Skip to content

Commit

Permalink
Merge pull request #841 from cjee21/openfolder-dialog
Browse files Browse the repository at this point in the history
Windows GUI: Change dialog for opening folders
  • Loading branch information
JeromeMartinez authored May 23, 2024
2 parents c9c6962 + d3dd9a3 commit 68f24b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/GUI/VCL/GUI_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,15 +1190,15 @@ void __fastcall TMainF::M_File_Open_FileClick(TObject *Sender)
//---------------------------------------------------------------------------
void __fastcall TMainF::M_File_Open_FolderClick(TObject *Sender)
{
Ztring S1=OpenFolder_Show(Application->Handle, __T("Select your directory"), __T("MediaInfo"));
if (!FolderOpenDialog1->Execute())
return;

if (S1!=__T(""))
{
if (TDirectory::GetFiles(FolderOpenDialog1->FileName).Length != 0) {
// First we clear the list
if (M_Options_CloseAllAuto->Checked)
M_File_Close_AllClick(Sender);

I->Open(S1);
I->Open(GUI_Text(FolderOpenDialog1->FileName));
Refresh();
}
}
Expand Down
7 changes: 7 additions & 0 deletions Source/GUI/VCL/GUI_Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -7313,6 +7313,13 @@ object MainF: TMainF
object ApplicationEvents1: TApplicationEvents
OnSettingChange = ApplicationEvents1OnSettingChange
Left = 768
Top = 480
end
object FolderOpenDialog1: TFileOpenDialog
FavoriteLinks = <>
FileTypes = <>
Options = [fdoPickFolders]
Left = 768
Top = 424
end
end
2 changes: 2 additions & 0 deletions Source/GUI/VCL/GUI_Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <ExtCtrls.hpp>
#include <Buttons.hpp>
#include <System.ImageList.hpp>
#include <System.IOUtils.hpp>
#include <Vcl.BaseImageCollection.hpp>
#include <Vcl.ImageCollection.hpp>
#include <Vcl.VirtualImageList.hpp>
Expand Down Expand Up @@ -229,6 +230,7 @@ class TMainF : public TForm
TVirtualImageList* Toolbar_Image;
TMenuItem *M_Options_Darkmode;
TApplicationEvents *ApplicationEvents1;
TFileOpenDialog *FolderOpenDialog1;
void __fastcall FormResize(TObject *Sender);
void __fastcall M_Help_AboutClick(TObject *Sender);
void __fastcall M_Options_PreferencesClick(TObject *Sender);
Expand Down

0 comments on commit 68f24b8

Please sign in to comment.