2 /// \file BackupWindow.h
7 Copyright (C) 2007-2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
23 #include <libglademm.h>
26 #include "DeviceBus.h"
29 class BackupWindow
: public Gtk::Window
32 const Glib::RefPtr
<Gnome::Glade::Xml
> &m_xml
;
34 // dispatcher for updating thread info
35 Glib::Dispatcher m_signal_update
;
37 // Bus of Blackberry devices
40 // vector for storing Threads
41 std::vector
<std::tr1::shared_ptr
<Thread
> > m_threads
;
43 // signal exception handling connection
44 sigc::connection m_signal_handler_connection
;
47 Gtk::Statusbar
*m_pStatusbar
;
48 Gtk::Button
*m_pBackupButton
, *m_pRestoreButton
,
49 *m_pConfigButton
, *m_pDisconnectButton
,
50 *m_pDisconnectAllButton
, *m_pReloadButton
;
51 Gtk::Label
*m_pDeviceLabel
;
52 Gtk::TreeView
*m_pDeviceList
;
54 // objects used by DeviceList
55 class Columns
: public Gtk::TreeModel::ColumnRecord
58 Gtk::TreeModelColumn
<unsigned int> m_id
;
59 Gtk::TreeModelColumn
<Glib::ustring
> m_pin
;
60 Gtk::TreeModelColumn
<Glib::ustring
> m_name
;
61 Gtk::TreeModelColumn
<Glib::ustring
> m_status
;
62 Gtk::TreeModelColumn
<unsigned int> m_percentage
;
74 Glib::RefPtr
<Gtk::ListStore
> m_pListStore
;
75 Glib::RefPtr
<Gtk::TreeSelection
> m_pDeviceSelection
;
78 unsigned int m_device_count
;
80 // pointer to active Thread;
86 // statusbar message ID's
87 guint m_last_status_id
;
91 bool Connect(Thread
*);
92 void Disconnect(Thread
*);
93 void CheckDeviceName(Thread
*);
94 bool PromptForRestoreTarball(std::string
&restoreFilename
,
95 const std::string
&start_path
);
97 void StatusbarSet(const Glib::ustring
& text
);
98 bool CheckWorking(); // returns true if ok to proceed
101 BackupWindow(BaseObjectType
*cobject
, const Glib::RefPtr
<Gnome::Glade::Xml
> &xml
);
104 // handler for exceptions that happen in signal calls
105 void signal_exception_handler();
107 // handler for treeview update requests
108 void treeview_update();
114 void on_disconnect();
115 void on_disconnect_all();
117 void on_device_change();
119 void on_help_about();
123 virtual bool on_delete_event(GdkEventAny
*event
);