diff --git a/src/interface/Mainfrm.cpp b/src/interface/Mainfrm.cpp index 9f97a55..d1ead4a 100644 --- a/src/interface/Mainfrm.cpp +++ b/src/interface/Mainfrm.cpp @@ -89,11 +89,13 @@ BEGIN_EVENT_TABLE(CMainFrame, wxFrame) EVT_TIMER(wxID_ANY, CMainFrame::OnTimer) EVT_TOOL(XRCID("ID_TOOLBAR_PROCESSQUEUE"), CMainFrame::OnProcessQueue) EVT_TOOL(XRCID("ID_TOOLBAR_LOGVIEW"), CMainFrame::OnToggleLogView) + EVT_TOOL(XRCID("ID_TOOLBAR_LOCALVIEW"), CMainFrame::OnToggleLocalView) EVT_TOOL(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), CMainFrame::OnToggleLocalTreeView) EVT_TOOL(XRCID("ID_TOOLBAR_REMOTETREEVIEW"), CMainFrame::OnToggleRemoteTreeView) EVT_TOOL(XRCID("ID_TOOLBAR_QUEUEVIEW"), CMainFrame::OnToggleQueueView) EVT_MENU(XRCID("ID_VIEW_TOOLBAR"), CMainFrame::OnToggleToolBar) EVT_MENU(XRCID("ID_VIEW_MESSAGELOG"), CMainFrame::OnToggleLogView) + EVT_MENU(XRCID("ID_VIEW_LOCALVIEW"), CMainFrame::OnToggleLocalView) EVT_MENU(XRCID("ID_VIEW_LOCALTREE"), CMainFrame::OnToggleLocalTreeView) EVT_MENU(XRCID("ID_VIEW_REMOTETREE"), CMainFrame::OnToggleRemoteTreeView) EVT_MENU(XRCID("ID_VIEW_QUEUE"), CMainFrame::OnToggleQueueView) @@ -1586,6 +1588,67 @@ void CMainFrame::OnToggleLogView(wxCommandEvent& event) COptions::Get()->SetOption(OPTION_SHOW_MESSAGELOG, shown); } +void CMainFrame::OnToggleLocalView(wxCommandEvent& event) +{ + if (!m_pContextControl) + return; + + CContextControl::_context_controls* controls = m_pContextControl->GetCurrentControls(); + bool show = !controls || !controls->pViewSplitter->IsSplit(); + + if (!show) + { + for (int i = 0; i < m_pContextControl->GetTabCount(); i++) + { + CContextControl::_context_controls* controls = m_pContextControl->GetControlsFromTabIndex(i); + if (!controls) + continue; + + if (!controls->pViewSplitter->IsSplit()) + continue; + + controls->pViewSplitter->Unsplit(controls->pLocalSplitter); + } + } + else + ShowLocalView(); + + COptions::Get()->SetOption(OPTION_SHOW_VIEW_LOCAL, show); +} + +void CMainFrame::ShowLocalView() +{ + if (!m_pContextControl) + return; + + const int layout = COptions::Get()->GetOptionVal(OPTION_FILEPANE_LAYOUT); + const int swap = COptions::Get()->GetOptionVal(OPTION_FILEPANE_SWAP); + for (int i = 0; i < m_pContextControl->GetTabCount(); i++) + { + CContextControl::_context_controls* controls = m_pContextControl->GetControlsFromTabIndex(i); + if (!controls) + continue; + + if (controls->pViewSplitter->IsSplit()) + continue; + + if (layout == 1) + { + if (swap) + controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter); + else + controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter); + } + else + { + if (swap) + controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter); + else + controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter); + } + } +} + void CMainFrame::OnToggleLocalTreeView(wxCommandEvent& event) { if (!m_pContextControl) @@ -1878,19 +1941,22 @@ void CMainFrame::UpdateLayout(int layout /*=-1*/, int swap /*=-1*/, int messagel if (mode != isMode || swap != isSwap) { controls->pViewSplitter->Unsplit(); - if (mode == wxSPLIT_VERTICAL) - { - if (swap) - controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter); - else - controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter); - } - else + if (COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) { - if (swap) - controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter); + if (mode == wxSPLIT_VERTICAL) + { + if (swap) + controls->pViewSplitter->SplitVertically(controls->pRemoteSplitter, controls->pLocalSplitter); + else + controls->pViewSplitter->SplitVertically(controls->pLocalSplitter, controls->pRemoteSplitter); + } else - controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter); + { + if (swap) + controls->pViewSplitter->SplitHorizontally(controls->pRemoteSplitter, controls->pLocalSplitter); + else + controls->pViewSplitter->SplitHorizontally(controls->pLocalSplitter, controls->pRemoteSplitter); + } } } diff --git a/src/interface/Mainfrm.h b/src/interface/Mainfrm.h index 2124eea..8b12f16 100644 --- a/src/interface/Mainfrm.h +++ b/src/interface/Mainfrm.h @@ -92,6 +92,7 @@ protected: CUpdateWizard* m_pUpdateWizard; #endif //FZ_MANUALUPDATECHECK && FZ_AUTOUPDATECHECK + void ShowLocalView(); void ShowLocalTree(); void ShowRemoteTree(); @@ -119,6 +120,7 @@ protected: void OnMenuEditSettings(wxCommandEvent& event); void OnToggleToolBar(wxCommandEvent& event); void OnToggleLogView(wxCommandEvent& event); + void OnToggleLocalView(wxCommandEvent& event); void OnToggleLocalTreeView(wxCommandEvent& event); void OnToggleRemoteTreeView(wxCommandEvent& event); void OnToggleQueueView(wxCommandEvent& event); diff --git a/src/interface/Options.cpp b/src/interface/Options.cpp index 3fd791a..efe30a6 100644 --- a/src/interface/Options.cpp +++ b/src/interface/Options.cpp @@ -120,6 +120,7 @@ static const t_Option options[OPTIONS_NUM] = { "Allow ascii resume", number, _T("0"), normal }, { "Greeting version", string, _T(""), normal }, { "Onetime Dialogs", string, _T(""), normal }, + { "Show View Local", number, _T("1"), normal }, { "Show Tree Local", number, _T("1"), normal }, { "Show Tree Remote", number, _T("1"), normal }, { "File Pane Layout", number, _T("0"), normal }, diff --git a/src/interface/Options.h b/src/interface/Options.h index 1da1ef3..44ba9a2 100644 --- a/src/interface/Options.h +++ b/src/interface/Options.h @@ -25,6 +25,7 @@ enum interfaceOptions OPTION_ASCIIRESUME, OPTION_GREETINGVERSION, OPTION_ONETIME_DIALOGS, + OPTION_SHOW_VIEW_LOCAL, OPTION_SHOW_TREE_LOCAL, OPTION_SHOW_TREE_REMOTE, OPTION_FILEPANE_LAYOUT, diff --git a/src/interface/QueueView.cpp b/src/interface/QueueView.cpp index 908fc0b..9eb381b 100644 --- a/src/interface/QueueView.cpp +++ b/src/interface/QueueView.cpp @@ -128,6 +128,9 @@ public: CDragDropManager* pDragDropManager = CDragDropManager::Get(); if (pDragDropManager && !pDragDropManager->remoteParent.IsEmpty()) { + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + return wxDragNone; + // Drag from remote to queue, check if local path is writeable CState* const pState = CContextManager::Get()->GetCurrentContext(); if (!pState) diff --git a/src/interface/RemoteListView.cpp b/src/interface/RemoteListView.cpp index bc610a5..296a1c6 100644 --- a/src/interface/RemoteListView.cpp +++ b/src/interface/RemoteListView.cpp @@ -1271,6 +1271,13 @@ void CRemoteListView::OnItemActivated(wxListEvent &event) } else { + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + // Local View is not visible so return + wxBell(); + return; + } + wxCommandEvent evt(0, action == 1 ? XRCID("ID_DOWNLOAD") : XRCID("ID_ADDTOQUEUE")); OnMenuDownload(evt); } @@ -1293,6 +1300,13 @@ void CRemoteListView::OnItemActivated(wxListEvent &event) return; } + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + // Local View is not visible so return + wxBell(); + return; + } + const bool queue_only = action == 1; const CLocalPath local_path = m_pState->GetLocalDir(); @@ -1478,6 +1492,12 @@ void CRemoteListView::OnContextMenu(wxContextMenuEvent& event) } } + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + pMenu->Enable(XRCID("ID_DOWNLOAD"), false); + pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false); + } + PopupMenu(pMenu); delete pMenu; } diff --git a/src/interface/RemoteTreeView.cpp b/src/interface/RemoteTreeView.cpp index d1d9dee..3bed7e0 100644 --- a/src/interface/RemoteTreeView.cpp +++ b/src/interface/RemoteTreeView.cpp @@ -3,6 +3,7 @@ #include "commandqueue.h" #include #include "dndobjects.h" +#include "Options.h" #include "chmoddialog.h" #include "recursive_operation.h" #include "inputdialog.h" @@ -956,6 +957,12 @@ void CRemoteTreeView::OnContextMenu(wxTreeEvent& event) pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false); } + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + pMenu->Enable(XRCID("ID_DOWNLOAD"), false); + pMenu->Enable(XRCID("ID_ADDTOQUEUE"), false); + } + PopupMenu(pMenu); delete pMenu; } diff --git a/src/interface/commandqueue.cpp b/src/interface/commandqueue.cpp index 8098e95..fdac060 100644 --- a/src/interface/commandqueue.cpp +++ b/src/interface/commandqueue.cpp @@ -1,6 +1,7 @@ #include #include "commandqueue.h" #include "Mainfrm.h" +#include "Options.h" #include "state.h" #include "recursive_operation.h" #include "loginmanager.h" @@ -213,10 +214,13 @@ void CCommandQueue::Finish(COperationNotification *pNotification) { // Symbolic link does not point to a directory. Either points to file // or is completely invalid - CListCommand* pListCommand = (CListCommand*)pCommand; - wxASSERT(pListCommand->GetFlags() & LIST_FLAG_LINK); + 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 + { + CListCommand* pListCommand = (CListCommand*)pCommand; + wxASSERT(pListCommand->GetFlags() & LIST_FLAG_LINK); - m_pState->LinkIsNotDir(pListCommand->GetPath(), pListCommand->GetSubDir()); + m_pState->LinkIsNotDir(pListCommand->GetPath(), pListCommand->GetSubDir()); + } } else m_pState->ListingFailed(pNotification->nReplyCode); diff --git a/src/interface/context_control.cpp b/src/interface/context_control.cpp index cd16198..39e9e39 100644 --- a/src/interface/context_control.cpp +++ b/src/interface/context_control.cpp @@ -191,19 +191,27 @@ void CContextControl::CreateContextControls(CState* pState) const int layout = COptions::Get()->GetOptionVal(OPTION_FILEPANE_LAYOUT); const int swap = COptions::Get()->GetOptionVal(OPTION_FILEPANE_SWAP); - if (layout == 1) + if (COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) { - if (swap) - context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter); + if (layout == 1) + { + if (swap) + context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter); + else + context_controls.pViewSplitter->SplitHorizontally(context_controls.pLocalSplitter, context_controls.pRemoteSplitter); + } else - context_controls.pViewSplitter->SplitHorizontally(context_controls.pLocalSplitter, context_controls.pRemoteSplitter); + { + if (swap) + context_controls.pViewSplitter->SplitVertically(context_controls.pRemoteSplitter, context_controls.pLocalSplitter); + else + context_controls.pViewSplitter->SplitVertically(context_controls.pLocalSplitter, context_controls.pRemoteSplitter); + } } else { - if (swap) - context_controls.pViewSplitter->SplitVertically(context_controls.pRemoteSplitter, context_controls.pLocalSplitter); - else - context_controls.pViewSplitter->SplitVertically(context_controls.pLocalSplitter, context_controls.pRemoteSplitter); + context_controls.pViewSplitter->SplitHorizontally(context_controls.pRemoteSplitter, context_controls.pLocalSplitter); + context_controls.pViewSplitter->Unsplit(context_controls.pLocalSplitter); } context_controls.pLocalViewHeader = new CLocalViewHeader(context_controls.pLocalSplitter, pState); diff --git a/src/interface/menu_bar.cpp b/src/interface/menu_bar.cpp index d093909..79a862f 100644 --- a/src/interface/menu_bar.cpp +++ b/src/interface/menu_bar.cpp @@ -87,6 +87,7 @@ CMenuBar* CMenuBar::Load(CMainFrame* pMainFrame) menubar->Check(XRCID("ID_VIEW_TOOLBAR"), COptions::Get()->GetOptionVal(OPTION_TOOLBAR_HIDDEN) == 0); menubar->Check(XRCID("ID_VIEW_MESSAGELOG"), COptions::Get()->GetOptionVal(OPTION_SHOW_MESSAGELOG) != 0); menubar->Check(XRCID("ID_VIEW_QUEUE"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0); + menubar->Check(XRCID("ID_VIEW_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0); menubar->Check(XRCID("ID_VIEW_LOCALTREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0); menubar->Check(XRCID("ID_VIEW_REMOTETREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_REMOTE) != 0); menubar->Check(XRCID("ID_MENU_VIEW_FILELISTSTATUSBAR"), COptions::Get()->GetOptionVal(OPTION_FILELIST_STATUSBAR) != 0); @@ -126,6 +127,7 @@ CMenuBar* CMenuBar::Load(CMainFrame* pMainFrame) menubar->RegisterOption(OPTION_TOOLBAR_HIDDEN); menubar->RegisterOption(OPTION_SHOW_MESSAGELOG); menubar->RegisterOption(OPTION_SHOW_QUEUE); + menubar->RegisterOption(OPTION_SHOW_VIEW_LOCAL); menubar->RegisterOption(OPTION_SHOW_TREE_LOCAL); menubar->RegisterOption(OPTION_SHOW_TREE_REMOTE); menubar->RegisterOption(OPTION_MESSAGELOG_POSITION); @@ -275,7 +277,7 @@ void CMenuBar::OnMenuEvent(wxCommandEvent& event) else pState->ChangeRemoteDir(pData->m_remoteDir); } - if (!pData->m_localDir.empty()) + if (!pData->m_localDir.empty() && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) { bool set = pState->SetLocalDir(pData->m_localDir); @@ -316,7 +318,7 @@ void CMenuBar::OnMenuEvent(wxCommandEvent& event) pState->ChangeRemoteDir(remote_dir); } } - if (!local_dir.empty()) + if (!local_dir.empty() && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) { bool set = pState->SetLocalDir(local_dir); @@ -370,6 +372,8 @@ void CMenuBar::OnStateChange(CState* pState, enum t_statechange_notifications no void CMenuBar::OnOptionChanged(int option) { + CState* pState = CContextManager::Get()->GetCurrentContext(); + switch (option) { case OPTION_ASCIIBINARY: @@ -389,6 +393,31 @@ void CMenuBar::OnOptionChanged(int option) case OPTION_PRESERVE_TIMESTAMPS: Check(XRCID("ID_MENU_TRANSFER_PRESERVETIMES"), COptions::Get()->GetOptionVal(OPTION_PRESERVE_TIMESTAMPS) != 0); break; + case OPTION_SHOW_VIEW_LOCAL: + Check(XRCID("ID_VIEW_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0); + + if (pState) + { + const CServer* pServer = pState->GetServer(); + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + CComparisonManager* pComparisonManager = pState->GetComparisonManager(); + if (pComparisonManager->IsComparing()) + { + pComparisonManager->ExitComparisonMode(); + Check(XRCID("ID_TOOLBAR_COMPARISON"), false); + } + + if (pState->GetSyncBrowse()) + { + pState->SetSyncBrowse(!pState->GetSyncBrowse()); + Check(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), false); + } + } + Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + } + break; case OPTION_SHOW_TREE_LOCAL: Check(XRCID("ID_VIEW_LOCALTREE"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0); break; @@ -458,8 +487,8 @@ void CMenuBar::UpdateMenubarState() Enable(XRCID("ID_CANCEL"), pServer && !idle); Enable(XRCID("ID_MENU_SERVER_CMD"), pServer && idle); Enable(XRCID("ID_MENU_FILE_COPYSITEMANAGER"), pServer != 0); - Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0); - Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0); + Enable(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + Enable(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); Enable(XRCID("ID_MENU_SERVER_SEARCH"), pServer && idle); Check(XRCID("ID_TOOLBAR_COMPARISON"), pState->GetComparisonManager()->IsComparing()); diff --git a/src/interface/resources/menus.xrc b/src/interface/resources/menus.xrc index 605c99a..dc2a48d 100644 --- a/src/interface/resources/menus.xrc +++ b/src/interface/resources/menus.xrc @@ -110,6 +110,10 @@ 1 + + + 1 + 1 diff --git a/src/interface/resources/toolbar.xrc b/src/interface/resources/toolbar.xrc index 424f31b..9ae8023 100644 --- a/src/interface/resources/toolbar.xrc +++ b/src/interface/resources/toolbar.xrc @@ -16,6 +16,12 @@ 1 Toggles the display of the message log + + + Toggles the display of the local view + 1 + Toggles the display of the local view + Toggles the display of the local directory tree diff --git a/src/interface/state.cpp b/src/interface/state.cpp index fcd5bb6..99d6b6b 100644 --- a/src/interface/state.cpp +++ b/src/interface/state.cpp @@ -244,6 +244,9 @@ CLocalPath CState::GetLocalDir() const bool CState::SetLocalDir(const wxString& dir, wxString *error /*=0*/) { + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + return false; + if (m_sync_browse.is_changing) { wxMessageBox(_T("Cannot change directory, there already is a synchronized browsing operation in progress."), _("Synchronized browsing")); diff --git a/src/interface/toolbar.cpp b/src/interface/toolbar.cpp index de65ae0..962a9b0 100644 --- a/src/interface/toolbar.cpp +++ b/src/interface/toolbar.cpp @@ -54,6 +54,7 @@ CToolBar* CToolBar::Load(CMainFrame* pMainFrame) toolbar->RegisterOption(OPTION_SHOW_MESSAGELOG); toolbar->RegisterOption(OPTION_SHOW_QUEUE); + toolbar->RegisterOption(OPTION_SHOW_VIEW_LOCAL); toolbar->RegisterOption(OPTION_SHOW_TREE_LOCAL); toolbar->RegisterOption(OPTION_SHOW_TREE_REMOTE); toolbar->RegisterOption(OPTION_MESSAGELOG_POSITION); @@ -72,6 +73,7 @@ CToolBar* CToolBar::Load(CMainFrame* pMainFrame) toolbar->ToggleTool(XRCID("ID_TOOLBAR_FILTER"), CFilterManager::HasActiveFilters()); toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOGVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_MESSAGELOG) != 0); toolbar->ToggleTool(XRCID("ID_TOOLBAR_QUEUEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0); + toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0); toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0); toolbar->ToggleTool(XRCID("ID_TOOLBAR_REMOTETREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_REMOTE) != 0); @@ -133,8 +135,8 @@ void CToolBar::UpdateToolbarState() EnableTool(XRCID("ID_TOOLBAR_DISCONNECT"), pServer && idle); EnableTool(XRCID("ID_TOOLBAR_CANCEL"), pServer && !idle); - EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0); - EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0); + EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); EnableTool(XRCID("ID_TOOLBAR_FIND"), pServer && idle); ToggleTool(XRCID("ID_TOOLBAR_COMPARISON"), pState->GetComparisonManager()->IsComparing()); @@ -153,6 +155,8 @@ void CToolBar::UpdateToolbarState() void CToolBar::OnOptionChanged(int option) { + CState* pState = CContextManager::Get()->GetCurrentContext(); + switch (option) { case OPTION_SHOW_MESSAGELOG: @@ -161,6 +165,31 @@ void CToolBar::OnOptionChanged(int option) case OPTION_SHOW_QUEUE: ToggleTool(XRCID("ID_TOOLBAR_QUEUEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0); break; + case OPTION_SHOW_VIEW_LOCAL: + ToggleTool(XRCID("ID_TOOLBAR_LOCALVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL) != 0); + + if (pState) + { + const CServer* pServer = pState->GetServer(); + if (!COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)) + { + CComparisonManager* pComparisonManager = pState->GetComparisonManager(); + if (pComparisonManager->IsComparing()) + { + pComparisonManager->ExitComparisonMode(); + ToggleTool(XRCID("ID_TOOLBAR_COMPARISON"), false); + } + + if (pState->GetSyncBrowse()) + { + pState->SetSyncBrowse(!pState->GetSyncBrowse()); + ToggleTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), false); + } + } + EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0 && COptions::Get()->GetOptionVal(OPTION_SHOW_VIEW_LOCAL)); + } + break; case OPTION_SHOW_TREE_LOCAL: ToggleTool(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0); break;