Skip to content

Commit

Permalink
Improve log file generation #372
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlo committed Mar 10, 2016
1 parent 376775b commit 7c44848
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions launcher/gimx-launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,8 @@ void launcherFrame::OnButtonStartClick(wxCommandEvent& event)

MyProcess *process = new MyProcess(this, command);

startTime = wxGetUTCTime();

if(!wxExecute(command, wxEXEC_ASYNC | wxEXEC_NOHIDE, process))
{
wxMessageBox( _("can't start gimx!"), _("Error"), wxICON_ERROR);
Expand Down Expand Up @@ -1294,6 +1296,20 @@ void launcherFrame::OnProcessTerminated(wxProcess *process, int status)
wxExecute(wxT("xdg-open ") + gimxLogDir + wxT(LOG_FILE), wxEXEC_ASYNC, NULL);
#endif
}
else
{
long int endTime = wxGetUTCTime();
if(endTime - startTime < 5)
{
int answer = wxMessageBox(_("GIMX ran less than 5 seconds. Would you like to generate a log report?"), _("Confirm"), wxYES_NO | wxCANCEL);
if (answer == wxYES)
{
ProcessOutputChoice->SetSelection(ProcessOutputChoice->FindString(_("log file")));
wxCommandEvent event;
OnButtonStartClick(event);
}
}
}

SetFocus();
}
Expand Down
1 change: 1 addition & 0 deletions launcher/gimx-launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class launcherFrame: public wxFrame
wxLocale* locale;

bool started;
long startTime;

wxString userDir;
wxString gimxConfigDir;
Expand Down

0 comments on commit 7c44848

Please sign in to comment.