本文整理汇总了Python中PyKDE4.kdeui.KApplication.setOrganizationName方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.setOrganizationName方法的具体用法?Python KApplication.setOrganizationName怎么用?Python KApplication.setOrganizationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyKDE4.kdeui.KApplication
的用法示例。
在下文中一共展示了KApplication.setOrganizationName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import setOrganizationName [as 别名]
def main():
global app, aboutData
import setproctitle
setproctitle.setproctitle("iosshy")
from PyQt4.QtCore import QCoreApplication, QTranslator, QLocale, QSettings
from PyQt4.QtGui import QApplication, QSystemTrayIcon, QImage
from tunneldialog import TunnelDialog
try:
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import KApplication, KIcon
aboutData = KAboutData(
name, #appName
name, #catalogName
ki18n(name), #programName
version,
ki18n(description), #shortDescription
KAboutData.License_BSD, #licenseKey
ki18n("© 2010 Massimiliano Torromeo"), #copyrightStatement
ki18n(""), #text
url #homePageAddress
)
aboutData.setBugAddress("http://github.com/mtorromeo/iosshy/issues")
aboutData.addAuthor(
ki18n("Massimiliano Torromeo"), #name
ki18n("Main developer"), #task
"[email protected]" #email
)
aboutData.setProgramLogo(QImage(":icons/network-server.png"))
KCmdLineArgs.init(sys.argv, aboutData)
app = KApplication()
app.setWindowIcon(KIcon("network-server"))
if app.isSessionRestored():
sys.exit(0)
except ImportError:
app = QApplication(sys.argv)
app.setOrganizationName("MTSoft")
app.setApplicationName(name)
if QSystemTrayIcon.isSystemTrayAvailable():
translator = QTranslator()
qmFile = "tunneller_%s.qm" % QLocale.system().name()
if os.path.isfile(qmFile):
translator.load(qmFile)
app.installTranslator(translator)
dialog = TunnelDialog()
sys.exit(app.exec_())
else:
print "System tray not available. Exiting."
sys.exit(1)
示例2: main
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import setOrganizationName [as 别名]
def main():
" Main Loop "
from getopt import getopt
OPAQUE = True
BORDER = True
try:
opts, args = getopt(sys.argv[1:], "hvob", ["version", "help", "opaque", "borderless"])
pass
except:
pass
for o, v in opts:
if o in ("-h", "--help"):
print(
"""
Usage:
-h, --help Show help informations and exit.
-v, --version Show version information and exit.
-o, --opaque Use Opaque GUI.
-b, --borderless No WM Borders.
Run without parameters and arguments to use the GUI.
"""
)
return sys.exit(1)
elif o in ("-v", "--version"):
print(__version__)
return sys.exit(1)
elif o in ("-o", "--opaque"):
OPAQUE = False
elif o in ("-b", "--borderless"):
BORDER = False
# define our App
try:
app = QApplication(sys.argv)
app.setApplicationName(__doc__)
app.setOrganizationName(__author__)
app.setOrganizationDomain(__author__)
app.setStyle("Plastique")
app.setStyle("Oxygen")
except TypeError:
aboutData = KAboutData(
__doc__,
"",
ki18n(__doc__),
__version__,
ki18n(__doc__),
KAboutData.License_GPL,
ki18n(__author__),
ki18n("none"),
__url__,
__email__,
)
KCmdLineArgs.init(sys.argv, aboutData)
app = QApplication()
app.lastWindowClosed.connect(app.quit)
# w is gonna be the mymainwindow class
w = MyMainWindow()
# set the class with the attribute of translucent background as true
if OPAQUE is True:
w.setAttribute(Qt.WA_TranslucentBackground, True)
# WM Borders
if BORDER is False:
w.setWindowFlags(w.windowFlags() | Qt.FramelessWindowHint)
# run the class
w.show()
# if exiting the loop take down the app
sys.exit(app.exec_())