139 self.trUtf8("Toolbar Name:"), |
139 self.trUtf8("Toolbar Name:"), |
140 QLineEdit.Normal) |
140 QLineEdit.Normal) |
141 if ok and name: |
141 if ok and name: |
142 if self.toolbarComboBox.findText(name) != -1: |
142 if self.toolbarComboBox.findText(name) != -1: |
143 # toolbar with this name already exists |
143 # toolbar with this name already exists |
144 E5MessageBox.critical(self, |
144 E5MessageBox.critical( |
145 self.trUtf8("New Toolbar"), |
145 self, |
146 self.trUtf8( |
146 self.trUtf8("New Toolbar"), |
147 """A toolbar with the name <b>{0}</b> already exists.""") |
147 self.trUtf8( |
148 .format(name)) |
148 """A toolbar with the name <b>{0}</b> already""" |
|
149 """ exists.""") |
|
150 .format(name)) |
149 return |
151 return |
150 |
152 |
151 tbItem = E5ToolBarItem(None, [], False) |
153 tbItem = E5ToolBarItem(None, [], False) |
152 tbItem.title = name |
154 tbItem.title = name |
153 tbItem.isChanged = True |
155 tbItem.isChanged = True |
162 def on_removeButton_clicked(self): |
164 def on_removeButton_clicked(self): |
163 """ |
165 """ |
164 Private slot to remove a custom toolbar. |
166 Private slot to remove a custom toolbar. |
165 """ |
167 """ |
166 name = self.toolbarComboBox.currentText() |
168 name = self.toolbarComboBox.currentText() |
167 res = E5MessageBox.yesNo(self, |
169 res = E5MessageBox.yesNo( |
|
170 self, |
168 self.trUtf8("Remove Toolbar"), |
171 self.trUtf8("Remove Toolbar"), |
169 self.trUtf8( |
172 self.trUtf8( |
170 """Should the toolbar <b>{0}</b> really be removed?""") |
173 """Should the toolbar <b>{0}</b> really be removed?""") |
171 .format(name)) |
174 .format(name)) |
172 if res: |
175 if res: |
197 if ok and newName: |
200 if ok and newName: |
198 if oldName == newName: |
201 if oldName == newName: |
199 return |
202 return |
200 if self.toolbarComboBox.findText(newName) != -1: |
203 if self.toolbarComboBox.findText(newName) != -1: |
201 # toolbar with this name already exists |
204 # toolbar with this name already exists |
202 E5MessageBox.critical(self, |
205 E5MessageBox.critical( |
203 self.trUtf8("Rename Toolbar"), |
206 self, |
204 self.trUtf8( |
207 self.trUtf8("Rename Toolbar"), |
205 """A toolbar with the name <b>{0}</b> already exists.""") |
208 self.trUtf8( |
206 .format(newName)) |
209 """A toolbar with the name <b>{0}</b> already""" |
|
210 """ exists.""") |
|
211 .format(newName)) |
207 return |
212 return |
208 index = self.toolbarComboBox.currentIndex() |
213 index = self.toolbarComboBox.currentIndex() |
209 self.toolbarComboBox.setItemText(index, newName) |
214 self.toolbarComboBox.setItemText(index, newName) |
210 tbItem = \ |
215 tbItem = \ |
211 self.__toolbarItems[self.toolbarComboBox.itemData(index)] |
216 self.__toolbarItems[self.toolbarComboBox.itemData(index)] |