Fixed bug where the Add Directory panel would not show the Directory Requester until a key was pressed

This commit is contained in:
Dimitris Panokostas 2018-01-21 18:24:53 +01:00
parent af6ced7111
commit 4415e3d049
3 changed files with 36 additions and 23 deletions

View file

@ -231,9 +231,9 @@ static void EditFilesysVirtualLoop()
SDL_Event event;
while (SDL_PollEvent(&event))
{
gotEvent = 1;
if (event.type == SDL_KEYDOWN)
{
gotEvent = 1;
switch (event.key.keysym.sym)
{
case VK_ESCAPE:

View file

@ -160,10 +160,13 @@ class AddVirtualHDActionListener : public gcn::ActionListener
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (EditFilesysVirtual(-1))
gui_force_rtarea_hdchange();
cmdAddDirectory->requestFocus();
RefreshPanelHD();
if (actionEvent.getSource() == cmdAddDirectory)
{
if (EditFilesysVirtual(-1))
gui_force_rtarea_hdchange();
cmdAddDirectory->requestFocus();
RefreshPanelHD();
}
}
};
@ -175,10 +178,13 @@ class AddHardfileActionListener : public gcn::ActionListener
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (EditFilesysHardfile(-1))
gui_force_rtarea_hdchange();
cmdAddHardfile->requestFocus();
RefreshPanelHD();
if (actionEvent.getSource() == cmdAddHardfile)
{
if (EditFilesysHardfile(-1))
gui_force_rtarea_hdchange();
cmdAddHardfile->requestFocus();
RefreshPanelHD();
}
}
};
@ -190,10 +196,13 @@ class CreateHardfileActionListener : public gcn::ActionListener
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (CreateFilesysHardfile())
gui_force_rtarea_hdchange();
cmdCreateHardfile->requestFocus();
RefreshPanelHD();
if (actionEvent.getSource() == cmdCreateHardfile)
{
if (CreateFilesysHardfile())
gui_force_rtarea_hdchange();
cmdCreateHardfile->requestFocus();
RefreshPanelHD();
}
}
};
@ -205,18 +214,21 @@ class CDCheckActionListener : public gcn::ActionListener
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (changed_prefs.cdslots[0].inuse)
if (actionEvent.getSource() == chkCD)
{
changed_prefs.cdslots[0].inuse = false;
changed_prefs.cdslots[0].type = SCSI_UNIT_DISABLED;
if (changed_prefs.cdslots[0].inuse)
{
changed_prefs.cdslots[0].inuse = false;
changed_prefs.cdslots[0].type = SCSI_UNIT_DISABLED;
}
else
{
changed_prefs.cdslots[0].inuse = true;
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
}
RefreshPanelHD();
RefreshPanelQuickstart();
}
else
{
changed_prefs.cdslots[0].inuse = true;
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
}
RefreshPanelHD();
RefreshPanelQuickstart();
}
};

View file

@ -359,6 +359,7 @@ bool SelectFolder(const char* title, char* value)
UpdateGuiScreen();
SelectFolderLoop();
ExitSelectFolder();
if (dialogResult)
{