E5Gui/E5ToolBarDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3190
a9a94491c4fd
child 3539
0c2dc1446ebf
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
78 self.__restoreDefaultsButton = \ 78 self.__restoreDefaultsButton = \
79 self.buttonBox.button(QDialogButtonBox.RestoreDefaults) 79 self.buttonBox.button(QDialogButtonBox.RestoreDefaults)
80 self.__resetButton = self.buttonBox.button(QDialogButtonBox.Reset) 80 self.__resetButton = self.buttonBox.button(QDialogButtonBox.Reset)
81 81
82 self.actionsTree.header().hide() 82 self.actionsTree.header().hide()
83 self.__separatorText = self.trUtf8("--Separator--") 83 self.__separatorText = self.tr("--Separator--")
84 itm = QTreeWidgetItem(self.actionsTree, [self.__separatorText]) 84 itm = QTreeWidgetItem(self.actionsTree, [self.__separatorText])
85 self.actionsTree.setCurrentItem(itm) 85 self.actionsTree.setCurrentItem(itm)
86 86
87 for category in sorted(self.__manager.categories()): 87 for category in sorted(self.__manager.categories()):
88 categoryItem = QTreeWidgetItem(self.actionsTree, [category]) 88 categoryItem = QTreeWidgetItem(self.actionsTree, [category])
133 """ 133 """
134 Private slot to create a new toolbar. 134 Private slot to create a new toolbar.
135 """ 135 """
136 name, ok = QInputDialog.getText( 136 name, ok = QInputDialog.getText(
137 self, 137 self,
138 self.trUtf8("New Toolbar"), 138 self.tr("New Toolbar"),
139 self.trUtf8("Toolbar Name:"), 139 self.tr("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( 144 E5MessageBox.critical(
145 self, 145 self,
146 self.trUtf8("New Toolbar"), 146 self.tr("New Toolbar"),
147 self.trUtf8( 147 self.tr(
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
166 Private slot to remove a custom toolbar. 166 Private slot to remove a custom toolbar.
167 """ 167 """
168 name = self.toolbarComboBox.currentText() 168 name = self.toolbarComboBox.currentText()
169 res = E5MessageBox.yesNo( 169 res = E5MessageBox.yesNo(
170 self, 170 self,
171 self.trUtf8("Remove Toolbar"), 171 self.tr("Remove Toolbar"),
172 self.trUtf8( 172 self.tr(
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)
191 Private slot to rename a custom toolbar. 191 Private slot to rename a custom toolbar.
192 """ 192 """
193 oldName = self.toolbarComboBox.currentText() 193 oldName = self.toolbarComboBox.currentText()
194 newName, ok = QInputDialog.getText( 194 newName, ok = QInputDialog.getText(
195 self, 195 self,
196 self.trUtf8("Rename Toolbar"), 196 self.tr("Rename Toolbar"),
197 self.trUtf8("New Toolbar Name:"), 197 self.tr("New Toolbar Name:"),
198 QLineEdit.Normal, 198 QLineEdit.Normal,
199 oldName) 199 oldName)
200 if ok and newName: 200 if ok and newName:
201 if oldName == newName: 201 if oldName == newName:
202 return 202 return
203 if self.toolbarComboBox.findText(newName) != -1: 203 if self.toolbarComboBox.findText(newName) != -1:
204 # toolbar with this name already exists 204 # toolbar with this name already exists
205 E5MessageBox.critical( 205 E5MessageBox.critical(
206 self, 206 self,
207 self.trUtf8("Rename Toolbar"), 207 self.tr("Rename Toolbar"),
208 self.trUtf8( 208 self.tr(
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()

eric ide

mercurial