145 self, |
145 self, |
146 self.trUtf8("New Toolbar"), |
146 self.trUtf8("New Toolbar"), |
147 self.trUtf8( |
147 self.trUtf8( |
148 """A toolbar with the name <b>{0}</b> already""" |
148 """A toolbar with the name <b>{0}</b> already""" |
149 """ exists.""") |
149 """ exists.""") |
150 .format(name)) |
150 .format(name)) |
151 return |
151 return |
152 |
152 |
153 tbItem = E5ToolBarItem(None, [], False) |
153 tbItem = E5ToolBarItem(None, [], False) |
154 tbItem.title = name |
154 tbItem.title = name |
155 tbItem.isChanged = True |
155 tbItem.isChanged = True |
169 res = E5MessageBox.yesNo( |
169 res = E5MessageBox.yesNo( |
170 self, |
170 self, |
171 self.trUtf8("Remove Toolbar"), |
171 self.trUtf8("Remove Toolbar"), |
172 self.trUtf8( |
172 self.trUtf8( |
173 """Should the toolbar <b>{0}</b> really be removed?""") |
173 """Should the toolbar <b>{0}</b> really be removed?""") |
174 .format(name)) |
174 .format(name)) |
175 if res: |
175 if res: |
176 index = self.toolbarComboBox.currentIndex() |
176 index = self.toolbarComboBox.currentIndex() |
177 tbItemID = self.toolbarComboBox.itemData(index) |
177 tbItemID = self.toolbarComboBox.itemData(index) |
178 tbItem = self.__toolbarItems[tbItemID] |
178 tbItem = self.__toolbarItems[tbItemID] |
179 if tbItem.toolBarId is not None and \ |
179 if tbItem.toolBarId is not None and \ |
206 self, |
206 self, |
207 self.trUtf8("Rename Toolbar"), |
207 self.trUtf8("Rename Toolbar"), |
208 self.trUtf8( |
208 self.trUtf8( |
209 """A toolbar with the name <b>{0}</b> already""" |
209 """A toolbar with the name <b>{0}</b> already""" |
210 """ exists.""") |
210 """ exists.""") |
211 .format(newName)) |
211 .format(newName)) |
212 return |
212 return |
213 index = self.toolbarComboBox.currentIndex() |
213 index = self.toolbarComboBox.currentIndex() |
214 self.toolbarComboBox.setItemText(index, newName) |
214 self.toolbarComboBox.setItemText(index, newName) |
215 tbItem = \ |
215 tbItem = \ |
216 self.__toolbarItems[self.toolbarComboBox.itemData(index)] |
216 self.__toolbarItems[self.toolbarComboBox.itemData(index)] |
356 if self.actionsTree.currentItem().text(0) == self.__separatorText: |
356 if self.actionsTree.currentItem().text(0) == self.__separatorText: |
357 item.setText(self.__separatorText) |
357 item.setText(self.__separatorText) |
358 actionID = None |
358 actionID = None |
359 else: |
359 else: |
360 actionID = self.actionsTree.currentItem()\ |
360 actionID = self.actionsTree.currentItem()\ |
361 .data(0, E5ToolBarDialog.ActionIdRole) |
361 .data(0, E5ToolBarDialog.ActionIdRole) |
362 action = self.__manager.actionById(actionID) |
362 action = self.__manager.actionById(actionID) |
363 item.setText(action.text()) |
363 item.setText(action.text()) |
364 item.setIcon(action.icon()) |
364 item.setIcon(action.icon()) |
365 item.setTextAlignment(Qt.AlignLeft | Qt.AlignVCenter) |
365 item.setTextAlignment(Qt.AlignLeft | Qt.AlignVCenter) |
366 item.setData(E5ToolBarDialog.ActionIdRole, int(id(action))) |
366 item.setData(E5ToolBarDialog.ActionIdRole, int(id(action))) |