3 class DialogEdit( QDialog ) :
5 def __init__( self, helpFile, controller, widgetDialogBox ) :
8 # Initializing parent widget
9 QDialog.__init__( self )
12 self.setObjectName( "Dialog" )
13 self.setWindowTitle( "Dialog data" )
14 self._helpFile = helpFile
15 self._controller = controller
16 self._widgetDialogBox = widgetDialogBox
19 self.mainLayout = QVBoxLayout( self )
20 self.h1 = QHBoxLayout( self )
21 self.h2 = QHBoxLayout( self )
22 self.mainLayout.addLayout( self.h1 )
23 self.mainLayout.addLayout( self.h2 )
24 self.v11 = QVBoxLayout( self)
25 self.v12 = QVBoxLayout( self )
26 self.h1.addLayout( self.v11 )
27 self.h1.addLayout( self.v12 )
29 # Filling layouts with standard widgets( common to all childre )
30 self.fillStandardWidgets()
31 # Adding special widgets to layouts( special to each child )
32 self.addSpecialWidgets()
34 # Connecting widgets to slots
38 def getController( self ) :
39 return self._controller
41 def fillStandardWidgets( self ) :
44 self.bOk = QPushButton( "OK", self )
45 self.h2.addWidget( self.bOk )
46 self.bCancel = QPushButton( "Cancel", self )
47 self.h2.addWidget( self.bCancel )
48 self.bHelp = QPushButton( "Help", self )
49 self.h2.addWidget( self.bHelp )
52 def addSpecialWidgets( self ) :
53 print('Virtual method')
56 def connectSlots( self ) :
57 self.bOk.clicked.connect(self.apply)
58 self.bHelp.clicked.connect(self.help)
59 self.bCancel.clicked.connect(self.close)
63 self.retrieveUserEntries()
64 if not self.checkUserEntries() :
65 QMessageBox.warning( self, 'information faillure', self.errMessage )
71 def retrieveUserEntries( self ) :
72 print('Virtual method')
75 def checkUserEntries( self ) :
76 print('Virtual method')
79 def execApply( self ) :
80 print('Virtual method')
85 os.system( 'firefox ' + self._helpFile + '&' )
89 self._widgetDialogBox.close()