mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
Inform user # of selected docs when in settings
Reminds the users of the number of documents selected when they are in the settings.
This commit is contained in:
parent
0a993a682f
commit
bc82163bc4
2 changed files with 14 additions and 1 deletions
|
@ -296,6 +296,12 @@ class SettingsWidget(QtWidgets.QWidget):
|
|||
super(SettingsWidget, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
|
||||
# Num Docs Selected
|
||||
self.docs_selected_label = QtWidgets.QLabel("No documents selected")
|
||||
self.docs_selected_label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.docs_selected_label.setContentsMargins(0, 0, 0, 20)
|
||||
self.docs_selected_label.setProperty("class", "docs-selection") # type: ignore [arg-type]
|
||||
|
||||
# Save safe version
|
||||
self.save_checkbox = QtWidgets.QCheckBox("Save safe PDF to")
|
||||
self.save_checkbox.clicked.connect(self.update_ui)
|
||||
|
@ -386,6 +392,7 @@ class SettingsWidget(QtWidgets.QWidget):
|
|||
# Layout
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
layout.addSpacing(20)
|
||||
layout.addWidget(self.docs_selected_label)
|
||||
layout.addLayout(self.save_location_layout)
|
||||
layout.addLayout(self.safe_extension_layout)
|
||||
layout.addLayout(open_layout)
|
||||
|
@ -466,8 +473,10 @@ class SettingsWidget(QtWidgets.QWidget):
|
|||
self.save_location.setText(save_dir)
|
||||
if len(selected_docs) == 1:
|
||||
self.start_button.setText("Convert to Safe Document")
|
||||
self.docs_selected_label.setText(f"1 document selected")
|
||||
else:
|
||||
self.start_button.setText("Convert to Safe Documents")
|
||||
self.docs_selected_label.setText(f"{len(selected_docs)} documents selected")
|
||||
|
||||
self.update_ui()
|
||||
|
||||
|
|
|
@ -17,4 +17,8 @@ QLabel[style="safe_extension_filename"] {
|
|||
padding: 4px 0px 4px 4px;
|
||||
background: white;
|
||||
color: grey;
|
||||
}
|
||||
}
|
||||
|
||||
QLabel.docs-selection {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue