diff --git a/src/fime/import_task.py b/src/fime/import_task.py index 737e3d5..ccbeef2 100644 --- a/src/fime/import_task.py +++ b/src/fime/import_task.py @@ -28,6 +28,9 @@ class ImportTask(QtWidgets.QDialog): self.completer.running.connect(self.spin) self.completer.stopped.connect(self.no_spin) + self.auto_change_task_check_box = QtWidgets.QCheckBox() + self.auto_change_task_check_box.setText("Set as active task after import") + ok_button = QtWidgets.QPushButton() ok_button.setText("OK") ok_button.setIcon(get_icon("dialog-ok")) @@ -57,6 +60,7 @@ class ImportTask(QtWidgets.QDialog): blayout = QtWidgets.QHBoxLayout() blayout.addSpacing(300) + blayout.addWidget(self.auto_change_task_check_box) blayout.addWidget(cancel_button) blayout.addWidget(ok_button) @@ -78,7 +82,12 @@ class ImportTask(QtWidgets.QDialog): def task_text(self): return self.line_edit.text() + @property + def change_task(self): + return self.auto_change_task_check_box.isChecked() + def showEvent(self, _): + self.auto_change_task_check_box.setChecked(self.config.import_auto_change_task) # pick up config changes self.completer.update_urls() self.line_edit.setText("") diff --git a/src/fime/main.py b/src/fime/main.py index 0132de1..26b57cb 100755 --- a/src/fime/main.py +++ b/src/fime/main.py @@ -79,7 +79,7 @@ class App: def new_task_imported(self): if self.import_task.task_text: self.tasks.add_jira_task(self.import_task.task_text) - if self.config.import_auto_change_task: + if self.import_task.change_task: self.change_task(self.import_task.task_text) self.update_tray_menu() diff --git a/src/fime/settings.py b/src/fime/settings.py index e15e9f4..edc3470 100644 --- a/src/fime/settings.py +++ b/src/fime/settings.py @@ -51,8 +51,7 @@ class Settings(QtWidgets.QDialog): settings_layout.addWidget(self.flip_menu_check_box, 3, 1, QtCore.Qt.AlignRight) import_auto_change_task_label = QtWidgets.QLabel() - import_auto_change_task_label.setText("Automatically select as active task\n after task import") - #import_auto_change_task_label.setTextFormat(QtCore.Qt.) + import_auto_change_task_label.setText("Automatically select task as active task\nafter task import") settings_layout.addWidget(import_auto_change_task_label, 4, 0) self.import_auto_change_task_check_box = QtWidgets.QCheckBox() settings_layout.addWidget(self.import_auto_change_task_check_box, 4, 1, QtCore.Qt.AlignRight)