Selaa lähdekoodia

Persisting other local panel layout and path

Source commit: e5c9faaa67268df2ea0890ad6fd7a132e9652943
Martin Prikryl 5 vuotta sitten
vanhempi
sitoutus
65a6145ff4

+ 4 - 5
source/forms/ScpCommander.cpp

@@ -190,9 +190,9 @@ void __fastcall TScpCommanderForm::RestoreParams()
   SessionsPageControl->Visible = WinConfiguration->ScpCommander.SessionsTabs;
   SessionsPageControl->Visible = WinConfiguration->ScpCommander.SessionsTabs;
   StatusBar->Visible = WinConfiguration->ScpCommander.StatusBar;
   StatusBar->Visible = WinConfiguration->ScpCommander.StatusBar;
 
 
-  // TODO_OTHER_LOCAL
   RestorePanelParams(LocalDirView, LocalDriveView, LocalStatusBar, WinConfiguration->ScpCommander.LocalPanel);
   RestorePanelParams(LocalDirView, LocalDriveView, LocalStatusBar, WinConfiguration->ScpCommander.LocalPanel);
   RestorePanelParams(RemoteDirView, RemoteDrivePanel, RemoteStatusBar, WinConfiguration->ScpCommander.RemotePanel);
   RestorePanelParams(RemoteDirView, RemoteDrivePanel, RemoteStatusBar, WinConfiguration->ScpCommander.RemotePanel);
+  OtherLocalDirView->ColProperties->ParamsStr = WinConfiguration->ScpCommander.OtherLocalPanelDirViewParams;
   FPanelsRestored = true;
   FPanelsRestored = true;
 
 
   // just to make sure
   // just to make sure
@@ -238,12 +238,12 @@ void __fastcall TScpCommanderForm::StoreParams()
 
 
     CommanderConfiguration.CurrentPanel = FCurrentSide;
     CommanderConfiguration.CurrentPanel = FCurrentSide;
 
 
-    // TODO_OTHER_LOCAL
     StorePanelParams(LocalDirView, LocalDriveView, LocalStatusBar, CommanderConfiguration.LocalPanel);
     StorePanelParams(LocalDirView, LocalDriveView, LocalStatusBar, CommanderConfiguration.LocalPanel);
     StorePanelParams(RemoteDirView, RemoteDrivePanel, RemoteStatusBar, CommanderConfiguration.RemotePanel);
     StorePanelParams(RemoteDirView, RemoteDrivePanel, RemoteStatusBar, CommanderConfiguration.RemotePanel);
+    CommanderConfiguration.OtherLocalPanelDirViewParams = OtherLocalDirView->ColProperties->ParamsStr;
 
 
-    // TODO_OTHER_LOCAL
     CommanderConfiguration.LocalPanel.LastPath = LocalDirView->Path;
     CommanderConfiguration.LocalPanel.LastPath = LocalDirView->Path;
+    CommanderConfiguration.OtherLocalPanelLastPath = OtherLocalDirView->Path;
 
 
     CommanderConfiguration.WindowParams = StoreForm(this);
     CommanderConfiguration.WindowParams = StoreForm(this);
 
 
@@ -377,8 +377,7 @@ void __fastcall TScpCommanderForm::DoShow()
   // is finally connected
   // is finally connected
   UpdateControls();
   UpdateControls();
 
 
-  // TODO_OTHER_LOCAL (persistent "other" local path)
-  DoLocalDefaultDirectory(OtherLocalDirView, UnicodeString());
+  DoLocalDefaultDirectory(OtherLocalDirView, WinConfiguration->ScpCommander.OtherLocalPanelLastPath);
 
 
   // If we do not call SetFocus on any control before DoShow,
   // If we do not call SetFocus on any control before DoShow,
   // no control will get focused on Login dialog
   // no control will get focused on Login dialog

+ 6 - 0
source/windows/WinConfiguration.cpp

@@ -760,6 +760,8 @@ void __fastcall TWinConfiguration::Default()
   FScpCommander.LocalPanel.DriveViewWidth = 100;
   FScpCommander.LocalPanel.DriveViewWidth = 100;
   FScpCommander.LocalPanel.DriveViewWidthPixelsPerInch = USER_DEFAULT_SCREEN_DPI;
   FScpCommander.LocalPanel.DriveViewWidthPixelsPerInch = USER_DEFAULT_SCREEN_DPI;
   FScpCommander.LocalPanel.LastPath = UnicodeString();
   FScpCommander.LocalPanel.LastPath = UnicodeString();
+  FScpCommander.OtherLocalPanelDirViewParams = FScpCommander.LocalPanel.DirViewParams;
+  FScpCommander.OtherLocalPanelLastPath = UnicodeString();
 
 
   FBookmarks->Clear();
   FBookmarks->Clear();
 }
 }
@@ -1150,6 +1152,10 @@ THierarchicalStorage * TWinConfiguration::CreateScpStorage(bool & SessionList)
     KEY(Integer, ScpCommander.RemotePanel.DriveViewWidthPixelsPerInch); \
     KEY(Integer, ScpCommander.RemotePanel.DriveViewWidthPixelsPerInch); \
     KEY(String,  ScpCommander.RemotePanel.LastPath); \
     KEY(String,  ScpCommander.RemotePanel.LastPath); \
   ); \
   ); \
+  BLOCK(L"Interface\\Commander\\OtherLocalPanel", CANCREATE, \
+    KEYEX(String, ScpCommander.OtherLocalPanelDirViewParams, L"DirViewParams"); \
+    KEYEX(String, ScpCommander.OtherLocalPanelLastPath, L"LastPath"); \
+  ); \
   BLOCK(L"Security", CANCREATE, \
   BLOCK(L"Security", CANCREATE, \
     KEY(Bool,    FUseMasterPassword); \
     KEY(Bool,    FUseMasterPassword); \
     KEY(String,  FMasterPasswordVerifier); \
     KEY(String,  FMasterPasswordVerifier); \

+ 4 - 1
source/windows/WinConfiguration.h

@@ -66,13 +66,16 @@ struct TScpCommanderConfiguration {
   bool TreeOnLeft;
   bool TreeOnLeft;
   bool ExplorerKeyboardShortcuts;
   bool ExplorerKeyboardShortcuts;
   bool SystemContextMenu;
   bool SystemContextMenu;
+  UnicodeString OtherLocalPanelDirViewParams;
+  UnicodeString OtherLocalPanelLastPath;
   bool __fastcall operator !=(TScpCommanderConfiguration & rhc)
   bool __fastcall operator !=(TScpCommanderConfiguration & rhc)
     { return C(WindowParams) C(LocalPanelWidth) C(ToolbarsLayout) C(ToolbarsButtons)
     { return C(WindowParams) C(LocalPanelWidth) C(ToolbarsLayout) C(ToolbarsButtons)
       C(SessionsTabs) C(StatusBar)
       C(SessionsTabs) C(StatusBar)
       C(LocalPanel) C(RemotePanel) C(CurrentPanel)
       C(LocalPanel) C(RemotePanel) C(CurrentPanel)
       C(NortonLikeMode) C(PreserveLocalDirectory)
       C(NortonLikeMode) C(PreserveLocalDirectory)
       C(CompareBySize) C(CompareByTime) C(SwappedPanels)
       C(CompareBySize) C(CompareByTime) C(SwappedPanels)
-      C(TreeOnLeft) C(ExplorerKeyboardShortcuts) C(SystemContextMenu) 0; };
+      C(TreeOnLeft) C(ExplorerKeyboardShortcuts) C(SystemContextMenu)
+      C(OtherLocalPanelDirViewParams) C(OtherLocalPanelLastPath) 0; };
 
 
   TCompareCriterias __fastcall CompareCriterias()
   TCompareCriterias __fastcall CompareCriterias()
   {
   {