本文整理汇总了Python中yali.gui.YaliDialog.Dialog类的典型用法代码示例。如果您正苦于以下问题:Python Dialog类的具体用法?Python Dialog怎么用?Python Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: showException
def showException(ex_type, tb):
title = _("Error!")
if ex_type in (yali.exception_fatal, yali.exception_pisi):
w = ErrorWidget(tb)
else:
w = ExceptionWidget(tb)
d = Dialog(title, w, None)
d.resize(500,400)
d.exec_loop()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:10,代码来源:runner.py
示例2: showException
def showException(ex_type, tb):
title = "Unhandled Exception!"
if ex_type == yali.exception_fatal:
w = ErrorWidget(tb)
else:
w = ExceptionWidget(tb)
d = Dialog(title, w, None)
d.resize(500,400)
d.exec_loop()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:10,代码来源:runner.py
示例3: showException
def showException(error_type, error_traceback):
title = _("An error occured")
closeButton = True
if error_type in (yali.exception_yali, yali.exception_pisi):
closeButton = False
ctx.logger.debug(error_traceback)
d = Dialog(title, ExceptionWidget(error_traceback, not closeButton), None, closeButton, icon="error")
d.resize(300,160)
d.exec_()
开发者ID:Tayyib,项目名称:uludag,代码行数:11,代码来源:runner.py
示例4: showException
def showException(ex_type, tb):
title = _("An error occured")
closeButton = True
if ex_type in (yali.exception_fatal, yali.exception_pisi):
closeButton = False
ctx.debugger.log(tb)
d = Dialog(title, ExceptionWidget(tb, not closeButton), None, closeButton, icon="error")
d.resize(300,160)
d.exec_()
开发者ID:Tayyib,项目名称:uludag,代码行数:11,代码来源:runner.py
示例5: toggleTetris
def toggleTetris(self):
self.tetris = Dialog(_("Tetris"), None, self, True, QtGui.QKeySequence(Qt.Key_F6))
_tetris = Tetris(self.tetris)
self.tetris.addWidget(_tetris)
self.tetris.resize(240,500)
_tetris.start()
self.tetris.exec_()
开发者ID:Tayyib,项目名称:uludag,代码行数:7,代码来源:YaliWindow.py
示例6: __init__
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."),
customIcon="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))
if self.origrequest.exists:
self.dialog.resize(QSize(450, 200))
else:
self.dialog.resize(QSize(450, 400))
开发者ID:Tayyib,项目名称:uludag,代码行数:33,代码来源:raid_gui.py
示例7: __init__
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))
开发者ID:Pardus-Linux,项目名称:yali,代码行数:7,代码来源:shrink_gui.py
示例8: toggleConsole
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_()
开发者ID:Pardus-Linux,项目名称:yali,代码行数:9,代码来源:YaliWindow.py
示例9: __init__
class Debugger:
def __init__(self,showLineNumbers=True):
title = _("Debug")
self.debugWidget = QWidget()
self.traceback = DebugContainer(self.debugWidget,showLineNumbers)
l = QVBoxLayout(self.debugWidget)
l.addWidget(self.traceback)
self.window = Dialog(title,self.debugWidget,None,extraButtons=True)
self.window.resize(500,400)
self.aspect = DebuggerAspect(self)
def showWindow(self):
self.window.show()
def log(self,log,type=1):
self.traceback.add(QString(log),type)
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:18,代码来源:debugger.py
示例10: __init__
def __init__(self,showLineNumbers=True):
title = _("Debug")
self.debugWidget = QWidget()
self.traceback = DebugContainer(self.debugWidget,showLineNumbers)
l = QVBoxLayout(self.debugWidget)
l.addWidget(self.traceback)
self.window = Dialog(title,self.debugWidget,None,extraButtons=True)
self.window.resize(500,400)
self.aspect = DebuggerAspect(self)
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:11,代码来源:debugger.py
示例11: __init__
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))
开发者ID:hrngultekin,项目名称:yali-family,代码行数:15,代码来源:lvm_gui.py
示例12: execute
def execute(self):
# show confirmation dialog
w = WarningWidget(self)
self.dialog = WarningDialog(w, self)
if not self.dialog.exec_loop():
# disabled by weaver.
ctx.screens.enablePrev()
self.partlist.update()
return False
# show information window...
info_window = InformationWindow(self, _("Please wait while formatting!"))
# commit events
self.partlist.devices_commit()
# 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
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()))
# apply all partition requests
ctx.partrequests.applyAll()
# close window
info_window.close(True)
return True
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:47,代码来源:ScrPartitionManual.py
示例13: __init__
def __init__(self,showTimeStamp=True):
title = _("Debugging Console")
self.debugWidget = QtGui.QWidget()
self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2),self.debugWidget)
QObject.connect(self.debugShortCut, SIGNAL("activated()"), self.toggleDebug)
self.traceback = DebugContainer(self.debugWidget,showTimeStamp)
self.loglevel = QtGui.QComboBox(self.debugWidget)
self.loglevel.addItem("0: Developer Messages")
self.loglevel.addItem("1: All Messages")
QObject.connect(self.loglevel, SIGNAL("currentIndexChanged(int)"),self.loglevelChanged)
l = QtGui.QVBoxLayout(self.debugWidget)
l.addWidget(self.loglevel)
l.addWidget(self.traceback)
self.window = Dialog(title,self.debugWidget)
self.window.resize(500,400)
self.aspect = DebuggerAspect(self)
开发者ID:Tayyib,项目名称:uludag,代码行数:19,代码来源:debugger.py
示例14: execute
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
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:42,代码来源:Partitioning.py
示例15: __init__
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))
开发者ID:hrngultekin,项目名称:yali-family,代码行数:20,代码来源:partition_gui.py
示例16: LVMEditor
class LVMEditor(object):
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(_("Not enough physical volumes"),
_("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 = _("Make LVM Volume Group")
else:
try:
title = _("Edit LVM Volume Group: %s") % (request.name,)
except AttributeError:
title = _("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))
def run(self):
if self.dialog is None:
return []
while 1:
rc = self.dialog.exec_()
operations = []
if not rc:
if self.isNew:
if self.lvs.has_key(self.origrequest.name):
del self.lvs[self.origrequest.name]
self.destroy()
return []
widget = self.dialog.content
name = str(widget.name.text())
pvs = widget.selectedPhysicalVolumes
msg = sanityCheckVolumeGroupName(name)
if msg:
self.intf.messageWindow(_("Invalid Volume Group Name"),
msg, type="warning")
continue
origname = self.origrequest.name
if origname != name:
if name in [vg.name for vg in self.storage.vgs]:
self.intf.messageWindow(_("Name in use"),
_("The volume group name \"%s\" is "
"already in use. Please pick another.")
% (name,), type="warning")
continue
peSize = int(widget.physicalExtends.itemData(widget.physicalExtends.currentIndex())) / 1024.0
origlvs = self.origrequest.lvs
if not self.origrequest.exists:
ctx.logger.debug("non-existing vg -- setting up lvs, pvs, name, peSize")
for lv in self.origrequest.lvs:
self.origrequest._removeLogicalVolume(lv)
for pv in self.origrequest.pvs:
if pv not in self.pvs:
self.origrequest._removePhysicalVolume(pv)
for pv in self.pvs:
if pv not in self.origrequest.pvs:
self.origrequest._addPhysicalVolume(pv)
self.origrequest.name = name
self.origrequest.peSize = peSize
#.........这里部分代码省略.........
开发者ID:hrngultekin,项目名称:yali-family,代码行数:101,代码来源:lvm_gui.py
示例17: showError
def showError(self, title, message, parent=None):
r = ErrorWidget(parent)
r.label.setText(message)
d = Dialog(title, r, self, closeButton=False)
d.resize(300,200)
d.exec_()
开发者ID:Tayyib,项目名称:uludag,代码行数:6,代码来源:installer.py
示例18: showGPL
def showGPL(self):
# make a release notes dialog
r = GUIGPL.Widget(self)
d = Dialog("GPL", r, self)
d.resize(500,400)
d.exec_loop()
开发者ID:Tayyib,项目名称:uludag,代码行数:6,代码来源:ScrWelcome.py
示例19: Widget
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
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):
#.........这里部分代码省略.........
开发者ID:Tayyib,项目名称:uludag,代码行数:101,代码来源:ScrPartitionManual.py
示例20: showGPL
def showGPL(self):
# make a GPL dialog
d = Dialog("GPL", Gpl(self), self)
d.resize(500,400)
d.exec_()
开发者ID:Tayyib,项目名称:uludag,代码行数:5,代码来源:ScrWelcome.py
注:本文中的yali.gui.YaliDialog.Dialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论