Ticket #8411: filezilla-3.5.3_Option_Hide_Local_View01a.diff.txt

File filezilla-3.5.3_Option_Hide_Local_View01a.diff.txt, 21.1 KB (added by Camo Mike, 8 years ago)
Line 
1diff --git a/src/interface/Mainfrm.cpp b/src/interface/Mainfrm.cpp
2index 9f97a55..d1ead4a 100644
3--- a/src/interface/Mainfrm.cpp
4+++ b/src/interface/Mainfrm.cpp
5@@ -89,11 +89,13 @@ BEGIN_EVENT_TABLE(CMainFrame, wxFrame)
6 EVT_TIMER(wxID_ANY, CMainFrame::OnTimer)
7 EVT_TOOL(XRCID("ID_TOOLBAR_PROCESSQUEUE"), CMainFrame::OnProcessQueue)
8 EVT_TOOL(XRCID("ID_TOOLBAR_LOGVIEW"), CMainFrame::OnToggleLogView)
9+ EVT_TOOL(XRCID("ID_TOOLBAR_LOCALVIEW"), CMainFrame::OnToggleLocalView)
10 EVT_TOOL(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), CMainFrame::OnToggleLocalTreeView)
11 EVT_TOOL(XRCID("ID_TOOLBAR_REMOTETREEVIEW"), CMainFrame::OnToggleRemoteTreeView)
12 EVT_TOOL(XRCID("ID_TOOLBAR_QUEUEVIEW"), CMainFrame::OnToggleQueueView)
13 EVT_MENU(XRCID("ID_VIEW_TOOLBAR"), CMainFrame::OnToggleToolBar)
14 EVT_MENU(XRCID("ID_VIEW_MESSAGELOG"), CMainFrame::OnToggleLogView)
15+ EVT_MENU(XRCID("ID_VIEW_LOCALVIEW"), CMainFrame::OnToggleLocalView)
16 EVT_MENU(XRCID("ID_VIEW_LOCALTREE"), CMainFrame::OnToggleLocalTreeView)
17 EVT_MENU(XRCID("ID_VIEW_REMOTETREE"), CMainFrame::OnToggleRemoteTreeView)
18 EVT_MENU(XRCID("ID_VIEW_QUEUE"), CMainFrame::OnToggleQueueView)
19@@ -1586,6 +1588,67 @@ void CMainFrame::OnToggleLogView(wxCommandEvent& event)
20 COptions::Get()->SetOption(OPTION_SHOW_MESSAGELOG, shown);
21 }
22
23+void CMainFrame::OnToggleLocalView(wxCommandEvent& event)
24+{
25+ if (!m_pContextControl)
26+ return;
27+
28+ CContextControl::_context_controls* controls = m_pContextControl->GetCurrentControls();
29+ bool show = !controls || !controls->pViewSplitter->IsSplit();
30+
31+ if (!show)
32+ {
33+ for (int i = 0; i < m_pContextControl->GetTabCount(); i++)
34+ {
35+ CContextControl::_context_controls* controls = m_pContextControl->GetControlsFromTabIndex(i);
36+ if (!controls)
37+ continue;
38+
39+ if (!controls->pViewSplitter->IsSplit())
40+ continue;
41+
42+ controls->pViewSplitter->Unsplit(controls->pLocalSplitter);
43+ }
44+ }
45+ else
46+ ShowLocalView();
47+
48+ COptions::Get()->SetOption(OPTION_SHOW_VIEW_LOCAL, show);
49+}
50+
51+void CMainFrame::ShowLocalView()
52+{
53+ if (!m_pContextControl)
54+ return;
55+
56+ const int layout = COptions::Get()->GetOptionVal(OPTION_FILEPANE_LAYOUT);
57+ const int swap = COptions::Get()->GetOptionVal(OPTION_FILEPANE_SWAP);
58+ for (int i = 0; i < m_pContextControl->GetTabCount(); i++)
59+ {
60+ CContextControl::_context_controls* controls = m_pContextControl->GetControlsFromTabIndex(i);
61+ if (!controls)
62+ continue;
63+
64+ if (controls->pViewSplitter->IsSplit())
65+ continue;
66+
67+ if (layout == 1)
68+ {
69+ if (swap)
70+ controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter);
71+ else
72+ controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter);
73+ }
74+ else
75+ {
76+ if (swap)
77+ controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter);
78+ else
79+ controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter);
80+ }
81+ }
82+}
83+
84 void CMainFrame::OnToggleLocalTreeView(wxCommandEvent& event)
85 {
86 if (!m_pContextControl)
87@@ -1878,19 +1941,22 @@ void CMainFrame::UpdateLayout(int layout /*=-1*/, int swap /*=-1*/, int messagel
88 if (mode != isMode || swap != isSwap)
89 {
90 controls->pViewSplitter->Unsplit();
91- if (mode == wxSPLIT_VERTICAL)
92- {
93- if (swap)
94- controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter);
95- else
96- controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter);
97- }
98- else
99+ if (COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
100 {
101- if (swap)
102- controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter);
103+ if (mode == wxSPLIT_VERTICAL)
104+ {
105+ if (swap)
106+ controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter);
107+ else
108+ controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter);
109+ }
110 else
111- controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter);
112+ {
113+ if (swap)
114+ controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter);
115+ else
116+ controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter);
117+ }
118 }
119 }
120
121diff --git a/src/interface/Mainfrm.h b/src/interface/Mainfrm.h
122index 2124eea..8b12f16 100644
123--- a/src/interface/Mainfrm.h
124+++ b/src/interface/Mainfrm.h
125@@ -92,6 +92,7 @@ protected:
126 CUpdateWizard* m_pUpdateWizard;
127 #endif //FZ_MANUALUPDATECHECK && FZ_AUTOUPDATECHECK
128
129+ void ShowLocalView();
130 void ShowLocalTree();
131 void ShowRemoteTree();
132
133@@ -119,6 +120,7 @@ protected:
134 void OnMenuEditSettings(wxCommandEvent& event);
135 void OnToggleToolBar(wxCommandEvent& event);
136 void OnToggleLogView(wxCommandEvent& event);
137+ void OnToggleLocalView(wxCommandEvent& event);
138 void OnToggleLocalTreeView(wxCommandEvent& event);
139 void OnToggleRemoteTreeView(wxCommandEvent& event);
140 void OnToggleQueueView(wxCommandEvent& event);
141diff --git a/src/interface/Options.cpp b/src/interface/Options.cpp
142index 3fd791a..efe30a6 100644
143--- a/src/interface/Options.cpp
144+++ b/src/interface/Options.cpp
145@@ -120,6 +120,7 @@ static const t_Option options[OPTIONS_NUM] =
146 { "Allow ascii resume", number, _T("0"), normal },
147 { "Greeting version", string, _T(""), normal },
148 { "Onetime Dialogs", string, _T(""), normal },
149+ { "Show View Local", number, _T("1"), normal },
150 { "Show Tree Local", number, _T("1"), normal },
151 { "Show Tree Remote", number, _T("1"), normal },
152 { "File Pane Layout", number, _T("0"), normal },
153diff --git a/src/interface/Options.h b/src/interface/Options.h
154index 1da1ef3..44ba9a2 100644
155--- a/src/interface/Options.h
156+++ b/src/interface/Options.h
157@@ -25,6 +25,7 @@ enum interfaceOptions
158 OPTION_ASCIIRESUME,
159 OPTION_GREETINGVERSION,
160 OPTION_ONETIME_DIALOGS,
161+ OPTION_SHOW_VIEW_LOCAL,
162 OPTION_SHOW_TREE_LOCAL,
163 OPTION_SHOW_TREE_REMOTE,
164 OPTION_FILEPANE_LAYOUT,
165diff --git a/src/interface/QueueView.cpp b/src/interface/QueueView.cpp
166index 908fc0b..9eb381b 100644
167--- a/src/interface/QueueView.cpp
168+++ b/src/interface/QueueView.cpp
169@@ -128,6 +128,9 @@ public:
170 CDragDropManager* pDragDropManager = CDragDropManager::Get();
171 if (pDragDropManager && !pDragDropManager->remoteParent.IsEmpty())
172 {
173+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
174+ return wxDragNone;
175+
176 // Drag from remote to queue, check if local path is writeable
177 CState* const pState = CContextManager::Get()->GetCurrentContext();
178 if (!pState)
179diff --git a/src/interface/RemoteListView.cpp b/src/interface/RemoteListView.cpp
180index bc610a5..296a1c6 100644
181--- a/src/interface/RemoteListView.cpp
182+++ b/src/interface/RemoteListView.cpp
183@@ -1271,6 +1271,13 @@ void CRemoteListView::OnItemActivated(wxListEvent &event)
184 }
185 else
186 {
187+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
188+ {
189+ // Local View is not visible so return
190+ wxBell();
191+ return;
192+ }
193+
194 wxCommandEvent evt(0, action == 1 ? XRCID("ID_DOWNLOAD") : XRCID("ID_ADDTOQUEUE"));
195 OnMenuDownload(evt);
196 }
197@@ -1293,6 +1300,13 @@ void CRemoteListView::OnItemActivated(wxListEvent &event)
198 return;
199 }
200
201+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
202+ {
203+ // Local View is not visible so return
204+ wxBell();
205+ return;
206+ }
207+
208 const bool queue_only = action == 1;
209
210 const CLocalPath local_path = m_pState->GetLocalDir();
211@@ -1478,6 +1492,12 @@ void CRemoteListView::OnContextMenu(wxContextMenuEvent& event)
212 }
213 }
214
215+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
216+ {
217+ pMenu->Enable(XRCID("ID_DOWNLOAD"), false);
218+ pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false);
219+ }
220+
221 PopupMenu(pMenu);
222 delete pMenu;
223 }
224diff --git a/src/interface/RemoteTreeView.cpp b/src/interface/RemoteTreeView.cpp
225index d1d9dee..3bed7e0 100644
226--- a/src/interface/RemoteTreeView.cpp
227+++ b/src/interface/RemoteTreeView.cpp
228@@ -3,6 +3,7 @@
229 #include "commandqueue.h"
230 #include <wx/dnd.h>
231 #include "dndobjects.h"
232+#include "Options.h"
233 #include "chmoddialog.h"
234 #include "recursive_operation.h"
235 #include "inputdialog.h"
236@@ -956,6 +957,12 @@ void CRemoteTreeView::OnContextMenu(wxTreeEvent& event)
237 pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false);
238 }
239
240+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
241+ {
242+ pMenu->Enable(XRCID("ID_DOWNLOAD"), false);
243+ pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false);
244+ }
245+
246 PopupMenu(pMenu);
247 delete pMenu;
248 }
249diff --git a/src/interface/commandqueue.cpp b/src/interface/commandqueue.cpp
250index 8098e95..fdac060 100644
251--- a/src/interface/commandqueue.cpp
252+++ b/src/interface/commandqueue.cpp
253@@ -1,6 +1,7 @@
254 #include <filezilla.h>
255 #include "commandqueue.h"
256 #include "Mainfrm.h"
257+#include "Options.h"
258 #include "state.h"
259 #include "recursive_operation.h"
260 #include "loginmanager.h"
261@@ -213,10 +214,13 @@ void CCommandQueue::Finish(COperationNotification *pNotification)
262 {
263 // Symbolic link does not point to a directory. Either points to file
264 // or is completely invalid
265- CListCommand* pListCommand = (CListCommand*)pCommand;
266- wxASSERT(pListCommand->GetFlags() & LIST_FLAG_LINK);
267+ if (COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) || m_pState->GetRecursiveOperationHandler()->GetOperationMode() != CRecursiveOperation::OperationMode::recursive_none) //recursive_none is set for doubleclick but not for drag and drop, this allows drag and drop to succeed
268+ {
269+ CListCommand* pListCommand = (CListCommand*)pCommand;
270+ wxASSERT(pListCommand->GetFlags() & LIST_FLAG_LINK);
271
272- m_pState->LinkIsNotDir(pListCommand->GetPath(), pListCommand->GetSubDir());
273+ m_pState->LinkIsNotDir(pListCommand->GetPath(), pListCommand->GetSubDir());
274+ }
275 }
276 else
277 m_pState->ListingFailed(pNotification->nReplyCode);
278diff --git a/src/interface/context_control.cpp b/src/interface/context_control.cpp
279index cd16198..39e9e39 100644
280--- a/src/interface/context_control.cpp
281+++ b/src/interface/context_control.cpp
282@@ -191,19 +191,27 @@ void CContextControl::CreateContextControls(CState* pState)
283 const int layout = COptions::Get()->GetOptionVal(OPTION_FILEPANE_LAYOUT);
284 const int swap = COptions::Get()->GetOptionVal(OPTION_FILEPANE_SWAP);
285
286- if (layout == 1)
287+ if (COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
288 {
289- if (swap)
290- context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter);
291+ if (layout == 1)
292+ {
293+ if (swap)
294+ context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter);
295+ else
296+ context_controls.pViewSplitter->SplitHorizontally(context_controls.pLocalSplitter, context_controls.pRemoteSplitter);
297+ }
298 else
299- context_controls.pViewSplitter->SplitHorizontally(context_controls.pLocalSplitter, context_controls.pRemoteSplitter);
300+ {
301+ if (swap)
302+ context_controls.pViewSplitter->SplitVertically(context_controls.pRemoteSplitter, context_controls.pLocalSplitter);
303+ else
304+ context_controls.pViewSplitter->SplitVertically(context_controls.pLocalSplitter, context_controls.pRemoteSplitter);
305+ }
306 }
307 else
308 {
309- if (swap)
310- context_controls.pViewSplitter->SplitVertically(context_controls.pRemoteSplitter, context_controls.pLocalSplitter);
311- else
312- context_controls.pViewSplitter->SplitVertically(context_controls.pLocalSplitter, context_controls.pRemoteSplitter);
313+ context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter);
314+ context_controls.pViewSplitter->Unsplit(context_controls.pLocalSplitter);
315 }
316
317 context_controls.pLocalViewHeader = new CLocalViewHeader(context_controls.pLocalSplitter, pState);
318diff --git a/src/interface/menu_bar.cpp b/src/interface/menu_bar.cpp
319index d093909..79a862f 100644
320--- a/src/interface/menu_bar.cpp
321+++ b/src/interface/menu_bar.cpp
322@@ -87,6 +87,7 @@ CMenuBar* CMenuBar::Load(CMainFrame* pMainFrame)
323 menubar->Check(XRCID("ID_VIEW_TOOLBAR"), COptions::Get()->GetOptionVal(OPTION_TOOLBAR_HIDDEN) == 0);
324 menubar->Check(XRCID("ID_VIEW_MESSAGELOG"), COptions::Get()->GetOptionVal(OPTION_SHOW_MESSAGELOG) != 0);
325 menubar->Check(XRCID("ID_VIEW_QUEUE"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0);
326+ menubar->Check(XRCID("ID_VIEW_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0);
327 menubar->Check(XRCID("ID_VIEW_LOCALTREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0);
328 menubar->Check(XRCID("ID_VIEW_REMOTETREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_REMOTE) != 0);
329 menubar->Check(XRCID("ID_MENU_VIEW_FILELISTSTATUSBAR"), COptions::Get()->GetOptionVal(OPTION_FILELIST_STATUSBAR) != 0);
330@@ -126,6 +127,7 @@ CMenuBar* CMenuBar::Load(CMainFrame* pMainFrame)
331 menubar->RegisterOption(OPTION_TOOLBAR_HIDDEN);
332 menubar->RegisterOption(OPTION_SHOW_MESSAGELOG);
333 menubar->RegisterOption(OPTION_SHOW_QUEUE);
334+ menubar->RegisterOption(OPTION_SHOW_VIEW_LOCAL);
335 menubar->RegisterOption(OPTION_SHOW_TREE_LOCAL);
336 menubar->RegisterOption(OPTION_SHOW_TREE_REMOTE);
337 menubar->RegisterOption(OPTION_MESSAGELOG_POSITION);
338@@ -275,7 +277,7 @@ void CMenuBar::OnMenuEvent(wxCommandEvent& event)
339 else
340 pState->ChangeRemoteDir(pData->m_remoteDir);
341 }
342- if (!pData->m_localDir.empty())
343+ if (!pData->m_localDir.empty() && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
344 {
345 bool set = pState->SetLocalDir(pData->m_localDir);
346
347@@ -316,7 +318,7 @@ void CMenuBar::OnMenuEvent(wxCommandEvent& event)
348 pState->ChangeRemoteDir(remote_dir);
349 }
350 }
351- if (!local_dir.empty())
352+ if (!local_dir.empty() && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
353 {
354 bool set = pState->SetLocalDir(local_dir);
355
356@@ -370,6 +372,8 @@ void CMenuBar::OnStateChange(CState* pState, enum t_statechange_notifications no
357
358 void CMenuBar::OnOptionChanged(int option)
359 {
360+ CState* pState = CContextManager::Get()->GetCurrentContext();
361+
362 switch (option)
363 {
364 case OPTION_ASCIIBINARY:
365@@ -389,6 +393,31 @@ void CMenuBar::OnOptionChanged(int option)
366 case OPTION_PRESERVE_TIMESTAMPS:
367 Check(XRCID("ID_MENU_TRANSFER_PRESERVETIMES"), COptions::Get()->GetOptionVal(OPTION_PRESERVE_TIMESTAMPS) != 0);
368 break;
369+ case OPTION_SHOW_VIEW_LOCAL:
370+ Check(XRCID("ID_VIEW_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0);
371+
372+ if (pState)
373+ {
374+ const CServer* pServer = pState->GetServer();
375+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
376+ {
377+ CComparisonManager* pComparisonManager = pState->GetComparisonManager();
378+ if (pComparisonManager->IsComparing())
379+ {
380+ pComparisonManager->ExitComparisonMode();
381+ Check(XRCID("ID_TOOLBAR_COMPARISON"), false);
382+ }
383+
384+ if (pState->GetSyncBrowse())
385+ {
386+ pState->SetSyncBrowse(!pState->GetSyncBrowse());
387+ Check(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), false);
388+ }
389+ }
390+ Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
391+ Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
392+ }
393+ break;
394 case OPTION_SHOW_TREE_LOCAL:
395 Check(XRCID("ID_VIEW_LOCALTREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0);
396 break;
397@@ -458,8 +487,8 @@ void CMenuBar::UpdateMenubarState()
398 Enable(XRCID("ID_CANCEL"), pServer && !idle);
399 Enable(XRCID("ID_MENU_SERVER_CMD"), pServer && idle);
400 Enable(XRCID("ID_MENU_FILE_COPYSITEMANAGER"), pServer != 0);
401- Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0);
402- Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0);
403+ Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
404+ Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
405 Enable(XRCID("ID_MENU_SERVER_SEARCH"), pServer && idle);
406
407 Check(XRCID("ID_TOOLBAR_COMPARISON"), pState->GetComparisonManager()->IsComparing());
408diff --git a/src/interface/resources/menus.xrc b/src/interface/resources/menus.xrc
409index 605c99a..dc2a48d 100644
410--- a/src/interface/resources/menus.xrc
411+++ b/src/interface/resources/menus.xrc
412@@ -110,6 +110,10 @@
413 <label>&amp;Message log</label>
414 <checkable>1</checkable>
415 </object>
416+ <object class="wxMenuItem" name="ID_VIEW_LOCALVIEW">
417+ <label>Local &amp;view</label>
418+ <checkable>1</checkable>
419+ </object>
420 <object class="wxMenuItem" name="ID_VIEW_LOCALTREE">
421 <label>&amp;Local directory tree</label>
422 <checkable>1</checkable>
423diff --git a/src/interface/resources/toolbar.xrc b/src/interface/resources/toolbar.xrc
424index 424f31b..9ae8023 100644
425--- a/src/interface/resources/toolbar.xrc
426+++ b/src/interface/resources/toolbar.xrc
427@@ -16,6 +16,12 @@
428 <toggle>1</toggle>
429 <tooltip>Toggles the display of the message log</tooltip>
430 </object>
431+ <object class="tool" name="ID_TOOLBAR_LOCALVIEW">
432+ <bitmap stock_id="ART_LOCALTREEVIEW"></bitmap>
433+ <longhelp>Toggles the display of the local view</longhelp>
434+ <toggle>1</toggle>
435+ <tooltip>Toggles the display of the local view</tooltip>
436+ </object>
437 <object class="tool" name="ID_TOOLBAR_LOCALTREEVIEW">
438 <bitmap stock_id="ART_LOCALTREEVIEW"></bitmap>
439 <longhelp>Toggles the display of the local directory tree</longhelp>
440diff --git a/src/interface/state.cpp b/src/interface/state.cpp
441index fcd5bb6..99d6b6b 100644
442--- a/src/interface/state.cpp
443+++ b/src/interface/state.cpp
444@@ -244,6 +244,9 @@ CLocalPath CState::GetLocalDir() const
445
446 bool CState::SetLocalDir(const wxString& dir, wxString *error /*=0*/)
447 {
448+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
449+ return false;
450+
451 if (m_sync_browse.is_changing)
452 {
453 wxMessageBox(_T("Cannot change directory, there already is a synchronized browsing operation in progress."), _("Synchronized browsing"));
454diff --git a/src/interface/toolbar.cpp b/src/interface/toolbar.cpp
455index de65ae0..962a9b0 100644
456--- a/src/interface/toolbar.cpp
457+++ b/src/interface/toolbar.cpp
458@@ -54,6 +54,7 @@ CToolBar* CToolBar::Load(CMainFrame* pMainFrame)
459
460 toolbar->RegisterOption(OPTION_SHOW_MESSAGELOG);
461 toolbar->RegisterOption(OPTION_SHOW_QUEUE);
462+ toolbar->RegisterOption(OPTION_SHOW_VIEW_LOCAL);
463 toolbar->RegisterOption(OPTION_SHOW_TREE_LOCAL);
464 toolbar->RegisterOption(OPTION_SHOW_TREE_REMOTE);
465 toolbar->RegisterOption(OPTION_MESSAGELOG_POSITION);
466@@ -72,6 +73,7 @@ CToolBar* CToolBar::Load(CMainFrame* pMainFrame)
467 toolbar->ToggleTool(XRCID("ID_TOOLBAR_FILTER"), CFilterManager::HasActiveFilters());
468 toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOGVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_MESSAGELOG) != 0);
469 toolbar->ToggleTool(XRCID("ID_TOOLBAR_QUEUEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0);
470+ toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0);
471 toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0);
472 toolbar->ToggleTool(XRCID("ID_TOOLBAR_REMOTETREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_REMOTE) != 0);
473
474@@ -133,8 +135,8 @@ void CToolBar::UpdateToolbarState()
475
476 EnableTool(XRCID("ID_TOOLBAR_DISCONNECT"), pServer && idle);
477 EnableTool(XRCID("ID_TOOLBAR_CANCEL"), pServer && !idle);
478- EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0);
479- EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0);
480+ EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
481+ EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
482 EnableTool(XRCID("ID_TOOLBAR_FIND"), pServer && idle);
483
484 ToggleTool(XRCID("ID_TOOLBAR_COMPARISON"), pState->GetComparisonManager()->IsComparing());
485@@ -153,6 +155,8 @@ void CToolBar::UpdateToolbarState()
486
487 void CToolBar::OnOptionChanged(int option)
488 {
489+ CState* pState = CContextManager::Get()->GetCurrentContext();
490+
491 switch (option)
492 {
493 case OPTION_SHOW_MESSAGELOG:
494@@ -161,6 +165,31 @@ void CToolBar::OnOptionChanged(int option)
495 case OPTION_SHOW_QUEUE:
496 ToggleTool(XRCID("ID_TOOLBAR_QUEUEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0);
497 break;
498+ case OPTION_SHOW_VIEW_LOCAL:
499+ ToggleTool(XRCID("ID_TOOLBAR_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0);
500+
501+ if (pState)
502+ {
503+ const CServer* pServer = pState->GetServer();
504+ if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL))
505+ {
506+ CComparisonManager* pComparisonManager = pState->GetComparisonManager();
507+ if (pComparisonManager->IsComparing())
508+ {
509+ pComparisonManager->ExitComparisonMode();
510+ ToggleTool(XRCID("ID_TOOLBAR_COMPARISON"), false);
511+ }
512+
513+ if (pState->GetSyncBrowse())
514+ {
515+ pState->SetSyncBrowse(!pState->GetSyncBrowse());
516+ ToggleTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), false);
517+ }
518+ }
519+ EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
520+ EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL));
521+ }
522+ break;
523 case OPTION_SHOW_TREE_LOCAL:
524 ToggleTool(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0);
525 break;