Skip to content

Commit

Permalink
Remove 4th save button (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszKielar authored Mar 12, 2021
1 parent 7884deb commit 9b719b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion merge_pdfs/gui/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def getActionAdd(window: QWindow) -> QAction:
icon = QApplication.style().standardIcon(QStyle.SP_DialogOpenButton)
addAction = QAction(icon, "Add", window)
addAction.setShortcut("Ctrl+A")
addAction.setShortcut("Ctrl++")
return addAction


Expand Down
24 changes: 1 addition & 23 deletions merge_pdfs/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,7 @@ def _defineLayout(self) -> None:

# define listView widget
self.listViewWidget = PDFListWidget()

# define save button
self.buttonSave = QPushButton(text="Save")
self.buttonSave.setObjectName("buttonSave")
self.buttonSave.pressed.connect(self.listViewWidget.saveFile)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonSave.sizePolicy().hasHeightForWidth())
self.buttonSave.setSizePolicy(sizePolicy)

# define widgets
widgets = (
(self.listViewWidget, None),
(self.buttonSave, (0, Qt.AlignRight | Qt.AlignVCenter)),
)

# add all widgets to the layout
for widget, settings in widgets:
if settings:
layout.addWidget(widget, *settings)
else:
layout.addWidget(widget)
layout.addWidget(self.listViewWidget)

# create central widget
centralWidget = QWidget()
Expand Down
2 changes: 1 addition & 1 deletion merge_pdfs/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, *args, **kwargs) -> None:
self.setDragDropOverwriteMode(False)
self.setDragDropMode(QAbstractItemView.InternalMove)
self.setAlternatingRowColors(True)
self.setSelectionMode(QAbstractItemView.ContiguousSelection)
self.setSelectionMode(QAbstractItemView.ExtendedSelection)

# dict that maps item label with its paths
self._addedFiles: Dict[str, Path] = {}
Expand Down

0 comments on commit 9b719b2

Please sign in to comment.