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