54 Private slot to add a new entry. |
54 Private slot to add a new entry. |
55 """ |
55 """ |
56 groupName = self.nameEdit.text() |
56 groupName = self.nameEdit.text() |
57 |
57 |
58 if not groupName: |
58 if not groupName: |
59 E5MessageBox.critical(self, |
59 E5MessageBox.critical( |
|
60 self, |
60 self.trUtf8("Add tool group entry"), |
61 self.trUtf8("Add tool group entry"), |
61 self.trUtf8("You have to give a name for the group to add.")) |
62 self.trUtf8("You have to give a name for the group to add.")) |
62 return |
63 return |
63 |
64 |
64 if len(self.groupsList.findItems( |
65 if len(self.groupsList.findItems( |
65 groupName, Qt.MatchFlags(Qt.MatchExactly))): |
66 groupName, Qt.MatchFlags(Qt.MatchExactly))): |
66 E5MessageBox.critical(self, |
67 E5MessageBox.critical( |
|
68 self, |
67 self.trUtf8("Add tool group entry"), |
69 self.trUtf8("Add tool group entry"), |
68 self.trUtf8("An entry for the group name {0} already exists.")\ |
70 self.trUtf8("An entry for the group name {0} already exists.")\ |
69 .format(groupName)) |
71 .format(groupName)) |
70 return |
72 return |
71 |
73 |
82 return |
84 return |
83 |
85 |
84 groupName = self.nameEdit.text() |
86 groupName = self.nameEdit.text() |
85 |
87 |
86 if not groupName: |
88 if not groupName: |
87 E5MessageBox.critical(self, |
89 E5MessageBox.critical( |
|
90 self, |
88 self.trUtf8("Add tool group entry"), |
91 self.trUtf8("Add tool group entry"), |
89 self.trUtf8("You have to give a name for the group to add.")) |
92 self.trUtf8("You have to give a name for the group to add.")) |
90 return |
93 return |
91 |
94 |
92 if len(self.groupsList.findItems( |
95 if len(self.groupsList.findItems( |
93 groupName, Qt.MatchFlags(Qt.MatchExactly))): |
96 groupName, Qt.MatchFlags(Qt.MatchExactly))): |
94 E5MessageBox.critical(self, |
97 E5MessageBox.critical( |
|
98 self, |
95 self.trUtf8("Add tool group entry"), |
99 self.trUtf8("Add tool group entry"), |
96 self.trUtf8("An entry for the group name {0} already exists.")\ |
100 self.trUtf8("An entry for the group name {0} already exists.")\ |
97 .format(groupName)) |
101 .format(groupName)) |
98 return |
102 return |
99 |
103 |
107 """ |
111 """ |
108 row = self.groupsList.currentRow() |
112 row = self.groupsList.currentRow() |
109 if row < 0: |
113 if row < 0: |
110 return |
114 return |
111 |
115 |
112 res = E5MessageBox.yesNo(self, |
116 res = E5MessageBox.yesNo( |
|
117 self, |
113 self.trUtf8("Delete tool group entry"), |
118 self.trUtf8("Delete tool group entry"), |
114 self.trUtf8("""<p>Do you really want to delete the tool group""" |
119 self.trUtf8("""<p>Do you really want to delete the tool group""" |
115 """ <b>"{0}"</b>?</p>""")\ |
120 """ <b>"{0}"</b>?</p>""")\ |
116 .format(self.groupsList.currentItem().text()), |
121 .format(self.groupsList.currentItem().text()), |
117 icon=E5MessageBox.Warning) |
122 icon=E5MessageBox.Warning) |