Beispiel #1
0
    def __init__(self, parent=None, args=None):
        QtGui.QWidget.__init__(self, parent)
        self.__sysargs = args

        if os.getuid() != 0:
            self.root_user_notification()

        self.ui = Ui_QuickFormat()
        self.ui.setupUi(self)

        self.formatter = Formatter()
        self.device_notifier = StorageNotifier()

        self.first_run = True

        # Initial selection is the first partition found (see next comment)
        self.initial_selection = 0

        # Connect Qt Signals
        self.__init_signals__()

        # Initialize custom widgets such as the new combobox
        self.__set_custom_widgets__()

        # Initialize the fancy notification widget (Derrived from PDS by Gokmen Goksel)
        self.__init_notifier__()

        # Uses DeviceDetector class for getting device list
        self.show_volume_list()

        self.generate_file_system_list()

        self.volume_to_format = ""

        self.__make_initial_selection__(self.initial_selection)

        self.refreshing_devices = False

        # Monitor USB ports for any new devices
        self.device_notifier.iface_notifier.connect_to_signal(
            'DeviceAdded', self.slot_refresh_volume_list)
        self.device_notifier.iface_notifier.connect_to_signal(
            'DeviceRemoved', self.slot_refresh_volume_list)
Beispiel #2
0
    def __init__(self, parent=None, args=None):
        QtGui.QWidget.__init__(self, parent)
        self.__sysargs = args

        self.ui = Ui_QuickFormat()
        self.ui.setupUi(self)

        self.formatter = Formatter()

        self.first_run = True

        # Initial selection is the first partition found (see next comment)
        self.initial_selection = 0

        # If a partition path is given as argument, intial selection becomes the parition given
        self.__process_args__()

        # Connect Qt Signals
        self.__init_signals__()

        # Initialize custom widgets such as the new combobox
        self.__set_custom_widgets__()

        # Initialize the fancy notification widget (Derrived from PDS by Gokmen Goksel)
        self.__init_notifier__()

        self.show_volume_list()
        self.generate_file_system_list()

        self.volume_to_format = ""

        self.__make_initial_selection__(self.initial_selection)

        self.refreshing_devices = False

        # Monitor USB ports for any new devices
        notifier = Solid.DeviceNotifier().instance()
        self.connect(notifier, SIGNAL("deviceAdded(const QString&)"),
                     self.slot_refresh_volume_list)
        self.connect(notifier, SIGNAL("deviceRemoved(const QString&)"),
                     self.slot_refresh_volume_list)