Make the fonts collector dialog modeless

Originally committed to SVN as r6555.
This commit is contained in:
Thomas Goyne 2012-03-09 00:24:01 +00:00
parent 6b141f2bd3
commit 8ec478db36
3 changed files with 9 additions and 7 deletions

View file

@ -101,8 +101,7 @@ struct tool_font_collector : public Command {
STR_HELP("Open fonts collector")
void operator()(agi::Context *c) {
c->videoController->Stop();
DialogFontsCollector(c->parent, c->ass).ShowModal();
c->dialog->Show<DialogFontsCollector>(c);
}
};

View file

@ -32,6 +32,7 @@
#include "ass_file.h"
#include "compat.h"
#include "help_button.h"
#include "include/aegisub/context.h"
#include "libresrc/libresrc.h"
#include "main.h"
#include "scintilla_text_ctrl.h"
@ -179,9 +180,9 @@ public:
}
};
DialogFontsCollector::DialogFontsCollector(wxWindow *parent, AssFile *ass)
: wxDialog(parent, -1, _("Fonts Collector"))
, subs(ass)
DialogFontsCollector::DialogFontsCollector(agi::Context *c)
: wxDialog(c->parent, -1, _("Fonts Collector"))
, subs(c->ass)
{
SetIcon(BitmapToIcon(GETIMAGE(font_collector_button_24)));
@ -194,7 +195,7 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent, AssFile *ass)
collection_mode = new wxRadioBox(this, -1, "Action", wxDefaultPosition, wxDefaultSize, 4, modes, 1);
collection_mode->SetSelection(mid<int>(0, OPT_GET("Tool/Fonts Collector/Action")->GetInt(), 3));
if (!ass->filename)
if (!subs->filename)
collection_mode->Enable(2, false);
wxStaticBoxSizer *destination_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Destination"));

View file

@ -25,6 +25,8 @@
#include <wx/dialog.h>
#endif
namespace agi { struct Context; }
class AssFile;
class ScintillaTextCtrl;
class wxButton;
@ -59,5 +61,5 @@ class DialogFontsCollector : public wxDialog {
void OnCollectionComplete(wxThreadEvent &);
public:
DialogFontsCollector(wxWindow *parent, AssFile *subs);
DialogFontsCollector(agi::Context *c);
};