97 executable = self.executableEdit.text() |
97 executable = self.executableEdit.text() |
98 arguments = self.argumentsEdit.text() |
98 arguments = self.argumentsEdit.text() |
99 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] |
99 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] |
100 |
100 |
101 if not executable: |
101 if not executable: |
102 E5MessageBox.critical(self, |
102 E5MessageBox.critical( |
|
103 self, |
103 self.trUtf8("Add tool entry"), |
104 self.trUtf8("Add tool entry"), |
104 self.trUtf8("You have to set an executable to add to the" |
105 self.trUtf8( |
|
106 "You have to set an executable to add to the" |
105 " Tools-Menu first.")) |
107 " Tools-Menu first.")) |
106 return |
108 return |
107 |
109 |
108 if not menutext: |
110 if not menutext: |
109 E5MessageBox.critical(self, |
111 E5MessageBox.critical( |
|
112 self, |
110 self.trUtf8("Add tool entry"), |
113 self.trUtf8("Add tool entry"), |
111 self.trUtf8("You have to insert a menuentry text to add the" |
114 self.trUtf8( |
|
115 "You have to insert a menuentry text to add the" |
112 " selected program to the Tools-Menu first.")) |
116 " selected program to the Tools-Menu first.")) |
113 return |
117 return |
114 |
118 |
115 if not Utilities.isinpath(executable): |
119 if not Utilities.isinpath(executable): |
116 E5MessageBox.critical(self, |
120 E5MessageBox.critical( |
|
121 self, |
117 self.trUtf8("Add tool entry"), |
122 self.trUtf8("Add tool entry"), |
118 self.trUtf8("The selected file could not be found or" |
123 self.trUtf8( |
|
124 "The selected file could not be found or" |
119 " is not an executable." |
125 " is not an executable." |
120 " Please choose an executable filename.")) |
126 " Please choose an executable filename.")) |
121 return |
127 return |
122 |
128 |
123 if len(self.toolsList.findItems( |
129 if len(self.toolsList.findItems( |
124 menutext, Qt.MatchFlags(Qt.MatchExactly))): |
130 menutext, Qt.MatchFlags(Qt.MatchExactly))): |
125 E5MessageBox.critical(self, |
131 E5MessageBox.critical( |
|
132 self, |
126 self.trUtf8("Add tool entry"), |
133 self.trUtf8("Add tool entry"), |
127 self.trUtf8("An entry for the menu text {0} already exists.")\ |
134 self.trUtf8("An entry for the menu text {0} already exists.")\ |
128 .format(menutext)) |
135 .format(menutext)) |
129 return |
136 return |
130 |
137 |
152 executable = self.executableEdit.text() |
159 executable = self.executableEdit.text() |
153 arguments = self.argumentsEdit.text() |
160 arguments = self.argumentsEdit.text() |
154 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] |
161 redirect = self.redirectionModes[self.redirectCombo.currentIndex()][0] |
155 |
162 |
156 if not executable: |
163 if not executable: |
157 E5MessageBox.critical(self, |
164 E5MessageBox.critical( |
|
165 self, |
158 self.trUtf8("Change tool entry"), |
166 self.trUtf8("Change tool entry"), |
159 self.trUtf8("You have to set an executable to change the" |
167 self.trUtf8( |
|
168 "You have to set an executable to change the" |
160 " Tools-Menu entry.")) |
169 " Tools-Menu entry.")) |
161 return |
170 return |
162 |
171 |
163 if not menutext: |
172 if not menutext: |
164 E5MessageBox.critical(self, |
173 E5MessageBox.critical( |
|
174 self, |
165 self.trUtf8("Change tool entry"), |
175 self.trUtf8("Change tool entry"), |
166 self.trUtf8("You have to insert a menuentry text to change the" |
176 self.trUtf8( |
|
177 "You have to insert a menuentry text to change the" |
167 " selected Tools-Menu entry.")) |
178 " selected Tools-Menu entry.")) |
168 return |
179 return |
169 |
180 |
170 if not Utilities.isinpath(executable): |
181 if not Utilities.isinpath(executable): |
171 E5MessageBox.critical(self, |
182 E5MessageBox.critical( |
|
183 self, |
172 self.trUtf8("Change tool entry"), |
184 self.trUtf8("Change tool entry"), |
173 self.trUtf8("The selected file could not be found or" |
185 self.trUtf8( |
|
186 "The selected file could not be found or" |
174 " is not an executable." |
187 " is not an executable." |
175 " Please choose an existing executable filename.")) |
188 " Please choose an existing executable filename.")) |
176 return |
189 return |
177 |
190 |
178 self.toollist[row] = { |
191 self.toollist[row] = { |
259 self.executableEdit.text(), |
272 self.executableEdit.text(), |
260 "") |
273 "") |
261 if execfile: |
274 if execfile: |
262 execfile = Utilities.toNativeSeparators(execfile) |
275 execfile = Utilities.toNativeSeparators(execfile) |
263 if not Utilities.isinpath(execfile): |
276 if not Utilities.isinpath(execfile): |
264 E5MessageBox.critical(self, |
277 E5MessageBox.critical( |
|
278 self, |
265 self.trUtf8("Select executable"), |
279 self.trUtf8("Select executable"), |
266 self.trUtf8("The selected file is not an executable." |
280 self.trUtf8( |
|
281 "The selected file is not an executable." |
267 " Please choose an executable filename.")) |
282 " Please choose an executable filename.")) |
268 return |
283 return |
269 |
284 |
270 self.executableEdit.setText(execfile) |
285 self.executableEdit.setText(execfile) |
271 |
286 |