Skip to content

Commit

Permalink
Fix android issues with backup menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kisspeace committed May 30, 2023
1 parent a710b0b commit 78576ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,15 @@ procedure TForm1.BtnApplyBackupOnTap(Sender: TObject;
begin
try
ImportAppData(LFilename, DEF_EXIM_OPTIONS);
{$IFDEF MSWINDOWS}
ShowMessage('Success. Please restart application.');
Application.Terminate;
{$ELSE}
UserBooleanDialog('Success. Please restart application.',
procedure begin
Application.Terminate;
end);
{$ENDIF}
except
On E: Exception do
begin
Expand Down Expand Up @@ -1329,15 +1336,18 @@ procedure TForm1.BtnSetManageBackupsOnTap(Sender: TObject;

if DirectoryExists(LDirectory) then
begin
LFiles := GetFiles(LDirectory + PathDelim + 'NsfwBox-*.zip');
LFiles := GetFiles(LDirectory + PathDelim);

SelectMenuBackupFiles.Menu.FreeControls;
for I := High(LFiles) downto Low(LFiles) do
begin
var LFile := LFiles[I];
if (LFile.Name = '.') or (LFile.Name = '..') then continue;

var LNewBtn := SelectMenuBackupFiles.AddBtn(TRectButton,
LFile.Name + ' (' + BytesCountToSizeStr(LFile.Size) + ')',
TPath.Combine(LDirectory, LFile.Name));

LNewBtn.ImageControl.Visible := False;
LNewBtn.Text.Margins.Left := 5;
LNewBtn.Position.Y := Single.MaxValue;
Expand Down

0 comments on commit 78576ed

Please sign in to comment.