def __init__(self, target_widget, default_attrs=None): super().__init__(target_widget) self.target_widget = target_widget self.default_attrs = default_attrs self.export_action = create_action(None, "Export ...", self.handle_export_action) self.import_action = create_action(None, "Import ...", self.handle_import_action) self.model_index = QModelIndex()
def __init__(self, target_widget): super().__init__(target_widget) self.target_widget = target_widget self.export_action = create_action(None, "Export ...", self.handle_export_action) self.import_action = create_action(None, "Import ...", self.handle_import_action) self.context_menu = QMenu() self.context_menu.addAction(self.export_action) self.context_menu.addAction(self.import_action) self.model_index = QModelIndex()
def __init__(self): super().__init__() self.setWindowTitle("UI Loader Helper") self.setGeometry(300, 300, 600, 800) self.reload_ui_action = create_action( self.get_icon(QStyle.SP_BrowserReload), "Reload UI", self.handle_reload_ui, None) self.kire_gauge_model = KireGaugeModel() self.init_toolbar()
def init_actions(self): self.open_chunk_directory_action = create_action( self.get_icon(QStyle.SP_DirOpenIcon), "Open chunk_directory ...", self.handle_open_chunk_directory, None) self.open_mod_directory_action = create_action( self.get_icon(QStyle.SP_DirOpenIcon), "Open mod directory ...", self.handle_open_mod_directory, QKeySequence.Open) self.save_file_action = create_action( self.get_icon(QStyle.SP_DriveHDIcon), "Save file", self.handle_save_file_action, QKeySequence.Save) self.save_file_action.setDisabled(True) self.export_csv_action = create_action( self.get_icon(QStyle.SP_FileIcon), "Export file to CSV...", self.handle_export_file_action) self.export_csv_action.setDisabled(True) self.about_action = create_action( None, "About", self.handle_about_action) self.lang_actions = { lang: create_action( None, name, partial(self.handle_set_lang_action, lang), checkable=True) for lang, name in LANG }
def __init__(self, parent=None): super().__init__(parent) self._proxy_model = QSortFilterProxyModel(self) self._proxy_model.setDynamicSortFilter(True) super().setModel(self._proxy_model) header = FilterHeader(self) header.filter_changed.connect(self.set_filter) self.setHorizontalHeader(header) self.setSortingEnabled(True) self.setSelectionMode(QAbstractItemView.ContiguousSelection) self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested.connect(self.show_context_menu) self.import_export_manager = ImportExportManager(self) self.copy_action = create_action( None, "Copy", self.copy_selection_to_clipboard)
def init_actions(self): self.open_chunk_directory_action = create_action( self.get_icon(QStyle.SP_DirOpenIcon), "Open chunk_directory ...", self.handle_open_chunk_directory, None) self.open_mod_directory_action = create_action( self.get_icon(QStyle.SP_DirOpenIcon), "Open mod directory ...", self.handle_open_mod_directory, QKeySequence.Open) self.save_file_action = create_action( self.get_icon(QStyle.SP_DriveHDIcon), "Save file", self.handle_save_file_action, QKeySequence.Save) self.save_file_action.setDisabled(True) self.export_action = create_action(self.get_icon(QStyle.SP_FileIcon), "Export file ...", self.handle_export_file_action) self.export_action.setDisabled(True) self.import_action = create_action(self.get_icon(QStyle.SP_FileIcon), "Import file ...", self.handle_import_file_action) self.import_action.setDisabled(True) self.help_action = create_action(None, "Show help", self.handle_show_help_action) self.about_action = create_action(None, "About", self.handle_about_action) self.lang_actions = { lang: create_action(None, name, partial(self.handle_set_lang_action, lang), checkable=True) for lang, name in LANG } self.quick_access_actions = [ create_action( None, title, partial(self.workspace.open_file_any_dir, file_rel_path)) for title, file_rel_path in QUICK_ACCESS_ITEMS ]