• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python YaliDialog.WarningDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中yali.gui.YaliDialog.WarningDialog的典型用法代码示例。如果您正苦于以下问题:Python WarningDialog类的具体用法?Python WarningDialog怎么用?Python WarningDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WarningDialog类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: execute

    def execute(self):
        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        try:
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home"))
            yali.sysutils.umount(ctx.consts.target_dir + "/home")
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir))
            yali.sysutils.umount(ctx.consts.target_dir)
        except:
            ctx.debugger.log("Umount Failed.")
            pass

        w = RebootWidget(self)

        ctx.debugger.log("Show reboot dialog.")
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()

        ctx.debugger.log("Trying to eject the CD.")
        # remove cd...
        yali.sysutils.eject_cdrom()

        ctx.debugger.log("Yali, fastreboot calling..")

        # store log content
        if ctx.debugEnabled:
            open(ctx.consts.log_file,"w").write(str(ctx.debugger.traceback.plainLogs))

        time.sleep(4)
        yali.sysutils.fastreboot()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:33,代码来源:ScrGoodbye.py


示例2: execute

    def execute(self):

        def autopartDevice():
            dev = self.device

            # fist delete partitions on device
            dev.deleteAllPartitions()
            dev.commit()

            p = dev.addPartition(parttype.root.parted_type,
                                 parttype.root.filesystem,
                                 dev.getFreeMB(),
                                 parttype.root.parted_flags)
            p = dev.getPartition(p.num) # get partition.Partition
            dev.commit()

            ctx.partrequests.append(
                request.MountRequest(p, parttype.root))
            ctx.partrequests.append(
                request.FormatRequest(p, parttype.root))
            ctx.partrequests.append(
                request.SwapFileRequest(p, parttype.root))


        if self.accept_auto.isChecked():

            # show confirmation dialog
            w = WarningWidget(self)
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                # disabled by weaver
                ctx.screens.enablePrev()
                self.updateUI()
                return False

            # show information window...
            info_window = InformationWindow(self, _("Please wait while formatting!"))

            # inform user
            self.info.setText(_('<font color="#FF6D19">Preparing your disk for installation!</font>'))
            ctx.screens.processEvents()

            # remove all other requests (if there are any).
            ctx.partrequests.remove_all()

            ctx.use_autopart = True
            autopartDevice()
            # need to wait for devices to be created
            time.sleep(1)
            ctx.partrequests.applyAll()

            # skip next screen()
            num = ctx.screens.getCurrentIndex() + 1
            ctx.screens.goToScreen(num)

            # close window
            info_window.close(True)

        return True
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:59,代码来源:ScrPartitionAuto.py


示例3: execute

    def execute(self):

        def autopartDevice():
            dev = self.device

            # fist delete partitions on device
            dev.deleteAllPartitions()
            dev.commit()

            p = dev.addPartition(parttype.root.parted_type,
                                 parttype.root.filesystem,
                                 dev.getFreeMB(),
                                 parttype.root.parted_flags)
            p = dev.getPartition(p.num) # get partition.Partition
            dev.commit()

            ctx.partrequests.append(
                request.MountRequest(p, parttype.root))
            ctx.partrequests.append(
                request.FormatRequest(p, parttype.root))
            ctx.partrequests.append(
                request.SwapFileRequest(p, parttype.root))


        if self.accept_auto.isChecked():

            # show confirmation dialog
            w = WarningWidget(self)
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                return False


            # inform user
            self.info.setText(_('<font color="#FF6D19">Preparing your disk for installation!</font>'))
            ctx.screens.processEvents()

            
            ctx.use_autopart = True
            autopartDevice()
            # need to wait for devices to be created
            time.sleep(1)
            ctx.partrequests.applyAll()

            # skip next screen()
            num = ctx.screens.getCurrentIndex() + 1
            ctx.screens.goToScreen(num)


        return True
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:50,代码来源:AutoPartitioning.py


示例4: execute

    def execute(self):
        isAdminSet = False
        for i in range(self.userList.count()):
            u = self.userList.item(i).getUser()
            if "wheel" in u.groups:
                isAdminSet = True

        if not isAdminSet:
            # show confirmation dialog
            w = WarningWidget(self)
            w.warning.setText(_('''<b>
<p>You have not defined an administrator!</p>

<p>A user without administrative rights cannot complete system maintenance 
tasks. You are strongly encouraged to define an administrator user.</p>

<p>Click "Cancel" to define an administrator user (recommended) or "OK" to 
go to next screen.</p>
</b>
'''))
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                ctx.screens.enablePrev()
                ctx.screens.enableNext()
                return False

        # reset and fill pending_users
        yali.users.reset_pending_users()

        ctx.installData.autoLoginUser = str(self.autoLogin.currentText())

        for i in range(self.userList.count()):
            u = self.userList.item(i).getUser()
            ctx.installData.users.append(u)

            yali.users.pending_users.append(u)
            ctx.debugger.log("USER::%s"%u.username)

        return True
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:39,代码来源:ScrUsers.py


示例5: execute

    def execute(self):

        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        if yali.sysutils.checkYaliDebug():
            open(ctx.consts.log_file,"w").write(ctx.debugger.traceback.plainLogs)

        # remove cd...
        w = RebootWidget(self)
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()

        try:
            yali.sysutils.umount(ctx.consts.target_dir + "/home")
        except:
            pass

        yali.sysutils.umount(ctx.consts.target_dir)
        yali.sysutils.fastreboot()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:22,代码来源:ScrGoodbye.py


示例6: Widget

class Widget(SetupUsersWidget, ScreenWidget):

    help = _('''
<font size="+2">User setup</font>

<font size="+1">
<p>
Other than the system administrator user,
you can create a user account for your 
daily needs, i.e reading your e-mail, surfing
on the web and searching for daily recipe
offerings. Usual password assignment
rules also apply here: This password should 
be unique and private. Choose a password 
difficult to guess, but easy to remember. 
</p>
<p>
Click Next button to proceed.
</p>
</font>
''')

    def __init__(self, *args):
        apply(SetupUsersWidget.__init__, (self,) + args)

        self.pix.setPixmap(ctx.iconfactory.newPixmap("users"))
        self.pass_error.setText("")
        self.edititemindex = None

        # User Icons
        self.normalUserIcon = ctx.iconfactory.newPixmap("user_normal")
        self.superUserIcon = ctx.iconfactory.newPixmap("user_root")

        # KDE AutoLogin
        self.autoLoginUser = ""

        # Give Admin Privileges default
        self.admin.setChecked(True)

        self.createButton.setEnabled(False)

        self.connect(self.pass1, SIGNAL("textChanged(const QString &)"),
                     self.slotTextChanged)
        self.connect(self.pass2, SIGNAL("textChanged(const QString &)"),
                     self.slotTextChanged)
        self.connect(self.username, SIGNAL("textChanged(const QString &)"),
                     self.slotTextChanged)
        self.connect(self.createButton, SIGNAL("clicked()"),
                     self.slotCreateUser)
        self.connect(self.deleteButton, SIGNAL("clicked()"),
                     self.slotDeleteUser)
        self.connect(self.userList, SIGNAL("doubleClicked(QListBoxItem*)"),
                     self.slotEditUser)
        self.connect(self.pass2, SIGNAL("returnPressed()"),
                     self.slotReturnPressed)
        self.checkUsers()

    def shown(self):
        from os.path import basename
        ctx.debugger.log("%s loaded" % basename(__file__))

        ctx.installData.users = []
        ctx.installData.autoLoginUser = None

        self.checkUsers()
        self.checkCapsLock()
        self.username.setFocus()

    def execute(self):
        isAdminSet = False
        for i in range(self.userList.count()):
            u = self.userList.item(i).getUser()
            if "wheel" in u.groups:
                isAdminSet = True

        if not isAdminSet:
            # show confirmation dialog
            w = WarningWidget(self)
            w.warning.setText(_('''<b>
<p>You have not defined an administrator!</p>

<p>A user without administrative rights cannot complete system maintenance 
tasks. You are strongly encouraged to define an administrator user.</p>

<p>Click "Cancel" to define an administrator user (recommended) or "OK" to 
go to next screen.</p>
</b>
'''))
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                ctx.screens.enablePrev()
                ctx.screens.enableNext()
                return False

        # reset and fill pending_users
        yali.users.reset_pending_users()

        ctx.installData.autoLoginUser = str(self.autoLogin.currentText())

        for i in range(self.userList.count()):
#.........这里部分代码省略.........
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:101,代码来源:ScrUsers.py


示例7: Widget

class Widget(QWidget, ScreenWidget):

    help = _('''
<font size="+2">Congratulations</font>


<font size="+1">
<p>
You have successfully installed Pardus, a very easy to use desktop system on
your machine. Now you can start playing with your system and stay productive
all the time.
</p>
<P>
Click on the Next button to proceed. One note: You remember your password,
don't you?
</p>
</font>
''')

    def __init__(self, *args):
        apply(QWidget.__init__, (self,) + args)

        img = QLabel(self)
        img.setPixmap(ctx.iconfactory.newPixmap("goodbye"))

        self.steps = YaliSteps(self)

        self.info = QLabel(self)
        self.info.setText(
            _('<b><font size="+2" color="#FF6D19">Rebooting system. Please wait!</font></b>'))
        self.info.hide()
        self.info.setAlignment(QLabel.AlignCenter|QLabel.AlignTop)
        self.info.setMinimumSize(QSize(0,50))

        vbox = QVBoxLayout(self)
        vbox.addStretch(1)

        hbox = QHBoxLayout(vbox)
        hbox.addStretch(1)
        #FIXME Where is the steps layout ??
        hbox.addWidget(img)
        hbox.addStretch(1)

        vbox.addStretch(1)
        vbox.addWidget(self.info)

    def shown(self):
        from os.path import basename
        ctx.debugger.log("%s loaded" % basename(__file__))
        ctx.screens.disablePrev()
        self.processPendingActions()
        self.steps.slotRunOperations()

    def execute(self):
        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        try:
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home"))
            yali.sysutils.umount(ctx.consts.target_dir + "/home")
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir))
            yali.sysutils.umount(ctx.consts.target_dir)
        except:
            ctx.debugger.log("Umount Failed.")
            pass

        w = RebootWidget(self)

        ctx.debugger.log("Show reboot dialog.")
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()

        ctx.debugger.log("Trying to eject the CD.")
        # remove cd...
        yali.sysutils.eject_cdrom()

        ctx.debugger.log("Yali, fastreboot calling..")

        # store log content
        if ctx.debugEnabled:
            open(ctx.consts.log_file,"w").write(str(ctx.debugger.traceback.plainLogs))

        time.sleep(4)
        yali.sysutils.fastreboot()

    # process pending actions defined in other screens.
    def processPendingActions(self):
        comarLink = None

        def connectToComar():
            global comarLink
            for i in range(20):
                try:
                    ctx.debugger.log("trying to start comar..")
                    comarLink = comar.Link(sockname=consts.comar_socket_file)
                    break
                except comar.CannotConnect:
                    time.sleep(1)
#.........这里部分代码省略.........
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:101,代码来源:ScrGoodbye.py


示例8: Widget

class Widget(AutoPartWidget, ScreenWidget):

    help = _('''
<font size="+2">Automatic Partitioning</font>

<font size="+1">
<p>
Pardus can be installed on a variety of hardware. You can install Pardus
on an empty disk or hard disk partition. <b>An installation will automatically
destroy the previously saved information on selected partitions. </b>
</p>
<p>
Automatic partitioning use your entire disk for Pardus installation. From 
this screen you can select to automatically partition one of you disks, or
you can skip this screen and try manual partitioning.
</p>
<p>
Please refer to Pardus Installing and Using Guide for more information
about disk partitioning.
</p>
</font>
''')

    def __init__(self, *args):
        apply(AutoPartWidget.__init__, (self,) + args)
        
        self.device = None
        self.enable_next = False
        
        self.device_list.setPaletteBackgroundColor(ctx.consts.bg_color)
        self.device_list.setPaletteForegroundColor(ctx.consts.fg_color)

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

        # fill device list
        for dev in yali.storage.devices:
            if dev.getTotalMB() >= ctx.consts.min_root_size:
                DeviceItem(self.device_list, dev)
        # select the first disk by default
        self.device_list.setSelected(0, True)


        self.connect(self.accept_auto, SIGNAL("clicked()"),
                     self.slotSelectAuto)
        self.connect(self.manual, SIGNAL("clicked()"),
                     self.slotSelectManual)

        self.connect(self.device_list, SIGNAL("selectionChanged(QListBoxItem*)"),
                     self.slotDeviceChanged)
        

    def shown(self):
        ctx.screens.enablePrev()

        self.updateUI()

    def execute(self):

        def autopartDevice():
            dev = self.device

            # fist delete partitions on device
            dev.deleteAllPartitions()
            dev.commit()

            p = dev.addPartition(parttype.root.parted_type,
                                 parttype.root.filesystem,
                                 dev.getFreeMB(),
                                 parttype.root.parted_flags)
            p = dev.getPartition(p.num) # get partition.Partition
            dev.commit()

            ctx.partrequests.append(
                request.MountRequest(p, parttype.root))
            ctx.partrequests.append(
                request.FormatRequest(p, parttype.root))
            ctx.partrequests.append(
                request.SwapFileRequest(p, parttype.root))


        if self.accept_auto.isChecked():

            # show confirmation dialog
            w = WarningWidget(self)
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                return False


            # inform user
            self.info.setText(_('<font color="#FF6D19">Preparing your disk for installation!</font>'))
            ctx.screens.processEvents()

            
            ctx.use_autopart = True
            autopartDevice()
            # need to wait for devices to be created
            time.sleep(1)
#.........这里部分代码省略.........
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:101,代码来源:AutoPartitioning.py


示例9: Widget

class Widget(QWidget, ScreenWidget):

    help = _('''
<font size="+2">Congratulations</font>


<font size="+1">
<p><b>Voila! You made it!</b></p>
<p>
You have successfully installed Pardus, a very easy to use desktop system on
your machine. Now you can start playing with your system and stay productive
all the time.
</p>
<P>
Click on the Next button to proceed. One note: You remember your password,
don't you?
</p>
</font>
''')

    def __init__(self, *args):
        apply(QWidget.__init__, (self,) + args)
        
        img = QLabel(self)
        img.setPixmap(ctx.iconfactory.newPixmap("goodbye"))

        self.info = QLabel(self)
        self.info.setText(
            _('<b><font size="+2" color="#FF6D19">Rebooting system. Please wait!</font></b>'))
        self.info.hide()
        self.info.setAlignment(QLabel.AlignCenter|QLabel.AlignTop)
        self.info.setMinimumSize(QSize(0,50))

        vbox = QVBoxLayout(self)
        vbox.addStretch(1)

        hbox = QHBoxLayout(vbox)
        hbox.addStretch(1)
        hbox.addWidget(img)
        hbox.addStretch(1)

        vbox.addStretch(1)
        vbox.addWidget(self.info)


    def shown(self):
        ctx.screens.disablePrev()
#        print yali.users.pending_users
#        for i in yali.users.pending_users:
#            print i
        self.processPendingActions()


    def execute(self):

        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        #FIXME: this is a dirty and temporary workaround.. will be removed.
#        os.chmod(ctx.consts.target_dir + "/var/tmp", 01777)

        # remove cd...
        w = RebootWidget(self)
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()


        try:
            mount.umount(ctx.consts.target_dir + "/home")
        except:
            pass

        mount.umount(ctx.consts.target_dir)
        reboot.fastreboot()


    # process pending actions defined in other screens.
    def processPendingActions(self):
        for u in yali.users.pending_users:
            u.addUser()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:82,代码来源:Goodbye.py


示例10: Widget


#.........这里部分代码省略.........
        p = dev.addPartition(parttype.root.parted_type,
                             parttype.root.filesystem,
                             dev.getFreeMB(),
                             parttype.root.parted_flags)
        p = dev.getPartition(p.num) # get partition.Partition

        # create the partition
        dev.commit()

        # make partition requests
        ctx.partrequests.append(request.MountRequest(p, parttype.root))
        ctx.partrequests.append(request.FormatRequest(p, parttype.root))
        ctx.partrequests.append(request.LabelRequest(p, parttype.root))
        ctx.partrequests.append(request.SwapFileRequest(p, parttype.root))

    def checkSwap(self):
        # check swap partition, if not present use swap file
        rt = request.mountRequestType
        pt = parttype.swap
        swap_part_req = ctx.partrequests.searchPartTypeAndReqType(pt, rt)

        if not swap_part_req:
            # No swap partition defined using swap as file in root
            # partition
            rt = request.mountRequestType
            pt = parttype.root
            root_part_req = ctx.partrequests.searchPartTypeAndReqType(pt, rt)
            ctx.partrequests.append(request.SwapFileRequest(root_part_req.partition(),
                                    root_part_req.partitionType()))


    def execute(self):

        w = WarningWidget(self)

        # We need different warning messages for Auto and Manual Partitioning
        if ctx.installData.autoPartDev:
            # show confirmation dialog
            w.warning.setText(_('''<b>
<p>This action will use your entire disk for Pardus installation and
all your present data on the selected disk will be lost.</p>

<p>After being sure you had your backup this is generally a safe
and easy way to install Pardus.</p>
</b>
'''))
        if not ctx.autoInstall:
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                # disabled by weaver
                ctx.screens.enablePrev()
                return False

        info_window = InformationWindow(self, _("Please wait while formatting!"))
        ctx.screens.processEvents()

        # We should do partitioning operations in here.

        # Auto Partitioning
        if ctx.installData.autoPartDev:
            ctx.partrequests.remove_all()
            ctx.use_autopart = True
            self.autopartDevice()
            time.sleep(1)
            ctx.partrequests.applyAll()

        # Manual Partitioning
        else:
            for dev in yali.storage.devices:
                dev.commit()
            # wait for udev to create device nodes
            time.sleep(2)
            self.checkSwap()
            ctx.partrequests.applyAll()

        info_window.close()

        root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
                                                                  request.mountRequestType)

        # install_dev
        if self.noInstall.isChecked():
            ctx.installData.bootLoaderDev = None
        elif self.installPart.isChecked():
            ctx.installData.bootLoaderDev = basename(root_part_req.partition().getPath())
        elif self.installMBR.isChecked():
            ctx.installData.bootLoaderDev = basename(self.device.getPath())
        else:
            if len(yali.storage.devices) > 1:
                self.orderedDiskList = yali.storage.getOrderedDiskList()
                ctx.installData.bootLoaderDev = basename(self.orderedDiskList[0])
            else:
                ctx.installData.bootLoaderDev = str(basename(root_part_req.partition().getPath()))

        _ins_part = root_part_req.partition().getPath()

        ctx.debugger.log("Pardus installed to : %s" % _ins_part)
        ctx.debugger.log("GRUB will be installed to : %s" % ctx.installData.bootLoaderDev)

        return True
开发者ID:Tayyib,项目名称:uludag,代码行数:101,代码来源:ScrBootloader.py


示例11: execute

    def execute(self):

        w = WarningWidget(self)

        # We need different warning messages for Auto and Manual Partitioning
        if ctx.installData.autoPartDev:
            # show confirmation dialog
            w.warning.setText(_('''<b>
<p>This action will use your entire disk for Pardus installation and
all your present data on the selected disk will be lost.</p>

<p>After being sure you had your backup this is generally a safe
and easy way to install Pardus.</p>
</b>
'''))
        if not ctx.autoInstall:
            self.dialog = WarningDialog(w, self)
            if not self.dialog.exec_loop():
                # disabled by weaver
                ctx.screens.enablePrev()
                return False

        info_window = InformationWindow(self, _("Please wait while formatting!"))
        ctx.screens.processEvents()

        # We should do partitioning operations in here.

        # Auto Partitioning
        if ctx.installData.autoPartDev:
            ctx.partrequests.remove_all()
            ctx.use_autopart = True
            self.autopartDevice()
            time.sleep(1)
            ctx.partrequests.applyAll()

        # Manual Partitioning
        else:
            for dev in yali.storage.devices:
                dev.commit()
            # wait for udev to create device nodes
            time.sleep(2)
            self.checkSwap()
            ctx.partrequests.applyAll()

        info_window.close()

        root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
                                                                  request.mountRequestType)

        # install_dev
        if self.noInstall.isChecked():
            ctx.installData.bootLoaderDev = None
        elif self.installPart.isChecked():
            ctx.installData.bootLoaderDev = basename(root_part_req.partition().getPath())
        elif self.installMBR.isChecked():
            ctx.installData.bootLoaderDev = basename(self.device.getPath())
        else:
            if len(yali.storage.devices) > 1:
                self.orderedDiskList = yali.storage.getOrderedDiskList()
                ctx.installData.bootLoaderDev = basename(self.orderedDiskList[0])
            else:
                ctx.installData.bootLoaderDev = str(basename(root_part_req.partition().getPath()))

        _ins_part = root_part_req.partition().getPath()

        ctx.debugger.log("Pardus installed to : %s" % _ins_part)
        ctx.debugger.log("GRUB will be installed to : %s" % ctx.installData.bootLoaderDev)

        return True
开发者ID:Tayyib,项目名称:uludag,代码行数:69,代码来源:ScrBootloader.py


示例12: Widget

class Widget(QWidget, ScreenWidget):

    help = _('''
<font size="+2">Congratulations</font>


<font size="+1">
<p>
You have successfully installed Pardus, a very easy to use desktop system on
your machine. Now you can start playing with your system and stay productive
all the time.
</p>
<P>
Click on the Next button to proceed. One note: You remember your password,
don't you?
</p>
</font>
''')

    def __init__(self, *args):
        apply(QWidget.__init__, (self,) + args)
        
        img = QLabel(self)
        img.setPixmap(ctx.iconfactory.newPixmap("goodbye"))

        self.info = QLabel(self)
        self.info.setText(
            _('<b><font size="+2" color="#FF6D19">Rebooting system. Please wait!</font></b>'))
        self.info.hide()
        self.info.setAlignment(QLabel.AlignCenter|QLabel.AlignTop)
        self.info.setMinimumSize(QSize(0,50))

        vbox = QVBoxLayout(self)
        vbox.addStretch(1)

        hbox = QHBoxLayout(vbox)
        hbox.addStretch(1)
        hbox.addWidget(img)
        hbox.addStretch(1)

        vbox.addStretch(1)
        vbox.addWidget(self.info)

    def shown(self):
        from os.path import basename
        ctx.debugger.log("%s loaded" % basename(__file__))
        ctx.screens.disablePrev()
        self.processPendingActions()

    def execute(self):

        ctx.screens.disableNext()

        self.info.show()
        self.info.setAlignment(QLabel.AlignCenter)

        #open(ctx.consts.log_file,"w").write(ctx.debugger.traceback.plainLogs)

        try:
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home"))
            yali.sysutils.umount(ctx.consts.target_dir + "/home")
            ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir))
            yali.sysutils.umount(ctx.consts.target_dir)
        except:
            ctx.debugger.log("Umount Failed.")
            pass
        
        ctx.debugger.log("Trying to eject the CD.")
        # remove cd...
        w = RebootWidget(self)
        ctx.debugger.log("Show reboot dialog.")
        self.dialog = WarningDialog(w, self)
        self.dialog.exec_loop()

        ctx.debugger.log("Yali, fastreboot calling..")
        yali.sysutils.fastreboot()

    # process pending actions defined in other screens.
    def processPendingActions(self):
        # add users
        for u in yali.users.pending_users:
            ctx.debugger.log("User %s adding to system" % u.username)
            u.addUser()
            ctx.debugger.log("User %s added to system" % u.username)

        # write console keyboard data
        yali.localeutils.write_keymap(ctx.keydata.console)
        ctx.debugger.log("Keymap stored.")

        # migrate xorg.conf
        yali.postinstall.migrate_xorg_conf(ctx.keydata.X)
        ctx.debugger.log("xorg.conf merged.")
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:92,代码来源:ScrGoodbye.py


示例13: execute

    def execute(self):

        w = WarningWidget(self)

        # We need different warning messages for Auto and Manual Partitioning
        if ctx.installData.autoPartDev:
            # show confirmation dialog
            w.warning.setText(_('''<b>
<p>This action will use your entire disk for Pardus installation and
all your present data on the selected disk will be lost.</p>

<p>After being sure you had your backup this is generally a safe
and easy way to install Pardus.</p>
</b>
'''))
        self.dialog = WarningDialog(w, self)
        if not self.dialog.exec_loop():
            # disabled by weaver
            ctx.screens.enablePrev()
            return False

        info_window = InformationWindow(self, _("Please wait while formatting!"))
        ctx.screens.processEvents()

        # We should do partitioning operations in here.

        # Auto Partitioning
        if ctx.installData.autoPartDev:
            ctx.partrequests.remove_all()
            ctx.use_autopart = True
            self.autopartDevice()
            time.sleep(1)
            ctx.partrequests.applyAll()

        # Manual Partitioning
        else:
            for dev in yali.storage.devices:
                dev.commit()
            # wait for udev to create device nodes
            time.sleep(2)
            self.checkSwap()
            ctx.partrequests.applyAll()

        info_window.close()

        if self.noInstall.isChecked():
            ctx.installData.bootLoaderDev = None

        # show information window...
        # info_window = InformationWindow(self, _("Please wait while installing bootloader!"))

        # loader = yali.bootloader.BootLoader()

        root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
                                                                  request.mountRequestType)

        # install_dev

        if self.installPart.isChecked():
            ctx.installData.bootLoaderDev = basename(root_part_req.partition().getPath())
        elif self.installMBR.isChecked():
            ctx.installData.bootLoaderDev = basename(self.device.getPath())
        else:
            ctx.installData.bootLoaderDev = str(filter(lambda u: u.isalpha(),
                                                       basename(root_part_req.partition().getPath())))

        _ins_part = root_part_req.partition().getPath()

        ctx.debugger.log("Pardus installed to : %s" % _ins_part)
        ctx.debugger.log("GRUB will be installed to : %s" % ctx.installData.bootLoaderDev)

        # loader.write_grub_conf(_ins_part,ctx.installData.bootLoaderDev)

        # Windows partitions...
        #for d in yali.storage.devices:
        #    for p in d.getPartitions():
        #        fs = p.getFSName()
        #        if fs in ("ntfs", "fat32"):
        #            if is_windows_boot(p.getPath(), fs):
        #                win_fs = fs
        #                win_dev = basename(p.getDevicePath())
        #                win_root = basename(p.getPath())
        #                loader.grub_conf_append_win(install_dev,
        #                                            win_dev,
        #                                            win_root,
        #                                            win_fs)
        #                continue

        # finally install it
        # loader.install_grub(install_dev)

        # close window
        # info_window.close(True)

        return True
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:95,代码来源:ScrBootloader.py



注:本文中的yali.gui.YaliDialog.WarningDialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python formats.getFormat函数代码示例发布时间:2022-05-26
下一篇:
Python YaliDialog.Dialog类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap