Helpviewer/GreaseMonkey/GreaseMonkeyAddScriptDialog.py

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

eric ide

mercurial