mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +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__()
|
super(SettingsWidget, self).__init__()
|
||||||
self.dangerzone = dangerzone
|
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
|
# Save safe version
|
||||||
self.save_checkbox = QtWidgets.QCheckBox("Save safe PDF to")
|
self.save_checkbox = QtWidgets.QCheckBox("Save safe PDF to")
|
||||||
self.save_checkbox.clicked.connect(self.update_ui)
|
self.save_checkbox.clicked.connect(self.update_ui)
|
||||||
|
@ -386,6 +392,7 @@ class SettingsWidget(QtWidgets.QWidget):
|
||||||
# Layout
|
# Layout
|
||||||
layout = QtWidgets.QVBoxLayout()
|
layout = QtWidgets.QVBoxLayout()
|
||||||
layout.addSpacing(20)
|
layout.addSpacing(20)
|
||||||
|
layout.addWidget(self.docs_selected_label)
|
||||||
layout.addLayout(self.save_location_layout)
|
layout.addLayout(self.save_location_layout)
|
||||||
layout.addLayout(self.safe_extension_layout)
|
layout.addLayout(self.safe_extension_layout)
|
||||||
layout.addLayout(open_layout)
|
layout.addLayout(open_layout)
|
||||||
|
@ -466,8 +473,10 @@ class SettingsWidget(QtWidgets.QWidget):
|
||||||
self.save_location.setText(save_dir)
|
self.save_location.setText(save_dir)
|
||||||
if len(selected_docs) == 1:
|
if len(selected_docs) == 1:
|
||||||
self.start_button.setText("Convert to Safe Document")
|
self.start_button.setText("Convert to Safe Document")
|
||||||
|
self.docs_selected_label.setText(f"1 document selected")
|
||||||
else:
|
else:
|
||||||
self.start_button.setText("Convert to Safe Documents")
|
self.start_button.setText("Convert to Safe Documents")
|
||||||
|
self.docs_selected_label.setText(f"{len(selected_docs)} documents selected")
|
||||||
|
|
||||||
self.update_ui()
|
self.update_ui()
|
||||||
|
|
||||||
|
|
|
@ -18,3 +18,7 @@ QLabel[style="safe_extension_filename"] {
|
||||||
background: white;
|
background: white;
|
||||||
color: grey;
|
color: grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QLabel.docs-selection {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue