Plugins/ViewManagerPlugins/Listspace/Listspace.py

changeset 560
0a621357b213
parent 525
400b72e2602a
child 791
9ec2ac20e54e
equal deleted inserted replaced
559:ee695ebbd6e0 560:0a621357b213
416 Change the displayed name of the editor. 416 Change the displayed name of the editor.
417 417
418 @param editor editor window to be changed 418 @param editor editor window to be changed
419 @param newName new name to be shown (string) 419 @param newName new name to be shown (string)
420 """ 420 """
421 currentRow = self.viewlist.currentRow() 421 if newName:
422 index = self.editors.index(editor) 422 currentRow = self.viewlist.currentRow()
423 txt = os.path.basename(newName) 423 index = self.editors.index(editor)
424 if not QFileInfo(newName).isWritable(): 424 txt = os.path.basename(newName)
425 txt = self.trUtf8("{0} (ro)").format(txt) 425 if not QFileInfo(newName).isWritable():
426 itm = self.viewlist.item(index) 426 txt = self.trUtf8("{0} (ro)").format(txt)
427 itm.setText(txt) 427 itm = self.viewlist.item(index)
428 itm.setToolTip(newName) 428 itm.setText(txt)
429 self.viewlist.setCurrentRow(currentRow) 429 itm.setToolTip(newName)
430 self.changeCaption.emit(newName) 430 self.viewlist.setCurrentRow(currentRow)
431 431 self.changeCaption.emit(newName)
432
432 def _modificationStatusChanged(self, m, editor): 433 def _modificationStatusChanged(self, m, editor):
433 """ 434 """
434 Protected slot to handle the modificationStatusChanged signal. 435 Protected slot to handle the modificationStatusChanged signal.
435 436
436 @param m flag indicating the modification status (boolean) 437 @param m flag indicating the modification status (boolean)

eric ide

mercurial