本文整理汇总了Python中kdecore.KApplication.kApplication方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.kApplication方法的具体用法?Python KApplication.kApplication怎么用?Python KApplication.kApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kdecore.KApplication
的用法示例。
在下文中一共展示了KApplication.kApplication方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: saveFileList
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def saveFileList(self):
"""Update the list of monitored files in the configuration file."""
files = []
for mon in self.monitors:
files.append(mon.getFileName())
cfg = KApplication.kApplication().config()
cfg.setGroup("Monitor")
cfg.writeEntry("files", files)
示例2: __init__
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def __init__(self, parent, name='BaseGameDataDialog'):
KDialogBase.__init__(self, parent, name)
# setup app pointer
self.app = KApplication.kApplication()
self.myconfig = self.app.myconfig
# we need a frame for the layout widget
# the layout widget won't work with a window as parent
self.frame = BaseGameDataFrame(self)
# set frame as main widget
self.setMainWidget(self.frame)
示例3: runAction
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def runAction(url):
"""
Runs an URL with KRun. If url starts with "email=" or "emailpreview=",
it is converted to a mailto: link with the url attached, and opened in
the default KDE mailer.
If url starts with "print=", the file is directly printed with lpr.
If url starts with "embed=", a subroutine in pdftk is called to embed
LilyPond documents in the output PDF.
"""
# hack: prevent QTextView recognizing mailto: urls cos it can't handle
# query string
url = unicode(url) # url could be a QString
m = re.match("([a-z]+)=(.*)", url)
if not m:
return krun(url)
command, url = m.groups()
if command == 'print':
path = unicode(KURL(url).path())
cmd = splitcommandline(config("commands").get("lpr", "lpr"))
cmd.append(path)
p = Popen(cmd, stderr=PIPE)
if p.wait() != 0:
error(_("Printing failed: %s") % p.stderr.read())
else:
info(_("The document has been sent to the printer."))
elif command in ('email', 'emailpreview'):
if command == "email" or warncontinue(_(
"This PDF has been created with point-and-click urls (preview "
"mode), which increases the file size dramatically. It's better "
"to email documents without point-and-click urls (publish mode), "
"because they are much smaller. Continue anyway?")):
KApplication.kApplication().invokeMailer(
KURL(u"mailto:?attach=%s" % url), "", True)
elif command == 'embed':
ly = unicode(KURL(url).path())
from lilykde import pdftk
pdftk.attach_files(ly)
示例4: setDocument
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def setDocument(self):
doc = open("examples/helloworld/Hello.html").read()
app = KApplication.kApplication()
# here we try to make a blank page first
# as in the KTextBrowser, but this doesn't do the trick
if True:
view = self.view()
view.layout()
self.begin()
self.write('')
self.end()
app.processEvents()
app.processEvents()
self.begin()
self.setAutoloadImages(True)
self.write(doc)
self.end()
self.connect(self, SIGNAL("completed()"),self.complete)
示例5: __init__
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def __init__(self):
QObject.__init__(self)
self.sysTray = KMySystemTray()
self.sysTray.setPixmap(self.sysTray.loadIcon("ksmarttray"))
self.sysTray.show()
self.process = KProcIO()
self.state = KSmartTray.State.Waiting
self.lastKnownStatus = ""
self.blinkFlag = False
self.updateFailed = False
self.checkTimer = QTimer()
self.blinkTimer = QTimer()
QObject.connect(self.checkTimer, SIGNAL("timeout()"), self.checkUpgrades)
QObject.connect(self.process, SIGNAL("processExited(KProcess *)"),
self.processDone)
QObject.connect(self, PYSIGNAL("foundNewUpgrades()"), self.startBlinking)
QObject.connect(self, PYSIGNAL("foundNoUpgrades()"), self.stopBlinking)
QObject.connect(self.sysTray, PYSIGNAL("mouseEntered()"), self.stopBlinking)
QObject.connect(self.blinkTimer, SIGNAL("timeout()"), self.toggleBlink)
QObject.connect(self.sysTray.checkAction, SIGNAL("activated()"),
self.manualCheckUpgrades)
QObject.connect(self.sysTray.startSmartAction, SIGNAL("activated()"),
self.startSmart)
QObject.connect(self.sysTray.stopAction, SIGNAL("activated()"),
self.stopChecking)
QObject.connect(self.sysTray, SIGNAL("quitSelected()"),
KApplication.kApplication(), SLOT("quit()"))
QObject.connect(self.sysTray, PYSIGNAL("activated()"), self.runUpgrades)
self.checkTimer.start(5*60*1000)
self.checkUpgrades()
示例6: makeCaption
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def makeCaption(title):
"""Create a standard window caption"""
return KApplication.kApplication().makeStdCaption(i18n(title))
示例7: get_application_pointer
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def get_application_pointer():
return KApplication.kApplication()
示例8: warncontinue
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def warncontinue(message):
return KMessageBox.warningContinueCancel(
KApplication.kApplication().mainWidget(), message
) == KMessageBox.Continue
示例9: info
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def info(message, **a):
KMessageBox.information(
KApplication.kApplication().mainWidget(), message)
示例10: sorry
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def sorry(message, **a):
KMessageBox.sorry(KApplication.kApplication().mainWidget(), message)
示例11: error
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def error(message, **a):
KMessageBox.error(KApplication.kApplication().mainWidget(), message)