Add activity.keep_button

This commit is contained in:
Aleksey Lim 2009-07-28 11:58:31 +00:00
parent 095c732c9a
commit 2088bd5f2a

View File

@ -132,16 +132,8 @@ class ActivityToolbar(gtk.Toolbar):
self._update_share() self._update_share()
self.keep = ToolButton(tooltip=_('Keep')) self.keep = keep_button(activity)
client = gconf.client_get_default()
color = XoColor(client.get_string('/desktop/sugar/user/color'))
keep_icon = Icon(icon_name='document-save', xo_color=color)
self.keep.set_icon_widget(keep_icon)
keep_icon.show()
self.keep.props.accelerator = '<Ctrl>S'
self.keep.connect('clicked', self.__keep_clicked_cb)
self.insert(self.keep, -1) self.insert(self.keep, -1)
self.keep.show()
if not hide_stop: if not hide_stop:
self.stop = stop_button(activity) self.stop = stop_button(activity)
@ -174,9 +166,6 @@ class ActivityToolbar(gtk.Toolbar):
if scope == SCOPE_NEIGHBORHOOD: if scope == SCOPE_NEIGHBORHOOD:
self._activity.share() self._activity.share()
def __keep_clicked_cb(self, button):
self._activity.copy()
def __jobject_updated_cb(self, jobject): def __jobject_updated_cb(self, jobject):
self.title.set_text(jobject['title']) self.title.set_text(jobject['title'])
@ -1120,13 +1109,10 @@ def share_button(activity, **kwargs):
def update_share(): def update_share():
quiet_trigger.append(True) quiet_trigger.append(True)
logging.error(private.props.sensitive)
if activity.get_shared(): if activity.get_shared():
private.props.sensitive = False private.props.sensitive = False
neighborhood.props.sensitive = False neighborhood.props.sensitive = False
neighborhood.props.active = True neighborhood.props.active = True
logging.error(private.props.sensitive)
else: else:
private.props.sensitive = True private.props.sensitive = True
neighborhood.props.sensitive = True neighborhood.props.sensitive = True
@ -1138,3 +1124,17 @@ def share_button(activity, **kwargs):
activity.connect('joined', lambda activity: update_share()) activity.connect('joined', lambda activity: update_share())
return RadioMenuButton(palette=palette) return RadioMenuButton(palette=palette)
def keep_button(activity, **kwargs):
client = gconf.client_get_default()
color = XoColor(client.get_string('/desktop/sugar/user/color'))
keep_icon = Icon(icon_name='document-save', xo_color=color)
keep_icon.show()
keep = ToolButton(tooltip=_('Keep'))
keep.set_icon_widget(keep_icon)
keep.props.accelerator = '<Ctrl>S'
keep.connect('clicked', lambda button: activity.copy())
keep.show()
return keep