summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2015-04-25 22:15:48 +0200
committerJosJuice <josjuice@gmail.com>2015-04-25 22:15:48 +0200
commitdb1d81ebf8d19c480e51cb4d43a9f9f488d569fc (patch)
treee2184c7fdd92afcb1e8555cc6d95a6cedf763b3d /Source/Core
parent645aa5af8b05b20c30948027d83a1a618c6c40a4 (diff)
ISOProperties: Don't block when opening default INI in text editor
The purpose of blocking is to reload user INIs after they have been edited. However, ISOProperties never reloads default INIs, because they aren't meant to be edited. Blocking on default INIs is thus useless, and it's rather annoying for games that have two default INIs, because it makes it impossible to see both at once.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/ISOProperties.cpp27
-rw-r--r--Source/Core/DolphinWX/ISOProperties.h2
2 files changed, 18 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp
index f2ef327c10..4dee90d5b4 100644
--- a/Source/Core/DolphinWX/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/ISOProperties.cpp
@@ -1180,7 +1180,7 @@ bool CISOProperties::SaveGameConfig()
return success;
}
-void CISOProperties::LaunchExternalEditor(const std::string& filename)
+void CISOProperties::LaunchExternalEditor(const std::string& filename, bool wait_until_closed)
{
#ifdef __APPLE__
// wxTheMimeTypesManager is not yet implemented for wxCocoa
@@ -1203,18 +1203,25 @@ void CISOProperties::LaunchExternalEditor(const std::string& filename)
if (OpenCommand.IsEmpty())
{
WxUtils::ShowErrorDialog(_("Couldn't find open command for extension 'ini'!"));
+ return;
}
+
+ long result;
+
+ if (wait_until_closed)
+ result = wxExecute(OpenCommand, wxEXEC_SYNC);
else
+ result = wxExecute(OpenCommand);
+
+ if (result == -1)
{
- if (wxExecute(OpenCommand, wxEXEC_SYNC) == -1)
- WxUtils::ShowErrorDialog(_("wxExecute returned -1 on application run!"));
+ WxUtils::ShowErrorDialog(_("wxExecute returned -1 on application run!"));
+ return;
}
-#endif
-
- bRefreshList = true; // Just in case
- // Once we're done with the ini edit, give the focus back to Dolphin
- SetFocus();
+ if (wait_until_closed)
+ bRefreshList = true; // Just in case
+#endif
}
void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
@@ -1226,7 +1233,7 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
std::fstream blankFile(GameIniFileLocal, std::ios::out);
blankFile.close();
}
- LaunchExternalEditor(GameIniFileLocal);
+ LaunchExternalEditor(GameIniFileLocal, true);
GameIniLocal.Load(GameIniFileLocal);
LoadGameConfig();
}
@@ -1283,7 +1290,7 @@ void CISOProperties::OnShowDefaultConfig(wxCommandEvent& WXUNUSED (event))
{
std::string path = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + filename;
if (File::Exists(path))
- LaunchExternalEditor(path);
+ LaunchExternalEditor(path, false);
}
}
diff --git a/Source/Core/DolphinWX/ISOProperties.h b/Source/Core/DolphinWX/ISOProperties.h
index cf771942ff..a7d275a297 100644
--- a/Source/Core/DolphinWX/ISOProperties.h
+++ b/Source/Core/DolphinWX/ISOProperties.h
@@ -195,7 +195,7 @@ private:
IDM_BNRSAVEAS
};
- void LaunchExternalEditor(const std::string& filename);
+ void LaunchExternalEditor(const std::string& filename, bool wait_until_closed);
void CreateGUIControls(bool);
void OnClose(wxCloseEvent& event);