예제 #1
0
    def loadGroups(self):
        """Loads all groups and checks the default or selected ones """
        allGroups = allGroupList()  # Get the group list from OS
        self.ui.groupList.clear()  # Clear group list.
        self.ui.groupList.insertItems(0, allGroups)  # Insert all the groups.
        self.ui.groupList.sortItems()  # Sorts the list in ascending order

        # -------------------------
        # Define which groups to check
        if self.editMode:
            # If a user is specified, check its own groups.
            groupsToCheck = self.user.groups
        else:
            # If no user specified, check the default groups.
            groupsToCheck = kahya().defaultGroups

        # -------------------------
        # Iterate over the list items to check the selected/default ones.
        count = self.ui.groupList.count()
        for i in range(count):
            item = self.ui.groupList.item(i)
            # Set checkable (checkbox appears next)
            item.setFlags(QtCore.Qt.ItemIsUserCheckable
                          | QtCore.Qt.ItemIsEnabled)

            # Now check if needed.
            if str(item.text()) in groupsToCheck:
                item.setCheckState(QtCore.Qt.Checked)
            else:
                item.setCheckState(QtCore.Qt.Unchecked)  # Do not delete this!
예제 #2
0
    def loadGroups(self):  
        """Loads all groups and checks the default or selected ones """        
        allGroups     = allGroupList()                  # Get the group list from OS
        self.ui.groupList.clear()                       # Clear group list.
        self.ui.groupList.insertItems(0, allGroups)     # Insert all the groups.
        self.ui.groupList.sortItems()                   # Sorts the list in ascending order

        # -------------------------
        # Define which groups to check
        if self.editMode:
            # If a user is specified, check its own groups.
            groupsToCheck = self.user.groups
        else:
            # If no user specified, check the default groups.
            groupsToCheck = kahya().defaultGroups
        
        # ------------------------- 
        # Iterate over the list items to check the selected/default ones.
        count = self.ui.groupList.count()
        for i in range(count):
            item = self.ui.groupList.item(i)
            # Set checkable (checkbox appears next)
            item.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)

            # Now check if needed.
            if str(item.text()) in groupsToCheck:
                item.setCheckState(QtCore.Qt.Checked)
            else:
                item.setCheckState(QtCore.Qt.Unchecked) # Do not delete this!
예제 #3
0
    def execute(self):
        if not kahyaExists():
            ctx.debugger.log("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        print "...",ctx.options.kahyaFile

        kahyaOpt = get_kernel_opt(ctx.consts.kahyaParam)

        if kahyaOpt:
            ctx.debugger.log("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.debugger.log("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity()==True:
                ctx.debugger.log("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali4.storage.init_devices():
                    raise GUIException, _("Can't find a storage device!")

                devices = []
                for dev in yali4.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()
                ctx.debugger.log("Given Kahya Values :")

                # single types
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                ctx.installData.autoPartDev = devices[int(correctData.partitioning[0].disk[-1])]
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.debugger.log("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.debugger.log("KEYDATA  : %s " % ctx.installData.keyData.X)

                if ctx.installData.repoAddr:
                    ctx.debugger.log("REPOADDR : %s " % ctx.installData.repoAddr)
                    ctx.debugger.log("REPONAME : %s " % ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali4.users.pending_users.append(user)
                    ctx.debugger.log("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.debugger.log("dryRun activated Yali stopped")
                else:
                    # Bootloader Screen is 9
                    ctx.mainScreen.setCurrent(9)
            else:
                ctx.debugger.log("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.debugger.log("".join(wrongData))

        ctx.mainScreen.disableBack()
        ctx.mainScreen.disableNext()
예제 #4
0
    def execute(self):
        if not kahyaExists():
            ctx.debugger.log("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        ctx.debugger.log("Kahya File : %s " % ctx.options.kahyaFile)

        kahyaOpt = get_kernel_opt(ctx.consts.kahya_param)

        if kahyaOpt:
            ctx.debugger.log("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
            if kahyaFile == "":
                kahyaFile = ctx.consts.default_kahya_file
        elif ctx.options.useKahya:
            kahyaFile = ctx.consts.default_kahya_file
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.debugger.log("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity()==True:
                ctx.debugger.log("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali4.storage.initDevices():
                    raise GUIException, _("Can't find a storage device!")

                devices = []
                for dev in yali4.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()

                # set keymap
                ctx.yali.setKeymap(correctData.keyData)

                # single types
                ctx.installData.isKahyaUsed = True
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                yali4.storage.setOrderedDiskList()
                ctx.installData.autoPartDev = devices[int(correctData.partitioning[0].disk[-1])]
                ctx.installData.autoPartMethod = {"auto":methodEraseAll,"smartAuto":methodUseAvail}[correctData.partitioningType]
                if ctx.installData.autoPartMethod == methodUseAvail:
                    ctx.installData.autoPartPartition = ctx.yali.getResizableFirstPartition()
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot
                ctx.installData.timezone = correctData.timezone

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.debugger.log("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.debugger.log("KEYDATA  : %s " % ctx.installData.keyData["xkblayout"])

                if ctx.installData.repoAddr:
                    ctx.debugger.log("REPOADDR : %s " % ctx.installData.repoAddr)
                    ctx.debugger.log("REPONAME : %s " % ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali4.users.pending_users.append(user)
                    ctx.debugger.log("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.debugger.log("dryRun activated Yali stopped")
                else:
                    # Summary Screen is 10
                    ctx.mainScreen.setCurrent(10)
            else:
                ctx.debugger.log("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.debugger.log("".join(wrongData))
예제 #5
0
    def execute(self):
        if not kahyaExists():
            ctx.debugger.log("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        ctx.debugger.log("Kahya File : %s " % ctx.options.kahyaFile)

        kahyaOpt = get_kernel_opt(ctx.consts.kahya_param)

        if kahyaOpt:
            ctx.debugger.log("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
            if kahyaFile == "":
                kahyaFile = ctx.consts.default_kahya_file
        elif ctx.options.useKahya:
            kahyaFile = ctx.consts.default_kahya_file
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.debugger.log("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity() == True:
                ctx.debugger.log("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali4.storage.initDevices():
                    raise GUIException, _("Can't find a storage device!")

                devices = []
                for dev in yali4.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()

                # set keymap
                ctx.yali.setKeymap(correctData.keyData)

                # single types
                ctx.installData.isKahyaUsed = True
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                yali4.storage.setOrderedDiskList()
                ctx.installData.autoPartDev = devices[int(
                    correctData.partitioning[0].disk[-1])]
                ctx.installData.autoPartMethod = {
                    "auto": methodEraseAll,
                    "smartAuto": methodUseAvail
                }[correctData.partitioningType]
                if ctx.installData.autoPartMethod == methodUseAvail:
                    ctx.installData.autoPartPartition = ctx.yali.getResizableFirstPartition(
                    )
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot
                ctx.installData.timezone = correctData.timezone

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.debugger.log("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.debugger.log("KEYDATA  : %s " %
                                 ctx.installData.keyData["xkblayout"])

                if ctx.installData.repoAddr:
                    ctx.debugger.log("REPOADDR : %s " %
                                     ctx.installData.repoAddr)
                    ctx.debugger.log("REPONAME : %s " %
                                     ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali4.users.pending_users.append(user)
                    ctx.debugger.log("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.debugger.log("dryRun activated Yali stopped")
                else:
                    # Summary Screen is 10
                    ctx.mainScreen.setCurrent(10)
            else:
                ctx.debugger.log("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.debugger.log("".join(wrongData))