Preferences/ToolGroupConfigurationDialog.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3484
645c12de6b0c
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
56 groupName = self.nameEdit.text() 56 groupName = self.nameEdit.text()
57 57
58 if not groupName: 58 if not groupName:
59 E5MessageBox.critical( 59 E5MessageBox.critical(
60 self, 60 self,
61 self.trUtf8("Add tool group entry"), 61 self.tr("Add tool group entry"),
62 self.trUtf8("You have to give a name for the group to add.")) 62 self.tr("You have to give a name for the group to add."))
63 return 63 return
64 64
65 if len(self.groupsList.findItems( 65 if len(self.groupsList.findItems(
66 groupName, Qt.MatchFlags(Qt.MatchExactly))): 66 groupName, Qt.MatchFlags(Qt.MatchExactly))):
67 E5MessageBox.critical( 67 E5MessageBox.critical(
68 self, 68 self,
69 self.trUtf8("Add tool group entry"), 69 self.tr("Add tool group entry"),
70 self.trUtf8("An entry for the group name {0} already exists.") 70 self.tr("An entry for the group name {0} already exists.")
71 .format(groupName)) 71 .format(groupName))
72 return 72 return
73 73
74 self.groupsList.addItem(groupName) 74 self.groupsList.addItem(groupName)
75 self.toolGroups.append([groupName, []]) 75 self.toolGroups.append([groupName, []])
86 groupName = self.nameEdit.text() 86 groupName = self.nameEdit.text()
87 87
88 if not groupName: 88 if not groupName:
89 E5MessageBox.critical( 89 E5MessageBox.critical(
90 self, 90 self,
91 self.trUtf8("Add tool group entry"), 91 self.tr("Add tool group entry"),
92 self.trUtf8("You have to give a name for the group to add.")) 92 self.tr("You have to give a name for the group to add."))
93 return 93 return
94 94
95 if len(self.groupsList.findItems( 95 if len(self.groupsList.findItems(
96 groupName, Qt.MatchFlags(Qt.MatchExactly))): 96 groupName, Qt.MatchFlags(Qt.MatchExactly))):
97 E5MessageBox.critical( 97 E5MessageBox.critical(
98 self, 98 self,
99 self.trUtf8("Add tool group entry"), 99 self.tr("Add tool group entry"),
100 self.trUtf8("An entry for the group name {0} already exists.") 100 self.tr("An entry for the group name {0} already exists.")
101 .format(groupName)) 101 .format(groupName))
102 return 102 return
103 103
104 self.toolGroups[row][0] = groupName 104 self.toolGroups[row][0] = groupName
105 self.groupsList.currentItem().setText(groupName) 105 self.groupsList.currentItem().setText(groupName)
113 if row < 0: 113 if row < 0:
114 return 114 return
115 115
116 res = E5MessageBox.yesNo( 116 res = E5MessageBox.yesNo(
117 self, 117 self,
118 self.trUtf8("Delete tool group entry"), 118 self.tr("Delete tool group entry"),
119 self.trUtf8("""<p>Do you really want to delete the tool group""" 119 self.tr("""<p>Do you really want to delete the tool group"""
120 """ <b>"{0}"</b>?</p>""") 120 """ <b>"{0}"</b>?</p>""")
121 .format(self.groupsList.currentItem().text()), 121 .format(self.groupsList.currentItem().text()),
122 icon=E5MessageBox.Warning) 122 icon=E5MessageBox.Warning)
123 if not res: 123 if not res:
124 return 124 return
125 125

eric ide

mercurial