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) |