def __init__(self, opts, notify=None): MainWindow.__init__(self, opts, disable_automatic_gc=True) try: install_new_plugins() except Exception: import traceback traceback.print_exc() self.setWindowTitle(self.APP_NAME) self.boss = Boss(self, notify=notify) self.setWindowIcon(QIcon(I('tweak.png'))) self.opts = opts self.path_to_ebook = None self.container = None self.current_metadata = None self.blocking_job = BlockingJob(self) self.keyboard = KeyboardManager(self, config_name='shortcuts/tweak_book') self.central = Central(self) self.setCentralWidget(self.central) self.check_book = Check(self) self.spell_check = SpellCheck(parent=self) self.toc_view = TOCViewer(self) self.text_search = TextSearch(self) self.saved_searches = SavedSearches(self) self.image_browser = InsertImage(self, for_browsing=True) self.reports = Reports(self) self.check_external_links = CheckExternalLinks(self) self.insert_char = CharSelect(self) self.manage_fonts = ManageFonts(self) self.sr_debug_output = DebugOutput(self) self.create_actions() self.create_toolbars() self.create_docks() self.create_menubar() self.status_bar = self.statusBar() self.status_bar.addPermanentWidget( self.boss.save_manager.status_widget) self.cursor_position_widget = CursorPositionWidget(self) self.status_bar.addPermanentWidget(self.cursor_position_widget) self.status_bar_default_msg = la = QLabel( ' ' + _('{0} {1} created by {2}').format( __appname__, get_version(), 'Kovid Goyal')) la.base_template = unicode_type(la.text()) self.status_bar.addWidget(la) f = self.status_bar.font() f.setBold(True) self.status_bar.setFont(f) self.boss(self) g = QApplication.instance().desktop().availableGeometry(self) self.resize(g.width() - 50, g.height() - 50) self.restore_state() self.apply_settings()
def __init__(self, opts, notify=None): MainWindow.__init__(self, opts, disable_automatic_gc=True) self.boss = Boss(self, notify=notify) self.setWindowTitle(self.APP_NAME) self.setWindowIcon(QIcon(I('tweak.png'))) self.opts = opts self.path_to_ebook = None self.container = None self.current_metadata = None self.blocking_job = BlockingJob(self) self.keyboard = KeyboardManager(self, config_name='shortcuts/tweak_book') self.central = Central(self) self.setCentralWidget(self.central) self.check_book = Check(self) self.toc_view = TOCViewer(self) self.create_actions() self.create_toolbars() self.create_docks() self.create_menubar() self.status_bar = self.statusBar() self.status_bar.addPermanentWidget( self.boss.save_manager.status_widget) self.cursor_position_widget = CursorPositionWidget(self) self.status_bar.addPermanentWidget(self.cursor_position_widget) self.status_bar.addWidget( QLabel( _('{0} {1} created by {2}').format(__appname__, get_version(), 'Kovid Goyal'))) f = self.status_bar.font() f.setBold(True) self.status_bar.setFont(f) self.boss(self) g = QApplication.instance().desktop().availableGeometry(self) self.resize(g.width() - 50, g.height() - 50) self.restore_state() self.keyboard.finalize()