X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fmainwindow.py;h=19f05a9ebc1250c1223e6bdf5f3bfb5d19bece1e;hp=b85ce0dc0da966bbf1596f14434dd9fcf4cf0bc1;hb=6d695f75f8ada305d7d8c9f5e519ead6032ff097;hpb=a27d51684e4c3f10b721b6fd6b28711f26063da9 diff --git a/sface/mainwindow.py b/sface/mainwindow.py index b85ce0d..19f05a9 100644 --- a/sface/mainwindow.py +++ b/sface/mainwindow.py @@ -13,11 +13,12 @@ from sface.screens.mainscreen import MainScreen from sface.screens.helpscreen import HelpScreen # depending on the platform.. +# could probably use Qt's resource system but looks overkill for just one file... def locate_image_file (filename): - for dir in [ '/usr/share' ] : + for dir in [ '/usr/share', '/Applications/sface.app/Contents/Resources/sface' ] : for suffix in ['png','jpg']: attempt=os.path.join(dir,'images',"%s.%s"%(filename,suffix)) - if os.path.is_file(attempt) : return attempt + if os.path.isfile(attempt) : return attempt return os.path.join('/could/not/locate/image/file',filename) @@ -27,7 +28,7 @@ class Nav(QWidget): self.title = QLabel("", self) scene=QGraphicsScene() - pixmap = QPixmap(locate_image_file('graphic-sfa.png')) + pixmap = QPixmap(locate_image_file('graphic-sfa')) logolabel=QLabel("",self) logolabel.setPixmap(pixmap) self.main = QLabel("", self)