Beispiel #1
0
    def __init__(self, parent, request, isNew=False):
        self.parent = parent
        self.storage = parent.storage
        self.intf = parent.intf
        self.origrequest = request
        self.isNew = isNew

        availraidparts = self.parent.storage.unusedRaidMembers(
            array=self.origrequest)
        if availraidparts < 2:
            self.intf.messageWindow(_("Invalid Raid Members"),
                                    _("At least two unused software RAID "
                                      "partitions are needed to create "
                                      "a RAID device.\n\n"
                                      "First create at least two partitions "
                                      "of type \"software RAID\", and then "
                                      "select the \"RAID\" option again."),
                                    type="error")
            return

        if isNew:
            title = _("Make RAID Device")
        else:
            if request.minor is not None:
                title = _("Edit RAID Device: %s") % request.path
            else:
                title = _("Edit RAID Device")

        self.dialog = Dialog(title, closeButton=False)
        self.dialog.addWidget(RaidWidget(self, request, isNew))
        self.dialog.resize(QSize(450, 200))
Beispiel #2
0
    def __init__(self,
                 parent,
                 origrequest,
                 isNew=False,
                 partedPartition=None,
                 restricts=None):
        self.storage = parent.storage
        self.intf = parent.intf
        self.origrequest = origrequest
        self.isNew = isNew
        self.parent = parent
        self.partedPartition = partedPartition

        if isNew:
            title = _("Create Partition on %(path)s (%(model)s)") % {
                "path": os.path.basename(partedPartition.disk.device.path),
                "model": partedPartition.disk.device.model
            }
        else:
            try:
                title = _("Edit Partition %s") % origrequest.path
            except:
                title = _("Edit Partition")

        self.dialog = Dialog(title, closeButton=False)
        self.dialog.addWidget(
            PartitionWidget(self, origrequest, isNew, restricts))
        self.dialog.resize(QSize(350, 175))
Beispiel #3
0
 def toggleTetris(self):
     self.tetris = Dialog(_("Tetris"), None, True, QKeySequence(Qt.Key_F6))
     _tetris = Tetris(self.tetris)
     self.tetris.addWidget(_tetris)
     self.tetris.resize(240, 500)
     _tetris.start()
     self.tetris.exec_()
Beispiel #4
0
 def __init__(self, parent, storage):
     self.storage = storage
     self.intf = parent.intf
     self.parent = parent
     self.dialog = Dialog(_("Partitions to Shrink"), closeButton=False)
     self.dialog.addWidget(ShrinkWidget(self))
     self.dialog.resize(QSize(0,0))
Beispiel #5
0
 def toggleConsole(self):
     if not self.terminal:
         terminal = QTermWidget()
         terminal.setScrollBarPosition(QTermWidget.ScrollBarRight)
         terminal.setColorScheme(1)
         terminal.sendText("export TERM='xterm'\nclear\n")
         self.terminal = Dialog(_("Terminal"), terminal, True, QKeySequence(Qt.Key_F11))
         self.terminal.resize(700, 500)
     self.terminal.exec_()
Beispiel #6
0
    def __init__(self, parent, request, isNew=False):
        self.parent = parent
        self.storage = parent.storage
        self.origrequest = request
        self.peSize = request.peSize
        self.pvs = request.pvs[:]
        self.isNew = isNew
        self.intf = parent.intf
        self.operations = []
        self.dialog = None
        self.lvs = {}

        for lv in self.origrequest.lvs:
            self.lvs[lv.lvname] = {
                "name": lv.lvname,
                "size": lv.size,
                "format": copy.copy(lv.format),
                "originalFormat": lv.originalFormat,
                "stripes": lv.stripes,
                "logSize": lv.logSize,
                "snapshotSpace": lv.snapshotSpace,
                "exists": lv.exists
            }

        self.availlvmparts = self.storage.unusedPVS(vg=request)
        # if no PV exist, raise an error message and return
        if len(self.availlvmparts) < 1:
            self.intf.messageWindow(
                _("General", "Not enough physical volumes"),
                _(
                    "General", "At least one unused physical "
                    "volume partition is "
                    "needed to\ncreate an LVM Volume Group.\n"
                    "Create a partition or RAID array "
                    "of type \"physical volume\n(LVM)\" and then "
                    "select the \"LVM\" option again."),
                type="warning")
            self.dialog = None
            return

        if isNew:
            title = _("General", "Make LVM Volume Group")
        else:
            try:
                title = _("General",
                          "Edit LVM Volume Group: %s") % (request.name, )
            except AttributeError:
                title = _("General", "Edit LVM Volume Group")

        self.dialog = Dialog(title, closeButton=False)
        self.dialog.addWidget(
            VolumeGroupWidget(self, self.origrequest, isNew=isNew))
        self.dialog.resize(QSize(450, 200))
Beispiel #7
0
    def __init__(self, parent, request, isNew=False):
        self.parent = parent
        self.storage = parent.parent.storage
        self.intf = parent.parent.intf
        self.origrequest = request
        self.isNew = isNew

        if isNew:
            title = _("Make Logical Volume")
        else:
            title = _("Edit Logical Volume: %s") % request.lvname

        self.dialog = Dialog(title, closeButton=False)
        self.dialog.addWidget(LogicalVolumeWidget(self, request, isNew))
        self.dialog.resize(QSize(0, 0))
Beispiel #8
0
 def showReleaseNotes(self):
     # make a release notes dialog
     dialog = Dialog(_('Release Notes'), ReleaseNotes(self), self)
     dialog.resize(500, 400)
     dialog.exec_()
Beispiel #9
0
 def showGPL(self):
     dialog = Dialog("GPL", LicenseBrowser(self), self)
     dialog.resize(500, 400)
     dialog.exec_()