From a327bec4e42cc572fb84e559025e888a4a20edd3 Mon Sep 17 00:00:00 2001 From: tassaron Date: Mon, 14 Aug 2017 16:39:53 -0400 Subject: organizing GUImode-specific code --- src/gui/mainwindow.ui | 828 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 828 insertions(+) create mode 100644 src/gui/mainwindow.ui (limited to 'src/gui/mainwindow.ui') diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui new file mode 100644 index 0000000..b43d375 --- /dev/null +++ b/src/gui/mainwindow.ui @@ -0,0 +1,828 @@ + + + MainWindow + + + + 0 + 0 + 1008 + 575 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + MainWindow + + + + + 0 + 0 + + + + false + + + + 9 + + + 0 + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 0 + 360 + + + + + + + + QLayout::SetDefaultConstraint + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 420 + 0 + + + + + + + + + + QLayout::SetMinimumSize + + + 3 + + + + + QLayout::SetMinimumSize + + + 3 + + + + + QLayout::SetMinimumSize + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 140 + 20 + + + + + + + + Projects + + + + + + + Presets + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 2 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 1 + + + true + + + true + + + false + + + QAbstractItemView::InternalMove + + + Qt::MoveAction + + + + + + + + + Add + + + + + + + Remove + + + + + + + Up + + + + + + + Down + + + + + + + + + + + 4 + + + 2 + + + + + + + + + + + QLayout::SetFixedSize + + + 4 + + + 0 + + + + + + 0 + 0 + + + + + 500 + 0 + + + + + 16777215 + 180 + + + + QTabWidget::North + + + QTabWidget::Rounded + + + 0 + + + + Export Video + + + + 10 + + + + + 0 + + + + + + 0 + 0 + + + + + 85 + 0 + + + + + 80 + 16777215 + + + + + 80 + 0 + + + + Audio File + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + + 0 + 0 + + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + ... + + + + + + + + + + + + + + 0 + 0 + + + + + 85 + 0 + + + + + 0 + 0 + + + + Output File + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + ... + + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + 24 + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 10 + 20 + + + + + + + + Create Video + + + + + + + false + + + Cancel + + + + + + + + + + + + true + + + Qt::AlignCenter + + + -1 + + + + + + + progressLabel + + + + Encoder Settings + + + + 10 + + + + + + + + 0 + 0 + + + + + 85 + 0 + + + + Container + + + + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 5 + 5 + + + + + + + + + 0 + 0 + + + + Resolution + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + 85 + 0 + + + + Video Codec + + + + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 5 + + + + + + + + + 0 + 0 + + + + Video Bitrate (Kbps) + + + + + + + 99999 + + + + + + + + + + + + 0 + 0 + + + + + 85 + 0 + + + + Audio Codec + + + + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 10 + + + + + + + + + 0 + 0 + + + + Audio Bitrate (Kbps) + + + + + + + 9999 + + + + + + + + + + + + + QLayout::SetDefaultConstraint + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 500 + 0 + + + + + + + + + 0 + 0 + + + + + 0 + 180 + + + + + 16777215 + 180 + + + + -1 + + + + + + + + + + + + + -- cgit v1.2.3 From 9d9c4076ac1dfccdd1a753d137d87bcf5f179e3b Mon Sep 17 00:00:00 2001 From: tassaron Date: Sun, 20 Aug 2017 22:04:57 -0400 Subject: added undo button to GUI with icons that theoretically should look ok cross-platform --- src/component.py | 2 +- src/gui/actions.py | 14 +++++++------- src/gui/mainwindow.py | 36 ++++++++++++++++++++++++++++++++++++ src/gui/mainwindow.ui | 7 +++++++ 4 files changed, 51 insertions(+), 8 deletions(-) (limited to 'src/gui/mainwindow.ui') diff --git a/src/component.py b/src/component.py index 1f55a19..35fc717 100644 --- a/src/component.py +++ b/src/component.py @@ -823,7 +823,7 @@ class ComponentUpdate(QtWidgets.QUndoCommand): '''Command object for making a component action undoable''' def __init__(self, parent, oldWidgetVals, modifiedVals): super().__init__( - 'Changed %s component #%s' % ( + 'change %s component #%s' % ( parent.name, parent.compPos ) ) diff --git a/src/gui/actions.py b/src/gui/actions.py index ebd9702..8e867b9 100644 --- a/src/gui/actions.py +++ b/src/gui/actions.py @@ -15,7 +15,7 @@ from core import Core class AddComponent(QUndoCommand): def __init__(self, parent, compI, moduleI): super().__init__( - "New %s component" % + "create new %s component" % parent.core.modules[moduleI].Component.name ) self.parent = parent @@ -39,7 +39,7 @@ class AddComponent(QUndoCommand): class RemoveComponent(QUndoCommand): def __init__(self, parent, selectedRows): - super().__init__('Remove component') + super().__init__('remove component') self.parent = parent componentList = self.parent.window.listWidget_componentList self.selectedRows = [ @@ -63,7 +63,7 @@ class RemoveComponent(QUndoCommand): class MoveComponent(QUndoCommand): def __init__(self, parent, row, newRow, tag): - super().__init__("Move component %s" % tag) + super().__init__("move component %s" % tag) self.parent = parent self.row = row self.newRow = newRow @@ -107,7 +107,7 @@ class MoveComponent(QUndoCommand): class ClearPreset(QUndoCommand): def __init__(self, parent, compI): - super().__init__("Clear preset") + super().__init__("clear preset") self.parent = parent self.compI = compI self.component = self.parent.core.selectedComponents[compI] @@ -125,7 +125,7 @@ class ClearPreset(QUndoCommand): class OpenPreset(QUndoCommand): def __init__(self, parent, presetName, compI): - super().__init__("Open %s preset" % presetName) + super().__init__("open %s preset" % presetName) self.parent = parent self.presetName = presetName self.compI = compI @@ -145,7 +145,7 @@ class OpenPreset(QUndoCommand): class RenamePreset(QUndoCommand): def __init__(self, parent, path, oldName, newName): - super().__init__('Rename preset') + super().__init__('rename preset') self.parent = parent self.path = path self.oldName = oldName @@ -167,7 +167,7 @@ class DeletePreset(QUndoCommand): ) self.store = self.parent.core.getPreset(self.path) self.presetName = self.store['preset'] - super().__init__('Delete %s preset (%s)' % (self.presetName, compName)) + super().__init__('delete %s preset (%s)' % (self.presetName, compName)) self.loadedPresets = [ i for i, comp in enumerate(self.parent.core.selectedComponents) if self.presetName == str(comp.currentPreset) diff --git a/src/gui/mainwindow.py b/src/gui/mainwindow.py index 2841896..3b204b7 100644 --- a/src/gui/mainwindow.py +++ b/src/gui/mainwindow.py @@ -100,6 +100,42 @@ class MainWindow(QtWidgets.QMainWindow): self.window.installEventFilter(self) componentList = self.window.listWidget_componentList + style = window.pushButton_undo.style() + undoButton = window.pushButton_undo + undoButton.setIcon( + style.standardIcon(QtWidgets.QStyle.SP_FileDialogBack) + ) + undoButton.clicked.connect(self.undoStack.undo) + undoButton.setEnabled(False) + self.undoStack.cleanChanged.connect( + lambda change: undoButton.setEnabled(self.undoStack.count()) + ) + self.undoMenu = QMenu() + self.undoMenu.addAction( + self.undoStack.createUndoAction(self) + ) + self.undoMenu.addAction( + self.undoStack.createRedoAction(self) + ) + action = self.undoMenu.addAction('Show History...') + action.triggered.connect( + lambda _: self.showUndoStack() + ) + undoButton.setMenu(self.undoMenu) + + style = window.pushButton_listMoveUp.style() + window.pushButton_listMoveUp.setIcon( + style.standardIcon(QtWidgets.QStyle.SP_ArrowUp) + ) + style = window.pushButton_listMoveDown.style() + window.pushButton_listMoveDown.setIcon( + style.standardIcon(QtWidgets.QStyle.SP_ArrowDown) + ) + style = window.pushButton_removeComponent.style() + window.pushButton_removeComponent.setIcon( + style.standardIcon(QtWidgets.QStyle.SP_DialogDiscardButton) + ) + if sys.platform == 'darwin': log.debug( 'Darwin detected: showing progress label below progress bar') diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index b43d375..cd8454d 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -110,6 +110,13 @@ QLayout::SetMinimumSize + + + + Undo + + + -- cgit v1.2.3