Preferences/ToolConfigurationDialog.py

changeset 537
72b32daeb8d6
parent 97
c4086afea02b
child 564
b3d966393ba9
equal deleted inserted replaced
536:6d8d39753c82 537:72b32daeb8d6
11 11
12 from PyQt4.QtCore import * 12 from PyQt4.QtCore import *
13 from PyQt4.QtGui import * 13 from PyQt4.QtGui import *
14 14
15 from E5Gui.E5Completers import E5FileCompleter 15 from E5Gui.E5Completers import E5FileCompleter
16 from E5Gui import E5MessageBox
16 17
17 from .Ui_ToolConfigurationDialog import Ui_ToolConfigurationDialog 18 from .Ui_ToolConfigurationDialog import Ui_ToolConfigurationDialog
18 import Utilities 19 import Utilities
19 20
20 class ToolConfigurationDialog(QDialog, Ui_ToolConfigurationDialog): 21 class ToolConfigurationDialog(QDialog, Ui_ToolConfigurationDialog):
92 executable = self.executableEdit.text() 93 executable = self.executableEdit.text()
93 arguments = self.argumentsEdit.text() 94 arguments = self.argumentsEdit.text()
94 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] 95 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0]
95 96
96 if not executable: 97 if not executable:
97 QMessageBox.critical(self, 98 E5MessageBox.critical(self,
98 self.trUtf8("Add tool entry"), 99 self.trUtf8("Add tool entry"),
99 self.trUtf8("You have to set an executable to add to the" 100 self.trUtf8("You have to set an executable to add to the"
100 " Tools-Menu first.")) 101 " Tools-Menu first."))
101 return 102 return
102 103
103 if not menutext: 104 if not menutext:
104 QMessageBox.critical(self, 105 E5MessageBox.critical(self,
105 self.trUtf8("Add tool entry"), 106 self.trUtf8("Add tool entry"),
106 self.trUtf8("You have to insert a menuentry text to add the" 107 self.trUtf8("You have to insert a menuentry text to add the"
107 " selected program to the Tools-Menu first.")) 108 " selected program to the Tools-Menu first."))
108 return 109 return
109 110
110 if not Utilities.isinpath(executable): 111 if not Utilities.isinpath(executable):
111 QMessageBox.critical(self, 112 E5MessageBox.critical(self,
112 self.trUtf8("Add tool entry"), 113 self.trUtf8("Add tool entry"),
113 self.trUtf8("The selected file could not be found or" 114 self.trUtf8("The selected file could not be found or"
114 " is not an executable." 115 " is not an executable."
115 " Please choose an executable filename.")) 116 " Please choose an executable filename."))
116 return 117 return
117 118
118 if len(self.toolsList.findItems(menutext, Qt.MatchFlags(Qt.MatchExactly))): 119 if len(self.toolsList.findItems(menutext, Qt.MatchFlags(Qt.MatchExactly))):
119 QMessageBox.critical(self, 120 E5MessageBox.critical(self,
120 self.trUtf8("Add tool entry"), 121 self.trUtf8("Add tool entry"),
121 self.trUtf8("An entry for the menu text {0} already exists.")\ 122 self.trUtf8("An entry for the menu text {0} already exists.")\
122 .format(menutext)) 123 .format(menutext))
123 return 124 return
124 125
146 executable = self.executableEdit.text() 147 executable = self.executableEdit.text()
147 arguments = self.argumentsEdit.text() 148 arguments = self.argumentsEdit.text()
148 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] 149 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0]
149 150
150 if not executable: 151 if not executable:
151 QMessageBox.critical(self, 152 E5MessageBox.critical(self,
152 self.trUtf8("Change tool entry"), 153 self.trUtf8("Change tool entry"),
153 self.trUtf8("You have to set an executable to change the" 154 self.trUtf8("You have to set an executable to change the"
154 " Tools-Menu entry.")) 155 " Tools-Menu entry."))
155 return 156 return
156 157
157 if not menutext: 158 if not menutext:
158 QMessageBox.critical(self, 159 E5MessageBox.critical(self,
159 self.trUtf8("Change tool entry"), 160 self.trUtf8("Change tool entry"),
160 self.trUtf8("You have to insert a menuentry text to change the" 161 self.trUtf8("You have to insert a menuentry text to change the"
161 " selected Tools-Menu entry.")) 162 " selected Tools-Menu entry."))
162 return 163 return
163 164
164 if not Utilities.isinpath(executable): 165 if not Utilities.isinpath(executable):
165 QMessageBox.critical(self, 166 E5MessageBox.critical(self,
166 self.trUtf8("Change tool entry"), 167 self.trUtf8("Change tool entry"),
167 self.trUtf8("The selected file could not be found or" 168 self.trUtf8("The selected file could not be found or"
168 " is not an executable." 169 " is not an executable."
169 " Please choose an existing executable filename.")) 170 " Please choose an existing executable filename."))
170 return 171 return
252 self.executableEdit.text(), 253 self.executableEdit.text(),
253 "") 254 "")
254 if execfile: 255 if execfile:
255 execfile = Utilities.toNativeSeparators(execfile) 256 execfile = Utilities.toNativeSeparators(execfile)
256 if not Utilities.isinpath(execfile): 257 if not Utilities.isinpath(execfile):
257 QMessageBox.critical(self, 258 E5MessageBox.critical(self,
258 self.trUtf8("Select executable"), 259 self.trUtf8("Select executable"),
259 self.trUtf8("The selected file is not an executable." 260 self.trUtf8("The selected file is not an executable."
260 " Please choose an executable filename.")) 261 " Please choose an executable filename."))
261 return 262 return
262 263

eric ide

mercurial