Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py

changeset 2192
61b3849df76d
parent 1953
26aa6fd94dc2
child 2302
f29e9405c851
equal deleted inserted replaced
2191:7c7251ce9497 2192:61b3849df76d
18 from .Ui_GreaseMonkeyAddScriptDialog import Ui_GreaseMonkeyAddScriptDialog 18 from .Ui_GreaseMonkeyAddScriptDialog import Ui_GreaseMonkeyAddScriptDialog
19 19
20 from QScintilla.MiniEditor import MiniEditor 20 from QScintilla.MiniEditor import MiniEditor
21 21
22 from Helpviewer import HelpUtilities 22 from Helpviewer import HelpUtilities
23 import Helpviewer.HelpWindow
23 24
24 import UI.PixmapCache 25 import UI.PixmapCache
25 26
26 27
27 class GreaseMonkeyAddScriptDialog(QDialog, Ui_GreaseMonkeyAddScriptDialog): 28 class GreaseMonkeyAddScriptDialog(QDialog, Ui_GreaseMonkeyAddScriptDialog):
80 Private slot handling the accepted signal. 81 Private slot handling the accepted signal.
81 """ 82 """
82 if self.__manager.addScript(self.__script): 83 if self.__manager.addScript(self.__script):
83 msg = self.trUtf8("<p><b>{0}</b> installed successfully.</p>").format( 84 msg = self.trUtf8("<p><b>{0}</b> installed successfully.</p>").format(
84 self.__script.name()) 85 self.__script.name())
86 success = True
85 else: 87 else:
86 msg = self.trUtf8("<p>Cannot install script.</p>") 88 msg = self.trUtf8("<p>Cannot install script.</p>")
89 success = False
87 90
88 E5MessageBox.information(self, 91 if success and Helpviewer.HelpWindow.HelpWindow.notificationsEnabled():
89 self.trUtf8("GreaseMonkey Script Installation"), 92 Helpviewer.HelpWindow.HelpWindow.showNotification(
90 msg) 93 UI.PixmapCache.getPixmap("greaseMonkey48.png"),
94 self.trUtf8("GreaseMonkey Script Installation"),
95 msg)
96 else:
97 E5MessageBox.information(self,
98 self.trUtf8("GreaseMonkey Script Installation"),
99 msg)

eric ide

mercurial