当前位置: 首页>>代码示例>>Python>>正文


Python KApplication.kApplication方法代码示例

本文整理汇总了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)
开发者ID:BackupTheBerlios,项目名称:lovi-svn,代码行数:10,代码来源:main.py

示例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)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:12,代码来源:gamedata_widgets.py

示例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)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:39,代码来源:actions.py

示例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)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:22,代码来源:textbrowser_image.py

示例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()
开发者ID:blackPantherOS,项目名称:packagemanagement,代码行数:42,代码来源:ksmarttray.py

示例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))
开发者ID:BackupTheBerlios,项目名称:lovi-svn,代码行数:5,代码来源:main.py

示例7: get_application_pointer

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
def get_application_pointer():
    return KApplication.kApplication()
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:4,代码来源:__init__.py

示例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
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:6,代码来源:widgets.py

示例9: info

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
 def info(message, **a):
     KMessageBox.information(
         KApplication.kApplication().mainWidget(), message)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:5,代码来源:widgets.py

示例10: sorry

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
 def sorry(message, **a):
     KMessageBox.sorry(KApplication.kApplication().mainWidget(), message)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:4,代码来源:widgets.py

示例11: error

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import kApplication [as 别名]
 def error(message, **a):
     KMessageBox.error(KApplication.kApplication().mainWidget(), message)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:4,代码来源:widgets.py


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