2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <boost/thread.hpp>
21 #include <wx/taskbar.h>
25 #include "lib/server.h"
27 using namespace boost;
34 class StatusDialog : public wxDialog
38 : wxDialog (0, wxID_ANY, _("DVD-o-matic encode server"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
40 wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
41 table->AddGrowableCol (1, 1);
43 add_label_to_sizer (table, this, "Hello");
47 table->SetSizeHints (this);
51 class TaskBarIcon : public wxTaskBarIcon
56 wxIcon icon (std_to_wx ("taskbar_icon"));
57 SetIcon (icon, std_to_wx ("DVD-o-matic encode server"));
59 Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status));
60 Connect (ID_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::quit));
63 wxMenu* CreatePopupMenu ()
65 wxMenu* menu = new wxMenu;
66 menu->Append (ID_status, std_to_wx ("Status..."));
67 menu->Append (ID_quit, std_to_wx ("Quit"));
72 void status (wxCommandEvent &)
74 StatusDialog* d = new StatusDialog;
78 void quit (wxCommandEvent &)
80 wxTheApp->ExitMainLoop ();
84 class App : public wxApp
100 _thread = new thread (bind (&App::main_thread, this));
110 boost::thread* _thread;