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