Skip to content

Commit

Permalink
Allow to start editors from gimx-launcher with no config #512
Browse files Browse the repository at this point in the history
  • Loading branch information
matlo committed Jan 10, 2018
1 parent a7b5a4e commit 492e724
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions launcher/gimx-launcher.cpp
Expand Up @@ -1568,39 +1568,35 @@ void launcherFrame::OnButtonCheckClick1(wxCommandEvent& event __attribute__((unu


void launcherFrame::OnMenuEditConfig(wxCommandEvent& event __attribute__((unused))) void launcherFrame::OnMenuEditConfig(wxCommandEvent& event __attribute__((unused)))
{ {
if(InputChoice->GetStringSelection().IsEmpty()) wxString command = wxT("gimx-config");

if(!InputChoice->GetStringSelection().IsEmpty())
{ {
wxMessageBox( _("No config selected!"), _("Error"), wxICON_ERROR); command.Append(wxT(" -f \""));
return; command.Append(InputChoice->GetStringSelection());
command.Append(wxT("\""));
} }


wxString command = wxT("gimx-config -f \"");
command.Append(InputChoice->GetStringSelection());
command.Append(wxT("\""));

if (!wxExecute(command, wxEXEC_ASYNC)) if (!wxExecute(command, wxEXEC_ASYNC))
{ {
wxMessageBox(_("Error editing the config file!"), _("Error"), wxMessageBox(_("Failed to start gimx-config!"), _("Error"), wxICON_ERROR);
wxICON_ERROR);
} }
} }


void launcherFrame::OnMenuEditFpsConfig(wxCommandEvent& event __attribute__((unused))) void launcherFrame::OnMenuEditFpsConfig(wxCommandEvent& event __attribute__((unused)))
{ {
if(InputChoice->GetStringSelection().IsEmpty()) wxString command = wxT("gimx-fpsconfig");

if(!InputChoice->GetStringSelection().IsEmpty())
{ {
wxMessageBox( _("No config selected!"), _("Error"), wxICON_ERROR); command.Append(wxT(" -f \""));
return; command.Append(InputChoice->GetStringSelection());
command.Append(wxT("\""));
} }


wxString command = wxT("gimx-fpsconfig -f \"");
command.Append(InputChoice->GetStringSelection());
command.Append(wxT("\""));

if (!wxExecute(command, wxEXEC_ASYNC)) if (!wxExecute(command, wxEXEC_ASYNC))
{ {
wxMessageBox(_("Error editing the config file!"), _("Error"), wxMessageBox(_("Failed to start gimx-fpsconfig!"), _("Error"), wxICON_ERROR);
wxICON_ERROR);
} }
} }


Expand Down

0 comments on commit 492e724

Please sign in to comment.