Public Member Functions | |
| def | __init__ |
| def | setup_cfg |
| def | setup_ui |
| def | setup_actions |
| def | closeEvent |
| def | fill |
| def | page_changed |
| def | update_album_count |
| def | about_qomics |
| def | create_album |
| def | update_catalog |
| def | reload_data |
| def | configure_colors |
| def | configure_mirrors |
| def | configure_datasource |
| def | create_savepoint |
| def | manage_backups |
| def | send_overlay |
| def | send_overlay_silent |
Public Attributes | |
| loaded | |
| album_counter | |
| tabwidget | |
| tabs | |
Static Public Attributes | |
| string | conf_section = "gui/main_window" |
Private Attributes | |
| __current_page | |
| def py::gui::main_window::main_window::__init__ | ( | self | ) |
| def py::gui::main_window::main_window::setup_cfg | ( | self | ) |
| def py::gui::main_window::main_window::setup_ui | ( | self, | ||
| parent | ||||
| ) |
00061 : 00062 Ui_main_window.setupUi(self, parent) 00063 00064 self.album_counter = QLabel() 00065 self.statusBar().addPermanentWidget(self.album_counter) 00066 00067 self.tabwidget = QTabWidget(self.centralwidget) 00068 self.vboxlayout.addWidget(self.tabwidget) 00069 00070 # setup tabs 00071 self.tabs = { 00072 "main_library" : gui.page.page(gui.views.flat_library("main_library",qodb.cte.main_library_id),True), 00073 "shopping_list" : gui.page.page(gui.views.flat_library("shopping_list",qodb.cte.shopping_list_id),True), 00074 "latestout" : gui.page.page(gui.views.flat_latestout("latestout"),True), 00075 "nextout" : gui.page.page(gui.views.flat_nextout("nextout"),True), 00076 "catalog" : gui.page.page(gui.views.flat_search("catalog"),True), 00077 } 00078 self.tabs["main_library_series"] = gui.page.page_series(gui.views.series("main_library_series",self.tabs["main_library"].model)) 00079 self.tabwidget.addTab(self.tabs["main_library"], _("My comics")) 00080 self.tabwidget.addTab(self.tabs["main_library_series"], _("My series")) 00081 self.tabwidget.addTab(self.tabs["shopping_list"], _("Shopping list")) 00082 self.tabwidget.addTab(self.tabs["latestout"], _("Latest out")) 00083 self.tabwidget.addTab(self.tabs["nextout"], _("Next out")) 00084 self.tabwidget.addTab(self.tabs["catalog"], _("Catalog")) 00085 00086 # setup geometry 00087 cfg = qocfg.get_user_config() 00088 if cfg.has_option(self.conf_section,"geometry") : 00089 self.restoreGeometry(cfg.get(self.conf_section,"geometry")) 00090 00091 # checkable options 00092 self.action_auto_save.setChecked(qocfg.get_autosave_comics()) 00093 self.action_auto_fetch_covers.setChecked(qocfg.get_autofetch_covers()) 00094 self.action_auto_send_changes.setChecked(qocfg.get_autosend_overlay()) 00095 self.action_auto_savepoint.setChecked(qocfg.get_autosavepoint()) 00096 def setup_actions( self ) :
| def py::gui::main_window::main_window::setup_actions | ( | self | ) |
00097 : 00098 for obj, slot in [ 00099 (self.action_create_album, self.create_album), 00100 (self.action_update_catalog, self.update_catalog), 00101 (self.action_reload_data, self.reload_data), 00102 (self.action_configure_colors, self.configure_colors), 00103 (self.action_configure_mirrors, self.configure_mirrors), 00104 (self.action_configure_datasource, self.configure_datasource), 00105 (self.action_about_qomics, self.about_qomics), 00106 (self.action_manage_backups, self.manage_backups), 00107 (self.action_create_savepoint, self.create_savepoint), 00108 (self.action_send_changes, self.send_overlay), 00109 ] : 00110 QObject.connect(obj, SIGNAL("activated()"), slot) 00111 for obj, slot in [ 00112 (self.action_auto_fetch_covers, qocfg.set_autofetch_covers), 00113 (self.action_auto_send_changes, qocfg.set_autosend_overlay), 00114 (self.action_auto_savepoint, qocfg.set_autosavepoint), 00115 ] : 00116 QObject.connect(obj, SIGNAL("toggled(bool)"), slot) 00117 00118 QObject.connect(self.tabwidget, SIGNAL("currentChanged(int)"), self.page_changed) 00119 QObject.connect(self, SIGNAL("fill"), self.fill) 00120 self.__current_page = None 00121 self.page_changed() 00122 def closeEvent( self, event ) :
| def py::gui::main_window::main_window::closeEvent | ( | self, | ||
| event | ||||
| ) |
00123 : 00124 if qocfg.get_autosavepoint() : 00125 gui.dialog.create_savepoint(self).exec_() 00126 if qocfg.get_autosend_overlay() : 00127 self.send_overlay() 00128 for w in self.tabs.itervalues() : 00129 w.save_geometry() 00130 w.save() 00131 qocfg.get_user_config().set(self.conf_section,"geometry",str(self.saveGeometry())) 00132 QMainWindow.closeEvent( self, event ) 00133 def fill( self ) :
| def py::gui::main_window::main_window::fill | ( | self | ) |
reload all tabs
00134 : 00135 """ 00136 reload all tabs 00137 """ 00138 # load libraries first 00139 self.loaded.clear() 00140 for view in ["main_library","shopping_list","main_library_series","latestout","nextout"] : 00141 self.tabs[view].model.reload() 00142 self.loaded.set() 00143 def page_changed( self ) :
| def py::gui::main_window::main_window::page_changed | ( | self | ) |
00144 : 00145 if self.__current_page : 00146 QObject.disconnect(self.__current_page, SIGNAL("album_count_changed"), self.update_album_count) 00147 self.__current_page = self.tabwidget.currentWidget() 00148 QObject.connect(self.tabwidget.currentWidget(), SIGNAL("album_count_changed"), self.update_album_count) 00149 self.update_album_count() 00150 def update_album_count( self ) :
| def py::gui::main_window::main_window::update_album_count | ( | self | ) |
| def py::gui::main_window::main_window::about_qomics | ( | self | ) |
| def py::gui::main_window::main_window::create_album | ( | self | ) |
| def py::gui::main_window::main_window::update_catalog | ( | self | ) |
| def py::gui::main_window::main_window::reload_data | ( | self | ) |
| def py::gui::main_window::main_window::configure_colors | ( | self | ) |
| def py::gui::main_window::main_window::configure_mirrors | ( | self | ) |
| def py::gui::main_window::main_window::configure_datasource | ( | self | ) |
| def py::gui::main_window::main_window::create_savepoint | ( | self | ) |
| def py::gui::main_window::main_window::manage_backups | ( | self | ) |
00197 : 00198 gui.dialog.manage_backups(self).exec_() 00199 00200 @gui.dialog.show_failure def send_overlay( self ) :
| def py::gui::main_window::main_window::send_overlay | ( | self | ) |
| def py::gui::main_window::main_window::send_overlay_silent | ( | self | ) |
string py::gui::main_window::main_window::conf_section = "gui/main_window" [static] |
1.5.3