Skip to content

Commit

Permalink
feat(ui): Add 'Do not ask again' button in the upload confirmation di…
Browse files Browse the repository at this point in the history
…alog (#116)

Signed-off-by: Gahyun Suh <[email protected]>
  • Loading branch information
gahyusuh authored Nov 22, 2023
1 parent 2b1eb3c commit 62e62f4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/deadline/client/ui/dialogs/submit_job_progress_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
QLabel,
QMessageBox,
QProgressBar,
QPushButton,
QTextEdit,
QVBoxLayout,
QWidget,
Expand Down Expand Up @@ -513,7 +514,7 @@ def handle_thread_exception(self, e: BaseException) -> None:
def _confirm_job_attachments_upload(self, num_files: int, upload_size: int) -> bool:
"""
Creates a dialog to prompt the user to confirm that they want to proceed
with uploding the specified number of files totaling a certain size.
with uploading the specified number of files totaling a certain size.
"""
message_box = QMessageBox(self)
message_box.setText(
Expand All @@ -522,10 +523,17 @@ def _confirm_job_attachments_upload(self, num_files: int, upload_size: int) -> b
)
message_box.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
message_box.setDefaultButton(QMessageBox.Ok)

# Add the "Do not ask again" button that acts like 'OK' but sets the config
# setting to always auto-accept similar prompts in the future.
dont_ask_button = QPushButton("Do not ask again", self)
dont_ask_button.clicked.connect(lambda: set_setting("settings.auto_accept", "true"))
message_box.addButton(dont_ask_button, QMessageBox.ActionRole)

message_box.setWindowTitle("Job Attachments Upload Confirmation")
selection = message_box.exec_()

return selection == QMessageBox.Ok
return selection != QMessageBox.Cancel

def closeEvent(self, event: QCloseEvent) -> None:
"""
Expand Down

0 comments on commit 62e62f4

Please sign in to comment.