refactoring
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>
Wed, 18 Feb 2004 22:45:50 +0000 (22:45 +0000)
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>
Wed, 18 Feb 2004 22:45:50 +0000 (22:45 +0000)
bin/oecommander

index 86191bc..8042880 100644 (file)
@@ -14,7 +14,7 @@ def fail( reason ):
     sys.exit( -1 )
 
 #
-# sanity check PyQt
+# sanity check Qt and PyQt
 #
 
 try:
@@ -29,20 +29,21 @@ except NameError:
     fail( "PyQt Version %s is too old. Please upgrade to PyQt 3.10 or later." % PYQT_VERSION )
 
 major, minor = PYQT_VERSION_STR.split( '.' )
-if major < 3 or ( major == 3 and minor < 10 ):
+if int(major) < 3 or ( int(major) == 3 and int(minor) < 10 ):
     fail( "PyQt Version %s is too old. Please upgrade to PyQt 3.10 or later." % PYQT_VERSION_STR )
 
 import sys
-from commander.mainwindow import MainWindow
+try:
+    from commander.mainwindow import MainWindow
+except ImportError:
+    fail( "Error: Can't load GUI parts. Did you 'qmake commander.pro && make' in $OEDIR/commander/?" )
 from qt import *
 
 #------------------------------------------------------------------------#
 # main
 #------------------------------------------------------------------------#
 
-app = QApplication( sys.argv )
-mw = MainWindow()
-mw.show()
-app.setMainWidget( mw )
-app.exec_loop()
-
+from commander.application import CommanderApplication
+app = CommanderApplication( sys.argv )
+app.initialize()
+app.run()