diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2006-05-18 20:35:12 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2006-05-18 20:35:12 (GMT) |
commit | fd8a921d96e30fe887275b7f76df3c8f24c61b24 (patch) | |
tree | 665ddb75d22827c8809d80bc2336ce129ab8077f /sugar/browser | |
parent | 6f77290880dbb6dcb9d37988697124c073e3b381 (diff) |
Improve the page sharing UI
Diffstat (limited to 'sugar/browser')
-rw-r--r-- | sugar/browser/NotificationBar.py | 2 | ||||
-rwxr-xr-x | sugar/browser/browser.py | 24 |
2 files changed, 18 insertions, 8 deletions
diff --git a/sugar/browser/NotificationBar.py b/sugar/browser/NotificationBar.py index 71ce151..3c943b1 100644 --- a/sugar/browser/NotificationBar.py +++ b/sugar/browser/NotificationBar.py @@ -42,7 +42,7 @@ class NotificationBar(gtk.HBox): return False def set_text(self, text): - self._text_label.set_markup('<b>' + text + '</b>') + self._text_label.set_markup(text) def set_action(self, action_id, action_text): self._action_id = action_id diff --git a/sugar/browser/browser.py b/sugar/browser/browser.py index bec69eb..a70028e 100755 --- a/sugar/browser/browser.py +++ b/sugar/browser/browser.py @@ -172,12 +172,17 @@ class BrowserActivity(activity.Activity): self.uri = uri self._group = group self._mode = BrowserActivity.SOLO + + def _update_shared_location(self): + address = self.embed.get_address() + self._model.set_value('address', address) + title = self.embed.get_title() + self._model.set_value('title', title) def __notif_bar_action_cb(self, bar, action_id): print action_id if action_id == 'set_shared_location': - address = self.embed.get_address() - self._model.set_value('address', address) + self._update_shared_location() elif action_id == 'goto_shared_location': address = self._model.get_value("address") print address @@ -187,8 +192,8 @@ class BrowserActivity(activity.Activity): def set_mode(self, mode): self._mode = mode if mode == BrowserActivity.LEADING: - self._notif_bar.set_text("You are leading the browsing.") - self._notif_bar.set_action("set_shared_location", "Move Here") + self._notif_bar.set_text("Share this page with the group.") + self._notif_bar.set_action("set_shared_location", "Share") self._notif_bar.show() def _setup_shared(self, uri): @@ -235,7 +240,8 @@ class BrowserActivity(activity.Activity): def share(self): address = self.embed.get_address() self._model = self._group.get_store().create_model(address) - self._model.set_value('address', address) + self._model.set_value('owner', self._group.get_owner().get_nick_name()) + self._update_shared_location() self.set_mode(BrowserActivity.LEADING) bus = dbus.SessionBus() @@ -254,8 +260,12 @@ class BrowserActivity(activity.Activity): self._notify_shared_location_change() def _notify_shared_location_change(self): - self._notif_bar.set_text("The lead moved to a new location.") - self._notif_bar.set_action("goto_shared_location", "Move There") + owner = self._model.get_value('owner') + title = self._model.get_value('title') + + text = '<b>' + owner + '</b> is reading <i>' + title + '</i>' + self._notif_bar.set_text(text) + self._notif_bar.set_action("goto_shared_location", "Go There") self._notif_bar.show() def activity_on_close_from_user(self): |