本文整理汇总了Python中picard.ui.itemviews.MainPanel.remove方法的典型用法代码示例。如果您正苦于以下问题:Python MainPanel.remove方法的具体用法?Python MainPanel.remove怎么用?Python MainPanel.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类picard.ui.itemviews.MainPanel
的用法示例。
在下文中一共展示了MainPanel.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from picard.ui.itemviews import MainPanel [as 别名]
# 或者: from picard.ui.itemviews.MainPanel import remove [as 别名]
class MainWindow(QtGui.QMainWindow):
options = [
Option("persist", "window_state", QtCore.QByteArray(),
QtCore.QVariant.toByteArray),
Option("persist", "window_position", QtCore.QPoint(),
QtCore.QVariant.toPoint),
Option("persist", "window_size", QtCore.QSize(780, 560),
QtCore.QVariant.toSize),
Option("persist", "bottom_splitter_state", QtCore.QByteArray(),
QtCore.QVariant.toByteArray),
BoolOption("persist", "window_maximized", False),
BoolOption("persist", "view_cover_art", False),
BoolOption("persist", "view_file_browser", False),
TextOption("persist", "current_directory", ""),
]
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
self.selected_objects = []
self.ignore_selection_changes = False
self.setupUi()
def setupUi(self):
self.setWindowTitle(_("MusicBrainz Picard"))
icon = QtGui.QIcon()
icon.addFile(":/images/16x16/picard.png", QtCore.QSize(16, 16))
icon.addFile(":/images/24x24/picard.png", QtCore.QSize(24, 24))
icon.addFile(":/images/32x32/picard.png", QtCore.QSize(32, 32))
icon.addFile(":/images/48x48/picard.png", QtCore.QSize(48, 48))
icon.addFile(":/images/128x128/picard.png", QtCore.QSize(128, 128))
icon.addFile(":/images/256x256/picard.png", QtCore.QSize(256, 256))
self.setWindowIcon(icon)
self.create_actions()
self.create_statusbar()
self.create_toolbar()
self.create_menus()
mainLayout = QtGui.QSplitter(QtCore.Qt.Vertical)
mainLayout.setContentsMargins(0, 0, 0, 0)
mainLayout.setHandleWidth(1)
self.panel = MainPanel(self, mainLayout)
self.file_browser = FileBrowser(self.panel)
if not self.show_file_browser_action.isChecked():
self.file_browser.hide()
self.panel.insertWidget(0, self.file_browser)
self.panel.restore_state()
self.metadata_box = MetadataBox(self)
self.cover_art_box = CoverArtBox(self)
if not self.show_cover_art_action.isChecked():
self.cover_art_box.hide()
bottomLayout = QtGui.QHBoxLayout()
bottomLayout.setContentsMargins(0, 0, 0, 0)
bottomLayout.setSpacing(0)
bottomLayout.addWidget(self.metadata_box, 1)
bottomLayout.addWidget(self.cover_art_box, 0)
bottom = QtGui.QWidget()
bottom.setLayout(bottomLayout)
mainLayout.addWidget(self.panel)
mainLayout.addWidget(bottom)
self.setCentralWidget(mainLayout)
# FIXME: use QApplication's clipboard
self._clipboard = []
for function in ui_init:
function(self)
def keyPressEvent(self, event):
if event.matches(QtGui.QKeySequence.Delete):
if self.metadata_box.hasFocus():
self.metadata_box.remove_selected_tags()
else:
self.remove()
else:
QtGui.QMainWindow.keyPressEvent(self, event)
def show(self):
self.restoreWindowState()
QtGui.QMainWindow.show(self)
self.metadata_box.restore_state()
def closeEvent(self, event):
if self.config.setting["quit_confirmation"] and not self.show_quit_confirmation():
event.ignore()
return
self.saveWindowState()
event.accept()
def show_quit_confirmation(self):
unsaved_files = sum(a.get_num_unsaved_files() for a in self.tagger.albums.itervalues())
QMessageBox = QtGui.QMessageBox
if unsaved_files > 0:
msg = QMessageBox(self)
#.........这里部分代码省略.........
示例2: MainWindow
# 需要导入模块: from picard.ui.itemviews import MainPanel [as 别名]
# 或者: from picard.ui.itemviews.MainPanel import remove [as 别名]
class MainWindow(QtWidgets.QMainWindow, PreserveGeometry):
defaultsize = QtCore.QSize(780, 560)
autorestore = False
selection_updated = QtCore.pyqtSignal(object)
options = [
config.Option("persist", "window_state", QtCore.QByteArray()),
config.Option("persist", "bottom_splitter_state", QtCore.QByteArray()),
config.BoolOption("persist", "window_maximized", False),
config.BoolOption("persist", "view_cover_art", True),
config.BoolOption("persist", "view_toolbar", True),
config.BoolOption("persist", "view_file_browser", False),
config.TextOption("persist", "current_directory", ""),
]
def __init__(self, parent=None):
super().__init__(parent)
self.selected_objects = []
self.ignore_selection_changes = False
self.toolbar = None
self.setupUi()
def setupUi(self):
self.setWindowTitle(_("MusicBrainz Picard"))
icon = QtGui.QIcon()
icon.addFile(":/images/16x16/org.musicbrainz.Picard.png", QtCore.QSize(16, 16))
icon.addFile(":/images/24x24/org.musicbrainz.Picard.png", QtCore.QSize(24, 24))
icon.addFile(":/images/32x32/org.musicbrainz.Picard.png", QtCore.QSize(32, 32))
icon.addFile(":/images/48x48/org.musicbrainz.Picard.png", QtCore.QSize(48, 48))
icon.addFile(":/images/128x128/org.musicbrainz.Picard.png", QtCore.QSize(128, 128))
icon.addFile(":/images/256x256/org.musicbrainz.Picard.png", QtCore.QSize(256, 256))
self.setWindowIcon(icon)
self.show_close_window = IS_MACOS
self.create_actions()
self.create_statusbar()
self.create_toolbar()
self.create_menus()
if IS_MACOS:
self.setUnifiedTitleAndToolBarOnMac(True)
self.toolbar.setMovable(False)
self.search_toolbar.setMovable(False)
mainLayout = QtWidgets.QSplitter(QtCore.Qt.Vertical)
mainLayout.setContentsMargins(0, 0, 0, 0)
mainLayout.setHandleWidth(1)
self.panel = MainPanel(self, mainLayout)
self.file_browser = FileBrowser(self.panel)
if not self.show_file_browser_action.isChecked():
self.file_browser.hide()
self.panel.insertWidget(0, self.file_browser)
self.panel.restore_state()
self.metadata_box = MetadataBox(self)
self.cover_art_box = CoverArtBox(self)
if not self.show_cover_art_action.isChecked():
self.cover_art_box.hide()
self.logDialog = LogView(self)
self.historyDialog = HistoryView(self)
bottomLayout = QtWidgets.QHBoxLayout()
bottomLayout.setContentsMargins(0, 0, 0, 0)
bottomLayout.setSpacing(0)
bottomLayout.addWidget(self.metadata_box, 1)
bottomLayout.addWidget(self.cover_art_box, 0)
bottom = QtWidgets.QWidget()
bottom.setLayout(bottomLayout)
mainLayout.addWidget(self.panel)
mainLayout.addWidget(bottom)
self.setCentralWidget(mainLayout)
# accessibility
self.set_tab_order()
for function in ui_init:
function(self)
def keyPressEvent(self, event):
# On macOS Command+Backspace triggers the so called "Forward Delete".
# It should be treated the same as the Delete button.
is_forward_delete = IS_MACOS and \
event.key() == QtCore.Qt.Key_Backspace and \
event.modifiers() & QtCore.Qt.ControlModifier
if event.matches(QtGui.QKeySequence.Delete) or is_forward_delete:
if self.metadata_box.hasFocus():
self.metadata_box.remove_selected_tags()
else:
self.remove()
else:
super().keyPressEvent(event)
def show(self):
self.restoreWindowState()
super().show()
#.........这里部分代码省略.........