本文整理汇总了Python中PyKDE4.kdeui.KApplication.setWindowIcon方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.setWindowIcon方法的具体用法?Python KApplication.setWindowIcon怎么用?Python KApplication.setWindowIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyKDE4.kdeui.KApplication
的用法示例。
在下文中一共展示了KApplication.setWindowIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import setWindowIcon [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: KAboutData
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import setWindowIcon [as 别名]
aboutData = KAboutData(appName, catalogue, programName, version, description,
license, copyright, text, homepage, bugEmail)
# aboutData.addAuthor(ki18n("Sarwo Hadi Setyana"), ki18n("Author"),
# "[email protected]", "", "shsetyana")
aboutData.addAuthor(ki18n("Sarwo Hadi Setyana"), ki18n("Author"),
"[email protected]", "")
aboutData.addCredit(ki18n("Ahmed Atalla"), ki18n("TuxCut author"),
"[email protected]")
KCmdLineArgs.init(sys.argv, aboutData)
app = KApplication()
app.setWindowIcon(KIcon("edit-cut"))
netkut = Netkut()
netkut.mainWindow.show()
x = os.popen('whoami','r')
user = x.readline()
if user != 'root\n':
KMessageBox.error(None, "You must be root to run Netkut", "Error")
quit()
if netkut.gwMAC == '':
KMessageBox.error(None, "You are not connected to any network, netkut will Quit", "Connection Error")
quit()