Use nick name consistently in the profile

This commit is contained in:
Marco Pesenti Gritti 2007-09-17 16:28:21 +02:00
parent ed22733941
commit 2536f51570
4 changed files with 10 additions and 10 deletions

View File

@ -46,7 +46,7 @@ class ShellOwner(gobject.GObject):
def __init__(self): def __init__(self):
gobject.GObject.__init__(self) gobject.GObject.__init__(self)
self._nick = profile.get_name() self._nick = profile.get_nick_name()
self._icon = None self._icon = None
self._icon_hash = "" self._icon_hash = ""

View File

@ -41,7 +41,7 @@ class FriendsBox(hippo.CanvasBox):
self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True, self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True,
xo_color=profile.get_color()) xo_color=profile.get_color())
self._owner_icon.props.size = style.LARGE_ICON_SIZE 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._owner_icon.set_palette(palette)
self._layout.add_center(self._owner_icon) self._layout.add_center(self._owner_icon)

View File

@ -149,7 +149,7 @@ class HomeMyIcon(MyIcon):
self._shell = shell self._shell = shell
def enable_palette(self): def enable_palette(self):
palette = Palette(profile.get_name()) palette = Palette(profile.get_nick_name())
reboot_menu_item = gtk.MenuItem(_('Reboot')) reboot_menu_item = gtk.MenuItem(_('Reboot'))
reboot_menu_item.connect('activate', self._reboot_activate_cb) reboot_menu_item.connect('activate', self._reboot_activate_cb)

View File

@ -58,7 +58,7 @@ class Profile(object):
privkey_hash -- SHA has of the child's public key privkey_hash -- SHA has of the child's public key
""" """
def __init__(self, path): def __init__(self, path):
self.name = None self.nick_name = None
self.color = None self.color = None
self.pubkey = None self.pubkey = None
self.privkey_hash = None self.privkey_hash = None
@ -73,7 +73,7 @@ class Profile(object):
self._hash_private_key() self._hash_private_key()
def is_valid(self): 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.color is not None and \
self.pubkey is not None and \ self.pubkey is not None and \
self.privkey_hash is not None self.privkey_hash is not None
@ -82,8 +82,8 @@ class Profile(object):
cp = ConfigParser() cp = ConfigParser()
parsed = cp.read([self._config_path]) parsed = cp.read([self._config_path])
if self.name: if self.nick_name:
_set_key(cp, 'Buddy', 'NickName', self.name) _set_key(cp, 'Buddy', 'NickName', self.nick_name)
if self.color: if self.color:
_set_key(cp, 'Buddy', 'Color', self.color.to_string()) _set_key(cp, 'Buddy', 'Color', self.color.to_string())
if self.backup1: if self.backup1:
@ -104,7 +104,7 @@ class Profile(object):
if cp.has_option('Buddy', 'NickName'): if cp.has_option('Buddy', 'NickName'):
name = cp.get('Buddy', 'NickName') name = cp.get('Buddy', 'NickName')
# decode nickname from ascii-safe chars to unicode # 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'): if cp.has_option('Buddy', 'Color'):
self.color = XoColor(cp.get('Buddy', 'Color')) self.color = XoColor(cp.get('Buddy', 'Color'))
if cp.has_option('Jabber', 'Server'): if cp.has_option('Jabber', 'Server'):
@ -179,8 +179,8 @@ def get_profile():
# Convenience methods for frequently used properties # Convenience methods for frequently used properties
def get_name(): def get_nick_name():
return get_profile().name return get_profile().nick_name
def get_color(): def get_color():
return get_profile().color return get_profile().color