446 cb2a.setSizeAdjustPolicy(QComboBox.AdjustToContents) |
446 cb2a.setSizeAdjustPolicy(QComboBox.AdjustToContents) |
447 hboxLayout.addWidget(cb2a) |
447 hboxLayout.addWidget(cb2a) |
448 cb2a.hide() |
448 cb2a.hide() |
449 self.singlesItemsBoxLayout.addWidget(hbox) |
449 self.singlesItemsBoxLayout.addWidget(hbox) |
450 |
450 |
451 cb1.activated[int].connect(self.__singlesCharTypeSelected) |
451 cb1.activated[int].connect( |
452 cb2.activated[int].connect(self.__singlesCharTypeSelected) |
452 lambda i: self.__singlesCharTypeSelected(i, cb1)) |
|
453 cb2.activated[int].connect( |
|
454 lambda i: self.__singlesCharTypeSelected(i, cb2)) |
453 hbox.show() |
455 hbox.show() |
454 |
456 |
455 self.singlesItemsBox.adjustSize() |
457 self.singlesItemsBox.adjustSize() |
456 |
458 |
457 self.singlesEntries.append([cb1, le1, cb1a]) |
459 self.singlesEntries.append([cb1, le1, cb1a]) |
480 le2 = QLineEdit(hbox) |
482 le2 = QLineEdit(hbox) |
481 le2.setValidator(self.charValidator) |
483 le2.setValidator(self.charValidator) |
482 hboxLayout.addWidget(le2) |
484 hboxLayout.addWidget(le2) |
483 self.rangesItemsBoxLayout.addWidget(hbox) |
485 self.rangesItemsBoxLayout.addWidget(hbox) |
484 |
486 |
485 cb1.activated[int].connect(self.__rangesCharTypeSelected) |
487 cb1.activated[int].connect( |
|
488 lambda i: self.__rangesCharTypeSelected(i, cb1)) |
|
489 |
486 hbox.show() |
490 hbox.show() |
487 |
491 |
488 self.rangesItemsBox.adjustSize() |
492 self.rangesItemsBox.adjustSize() |
489 |
493 |
490 self.rangesEntries.append([cb1, le1, le2]) |
494 self.rangesEntries.append([cb1, le1, le2]) |
545 lineedit.hide() |
549 lineedit.hide() |
546 if combo is not None: |
550 if combo is not None: |
547 combo.hide() |
551 combo.hide() |
548 lineedit.clear() |
552 lineedit.clear() |
549 |
553 |
550 def __singlesCharTypeSelected(self, index): |
554 def __singlesCharTypeSelected(self, index, combo): |
551 """ |
555 """ |
552 Private slot to handle the activated(int) signal of the single chars |
556 Private slot to handle the activated(int) signal of the single chars |
553 combo boxes. |
557 combo boxes. |
554 |
558 |
555 @param index selected list index (integer) |
559 @param index selected list index |
556 """ |
560 @type int |
557 combo = self.sender() |
561 @param combo reference to the combo box |
|
562 @type QComboBox |
|
563 """ |
558 for entriesList in self.singlesEntries: |
564 for entriesList in self.singlesEntries: |
559 if combo == entriesList[0]: |
565 if combo == entriesList[0]: |
560 formatIdentifier = combo.itemData(index) |
566 formatIdentifier = combo.itemData(index) |
561 self.__performSelectedAction( |
567 self.__performSelectedAction( |
562 formatIdentifier, entriesList[1], entriesList[2]) |
568 formatIdentifier, entriesList[1], entriesList[2]) |
563 break |
569 break |
564 |
570 |
565 def __rangesCharTypeSelected(self, index): |
571 def __rangesCharTypeSelected(self, index, combo): |
566 """ |
572 """ |
567 Private slot to handle the activated(int) signal of the char ranges |
573 Private slot to handle the activated(int) signal of the char ranges |
568 combo boxes. |
574 combo boxes. |
569 |
575 |
570 @param index selected list index (integer) |
576 @param index selected list index |
571 """ |
577 @type int |
572 combo = self.sender() |
578 @param combo reference to the combo box |
|
579 @type QComboBox |
|
580 """ |
573 for entriesList in self.rangesEntries: |
581 for entriesList in self.rangesEntries: |
574 if combo == entriesList[0]: |
582 if combo == entriesList[0]: |
575 formatIdentifier = combo.itemData(index) |
583 formatIdentifier = combo.itemData(index) |
576 self.__performSelectedAction(formatIdentifier, entriesList[1], |
584 self.__performSelectedAction(formatIdentifier, entriesList[1], |
577 None) |
585 None) |