Skip to content

Commit

Permalink
Fix Panel Mode save
Browse files Browse the repository at this point in the history
  • Loading branch information
dimfishr committed Jan 31, 2018
1 parent f07043e commit d866b37
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions fardroid.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions fardroid.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
Expand Down Expand Up @@ -122,7 +122,6 @@
</ClCompile>
<Link>
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>C:\Program Files\Far\Plugins\FarDroid\fardroid.dll</OutputFile>
<ModuleDefinitionFile>fardroid.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>false</GenerateMapFile>
Expand Down
21 changes: 14 additions & 7 deletions fardroidPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void *>(&PInfo));
if (PInfo.PluginHandle && PInfo.PluginHandle != INVALID_HANDLE_VALUE && PInfo.OwnerGuid == MainGuid)
Expand Down Expand Up @@ -250,9 +251,6 @@ void WINAPI GetOpenPanelInfoW(struct OpenPanelInfo* Info)
Info->StructSize = sizeof *Info;
Info->Flags = OPIF_SHOWPRESERVECASE | OPIF_USEFREESIZE;

Info->StartSortMode = static_cast<OPENPANELINFO_SORTMODES>(conf.SortMode);
Info->StartSortOrder = conf.SortOrder;

Info->Format = LOC(MTitle);

android->PreparePanel(Info);
Expand All @@ -261,6 +259,9 @@ void WINAPI GetOpenPanelInfoW(struct OpenPanelInfo* Info)
Info->DescrFilesNumber = 0;

Info->StartPanelMode = _F('0') + conf.PanelMode;
Info->StartSortMode = static_cast<OPENPANELINFO_SORTMODES>(conf.SortMode);
Info->StartSortOrder = conf.SortOrder;

Info->PanelModesArray = nullptr;
Info->PanelModesNumber = 0;

Expand Down Expand Up @@ -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<void *>(&PInfo));
android->ChangePermissionsDialog(static_cast<int>(PInfo.SelectedItemsNumber));
android->Reread();
Expand Down Expand Up @@ -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<void *>(&PInfo));
conf.SortMode = PInfo.SortMode;
conf.PanelMode = static_cast<int>(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<int>(PInfo.ViewMode);
conf.SortOrder = IS_FLAG(PInfo.Flags, PFLAGS_REVERSESORTORDER);
conf.SavePanel();
}
break;
}

Expand Down
5 changes: 4 additions & 1 deletion texts/History.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define MAJORVERSION 2
#define MINORVERSION 13
#define REVISION 1
#define REVISION 2
#define BUILDNUMBER 0

0 comments on commit d866b37

Please sign in to comment.