コード例 #1
0
 def add_drive_cb(button):
     """Callback for adding a drive"""
     title = _("Choose a folder")
     pathname = GuiBasic.browse_folder(self.parent, title,
                                       multiple=False, stock_button=gtk.STOCK_ADD)
     if pathname:
         liststore.append([pathname])
         pathnames.append(pathname)
         options.set_list('shred_drives', pathnames)
コード例 #2
0
 def add_drive_cb(button):
     """Callback for adding a drive"""
     title = _("Choose a folder")
     pathname = GuiBasic.browse_folder(self.parent, title,
                                       multiple=False, stock_button=gtk.STOCK_ADD)
     if pathname:
         liststore.append([pathname])
         pathnames.append(pathname)
         options.set_list('shred_drives', pathnames)
コード例 #3
0
ファイル: GUI.py プロジェクト: jun-zhang/bleachbit
    def cb_wipe_free_space(self, action):
        """callback to wipe free space in arbitrary folder"""
        path = GuiBasic.browse_folder(self.window, _("Choose a folder"), multiple=False, stock_button=gtk.STOCK_OK)
        if not path:
            # user cancelled
            return

        backends["_gui"] = Cleaner.create_wipe_cleaner(path)

        # execute
        operations = {"_gui": ["free_disk_space"]}
        self.preview_or_run_operations(True, operations)
コード例 #4
0
 def add_custom_folder_cb(button):
     """Callback for adding a folder"""
     title = _("Choose a folder")
     pathname = GuiBasic.browse_folder(self.parent, title,
                                       multiple=False, stock_button=gtk.STOCK_ADD)
     if pathname:
         for this_pathname in pathnames:
             if pathname == this_pathname[1]:
                 print "warning: '%s' already exists in whitelist" % pathname
                 return
         liststore.append([_('Folder'), pathname])
         pathnames.append(['folder', pathname])
         options.set_custom_paths(pathnames)
コード例 #5
0
 def add_custom_folder_cb(button):
     """Callback for adding a folder"""
     title = _("Choose a folder")
     pathname = GuiBasic.browse_folder(self.parent, title,
                                       multiple=False, stock_button=gtk.STOCK_ADD)
     if pathname:
         for this_pathname in pathnames:
             if pathname == this_pathname[1]:
                 print "warning: '%s' already exists in whitelist" % pathname
                 return
         liststore.append([_('Folder'), pathname])
         pathnames.append(['folder', pathname])
         options.set_custom_paths(pathnames)
コード例 #6
0
    def cb_wipe_free_space(self, action):
        """callback to wipe free space in arbitrary folder"""
        path = GuiBasic.browse_folder(self.window,
                                      _("Choose a folder"),
                                      multiple=False, stock_button=gtk.STOCK_OK)
        if not path:
            # user cancelled
            return

        backends['_gui'] = Cleaner.create_wipe_cleaner(path)

        # execute
        operations = {'_gui': ['free_disk_space']}
        self.preview_or_run_operations(True, operations)
コード例 #7
0
ファイル: GUI.py プロジェクト: jun-zhang/bleachbit
    def cb_shred_file(self, action):
        """Callback for shredding a file or folder"""

        # get list of files
        if "ShredFiles" == action.get_name():
            paths = GuiBasic.browse_files(self.window, _("Choose files to shred"))
        elif "ShredFolders" == action.get_name():
            paths = GuiBasic.browse_folder(
                self.window, _("Choose folder to shred"), multiple=True, stock_button=gtk.STOCK_DELETE
            )
        else:
            raise RuntimeError("Unexpected kind in cb_shred_file")

        if not paths:
            return

        self.shred_paths(paths)
コード例 #8
0
    def cb_shred_file(self, action):
        """Callback for shredding a file or folder"""

        # get list of files
        if 'ShredFiles' == action.get_name():
            paths = GuiBasic.browse_files(self.window,
                                          _("Choose files to shred"))
        elif 'ShredFolders' == action.get_name():
            paths = GuiBasic.browse_folder(self.window,
                                           _("Choose folder to shred"),
                                           multiple=True,
                                           stock_button=gtk.STOCK_DELETE)
        else:
            raise RuntimeError("Unexpected kind in cb_shred_file")

        if not paths:
            return

        self.shred_paths(paths)