Skip to content

Commit

Permalink
v1.3.2 reset filelist index when files dropped.
Browse files Browse the repository at this point in the history
added FiCurrentFileIndex := 0;
  • Loading branch information
torum committed Jan 7, 2023
1 parent 642463a commit 7749730
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
14 changes: 1 addition & 13 deletions ImageViewer.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ procedure TranslateLCL;
var
Lang,FallbackLang: String;
begin
// TODO: in windows, you have to call GetUserDefaultUILanguage() API to get UI languages.
// TODO: On windows, you have to call GetUserDefaultUILanguage() API to get UI languages.
// http://sygh.hatenadiary.jp/entry/2014/05/24/181319
{
GetSystemDefaultLangID()
Expand All @@ -34,18 +34,6 @@ procedure TranslateLCL;
FallbackLang:='';
LazGetLanguageIDs(Lang,FallbackLang);

//LazGetLanguageIDs(Lang,FallbackLang);
//OutputDebugString(PChar(TrimRight( 'Lang is '+ Lang + ', FallbackLang is '+ FallbackLang )));
//Debug Output: 'Lang is jp_JP FallbackLang is jp'
// What??? It supporsed to be "ja_JP"!!

//Lang := FallbackLang+'_'+Country;

//LazGetShortLanguageID(Lang);
//OutputDebugString(PChar(TrimRight( 'Lang is '+ Lang )));
//Debug Output: 'Lang is jp'
// What? not ja?

if (Lang = 'en') or (Lang = 'en_US') or (Lang = 'us')
or (FallbackLang = 'us') or (FallbackLang = 'US') or (FallbackLang = 'en') then
Lang := 'en';
Expand Down
2 changes: 1 addition & 1 deletion umain.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object frmMain: TfrmMain
OnShow = FormShow
PopupMode = pmAuto
Position = poScreenCenter
LCLVersion = '2.2.0.4'
LCLVersion = '2.2.2.0'
object Image1: TImage
Left = 0
Height = 241
Expand Down
9 changes: 4 additions & 5 deletions umain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
preLoading image for slideshow.
load playlist.
more Command line options.
file drop handling(win).
OS's power-save event aware.
Modal dialog with options and playlist edit tab (drag & drop files).
Modal dialog with options and playlist edit tab.
}

interface
Expand Down Expand Up @@ -355,7 +353,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
i,f:integer;
configFile:string;
begin
FstrAppVer:='1.3.0';
FstrAppVer:='1.3.2';

// Init Main form properties.
self.Caption:=ReplaceStr(ExtractFileName(ParamStr(0)),ExtractFileExt(ParamStr(0)),'');
Expand Down Expand Up @@ -392,7 +390,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
// Be carefull when settings this. If the size is too large, the list will be empty.
FOptMinimulFileSizeKiloByte:=1;

// Non user editable options. (TODO: should remove "Opt" from name.)
// Non user editable flags.
FisSlideshowAutoStart:=true;
FisStretch:=false;
FisInFrame:=false;
Expand Down Expand Up @@ -1057,6 +1055,7 @@ procedure TfrmMain.FormDropFiles(Sender: TObject;

if TmpFileList.Count <> 0 then
begin
FiCurrentFileIndex:=0;
fisSingleFileSelected := isSingleFSelected;
fstrInitialSelectedImageFile := strInitialSelectedImageFile;
FstFileList.Assign(TmpFileList);
Expand Down

0 comments on commit 7749730

Please sign in to comment.