258 be performed (boolean) |
258 be performed (boolean) |
259 @param objectType type of the object (string). |
259 @param objectType type of the object (string). |
260 """ |
260 """ |
261 if not noCheck and \ |
261 if not noCheck and \ |
262 (not self.__checkShortcut( |
262 (not self.__checkShortcut( |
263 keysequence, objectType, self.__editTopItem) or \ |
263 keysequence, objectType, self.__editTopItem) or |
264 not self.__checkShortcut( |
264 not self.__checkShortcut( |
265 altKeysequence, objectType, self.__editTopItem)): |
265 altKeysequence, objectType, self.__editTopItem)): |
266 return |
266 return |
267 |
267 |
268 self.shortcutsList.currentItem().setText(1, keysequence.toString()) |
268 self.shortcutsList.currentItem().setText(1, keysequence.toString()) |
269 self.shortcutsList.currentItem().setText(2, altKeysequence.toString()) |
269 self.shortcutsList.currentItem().setText(2, altKeysequence.toString()) |
270 |
270 |
315 self.trUtf8("Edit shortcuts"), |
315 self.trUtf8("Edit shortcuts"), |
316 self.trUtf8( |
316 self.trUtf8( |
317 """<p><b>{0}</b> has already been""" |
317 """<p><b>{0}</b> has already been""" |
318 """ allocated to the <b>{1}</b> action. """ |
318 """ allocated to the <b>{1}</b> action. """ |
319 """Remove this binding?</p>""") |
319 """Remove this binding?</p>""") |
320 .format(keystr, itm.text(0)), |
320 .format(keystr, itm.text(0)), |
321 icon=E5MessageBox.Warning) |
321 icon=E5MessageBox.Warning) |
322 if res: |
322 if res: |
323 itm.setText(col, "") |
323 itm.setText(col, "") |
324 return True |
324 return True |
325 else: |
325 else: |
334 self, |
334 self, |
335 self.trUtf8("Edit shortcuts"), |
335 self.trUtf8("Edit shortcuts"), |
336 self.trUtf8( |
336 self.trUtf8( |
337 """<p><b>{0}</b> hides the <b>{1}</b>""" |
337 """<p><b>{0}</b> hides the <b>{1}</b>""" |
338 """ action. Remove this binding?</p>""") |
338 """ action. Remove this binding?</p>""") |
339 .format(keystr, itm.text(0)), |
339 .format(keystr, itm.text(0)), |
340 icon=E5MessageBox.Warning) |
340 icon=E5MessageBox.Warning) |
341 if res: |
341 if res: |
342 itm.setText(col, "") |
342 itm.setText(col, "") |
343 return True |
343 return True |
344 else: |
344 else: |
352 self.trUtf8("Edit shortcuts"), |
352 self.trUtf8("Edit shortcuts"), |
353 self.trUtf8( |
353 self.trUtf8( |
354 """<p><b>{0}</b> is hidden by the """ |
354 """<p><b>{0}</b> is hidden by the """ |
355 """<b>{1}</b> action. """ |
355 """<b>{1}</b> action. """ |
356 """Remove this binding?</p>""") |
356 """Remove this binding?</p>""") |
357 .format(keystr, itm.text(0)), |
357 .format(keystr, itm.text(0)), |
358 icon=E5MessageBox.Warning) |
358 icon=E5MessageBox.Warning) |
359 if res: |
359 if res: |
360 itm.setText(col, "") |
360 itm.setText(col, "") |
361 return True |
361 return True |
362 else: |
362 else: |
449 for topIndex in range(self.shortcutsList.topLevelItemCount()): |
449 for topIndex in range(self.shortcutsList.topLevelItemCount()): |
450 topItem = self.shortcutsList.topLevelItem(topIndex) |
450 topItem = self.shortcutsList.topLevelItem(topIndex) |
451 childHiddenCount = 0 |
451 childHiddenCount = 0 |
452 for index in range(topItem.childCount()): |
452 for index in range(topItem.childCount()): |
453 itm = topItem.child(index) |
453 itm = topItem.child(index) |
454 if (self.actionButton.isChecked() and \ |
454 if (self.actionButton.isChecked() and |
455 not QRegExp(txt, Qt.CaseInsensitive).indexIn(itm.text(0)) > |
455 not QRegExp(txt, Qt.CaseInsensitive).indexIn(itm.text(0)) > |
456 -1) or \ |
456 -1) or \ |
457 (self.shortcutButton.isChecked() and \ |
457 (self.shortcutButton.isChecked() and |
458 not txt.lower() in itm.text(1).lower() and \ |
458 not txt.lower() in itm.text(1).lower() and |
459 not txt.lower() in itm.text(2).lower()): |
459 not txt.lower() in itm.text(2).lower()): |
460 itm.setHidden(True) |
460 itm.setHidden(True) |
461 childHiddenCount += 1 |
461 childHiddenCount += 1 |
462 else: |
462 else: |
463 itm.setHidden(False) |
463 itm.setHidden(False) |
464 topItem.setHidden(childHiddenCount == topItem.childCount()) |
464 topItem.setHidden(childHiddenCount == topItem.childCount()) |