Remove a lot of pointless headers for dialogs

Most of the dialogs in Aegisub have a public interface consisting of a
single function, so there's really no need to expose the actual dialog
classes to the rest of the program. Add dialogs.h with the declarations
of all of those functions (most of which are just ShowFooDialog()), and
kill a million other headers.
This commit is contained in:
Thomas Goyne 2014-05-22 12:07:15 -07:00
parent 49357eec20
commit 2bf23af00a
64 changed files with 1023 additions and 1953 deletions

View File

@ -142,38 +142,15 @@
<ClInclude Include="$(SrcDir)command\command.h" />
<ClInclude Include="$(SrcDir)compat.h" />
<ClInclude Include="$(SrcDir)crash_writer.h" />
<ClInclude Include="$(SrcDir)dialog_about.h" />
<ClInclude Include="$(SrcDir)dialog_attachments.h" />
<ClInclude Include="$(SrcDir)dialog_automation.h" />
<ClInclude Include="$(SrcDir)dialog_autosave.h" />
<ClInclude Include="$(SrcDir)dialog_colorpicker.h" />
<ClInclude Include="$(SrcDir)dialog_detached_video.h" />
<ClInclude Include="$(SrcDir)dialog_dummy_video.h" />
<ClInclude Include="$(SrcDir)dialog_export.h" />
<ClInclude Include="$(SrcDir)dialog_export_ebu3264.h" />
<ClInclude Include="$(SrcDir)dialog_fonts_collector.h" />
<ClInclude Include="$(SrcDir)dialog_jumpto.h" />
<ClInclude Include="$(SrcDir)dialog_kara_timing_copy.h" />
<ClInclude Include="$(SrcDir)dialog_log.h" />
<ClInclude Include="$(SrcDir)dialog_manager.h" />
<ClInclude Include="$(SrcDir)dialog_paste_over.h" />
<ClInclude Include="$(SrcDir)dialog_progress.h" />
<ClInclude Include="$(SrcDir)dialog_properties.h" />
<ClInclude Include="$(SrcDir)dialog_resample.h" />
<ClInclude Include="$(SrcDir)dialog_search_replace.h" />
<ClInclude Include="$(SrcDir)dialog_selected_choices.h" />
<ClInclude Include="$(SrcDir)dialog_selection.h" />
<ClInclude Include="$(SrcDir)dialog_shift_times.h" />
<ClInclude Include="$(SrcDir)dialog_spellchecker.h" />
<ClInclude Include="$(SrcDir)dialog_style_editor.h" />
<ClInclude Include="$(SrcDir)dialog_style_manager.h" />
<ClInclude Include="$(SrcDir)dialog_styling_assistant.h" />
<ClInclude Include="$(SrcDir)dialog_text_import.h" />
<ClInclude Include="$(SrcDir)dialog_timing_processor.h" />
<ClInclude Include="$(SrcDir)dialog_translation.h" />
<ClInclude Include="$(SrcDir)dialog_version_check.h" />
<ClInclude Include="$(SrcDir)dialog_video_details.h" />
<ClInclude Include="$(SrcDir)dialog_video_properties.h" />
<ClInclude Include="$(SrcDir)dialogs.h" />
<ClInclude Include="$(SrcDir)export_fixstyle.h" />
<ClInclude Include="$(SrcDir)export_framerate.h" />
<ClInclude Include="$(SrcDir)factory_manager.h" />

View File

@ -219,18 +219,6 @@
<ClInclude Include="$(SrcDir)fft.h">
<Filter>Audio</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_attachments.h">
<Filter>Features\Attachments</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_jumpto.h">
<Filter>Video\UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_video_details.h">
<Filter>Video\UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_style_manager.h">
<Filter>Features\Style editor</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_style_editor.h">
<Filter>Features\Style editor</Filter>
</ClInclude>
@ -240,18 +228,9 @@
<ClInclude Include="$(SrcDir)font_file_lister_fontconfig.h">
<Filter>Features\Font collector</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_fonts_collector.h">
<Filter>Features\Font collector</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_dummy_video.h">
<Filter>Video\UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_detached_video.h">
<Filter>Video\UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_export.h">
<Filter>Features\Export</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_export_ebu3264.h">
<Filter>Features\Export</Filter>
</ClInclude>
@ -267,27 +246,12 @@
<ClInclude Include="$(SrcDir)auto4_lua_factory.h">
<Filter>Automation\Lua</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_automation.h">
<Filter>Automation\UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_paste_over.h">
<Filter>Features\Paste Over</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_shift_times.h">
<Filter>Features\Shift Times</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_translation.h">
<Filter>Features\Translation Assistant</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)colorspace.h">
<Filter>Features\Colour picker</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_colorpicker.h">
<Filter>Features\Colour picker</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_kara_timing_copy.h">
<Filter>Features\Karaoke copier</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)gl_wrap.h">
<Filter>Video\UI</Filter>
</ClInclude>
@ -324,30 +288,15 @@
<ClInclude Include="$(SrcDir)subtitle_format_ttxt.h">
<Filter>Subtitle formats</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_spellchecker.h">
<Filter>Features\Spell checker</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)spellchecker_hunspell.h">
<Filter>Features\Spell checker</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)thesaurus.h">
<Filter>Features\Thesaurus</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_resample.h">
<Filter>Features\Resolution resampler</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_text_import.h">
<Filter>Features\Import</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_timing_processor.h">
<Filter>Features\Timing post-processor</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_styling_assistant.h">
<Filter>Features\Styling assistant</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_version_check.h">
<Filter>Features\Update checker</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)video_controller.h">
<Filter>Video</Filter>
</ClInclude>
@ -510,36 +459,21 @@
<ClInclude Include="$(SrcDir)version.h">
<Filter>Features\About box</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_about.h">
<Filter>Features\About box</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_selection.h">
<Filter>Features\Conditional select lines</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_search_replace.h">
<Filter>Features\Search-replace</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_selected_choices.h">
<Filter>Utilities\UI utilities</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_progress.h">
<Filter>Utilities\UI utilities</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)persist_location.h">
<Filter>Utilities\UI utilities</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_log.h">
<Filter>Utilities\Logging</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)crash_writer.h">
<Filter>Utilities\Logging</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)utils.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_properties.h">
<Filter>Features\File properties</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)ass_karaoke.h">
<Filter>ASS</Filter>
</ClInclude>
@ -591,9 +525,6 @@
<ClInclude Include="$(SrcDir)placeholder_ctrl.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_autosave.h">
<Filter>Features\Autosave</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)ass_info.h">
<Filter>ASS</Filter>
</ClInclude>
@ -618,15 +549,15 @@
<ClInclude Include="$(SrcDir)subtitle_format_ssa.h">
<Filter>Subtitle formats</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialog_video_properties.h">
<Filter>Features\Resolution resampler</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)async_video_provider.h">
<Filter>Video\Providers</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)project.h">
<Filter>Main UI</Filter>
</ClInclude>
<ClInclude Include="$(SrcDir)dialogs.h">
<Filter>Features</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SrcDir)ass_dialogue.cpp">
@ -1192,4 +1123,4 @@
<ResourceCompile Include="$(SrcDir)res\res.rc" />
<ResourceCompile Include="$(SrcDir)res\strings.rc" />
</ItemGroup>
</Project>
</Project>

View File

@ -17,7 +17,7 @@
#include "colour_button.h"
#include "compat.h"
#include "dialog_colorpicker.h"
#include "dialogs.h"
#include <boost/gil/gil_all.hpp>

View File

@ -37,11 +37,9 @@
#include <libaegisub/make_unique.h>
#include "../compat.h"
#include "../dialog_about.h"
#include "../dialog_detached_video.h"
#include "../dialog_log.h"
#include "../dialog_manager.h"
#include "../dialog_version_check.h"
#include "../dialogs.h"
#include "../frame_main.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
@ -62,7 +60,7 @@ struct app_about final : public Command {
STR_HELP("About Aegisub")
void operator()(agi::Context *c) override {
AboutScreen(c->parent).ShowModal();
ShowAboutDialog(c->parent);
}
};
@ -186,7 +184,7 @@ struct app_log final : public Command {
STR_HELP("View the event log")
void operator()(agi::Context *c) override {
c->dialog->Show<LogWindow>(c);
ShowLogWindow(c);
}
};

View File

@ -32,8 +32,7 @@
#include "command.h"
#include "../auto4_base.h"
#include "../dialog_automation.h"
#include "../dialog_manager.h"
#include "../dialogs.h"
#include "../frame_main.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
@ -80,7 +79,7 @@ struct open_manager final : public Command {
STR_HELP("Open automation manager")
void operator()(agi::Context *c) override {
c->dialog->Show<DialogAutomation>(c);
ShowAutomationDialog(c);
}
};

View File

@ -36,9 +36,8 @@
#include "../ass_karaoke.h"
#include "../ass_style.h"
#include "../compat.h"
#include "../dialog_colorpicker.h"
#include "../dialog_paste_over.h"
#include "../dialog_search_replace.h"
#include "../dialogs.h"
#include "../include/aegisub/context.h"
#include "../initial_line_state.h"
#include "../libresrc/libresrc.h"
@ -138,7 +137,7 @@ void paste_lines(agi::Context *c, bool paste_over, Paster&& paste_line) {
AssDialogue *paste_over(wxWindow *parent, std::vector<bool>& pasteOverOptions, AssDialogue *new_line, AssDialogue *old_line) {
if (pasteOverOptions.empty()) {
if (DialogPasteOver(parent).ShowModal()) return nullptr;
if (!ShowPasteOverDialog(parent)) return nullptr;
pasteOverOptions = OPT_GET("Tool/Paste Lines Over/Fields")->GetListBool();
}

View File

@ -34,12 +34,8 @@
#include "../ass_dialogue.h"
#include "../ass_file.h"
#include "../compat.h"
#include "../dialog_attachments.h"
#include "../dialog_autosave.h"
#include "../dialog_manager.h"
#include "../dialog_properties.h"
#include "../dialog_search_replace.h"
#include "../dialog_spellchecker.h"
#include "../dialogs.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
#include "../options.h"
@ -85,7 +81,7 @@ struct subtitle_attachment final : public Command {
void operator()(agi::Context *c) override {
c->videoController->Stop();
DialogAttachments(c->parent, c->ass.get()).ShowModal();
ShowAttachmentsDialog(c->parent, c->ass.get());
}
};
@ -255,9 +251,9 @@ struct subtitle_open_autosave final : public Command {
void operator()(agi::Context *c) override {
if (c->subsController->TryToClose() == wxCANCEL) return;
DialogAutosave dialog(c->parent);
if (dialog.ShowModal() == wxID_OK)
c->project->LoadSubtitles(dialog.ChosenFile());
auto file = PickAutosaveFile(c->parent);
if (!file.empty())
c->project->LoadSubtitles(file);
}
};
@ -307,7 +303,7 @@ struct subtitle_properties final : public Command {
void operator()(agi::Context *c) override {
c->videoController->Stop();
DialogProperties(c).ShowModal();
ShowPropertiesDialog(c);
}
};
@ -417,7 +413,7 @@ struct subtitle_spellcheck final : public Command {
void operator()(agi::Context *c) override {
c->videoController->Stop();
c->dialog->Show<DialogSpellChecker>(c);
ShowSpellcheckerDialog(c);
}
};
}

View File

@ -36,8 +36,7 @@
#include "../async_video_provider.h"
#include "../audio_controller.h"
#include "../audio_timing.h"
#include "../dialog_manager.h"
#include "../dialog_shift_times.h"
#include "../dialogs.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
#include "../options.h"
@ -156,7 +155,7 @@ struct time_shift final : public Command {
STR_HELP("Shift subtitles by time or frames")
void operator()(agi::Context *c) override {
c->dialog->Show<DialogShiftTimes>(c);
ShowShiftTimesDialog(c);
}
};

View File

@ -32,16 +32,10 @@
#include "command.h"
#include "../compat.h"
#include "../dialog_export.h"
#include "../dialog_fonts_collector.h"
#include "../dialog_kara_timing_copy.h"
#include "../dialog_manager.h"
#include "../dialog_resample.h"
#include "../dialog_selection.h"
#include "../dialog_style_manager.h"
#include "../dialog_styling_assistant.h"
#include "../dialog_timing_processor.h"
#include "../dialog_translation.h"
#include "../dialogs.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
#include "../options.h"
@ -79,7 +73,7 @@ struct tool_export final : public Command {
void operator()(agi::Context *c) override {
c->videoController->Stop();
DialogExport(c).ShowModal();
ShowExportDialog(c);
}
};
@ -91,7 +85,7 @@ struct tool_font_collector final : public Command {
STR_HELP("Open fonts collector")
void operator()(agi::Context *c) override {
c->dialog->Show<DialogFontsCollector>(c);
ShowFontsCollectorDialog(c);
}
};
@ -103,7 +97,7 @@ struct tool_line_select final : public Command {
STR_HELP("Select lines based on defined criteria")
void operator()(agi::Context *c) override {
c->dialog->Show<DialogSelection>(c);
ShowSelectLinesDialog(c);
}
};
@ -117,7 +111,7 @@ struct tool_resampleres final : public Command {
void operator()(agi::Context *c) override {
c->videoController->Stop();
ResampleSettings settings;
if (DialogResample(c, settings).ShowModal() == wxID_OK)
if (PromptForResampleSettings(c, settings))
ResampleResolution(c->ass.get(), settings);
}
};
@ -172,7 +166,7 @@ struct tool_style_manager final : public Command {
STR_HELP("Open the styles manager")
void operator()(agi::Context *c) override {
c->dialog->Show<DialogStyleManager>(c);
ShowStyleManagerDialog(c);
}
};
@ -184,7 +178,7 @@ struct tool_time_kanji final : public Command {
STR_HELP("Open the Kanji timer copier")
void operator()(agi::Context *c) override {
DialogKanjiTimer(c).ShowModal();
ShowKanjiTimerDialog(c);
}
};
@ -196,7 +190,7 @@ struct tool_time_postprocess final : public Command {
STR_HELP("Post-process the subtitle timing to add lead-ins and lead-outs, snap timing to scene changes, etc.")
void operator()(agi::Context *c) override {
DialogTimingProcessor(c).ShowModal();
ShowTimingProcessorDialog(c);
}
};

View File

@ -36,10 +36,8 @@
#include "../async_video_provider.h"
#include "../compat.h"
#include "../dialog_detached_video.h"
#include "../dialog_dummy_video.h"
#include "../dialog_jumpto.h"
#include "../dialog_manager.h"
#include "../dialog_video_details.h"
#include "../dialogs.h"
#include "../frame_main.h"
#include "../include/aegisub/context.h"
#include "../include/aegisub/subtitles_provider.h"
@ -270,7 +268,7 @@ struct video_details final : public validator_video_loaded {
void operator()(agi::Context *c) override {
c->videoController->Stop();
DialogVideoDetails(c).ShowModal();
ShowVideoDetailsDialog(c);
}
};
@ -529,7 +527,7 @@ struct video_jump final : public validator_video_loaded {
void operator()(agi::Context *c) override {
c->videoController->Stop();
DialogJumpTo(c).ShowModal();
ShowJumpToDialog(c);
c->videoSlider->SetFocus();
}
};
@ -584,7 +582,7 @@ struct video_open_dummy final : public Command {
STR_HELP("Open a placeholder video clip with solid color")
void operator()(agi::Context *c) override {
std::string fn = DialogDummyVideo::CreateDummyVideo(c->parent);
std::string fn = CreateDummyVideo(c->parent);
if (!fn.empty())
c->project->LoadVideo(fn);
}

View File

@ -27,12 +27,11 @@
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_about.cpp
/// @brief About-dialogue box
/// @ingroup configuration_ui
///
#include "libresrc/libresrc.h"
#include "version.h"
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/statbmp.h>
@ -40,110 +39,114 @@
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include "dialog_about.h"
#include "libresrc/libresrc.h"
#include "version.h"
AboutScreen::AboutScreen(wxWindow *parent)
: wxDialog (parent, -1, _("About Aegisub"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX , _("About Aegisub"))
{
// Generate library string
wxString libString = "Aegisub includes portions from the following other projects:\n";
libString += " wxWidgets - Copyright (c) Julian Smart, Robert Roebling et al;\n";
libString += " wxStyledTextCtrl - Copyright (c) Robin Dunn, Neil Hodgson;\n";
libString += " Scintilla - Copyright (c) Neil Hodgson;\n";
libString += " Boost - Copyright (c) Beman Dawes, David Abrahams et al;\n";
libString += " UniversalCharDet - Copyright (c) Netscape Communications Corp.;\n";
libString += " ICU - Copyright (c) International Business Machines Corp.;\n";
libString += " Lua - Copyright (c) Lua.org, PUC-Rio;\n";
libString += " LuaJIT - Copyright (c) Mike Pall;\n";
libString += " luabins - Copyright (c) Alexander Gladysh;\n";
namespace {
struct AboutScreen : wxDialog {
AboutScreen(wxWindow *parent)
: wxDialog(parent, -1, _("About Aegisub"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX, _("About Aegisub"))
{
// Generate library string
wxString libString = "Aegisub includes portions from the following other projects:\n";
libString += " wxWidgets - Copyright (c) Julian Smart, Robert Roebling et al;\n";
libString += " wxStyledTextCtrl - Copyright (c) Robin Dunn, Neil Hodgson;\n";
libString += " Scintilla - Copyright (c) Neil Hodgson;\n";
libString += " Boost - Copyright (c) Beman Dawes, David Abrahams et al;\n";
libString += " UniversalCharDet - Copyright (c) Netscape Communications Corp.;\n";
libString += " ICU - Copyright (c) International Business Machines Corp.;\n";
libString += " Lua - Copyright (c) Lua.org, PUC-Rio;\n";
libString += " LuaJIT - Copyright (c) Mike Pall;\n";
libString += " luabins - Copyright (c) Alexander Gladysh;\n";
#ifdef WITH_HUNSPELL
libString += " Hunspell - Copyright (c) Kevin Hendricks;\n";
libString += " Hunspell - Copyright (c) Kevin Hendricks;\n";
#endif
#ifdef WITH_PORTAUDIO
libString += " PortAudio - Copyright (c) Ross Bencina, Phil Burk;\n";
libString += " PortAudio - Copyright (c) Ross Bencina, Phil Burk;\n";
#endif
#ifdef WITH_FFMS2
libString += " FFmpeg - Copyright (c) Fabrice Bellard;\n";
libString += " FFMS2 - Copyright (c) Fredrik Mellbin;\n";
libString += " FFmpeg - Copyright (c) Fabrice Bellard;\n";
libString += " FFMS2 - Copyright (c) Fredrik Mellbin;\n";
#endif
#ifdef WITH_AVISYNTH
libString += " Avisynth 2.5 - Copyright (c) Ben Rudiak-Gould et al;\n";
libString += " Avisynth 2.5 - Copyright (c) Ben Rudiak-Gould et al;\n";
#endif
#ifdef WITH_CSRI
libString += " csri - Copyright (c) David Lamparter;\n";
libString += " csri - Copyright (c) David Lamparter;\n";
# ifdef __WINDOWS__
libString += " vsfilter - Copyright (c) Gabest et al;\n";
libString += " vsfilter - Copyright (c) Gabest et al;\n";
# endif
#endif
libString += " libass - Copyright (c) Evgeniy Stepanov, Grigori Goronzy;\n";
libString += " libass - Copyright (c) Evgeniy Stepanov, Grigori Goronzy;\n";
#ifdef __WINDOWS__
libString += " Matroska Parser - Copyright (c) Mike Matsnev;\n";
libString += " Matroska Parser - Copyright (c) Mike Matsnev;\n";
#endif
libString += " Freetype - Copyright (c) David Turner, Robert Wilhelm, Werner Lemberg;\n";
libString += " Fontconfig - Copyright (c) Keith Packard et al;\n";
libString += " Freetype - Copyright (c) David Turner, Robert Wilhelm, Werner Lemberg;\n";
libString += " Fontconfig - Copyright (c) Keith Packard et al;\n";
#ifdef WITH_FFTW3
libString += " FFTW - Copyright (c) Matteo Frigo, Massachusetts Institute of Technology;\n";
libString += " FFTW - Copyright (c) Matteo Frigo, Massachusetts Institute of Technology;\n";
#endif
wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n");
if (translatorCredit == "Translated into LANGUAGE by PERSON\n") translatorCredit.Clear();
wxString translatorCredit = _("Translated into LANGUAGE by PERSON\n");
if (translatorCredit == "Translated into LANGUAGE by PERSON\n") translatorCredit.Clear();
// Generate about string
wxString aboutString;
aboutString += wxString("Aegisub ") + GetAegisubShortVersionString() + ".\n";
aboutString += "Copyright (c) 2005-2014 Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et al.\n\n";
aboutString += "Programmers:\n";
aboutString += " Alysson Souza e Silva\n";
aboutString += " Amar Takhar\n";
aboutString += " Dan Donovan\n";
aboutString += " Daniel Moscoviter\n";
aboutString += " David Conrad\n";
aboutString += " David Lamparter\n";
aboutString += " Eric Batalitzky\n";
aboutString += " Evgeniy Stepanov\n";
aboutString += " Fredrik Mellbin\n";
aboutString += " Grigori Goronzy\n";
aboutString += " Karl Blomster\n";
aboutString += " Mike Matsnev\n";
aboutString += " Moritz Brunner\n";
aboutString += " Muhammad Lukman Nasaruddin\n";
aboutString += " Niels Martin Hansen\n";
aboutString += " Patryk Pomykalski\n";
aboutString += " Ravi Pinjala\n";
aboutString += " Rodrigo Braz Monteiro\n";
aboutString += " Simone Cociancich\n";
aboutString += " Thomas Goyne\n";
aboutString += "User manual written by:\n";
aboutString += " Karl Blomster\n";
aboutString += " Niels Martin Hansen\n";
aboutString += " Rodrigo Braz Monteiro\n";
aboutString += "Icons by:\n";
aboutString += " Philip Cash\n";
aboutString += "Additional thanks to:\n";
aboutString += " Mentar\n";
aboutString += " Sigurd Tao Lyngse\n";
aboutString += " Everyone in the Aegisub IRC channel\n";
aboutString += " Everyone who ever reported a bug\n";
aboutString += translatorCredit;
aboutString += "\n" + libString;
aboutString += _("\nSee the help file for full credits.\n");
aboutString += wxString::Format(_("Built by %s on %s."), GetAegisubBuildCredit(), GetAegisubBuildTime());
// Generate about string
wxString aboutString;
aboutString += wxString("Aegisub ") + GetAegisubShortVersionString() + ".\n";
aboutString += "Copyright (c) 2005-2014 Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et al.\n\n";
aboutString += "Programmers:\n";
aboutString += " Alysson Souza e Silva\n";
aboutString += " Amar Takhar\n";
aboutString += " Dan Donovan\n";
aboutString += " Daniel Moscoviter\n";
aboutString += " David Conrad\n";
aboutString += " David Lamparter\n";
aboutString += " Eric Batalitzky\n";
aboutString += " Evgeniy Stepanov\n";
aboutString += " Fredrik Mellbin\n";
aboutString += " Grigori Goronzy\n";
aboutString += " Karl Blomster\n";
aboutString += " Mike Matsnev\n";
aboutString += " Moritz Brunner\n";
aboutString += " Muhammad Lukman Nasaruddin\n";
aboutString += " Niels Martin Hansen\n";
aboutString += " Patryk Pomykalski\n";
aboutString += " Ravi Pinjala\n";
aboutString += " Rodrigo Braz Monteiro\n";
aboutString += " Simone Cociancich\n";
aboutString += " Thomas Goyne\n";
aboutString += "User manual written by:\n";
aboutString += " Karl Blomster\n";
aboutString += " Niels Martin Hansen\n";
aboutString += " Rodrigo Braz Monteiro\n";
aboutString += "Icons by:\n";
aboutString += " Philip Cash\n";
aboutString += "Additional thanks to:\n";
aboutString += " Mentar\n";
aboutString += " Sigurd Tao Lyngse\n";
aboutString += " Everyone in the Aegisub IRC channel\n";
aboutString += " Everyone who ever reported a bug\n";
aboutString += translatorCredit;
aboutString += "\n" + libString;
aboutString += _("\nSee the help file for full credits.\n");
aboutString += wxString::Format(_("Built by %s on %s."), GetAegisubBuildCredit(), GetAegisubBuildTime());
// Replace copyright symbol
wxChar copySymbol = 0xA9;
aboutString.Replace("(c)",wxString(copySymbol));
// Replace copyright symbol
wxChar copySymbol = 0xA9;
aboutString.Replace("(c)", wxString(copySymbol));
wxTextCtrl *textctrl = new wxTextCtrl(this, -1, aboutString, wxDefaultPosition, wxSize(-1,200), wxTE_MULTILINE|wxTE_READONLY|wxBORDER_NONE);
wxTextCtrl *textctrl = new wxTextCtrl(this, -1, aboutString, wxDefaultPosition, wxSize(-1, 200), wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE);
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
MainSizer->Add(new wxStaticBitmap(this, -1, GETIMAGE(splash)), 0, wxCENTER, 0);
MainSizer->Add(new wxStaticLine(this, wxID_ANY), 0, wxEXPAND|wxALL, 0);
MainSizer->Add(textctrl, 0, wxEXPAND|wxALL, 0);
MainSizer->Add(new wxStaticLine(this, wxID_ANY), 0, wxEXPAND|wxALL, 0);
MainSizer->Add(CreateButtonSizer(wxOK), 0, wxEXPAND|wxALL, 6);
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
MainSizer->Add(new wxStaticBitmap(this, -1, GETIMAGE(splash)), 0, wxCENTER, 0);
MainSizer->Add(new wxStaticLine(this, wxID_ANY), 0, wxEXPAND | wxALL, 0);
MainSizer->Add(textctrl, 0, wxEXPAND | wxALL, 0);
MainSizer->Add(new wxStaticLine(this, wxID_ANY), 0, wxEXPAND | wxALL, 0);
MainSizer->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxALL, 6);
SetSizerAndFit(MainSizer);
CentreOnParent();
SetSizerAndFit(MainSizer);
CentreOnParent();
}
};
}
void ShowAboutDialog(wxWindow *parent) {
AboutScreen(parent).ShowModal();
}

View File

@ -1,42 +0,0 @@
// Copyright (c) 2005, Rodrigo Braz Monteiro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_about.h
/// @see dialog_about.cpp
/// @ingroup configuration_ui
///
#include <wx/dialog.h>
/// @class AboutScreen
/// @brief About dialogue.
class AboutScreen: public wxDialog {
public:
AboutScreen(wxWindow *parent);
};

View File

@ -27,19 +27,6 @@
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_attachments.cpp
/// @brief Manage files attached to the subtitle file
/// @ingroup tools_ui
///
#include "dialog_attachments.h"
#include <wx/button.h>
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include <wx/listctrl.h>
#include <wx/sizer.h>
#include "ass_attachment.h"
#include "ass_file.h"
#include "compat.h"
@ -48,6 +35,34 @@
#include "options.h"
#include "utils.h"
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include <wx/listctrl.h>
#include <wx/sizer.h>
namespace {
class DialogAttachments final : public wxDialog {
AssFile *ass;
wxListView *listView;
wxButton *extractButton;
wxButton *deleteButton;
void OnAttachFont(wxCommandEvent &event);
void OnAttachGraphics(wxCommandEvent &event);
void OnExtract(wxCommandEvent &event);
void OnDelete(wxCommandEvent &event);
void OnListClick(wxListEvent &event);
void UpdateList();
void AttachFile(wxFileDialog &diag, wxString const& commit_msg);
public:
DialogAttachments(wxWindow *parent, AssFile *ass);
};
DialogAttachments::DialogAttachments(wxWindow *parent, AssFile *ass)
: wxDialog(parent, -1, _("Attachment List"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
, ass(ass)
@ -182,3 +197,8 @@ void DialogAttachments::OnListClick(wxListEvent &) {
extractButton->Enable(hasSel);
deleteButton->Enable(hasSel);
}
}
void ShowAttachmentsDialog(wxWindow *parent, AssFile *file) {
DialogAttachments(parent, file).ShowModal();
}

View File

@ -1,60 +0,0 @@
// Copyright (c) 2006, Rodrigo Braz Monteiro
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_attachments.h
/// @see dialog_attachments.cpp
/// @ingroup tools_ui
///
class AssFile;
class wxFileDialog;
class wxListView;
class wxListEvent;
#include <wx/dialog.h>
class DialogAttachments final : public wxDialog {
AssFile *ass;
wxListView *listView;
wxButton *extractButton;
wxButton *deleteButton;
void OnAttachFont(wxCommandEvent &event);
void OnAttachGraphics(wxCommandEvent &event);
void OnExtract(wxCommandEvent &event);
void OnDelete(wxCommandEvent &event);
void OnListClick(wxListEvent &event);
void UpdateList();
void AttachFile(wxFileDialog &diag, wxString const& commit_msg);
public:
DialogAttachments(wxWindow *parent, AssFile *ass);
};

View File

@ -27,16 +27,10 @@
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_automation.cpp
/// @brief Manage loaded Automation scripts
/// @ingroup secondary_ui
///
#include "dialog_automation.h"
#include "auto4_base.h"
#include "compat.h"
#include "command/command.h"
#include "dialog_manager.h"
#include "help_button.h"
#include "include/aegisub/context.h"
#include "libresrc/libresrc.h"
@ -44,16 +38,71 @@
#include "main.h"
#include "subtitle_format.h"
#include <libaegisub/signal.h>
#include <algorithm>
#include <boost/range/algorithm.hpp>
#include <vector>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/filedlg.h>
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
namespace {
/// Struct to attach a flag for global/local to scripts
struct ExtraScriptInfo {
Automation4::Script *script;
bool is_global;
};
class DialogAutomation final : public wxDialog {
agi::Context *context;
/// Currently loaded scripts
std::vector<ExtraScriptInfo> script_info;
/// File-local script manager
Automation4::ScriptManager *local_manager;
/// Listener for external changes to the local scripts
agi::signal::Connection local_scripts_changed;
/// Global script manager
Automation4::ScriptManager *global_manager;
/// Listener for external changes to the global scripts
agi::signal::Connection global_scripts_changed;
/// List of loaded scripts
wxListView *list;
/// Unload a local script
wxButton *remove_button;
/// Reload a script
wxButton *reload_button;
void RebuildList();
void AddScript(Automation4::Script *script, bool is_global);
void SetScriptInfo(int i, Automation4::Script *script);
void UpdateDisplay();
void OnAdd(wxCommandEvent &);
void OnRemove(wxCommandEvent &);
void OnReload(wxCommandEvent &);
void OnInfo(wxCommandEvent &);
void OnReloadAutoload(wxCommandEvent &);
public:
DialogAutomation(agi::Context *context);
};
DialogAutomation::DialogAutomation(agi::Context *c)
: wxDialog(c->parent, -1, _("Automation Manager"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, context(c)
@ -261,3 +310,8 @@ void DialogAutomation::OnReloadAutoload(wxCommandEvent &)
{
global_manager->Reload();
}
}
void ShowAutomationDialog(agi::Context *c) {
c->dialog->Show<DialogAutomation>(c);
}

View File

@ -1,101 +0,0 @@
// Copyright (c) 2005, Niels Martin Hansen
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_automation.h
/// @see dialog_automation.cpp
/// @ingroup secondary_ui
///
#include <vector>
#include <wx/dialog.h>
#include <libaegisub/signal.h>
namespace Automation4 {
class ScriptManager;
class AutoloadScriptManager;
class Script;
}
namespace agi { struct Context; }
class wxButton;
class wxListEvent;
class wxListView;
class DialogAutomation final : public wxDialog {
agi::Context *context;
/// Struct to attach a flag for global/local to scripts
struct ExtraScriptInfo {
Automation4::Script *script;
bool is_global;
};
/// Currently loaded scripts
std::vector<ExtraScriptInfo> script_info;
/// File-local script manager
Automation4::ScriptManager *local_manager;
/// Listener for external changes to the local scripts
agi::signal::Connection local_scripts_changed;
/// Global script manager
Automation4::ScriptManager *global_manager;
/// Listener for external changes to the global scripts
agi::signal::Connection global_scripts_changed;
/// List of loaded scripts
wxListView *list;
/// Unload a local script
wxButton *remove_button;
/// Reload a script
wxButton *reload_button;
void RebuildList();
void AddScript(Automation4::Script *script, bool is_global);
void SetScriptInfo(int i, Automation4::Script *script);
void UpdateDisplay();
void OnAdd(wxCommandEvent &);
void OnRemove(wxCommandEvent &);
void OnReload(wxCommandEvent &);
void OnInfo(wxCommandEvent &);
void OnReloadAutoload(wxCommandEvent &);
public:
DialogAutomation(agi::Context *context);
};

View File

@ -14,24 +14,51 @@
//
// Aegisub Project http://www.aegisub.org/
#include "dialog_autosave.h"
#include "compat.h"
#include "libresrc/libresrc.h"
#include "options.h"
#include <libaegisub/path.h>
#include <cstdint>
#include <boost/range/adaptor/map.hpp>
#include <map>
#include <string>
#include <vector>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/listbox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/string.h>
namespace {
struct Version {
wxString filename;
wxDateTime date;
wxString display;
};
struct AutosaveFile {
wxString name;
std::vector<Version> versions;
};
class DialogAutosave final : public wxDialog {
std::vector<AutosaveFile> files;
wxListBox *file_list;
wxListBox *version_list;
void Populate(std::map<wxString, AutosaveFile> &files_map, std::string const& path, wxString const& filter, wxString const& name_fmt);
void OnSelectFile(wxCommandEvent&);
public:
DialogAutosave(wxWindow *parent);
std::string ChosenFile() const;
};
DialogAutosave::DialogAutosave(wxWindow *parent)
: wxDialog(parent, -1, _("Open autosave file"), wxDefaultPosition, wxSize(800, 350), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
@ -138,3 +165,11 @@ std::string DialogAutosave::ChosenFile() const {
return from_wx(files[sel_file].versions[sel_version].filename);
}
}
std::string PickAutosaveFile(wxWindow *parent) {
DialogAutosave dialog(parent);
if (dialog.ShowModal() == wxID_OK)
return dialog.ChosenFile();
return "";
}

View File

@ -1,50 +0,0 @@
// Copyright (c) 2012, Thomas Goyne <plorkyeran@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// Aegisub Project http://www.aegisub.org/
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include <wx/dialog.h>
#include <wx/string.h>
class wxListBox;
class DialogAutosave final : public wxDialog {
struct Version {
wxString filename;
wxDateTime date;
wxString display;
};
struct AutosaveFile {
wxString name;
std::vector<Version> versions;
};
std::vector<AutosaveFile> files;
wxListBox *file_list;
wxListBox *version_list;
void Populate(std::map<wxString, AutosaveFile> &files_map, std::string const& path, wxString const& filter, wxString const& name_fmt);
void OnSelectFile(wxCommandEvent&);
public:
DialogAutosave(wxWindow *parent);
std::string ChosenFile() const;
};

View File

@ -27,13 +27,6 @@
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_colorpicker.cpp
/// @brief Custom colour-selection dialogue box
/// @ingroup tools_ui
///
#include "dialog_colorpicker.h"
#include "ass_style.h"
#include "colorspace.h"
#include "compat.h"

View File

@ -1,34 +0,0 @@
// Copyright (c) 2012, Thomas Goyne <plorkyeran@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_colorpicker.h
/// @see dialog_colorpicker.cpp
/// @ingroup tools_ui
///
#include <functional>
#include <libaegisub/color.h>
class wxWindow;
/// @brief Get a color from the user via a color picker dialog
/// @param parent Parent window
/// @param original Initial color to select
/// @param alpha Include controls for alpha
/// @param callback Function called whenever the selected color changes
/// @return Did the user accept the new color?
bool GetColorFromUser(wxWindow* parent, agi::Color original, bool alpha, std::function<void (agi::Color)> callback);

View File

@ -14,15 +14,19 @@
//
// Aegisub Project http://www.aegisub.org/
/// @file dialog_dummy_video.cpp
/// @brief Set up dummy video provider
/// @ingroup secondary_ui
///
#include "ass_time.h"
#include "colour_button.h"
#include "help_button.h"
#include "libresrc/libresrc.h"
#include "options.h"
#include "validators.h"
#include "video_provider_dummy.h"
#include "dialog_dummy_video.h"
#include <libaegisub/color.h>
#include <wx/checkbox.h>
#include <wx/combobox.h>
#include <wx/dialog.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/statline.h>
@ -32,15 +36,26 @@
#include <wx/valgen.h>
#include <wx/valnum.h>
#include "ass_time.h"
#include "colour_button.h"
#include "help_button.h"
#include "libresrc/libresrc.h"
#include "options.h"
#include "validators.h"
#include "video_provider_dummy.h"
namespace {
struct DialogDummyVideo final : wxDialog {
double fps = OPT_GET("Video/Dummy/FPS")->GetDouble();
int width = OPT_GET("Video/Dummy/Last/Width")->GetInt();
int height = OPT_GET("Video/Dummy/Last/Height")->GetInt();
int length = OPT_GET("Video/Dummy/Last/Length")->GetInt();
agi::Color color = OPT_GET("Colour/Video Dummy/Last Colour")->GetColor();
bool pattern = OPT_GET("Video/Dummy/Pattern")->GetBool();
wxStaticText *length_display;
wxFlexGridSizer *sizer;
template<typename T>
void AddCtrl(wxString const& label, T *ctrl);
void OnResolutionShortcut(wxCommandEvent &evt);
void UpdateLengthDisplay();
DialogDummyVideo(wxWindow *parent);
};
struct ResolutionShortcut {
const char *name;
@ -82,16 +97,8 @@ wxComboBox *resolution_shortcuts(wxWindow *parent, int width, int height) {
return ctrl;
}
}
DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
: wxDialog(parent, -1, _("Dummy video options"))
, fps(OPT_GET("Video/Dummy/FPS")->GetDouble())
, width(OPT_GET("Video/Dummy/Last/Width")->GetInt())
, height(OPT_GET("Video/Dummy/Last/Height")->GetInt())
, length(OPT_GET("Video/Dummy/Last/Length")->GetInt())
, color(OPT_GET("Colour/Video Dummy/Last Colour")->GetColor())
, pattern(OPT_GET("Video/Dummy/Pattern")->GetBool())
{
SetIcon(GETICON(use_dummy_video_menu_16));
@ -154,8 +161,9 @@ void DialogDummyVideo::OnResolutionShortcut(wxCommandEvent &e) {
void DialogDummyVideo::UpdateLengthDisplay() {
length_display->SetLabel(wxString::Format(_("Resulting duration: %s"), AssTime(length / fps * 1000).GetAssFormated(true)));
}
}
std::string DialogDummyVideo::CreateDummyVideo(wxWindow *parent) {
std::string CreateDummyVideo(wxWindow *parent) {
DialogDummyVideo dlg(parent);
if (dlg.ShowModal() != wxID_OK)
return "";