def update(self, *args, **kwargs):
        self._clear()
        self.link.set_sensitive(True)
        histories = gpaste_client.list_histories()
        current_name = gpaste_client.get_history_name()

        if len(histories) <= 1:
            self.link.set_sensitive(False)
            return None

        for history_name in histories:
            histories_manager_item = HistoriesManagerItem(history_name)
            histories_manager_item.link.connect(
                'activate-link',
                self._on_histories_manager_item,
                histories_manager_item
            )
            histories_manager_item.connect(
                'action-request',
                self._on_item_action
            )
            self._box.add(histories_manager_item)

            if history_name == current_name:
                self._set_active(history_name)
                histories_manager_item.set_active(True)

        self._box.show_all()
Exemple #2
0
    def _backup_history(self, name):
        histories = gpaste_client.list_histories()

        if name in histories:
            msg = _('Name "%s" already exists.') % name
            self._error_label.set_markup('<span fgcolor="red">%s</span>' % msg)
            self._show_error()
            return False

        gpaste_client.backup_history(self._current_name, name)

        return True
    def _backup_history(self, name):
        histories = gpaste_client.list_histories()

        if name in histories:
            msg = _('Name "%s" already exists.') % name
            self._error_label.set_markup('<span fgcolor="red">%s</span>' % msg)
            self._show_error()
            return False

        gpaste_client.backup_history(self._current_name, name)

        return True
    def update(self, *args, **kwargs):
        self._clear()
        self.link.set_sensitive(True)
        histories = gpaste_client.list_histories()
        current_name = gpaste_client.get_history_name()

        for history_name in histories:
            histories_manager_item = HistoriesManagerItem(history_name)
            histories_manager_item.link.connect(
                'activate-link', self._on_histories_manager_item,
                histories_manager_item)
            histories_manager_item.connect('action-request',
                                           self._on_item_action)
            self._box.add(histories_manager_item)

            if history_name == current_name:
                self._set_active(history_name)
                histories_manager_item.set_active(True)

        self._box.show_all()