comparison ui/mainwindow.cpp @ 845:d33834129d2a

(issue59) Improve details button.
author Emanuel Schuetze <emanuel@intevation.de>
date Wed, 30 Jul 2014 15:01:34 +0200
parents fa68e5aeeaac
children 9bab4fc3a1fe
comparison
equal deleted inserted replaced
844:fa68e5aeeaac 845:d33834129d2a
535 mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); 535 mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver."));
536 } 536 }
537 QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); 537 QPushButton *searchUpdates = new QPushButton(" " + tr("Update"));
538 searchUpdates->setFixedHeight(22); 538 searchUpdates->setFixedHeight(22);
539 searchUpdates->setToolTip(tr("Check for Updates")); 539 searchUpdates->setToolTip(tr("Check for Updates"));
540 searchUpdates->setStyleSheet("font-size: 10px;");
540 searchUpdates->setIcon(QIcon(":/img/update-list.png")); 541 searchUpdates->setIcon(QIcon(":/img/update-list.png"));
541 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); 542 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates()));
542 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); 543 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents);
543 updateDateAndSearchButton->addWidget(searchUpdates); 544 updateDateAndSearchButton->addWidget(searchUpdates);
544 545
594 mUpdatesNewCertificates = 595 mUpdatesNewCertificates =
595 new QLabel("<h3>" + 596 new QLabel("<h3>" +
596 tr("Install new trusted certificates (%1/%2)").arg(0).arg(0) + 597 tr("Install new trusted certificates (%1/%2)").arg(0).arg(0) +
597 "</h3>"); 598 "</h3>");
598 mUpdatesDetailsNew = new QPushButton(); 599 mUpdatesDetailsNew = new QPushButton();
600 mUpdatesDetailsNew->setText(" " + tr("Details"));
599 mUpdatesDetailsNew->setToolTip(tr("Show details")); 601 mUpdatesDetailsNew->setToolTip(tr("Show details"));
600 mUpdatesDetailsNew->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}"); 602 mUpdatesDetailsNew->setStyleSheet("font-size: 10px;");
601 mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png")); 603 mUpdatesDetailsNew->setFixedHeight(22);
604 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png"));
602 connect(mUpdatesDetailsNew, 605 connect(mUpdatesDetailsNew,
603 SIGNAL(clicked()), 606 SIGNAL(clicked()),
604 this, 607 this,
605 SLOT(toggleUpdatesNew())); 608 SLOT(toggleUpdatesNew()));
606 updatesNewLayout->addWidget(mUpdatesNewCertificates); 609 updatesNewLayout->addWidget(mUpdatesNewCertificates);
614 mUpdatesRemoveCertificates = 617 mUpdatesRemoveCertificates =
615 new QLabel("<h3>" + 618 new QLabel("<h3>" +
616 tr("Remove revoked certificates (%1/%2)").arg(0).arg(0) + 619 tr("Remove revoked certificates (%1/%2)").arg(0).arg(0) +
617 "</h3>"); 620 "</h3>");
618 mUpdatesDetailsRemove = new QPushButton(); 621 mUpdatesDetailsRemove = new QPushButton();
622 mUpdatesDetailsRemove->setText(" " + tr("Details"));
619 mUpdatesDetailsRemove->setToolTip(tr("Show details")); 623 mUpdatesDetailsRemove->setToolTip(tr("Show details"));
620 mUpdatesDetailsRemove->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}"); 624 mUpdatesDetailsRemove->setStyleSheet("font-size: 10px;");
621 mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png")); 625 mUpdatesDetailsRemove->setFixedHeight(22);
626 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png"));
622 connect(mUpdatesDetailsRemove, 627 connect(mUpdatesDetailsRemove,
623 SIGNAL(clicked()), 628 SIGNAL(clicked()),
624 this, 629 this,
625 SLOT(toggleUpdatesRemove())); 630 SLOT(toggleUpdatesRemove()));
626 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates); 631 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates);
634 mUpdatesManualCertificates = 639 mUpdatesManualCertificates =
635 new QLabel("<h3>" + 640 new QLabel("<h3>" +
636 tr("Manually changed certificates (%1)").arg(0) + 641 tr("Manually changed certificates (%1)").arg(0) +
637 "</h3>"); 642 "</h3>");
638 mUpdatesDetailsManual = new QPushButton(); 643 mUpdatesDetailsManual = new QPushButton();
644 mUpdatesDetailsManual->setText(" " + tr("Details"));
639 mUpdatesDetailsManual->setToolTip(tr("Show details")); 645 mUpdatesDetailsManual->setToolTip(tr("Show details"));
640 mUpdatesDetailsManual->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}"); 646 mUpdatesDetailsManual->setStyleSheet("font-size: 10px;");
641 mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png")); 647 mUpdatesDetailsManual->setFixedHeight(22);
648 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png"));
642 connect(mUpdatesDetailsManual, 649 connect(mUpdatesDetailsManual,
643 SIGNAL(clicked()), 650 SIGNAL(clicked()),
644 this, 651 this,
645 SLOT(toggleUpdatesManual())); 652 SLOT(toggleUpdatesManual()));
646 mUpdatesDetailsManual->hide(); 653 mUpdatesDetailsManual->hide();
923 mInstallButton->setText(" " + tr("Apply changes")); 930 mInstallButton->setText(" " + tr("Apply changes"));
924 } 931 }
925 932
926 if (mUpdatesManual->certificates().size()) { 933 if (mUpdatesManual->certificates().size()) {
927 mUpdatesDetailsManual->show(); 934 mUpdatesDetailsManual->show();
928 mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png")); 935 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png"));
929 mUpdatesDetailsManual->setToolTip(tr("Show details")); 936 mUpdatesDetailsManual->setToolTip(tr("Show details"));
930 mUpdatesManualCertificates->show(); 937 mUpdatesManualCertificates->show();
931 } else { 938 } else {
932 mUpdatesDetailsManual->hide(); 939 mUpdatesDetailsManual->hide();
933 mUpdatesManualCertificates->hide(); 940 mUpdatesManualCertificates->hide();
939 tr("Install new trusted certificates (%1/%2)") 946 tr("Install new trusted certificates (%1/%2)")
940 .arg(mUpdatesNew->selectedCertCount()) 947 .arg(mUpdatesNew->selectedCertCount())
941 .arg(mUpdatesNew->certificates().size()) + 948 .arg(mUpdatesNew->certificates().size()) +
942 "</h3>"); 949 "</h3>");
943 mUpdatesDetailsNew->show(); 950 mUpdatesDetailsNew->show();
944 mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png")); 951 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png"));
945 mUpdatesDetailsNew->setToolTip(tr("Show details")); 952 mUpdatesDetailsNew->setToolTip(tr("Show details"));
946 mUpdatesNewCertificates->show(); 953 mUpdatesNewCertificates->show();
947 } else { 954 } else {
948 mUpdatesDetailsNew->hide(); 955 mUpdatesDetailsNew->hide();
949 mUpdatesNew->hide(); 956 mUpdatesNew->hide();
955 tr("Remove revoked certificates (%1/%2)") 962 tr("Remove revoked certificates (%1/%2)")
956 .arg(mUpdatesRemove->selectedCertCount()) 963 .arg(mUpdatesRemove->selectedCertCount())
957 .arg(mUpdatesRemove->certificates().size()) + 964 .arg(mUpdatesRemove->certificates().size()) +
958 "</h3>"); 965 "</h3>");
959 mUpdatesRemoveCertificates->show(); 966 mUpdatesRemoveCertificates->show();
960 mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png")); 967 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png"));
961 mUpdatesDetailsRemove->setToolTip(tr("Show details")); 968 mUpdatesDetailsRemove->setToolTip(tr("Show details"));
962 mUpdatesDetailsRemove->show(); 969 mUpdatesDetailsRemove->show();
963 } else { 970 } else {
964 mUpdatesRemoveCertificates->hide(); 971 mUpdatesRemoveCertificates->hide();
965 mUpdatesDetailsRemove->hide(); 972 mUpdatesDetailsRemove->hide();
1232 } 1239 }
1233 1240
1234 void MainWindow::toggleUpdatesNew() { 1241 void MainWindow::toggleUpdatesNew() {
1235 if (!mUpdatesNew->isVisible()) { 1242 if (!mUpdatesNew->isVisible()) {
1236 mUpdatesDetailsNew->setToolTip(tr("Hide details")); 1243 mUpdatesDetailsNew->setToolTip(tr("Hide details"));
1237 mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-down-double.png")); 1244 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_grey_16px.png"));
1238 mUpdatesNew->show(); 1245 mUpdatesNew->show();
1239 } 1246 }
1240 else { 1247 else {
1241 mUpdatesNew->hide(); 1248 mUpdatesNew->hide();
1242 mUpdatesDetailsNew->setToolTip(tr("Show details")); 1249 mUpdatesDetailsNew->setToolTip(tr("Show details"));
1243 mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png")); 1250 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png"));
1244 } 1251 }
1245 } 1252 }
1246 1253
1247 void MainWindow::toggleUpdatesRemove() { 1254 void MainWindow::toggleUpdatesRemove() {
1248 if (!mUpdatesRemove->isVisible()) { 1255 if (!mUpdatesRemove->isVisible()) {
1249 mUpdatesDetailsRemove->setToolTip(tr("Hide details")); 1256 mUpdatesDetailsRemove->setToolTip(tr("Hide details"));
1250 mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-down-double.png")); 1257 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_grey_16px.png"));
1251 mUpdatesRemove->show(); 1258 mUpdatesRemove->show();
1252 } 1259 }
1253 else { 1260 else {
1254 mUpdatesRemove->hide(); 1261 mUpdatesRemove->hide();
1255 mUpdatesDetailsRemove->setToolTip(tr("Show details")); 1262 mUpdatesDetailsRemove->setToolTip(tr("Show details"));
1256 mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png")); 1263 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png"));
1257 } 1264 }
1258 } 1265 }
1259 1266
1260 void MainWindow::toggleUpdatesManual() { 1267 void MainWindow::toggleUpdatesManual() {
1261 if (!mUpdatesManual->isVisible()) { 1268 if (!mUpdatesManual->isVisible()) {
1262 mUpdatesDetailsManual->setToolTip(tr("Hide details")); 1269 mUpdatesDetailsManual->setToolTip(tr("Hide details"));
1263 mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-down-double.png")); 1270 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_grey_16px.png"));
1264 mUpdatesManual->show(); 1271 mUpdatesManual->show();
1265 } 1272 }
1266 else { 1273 else {
1267 mUpdatesDetailsManual->setToolTip(tr("Show details")); 1274 mUpdatesDetailsManual->setToolTip(tr("Show details"));
1268 mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png")); 1275 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png"));
1269 mUpdatesManual->hide(); 1276 mUpdatesManual->hide();
1270 } 1277 }
1271 } 1278 }
1272 1279
1273 void MainWindow::closeEvent(QCloseEvent *event) 1280 void MainWindow::closeEvent(QCloseEvent *event)

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