X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fmainwindow.py;h=620b000f3f6a5d3d551eb4fe40497241033f487a;hp=d23c7b3823b1d641ca5567d159533dbb11d8aa10;hb=96d786458551cb101e9ccd046e98cd03e331345e;hpb=48980053009418be48ddb49c44e5bc69fb1008cd diff --git a/sface/mainwindow.py b/sface/mainwindow.py index d23c7b3..620b000 100644 --- a/sface/mainwindow.py +++ b/sface/mainwindow.py @@ -1,4 +1,4 @@ -import os +import os, os.path import sys import time @@ -12,13 +12,22 @@ 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.isfile(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('/Users/parmentelat/git/sface/macos/graphic-sfa64.png') + pixmap = QPixmap(locate_image_file('graphic-sfa.png')) logolabel=QLabel("",self) logolabel.setPixmap(pixmap) self.main = QLabel("", self)