1 from PyQt4.QtGui import *
2 from PyQt4.QtCore import *
4 class DialogEdit( QDialog ) :
6 def __init__( self, helpFile, controller, widgetDialogBox ) :
9 # Initializing parent widget
10 QDialog.__init__( self )
13 self.setObjectName( "Dialog" )
14 self.setWindowTitle( "Dialog data" )
15 self._helpFile = helpFile
16 self._controller = controller
17 self._widgetDialogBox = widgetDialogBox
20 self.mainLayout = QVBoxLayout( self )
21 self.h1 = QHBoxLayout( self )
22 self.h2 = QHBoxLayout( self )
23 self.mainLayout.addLayout( self.h1 )
24 self.mainLayout.addLayout( self.h2 )
25 self.v11 = QVBoxLayout( self)
26 self.v12 = QVBoxLayout( self )
27 self.h1.addLayout( self.v11 )
28 self.h1.addLayout( self.v12 )
30 # Filling layouts with standard widgets( common to all childre )
31 self.fillStandardWidgets()
32 # Adding special widgets to layouts( special to each child )
33 self.addSpecialWidgets()
35 # Connecting widgets to slots
39 def getController( self ) :
40 return self._controller
42 def fillStandardWidgets( self ) :
45 self.bOk = QPushButton( "OK", self )
46 self.h2.addWidget( self.bOk )
47 self.bCancel = QPushButton( "Cancel", self )
48 self.h2.addWidget( self.bCancel )
49 self.bHelp = QPushButton( "Help", self )
50 self.h2.addWidget( self.bHelp )
53 def addSpecialWidgets( self ) :
54 print 'Virtual method'
57 def connectSlots( self ) :
58 self.connect( self.bOk, SIGNAL( 'clicked()' ), self.apply )
59 self.connect( self.bHelp, SIGNAL( 'clicked()' ), self.help )
60 self.connect( self.bCancel, SIGNAL( 'clicked()' ), self.close )
64 self.retrieveUserEntries()
65 if not self.checkUserEntries() :
66 QMessageBox.warning( self, 'information faillure', self.errMessage )
72 def retrieveUserEntries( self ) :
73 print 'Virtual method'
76 def checkUserEntries( self ) :
77 print 'Virtual method'
80 def execApply( self ) :
81 print 'Virtual method'
86 os.system( 'firefox ' + self._helpFile + '&' )
90 self._widgetDialogBox.close()