本文整理汇总了Python中PyKDE4.kdeui.KApplication.connect方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.connect方法的具体用法?Python KApplication.connect怎么用?Python KApplication.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyKDE4.kdeui.KApplication
的用法示例。
在下文中一共展示了KApplication.connect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ki18n
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import connect [as 别名]
self.setCentralWidget (MainFrame (self))
#-------------------- main ------------------------------------------------
appName = "default.py"
catalog = ""
programName = ki18n ("default") #ki18n required here
version = "1.0"
description = ki18n ("Default Example") #ki18n required here
license = KAboutData.License_GPL
copyright = ki18n ("(c) 2007 Jim Bublitz") #ki18n required here
text = ki18n ("none") #ki18n required here
homePage = "www.riverbankcomputing.com"
bugEmail = "[email protected]"
aboutData = KAboutData (appName, catalog, programName, version, description,
license, copyright, text, homePage, bugEmail)
# ki18n required for first two addAuthor () arguments
aboutData.addAuthor (ki18n ("Troy Melhase"), ki18n ("original concept"))
aboutData.addAuthor (ki18n ("Jim Bublitz"), ki18n ("pykdedocs"))
KCmdLineArgs.init (sys.argv, aboutData)
app = KApplication ()
mainWindow = MainWin (None, "main window")
mainWindow.show()
app.connect (app, SIGNAL ("lastWindowClosed ()"), app.quit)
app.exec_ ()
示例2: Frontend
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import connect [as 别名]
class Frontend(BaseFrontend):
def __init__(self):
BaseFrontend.__init__(self)
self.previous_excepthook = sys.excepthook
sys.excepthook = self.excepthook
self.debconf_callbacks = {}
self.language_questions = ('oem_config', 'language_label',
'language_heading_label',
'timezone_heading_label',
'keyboard_heading_label',
'user_heading_label',
'back', 'next')
self.current_step = None
# Set default language.
dbfilter = language.Language(self, self.debconf_communicator())
dbfilter.cleanup()
dbfilter.db.shutdown()
self.allowed_change_step = True
self.allowed_go_forward = True
self.mainLoopRunning = False
self.apply_changes = False
appName = "oem-config"
catalog = ""
programName = ki18n("OEM Config")
version = "1.0"
description = ki18n("Sets up the system")
license = KAboutData.License_GPL
copyright = ki18n("2006, 2007 Anirudh Ramesh. 2008 Canonical Ltd.")
text = ki18n("none")
homePage = "http://www.kubuntu.org"
bugEmail = ""
aboutData = KAboutData(appName, catalog, programName, version, description,
license, copyright, text, homePage, bugEmail)
KCmdLineArgs.init(['oem-config', '-style=oxygen'], aboutData)
self.app = KApplication()
# We want to hide the minimise button if running in the ubiquity-only mode (no desktop)
# To achieve this we need to set window flags to Dialog but we also need a parent widget which is showing
# else Qt tried to be clever and puts the minimise button back
self.parentWidget = QWidget()
self.parentWidget.show()
# The parent for our actual user interface window, this is needed only because Oxygen widget
# style refuses to draw our background on a top level widget
self.parent2 = QWidget(self.parentWidget)
self.parent2.setAutoFillBackground(True)
self.parent2.setWindowState(Qt.WindowFullScreen)
self.parent2.setWindowFlags(Qt.Dialog)
layout = QVBoxLayout(self.parent2)
layout.setContentsMargins(0, 0, 0, 0)
self.userinterface = OEMConfUI(self.parent2)
self.userinterface.setFrontend(self)
layout.addWidget(self.userinterface)
self.parent2.show()
self.userinterface.next.setIcon(KIcon("go-next"))
self.userinterface.back.setIcon(KIcon("go-previous"))
self.translate_widgets()
self.customize_installer()
self.tzmap = TimezoneMap(self)
map_vbox = QVBoxLayout(self.userinterface.map_frame)
map_vbox.setMargin(0)
map_vbox.addWidget(self.tzmap)
def excepthook(self, exctype, excvalue, exctb):
"""Crash handler."""
if (issubclass(exctype, KeyboardInterrupt) or
issubclass(exctype, SystemExit)):
return
self.post_mortem(exctype, excvalue, exctb)
self.previous_excepthook(exctype, excvalue, exctb)
def run(self):
if os.getuid() != 0:
title = ('This installer must be run with administrative '
'privileges, and cannot continue without them.')
result = QMessageBox.critical(self.userinterface, "Must be root",
title)
sys.exit(1)
self.userinterface.setCursor(QCursor(Qt.ArrowCursor))
#Signals and Slots
self.app.connect(self.userinterface.next,SIGNAL("clicked()"),self.on_next_clicked)
self.app.connect(self.userinterface.back,SIGNAL("clicked()"),self.on_back_clicked)
self.app.connect(self.userinterface.language_list, SIGNAL("itemSelectionChanged()"), self.on_language_treeview_selection_changed)
self.app.connect(self.userinterface.keyboard_list_1, SIGNAL("itemSelectionChanged()"), self.on_keyboard_layout_selected)
self.app.connect(self.userinterface.keyboard_list_2, SIGNAL("itemSelectionChanged()"), self.on_keyboard_variant_selected)
#.........这里部分代码省略.........
示例3: __init__
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import connect [as 别名]
def __init__(self, datadir=None, options=None, parent=None, file=None, attachWinID=None):
""" Provide a KDE based graphical user interface to configure
the used software repositories, corresponding authentication keys
and update automation """
SoftwareProperties.__init__(self, options=options, datadir=datadir)
self.options = options
self.datadir = datadir
global kapp
kapp = KApplication()
self.userinterface = SoftwarePropertiesKDEUI(datadir)
self.userinterface.setWindowIcon(KIcon("applications-other"))
self.userinterface.button_auth_restore.setIcon(KIcon("edit-undo"))
self.userinterface.button_add_auth.setIcon(KIcon("list-add"))
self.userinterface.button_auth_remove.setIcon(KIcon("list-remove"))
self.userinterface.button_remove.setIcon(KIcon("list-remove"))
self.userinterface.button_edit.setIcon(KIcon("document-edit"))
self.userinterface.button_add.setIcon(KIcon("list-add"))
self.userinterface.button_add_cdrom.setIcon(KIcon("media-optical"))
translate_widget(self.userinterface)
self.userinterface.show()
if attachWinID is not None:
KWindowSystem.setMainWindow(self.userinterface, int(attachWinID))
# rejected() signal from Close button
kapp.connect(self.userinterface.buttonBox, SIGNAL("rejected()"), self.on_close_button)
self.userinterface.buttonBox.button(QDialogButtonBox.Reset).setEnabled(False)
# Put some life into the user interface:
self.init_server_chooser()
self.init_popcon()
self.init_auto_update()
self.init_release_upgrades()
self.show_auto_update_level()
# Setup the key list
self.init_keys()
self.show_keys()
# Setup the ISV sources list
self.init_isv_sources()
self.show_isv_sources()
self.show_cdrom_sources()
kapp.connect(self.userinterface.checkbutton_source_code, SIGNAL("clicked()"), self.on_checkbutton_source_code_toggled)
kapp.connect(self.userinterface.button_auth_restore, SIGNAL("clicked()"), self.on_restore_clicked)
kapp.connect(self.userinterface.button_add_auth, SIGNAL("clicked()"), self.add_key_clicked)
kapp.connect(self.userinterface.button_auth_remove, SIGNAL("clicked()"), self.remove_key_clicked)
kapp.connect(self.userinterface.checkbutton_popcon, SIGNAL("toggled(bool)"), self.on_checkbutton_popcon_toggled)
kapp.connect(self.userinterface.checkbutton_auto_update, SIGNAL("toggled(bool)"), self.on_auto_update_toggled)
kapp.connect(self.userinterface.combobox_update_interval, SIGNAL("currentIndexChanged(int)"), self.on_combobox_update_interval_changed)
kapp.connect(self.userinterface.button_remove, SIGNAL("clicked()"), self.on_remove_clicked)
kapp.connect(self.userinterface.button_edit, SIGNAL("clicked()"), self.on_edit_clicked)
kapp.connect(self.userinterface.button_add_cdrom, SIGNAL("clicked()"), self.on_button_add_cdrom_clicked)
kapp.connect(self.userinterface.button_add, SIGNAL("clicked()"), self.on_add_clicked)
kapp.connect(self.userinterface.treeview_sources, SIGNAL("itemChanged(QTreeWidgetItem*, int)"), self.on_isv_source_toggled)
kapp.connect(self.userinterface.treeview_sources, SIGNAL("itemClicked(QTreeWidgetItem*, int)"), self.on_treeview_sources_cursor_changed)
kapp.connect(self.userinterface.treeview_cdroms, SIGNAL("itemChanged(QTreeWidgetItem*, int)"), self.on_cdrom_source_toggled)
kapp.connect(self.userinterface.treeview2, SIGNAL("itemClicked(QTreeWidgetItem*, int)"), self.on_treeview_keys_cursor_changed)
button_close = self.userinterface.buttonBox.button(QDialogButtonBox.Close)
button_close.setIcon(KIcon("dialog-close"))
button_revert = self.userinterface.buttonBox.button(QDialogButtonBox.Reset)
button_revert.setIcon(KIcon("edit-undo"))
kapp.connect(button_revert, SIGNAL("clicked()"), self.on_button_revert_clicked)
self.init_distro()
self.show_distro()
示例4: KApplication
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import connect [as 别名]
#Set Commandline arguments
KCmdLineArgs.init(sys.argv, aboutData)
#Create a Kapplication instance
app = KApplication()
window = FirewallManager()
window.show()
app.exec_()
else:
import gettext
__trans = gettext.translation('firewall-manager', fallback=True)
i18n = __trans.ugettext
from firewallmanager.main import MainWidget
from pds.quniqueapp import QUniqueApplication
app = QUniqueApplication(sys.argv, catalog="firewall-manager")
mainWindow = MainWidget(None)
mainWindow.show()
mainWindow.resize(640, 480)
mainWindow.setWindowTitle(i18n("Firewall Manager"))
mainWindow.setWindowIcon(KIcon("security-high"))
app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)
app.exec_()
def CreatePlugin(widget_parent, parent, component_data):
return Module(component_data, parent)