示例#1
0
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()
示例#2
0
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()
示例#3
0
 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)
示例#4
0
    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)
示例#5
0
 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)
示例#6
0
    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)
示例#7
0
    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)