Avoid having to include preferences.h in app.cpp

This commit is contained in:
Thomas Goyne 2014-12-28 20:28:33 -08:00
parent e485c469e2
commit 625bd7a767
3 changed files with 15 additions and 11 deletions

View File

@ -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();
}

View File

@ -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);

View File

@ -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);
}