I have a weird problem with pyInstaller + pySide.

The problem is when I try to compile this code which is a simple systray
icon with a menu that reads its icon from a .ico file in pyinstaller the
icon is invisible or can not be displayed, the same code run from .py is
read and displayed accordingly.
I am busting my head over this for the whole day today, and I can't get
over it.



SOURCE:

http://pastebin.com/HyHjhxi6




OR:




class Window(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
self.createActions()
 #Timer
timer = QtCore.QTimer(self)
self.connect(timer, QtCore.SIGNAL("timeout()"), self.runMain)
timer.setInterval(1000 * 60 * 60) # 1 Hour
timer.start()

 self.createMenu()
self.createTrayIcon()

 def runMain(self):
main()
self.emit(QtCore.SIGNAL("softwareFinished()"), "1")
 def createActions(self):
self.forceSyncAction = QtGui.QAction(self.tr("Force Sync"), self)
QtCore.QObject.connect(self.forceSyncAction, QtCore.SIGNAL("triggered()"),
self.runMain)
 self.exitApplication = QtGui.QAction(self.tr("Exit"), self)
QtCore.QObject.connect(self.exitApplication, QtCore.SIGNAL("triggered()"),
self, QtCore.SLOT("close()"))
 def createMenu(self):
self.trayIconMenu = QtGui.QMenu(self)
self.trayIconMenu.addAction(self.forceSyncAction)
self.trayIconMenu.addAction(self.exitApplication)
 def createTrayIcon(self):
FAVICON = QtGui.QIcon("c:\\Work\\favicon.ico")
FAVICON.addFile("c:\\Work\\favicon.ico")
self.trayIcon = QtGui.QSystemTrayIcon(self)
self.trayIcon.setIcon(FAVICON)
self.trayIcon.setContextMenu(self.trayIconMenu)
self.trayIcon.show()

 def mainQt():
FAVICON_NAME = "favicon.ico"
if not os.path.exists(FAVICON_NAME):
urllib.urlretrieve("http://www.garenabanlist.com/files/%s"%(FAVICON_NAME),
FAVICON_NAME)
 app = QtGui.QApplication(sys.argv)
if not QtGui.QSystemTrayIcon.isSystemTrayAvailable():
QtGui.QMessageBox.critical(None, QtCore.QObject.tr(app, "Systray"),
QtCore.QObject.tr(app, "I couldn't detect any system tray on this system."))
sys.exit(1)
 window = Window()
#window.show()
sys.exit(app.exec_())
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to