From e74da1f8bf6a99f874d7423e281dcec702d02d0f Mon Sep 17 00:00:00 2001 From: JakaKokosar Date: Fri, 15 Feb 2019 12:48:46 +0100 Subject: [PATCH 1/3] canvasmain: better informative text on reset widget settings dialog --- Orange/canvas/application/canvasmain.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Orange/canvas/application/canvasmain.py b/Orange/canvas/application/canvasmain.py index 500100a80da..a80d16ef555 100644 --- a/Orange/canvas/application/canvasmain.py +++ b/Orange/canvas/application/canvasmain.py @@ -1707,11 +1707,10 @@ def open_addons(self): def reset_widget_settings(self): res = message_question( - "Clear all widget settings on next restart", + "A restart of the application is necessary for the " + + "changes to take effect.", title="Clear settings", - informative_text=( - "A restart of the application is necessary " + - "for the changes to take effect"), + informative_text="Press OK to restart.", buttons=QMessageBox.Ok | QMessageBox.Cancel, default_button=QMessageBox.Ok, parent=self From c3cc9c7b7a541e2de0d4d568fe428508e331c18a Mon Sep 17 00:00:00 2001 From: JakaKokosar Date: Fri, 15 Feb 2019 12:53:24 +0100 Subject: [PATCH 2/3] addons: add option to restart Orange after new add-on is installed --- Orange/canvas/application/addons.py | 32 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Orange/canvas/application/addons.py b/Orange/canvas/application/addons.py index ad9e8a247b8..ae0084b941f 100644 --- a/Orange/canvas/application/addons.py +++ b/Orange/canvas/application/addons.py @@ -28,7 +28,7 @@ QWidget, QDialog, QLabel, QLineEdit, QTreeView, QHeaderView, QTextBrowser, QDialogButtonBox, QProgressDialog, QVBoxLayout, QStyle, QStyledItemDelegate, QStyleOptionViewItem, - QApplication, QHBoxLayout, QPushButton, QFormLayout + QApplication, QHBoxLayout, QPushButton, QFormLayout, QMessageBox ) from AnyQt.QtGui import ( @@ -41,9 +41,11 @@ QSettings) from AnyQt.QtCore import pyqtSignal as Signal, pyqtSlot as Slot -from ..gui.utils import message_warning, message_information, \ - message_critical as message_error, \ - OSX_NSURL_toLocalFile +from ..gui.utils import ( + message_warning, message_critical as message_error, + OSX_NSURL_toLocalFile +) + from ..help.manager import get_dist_meta, trim, parse_meta @@ -774,9 +776,25 @@ def __on_installer_error(self, command, pkg, retcode, output): self.reject() def __on_installer_finished(self): - message = "Please restart Orange for changes to take effect." - message_information(message, parent=self) - self.accept() + + def message_restart(parent): + icon = QMessageBox.Information + buttons = QMessageBox.Ok | QMessageBox.Cancel + title = 'Information' + text = 'A restart of the application is necessary for the ' \ + 'changes to take effect.' + + msg_box = QMessageBox(icon, title, text, buttons, parent) + msg_box.setDefaultButton(QMessageBox.Ok) + msg_box.button(QMessageBox.Ok).setText('Restart now') + msg_box.button(QMessageBox.Cancel).setText('Restart later') + return msg_box.exec_() + + if QMessageBox.Ok == message_restart(self): + self.accept() + self.parent().close() + else: + self.reject() def list_available_versions(): From 5bdfdf06484cfaad9cd8427bed59f7c89fe2f690 Mon Sep 17 00:00:00 2001 From: JakaKokosar Date: Fri, 15 Feb 2019 16:47:58 +0100 Subject: [PATCH 3/3] edit displayed text on orange restart dialog --- Orange/canvas/application/addons.py | 8 ++++---- Orange/canvas/application/canvasmain.py | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Orange/canvas/application/addons.py b/Orange/canvas/application/addons.py index ae0084b941f..fac22242440 100644 --- a/Orange/canvas/application/addons.py +++ b/Orange/canvas/application/addons.py @@ -781,13 +781,13 @@ def message_restart(parent): icon = QMessageBox.Information buttons = QMessageBox.Ok | QMessageBox.Cancel title = 'Information' - text = 'A restart of the application is necessary for the ' \ - 'changes to take effect.' + text = 'Orange needs to be restarted for the changes to take effect.' msg_box = QMessageBox(icon, title, text, buttons, parent) msg_box.setDefaultButton(QMessageBox.Ok) - msg_box.button(QMessageBox.Ok).setText('Restart now') - msg_box.button(QMessageBox.Cancel).setText('Restart later') + msg_box.setInformativeText('Press OK to close Orange now.') + + msg_box.button(QMessageBox.Cancel).setText('Close later') return msg_box.exec_() if QMessageBox.Ok == message_restart(self): diff --git a/Orange/canvas/application/canvasmain.py b/Orange/canvas/application/canvasmain.py index a80d16ef555..0a618030f55 100644 --- a/Orange/canvas/application/canvasmain.py +++ b/Orange/canvas/application/canvasmain.py @@ -1706,11 +1706,10 @@ def open_addons(self): return dlg.exec_() def reset_widget_settings(self): - res = message_question( - "A restart of the application is necessary for the " + - "changes to take effect.", + res = message_information( + "Orange needs to be restarted for the changes to take effect.", title="Clear settings", - informative_text="Press OK to restart.", + informative_text="Press OK to close Orange now.", buttons=QMessageBox.Ok | QMessageBox.Cancel, default_button=QMessageBox.Ok, parent=self