Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3484
645c12de6b0c
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
47 47
48 include = script.include() 48 include = script.include()
49 exclude = script.exclude() 49 exclude = script.exclude()
50 50
51 if include: 51 if include:
52 runsAt = self.trUtf8("<p>runs at:<br/><i>{0}</i></p>").format( 52 runsAt = self.tr("<p>runs at:<br/><i>{0}</i></p>").format(
53 "<br/>".join(include)) 53 "<br/>".join(include))
54 54
55 if exclude: 55 if exclude:
56 doesNotRunAt = self.trUtf8( 56 doesNotRunAt = self.tr(
57 "<p>does not run at:<br/><i>{0}</i></p>").format( 57 "<p>does not run at:<br/><i>{0}</i></p>").format(
58 "<br/>".join(exclude)) 58 "<br/>".join(exclude))
59 59
60 scriptInfoTxt = "<p><b>{0}</b> {1}<br/>{2}</p>{3}{4}".format( 60 scriptInfoTxt = "<p><b>{0}</b> {1}<br/>{2}</p>{3}{4}".format(
61 script.name(), script.version(), script.description(), runsAt, 61 script.name(), script.version(), script.description(), runsAt,
81 def __accepted(self): 81 def __accepted(self):
82 """ 82 """
83 Private slot handling the accepted signal. 83 Private slot handling the accepted signal.
84 """ 84 """
85 if self.__manager.addScript(self.__script): 85 if self.__manager.addScript(self.__script):
86 msg = self.trUtf8( 86 msg = self.tr(
87 "<p><b>{0}</b> installed successfully.</p>").format( 87 "<p><b>{0}</b> installed successfully.</p>").format(
88 self.__script.name()) 88 self.__script.name())
89 success = True 89 success = True
90 else: 90 else:
91 msg = self.trUtf8("<p>Cannot install script.</p>") 91 msg = self.tr("<p>Cannot install script.</p>")
92 success = False 92 success = False
93 93
94 import Helpviewer.HelpWindow 94 import Helpviewer.HelpWindow
95 if success and Helpviewer.HelpWindow.HelpWindow.notificationsEnabled(): 95 if success and Helpviewer.HelpWindow.HelpWindow.notificationsEnabled():
96 Helpviewer.HelpWindow.HelpWindow.showNotification( 96 Helpviewer.HelpWindow.HelpWindow.showNotification(
97 UI.PixmapCache.getPixmap("greaseMonkey48.png"), 97 UI.PixmapCache.getPixmap("greaseMonkey48.png"),
98 self.trUtf8("GreaseMonkey Script Installation"), 98 self.tr("GreaseMonkey Script Installation"),
99 msg) 99 msg)
100 else: 100 else:
101 E5MessageBox.information( 101 E5MessageBox.information(
102 self, 102 self,
103 self.trUtf8("GreaseMonkey Script Installation"), 103 self.tr("GreaseMonkey Script Installation"),
104 msg) 104 msg)

eric ide

mercurial