diff --git a/src/command/app.cpp b/src/command/app.cpp index 418a0f8b7..61467f610 100644 --- a/src/command/app.cpp +++ b/src/command/app.cpp @@ -46,7 +46,6 @@ #include "../main.h" #include "../options.h" #include "../project.h" -#include "../preferences.h" #include "../utils.h" namespace { @@ -209,7 +208,7 @@ struct app_options final : public Command { void operator()(agi::Context *c) override { try { - while (Preferences(c->parent).ShowModal() < 0); + ShowPreferences(c->parent); } catch (agi::Exception& e) { LOG_E("config/init") << "Caught exception: " << e.GetMessage(); } diff --git a/src/dialogs.h b/src/dialogs.h index e11d23419..2e03d09e9 100644 --- a/src/dialogs.h +++ b/src/dialogs.h @@ -56,20 +56,21 @@ int GetSelectedChoices(wxWindow *parent, wxArrayInt& selections, wxString const& std::string CreateDummyVideo(wxWindow *parent); +bool ShowPasteOverDialog(wxWindow *parent); +bool ShowPlainTextImportDialog(); void ShowAboutDialog(wxWindow *parent); void ShowAttachmentsDialog(wxWindow *parent, AssFile *file); -void ShowSelectLinesDialog(agi::Context *c); +void ShowAutomationDialog(agi::Context *c); void ShowExportDialog(agi::Context *c); -void ShowPropertiesDialog(agi::Context *c); void ShowFontsCollectorDialog(agi::Context *c); -bool ShowPlainTextImportDialog(); +void ShowJumpToDialog(agi::Context *c); void ShowKanjiTimerDialog(agi::Context *c); -bool ShowPasteOverDialog(wxWindow *parent); -void ShowSpellcheckerDialog(agi::Context *c); +void ShowLogWindow(agi::Context *c); +void ShowPreferences(wxWindow *parent); +void ShowPropertiesDialog(agi::Context *c); +void ShowSelectLinesDialog(agi::Context *c); void ShowShiftTimesDialog(agi::Context *c); +void ShowSpellcheckerDialog(agi::Context *c); void ShowStyleManagerDialog(agi::Context *c); void ShowTimingProcessorDialog(agi::Context *c); -void ShowJumpToDialog(agi::Context *c); -void ShowVideoDetailsDialog(agi::Context *c); -void ShowLogWindow(agi::Context *c); -void ShowAutomationDialog(agi::Context *c); +void ShowVideoDetailsDialog(agi::Context *c); diff --git a/src/preferences.cpp b/src/preferences.cpp index bd635fad0..c7c4f6d0c 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -733,3 +733,7 @@ Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences" Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Options"), wxID_HELP); defaultButton->Bind(wxEVT_BUTTON, &Preferences::OnResetDefault, this); } + +void ShowPreferences(wxWindow *parent) { + while (Preferences(parent).ShowModal() < 0); +}