X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fmainwindow.py;h=b85ce0dc0da966bbf1596f14434dd9fcf4cf0bc1;hp=6a0175ea2f933e2b8b6f8a55688512e6eef42b23;hb=a27d51684e4c3f10b721b6fd6b28711f26063da9;hpb=5d9d4374df91f919e5c744906186b2769b6d09ae diff --git a/sface/mainwindow.py b/sface/mainwindow.py index 6a0175e..b85ce0d 100644 --- a/sface/mainwindow.py +++ b/sface/mainwindow.py @@ -1,5 +1,4 @@ - -import os +import os, os.path import sys import time @@ -13,11 +12,24 @@ from sface.screens.configscreen import ConfigScreen from sface.screens.mainscreen import MainScreen from sface.screens.helpscreen import HelpScreen +# depending on the platform.. +def locate_image_file (filename): + for dir in [ '/usr/share' ] : + for suffix in ['png','jpg']: + attempt=os.path.join(dir,'images',"%s.%s"%(filename,suffix)) + if os.path.is_file(attempt) : return attempt + return os.path.join('/could/not/locate/image/file',filename) + + class Nav(QWidget): def __init__(self, parent=None): QWidget.__init__(self, parent) self.title = QLabel("", self) + scene=QGraphicsScene() + pixmap = QPixmap(locate_image_file('graphic-sfa.png')) + logolabel=QLabel("",self) + logolabel.setPixmap(pixmap) self.main = QLabel("", self) self.main.setAlignment(Qt.AlignRight) @@ -28,6 +40,7 @@ class Nav(QWidget): self.help.setAlignment(Qt.AlignRight) hlayout = QHBoxLayout() + hlayout.addWidget(logolabel) hlayout.addWidget(self.title) hlayout.addStretch() hlayout.addWidget(QLabel("Go to: ", self))