Beispiel #1
0
 def no_device_notification(self):
     if self.first_run:
         msgBox = QtGui.QMessageBox(1, i18n("Quick Format"), i18n("There aren't any removable devices."))
         msgBox.exec_()
         sys.exit()
     else:
         self.notifier.notify(NO_DEVICE)
         self.ui.volumeLabel.setText("")
Beispiel #2
0
 def no_device_notification(self):
     if self.first_run:
         msgBox = QtGui.QMessageBox(
             1, i18n("Quick Format"),
             i18n("There aren't any removable devices."))
         msgBox.exec_()
         sys.exit()
     else:
         self.notifier.notify(NO_DEVICE)
         self.ui.volumeLabel.setText("")
Beispiel #3
0
    def format_confirm_message(self):
        """'Are you sure?' message for format operation"""

        format_message = QtGui.QMessageBox()
        format_message.setText(i18n("This operation will delete your all data. Are you sure to continue?"))
        format_message.setIcon(QtGui.QMessageBox.Question)
        format_message.addButton(ACCEPT, QtGui.QMessageBox.AcceptRole)
        format_message.addButton(REJECT, QtGui.QMessageBox.RejectRole)
        format_message.exec_()
        return format_message.clickedButton().text()
Beispiel #4
0
    def format_confirm_message(self):
        """'Are you sure?' message for format operation"""

        format_message = QtGui.QMessageBox()
        format_message.setText(
            i18n(
                "This operation will delete your all data. Are you sure to continue?"
            ))
        format_message.setIcon(QtGui.QMessageBox.Question)
        format_message.addButton(ACCEPT, QtGui.QMessageBox.AcceptRole)
        format_message.addButton(REJECT, QtGui.QMessageBox.RejectRole)
        format_message.exec_()
        return format_message.clickedButton().text()
Beispiel #5
0
 def root_user_notification(self):
     root_msgBox = QtGui.QMessageBox(1, i18n("Quick Format"), i18n("You must be root user to use this application."))
     root_msgBox.exec_()
     sys.exit()
Beispiel #6
0
from quickformat.volume import Volume

from quickformat.notifier_backend import OUT, TOPCENTER, MIDCENTER, CURRENT, OUT

import sys, os

import dbus

FILE_SYSTEMS = {"Ext4":"ext4",
                "Ext3":"ext3",
                "Ext2":"ext2",
                "FAT32":"vfat",
                "NTFS":"ntfs-3g",
                }

ACCEPT = i18n("Yes")
REJECT = i18n("No")

class QuickFormat(QtGui.QWidget):

    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()
Beispiel #7
0
 def root_user_notification(self):
     root_msgBox = QtGui.QMessageBox(
         1, i18n("Quick Format"),
         i18n("You must be root user to use this application."))
     root_msgBox.exec_()
     sys.exit()
Beispiel #8
0
from quickformat.notifier_backend import OUT, TOPCENTER, MIDCENTER, CURRENT, OUT

import sys, os

import dbus

FILE_SYSTEMS = {
    "Ext4": "ext4",
    "Ext3": "ext3",
    "Ext2": "ext2",
    "FAT32": "vfat",
    "NTFS": "ntfs-3g",
}

ACCEPT = i18n("Yes")
REJECT = i18n("No")


class QuickFormat(QtGui.QWidget):
    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()