source: filezilla/trunk/fuentes/src/interface/queueview_successful.cpp @ 3185

Last change on this file since 3185 was 3185, checked in by jrpelegrina, 2 years ago

Update new version: 3.15.02

File size: 1.2 KB
Line 
1#include <filezilla.h>
2#include "queue.h"
3#include "queueview_successful.h"
4#include "Options.h"
5
6BEGIN_EVENT_TABLE(CQueueViewSuccessful, CQueueViewFailed)
7EVT_CONTEXT_MENU(CQueueViewSuccessful::OnContextMenu)
8EVT_MENU(XRCID("ID_AUTOCLEAR"), CQueueViewSuccessful::OnMenuAutoClear)
9END_EVENT_TABLE()
10
11CQueueViewSuccessful::CQueueViewSuccessful(CQueue* parent, int index)
12        : CQueueViewFailed(parent, index, _("Successful transfers"))
13{
14        std::list<ColumnId> extraCols;
15        extraCols.push_back(colTime);
16        CreateColumns(extraCols);
17
18        m_autoClear = COptions::Get()->GetOptionVal(OPTION_QUEUE_SUCCESSFUL_AUTOCLEAR) ? true : false;
19}
20
21void CQueueViewSuccessful::OnContextMenu(wxContextMenuEvent&)
22{
23        wxMenu* pMenu = wxXmlResource::Get()->LoadMenu(_T("ID_MENU_QUEUE_SUCCESSFUL"));
24        if (!pMenu)
25                return;
26
27        bool has_selection = HasSelection();
28
29        pMenu->Enable(XRCID("ID_REMOVE"), has_selection);
30        pMenu->Enable(XRCID("ID_REQUEUE"), has_selection);
31        pMenu->Enable(XRCID("ID_REQUEUEALL"), !m_serverList.empty());
32        pMenu->Check(XRCID("ID_AUTOCLEAR"), m_autoClear);
33
34        PopupMenu(pMenu);
35
36        delete pMenu;
37}
38
39void CQueueViewSuccessful::OnMenuAutoClear(wxCommandEvent&)
40{
41        m_autoClear = !m_autoClear;
42        COptions::Get()->SetOption(OPTION_QUEUE_SUCCESSFUL_AUTOCLEAR, m_autoClear ? true : false);
43}
Note: See TracBrowser for help on using the repository browser.