本文整理汇总了Python中PyKDE4.kdeui.KApplication.kApplication方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.kApplication方法的具体用法?Python KApplication.kApplication怎么用?Python KApplication.kApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyKDE4.kdeui.KApplication
的用法示例。
在下文中一共展示了KApplication.kApplication方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pulse
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def pulse(self, owner):
super(KDEFetchProgressAdapter, self).pulse(owner)
at_item = min(self.current_items + 1, self.total_items)
if self.current_cps > 0:
self.label.setText(_("Downloading additional package files...") + _("File %s of %s at %sB/s" % (at_item, self.total_items, apt_pkg.size_to_str(self.current_cps))))
else:
self.label.setText(_("Downloading additional package files...") + _("File %s of %s" % (at_item, self.total_items)))
self.progress.setValue(100 * self.current_bytes / self.total_bytes)
KApplication.kApplication().processEvents()
return True
示例2: __init__
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def __init__(self, datadir, component_data=None, parent=None):
LanguageSelectorBase.__init__(self, datadir)
KCModule.__init__(self, component_data, parent)
self.parentApp = KApplication.kApplication()
self.ui = Ui_QtLanguageSelectorGUI()
self.ui.setupUi(self)
self.about = MakeAboutData()
self.setAboutData(self.about)
self.setWindowIcon(KIcon("preferences-desktop-locale"))
self.imSwitch = ImSwitch()
# remove dangling ImSwitch symlinks if present
self.imSwitch.removeDanglingSymlinks()
self.init()
# connect the signals
self.connect(self.ui.listViewLanguagesInst, SIGNAL("itemSelectionChanged()"), self.checkInstallableComponents)
self.connect(self.ui.listViewLanguagesUninst, SIGNAL("itemSelectionChanged()"), self.onChanged)
self.connect(self.ui.ktabwidget, SIGNAL("currentChanged(int)"), self.onTabChangeRevertApply)
self.connect(self.ui.listBoxDefaultLanguage, SIGNAL("itemSelectionChanged()"), self.checkInputMethods)
self.connect(self.ui.checkBoxTr, SIGNAL("stateChanged(int)"), self.onChanged)
self.connect(self.ui.checkBoxIm, SIGNAL("stateChanged(int)"), self.onChanged)
self.connect(self.ui.checkBoxSpell, SIGNAL("stateChanged(int)"), self.onChanged)
self.connect(self.ui.checkBoxFonts, SIGNAL("stateChanged(int)"), self.onChanged)
示例3: update_interface
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def update_interface(self):
# run the base class
try:
InstallProgress.update_interface(self)
except ValueError as e:
pass
# log the output of dpkg (on the master_fd) to the DumbTerminal
while True:
try:
(rlist, wlist, xlist) = select.select([self.master_fd],[],[], 0.01)
# data available, read it
if len(rlist) > 0:
line = os.read(self.master_fd, 255)
self.parent.konsole.insertWithTermCodes(utf8(line))
else:
# nothing happend within the timeout, break
break
except Exception as e:
logging.debug("update_interface: %s" % e)
break
KApplication.kApplication().processEvents()
示例4: commit
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def commit(self):
# ui
self.status.setText(_("Installing '%s'...") % os.path.basename(self.debfile))
# the command
cmd = "/usr/bin/dpkg"
argv = [cmd, "--auto-deconfigure", "-i", self.debfile]
(self.child_pid, self.master_fd) = pty.fork()
if self.child_pid == 0:
os.environ["TERM"] = "dumb"
if not "DEBIAN_FRONTEND" in os.environ:
os.environ["DEBIAN_FRONTEND"] = "noninteractive"
os.environ["APT_LISTCHANGES_FRONTEND"] = "none"
exitstatus = subprocess.call(argv)
os._exit(exitstatus)
while True:
#Read from pty and write to DumbTerminal
try:
(rlist, wlist, xlist) = select.select([self.master_fd],[],[], 0.001)
if len(rlist) > 0:
line = os.read(self.master_fd, 255)
self.parent.konsole.insertWithTermCodes(utf8(line))
except Exception as e:
#print e
from errno import EAGAIN
if hasattr(e, "errno") and e.errno == EAGAIN:
continue
break
KApplication.kApplication().processEvents()
# at this point we got a read error from the pty, that most
# likely means that the client is dead
(pid, status) = os.waitpid(self.child_pid, 0)
self.exitstatus = os.WEXITSTATUS(status)
self.progress.setValue(100)
self.parent.closeButton.setEnabled(True)
self.parent.closeButton.setVisible(True)
self.parent.installationProgress.setVisible(False)
QTimer.singleShot(1, self.parent.changeSize)
示例5: __init__
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def __init__(self, datadir, options, file="", parent=None, name=None,
modal=0, fl=0):
GDebiKDEDialog.__init__(self,parent)
GDebiCommon.__init__(self,datadir,options,file)
# load the icon
self.setWindowIcon(KIcon("application-x-deb"))
# first, we load all the default descriptions -- pyuic doesn't use
# gettext as default (FIXME, copy code from language-selector)
self.textLabel1.setText(_("Package:"))
self.textLabel1_2.setText(_("Status:"))
self.detailsButton.setText(_("Details"))
self.tabWidget2.setTabText(0,_("Description"))
self.tabWidget2.setTabText(1,_("Details"))
self.tabWidget2.setTabText(2,_("Included Files"))
self.cancelButton.setText(__("kdelibs","&Cancel"))
self.installButton.setText(_("&Install Package"))
self.downloadButton.setText(_("&Download Package"))
self.DetailsVersionLabel.setText(_("<b>Version:</b>"))
self.DetailsMaintainerLabel.setText(_("<b>Maintainer:</b>"))
self.DetailsPriorityLabel.setText(_("<b>Priority:</b>"))
self.DetailsSectionLabel.setText(_("<b>Section:</b>"))
self.DetailsSizeLabel.setText(_("<b>Size:</b>"))
# translation finished
self.setDisabled(True)
self.PackageProgressBar.setEnabled(True)
self.detailsButton.hide()
self.downloadButton.hide()
self.installButton.setIcon(KIcon("dialog-ok"))
self.cancelButton.setIcon(KIcon("dialog-cancel"))
self.show()
self.kapp = KApplication.kApplication() #incidently, this stops it crashing on quit, no idea why, jriddell
self.kapp.processEvents() #run because openCache takes a while to do its thing
self.cprogress = CacheProgressAdapter(self.PackageProgressBar)
if not self.openCache():
KMessageBox.error(self, '<b>' + self.error_header + '</b><br>' + self.error_body,
self.error_header)
sys.exit(1)
# try to open the file
if file != "" and os.path.exists(file):
self.open(file)
else:
header = _("The package file does not exist")
body = _("A nonexistent file has been selected for installation. Please select an existing .deb package file.")
KMessageBox.error(self, '<b>' + header + '</b><br>' + body, header)
sys.exit(1)
self.setEnabled(True)
self.PackageProgressBar.hide()
self.connect(self.cancelButton, SIGNAL("clicked()"), self.cancelButtonClicked)
self.connect(self.installButton, SIGNAL("clicked()"), self.installButtonClicked)
self.connect(self.downloadButton, SIGNAL("clicked()"), self.downloadButtonClicked)
self.connect(self.detailsButton, SIGNAL("clicked()"), self.detailsButtonClicked)
示例6: postEventWithCallback
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def postEventWithCallback(self, callback, *args):
self.queue.put((callback, args))
app = KApplication.kApplication()
app.postEvent(self, QEvent(QEvent.User))
示例7: close
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def close(self):
self.accept()
KApplication.kApplication().exit()
示例8: update
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import kApplication [as 别名]
def update(self, percent=None):
self.progressbar.show()
if percent:
self.progressbar.setValue(percent)
KApplication.kApplication().processEvents()