76 self.__restoreDefaultsButton = \ |
76 self.__restoreDefaultsButton = \ |
77 self.buttonBox.button(QDialogButtonBox.RestoreDefaults) |
77 self.buttonBox.button(QDialogButtonBox.RestoreDefaults) |
78 self.__resetButton = self.buttonBox.button(QDialogButtonBox.Reset) |
78 self.__resetButton = self.buttonBox.button(QDialogButtonBox.Reset) |
79 |
79 |
80 self.actionsTree.header().hide() |
80 self.actionsTree.header().hide() |
81 self.__separatorText = self.trUtf8("--Separator--") |
81 self.__separatorText = self.tr("--Separator--") |
82 itm = QTreeWidgetItem(self.actionsTree, [self.__separatorText]) |
82 itm = QTreeWidgetItem(self.actionsTree, [self.__separatorText]) |
83 self.actionsTree.setCurrentItem(itm) |
83 self.actionsTree.setCurrentItem(itm) |
84 |
84 |
85 for category in sorted(self.__manager.categories()): |
85 for category in sorted(self.__manager.categories()): |
86 categoryItem = QTreeWidgetItem(self.actionsTree, [category]) |
86 categoryItem = QTreeWidgetItem(self.actionsTree, [category]) |
131 """ |
131 """ |
132 Private slot to create a new toolbar. |
132 Private slot to create a new toolbar. |
133 """ |
133 """ |
134 name, ok = QInputDialog.getText( |
134 name, ok = QInputDialog.getText( |
135 self, |
135 self, |
136 self.trUtf8("New Toolbar"), |
136 self.tr("New Toolbar"), |
137 self.trUtf8("Toolbar Name:"), |
137 self.tr("Toolbar Name:"), |
138 QLineEdit.Normal) |
138 QLineEdit.Normal) |
139 if ok and name: |
139 if ok and name: |
140 if self.toolbarComboBox.findText(name) != -1: |
140 if self.toolbarComboBox.findText(name) != -1: |
141 # toolbar with this name already exists |
141 # toolbar with this name already exists |
142 E5MessageBox.critical( |
142 E5MessageBox.critical( |
143 self, |
143 self, |
144 self.trUtf8("New Toolbar"), |
144 self.tr("New Toolbar"), |
145 self.trUtf8( |
145 self.tr( |
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 |
164 Private slot to remove a custom toolbar. |
164 Private slot to remove a custom toolbar. |
165 """ |
165 """ |
166 name = self.toolbarComboBox.currentText() |
166 name = self.toolbarComboBox.currentText() |
167 res = E5MessageBox.yesNo( |
167 res = E5MessageBox.yesNo( |
168 self, |
168 self, |
169 self.trUtf8("Remove Toolbar"), |
169 self.tr("Remove Toolbar"), |
170 self.trUtf8( |
170 self.tr( |
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) |
189 Private slot to rename a custom toolbar. |
189 Private slot to rename a custom toolbar. |
190 """ |
190 """ |
191 oldName = self.toolbarComboBox.currentText() |
191 oldName = self.toolbarComboBox.currentText() |
192 newName, ok = QInputDialog.getText( |
192 newName, ok = QInputDialog.getText( |
193 self, |
193 self, |
194 self.trUtf8("Rename Toolbar"), |
194 self.tr("Rename Toolbar"), |
195 self.trUtf8("New Toolbar Name:"), |
195 self.tr("New Toolbar Name:"), |
196 QLineEdit.Normal, |
196 QLineEdit.Normal, |
197 oldName) |
197 oldName) |
198 if ok and newName: |
198 if ok and newName: |
199 if oldName == newName: |
199 if oldName == newName: |
200 return |
200 return |
201 if self.toolbarComboBox.findText(newName) != -1: |
201 if self.toolbarComboBox.findText(newName) != -1: |
202 # toolbar with this name already exists |
202 # toolbar with this name already exists |
203 E5MessageBox.critical( |
203 E5MessageBox.critical( |
204 self, |
204 self, |
205 self.trUtf8("Rename Toolbar"), |
205 self.tr("Rename Toolbar"), |
206 self.trUtf8( |
206 self.tr( |
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() |