本文整理汇总了Python中yali.gui.YaliDialog.Dialog.done方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.done方法的具体用法?Python Dialog.done怎么用?Python Dialog.done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yali.gui.YaliDialog.Dialog
的用法示例。
在下文中一共展示了Dialog.done方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Widget
# 需要导入模块: from yali.gui.YaliDialog import Dialog [as 别名]
# 或者: from yali.gui.YaliDialog.Dialog import done [as 别名]
#.........这里部分代码省略.........
</p>
<p>
In order to use Pardus, you must create one Linux filesystem (for the
system files), which is mandatory and a swap space
(for improved performance), which is optional. This swap space
is used whenever system needs more memory, but the system lacks it.
We advise you to allocate at least 4 GBs of hard disk area and
swap space (between 500 MB - 2 GB, according to your needs) for
convenience. A Linux partition size less than 3.5 GB is not allowed.
You may also optionally use another disk partition for storing
user files.
</p>
<p>
You need to format a Linux partition, if it's used for the first time.
You can enable \'Use available free space\' option, if the hard disk's
remaining space is to be used automatically.
</p>
<p>
The partition table shows the device, size, partition type and
filesystem information. If the partition will be formatted during
Pardus installation stage, then the corresponding \'Format\'
column will be enabled.
</p>
<p>
Please refer to Pardus Installing and Using Guide for more information
about disk partitioning.
</p>
</font>
''')
def __init__(self, *args):
apply(QWidget.__init__, (self,) + args)
self.partlist = PartList(self)
self.partedit = PartEdit(self)
self.partedit.hide()
self.dialog = None
vbox = QVBoxLayout(self)
vbox.addWidget(self.partlist)
self.connect(self.partlist, PYSIGNAL("signalCreate"),
self.slotCreatePart)
self.connect(self.partlist, PYSIGNAL("signalDelete"),
self.slotDeletePart)
self.connect(self.partlist, PYSIGNAL("signalEdit"),
self.slotEditPart)
self.connect(self.partlist, PYSIGNAL("signalResize"),
self.slotResizePart)
self.connect(self.partedit, PYSIGNAL("signalApplied"),
self.slotApplied)
self.connect(self.partedit, PYSIGNAL("signalCanceled"),
self.slotCanceled)
def shown(self):
from os.path import basename
ctx.debugger.log("%s loaded" % basename(__file__))
ctx.screens.disableNext()
self.partlist.update()
##
# do the work and run requested actions on partitions.
def execute(self):
ctx.debugger.log("Manual Partitioning selected...")
ctx.screens.processEvents()
return True
def slotCreatePart(self, parent, d):
self.partedit.setState(createState, d)
self.dialog = Dialog(_("Create Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotDeletePart(self, parent, d):
self.partedit.setState(deleteState, d)
self.dialog = Dialog(_("Delete Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotEditPart(self, parent, d):
self.partedit.setState(editState, d)
self.dialog = Dialog(_("Edit Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotResizePart(self, parent, d):
self.partedit.setState(resizeState, d)
self.dialog = Dialog(_("Resize Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotApplied(self):
self.dialog.done(0)
self.partlist.update()
def slotCanceled(self):
self.dialog.reject()
示例2: Widget
# 需要导入模块: from yali.gui.YaliDialog import Dialog [as 别名]
# 或者: from yali.gui.YaliDialog.Dialog import done [as 别名]
#.........这里部分代码省略.........
def __init__(self, *args):
apply(QWidget.__init__, (self,) + args)
# initialize all storage devices
yali.storage.init_devices()
self.partlist = PartList(self)
self.partedit = PartEdit(self)
self.partedit.hide()
self.dialog = None
vbox = QVBoxLayout(self)
vbox.addWidget(self.partlist)
self.connect(self.partlist, PYSIGNAL("signalCreate"),
self.slotCreatePart)
self.connect(self.partlist, PYSIGNAL("signalDelete"),
self.slotDeletePart)
self.connect(self.partlist, PYSIGNAL("signalEdit"),
self.slotEditPart)
self.connect(self.partlist, PYSIGNAL("signalResize"),
self.slotResizePart)
self.connect(self.partedit, PYSIGNAL("signalApplied"),
self.slotApplied)
self.connect(self.partedit, PYSIGNAL("signalCanceled"),
self.slotCanceled)
def shown(self):
ctx.screens.enablePrev()
self.partlist.update()
##
# do the work and run requested actions on partitions.
def execute(self):
# inform user...
self.partlist.showPartitionRequests(formatting=True)
# process events and show partitioning information!
ctx.screens.processEvents()
##
# check swap partition, if not present use swap file
rt = request.mountRequestType
pt = parttype.swap
found_swap_part = [x for x in ctx.partrequests.searchPartTypeAndReqType(pt, rt)]
# this should give (at most) one result
# cause we are storing one request for a partitionType()
assert(len(found_swap_part) <= 1)
if not found_swap_part:
print "no swap partition defined using swap as file..."
# find root partition
for r in ctx.partrequests.searchReqType(request.mountRequestType):
ctx.partrequests.append(
request.SwapFileRequest(r.partition(), r.partitionType()))
# apply all partition requests
ctx.partrequests.applyAll()
def slotCreatePart(self, parent, d):
self.partedit.setState(createState, d)
self.dialog = Dialog(_("Create Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotDeletePart(self, parent, d):
self.partedit.setState(deleteState, d)
self.dialog = Dialog(_("Delete Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotEditPart(self, parent, d):
self.partedit.setState(editState, d)
self.dialog = Dialog(_("Edit Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotResizePart(self, parent, d):
self.partedit.setState(resizeState, d)
self.dialog = Dialog(_("Resize Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotApplied(self):
self.dialog.done(0)
del self.dialog
self.partlist.update()
def slotCanceled(self):
self.dialog.reject()
del self.dialog
示例3: Widget
# 需要导入模块: from yali.gui.YaliDialog import Dialog [as 别名]
# 或者: from yali.gui.YaliDialog.Dialog import done [as 别名]
#.........这里部分代码省略.........
vbox.addWidget(self.partlist)
self.connect(self.partlist, PYSIGNAL("signalCreate"),
self.slotCreatePart)
self.connect(self.partlist, PYSIGNAL("signalDelete"),
self.slotDeletePart)
self.connect(self.partlist, PYSIGNAL("signalEdit"),
self.slotEditPart)
self.connect(self.partlist, PYSIGNAL("signalResize"),
self.slotResizePart)
self.connect(self.partedit, PYSIGNAL("signalApplied"),
self.slotApplied)
self.connect(self.partedit, PYSIGNAL("signalCanceled"),
self.slotCanceled)
def shown(self):
ctx.screens.enablePrev()
self.partlist.update()
##
# do the work and run requested actions on partitions.
def execute(self):
# show confirmation dialog
w = WarningWidget(self)
self.dialog = WarningDialog(w, self)
if not self.dialog.exec_loop():
return False
# commit events
self.partlist.devices_commit()
# inform user...
self.partlist.showPartitionRequests(formatting=True)
# process events and show partitioning information!
ctx.screens.processEvents()
ctx.screens.processEvents()
##
# check swap partition, if not present use swap file
rt = request.mountRequestType
pt = parttype.swap
found_swap_part = [x for x in ctx.partrequests.searchPartTypeAndReqType(pt, rt)]
# this should give (at most) one result
# cause we are storing one request for a partitionType()
assert(len(found_swap_part) <= 1)
if not found_swap_part:
print "no swap partition defined using swap as file..."
# find root partition
rt = request.mountRequestType
pt = parttype.root
for r in ctx.partrequests.searchPartTypeAndReqType(pt, rt):
ctx.partrequests.append(
request.SwapFileRequest(r.partition(), r.partitionType()))
# apply all partition requests
ctx.partrequests.applyAll()
return True
def slotCreatePart(self, parent, d):
self.partedit.setState(createState, d)
self.dialog = Dialog(_("Create Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotDeletePart(self, parent, d):
self.partedit.setState(deleteState, d)
self.dialog = Dialog(_("Delete Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotEditPart(self, parent, d):
self.partedit.setState(editState, d)
self.dialog = Dialog(_("Edit Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotResizePart(self, parent, d):
self.partedit.setState(resizeState, d)
self.dialog = Dialog(_("Resize Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotApplied(self):
self.dialog.done(0)
self.partlist.update()
def slotCanceled(self):
self.dialog.reject()
示例4: Widget
# 需要导入模块: from yali.gui.YaliDialog import Dialog [as 别名]
# 或者: from yali.gui.YaliDialog.Dialog import done [as 别名]
class Widget(QWidget, ScreenWidget):
help = _('''
<font size="+2">Partitioning your hard disk</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>
In order to use Pardus, you must create one Linux filesystem (for the
basic files and folders) and a swap space (for improved performance).
We advise you to allocate at least 4 GBs of hard disk area and
swap space (between 500 MB - 2 GB, according to your needs) for
convenience. A Linux partition size less than 2.5 GB is not allowed.
</p>
<p>
Please refer to Pardus Installing and Using Guide for more information
about disk partitioning.
</p>
</font>
''')
def __init__(self, *args):
apply(QWidget.__init__, (self,) + args)
# initialize all storage devices
yali.storage.init_devices()
self.partlist = PartList(self)
self.partedit = PartEdit(self)
self.dialog = None
vbox = QVBoxLayout(self)
vbox.addWidget(self.partlist)
self.connect(self.partlist, PYSIGNAL("signalCreate"),
self.slotCreatePart)
self.connect(self.partlist, PYSIGNAL("signalDelete"),
self.slotDeletePart)
self.connect(self.partlist, PYSIGNAL("signalEdit"),
self.slotEditPart)
self.connect(self.partlist, PYSIGNAL("signalResize"),
self.slotResizePart)
self.connect(self.partedit, PYSIGNAL("signalApplied"),
self.slotApplied)
self.connect(self.partedit, PYSIGNAL("signalCanceled"),
self.slotCanceled)
def shown(self):
ctx.screens.prevEnabled()
self.partlist.update()
##
# do the work and run requested actions on partitions.
def execute(self):
# inform user...
self.partlist.showPartitionRequests(formatting=True)
# process events and show partitioning information!
ctx.screens.processEvents()
# apply all partition requests
ctx.partrequests.applyAll()
def slotCreatePart(self, parent, d):
self.partedit.setState(createState, d)
self.dialog = Dialog(_("Create Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotDeletePart(self, parent, d):
self.partedit.setState(deleteState, d)
self.dialog = Dialog(_("Delete Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotEditPart(self, parent, d):
self.partedit.setState(editState, d)
self.dialog = Dialog(_("Edit Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotResizePart(self, parent, d):
self.partedit.setState(resizeState, d)
self.dialog = Dialog(_("Resize Partition"), self.partedit, self)
self.dialog.exec_loop()
def slotApplied(self):
self.dialog.done(0)
#.........这里部分代码省略.........