diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-10-29 02:44:03 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-10-29 02:44:03 (GMT) |
commit | cae6e9d4e52fa03ed0f3edd7f5e470914693ee21 (patch) | |
tree | a87c0ca5f2536175ab66658fa02d79769c0d2d03 /button.py | |
parent | 6d703b14cef404ada23500d6eee218f77a6b75cb (diff) |
options to add copy to a toolbar button later
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@774 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'button.py')
-rw-r--r-- | button.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -18,8 +18,9 @@ class RecdButton(TrayButton, gobject.GObject): img = self.getImg( ) self.set_icon_widget( img ) + self.ACTIVATE_COPY_ID = 0 + self.ACTIVATE_REMOVE_ID = 0 self.setup_rollover_options( recd.title ) - #todo: add copy to clipboard only when available from the mesh def getImg( self ): @@ -82,15 +83,23 @@ class RecdButton(TrayButton, gobject.GObject): palette.menu.append(self.rem_menu_item) self.rem_menu_item.show() + self.addCopyMenuItem() + + + def addCopyMenuItem( self ): + if (self.recd.buddy and not self.recd.downloadedFromBuddy): + return + self.copy_menu_item = gtk.MenuItem( self.ui.ca.istrCopyToClipboard ) self.ACTIVATE_COPY_ID = self.copy_menu_item.connect('activate', self._itemCopyToClipboardCb) - palette.menu.append(self.copy_menu_item) + self.get_palette().menu.append(self.copy_menu_item) self.copy_menu_item.show() def cleanUp( self ): self.rem_menu_item.disconnect( self.ACTIVATE_REMOVE_ID ) - self.copy_menu_item.disconnect( self.ACTIVATE_COPY_ID ) + if (self.ACTIVATE_COPY_ID != 0): + self.copy_menu_item.disconnect( self.ACTIVATE_COPY_ID ) def _itemRemoveCb(self, widget): |