コード例 #1
0
ファイル: GUI.py プロジェクト: schlangens/bleachbit
    def shred_paths(self, paths, shred_settings=False, quit_when_done=False):
        """Shred file or folders

        When shredding_settings=True:
        If user confirms to delete, then returns True.  If user aborts, returns
        False.

        When quit_when_done=True:
        Always returns False to remove function from the idle queue.
        """
        # create a temporary cleaner object
        backends['_gui'] = Cleaner.create_simple_cleaner(paths)

        # preview and confirm
        operations = {'_gui': ['files']}
        self.preview_or_run_operations(False, operations)

        if GuiBasic.delete_confirmation_dialog(self,
                                               mention_preview=False,
                                               shred_settings=shred_settings):
            # delete
            self.preview_or_run_operations(True, operations)
            if shred_settings:
                return True

        if quit_when_done:
            GLib.idle_add(self.close, priority=GObject.PRIORITY_LOW)

        # user aborted
        return False
コード例 #2
0
    def run_operations(self, __widget):
        """Event when the 'delete' toolbar button is clicked."""
        # fixme: should present this dialog after finding operations

        # Disable delete confirmation message.
        # if the option is selected under preference.

        if options.get("delete_confirmation"):
            if not GuiBasic.delete_confirmation_dialog(self, True):
                return
        self.preview_or_run_operations(True)
コード例 #3
0
ファイル: GUI.py プロジェクト: tstenner/bleachbit
    def run_operations(self, __widget):
        """Event when the 'delete' toolbar button is clicked."""
        # fixme: should present this dialog after finding operations

        # Disable delete confirmation message.
        # if the option is selected under preference.

        if options.get("delete_confirmation"):
            if not GuiBasic.delete_confirmation_dialog(self.window, True):
                return
        self.preview_or_run_operations(True)
コード例 #4
0
    def cb_run_option(self, widget, really_delete, cleaner_id, option_id):
        """Callback from context menu to delete/preview a single option"""
        operations = {cleaner_id: [option_id]}

        # preview
        if not really_delete:
            self.preview_or_run_operations(False, operations)
            return

        # delete
        if GuiBasic.delete_confirmation_dialog(self, mention_preview=False):
            self.preview_or_run_operations(True, operations)
            return
コード例 #5
0
ファイル: GUI.py プロジェクト: tstenner/bleachbit
    def cb_run_option(self, widget, really_delete, cleaner_id, option_id):
        """Callback from context menu to delete/preview a single option"""
        operations = {cleaner_id: [option_id]}

        # preview
        if not really_delete:
            self.preview_or_run_operations(False, operations)
            return

        # delete
        if GuiBasic.delete_confirmation_dialog(self.window, mention_preview=False):
            self.preview_or_run_operations(True, operations)
            return
コード例 #6
0
ファイル: GUI.py プロジェクト: tstenner/bleachbit
    def shred_paths(self, paths):
        """Shred file or folders

        If user confirms and files are deleted, returns True.  If
        user aborts, returns False.
        """
        # create a temporary cleaner object
        backends['_gui'] = Cleaner.create_simple_cleaner(paths)

        # preview and confirm
        operations = {'_gui': ['files']}
        self.preview_or_run_operations(False, operations)

        if GuiBasic.delete_confirmation_dialog(self.window, mention_preview=False):
            # delete
            self.preview_or_run_operations(True, operations)
            return True

        # user aborted
        return False
コード例 #7
0
ファイル: GUI.py プロジェクト: reef-technologies/bleachbit
    def shred_paths(self, paths):
        """Shred file or folders

        If user confirms and files are deleted, returns True.  If
        user aborts, returns False.
        """
        # create a temporary cleaner object
        backends['_gui'] = Cleaner.create_simple_cleaner(paths)

        # preview and confirm
        operations = {'_gui': ['files']}
        self.preview_or_run_operations(False, operations)

        if GuiBasic.delete_confirmation_dialog(self, mention_preview=False):
            # delete
            self.preview_or_run_operations(True, operations)
            return True

        # user aborted
        return False
コード例 #8
0
ファイル: GUI.py プロジェクト: Grukz/bleachbit
 def _confirm_delete(self, mention_preview, shred_settings=False):
     if options.get("delete_confirmation"):
         return GuiBasic.delete_confirmation_dialog(self, mention_preview, shred_settings=shred_settings)
     return True