Use TerminatorTerm's get_window_title(), rather than everyone asking vte and failing to handle it properly.
This commit is contained in:
parent
4c0e500c7b
commit
f96018f0bc
@ -329,7 +329,7 @@ class Terminator:
|
||||
#parent.remove_page(page)
|
||||
pane.show()
|
||||
parent.insert_page(pane, None, page)
|
||||
notebooktablabel = TerminatorNotebookTabLabel(widget._vte.get_window_title(), parent, self)
|
||||
notebooktablabel = TerminatorNotebookTabLabel(widget.get_window_title(), parent, self)
|
||||
parent.set_tab_label(pane,notebooktablabel)
|
||||
parent.set_tab_label_packing(pane, True, True, gtk.PACK_START)
|
||||
parent.set_tab_reorderable(pane, True)
|
||||
@ -489,8 +489,8 @@ class Terminator:
|
||||
notebooklabel = ""
|
||||
if isinstance(child, TerminatorTerm):
|
||||
child._titlebox.hide()
|
||||
if widget._vte.get_window_title() is not None:
|
||||
notebooklabel = widget._vte.get_window_title()
|
||||
if widget.get_window_title() is not None:
|
||||
notebooklabel = widget.get_window_title()
|
||||
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
|
||||
notebook.set_tab_label(child, notebooktablabel)
|
||||
notebook.set_tab_label_packing(child, True, True, gtk.PACK_START)
|
||||
@ -515,13 +515,7 @@ class Terminator:
|
||||
notebook.append_page(terminal,None)
|
||||
terminal.show ()
|
||||
terminal.spawn_child ()
|
||||
## Some gtk/vte weirdness
|
||||
## If we don't use this silly test,
|
||||
## terminal._vte.get_window_title() might return
|
||||
## bogus values
|
||||
notebooklabel = ""
|
||||
if terminal._vte.get_window_title() is not None:
|
||||
notebooklabel = terminal._vte.get_window_title()
|
||||
notebooklabel = terminal.get_window_title()
|
||||
notebooktablabel = TerminatorNotebookTabLabel(notebooklabel, notebook, self)
|
||||
notebook.set_tab_label(terminal, notebooktablabel)
|
||||
notebook.set_tab_label_packing(terminal, True, True, gtk.PACK_START)
|
||||
|
@ -968,14 +968,16 @@ text/plain
|
||||
radioitem.connect ('activate', self.on_encoding_change, encoding[1])
|
||||
submenu.append (radioitem)
|
||||
|
||||
def get_vte_window_title(self, vte):
|
||||
def get_window_title(self, vte = None):
|
||||
if vte is None:
|
||||
vte = self._vte
|
||||
title = vte.get_window_title ()
|
||||
if title is None:
|
||||
title = str(self.command)
|
||||
return title
|
||||
|
||||
def on_vte_title_change(self, vte):
|
||||
title = self.get_vte_window_title(vte)
|
||||
title = self.get_window_title(vte)
|
||||
if self.conf.titletips:
|
||||
vte.set_property ("has-tooltip", True)
|
||||
vte.set_property ("tooltip-text", title)
|
||||
@ -1001,7 +1003,7 @@ text/plain
|
||||
return
|
||||
|
||||
def on_vte_focus(self, vte):
|
||||
title = self.get_vte_window_title(vte)
|
||||
title = self.get_window_title(vte)
|
||||
self.terminator.set_window_title("%s - %s" % (title, APP_NAME.capitalize()))
|
||||
notebookpage = self.terminator.get_first_notebook_page(vte)
|
||||
while notebookpage != None:
|
||||
|
Loading…
Reference in New Issue
Block a user