def __init__(self): super(MainWindow, self).__init__() # Store ourself. self.windows.append(self) # State! self.current_file = None # Editor! self.editor = QTextEdit() self.setCentralWidget(self.editor) # Style the editor style.apply_stylesheet(self.editor, 'editor.qss') # Menus and Stuff! self.init_actions() self.init_menus() self.init_toolbars() self.init_statusbar() # Settings! self.init_settings() # Icons! self.reload_icons() style.style_reloaded.connect(self.reload_icons) # Fancy! style.enable_aero(self) self.update_title() # Now, for some plugins. plugins.run_signal('new_window', self)
def closeEvent(self, event): """ Disconnect any signals and remove our reference. """ global _manager_window if _manager_window is self: _manager_window = None style.style_reloaded.disconnect(self.reload_icons) plugins.run_signal('closed_addon_manager', self)
def closeEvent(self, event): if self.try_save(): self.save_settings() if self in self.windows: self.windows.remove(self) plugins.run_signal('close_window', self) event.accept() else: event.ignore()
def __init__(self, parent=None): ManagerWindow.__init__(self, parent) # Set the window title and size. self.setWindowTitle(self.tr("Add-on Manager")) self.setMinimumSize(400, 300) # Build the main widget. self.tabs = QTabWidget(self) self.setCentralWidget(self.tabs) # Load up all our tabs. for addon_type in sorted(addons.manager._types.keys()): tab = AddonTypeTab(addon_type) self.tabs.addTab(tab, tab.windowIcon(), tab.windowTitle()) # Let plugins get in on this. plugins.run_signal('opened_addon_manager', self) # Icons and Style! style.enable_aero(self) self.reload_icons() style.style_reloaded.connect(self.reload_icons)
def __init__(self, parent=None): super(ManagerWindow, self).__init__(parent) # Set the window title and size. self.setWindowTitle(self.tr("Add-on Manager")) self.setMinimumSize(400, 300) # Build the main widget. self.tabs = QTabWidget(self) self.setCentralWidget(self.tabs) # Load up all our tabs. for addon_type in sorted(addons.manager._types.keys()): tab = AddonTypeTab(addon_type) self.tabs.addTab(tab, tab.windowIcon(), tab.windowTitle()) # Let plugins get in on this. plugins.run_signal('opened_addon_manager', self) # Icons and Style! #style.enable_aero(self) self.reload_icons() style.style_reloaded.connect(self.reload_icons)