From d866b379a7e80f244336faa67e9eed2f1a45d18b Mon Sep 17 00:00:00 2001 From: dimfish Date: Wed, 31 Jan 2018 12:22:03 +0300 Subject: [PATCH] Fix Panel Mode save --- fardroid.rc | 4 ++-- fardroid.vcxproj | 5 ++--- fardroidPlugin.cpp | 21 ++++++++++++++------- texts/History.txt | 5 ++++- version.info | 2 +- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/fardroid.rc b/fardroid.rc index d7231ca..c192046 100644 --- a/fardroid.rc +++ b/fardroid.rc @@ -53,7 +53,7 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2, 13, 1, 0 + FILEVERSION 2, 13, 2, 0 PRODUCTVERSION 2, 0, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG @@ -70,7 +70,7 @@ BEGIN BLOCK "041904b0" BEGIN VALUE "FileDescription", "FARDroid FAR Plugin" - VALUE "FileVersion", "2, 13, 1, 0\0" + VALUE "FileVersion", "2, 13, 2, 0\0" VALUE "InternalName", "fardroid" VALUE "LegalCopyright", "dimfish 2016, Vladimir Kubyshev 2010" VALUE "OriginalFilename", "fardroid.dll" diff --git a/fardroid.vcxproj b/fardroid.vcxproj index ceb8402..9058cb5 100644 --- a/fardroid.vcxproj +++ b/fardroid.vcxproj @@ -29,11 +29,11 @@ DynamicLibrary v120_xp Unicode - false + true DynamicLibrary - v141 + v120_xp Unicode @@ -122,7 +122,6 @@ Ws2_32.lib;%(AdditionalDependencies) - C:\Program Files\Far\Plugins\FarDroid\fardroid.dll fardroid.def true false diff --git a/fardroidPlugin.cpp b/fardroidPlugin.cpp index 29d4a92..401b534 100644 --- a/fardroidPlugin.cpp +++ b/fardroidPlugin.cpp @@ -214,6 +214,7 @@ intptr_t WINAPI ConfigureW(const struct ConfigureInfo* Info) conf.Save(); PanelInfo PInfo; + PInfo.StructSize = sizeof(PanelInfo); fardroid* android = nullptr; fInfo.PanelControl(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, static_cast(&PInfo)); if (PInfo.PluginHandle && PInfo.PluginHandle != INVALID_HANDLE_VALUE && PInfo.OwnerGuid == MainGuid) @@ -250,9 +251,6 @@ void WINAPI GetOpenPanelInfoW(struct OpenPanelInfo* Info) Info->StructSize = sizeof *Info; Info->Flags = OPIF_SHOWPRESERVECASE | OPIF_USEFREESIZE; - Info->StartSortMode = static_cast(conf.SortMode); - Info->StartSortOrder = conf.SortOrder; - Info->Format = LOC(MTitle); android->PreparePanel(Info); @@ -261,6 +259,9 @@ void WINAPI GetOpenPanelInfoW(struct OpenPanelInfo* Info) Info->DescrFilesNumber = 0; Info->StartPanelMode = _F('0') + conf.PanelMode; + Info->StartSortMode = static_cast(conf.SortMode); + Info->StartSortOrder = conf.SortOrder; + Info->PanelModesArray = nullptr; Info->PanelModesNumber = 0; @@ -306,6 +307,7 @@ intptr_t WINAPI ProcessPanelInputW(const struct ProcessPanelInputInfo* Info) case 0x41: { PanelInfo PInfo; + PInfo.StructSize = sizeof(PanelInfo); fInfo.PanelControl(Info->hPanel, FCTL_GETPANELINFO, 0, static_cast(&PInfo)); android->ChangePermissionsDialog(static_cast(PInfo.SelectedItemsNumber)); android->Reread(); @@ -395,11 +397,16 @@ intptr_t WINAPI ProcessPanelEventW(const struct ProcessPanelEventInfo* Info) { case FE_CHANGEVIEWMODE: PanelInfo PInfo; + PInfo.StructSize = sizeof(PanelInfo); fInfo.PanelControl(Info->hPanel, FCTL_GETPANELINFO, 0, static_cast(&PInfo)); - conf.SortMode = PInfo.SortMode; - conf.PanelMode = static_cast(PInfo.ViewMode); - conf.SortOrder = IS_FLAG(PInfo.Flags, PFLAGS_REVERSESORTORDER); - conf.SavePanel(); + + if (IS_FLAG(PInfo.Flags, PFLAGS_PLUGIN) && IS_FLAG(PInfo.Flags, PFLAGS_VISIBLE)) + { + conf.SortMode = PInfo.SortMode; + conf.PanelMode = static_cast(PInfo.ViewMode); + conf.SortOrder = IS_FLAG(PInfo.Flags, PFLAGS_REVERSESORTORDER); + conf.SavePanel(); + } break; } diff --git a/texts/History.txt b/texts/History.txt index fe51ca9..425297d 100644 --- a/texts/History.txt +++ b/texts/History.txt @@ -1,4 +1,7 @@ - 25.01.18 v2.13.1 + 31.01.18 v2.13.1 + * Fix Panel Mode save. + + 25.01.18 v2.13.1 * Fix 'Always No' option in copy dialog. * Fix escape characters ' ' and '\' in Native mode. diff --git a/version.info b/version.info index 7b10583..0e37f71 100644 --- a/version.info +++ b/version.info @@ -1,4 +1,4 @@ #define MAJORVERSION 2 #define MINORVERSION 13 -#define REVISION 1 +#define REVISION 2 #define BUILDNUMBER 0