Changeset View
Changeset View
Standalone View
Standalone View
kaccess/kaccess.cpp
Show First 20 Lines • Show All 662 Lines • ▼ Show 20 Line(s) | 576 | { | |||
---|---|---|---|---|---|
663 | 663 | | |||
664 | return keyname; | 664 | return keyname; | ||
665 | } | 665 | } | ||
666 | 666 | | |||
667 | void KAccessApp::createDialogContents() | 667 | void KAccessApp::createDialogContents() | ||
668 | { | 668 | { | ||
669 | if (dialog == nullptr) { | 669 | if (dialog == nullptr) { | ||
670 | dialog = new QDialog(nullptr); | 670 | dialog = new QDialog(nullptr); | ||
671 | dialog->setWindowTitle(i18n("Warning")); | 671 | dialog->setWindowTitle(i18nc("@title:window", "Accessibility Feature Changes")); | ||
pino: Since you are changing this string: can you please use Title Capitalization as described in the… | |||||
672 | dialog->setObjectName(QStringLiteral("AccessXWarning")); | 672 | dialog->setObjectName(QStringLiteral("AccessXWarning")); | ||
673 | dialog->setModal(true); | 673 | dialog->setModal(true); | ||
674 | 674 | | |||
675 | QVBoxLayout *topLayout = new QVBoxLayout(); | 675 | QVBoxLayout *topLayout = new QVBoxLayout(); | ||
676 | 676 | | |||
677 | QHBoxLayout * lay = new QHBoxLayout(); | 677 | QHBoxLayout * lay = new QHBoxLayout(); | ||
678 | 678 | | |||
679 | QLabel *label1 = new QLabel(); | 679 | QLabel *label1 = new QLabel(); | ||
680 | QIcon icon = QIcon::fromTheme(QStringLiteral("dialog-warning")); | 680 | QIcon icon = QIcon::fromTheme(QStringLiteral("dialog-warning")); | ||
681 | if (icon.isNull()) | 681 | if (icon.isNull()) | ||
682 | icon = QMessageBox::standardIcon(QMessageBox::Warning); | 682 | icon = QMessageBox::standardIcon(QMessageBox::Warning); | ||
683 | label1->setPixmap(icon.pixmap(64, 64)); | 683 | label1->setPixmap(icon.pixmap(64, 64)); | ||
684 | 684 | | |||
685 | lay->addWidget(label1, 0, Qt::AlignCenter); | 685 | lay->addWidget(label1, 0, Qt::AlignCenter); | ||
686 | 686 | | |||
687 | QVBoxLayout * vlay = new QVBoxLayout(); | 687 | QVBoxLayout * vlay = new QVBoxLayout(); | ||
688 | lay->addItem(vlay); | 688 | lay->addItem(vlay); | ||
689 | 689 | | |||
690 | featuresLabel = new QLabel(); | 690 | featuresLabel = new QLabel(); | ||
691 | featuresLabel->setAlignment(Qt::AlignVCenter); | 691 | featuresLabel->setAlignment(Qt::AlignVCenter); | ||
692 | featuresLabel->setWordWrap(true); | 692 | featuresLabel->setWordWrap(true); | ||
693 | vlay->addWidget(featuresLabel); | 693 | vlay->addWidget(featuresLabel); | ||
694 | vlay->addSpacing(10); | ||||
694 | vlay->addStretch(); | 695 | vlay->addStretch(); | ||
695 | 696 | | |||
696 | QHBoxLayout * hlay = new QHBoxLayout(); | 697 | QHBoxLayout * hlay = new QHBoxLayout(); | ||
697 | vlay->addItem(hlay); | 698 | vlay->addItem(hlay); | ||
698 | 699 | | |||
699 | QLabel *showModeLabel = new QLabel(i18n("&When a gesture was used:")); | 700 | QLabel *showModeLabel = new QLabel(i18n("&When a gesture was used:")); | ||
700 | hlay->addWidget(showModeLabel); | 701 | hlay->addWidget(showModeLabel); | ||
701 | 702 | | |||
702 | showModeCombobox = new KComboBox(); | 703 | showModeCombobox = new KComboBox(); | ||
703 | hlay->addWidget(showModeCombobox); | 704 | hlay->addWidget(showModeCombobox); | ||
704 | showModeLabel->setBuddy(showModeCombobox); | 705 | showModeLabel->setBuddy(showModeCombobox); | ||
705 | showModeCombobox->insertItem(0, i18n("Change Settings Without Asking")); | 706 | showModeCombobox->insertItem(0, i18n("Change Settings Without Asking")); | ||
706 | showModeCombobox->insertItem(1, i18n("Show This Confirmation Dialog")); | 707 | showModeCombobox->insertItem(1, i18n("Show This Confirmation Dialog")); | ||
707 | showModeCombobox->insertItem(2, i18n("Deactivate All AccessX Features & Gestures")); | 708 | showModeCombobox->insertItem(2, i18n("Deactivate All AccessX Features & Gestures")); | ||
708 | showModeCombobox->setCurrentIndex(1); | 709 | showModeCombobox->setCurrentIndex(1); | ||
710 | | ||||
711 | vlay->addSpacing(10); | ||||
712 | vlay->addStretch(); | ||||
713 | questionLabel = new QLabel(); | ||||
714 | vlay->addWidget(questionLabel); | ||||
715 | | ||||
709 | topLayout->addLayout(lay); | 716 | topLayout->addLayout(lay); | ||
710 | 717 | | |||
711 | auto buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, dialog); | 718 | auto buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, dialog); | ||
712 | 719 | | |||
713 | topLayout->addWidget(buttons); | 720 | topLayout->addWidget(buttons); | ||
davidedmundson: can we choose another role here? | |||||
amantia: Oops. | |||||
714 | dialog->setLayout(topLayout); | 721 | dialog->setLayout(topLayout); | ||
715 | 722 | | |||
716 | connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); | 723 | connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); | ||
717 | connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject); | 724 | connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject); | ||
718 | connect(dialog, &QDialog::accepted, this, &KAccessApp::yesClicked); | 725 | connect(dialog, &QDialog::accepted, this, &KAccessApp::yesClicked); | ||
719 | connect(dialog, &QDialog::rejected, this, &KAccessApp::noClicked); | 726 | connect(dialog, &QDialog::rejected, this, &KAccessApp::noClicked); | ||
720 | } | 727 | } | ||
721 | } | 728 | } | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 746 | } else { | |||
767 | if (enabled & XCB_XKB_BOOL_CTRL_MOUSE_KEYS) | 774 | if (enabled & XCB_XKB_BOOL_CTRL_MOUSE_KEYS) | ||
768 | enabledFeatures << i18n("Mouse keys"); | 775 | enabledFeatures << i18n("Mouse keys"); | ||
769 | else if (disabled & XCB_XKB_BOOL_CTRL_MOUSE_KEYS) | 776 | else if (disabled & XCB_XKB_BOOL_CTRL_MOUSE_KEYS) | ||
770 | disabledFeatures << i18n("Mouse keys"); | 777 | disabledFeatures << i18n("Mouse keys"); | ||
771 | 778 | | |||
772 | QString question; | 779 | QString question; | ||
773 | switch (enabledFeatures.count()) { | 780 | switch (enabledFeatures.count()) { | ||
774 | case 0: switch (disabledFeatures.count()) { | 781 | case 0: switch (disabledFeatures.count()) { | ||
775 | case 1: question = i18n("Do you really want to deactivate \"%1\"?", | 782 | case 1: question = i18n("<b>Do you really want to deactivate \"%1\"?</b>", | ||
776 | disabledFeatures[0]); | 783 | disabledFeatures[0]); | ||
777 | break; | 784 | break; | ||
778 | case 2: question = i18n("Do you really want to deactivate \"%1\" and \"%2\"?", | 785 | case 2: question = i18n("<b>Do you really want to deactivate \"%1\" and \"%2\"?</b>", | ||
779 | disabledFeatures[0], disabledFeatures[1]); | 786 | disabledFeatures[0], disabledFeatures[1]); | ||
780 | break; | 787 | break; | ||
781 | case 3: question = i18n("Do you really want to deactivate \"%1\", \"%2\" and \"%3\"?", | 788 | case 3: question = i18n("<b>Do you really want to deactivate \"%1\", \"%2\" and \"%3\"?</b>", | ||
782 | disabledFeatures[0], disabledFeatures[1], | 789 | disabledFeatures[0], disabledFeatures[1], | ||
783 | disabledFeatures[2]); | 790 | disabledFeatures[2]); | ||
784 | break; | 791 | break; | ||
785 | case 4: question = i18n("Do you really want to deactivate \"%1\", \"%2\", \"%3\" and \"%4\"?", | 792 | case 4: question = i18n("<b>Do you really want to deactivate \"%1\", \"%2\", \"%3\" and \"%4\"?</b>", | ||
786 | disabledFeatures[0], disabledFeatures[1], | 793 | disabledFeatures[0], disabledFeatures[1], | ||
787 | disabledFeatures[2], disabledFeatures[3]); | 794 | disabledFeatures[2], disabledFeatures[3]); | ||
788 | break; | 795 | break; | ||
789 | } | 796 | } | ||
790 | break; | 797 | break; | ||
791 | case 1: switch (disabledFeatures.count()) { | 798 | case 1: switch (disabledFeatures.count()) { | ||
792 | case 0: question = i18n("Do you really want to activate \"%1\"?", | 799 | case 0: question = i18n("<b>Do you really want to activate \"%1\"?</b>", | ||
793 | enabledFeatures[0]); | 800 | enabledFeatures[0]); | ||
794 | break; | 801 | break; | ||
795 | case 1: question = i18n("Do you really want to activate \"%1\" and to deactivate \"%2\"?", | 802 | case 1: question = i18n("<b>Do you really want to activate \"%1\" and to deactivate \"%2\"?</b>", | ||
796 | enabledFeatures[0], disabledFeatures[0]); | 803 | enabledFeatures[0], disabledFeatures[0]); | ||
797 | break; | 804 | break; | ||
798 | case 2: question = i18n("Do you really want to activate \"%1\" and to deactivate \"%2\" and \"%3\"?", | 805 | case 2: question = i18n("<b>Do you really want to activate \"%1\" and to deactivate \"%2\" and \"%3\"?</b>", | ||
799 | enabledFeatures[0], disabledFeatures[0], | 806 | enabledFeatures[0], disabledFeatures[0], | ||
800 | disabledFeatures[1]); | 807 | disabledFeatures[1]); | ||
801 | break; | 808 | break; | ||
802 | case 3: question = i18n("Do you really want to activate \"%1\" and to deactivate \"%2\", \"%3\" and \"%4\"?", | 809 | case 3: question = i18n("<b>Do you really want to activate \"%1\" and to deactivate \"%2\", \"%3\" and \"%4\"?</b>", | ||
803 | enabledFeatures[0], disabledFeatures[0], | 810 | enabledFeatures[0], disabledFeatures[0], | ||
804 | disabledFeatures[1], disabledFeatures[2]); | 811 | disabledFeatures[1], disabledFeatures[2]); | ||
805 | break; | 812 | break; | ||
806 | } | 813 | } | ||
807 | break; | 814 | break; | ||
808 | case 2: switch (disabledFeatures.count()) { | 815 | case 2: switch (disabledFeatures.count()) { | ||
809 | case 0: question = i18n("Do you really want to activate \"%1\" and \"%2\"?", | 816 | case 0: question = i18n("<b>Do you really want to activate \"%1\" and \"%2\"?", | ||
810 | enabledFeatures[0], enabledFeatures[1]); | 817 | enabledFeatures[0], enabledFeatures[1]); | ||
811 | break; | 818 | break; | ||
812 | case 1: question = i18n("Do you really want to activate \"%1\" and \"%2\" and to deactivate \"%3\"?", | 819 | case 1: question = i18n("<b>Do you really want to activate \"%1\" and \"%2\" and to deactivate \"%3\"?</b>", | ||
813 | enabledFeatures[0], enabledFeatures[1], | 820 | enabledFeatures[0], enabledFeatures[1], | ||
814 | disabledFeatures[0]); | 821 | disabledFeatures[0]); | ||
815 | break; | 822 | break; | ||
816 | case 2: question = i18n("Do you really want to activate \"%1\", and \"%2\" and to deactivate \"%3\" and \"%4\"?", | 823 | case 2: question = i18n("<b>Do you really want to activate \"%1\", and \"%2\" and to deactivate \"%3\" and \"%4\"?</b>", | ||
817 | enabledFeatures[0], enabledFeatures[1], | 824 | enabledFeatures[0], enabledFeatures[1], | ||
818 | enabledFeatures[0], disabledFeatures[1]); | 825 | enabledFeatures[0], disabledFeatures[1]); | ||
819 | break; | 826 | break; | ||
820 | } | 827 | } | ||
821 | break; | 828 | break; | ||
822 | case 3: switch (disabledFeatures.count()) { | 829 | case 3: switch (disabledFeatures.count()) { | ||
823 | case 0: question = i18n("Do you really want to activate \"%1\", \"%2\" and \"%3\"?", | 830 | case 0: question = i18n("<b>Do you really want to activate \"%1\", \"%2\" and \"%3\"?</b>", | ||
824 | enabledFeatures[0], enabledFeatures[1], | 831 | enabledFeatures[0], enabledFeatures[1], | ||
825 | enabledFeatures[2]); | 832 | enabledFeatures[2]); | ||
826 | break; | 833 | break; | ||
827 | case 1: question = i18n("Do you really want to activate \"%1\", \"%2\" and \"%3\" and to deactivate \"%4\"?", | 834 | case 1: question = i18n("<b>Do you really want to activate \"%1\", \"%2\" and \"%3\" and to deactivate \"%4\"?</b>", | ||
828 | enabledFeatures[0], enabledFeatures[1], | 835 | enabledFeatures[0], enabledFeatures[1], | ||
829 | enabledFeatures[2], disabledFeatures[0]); | 836 | enabledFeatures[2], disabledFeatures[0]); | ||
830 | break; | 837 | break; | ||
831 | } | 838 | } | ||
832 | break; | 839 | break; | ||
833 | case 4: question = i18n("Do you really want to activate \"%1\", \"%2\", \"%3\" and \"%4\"?", | 840 | case 4: question = i18n("<b>Do you really want to activate \"%1\", \"%2\", \"%3\" and \"%4\"?</b>", | ||
834 | enabledFeatures[0], enabledFeatures[1], | 841 | enabledFeatures[0], enabledFeatures[1], | ||
835 | enabledFeatures[2], enabledFeatures[3]); | 842 | enabledFeatures[2], enabledFeatures[3]); | ||
836 | break; | 843 | break; | ||
837 | } | 844 | } | ||
838 | QString explanation; | 845 | QString explanation; | ||
839 | if (enabledFeatures.count() + disabledFeatures.count() == 1) { | 846 | if (enabledFeatures.count() + disabledFeatures.count() == 1) { | ||
840 | explanation = i18n("An application has requested to change this setting."); | 847 | explanation = i18n("An application has requested to change this setting."); | ||
841 | 848 | | |||
Show All 11 Lines | |||||
853 | } else { | 860 | } else { | ||
854 | if (_gestures) | 861 | if (_gestures) | ||
855 | explanation = i18n("An application has requested to change these settings, or you used a combination of several keyboard gestures."); | 862 | explanation = i18n("An application has requested to change these settings, or you used a combination of several keyboard gestures."); | ||
856 | else | 863 | else | ||
857 | explanation = i18n("An application has requested to change these settings."); | 864 | explanation = i18n("An application has requested to change these settings."); | ||
858 | } | 865 | } | ||
859 | 866 | | |||
860 | createDialogContents(); | 867 | createDialogContents(); | ||
861 | featuresLabel->setText(question + QStringLiteral("\n\n") + explanation | 868 | featuresLabel->setText(explanation | ||
862 | + QStringLiteral(" ") + i18n("These AccessX settings are needed for some users with motion impairments and can be configured in the KDE System Settings. You can also turn them on and off with standardized keyboard gestures.\n\nIf you do not need them, you can select \"Deactivate all AccessX features and gestures\".")); | 869 | + QStringLiteral(" ") + i18n("These AccessX settings are needed for some users with motion impairments and can be configured in the KDE System Settings. You can also turn them on and off with standardized keyboard gestures.\n\nIf you do not need them, you can select \"Deactivate all AccessX features and gestures\".")); | ||
863 | 870 | questionLabel->setText(question); | |||
Let's use xi18nc() for this: xi18nc("@info", "<emphasis strong='true'>%1"</emphasis>, question) ngraham: Let's use `xi18nc()` for this:
`xi18nc("@info", "<emphasis strong='true'>%1"</emphasis>… | |||||
That looks weird., as it creates a translatable string for no reason. Obviously best would be to update all strings to have the bold text in it, but that creates lots of new strings for no good reason.... amantia: That looks weird., as it creates a translatable string for no reason. Obviously best would be… | |||||
I'd say updating all strings is good. Translators should have support from their tools (translation memory) and we will eventually have to move forward. gladhorn: I'd say updating all strings is good. Translators should have support from their tools… | |||||
I did, although disagree, as it makes the change not easily backportable. I also couldn't test/trigger all cases. amantia: I did, although disagree, as it makes the change not easily backportable. I also couldn't… | |||||
864 | KWindowSystem::setState(dialog->winId(), NET::KeepAbove); | 871 | KWindowSystem::setState(dialog->winId(), NET::KeepAbove); | ||
865 | KUserTimestamp::updateUserTimestamp(0); | 872 | KUserTimestamp::updateUserTimestamp(0); | ||
866 | dialog->show(); | 873 | dialog->show(); | ||
867 | } | 874 | } | ||
868 | } | 875 | } | ||
869 | } | 876 | } | ||
870 | 877 | | |||
871 | void KAccessApp::notifyChanges() | 878 | void KAccessApp::notifyChanges() | ||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |
Since you are changing this string: can you please use Title Capitalization as described in the HIG?
Also, adding a context like "@title:window" will help distinguish this as title.