Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

rename: show correct title for msgboxes

Changeset 0aef49561c04

Parent 09c8717417b0

by Johan Samyn

Changes to one file · Browse files at 0aef49561c04 Showing diff from parent 09c8717417b0 Diff from another changeset...

 
39
40
41
42
 
43
44
45
 
155
156
157
158
 
 
159
160
161
 
 
 
162
163
164
 
245
246
247
248
 
249
250
251
252
 
253
254
255
256
257
 
258
259
260
261
 
262
263
264
265
 
266
267
268
 
290
291
292
293
 
 
294
295
296
 
 
297
298
 
299
300
301
302
303
 
 
304
305
306
 
307
308
309
 
326
327
328
329
330
 
 
331
332
333
 
39
40
41
 
42
43
44
45
 
155
156
157
 
158
159
160
161
 
162
163
164
165
166
167
 
248
249
250
 
251
252
253
254
 
255
256
257
258
259
 
260
261
262
263
 
264
265
266
267
 
268
269
270
271
 
293
294
295
 
296
297
298
299
 
300
301
302
 
303
304
305
306
307
 
308
309
310
311
 
312
313
314
315
 
332
333
334
 
 
335
336
337
338
339
@@ -39,7 +39,7 @@
  self.root = paths.find_root()   self.repo = thgrepo.repository(ui, path=self.root)   except (error.RepoError): - qtlib.ErrorMsgBox(_('Rename Error'), + qtlib.ErrorMsgBox(_('Error'),   _('Could not find or initialize the repository'   ' from folder<p>%s</p>' % cwd))   return ('', '') @@ -155,10 +155,13 @@
  self.reponame = self.repo.displayname   if self.copy_chk.isChecked():   wt = (_('Copy - %s') % self.reponame) - self.rename_btn.setText(_('Copy')) + self.msgTitle = _('Copy') + self.errTitle = _('Copy Error')   else:   wt = (_('Rename - %s') % self.reponame) - self.rename_btn.setText(_('Rename')) + self.msgTitle = _('Rename') + self.errTitle = _('Rename Error') + self.rename_btn.setText(self.msgTitle)   self.setWindowTitle(wt)     def get_src(self): @@ -245,24 +248,24 @@
  new_name = os.path.relpath(dest, start=self.root)   self.dest_txt.setText(new_name)   if not os.path.exists(src): - qtlib.WarningMsgBox(_('Rename'), _('Source does not exists.')) + qtlib.WarningMsgBox(self.msgTitle, _('Source does not exists.'))   return   fullsrc = os.path.abspath(src)   if not fullsrc.startswith(self.repo.root): - qtlib.ErrorMsgBox(_('Rename Error'), + qtlib.ErrorMsgBox(self.errTitle,   _('The source must be within the repository tree.'))   return   fulldest = os.path.abspath(dest)   if not fulldest.startswith(self.repo.root): - qtlib.ErrorMsgBox(_('Rename Error'), + qtlib.ErrorMsgBox(self.errTitle,   _('The destination must be within the repository tree.'))   return   if src == dest: - qtlib.ErrorMsgBox(_('Rename Error'), + qtlib.ErrorMsgBox(self.errTitle,   _('Please give a destination that differs from the source'))   return   if os.path.exists(dest) and os.path.isfile(dest): - res = qtlib.QuestionMsgBox(_('Rename'), '<p>%s</p><p>%s</p>' % + res = qtlib.QuestionMsgBox(self.msgTitle, '<p>%s</p><p>%s</p>' %   (_('Destination file already exists.'),   _('Are you sure you want to overwrite it ?')),   defaultbutton=QMessageBox.No) @@ -290,20 +293,23 @@
  if not os.path.isdir(targetdir):   os.makedirs(targetdir)   if self.copy_chk.isChecked(): - commands.copy(self.repo.ui, self.repo, curr_name, new_name, **opts) + commands.copy(self.repo.ui, self.repo, curr_name, + new_name, **opts)   else:   os.rename(curr_name, new_name) - commands.rename(self.repo.ui, self.repo, curr_name, new_name, **opts) + commands.rename(self.repo.ui, self.repo, curr_name, + new_name, **opts)   except (OSError, IOError, util.Abort, error.RepoError), inst: - qtlib.ErrorMsgBox(_('Rename Error'), + qtlib.ErrorMsgBox(self.errTitle,   _('The following erorr was caught with rename :'),   hglib.tounicode(inst))   finally:   sys.stderr = saved - textout = hglib.tounicode(errors.getvalue() + self.repo.ui.popbuffer()) + textout = hglib.tounicode(errors.getvalue() + + self.repo.ui.popbuffer())   errors.close()   if len(textout) > 1: - qtlib.ErrorMsgBox(_('Rename Error'), textout) + qtlib.ErrorMsgBox(self.errTitle, textout)     def detail_clicked(self):   if self.cmd.is_show_output(): @@ -326,8 +332,8 @@
  self.detail_btn.setShown(True)     def command_finished(self, wrapper): - if wrapper.data is not 0 or self.cmd.is_show_output()\ - or self.keep_open_chk.isChecked(): + if (wrapper.data is not 0 or self.cmd.is_show_output() + or self.keep_open_chk.isChecked()):   if not self.cmd.is_show_output():   self.detail_btn.click()   self.cancel_btn.setHidden(True)