Use nick name consistently in the profile
This commit is contained in:
parent
ed22733941
commit
2536f51570
@ -46,7 +46,7 @@ class ShellOwner(gobject.GObject):
|
||||
def __init__(self):
|
||||
gobject.GObject.__init__(self)
|
||||
|
||||
self._nick = profile.get_name()
|
||||
self._nick = profile.get_nick_name()
|
||||
|
||||
self._icon = None
|
||||
self._icon_hash = ""
|
||||
|
@ -41,7 +41,7 @@ class FriendsBox(hippo.CanvasBox):
|
||||
self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True,
|
||||
xo_color=profile.get_color())
|
||||
self._owner_icon.props.size = style.LARGE_ICON_SIZE
|
||||
palette = Palette(profile.get_name())
|
||||
palette = Palette(profile.get_nick_name())
|
||||
self._owner_icon.set_palette(palette)
|
||||
self._layout.add_center(self._owner_icon)
|
||||
|
||||
|
@ -149,7 +149,7 @@ class HomeMyIcon(MyIcon):
|
||||
self._shell = shell
|
||||
|
||||
def enable_palette(self):
|
||||
palette = Palette(profile.get_name())
|
||||
palette = Palette(profile.get_nick_name())
|
||||
|
||||
reboot_menu_item = gtk.MenuItem(_('Reboot'))
|
||||
reboot_menu_item.connect('activate', self._reboot_activate_cb)
|
||||
|
@ -58,7 +58,7 @@ class Profile(object):
|
||||
privkey_hash -- SHA has of the child's public key
|
||||
"""
|
||||
def __init__(self, path):
|
||||
self.name = None
|
||||
self.nick_name = None
|
||||
self.color = None
|
||||
self.pubkey = None
|
||||
self.privkey_hash = None
|
||||
@ -73,7 +73,7 @@ class Profile(object):
|
||||
self._hash_private_key()
|
||||
|
||||
def is_valid(self):
|
||||
return self.name is not None and \
|
||||
return self.nick_name is not None and \
|
||||
self.color is not None and \
|
||||
self.pubkey is not None and \
|
||||
self.privkey_hash is not None
|
||||
@ -82,8 +82,8 @@ class Profile(object):
|
||||
cp = ConfigParser()
|
||||
parsed = cp.read([self._config_path])
|
||||
|
||||
if self.name:
|
||||
_set_key(cp, 'Buddy', 'NickName', self.name)
|
||||
if self.nick_name:
|
||||
_set_key(cp, 'Buddy', 'NickName', self.nick_name)
|
||||
if self.color:
|
||||
_set_key(cp, 'Buddy', 'Color', self.color.to_string())
|
||||
if self.backup1:
|
||||
@ -104,7 +104,7 @@ class Profile(object):
|
||||
if cp.has_option('Buddy', 'NickName'):
|
||||
name = cp.get('Buddy', 'NickName')
|
||||
# decode nickname from ascii-safe chars to unicode
|
||||
self.name = name.decode("utf-8")
|
||||
self.nick_name = name.decode("utf-8")
|
||||
if cp.has_option('Buddy', 'Color'):
|
||||
self.color = XoColor(cp.get('Buddy', 'Color'))
|
||||
if cp.has_option('Jabber', 'Server'):
|
||||
@ -179,8 +179,8 @@ def get_profile():
|
||||
|
||||
# Convenience methods for frequently used properties
|
||||
|
||||
def get_name():
|
||||
return get_profile().name
|
||||
def get_nick_name():
|
||||
return get_profile().nick_name
|
||||
|
||||
def get_color():
|
||||
return get_profile().color
|
||||
|
Loading…
Reference in New Issue
Block a user