Commit 3f778101 authored by Dan Pascu's avatar Dan Pascu

Renamed myicon to avatar

parent 66bbc3f6
...@@ -65,7 +65,7 @@ class MainWindow(base_class, ui_class): ...@@ -65,7 +65,7 @@ class MainWindow(base_class, ui_class):
self.default_icon_path = Resources.get('icons/default-avatar.png') self.default_icon_path = Resources.get('icons/default-avatar.png')
self.default_icon = QIcon(self.default_icon_path) self.default_icon = QIcon(self.default_icon_path)
self.last_icon_directory = os.path.expanduser('~') self.last_icon_directory = os.path.expanduser('~')
self.set_user_icon(IconManager().get('myicon')) self.set_user_icon(IconManager().get('avatar'))
self.active_sessions_label.hide() self.active_sessions_label.hide()
self.enable_call_buttons(False) self.enable_call_buttons(False)
...@@ -382,7 +382,7 @@ class MainWindow(base_class, ui_class): ...@@ -382,7 +382,7 @@ class MainWindow(base_class, ui_class):
settings = BlinkSettings() settings = BlinkSettings()
icon_manager = IconManager() icon_manager = IconManager()
if filename is not None: if filename is not None:
icon = icon_manager.store_file('myicon', filename) icon = icon_manager.store_file('avatar', filename)
try: try:
hash = hashlib.sha512(open(icon.filename).read()).hexdigest() hash = hashlib.sha512(open(icon.filename).read()).hexdigest()
except Exception: except Exception:
...@@ -390,7 +390,7 @@ class MainWindow(base_class, ui_class): ...@@ -390,7 +390,7 @@ class MainWindow(base_class, ui_class):
else: else:
settings.presence.icon = IconDescriptor('file://' + icon.filename, hash) settings.presence.icon = IconDescriptor('file://' + icon.filename, hash)
else: else:
icon_manager.remove('myicon') icon_manager.remove('avatar')
icon = None icon = None
settings.presence.icon = None settings.presence.icon = None
settings.save() settings.save()
...@@ -672,7 +672,7 @@ class MainWindow(base_class, ui_class): ...@@ -672,7 +672,7 @@ class MainWindow(base_class, ui_class):
state = getattr(AccountState, blink_settings.presence.current_state.state, AccountState.Available) state = getattr(AccountState, blink_settings.presence.current_state.state, AccountState.Available)
self.account_state.setState(state, blink_settings.presence.current_state.note) self.account_state.setState(state, blink_settings.presence.current_state.note)
if 'presence.icon' in notification.data.modified: if 'presence.icon' in notification.data.modified:
self.set_user_icon(IconManager().get('myicon')) self.set_user_icon(IconManager().get('avatar'))
if 'presence.offline_note' in notification.data.modified: if 'presence.offline_note' in notification.data.modified:
# TODO: set offline note -Saul # TODO: set offline note -Saul
pass pass
......
...@@ -192,7 +192,7 @@ class PresencePublicationHandler(object): ...@@ -192,7 +192,7 @@ class PresencePublicationHandler(object):
def _save_icon(self, icon_data, icon_hash): def _save_icon(self, icon_data, icon_hash):
settings = BlinkSettings() settings = BlinkSettings()
if None not in (icon_data, icon_hash): if None not in (icon_data, icon_hash):
icon = IconManager().store_data('myicon', icon_data) icon = IconManager().store_data('avatar', icon_data)
if icon: if icon:
settings.presence.icon = IconDescriptor('file://' + icon.filename, icon_hash) settings.presence.icon = IconDescriptor('file://' + icon.filename, icon_hash)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment