{
public:
StatusDialog ()
- : wxDialog (0, wxID_ANY, _("DVD-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ : wxDialog (0, wxID_ANY, _("DCP-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, _timer (this, ID_timer)
{
_sizer = new wxFlexGridSizer (1, 6, 6);
public:
TaskBarIcon ()
{
+#ifdef __WXMSW__
wxIcon icon (std_to_wx ("taskbar_icon"));
- SetIcon (icon, std_to_wx ("DVD-o-matic encode server"));
+#endif
+#ifdef __WXGTK__
+ wxInitAllImageHandlers();
+ wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG);
+ wxIcon icon;
+ icon.CopyFromBitmap (bitmap);
+#endif
+ SetIcon (icon, std_to_wx ("DCP-o-matic encode server"));
Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status));
Connect (ID_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::quit));
App ()
: wxApp ()
, _thread (0)
+ , _icon (0)
{}
private:
bool OnInit ()
{
- dvdomatic_setup ();
-
- new TaskBarIcon;
+ if (!wxApp::OnInit ()) {
+ return false;
+ }
+
+ dcpomatic_setup ();
+ _icon = new TaskBarIcon;
_thread = new thread (bind (&App::main_thread, this));
+
return true;
}
+ int OnExit ()
+ {
+ delete _icon;
+ return wxApp::OnExit ();
+ }
+
void main_thread ()
{
Server server (memory_log);
}
boost::thread* _thread;
+ TaskBarIcon* _icon;
};
IMPLEMENT_APP (App)