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
Original file line number Diff line number Diff line change
Expand Up @@ -1568,39 +1568,35 @@ void launcherFrame::OnButtonCheckClick1(wxCommandEvent& event __attribute__((unu

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);
return;
command.Append(wxT(" -f \""));
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))
{
wxMessageBox(_("Error editing the config file!"), _("Error"),
wxICON_ERROR);
wxMessageBox(_("Failed to start gimx-config!"), _("Error"), wxICON_ERROR);
}
}

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);
return;
command.Append(wxT(" -f \""));
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))
{
wxMessageBox(_("Error editing the config file!"), _("Error"),
wxICON_ERROR);
wxMessageBox(_("Failed to start gimx-fpsconfig!"), _("Error"), wxICON_ERROR);
}
}

Expand Down

0 comments on commit 492e724

Please sign in to comment.