Skip to content

Commit 353bb2f

Browse files
Version 3.0.3
1 parent 7541461 commit 353bb2f

File tree

11 files changed

+35
-36
lines changed

11 files changed

+35
-36
lines changed

installer/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Identity
1414
Name="22846MartinStoeckli.ExplorerGenie"
1515
Publisher="CN=ED1E5C1E-F8CD-4A09-A57F-18D151833C31"
16-
Version="3.0.2.0" />
16+
Version="3.0.3.0" />
1717

1818
<Properties>
1919
<DisplayName>ExplorerGenie</DisplayName>

src/ExplorerGenieCmd/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
2323
[assembly: Guid("510a4b3b-a01d-4ca9-af66-a99f022f2643")]
24-
[assembly: AssemblyVersion("3.0.2.0")]
25-
[assembly: AssemblyFileVersion("3.0.2.0")]
24+
[assembly: AssemblyVersion("3.0.3.0")]
25+
[assembly: AssemblyFileVersion("3.0.3.0")]

src/ExplorerGenieExt/ExplorerGenieExt.dproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
</PropertyGroup>
115115
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
116116
<VerInfo_Locale>1033</VerInfo_Locale>
117-
<VerInfo_Release>2</VerInfo_Release>
118-
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=3.0.2.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
117+
<VerInfo_Release>3</VerInfo_Release>
118+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=3.0.3.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
119119
<VerInfo_MinorVer>0</VerInfo_MinorVer>
120120
<VerInfo_MajorVer>3</VerInfo_MajorVer>
121121
</PropertyGroup>
@@ -192,7 +192,6 @@
192192
<Operation>1</Operation>
193193
</Platform>
194194
<Platform Name="Win32">
195-
<RemoteDir>Contents\MacOS</RemoteDir>
196195
<Operation>0</Operation>
197196
</Platform>
198197
</DeployClass>
0 Bytes
Binary file not shown.

src/ExplorerGenieExt/UnitApp.pas

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ interface
3737
/// </summary>
3838
TApp = class(TAutoObject, IApp, IExplorerCommand)
3939
private
40-
FMenus: IMenuModel;
4140
FExplorerCommand: IExplorerCommand;
4241
function CreateMenuModels(settingsService: TSettingsService; languageService: ILanguageService; resourceDllPath: String): IMenuModel;
4342

@@ -73,6 +72,7 @@ procedure TApp.Initialize;
7372
languageService: ILanguageService;
7473
settingsService: TSettingsService;
7574
resourceDllPath: String;
75+
menus: IMenuModel;
7676
begin
7777
Logger.Debug('---');
7878
Logger.Debug('TApp.Initialize');
@@ -81,14 +81,14 @@ procedure TApp.Initialize;
8181
languageService := TLanguageServiceFactory.CreateLanguageService('ExplorerGenie');
8282
{$IFDEF DEBUG}
8383
// development: Here we can force loading of a specific language.
84-
languageService := TLanguageServiceFactory.CreateLanguageService('ExplorerGenie', 'en');
84+
// languageService := TLanguageServiceFactory.CreateLanguageService('ExplorerGenie', 'en');
8585
{$ENDIF}
8686

8787
settingsService := TSettingsService.Create(languageService);
8888
try
8989
resourceDllPath := GetModuleName(HInstance);
90-
FMenus := CreateMenuModels(settingsService, languageService, resourceDllPath);
91-
FExplorerCommand := TExplorerCommand.Create(FMenus) as IExplorerCommand;
90+
menus := CreateMenuModels(settingsService, languageService, resourceDllPath);
91+
FExplorerCommand := TExplorerCommand.Create(menus) as IExplorerCommand;
9292
finally
9393
settingsService.Free;
9494
end;
@@ -99,7 +99,6 @@ destructor TApp.Destroy;
9999
Logger.Debug('TApp.Destroy');
100100
try
101101
FExplorerCommand := nil;
102-
FMenus := nil;
103102
except
104103
on e: Exception do
105104
MessageBox(0, PChar(e.Message), '', MB_ICONERROR);

src/ExplorerGenieExt/UnitEnumExplorerCommand.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ TEnumExplorerCommand = class(TInterfacedObject, IEnumExplorerCommand)
2525
FModel: IMenuModel;
2626
FCursor: ULONG;
2727

28+
property Model: IMenuModel read FModel;
29+
2830
// IEnumExplorerCommand
2931
function Next(celt: Cardinal; out pUICommand: IExplorerCommand; var pceltFetched: Cardinal): HRESULT; stdcall;
3032
function Skip(celt: Cardinal): HRESULT; stdcall;
@@ -33,8 +35,6 @@ TEnumExplorerCommand = class(TInterfacedObject, IEnumExplorerCommand)
3335
public
3436
constructor Create(model: IMenuModel);
3537
destructor Destroy(); override;
36-
37-
property Model: IMenuModel read FModel;
3838
end;
3939

4040
implementation
@@ -79,7 +79,7 @@ function TEnumExplorerCommand.Next(celt: Cardinal; out pUICommand: IExplorerComm
7979
try
8080
// pUICommand is actually an array which has already memory allocated to hold all references
8181
// of the requested commands. MAX_COMMAND has no meaning but to define a type of a static array,
82-
// the memory allocation of the array is done by the Explorer.
82+
// the memory allocation of the array is done by the Explorer. While testing, celt was always 1.
8383
commandsArrayPtr := PIExplorerCommandArray(@pUICommand);
8484
pceltFetched := 0;
8585
while (pceltFetched < celt) and (FCursor < ULONG(Model.ChildrenCount)) do

src/ExplorerGenieExt/UnitExplorerCommand.pas

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TExplorerCommand = class(TInterfacedObject, IExplorerCommand)
2727
private
2828
FModel: IMenuModel;
2929
class function ReturnWideStringProperty(const value: WideString; out ppszValue: LPWSTR): HRESULT;
30-
class procedure ReadSelectedFilenames(const psiItemArray: IShellItemArray; filenames: TStringList);
30+
class procedure ListSelectedFilenames(const psiItemArray: IShellItemArray; filenames: TStringList);
3131

3232
// IExplorerCommand
3333
function GetTitle(const psiItemArray: IShellItemArray; var ppszName: LPWSTR): HRESULT; stdcall;
@@ -83,7 +83,7 @@ function TExplorerCommand.ExplorerCommandInvoke(const psiItemArray: IShellItemAr
8383

8484
filenames := TStringList.Create();
8585
try
86-
ReadSelectedFilenames(psiItemArray, filenames);
86+
ListSelectedFilenames(psiItemArray, filenames);
8787
Model.OnClicked(Model, filenames);
8888
Logger.Debug('TExplorerCommand.ExplorerCommandInvoke'#9 + filenames.Text);
8989
except
@@ -114,9 +114,6 @@ function TExplorerCommand.GetFlags(var pFlags: TExpCmdFlags): HRESULT;
114114
function TExplorerCommand.GetIcon(const psiItemArray: IShellItemArray; var ppszIcon: LPWSTR): HRESULT;
115115
begin
116116
Logger.Debug('TExplorerCommand.GetIcon'#9 + Model.Title);
117-
118-
// Calling GetModuleName() here has lead to errors in Windows10, so we read the already prepared
119-
// resource path from the model.
120117
Result := ReturnWideStringProperty(Model.IconResourcePath, ppszIcon);
121118
end;
122119

@@ -148,7 +145,7 @@ function TExplorerCommand.GetToolTip(const psiItemArray: IShellItemArray; var pp
148145
Result := ReturnWideStringProperty('', ppszInfotip);
149146
end;
150147

151-
class procedure TExplorerCommand.ReadSelectedFilenames(const psiItemArray: IShellItemArray; filenames: TStringList);
148+
class procedure TExplorerCommand.ListSelectedFilenames(const psiItemArray: IShellItemArray; filenames: TStringList);
152149
var
153150
selectionCount: Cardinal;
154151
selectionIndex: Cardinal;

src/ExplorerGenieExt/UnitMenuModel.pas

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ interface
1818
/// the application itself (IExplorerCommand) they should be used reference counted by interface.
1919
/// </summary>
2020
/// <remarks>
21-
/// This model can outlive the application object and therefore should self contain all information
22-
/// required by the Windows IExplorerCommand API. This means storing properties in WideString
23-
/// instead of string and avoiding calls to GetModuleName().
21+
/// This model can outlive the application object and therefore should self contain all
22+
/// information required by the Windows IExplorerCommand API. Store and keep properties in
23+
/// WideString instead of string.
2424
/// </remarks>
2525
IMenuModel = interface
2626
['{923968D3-DFEF-47FE-A688-2E3D3DE1B728}']
@@ -91,7 +91,9 @@ TMenuModel = class(TInterfacedObject, IMenuModel)
9191
FIconResourcePath: WideString;
9292
FIsSeparator: Boolean;
9393
FOnClicked: TProc<IMenuModel, TStrings>;
94+
function GetOrCreateChildren(): TList<IMenuModel>;
9495
protected
96+
// IMenuModel
9597
function GetTitle(): WideString;
9698
procedure SetTitle(value: WideString);
9799
function GetIconResourcePath(): WideString;
@@ -100,7 +102,6 @@ TMenuModel = class(TInterfacedObject, IMenuModel)
100102
procedure SetIsSeparator(value: Boolean);
101103
function GetOnClicked(): TProc<IMenuModel, TStrings>;
102104
procedure SetOnClicked(value: TProc<IMenuModel, TStrings>);
103-
function GetOrCreateChildren(): TList<IMenuModel>;
104105
function GetChildrenCount: Integer;
105106
function GetChild(index: Integer): IMenuModel;
106107
procedure AddChild(const item: IMenuModel);

src/ExplorerGenieOptions/MainWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
mc:Ignorable="d"
1010
Title="ExplorerGenie"
1111
Height="420" Width="720"
12-
Icon="Resources/options.ico" ResizeMode="CanResizeWithGrip" Loaded="MainWindow_Loaded">
12+
Icon="Resources/options.ico" ResizeMode="CanResizeWithGrip" Loaded="MainWindow_Loaded" ContentRendered="MainWindow_ContentRendered">
1313

1414
<Window.Resources>
1515
<Color x:Key="GridHighlightBackgroundColor">#cce7ff</Color>
@@ -124,7 +124,7 @@
124124
<RowDefinition Height="auto"/>
125125
<RowDefinition Height="auto"/>
126126
</Grid.RowDefinitions>
127-
127+
128128
<CheckBox Grid.Row="0" IsChecked="{Binding CopyFileShowMenu}" Content="{Binding Language[guiShowMenu]}" VerticalAlignment="Center"/>
129129

130130
<GroupBox Grid.Row="1" Header="{Binding Language[submenuCopyFile]}" Margin="0,6,0,0" Padding="6">
@@ -208,7 +208,7 @@
208208
<Image Source="{StaticResource imgsrcArrowDown}" Margin="1" Width="12" Height="14"/>
209209
</Button>
210210
</StackPanel>
211-
211+
212212
<DataGrid
213213
x:Name="gridCustomGotoTools"
214214
Grid.Row="1"
@@ -238,7 +238,7 @@
238238
</DataGridTemplateColumn>
239239
</DataGrid.Columns>
240240
</DataGrid>
241-
241+
242242
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,6,0,0">
243243
<Image Source="{StaticResource imgsrcInfo}" Margin="0,4,6,0" Height="14" VerticalAlignment="Top"/>
244244
<TextBlock Text="{Binding Language[guiGotoInfo]}" />

src/ExplorerGenieOptions/MainWindow.xaml.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
4444
gridCustomGotoTools.Columns[0].Header = GetViewModel().Language["guiGotoMenuTitle"];
4545
gridCustomGotoTools.Columns[1].Header = GetViewModel().Language["guiGotoMenuCommand"];
4646
gridCustomGotoTools.Columns[2].Header = GetViewModel().Language["guiGotoMenuAdmin"];
47-
48-
if (GetViewModel().FreshInstallation)
49-
{
50-
MessageBox.Show(GetViewModel().Language["guiRestart"], Title, MessageBoxButton.OK, MessageBoxImage.Information);
51-
GetViewModel().FreshInstallation = false;
52-
}
5347
}
5448

5549
private SettingsViewModel GetViewModel()
@@ -74,5 +68,14 @@ private void HashDataGrid_MouseDoubleClick(object sender, System.Windows.Input.M
7468
GetViewModel().CalculateHashPageViewModel.CopyHashToClipboardCommand.Execute(selectedViewModel);
7569
}
7670
}
71+
72+
private void MainWindow_ContentRendered(object sender, EventArgs e)
73+
{
74+
if (GetViewModel().FreshInstallation)
75+
{
76+
MessageBox.Show(this, GetViewModel().Language["guiRestart"], Title, MessageBoxButton.OK, MessageBoxImage.Information);
77+
GetViewModel().FreshInstallation = false;
78+
}
79+
}
7780
}
7881
}

0 commit comments

Comments
 (0)