class BatchCopyButton(ToolButton): def __init__(self, journalactivity): self._journalactivity = journalactivity ToolButton.__init__(self, 'edit-copy') self.props.tooltip = _('Copy') self.connect('clicked', self.__clicked_cb) self._menu_builder = None def _refresh_menu_options(self): if self._menu_builder is not None: return self._menu_builder = CopyMenuBuilder( self._journalactivity, self.__get_uid_list_cb, self._journalactivity.volume_error_cb, self.get_palette().menu, add_clipboard_menu=False, add_webservices_menu=False) def update_mount_point(self): if self._menu_builder is not None: self._menu_builder.update_mount_point() def __clicked_cb(self, button): self._refresh_menu_options() button.palette.popup(immediate=True) def __get_uid_list_cb(self): model = self._journalactivity.get_list_view().get_model() return model.get_selected_items()
def _refresh_menu_options(self): if self._menu_builder is not None: return self._menu_builder = CopyMenuBuilder( self._journalactivity, self.__get_uid_list_cb, self._journalactivity.volume_error_cb, self.get_palette().menu, add_clipboard_menu=False, add_webservices_menu=False)
def __init__(self, journalactivity): self._journalactivity = journalactivity ToolButton.__init__(self, 'edit-copy') self.props.tooltip = _('Copy') self.connect('clicked', self.__clicked_cb) self.menu_builder = CopyMenuBuilder( self._journalactivity, self.__get_uid_list_cb, self._journalactivity.volume_error_cb, self.get_palette().menu, add_clipboard_menu=False, add_webservices_menu=False)
def _refresh_copy_palette(self): palette = self._copy.get_palette() # Use the menu defined in CopyMenu for menu_item in palette.menu.get_children(): palette.menu.remove(menu_item) menu_item.destroy() CopyMenuBuilder(self._journalactivity, self.__get_uid_list_cb, self.__volume_error_cb, palette.menu)