Skip to content

Commit

Permalink
refactor: Remove CreateFolder button from SelectFile (fixes #1338)
Browse files Browse the repository at this point in the history
There's no need to Create a new folder, when you're about to select a File
  • Loading branch information
midwan committed Jun 3, 2024
1 parent 10dbe57 commit b55981a
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/osdep/gui/SelectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ static gcn::ScrollArea* scrAreaFiles;
static gcn::TextField* txtCurrent;
static gcn::Label* lblFilename;
static gcn::TextField* txtFilename;
static gcn::Button* cmdCreateFolder;

class SelectFileListModel : public gcn::ListModel
{
Expand Down Expand Up @@ -167,15 +166,6 @@ class FileButtonActionListener : public gcn::ActionListener
dialogResult = false;
dialogFinished = true;
}
else if (actionEvent.getSource() == cmdCreateFolder)
{
wndSelectFile->releaseModalFocus();
if (Create_Folder(workingDir))
{
checkfoldername(workingDir);
wndSelectFile->requestModalFocus();
}
}
}
};

Expand Down Expand Up @@ -225,13 +215,6 @@ static void InitSelectFile(const std::string& title)

fileButtonActionListener = new FileButtonActionListener();

cmdCreateFolder = new gcn::Button("Create Folder");
cmdCreateFolder->setSize(BUTTON_WIDTH * 2, BUTTON_HEIGHT);
cmdCreateFolder->setPosition(DISTANCE_BORDER, DIALOG_HEIGHT - 2 * DISTANCE_BORDER - BUTTON_HEIGHT - 10);
cmdCreateFolder->setBaseColor(gui_base_color);
cmdCreateFolder->setForegroundColor(gui_foreground_color);
cmdCreateFolder->addActionListener(fileButtonActionListener);

cmdOK = new gcn::Button("Ok");
cmdOK->setSize(BUTTON_WIDTH, BUTTON_HEIGHT);
cmdOK->setPosition(DIALOG_WIDTH - DISTANCE_BORDER - 2 * BUTTON_WIDTH - DISTANCE_NEXT_X,
Expand Down Expand Up @@ -301,7 +284,6 @@ static void InitSelectFile(const std::string& title)
wndSelectFile->add(txtFilename);
}

wndSelectFile->add(cmdCreateFolder);
wndSelectFile->add(cmdOK);
wndSelectFile->add(cmdCancel);
wndSelectFile->add(txtCurrent);
Expand All @@ -327,7 +309,6 @@ static void ExitSelectFile()
wndSelectFile->releaseModalFocus();
gui_top->remove(wndSelectFile);

delete cmdCreateFolder;
delete cmdOK;
delete cmdCancel;
delete fileButtonActionListener;
Expand Down

0 comments on commit b55981a

Please sign in to comment.