improve keyboard error handling
[bitbake.git] / bin / commander / application.py
1 #!/usr/bin/env python
2 # -*- coding: iso8859-15 -*-
3
4 from commander.mainwindow import MainWindow
5 from qt import qApp, QTimer, QApplication, SIGNAL, SLOT
6
7 class CommanderApplication( QApplication ):
8     
9     def __init__( self, argv ):
10         QApplication.__init__( self, argv )
11
12     def initialize( self ):
13         self.mw = MainWindow()
14         self.mw.show()
15         self.setMainWidget( self.mw )
16     
17         QTimer.singleShot( 0, self.mw.buildRescanPackages )
18
19     def run( self ):
20         self.connect( self, SIGNAL( "lastWindowClosed()" ), self, SLOT( "quit()" ) )
21         print "--> exec_loop()"
22         self.exec_loop()
23         print "<-- exec_loop()"
24         
25 #------------------------------------------------------------------------#
26 # main
27 #------------------------------------------------------------------------#
28
29 if __name__ == "__main__":
30     import sys
31     from qt import *
32     app = CommanderApplication( sys.argv )
33     app.exec_loop()