Store terminal titles in layouts
This commit is contained in:
parent
f02f08314e
commit
70ab3b0f71
|
@ -130,4 +130,11 @@ class EditableLabel(gtk.EventBox):
|
||||||
"""Set the label foreground"""
|
"""Set the label foreground"""
|
||||||
self._label.modify_fg(state, color)
|
self._label.modify_fg(state, color)
|
||||||
|
|
||||||
|
def is_custom(self):
|
||||||
|
"""Return whether or not we have a custom string set"""
|
||||||
|
return(self._custom)
|
||||||
|
|
||||||
|
def set_custom(self):
|
||||||
|
"""Set the customness of the string to True"""
|
||||||
|
self._custom = True
|
||||||
gobject.type_register(EditableLabel)
|
gobject.type_register(EditableLabel)
|
||||||
|
|
|
@ -1282,6 +1282,9 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
||||||
if layout != "default":
|
if layout != "default":
|
||||||
# There's no point explicitly noting default profiles
|
# There's no point explicitly noting default profiles
|
||||||
layout['profile'] = profile
|
layout['profile'] = profile
|
||||||
|
title = self.titlebar.get_custom_string()
|
||||||
|
if title:
|
||||||
|
layout['title'] = title
|
||||||
name = 'terminal%d' % count
|
name = 'terminal%d' % count
|
||||||
count = count + 1
|
count = count + 1
|
||||||
global_layout[name] = layout
|
global_layout[name] = layout
|
||||||
|
@ -1298,6 +1301,8 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
||||||
# This doesn't need/use self.titlebar, but it's safer than sending
|
# This doesn't need/use self.titlebar, but it's safer than sending
|
||||||
# None
|
# None
|
||||||
self.really_create_group(self.titlebar, layout['group'])
|
self.really_create_group(self.titlebar, layout['group'])
|
||||||
|
if layout.has_key('title') and layout['title'] != '':
|
||||||
|
self.titlebar.set_custom_string(layout['title'])
|
||||||
|
|
||||||
# There now begins a great list of keyboard event handlers
|
# There now begins a great list of keyboard event handlers
|
||||||
def key_zoom_in(self):
|
def key_zoom_in(self):
|
||||||
|
|
|
@ -244,4 +244,16 @@ class Titlebar(gtk.EventBox):
|
||||||
self.bellicon.hide()
|
self.bellicon.hide()
|
||||||
return(False)
|
return(False)
|
||||||
|
|
||||||
|
def get_custom_string(self):
|
||||||
|
"""If we have a custom string set, return it, otherwise None"""
|
||||||
|
if self.label.is_custom():
|
||||||
|
return(self.label.get_text())
|
||||||
|
else:
|
||||||
|
return(None)
|
||||||
|
|
||||||
|
def set_custom_string(self, string):
|
||||||
|
"""Set a custom string"""
|
||||||
|
self.label.set_text(string)
|
||||||
|
self.label.set_custom()
|
||||||
|
|
||||||
gobject.type_register(Titlebar)
|
gobject.type_register(Titlebar)
|
||||||
|
|
Loading…
Reference in New Issue