void mux_dialog::on_abort(wxCommandEvent &) { #if defined(SYS_WINDOWS) if (m_abort_button_changed) { wxFileName output_file_name(static_cast<mmg_dialog *>(GetParent())->tc_output->GetValue()); wxExecute(wxString::Format(wxT("explorer \"%s\""), output_file_name.GetPath().c_str())); return; } change_abort_button(); #else if (m_abort_button_changed) return; m_abort_button_changed = true; b_abort->Enable(false); #endif b_ok->Enable(true); b_ok->SetFocus(); #if defined(SYS_WINDOWS) wxKill(m_pid, wxSIGKILL); #else wxKill(m_pid, wxSIGTERM); #endif }
void mux_dialog::on_process_terminated(wxCommandEvent &evt) { m_read_input_timer.Stop(); m_exit_code = evt.GetInt(); wxString format; if ((0 != m_exit_code) && (1 != m_exit_code)) format = Z("mkvmerge FAILED with a return code of %d. %s"); else format = Z("mkvmerge finished with a return code of %d. %s"); #if defined(SYS_WINDOWS) wxString status_1 = Z("There were warnings, or the process was terminated."); #else wxString status_1 = Z("There were warnings"); #endif auto status_str = 0 == m_exit_code ? wxString(Z("Everything went fine.")) : 1 == m_exit_code ? status_1 : 2 == m_exit_code ? wxString(Z("There were ERRORs.")) : wxString(wxT("")); update_label(wxString::Format(format, m_exit_code, status_str.c_str())); SetTitle(Z("mkvmerge has finished")); st_remaining_time_label->SetLabel(wxEmptyString); st_remaining_time->SetLabel(wxEmptyString); b_ok->Enable(true); b_ok->SetFocus(); #if defined(SYS_WINDOWS) change_abort_button(); if (m_taskbar_progress) m_taskbar_progress->set_state(0 != m_exit_code ? TBPF_ERROR : TBPF_NOPROGRESS); #else // SYS_WINDOWS b_abort->Enable(false); #endif // SYS_WINDOWS delete m_process; m_process = nullptr; }
void mux_dialog::done(int status) { SetTitle(Z("mkvmerge has finished")); st_remaining_time_label->SetLabel(wxEmptyString); st_remaining_time->SetLabel(wxEmptyString); pid = 0; b_ok->Enable(true); b_ok->SetFocus(); #if defined(SYS_WINDOWS) change_abort_button(); if (NULL != m_taskbar_progress) m_taskbar_progress->set_state(0 != status ? TBPF_ERROR : TBPF_NOPROGRESS); #else // SYS_WINDOWS b_abort->Enable(false); #endif // SYS_WINDOWS wxLogMessage(wxT("Muxing done, status: %d"), status); }