comparison ui/mainwindow.cpp @ 719:49bf73b5c7de

(Issue34) Show / hide details area depending on available changes
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 02 Jul 2014 16:35:16 +0200
parents e7a070e64b80
children b0929968562a
comparison
equal deleted inserted replaced
718:e7a070e64b80 719:49bf73b5c7de
832 { 832 {
833 Q_UNUSED (selected); 833 Q_UNUSED (selected);
834 mChangeCount = mUpdatesRemove->selectedCertCount() + 834 mChangeCount = mUpdatesRemove->selectedCertCount() +
835 mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size(); 835 mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size();
836 836
837 if (mUpdatesManual->certificates().size()) {
838 mUpdatesDetailsManual->show();
839 mUpdatesManualCertificates->show();
840 } else {
841 mUpdatesDetailsManual->hide();
842 mUpdatesManualCertificates->hide();
843 }
844
845 /* Show a different tip in case of manual changes, updates aviailable, updates and manual 837 /* Show a different tip in case of manual changes, updates aviailable, updates and manual
846 * changes available */ 838 * changes available */
847 if (changeCount() && !mUpdatesManual->certificates().size()) { 839 if (changeCount() && !mUpdatesManual->certificates().size()) {
848 mUpdatesTip->setText( 840 mUpdatesTip->setText(
849 tr("You should apply the following, recommended changes to your certificate stores.")); 841 tr("You should apply the following, recommended changes to your certificate stores."));
867 .arg(changeCount()) + 859 .arg(changeCount()) +
868 "</h2>"); 860 "</h2>");
869 mInstallButton->setText(" " + tr("Apply changes")); 861 mInstallButton->setText(" " + tr("Apply changes"));
870 } 862 }
871 863
864 if (mUpdatesManual->certificates().size()) {
865 mUpdatesDetailsManual->show();
866 mUpdatesDetailsManual->setText(tr("Show details"));
867 mUpdatesManualCertificates->show();
868 } else {
869 mUpdatesDetailsManual->hide();
870 mUpdatesManualCertificates->hide();
871 mUpdatesManual->hide();
872 }
873
872 if (mUpdatesNew->certificates().size()) { 874 if (mUpdatesNew->certificates().size()) {
873 mUpdatesNewCertificates->setText("<h3>" + 875 mUpdatesNewCertificates->setText("<h3>" +
874 tr("Install new trusted certificates (%1/%2)") 876 tr("Install new trusted certificates (%1/%2)")
875 .arg(mUpdatesNew->selectedCertCount()) 877 .arg(mUpdatesNew->selectedCertCount())
876 .arg(mUpdatesNew->certificates().size()) + 878 .arg(mUpdatesNew->certificates().size()) +
877 "</h3>"); 879 "</h3>");
878 mUpdatesDetailsNew->show(); 880 mUpdatesDetailsNew->show();
881 mUpdatesDetailsNew->setText(tr("Show details"));
879 mUpdatesNewCertificates->show(); 882 mUpdatesNewCertificates->show();
880 } else { 883 } else {
881 mUpdatesDetailsNew->hide(); 884 mUpdatesDetailsNew->hide();
885 mUpdatesNew->hide();
882 mUpdatesNewCertificates->hide(); 886 mUpdatesNewCertificates->hide();
883 } 887 }
884 888
885 if (mUpdatesRemove->certificates().size()) { 889 if (mUpdatesRemove->certificates().size()) {
886 mUpdatesRemoveCertificates->setText("<h3>" + 890 mUpdatesRemoveCertificates->setText("<h3>" +
887 tr("Remove revoked certificates (%1/%2)") 891 tr("Remove revoked certificates (%1/%2)")
888 .arg(mUpdatesRemove->selectedCertCount()) 892 .arg(mUpdatesRemove->selectedCertCount())
889 .arg(mUpdatesRemove->certificates().size()) + 893 .arg(mUpdatesRemove->certificates().size()) +
890 "</h3>"); 894 "</h3>");
891 mUpdatesRemoveCertificates->show(); 895 mUpdatesRemoveCertificates->show();
896 mUpdatesDetailsRemove->setText(tr("Show details"));
892 mUpdatesDetailsRemove->show(); 897 mUpdatesDetailsRemove->show();
893 } else { 898 } else {
894 mUpdatesRemoveCertificates->hide(); 899 mUpdatesRemoveCertificates->hide();
895 mUpdatesDetailsRemove->hide(); 900 mUpdatesDetailsRemove->hide();
901 mUpdatesRemove->hide();
896 } 902 }
897 } 903 }
898 904
899 void MainWindow::loadCertificateList() 905 void MainWindow::loadCertificateList()
900 { 906 {

http://wald.intevation.org/projects/trustbridge/