Beispiel #1
0
    def repopulate_storage(self):
        """Repopulate the storage."""
        # Update the widgets.
        self._conditionNotebook.set_current_page(PAGE_RESULT_SUCCESS)

        # Update the namespaces info.
        nvdimm.update_namespaces_info()

        # Get the task.
        task = ScanDevicesTask(self._storage)
        task.stopped_signal.connect(lambda: self.repopulate_finished(task))

        # Start the task.
        task.start()

        self._repopulateSpinner.start()
Beispiel #2
0
    def scan_devices_with_task(self):
        """Scan all devices with a task.

        We will reset a copy of the current storage model
        and switch the models if the reset is successful.

        :return: a task
        """
        # Copy the storage.
        storage = self.storage.copy()

        # Set up the storage.
        storage.ignored_disks = self._disk_selection_module.ignored_disks
        storage.exclusive_disks = self._disk_selection_module.exclusive_disks
        storage.protected_devices = self._disk_selection_module.protected_devices
        storage.disk_images = self._disk_selection_module.disk_images

        # Create the task.
        task = ScanDevicesTask(storage)
        task.succeeded_signal.connect(lambda: self._set_storage(storage))
        return task