Preferences/ToolGroupConfigurationDialog.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3020
542e97d4ecb3
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
56 Private slot to add a new entry. 56 Private slot to add a new entry.
57 """ 57 """
58 groupName = self.nameEdit.text() 58 groupName = self.nameEdit.text()
59 59
60 if not groupName: 60 if not groupName:
61 E5MessageBox.critical(self, 61 E5MessageBox.critical(
62 self,
62 self.trUtf8("Add tool group entry"), 63 self.trUtf8("Add tool group entry"),
63 self.trUtf8("You have to give a name for the group to add.")) 64 self.trUtf8("You have to give a name for the group to add."))
64 return 65 return
65 66
66 if len(self.groupsList.findItems( 67 if len(self.groupsList.findItems(
67 groupName, Qt.MatchFlags(Qt.MatchExactly))): 68 groupName, Qt.MatchFlags(Qt.MatchExactly))):
68 E5MessageBox.critical(self, 69 E5MessageBox.critical(
70 self,
69 self.trUtf8("Add tool group entry"), 71 self.trUtf8("Add tool group entry"),
70 self.trUtf8("An entry for the group name {0} already exists.")\ 72 self.trUtf8("An entry for the group name {0} already exists.")\
71 .format(groupName)) 73 .format(groupName))
72 return 74 return
73 75
84 return 86 return
85 87
86 groupName = self.nameEdit.text() 88 groupName = self.nameEdit.text()
87 89
88 if not groupName: 90 if not groupName:
89 E5MessageBox.critical(self, 91 E5MessageBox.critical(
92 self,
90 self.trUtf8("Add tool group entry"), 93 self.trUtf8("Add tool group entry"),
91 self.trUtf8("You have to give a name for the group to add.")) 94 self.trUtf8("You have to give a name for the group to add."))
92 return 95 return
93 96
94 if len(self.groupsList.findItems( 97 if len(self.groupsList.findItems(
95 groupName, Qt.MatchFlags(Qt.MatchExactly))): 98 groupName, Qt.MatchFlags(Qt.MatchExactly))):
96 E5MessageBox.critical(self, 99 E5MessageBox.critical(
100 self,
97 self.trUtf8("Add tool group entry"), 101 self.trUtf8("Add tool group entry"),
98 self.trUtf8("An entry for the group name {0} already exists.")\ 102 self.trUtf8("An entry for the group name {0} already exists.")\
99 .format(groupName)) 103 .format(groupName))
100 return 104 return
101 105
109 """ 113 """
110 row = self.groupsList.currentRow() 114 row = self.groupsList.currentRow()
111 if row < 0: 115 if row < 0:
112 return 116 return
113 117
114 res = E5MessageBox.yesNo(self, 118 res = E5MessageBox.yesNo(
119 self,
115 self.trUtf8("Delete tool group entry"), 120 self.trUtf8("Delete tool group entry"),
116 self.trUtf8("""<p>Do you really want to delete the tool group""" 121 self.trUtf8("""<p>Do you really want to delete the tool group"""
117 """ <b>"{0}"</b>?</p>""")\ 122 """ <b>"{0}"</b>?</p>""")\
118 .format(self.groupsList.currentItem().text()), 123 .format(self.groupsList.currentItem().text()),
119 icon=E5MessageBox.Warning) 124 icon=E5MessageBox.Warning)

eric ide

mercurial