예제 #1
0
    def on_save_button_clicked(self, widget):
        text = self.textview.get_text().strip()

        if self.auto_backup_setting.get_value():
            proxy.backup_source(self.textview.get_path(), self.get_time_stamp())
            self.update_backup_model()

        if proxy.edit_source(self.textview.get_path(), text) == 'error':
            ErrorDialog(message=_('Please check the permission of the '
                                  'sources.list file'),
                        title=_('Save failed!')).launch()
        else:
            self.save_button.set_sensitive(False)
            self.redo_button.set_sensitive(False)
예제 #2
0
    def on_save_button_clicked(self, widget):
        text = self.textview.get_text().strip()

        if self.auto_backup_setting.get_value():
            proxy.backup_source(self.textview.get_path(),
                                self.get_time_stamp())
            self.update_backup_model()

        if proxy.edit_source(self.textview.get_path(), text) == 'error':
            ErrorDialog(message=_('Please check the permission of the '
                                  'sources.list file'),
                        title=_('Save failed!')).launch()
        else:
            self.save_button.set_sensitive(False)
            self.redo_button.set_sensitive(False)
예제 #3
0
    def on_backup_button_clicked(self, widget):
        model, iter = self.list_selection.get_selected()

        if iter:
            path = model[iter][0]

            dialog = GetTextDialog(message=_('Please enter the name for your backup:'),
                                   text=self.get_time_stamp())
            response = dialog.run()
            dialog.destroy()
            backup_name = dialog.get_text()

            if response == Gtk.ResponseType.YES and backup_name:
                if self.is_valid_backup_name(backup_name):
                    if proxy.backup_source(path, backup_name):
                        self.update_backup_model()
                    else:
                        ErrorDialog(message=_('Backup Failed!')).launch()
                else:
                    ErrorDialog(message=_('Please only use alphanumeric characters'
                                        ' and "_" and "-".'),
                                title=_('Backup name is invalid')).launch()
예제 #4
0
    def on_backup_button_clicked(self, widget):
        model, iter = self.list_selection.get_selected()

        if iter:
            path = model[iter][0]

            dialog = GetTextDialog(
                message=_('Please enter the name for your backup:'),
                text=self.get_time_stamp())
            response = dialog.run()
            dialog.destroy()
            backup_name = dialog.get_text()

            if response == Gtk.ResponseType.YES and backup_name:
                if self.is_valid_backup_name(backup_name):
                    if proxy.backup_source(path, backup_name):
                        self.update_backup_model()
                    else:
                        ErrorDialog(message=_('Backup Failed!')).launch()
                else:
                    ErrorDialog(message=_(
                        'Please only use alphanumeric characters'
                        ' and "_" and "-".'),
                                title=_('Backup name is invalid')).launch()