本文整理汇总了Python中PyKDE4.kdecore.KGlobal类的典型用法代码示例。如果您正苦于以下问题:Python KGlobal类的具体用法?Python KGlobal怎么用?Python KGlobal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KGlobal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None):
KMainWindow.__init__(self, parent)
self.setWindowIcon(KIcon("security-high"))
widget = MainWidget(self)
KGlobal.locale().insertCatalog("firewall-manager")
self.resize(widget.size())
self.setCentralWidget(widget)
示例2: __init__
def __init__ (self, app):
KMainWindow.__init__(self)
# This is very important for translations when running as kcm_module
KGlobal.locale().insertCatalog("network-manager")
self.resize (640, 480)
self.setCentralWidget(MainManager(self, True, app))
示例3: removeShortcut
def removeShortcut(self, name):
"""
Deletes the given action if existing.
"""
resolvedName = self.resolveName(name)
action = self._collection.action(resolvedName)
if action:
action.deleteLater()
KGlobal.config().group(self._manager.configGroup).deleteEntry(resolvedName)
示例4: __init__
def __init__ (self, *args):
KMainWindow.__init__(self)
self.setWindowIcon(KIcon("flag-yellow"))
# This is very important for translations when running as kcm_module
KGlobal.locale().insertCatalog("service-manager")
self.resize (640, 480)
self.setCentralWidget(MainManager(self))
示例5: init
def init(self):
plasmascript.Applet.init(self)
KGlobal.locale().insertCatalog("veromix");
if "usr/share/kde4" not in os.path.realpath(__file__):
out = commands.getstatusoutput("xdg-icon-resource install --size 128 " + unicode(self.package().path()) + "contents/icons/veromix-plasmoid-128.png veromix-plasmoid")
if out[0] == 0:
print "veromix icon installed"
else:
print "Error installing veromix icon:", out
LADSPAPresetLoader().install_ladspa_presets_if_needed()
if self.is_ladspa_enabled():
# force singleton initialisation
LADSPAPresetLoader().presets()
LADSPAEffects().effects()
createDbusServiceDescription(self.package().path() + "/dbus-service/VeromixServiceQt.py", True)
KGlobal.locale().insertCatalog("veromix")
self.setHasConfigurationInterface(True)
self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
self.theme = Plasma.Svg(self)
self.widget = VeroMix(self)
self.widget.init()
defaultSize = QVariant(QSize (0,0))
size = self.config().readEntry("size", defaultSize).toSize()
if self.formFactor() == Plasma.Planar:
self.widget.setMinimumSize(275,125)
elif (size != defaultSize) :
self.widget.setPreferredSize(size.width(), size.height())
else:
self.widget.setPreferredSize(470 ,145)
self.connect(self.widget, SIGNAL("resized()"), self.dialogResized)
#try:
self.setGraphicsWidget(self.widget)
self.applet.setPassivePopup(True)
## FIXME: see fixPopupcion
self.setPopupIcon(KIcon("audio-volume-high"))
#self.setPopupIcon("audio-volume-muted")
# dont know why but adding it a second time helps (otherwise it
# wont popup when you add it directly to the panel)
self.setGraphicsWidget(self.widget)
self.connect(self.applet, SIGNAL("appletDestroyed(Plasma::Applet*)"), self.doExit)
self.setBackgroundHints(Plasma.Applet.StandardBackground)
self.applyConfig()
#except AttributeError , e:
#print e
#updateMetadataDesktop(self)
self.initTooltip()
self.initShortcuts()
QTimer.singleShot(1000, self.fixPopupIcon)
示例6: __init__
def __init__(self, component_data, parent):
KCModule.__init__(self, component_data, parent)
KGlobal.locale().insertCatalog(catalog)
if not dbus.get_default_main_loop():
from dbus.mainloop.qt import DBusQtMainLoop
DBusQtMainLoop(set_as_default = True)
MainWidget(self, embed=True)
示例7: __init__
def __init__(self, component_data, parent):
KCModule.__init__(self, component_data, parent)
# This is very important for translations when running as kcm_module
KGlobal.locale().insertCatalog("network-manager")
# DBUS MainLoop
if not dbus.get_default_main_loop():
from dbus.mainloop.qt import DBusQtMainLoop
DBusQtMainLoop(set_as_default = True)
MainManager(self, standAlone = False)
示例8: __init__
def __init__(self, component_data, parent=None):
KCModule.__init__(self, component_data, parent)
KGlobal.locale().insertCatalog('synaptiks')
# keep a reference to the generated about data to prevent it from being
# deleted by the GC
self._about = make_about_data(
ki18nc('kcmodule description', 'Touchpad configuration'))
self.setAboutData(self._about)
self.setQuickHelp(i18nc(
'@info:tooltip synaptiks kcmodule',
'<title>Touchpad configuration</title>'
'<para>This module lets you configure your touchpad.</para>'))
示例9: paths
def paths():
""" build a list of paths based on config """
# in which prefixes to look for relative paths
prefixes = KGlobal.dirs().kfsstnd_prefixes().split(os.pathsep)
prefixes = set(prefixes + ['/usr/', '/usr/local/'])
# if the path is not absolute, add it to all prefixes.
for path in conf.readEntry("paths", defaultPaths):
if os.path.isabs(path):
yield path
else:
for pref in prefixes:
yield os.path.join(pref, path)
for d in KGlobal.dirs().findDirs("data", path):
yield d
示例10: __init__
def __init__(self, parent = None):
plasmascript.Applet.__init__(self, parent)
self.kdehome = unicode(KGlobal.dirs().localkdedir())
self.iconPath = '/usr/share/kde4/apps/plasma/plasmoids/kde-plasma-spacer/contents/icons/Spacer.png'
self.icon = Plasma.IconWidget()
self.icon.setIcon(self.iconPath)
示例11: tabWidth
def tabWidth(self):
"""Returns the width of the tab character in this document."""
v = self.kateVariable("tab-width")
if v and v.isdigit():
return int(v)
group = KGlobal.config().group("Kate Document Defaults")
return group.readEntry("Tab Width", 8)
示例12: __init__
def __init__(self, parent):
QtCore.QObject.__init__(self)
self.applet = parent
self.kdehome = unicode(KGlobal.dirs().localkdedir())
if not os.path.exists(self.kdehome+u"share/apps/%s/%s.notifyrc" % (self.applet.metadata.pluginName(), self.applet.metadata.pluginName())):
# Install notifyrc file if required
self.install_notifications()
示例13: __init__
def __init__(self, servicePrefix):
# We manage our own documents.
self.documents = []
self.history = [] # latest shown documents
# KApplication needs to be instantiated before any D-Bus stuff
self.kapp = KApplication()
# Here we can setup config() stuff before MainWindow and its tools
# are created.
config = KGlobal.config().group("") # root group
self.setupConfiguration(config)
config.sync()
# DBus init
serviceName = "{0}{1}".format(servicePrefix, os.getpid())
DBusItem.__init__(self, serviceName, '/MainApp')
# We support only one MainWindow.
self.mainwin = self.createMainWindow()
self.kapp.setTopWidget(self.mainwin)
# Get our beloved editor :-)
self.editor = KTextEditor.EditorChooser.editor()
self.editor.readConfig()
# restore session etc.
self._sessionStartedFromCommandLine = False
示例14: __init__
def __init__(self, *args):
QtGui.QWidget.__init__(self,None)
self.ui = Ui_goodbyeWidget()
self.ui.setupUi(self)
lang = KGlobal.locale().language()
if lang == "hu":
self.helpPageUrl = "http://www.facebook.com/blackpantheros"
else:
self.helpPageUrl = "http://www.blackpantheros.eu"
self.smoltUrl = "http://backend.blackpanther.hu"
users = partition.allUsers()
# ittkapcsoldki
if not users:
self.ui.migrationGroupBox.hide()
#idaig
self.ui.buttonSystemSettings_2.connect(self.ui.buttonSystemSettings_2, SIGNAL("clicked()"), self.startSmolt)
self.ui.buttonMigration.connect(self.ui.buttonMigration, SIGNAL("clicked()"), self.startMigration)
self.ui.buttonSystemSettings.connect(self.ui.buttonSystemSettings, SIGNAL("clicked()"), self.startSystemSettings)
self.ui.buttonHelpPages.connect(self.ui.buttonHelpPages, SIGNAL("clicked()"), self.startHelpPages)
示例15: indentationWidth
def indentationWidth(self):
"""Returns the indent-width for the current document."""
v = self.kateVariable("indent-width")
if v and v.isdigit():
return int(v)
group = KGlobal.config().group("Kate Document Defaults")
return group.readEntry("Indentation Width", 2)