~ubuntu-branches/debian/sid/filezilla/sid

« back to all changes in this revision

Viewing changes to src/interface/Mainfrm.h

  • Committer: Bazaar Package Importer
  • Author(s): Adrien Cunin
  • Date: 2009-11-15 17:15:41 UTC
  • mfrom: (1.3.5 upstream) (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091115171541-nvo6m3hl3iof0lnc
* New upstream release
* Updated previous changelog entry to mention desktop notifications as a new
  feature

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#ifndef __WXMAC__
5
5
#include <wx/taskbar.h>
6
6
#endif
 
7
#include <wx/aui/auibook.h>
7
8
 
8
9
class CStatusView;
9
10
class CQueueView;
27
28
class CStatusBar;
28
29
class CMainFrameStateEventHandler;
29
30
class CSplitterWindowEx;
 
31
class wxAuiNotebookEx;
30
32
 
31
33
class CMainFrame : public wxFrame
32
34
{
 
35
        friend class CMainFrameStateEventHandler;
33
36
public:
34
37
        CMainFrame();
35
38
        virtual ~CMainFrame();
37
40
        void UpdateActivityLed(int direction);
38
41
 
39
42
        void AddToRequestQueue(CFileZillaEngine* pEngine, CAsyncRequestNotification* pNotification);
40
 
        CState* GetState() { return m_pState; }
41
43
        CStatusView* GetStatusView() { return m_pStatusView; }
42
 
        CLocalListView* GetLocalListView() { return m_pLocalListView; }
43
 
        CRemoteListView* GetRemoteListView() { return m_pRemoteListView; }
 
44
        CLocalListView* GetLocalListView() { return m_context_controls[m_current_context_controls].pLocalListView; }
 
45
        CRemoteListView* GetRemoteListView() { return m_context_controls[m_current_context_controls].pRemoteListView; }
44
46
        CQueueView* GetQueue() { return m_pQueueView; }
45
47
        CQuickconnectBar* GetQuickconnectBar() { return m_pQuickconnectBar; }
46
48
 
63
65
        void ProcessCommandLine();
64
66
 
65
67
        void ClearBookmarks();
 
68
 
 
69
        void PostInitialize();
66
70
        
 
71
        bool Connect(const CServer& server, const CServerPath& path = CServerPath());
 
72
 
67
73
protected:
68
74
        bool CreateMenus();
69
75
        bool CreateQuickconnectBar();
73
79
        void OpenSiteManager(const CServer* pServer = 0);
74
80
        void InitToolbarState();
75
81
        void InitMenubarState();
 
82
        bool CloseTab(int tab);
 
83
        void CreateTab();
 
84
        void CreateContextControls(CState* pState);
76
85
 
77
86
        void FocusNextEnabled(std::list<wxWindow*>& windowOrder, std::list<wxWindow*>::iterator iter, bool skipFirst, bool forward);
78
87
 
 
88
        void SetBookmarksFromPath(const wxString& path);
79
89
        void UpdateBookmarkMenu();
80
90
 
 
91
        struct _context_controls
 
92
        {
 
93
                // List of all windows and controls assorted with a context
 
94
                CView* pLocalTreeViewPanel;
 
95
                CView* pLocalListViewPanel;
 
96
                CLocalTreeView* pLocalTreeView;
 
97
                CLocalListView* pLocalListView;
 
98
                CView* pRemoteTreeViewPanel;
 
99
                CView* pRemoteListViewPanel;
 
100
                CRemoteTreeView* pRemoteTreeView;
 
101
                CRemoteListView* pRemoteListView;
 
102
                CViewHeader* pLocalViewHeader;
 
103
                CViewHeader* pRemoteViewHeader;
 
104
        
 
105
                CSplitterWindowEx* pViewSplitter; // Contains local and remote splitters
 
106
                CSplitterWindowEx* pLocalSplitter;
 
107
                CSplitterWindowEx* pRemoteSplitter;
 
108
 
 
109
                CState* pState;
 
110
 
 
111
                wxString title;
 
112
 
 
113
                int tab_index;
 
114
 
 
115
                struct _site_bookmarks
 
116
                {
 
117
                        wxString path;
 
118
                        std::list<wxString> bookmarks;
 
119
                };
 
120
                CSharedPointer<struct _site_bookmarks> site_bookmarks;
 
121
        };
 
122
 
 
123
        std::vector<struct _context_controls> m_context_controls;
 
124
        size_t m_current_context_controls;
 
125
 
81
126
        std::list<int> m_bookmark_menu_ids;
82
127
        std::map<int, wxString> m_bookmark_menu_id_map_global;
83
128
        std::map<int, wxString> m_bookmark_menu_id_map_site;
84
 
        wxString m_last_bookmark_path;
85
 
        std::list<wxString> m_bookmarks;
86
129
 
87
130
        CStatusBar* m_pStatusBar;
88
131
        wxMenuBar* m_pMenuBar;
90
133
        CQuickconnectBar* m_pQuickconnectBar;
91
134
 
92
135
        CSplitterWindowEx* m_pTopSplitter; // If log position is 0, splits message log from rest of panes
93
 
        CSplitterWindowEx* m_pBottomSplitter; // Top contains view splitter, buttom queue (or queuelog splitter if in position 1)
94
 
        CSplitterWindowEx* m_pViewSplitter; // Contains local and remote splitters
95
 
        CSplitterWindowEx* m_pLocalSplitter;
96
 
        CSplitterWindowEx* m_pRemoteSplitter;
 
136
        CSplitterWindowEx* m_pBottomSplitter; // Top contains view splitter, bottom queue (or queuelog splitter if in position 1)
97
137
        CSplitterWindowEx* m_pQueueLogSplitter;
98
138
 
99
139
        CStatusView* m_pStatusView;
100
140
        CQueueView* m_pQueueView;
101
 
        CView* m_pLocalTreeViewPanel;
102
 
        CView* m_pLocalListViewPanel;
103
 
        CLocalTreeView* m_pLocalTreeView;
104
 
        CLocalListView* m_pLocalListView;
105
 
        CView* m_pRemoteTreeViewPanel;
106
 
        CView* m_pRemoteListViewPanel;
107
 
        CRemoteTreeView* m_pRemoteTreeView;
108
 
        CRemoteListView* m_pRemoteListView;
109
 
        CViewHeader* m_pLocalViewHeader;
110
 
        CViewHeader* m_pRemoteViewHeader;
111
141
        CLed* m_pActivityLed[2];
112
142
        wxTimer m_transferStatusTimer;
113
143
        CThemeProvider* m_pThemeProvider;
168
198
        void OnIconize(wxIconizeEvent& event);
169
199
        void OnTaskBarClick(wxTaskBarIconEvent& event);
170
200
#endif
 
201
#ifdef __WXGTK__
 
202
        void OnTaskBarClick_Delayed(wxCommandEvent& event);
 
203
#endif
171
204
        void OnSearch(wxCommandEvent& event);
 
205
        void OnMenuNewTab(wxCommandEvent& event);
 
206
        void OnMenuCloseTab(wxCommandEvent& event);
 
207
        void OnTabChanged(wxAuiNotebookEvent& event);
 
208
        void OnTabClosing(wxAuiNotebookEvent& event);
 
209
        void OnTabClosing_Deferred(wxCommandEvent& event);
 
210
        void OnTabBgDoubleclick(wxAuiNotebookEvent& event);
172
211
 
173
212
        bool m_bInitDone;
174
213
        bool m_bQuit;
176
215
        wxTimer m_closeEventTimer;
177
216
 
178
217
        CAsyncRequestQueue* m_pAsyncRequestQueue;
179
 
        CState* m_pState;
180
218
        CMainFrameStateEventHandler* m_pStateEventHandler;
181
219
 
182
220
        CWindowStateManager* m_pWindowStateManager;
186
224
#ifndef __WXMAC__
187
225
        wxTaskBarIcon* m_taskBarIcon;
188
226
#endif
 
227
#ifdef __WXGTK__
 
228
        // There is a bug in KDE, causing the window to toggle iconized state
 
229
        // several times a second after uniconizing it from taskbar icon.
 
230
        // Set m_taskbar_is_uniconizing in OnTaskBarClick and unset the
 
231
        // next time the pending event processing runs and calls OnTaskBarClick_Delayed.
 
232
        // While set, ignore iconize events.
 
233
        bool m_taskbar_is_uniconizing;
 
234
#endif
 
235
 
 
236
        wxAuiNotebookEx* m_tabs;
189
237
};
190
238
 
191
239
#endif