Salome HOME
Mise à jour du template PythonComponent:
[tools/sat.git] / data / templates / PythonComponent / src / Dialog / RenameDialog.py
1 from DialogEdit import *
2 from qtsalome import *
3
4 class RenameDialog( DialogEdit ) :
5
6    def __init__( self, helpFile, controller, widgetDialogBox, model, oldName  ) :
7        """Constructor"""
8
9        # Initializing parent widget
10        DialogEdit.__init__( self, helpFile, controller, widgetDialogBox )
11
12        self._model = model
13        self.entryName.setText( oldName )
14        pass
15
16    def addSpecialWidgets( self ) :
17        lName = QLabel( "Name", self )
18        self.v11.addWidget( lName )
19        self.entryName = QLineEdit( self )
20        self.v12.addWidget( self.entryName )
21        pass
22
23    def execApply( self ) :
24        newName = self.newName
25        self.getController().editName( self._model, newName )
26        return
27
28    def retrieveUserEntries( self ) :
29        self.newName = str( self.entryName.text() )
30        pass
31
32    def checkUserEntries( self ) :
33        if self.newName == "" :
34           self.errMessage = 'All attributes must be filled'
35           return False
36        return True
37
38 pass