Skip to content

Commit

Permalink
Merge pull request #3605 from JakaKokosar/dev
Browse files Browse the repository at this point in the history
[FIX] Orange restart dialogs: Improve wording
  • Loading branch information
lanzagar authored Feb 18, 2019
2 parents 9817fa8 + 5bdfdf0 commit 24dee7b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
32 changes: 25 additions & 7 deletions Orange/canvas/application/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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


Expand Down Expand Up @@ -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 = '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.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):
self.accept()
self.parent().close()
else:
self.reject()


def list_available_versions():
Expand Down
8 changes: 3 additions & 5 deletions Orange/canvas/application/canvasmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,12 +1707,10 @@ def open_addons(self):
return dlg.exec_()

def reset_widget_settings(self):
res = message_question(
"Clear all widget settings on next restart",
res = message_information(
"Orange needs to be restarted 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 close Orange now.",
buttons=QMessageBox.Ok | QMessageBox.Cancel,
default_button=QMessageBox.Ok,
parent=self
Expand Down

0 comments on commit 24dee7b

Please sign in to comment.