Preferences/ToolGroupConfigurationDialog.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
13 from PyQt4.QtGui import * 13 from PyQt4.QtGui import *
14 14
15 from E5Gui import E5MessageBox 15 from E5Gui import E5MessageBox
16 16
17 from .Ui_ToolGroupConfigurationDialog import Ui_ToolGroupConfigurationDialog 17 from .Ui_ToolGroupConfigurationDialog import Ui_ToolGroupConfigurationDialog
18
18 19
19 class ToolGroupConfigurationDialog(QDialog, Ui_ToolGroupConfigurationDialog): 20 class ToolGroupConfigurationDialog(QDialog, Ui_ToolGroupConfigurationDialog):
20 """ 21 """
21 Class implementing a configuration dialog for the tool groups. 22 Class implementing a configuration dialog for the tool groups.
22 """ 23 """
23 def __init__(self, toolGroups, currentGroup, parent = None): 24 def __init__(self, toolGroups, currentGroup, parent=None):
24 """ 25 """
25 Constructor 26 Constructor
26 27
27 @param toolGroups list of configured tool groups 28 @param toolGroups list of configured tool groups
28 @param currentGroup number of the active group (integer) 29 @param currentGroup number of the active group (integer)
109 res = E5MessageBox.yesNo(self, 110 res = E5MessageBox.yesNo(self,
110 self.trUtf8("Delete tool group entry"), 111 self.trUtf8("Delete tool group entry"),
111 self.trUtf8("""<p>Do you really want to delete the tool group""" 112 self.trUtf8("""<p>Do you really want to delete the tool group"""
112 """ <b>"{0}"</b>?</p>""")\ 113 """ <b>"{0}"</b>?</p>""")\
113 .format(self.groupsList.currentItem().text()), 114 .format(self.groupsList.currentItem().text()),
114 icon = E5MessageBox.Warning) 115 icon=E5MessageBox.Warning)
115 if not res: 116 if not res:
116 return 117 return
117 118
118 if row == self.currentGroup: 119 if row == self.currentGroup:
119 # set to default group if current group gets deleted 120 # set to default group if current group gets deleted
186 self.deleteButton.setEnabled(False) 187 self.deleteButton.setEnabled(False)
187 self.changeButton.setEnabled(False) 188 self.changeButton.setEnabled(False)
188 189
189 def getToolGroups(self): 190 def getToolGroups(self):
190 """ 191 """
191 Public method to retrieve the tool groups. 192 Public method to retrieve the tool groups.
192 193
193 @return a list of lists containing the group name and the 194 @return a list of lists containing the group name and the
194 tool group entries 195 tool group entries
195 """ 196 """
196 return self.toolGroups[:], self.currentGroup 197 return self.toolGroups[:], self.currentGroup

eric ide

mercurial