Preferences/ToolGroupConfigurationDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3190
a9a94491c4fd
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
58 groupName = self.nameEdit.text() 58 groupName = self.nameEdit.text()
59 59
60 if not groupName: 60 if not groupName:
61 E5MessageBox.critical( 61 E5MessageBox.critical(
62 self, 62 self,
63 self.trUtf8("Add tool group entry"), 63 self.tr("Add tool group entry"),
64 self.trUtf8("You have to give a name for the group to add.")) 64 self.tr("You have to give a name for the group to add."))
65 return 65 return
66 66
67 if len(self.groupsList.findItems( 67 if len(self.groupsList.findItems(
68 groupName, Qt.MatchFlags(Qt.MatchExactly))): 68 groupName, Qt.MatchFlags(Qt.MatchExactly))):
69 E5MessageBox.critical( 69 E5MessageBox.critical(
70 self, 70 self,
71 self.trUtf8("Add tool group entry"), 71 self.tr("Add tool group entry"),
72 self.trUtf8("An entry for the group name {0} already exists.") 72 self.tr("An entry for the group name {0} already exists.")
73 .format(groupName)) 73 .format(groupName))
74 return 74 return
75 75
76 self.groupsList.addItem(groupName) 76 self.groupsList.addItem(groupName)
77 self.toolGroups.append([groupName, []]) 77 self.toolGroups.append([groupName, []])
88 groupName = self.nameEdit.text() 88 groupName = self.nameEdit.text()
89 89
90 if not groupName: 90 if not groupName:
91 E5MessageBox.critical( 91 E5MessageBox.critical(
92 self, 92 self,
93 self.trUtf8("Add tool group entry"), 93 self.tr("Add tool group entry"),
94 self.trUtf8("You have to give a name for the group to add.")) 94 self.tr("You have to give a name for the group to add."))
95 return 95 return
96 96
97 if len(self.groupsList.findItems( 97 if len(self.groupsList.findItems(
98 groupName, Qt.MatchFlags(Qt.MatchExactly))): 98 groupName, Qt.MatchFlags(Qt.MatchExactly))):
99 E5MessageBox.critical( 99 E5MessageBox.critical(
100 self, 100 self,
101 self.trUtf8("Add tool group entry"), 101 self.tr("Add tool group entry"),
102 self.trUtf8("An entry for the group name {0} already exists.") 102 self.tr("An entry for the group name {0} already exists.")
103 .format(groupName)) 103 .format(groupName))
104 return 104 return
105 105
106 self.toolGroups[row][0] = groupName 106 self.toolGroups[row][0] = groupName
107 self.groupsList.currentItem().setText(groupName) 107 self.groupsList.currentItem().setText(groupName)
115 if row < 0: 115 if row < 0:
116 return 116 return
117 117
118 res = E5MessageBox.yesNo( 118 res = E5MessageBox.yesNo(
119 self, 119 self,
120 self.trUtf8("Delete tool group entry"), 120 self.tr("Delete tool group entry"),
121 self.trUtf8("""<p>Do you really want to delete the tool group""" 121 self.tr("""<p>Do you really want to delete the tool group"""
122 """ <b>"{0}"</b>?</p>""") 122 """ <b>"{0}"</b>?</p>""")
123 .format(self.groupsList.currentItem().text()), 123 .format(self.groupsList.currentItem().text()),
124 icon=E5MessageBox.Warning) 124 icon=E5MessageBox.Warning)
125 if not res: 125 if not res:
126 return 126 return
127 127

eric ide

mercurial