Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 652:f65503c1833b trustbridge-refactor
Updated mainwindow layout and removed obsolete code.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 25 Jun 2014 14:54:45 +0200 |
parents | f8be956c819b |
children | 39f03316f675 |
comparison
equal
deleted
inserted
replaced
651:7cd6602e3fa2 | 652:f65503c1833b |
---|---|
57 #include "logging.h" | 57 #include "logging.h" |
58 | 58 |
59 MainWindow::MainWindow(bool trayMode): | 59 MainWindow::MainWindow(bool trayMode): |
60 mTrayMode(trayMode) | 60 mTrayMode(trayMode) |
61 { | 61 { |
62 mUpdatesNewSize = 0; | |
63 mUpdatesRemoveSize = 0; | |
64 mUpdatesManualSize = 0; | |
65 createActions(); | 62 createActions(); |
66 createTrayIcon(); | 63 createTrayIcon(); |
67 createContent(); | 64 createContent(); |
68 resize(950, 540); | 65 resize(950, 540); |
69 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode"); | 66 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode"); |
373 QVBoxLayout *headerTextLayout = new QVBoxLayout; | 370 QVBoxLayout *headerTextLayout = new QVBoxLayout; |
374 QHBoxLayout *centerLayout = new QHBoxLayout; | 371 QHBoxLayout *centerLayout = new QHBoxLayout; |
375 QVBoxLayout *buttonBarLayout = new QVBoxLayout; | 372 QVBoxLayout *buttonBarLayout = new QVBoxLayout; |
376 QHBoxLayout *bottomLayout = new QHBoxLayout; | 373 QHBoxLayout *bottomLayout = new QHBoxLayout; |
377 QHBoxLayout *containerLayout = new QHBoxLayout; | 374 QHBoxLayout *containerLayout = new QHBoxLayout; |
378 QVBoxLayout *updatesPanelLayout = new QVBoxLayout; | |
379 | 375 |
380 // The header (icon, about text) | 376 // The header (icon, about text) |
381 QImage *logoImage = new QImage(":/img/logo.png"); | 377 QImage *logoImage = new QImage(":/img/logo.png"); |
382 QLabel *logo = new QLabel; | 378 QLabel *logo = new QLabel; |
383 logo->setBackgroundRole(QPalette::Base); | 379 logo->setBackgroundRole(QPalette::Base); |
389 headerLayout->addWidget(logo); | 385 headerLayout->addWidget(logo); |
390 headerLayout->addLayout(headerTextLayout); | 386 headerLayout->addLayout(headerTextLayout); |
391 headerLayout->setStretch(0, 0); | 387 headerLayout->setStretch(0, 0); |
392 headerLayout->setStretch(1, 10); | 388 headerLayout->setStretch(1, 10); |
393 | 389 |
394 // Buttonbar | 390 /*********************************** |
391 * The Buttonbar on the left side. | |
392 ***********************************/ | |
395 mButtonGroup = new QButtonGroup; | 393 mButtonGroup = new QButtonGroup; |
396 | 394 |
397 QToolButton *updatesButton = new QToolButton; | 395 QToolButton *updatesButton = new QToolButton; |
398 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); | 396 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
399 updatesButton->setIcon(QIcon(":/img/view-refresh.png")); | 397 updatesButton->setIcon(QIcon(":/img/view-refresh.png")); |
446 buttonBarLayout->addWidget(allInstallButton); | 444 buttonBarLayout->addWidget(allInstallButton); |
447 buttonBarLayout->addWidget(allRemoveButton); | 445 buttonBarLayout->addWidget(allRemoveButton); |
448 buttonBarLayout->insertStretch(3, 10); | 446 buttonBarLayout->insertStretch(3, 10); |
449 buttonBarLayout->addWidget(infoButton); | 447 buttonBarLayout->addWidget(infoButton); |
450 | 448 |
451 //The main panels. | 449 /******************************** |
452 //The updates page. | 450 * The main pages. |
451 ********************************/ | |
452 | |
453 /******************************** | |
454 * The updates page. | |
455 ********************************/ | |
456 QVBoxLayout *updatesMainLayout = new QVBoxLayout; | |
453 mUpdatesPanel = new QScrollArea; | 457 mUpdatesPanel = new QScrollArea; |
458 QScrollArea *updatesContent = new QScrollArea; | |
459 // updatesContent->setFrameShape(QFrame::NoFrame); | |
454 mUpdatesWidget = new QWidget; | 460 mUpdatesWidget = new QWidget; |
461 | |
462 /* The updates header */ | |
455 QHBoxLayout *updatesHeaderLayout = new QHBoxLayout; | 463 QHBoxLayout *updatesHeaderLayout = new QHBoxLayout; |
456 QVBoxLayout *updatesHeaderTextLayout = new QVBoxLayout; | 464 QVBoxLayout *updatesHeaderTextLayout = new QVBoxLayout; |
457 QVBoxLayout *updatesHeaderSettLayout = new QVBoxLayout; | 465 QVBoxLayout *updatesHeaderButtonLayout = new QVBoxLayout; |
466 QHBoxLayout *updatesHeaderActionLayout = new QHBoxLayout; | |
467 QHBoxLayout *updatesHeaderSearchLayout = new QHBoxLayout; | |
458 | 468 |
459 mUpdatesHeader = | 469 mUpdatesHeader = |
460 new QLabel("<h2>" + tr("Updates (%1/%2)").arg(2).arg(4)+ "</h2>"); | 470 new QLabel("<h2>" + tr("Updates (%1/%2)").arg(0).arg(0)+ "</h2>"); |
461 mLastCertUpdate = | 471 mLastCertUpdate = |
462 new QLabel(tr("Last certificate update: %1").arg("today")); | 472 new QLabel(tr("Last certificate update: %1").arg("")); |
463 mLastSWupdate = | 473 mLastSWupdate = |
464 new QLabel(tr("Last Software update: %1").arg("today")); | 474 new QLabel(tr("Last Software update: %1").arg("")); |
475 QLabel *updatesTip = | |
476 new QLabel("<h4>" + tr("The following certificate changes are recommended.") + "</h4>"); | |
477 | |
465 updatesHeaderTextLayout->addWidget(mUpdatesHeader); | 478 updatesHeaderTextLayout->addWidget(mUpdatesHeader); |
466 updatesHeaderTextLayout->addWidget(mLastCertUpdate); | 479 updatesHeaderTextLayout->addWidget(mLastCertUpdate); |
467 updatesHeaderTextLayout->addWidget(mLastSWupdate); | 480 updatesHeaderTextLayout->addWidget(mLastSWupdate); |
481 updatesHeaderTextLayout->addSpacing(10); | |
482 updatesHeaderTextLayout->addWidget(updatesTip); | |
468 | 483 |
469 QPushButton *searchUpdates = new QPushButton(tr("Search for Updates")); | 484 QPushButton *searchUpdates = new QPushButton(tr("Search for Updates")); |
485 searchUpdates->setIcon(QIcon(":/img/system-search.png")); | |
486 QPushButton *quitButton = new QPushButton(tr("Quit without saving")); | |
487 quitButton->setIcon(QIcon(":/img/system-shutdown.png")); | |
488 QPushButton *installButton = new QPushButton(tr("Update")); | |
489 #ifdef Q_OS_WIN | |
490 if (is_admin()) { | |
491 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); | |
492 installButton->setIcon(uacShield); | |
493 } | |
494 #else | |
495 installButton->setIcon(QIcon(":/img/edit-redo.png")); | |
496 #endif | |
497 connect(quitButton, SIGNAL(clicked()), this, SLOT(closeApp())); | |
498 connect(installButton, SIGNAL(clicked()), this, SLOT(installCerts())); | |
470 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); | 499 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); |
471 updatesHeaderSettLayout->insertStretch(0, 10); | 500 |
472 updatesHeaderSettLayout->addWidget(searchUpdates); | 501 updatesHeaderActionLayout->addWidget(installButton); |
502 updatesHeaderActionLayout->addWidget(quitButton); | |
503 updatesHeaderSearchLayout->insertStretch(0, 1); | |
504 updatesHeaderSearchLayout->addWidget(searchUpdates); | |
505 | |
506 updatesHeaderButtonLayout->addLayout(updatesHeaderSearchLayout); | |
507 updatesHeaderButtonLayout->addLayout(updatesHeaderActionLayout); | |
508 | |
473 updatesHeaderLayout->addLayout(updatesHeaderTextLayout); | 509 updatesHeaderLayout->addLayout(updatesHeaderTextLayout); |
474 updatesHeaderLayout->insertStretch(1, 10); | 510 updatesHeaderLayout->insertStretch(1, 10); |
475 updatesHeaderLayout->addLayout(updatesHeaderSettLayout); | 511 updatesHeaderLayout->addLayout(updatesHeaderButtonLayout); |
476 | 512 |
513 /* The central panels. */ | |
477 QVBoxLayout *updatesCenterLayout = new QVBoxLayout; | 514 QVBoxLayout *updatesCenterLayout = new QVBoxLayout; |
478 QHBoxLayout *updatesNewLayout = new QHBoxLayout; | 515 QHBoxLayout *updatesNewLayout = new QHBoxLayout; |
479 QHBoxLayout *updatesRemoveLayout = new QHBoxLayout; | 516 QHBoxLayout *updatesRemoveLayout = new QHBoxLayout; |
480 QHBoxLayout *updatesManualLayout = new QHBoxLayout; | 517 QHBoxLayout *updatesManualLayout = new QHBoxLayout; |
481 QLabel *updatesTip = | |
482 new QLabel(tr("The following certificate changes are recommended.")); | |
483 mUpdatesNewCertificates = | 518 mUpdatesNewCertificates = |
484 new QLabel("<h3>" + | 519 new QLabel("<h3>" + |
485 tr("Install new Certificates (%1/%2)").arg(2).arg(2) + | 520 tr("Install new Certificates (%1/%2)").arg(0).arg(0) + |
486 "</h3>"); | 521 "</h3>"); |
487 QPushButton *updatesDetailsNew = new QPushButton(tr("Details")); | 522 mUpdatesDetailsNew = new QPushButton(tr("Show Details")); |
488 connect(updatesDetailsNew, | 523 connect(mUpdatesDetailsNew, |
489 SIGNAL(clicked()), | 524 SIGNAL(clicked()), |
490 this, | 525 this, |
491 SLOT(toggleUpdatesNew())); | 526 SLOT(toggleUpdatesNew())); |
492 updatesNewLayout->addWidget(mUpdatesNewCertificates); | 527 updatesNewLayout->addWidget(mUpdatesNewCertificates); |
493 updatesNewLayout->addWidget(updatesDetailsNew); | 528 updatesNewLayout->addWidget(mUpdatesDetailsNew); |
494 updatesNewLayout->insertStretch(2, 10); | 529 updatesNewLayout->insertStretch(2, 10); |
495 mUpdatesNew = new CertificateListWidget(this); | 530 mUpdatesNew = new CertificateListWidget(this); |
496 connect(mUpdatesNew, SIGNAL(certListChanged(int)), | 531 connect(mUpdatesNew, SIGNAL(certListChanged(int)), |
497 this, SLOT(listChanged(int))); | 532 this, SLOT(listChanged(int))); |
498 mUpdatesNew->hide(); | 533 mUpdatesNew->hide(); |
499 | 534 |
500 mUpdatesRemoveCertificates = | 535 mUpdatesRemoveCertificates = |
501 new QLabel("<h3>" + | 536 new QLabel("<h3>" + |
502 tr("Remove insecure Certificates (%1/%2)").arg(2).arg(2) + | 537 tr("Remove insecure Certificates (%1/%2)").arg(0).arg(0) + |
503 "</h3>"); | 538 "</h3>"); |
504 QPushButton *updatesDetailsRemove = new QPushButton(tr("Details")); | 539 mUpdatesDetailsRemove = new QPushButton(tr("Show Details")); |
505 connect(updatesDetailsRemove, | 540 connect(mUpdatesDetailsRemove, |
506 SIGNAL(clicked()), | 541 SIGNAL(clicked()), |
507 this, | 542 this, |
508 SLOT(toggleUpdatesRemove())); | 543 SLOT(toggleUpdatesRemove())); |
509 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates); | 544 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates); |
510 updatesRemoveLayout->addWidget(updatesDetailsRemove); | 545 updatesRemoveLayout->addWidget(mUpdatesDetailsRemove); |
511 updatesRemoveLayout->insertStretch(2, 10); | 546 updatesRemoveLayout->insertStretch(2, 10); |
512 mUpdatesRemove = new CertificateListWidget(this); | 547 mUpdatesRemove = new CertificateListWidget(this); |
513 connect(mUpdatesRemove, SIGNAL(certListChanged(int)), | 548 connect(mUpdatesRemove, SIGNAL(certListChanged(int)), |
514 this, SLOT(listChanged(int))); | 549 this, SLOT(listChanged(int))); |
515 mUpdatesRemove->hide(); | 550 mUpdatesRemove->hide(); |
516 | 551 |
517 mUpdatesManualCertificates = | 552 mUpdatesManualCertificates = |
518 new QLabel("<h3>" + | 553 new QLabel("<h3>" + |
519 tr("Manualy changed Certificates (%1)").arg(2) + | 554 tr("Manualy changed Certificates (%1)").arg(0) + |
520 "</h3>"); | 555 "</h3>"); |
521 QPushButton *updatesDetailsManual = new QPushButton(tr("Details")); | 556 mUpdatesDetailsManual = new QPushButton(tr("Show Details")); |
522 connect(updatesDetailsManual, | 557 connect(mUpdatesDetailsManual, |
523 SIGNAL(clicked()), | 558 SIGNAL(clicked()), |
524 this, | 559 this, |
525 SLOT(toggleUpdatesManual())); | 560 SLOT(toggleUpdatesManual())); |
526 updatesManualLayout->addWidget(mUpdatesManualCertificates); | 561 updatesManualLayout->addWidget(mUpdatesManualCertificates); |
527 updatesManualLayout->addWidget(updatesDetailsManual); | 562 updatesManualLayout->addWidget(mUpdatesDetailsManual); |
528 updatesManualLayout->insertStretch(2, 10); | 563 updatesManualLayout->insertStretch(2, 10); |
529 mUpdatesManual = new CertificateListWidget(this); | 564 mUpdatesManual = new CertificateListWidget(this); |
530 mUpdatesManual->hide(); | 565 mUpdatesManual->hide(); |
531 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)), | 566 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)), |
532 this, SLOT(removeFromManual(bool, const Certificate&))); | 567 this, SLOT(removeFromManual(bool, const Certificate&))); |
533 | 568 |
534 QHBoxLayout *updatesBottomLayout = new QHBoxLayout; | |
535 QPushButton *quitButton = new QPushButton(tr("Quit without saving")); | |
536 QPushButton *installButton = new QPushButton(tr("Update")); | |
537 #ifdef Q_OS_WIN | |
538 if (is_admin()) { | |
539 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); | |
540 installButton->setIcon(uacShield); | |
541 } | |
542 #endif | |
543 connect(quitButton, SIGNAL(clicked()), this, SLOT(closeApp())); | |
544 connect(installButton, SIGNAL(clicked()), this, SLOT(installCerts())); | |
545 updatesBottomLayout->insertStretch(0, 10); | |
546 updatesBottomLayout->addWidget(installButton); | |
547 updatesBottomLayout->addWidget(quitButton); | |
548 updatesBottomLayout->setAlignment(Qt::AlignBottom); | |
549 | |
550 updatesNewLayout->setAlignment(Qt::AlignTop); | 569 updatesNewLayout->setAlignment(Qt::AlignTop); |
551 updatesRemoveLayout->setAlignment(Qt::AlignTop); | 570 updatesRemoveLayout->setAlignment(Qt::AlignTop); |
552 updatesManualLayout->setAlignment(Qt::AlignTop); | 571 updatesManualLayout->setAlignment(Qt::AlignTop); |
553 updatesCenterLayout->addWidget(updatesTip, 0, Qt::AlignTop); | |
554 updatesCenterLayout->addLayout(updatesNewLayout); | 572 updatesCenterLayout->addLayout(updatesNewLayout); |
555 // updatesCenterLayout->setStretchFactor(updatesNewLayout, 100); | 573 updatesCenterLayout->addWidget(mUpdatesNew); |
556 updatesCenterLayout->addWidget(mUpdatesNew, 1, Qt::AlignTop); | |
557 updatesCenterLayout->addLayout(updatesRemoveLayout); | 574 updatesCenterLayout->addLayout(updatesRemoveLayout); |
558 // updatesCenterLayout->setStretchFactor(updatesRemoveLayout, 100); | 575 updatesCenterLayout->addWidget(mUpdatesRemove); |
559 updatesCenterLayout->addWidget(mUpdatesRemove, 1, Qt::AlignTop); | |
560 updatesCenterLayout->addLayout(updatesManualLayout); | 576 updatesCenterLayout->addLayout(updatesManualLayout); |
561 // updatesCenterLayout->setStretchFactor(updatesManualLayout, 100); | 577 updatesCenterLayout->addWidget(mUpdatesManual); |
562 updatesCenterLayout->addWidget(mUpdatesManual, 1, Qt::AlignTop); | 578 updatesCenterLayout->addStretch(1); |
563 updatesCenterLayout->insertStretch(7, 0); | 579 |
564 updatesCenterLayout->addLayout(updatesBottomLayout); | 580 updatesCenterLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); |
565 | 581 mUpdatesWidget->setLayout(updatesCenterLayout); |
566 | 582 updatesContent->setWidget(mUpdatesWidget); |
567 QFrame *updatesPanelSeparator = new QFrame(); | 583 |
568 updatesPanelSeparator->setFrameShape(QFrame::HLine); | 584 updatesMainLayout->addLayout(updatesHeaderLayout); |
569 updatesPanelSeparator->setFrameShadow(QFrame::Sunken); | 585 updatesMainLayout->addWidget(updatesContent); |
570 updatesPanelLayout->addLayout(updatesHeaderLayout); | 586 mUpdatesPanel->setLayout(updatesMainLayout); |
571 updatesPanelLayout->addWidget(updatesPanelSeparator); | 587 |
572 updatesPanelLayout->addLayout(updatesCenterLayout); | 588 /********************************* |
573 updatesPanelLayout->setStretchFactor(updatesCenterLayout, 1); | 589 * Panel for trusted certificates. |
574 //updatesPanelLayout->insertStretch(3, 2); | 590 *********************************/ |
575 //updatesPanelLayout->addLayout(updatesBottomLayout); | |
576 mUpdatesWidget->setLayout(updatesPanelLayout); | |
577 mUpdatesWidget->setMinimumSize(QSize(820, 440)); | |
578 mUpdatesPanel->setWidget(mUpdatesWidget); | |
579 | |
580 // Panel for trusted certificates. | |
581 mInstallPanel = new QScrollArea; | 591 mInstallPanel = new QScrollArea; |
582 | 592 |
583 QVBoxLayout *installPanelLayout = new QVBoxLayout; | 593 QVBoxLayout *installPanelLayout = new QVBoxLayout; |
584 QVBoxLayout *installHeaderLayout = new QVBoxLayout; | 594 QVBoxLayout *installHeaderLayout = new QVBoxLayout; |
585 QVBoxLayout *installCenterLayout = new QVBoxLayout; | 595 QVBoxLayout *installCenterLayout = new QVBoxLayout; |
604 installPanelLayout->addLayout(installHeaderLayout); | 614 installPanelLayout->addLayout(installHeaderLayout); |
605 installPanelLayout->addLayout(installCenterLayout); | 615 installPanelLayout->addLayout(installCenterLayout); |
606 installPanelLayout->addWidget(mInstallList); | 616 installPanelLayout->addWidget(mInstallList); |
607 mInstallPanel->setLayout(installPanelLayout); | 617 mInstallPanel->setLayout(installPanelLayout); |
608 | 618 |
609 // Panel for insecure certificates. | 619 /********************************** |
620 * Panel for insecure certificates. | |
621 **********************************/ | |
610 mRemovePanel = new QScrollArea; | 622 mRemovePanel = new QScrollArea; |
611 QVBoxLayout *removePanelLayout = new QVBoxLayout; | 623 QVBoxLayout *removePanelLayout = new QVBoxLayout; |
612 QVBoxLayout *removeHeaderLayout = new QVBoxLayout; | 624 QVBoxLayout *removeHeaderLayout = new QVBoxLayout; |
613 QVBoxLayout *removeCenterLayout = new QVBoxLayout; | 625 QVBoxLayout *removeCenterLayout = new QVBoxLayout; |
614 | 626 |
630 removePanelLayout->addLayout(removeHeaderLayout); | 642 removePanelLayout->addLayout(removeHeaderLayout); |
631 removePanelLayout->addLayout(removeCenterLayout); | 643 removePanelLayout->addLayout(removeCenterLayout); |
632 removePanelLayout->addWidget(mRemoveList); | 644 removePanelLayout->addWidget(mRemoveList); |
633 mRemovePanel->setLayout(removePanelLayout); | 645 mRemovePanel->setLayout(removePanelLayout); |
634 | 646 |
635 // Info panel. | 647 /********************************** |
648 * The info panel. | |
649 **********************************/ | |
636 mInfoPanel = new QScrollArea; | 650 mInfoPanel = new QScrollArea; |
637 | 651 |
638 QVBoxLayout *infoPanelLayout = new QVBoxLayout; | 652 QVBoxLayout *infoPanelLayout = new QVBoxLayout; |
639 QHBoxLayout *infoHeaderLayout = new QHBoxLayout; | 653 QHBoxLayout *infoHeaderLayout = new QHBoxLayout; |
640 QVBoxLayout *infoHeaderTextLayout = new QVBoxLayout; | 654 QVBoxLayout *infoHeaderTextLayout = new QVBoxLayout; |
699 | 713 |
700 infoPanelLayout->addLayout(infoHeaderLayout); | 714 infoPanelLayout->addLayout(infoHeaderLayout); |
701 infoPanelLayout->addLayout(infoCenterLayout); | 715 infoPanelLayout->addLayout(infoCenterLayout); |
702 mInfoPanel->setLayout(infoPanelLayout); | 716 mInfoPanel->setLayout(infoPanelLayout); |
703 | 717 |
704 // The main layout for pages. | 718 /******************************** |
719 * The main layout for pages. | |
720 ********************************/ | |
705 mInstallPanel->hide(); | 721 mInstallPanel->hide(); |
706 mRemovePanel->hide(); | 722 mRemovePanel->hide(); |
707 mInfoPanel->hide(); | 723 mInfoPanel->hide(); |
708 containerLayout->addWidget(mUpdatesPanel); | 724 containerLayout->addWidget(mUpdatesPanel); |
709 containerLayout->addWidget(mInstallPanel); | 725 containerLayout->addWidget(mInstallPanel); |
711 containerLayout->addWidget(mInfoPanel); | 727 containerLayout->addWidget(mInfoPanel); |
712 | 728 |
713 centerLayout->addLayout(buttonBarLayout); | 729 centerLayout->addLayout(buttonBarLayout); |
714 centerLayout->addLayout(containerLayout); | 730 centerLayout->addLayout(containerLayout); |
715 | 731 |
716 QFrame *topSeparator = new QFrame(); | |
717 topSeparator->setFrameShape(QFrame::HLine); | |
718 topSeparator->setFrameShadow(QFrame::Sunken); | |
719 | |
720 mainLayout->addLayout(headerLayout); | 732 mainLayout->addLayout(headerLayout); |
721 mainLayout->addWidget(topSeparator); | |
722 mainLayout->addLayout(centerLayout); | 733 mainLayout->addLayout(centerLayout); |
723 mainLayout->addLayout(bottomLayout); | 734 mainLayout->addLayout(bottomLayout); |
724 base->setLayout(mainLayout); | 735 base->setLayout(mainLayout); |
725 setCentralWidget(base); | 736 setCentralWidget(base); |
726 } | 737 } |
767 else { | 778 else { |
768 oldRemoveCerts.append(cert); | 779 oldRemoveCerts.append(cert); |
769 mRemoveList->addCertificate(cert, state, !state); | 780 mRemoveList->addCertificate(cert, state, !state); |
770 } | 781 } |
771 } | 782 } |
772 // Set the date of the old list. | |
773 // mCurrentListDate->setText(tr("Current List Date: %1") | |
774 // .arg(mInstalledList.date().toString())); | |
775 } | 783 } |
776 else { | 784 else { |
777 // Sort and filter both lists. | 785 // Sort and filter both lists. |
778 foreach (const Certificate &cert, mListToInstall.getCertificates()) { | 786 foreach (const Certificate &cert, mListToInstall.getCertificates()) { |
779 bool state = !mPreviouslyUnselected.contains(cert.base64Line()); | 787 bool state = !mPreviouslyUnselected.contains(cert.base64Line()); |
810 tr("Updates (%1/%2)") | 818 tr("Updates (%1/%2)") |
811 .arg(mUpdatesNew->selectedCertCount() + mUpdatesRemove->selectedCertCount()) | 819 .arg(mUpdatesNew->selectedCertCount() + mUpdatesRemove->selectedCertCount()) |
812 .arg(newRemoveCerts.size() + newInstallCerts.size()) + "</h2>"); | 820 .arg(newRemoveCerts.size() + newInstallCerts.size()) + "</h2>"); |
813 mLastCertUpdate->setText(tr("Last certificate update: %1") | 821 mLastCertUpdate->setText(tr("Last certificate update: %1") |
814 .arg(mInstalledList.date().toString())); | 822 .arg(mInstalledList.date().toString())); |
815 /* mCurrentListDate->setText(tr("Current List Date: %1") | |
816 .arg(mInstalledList.date().toString())); | |
817 mNewListDate->setText(tr("New List Date: %1").arg(mListToInstall.date().toString()));*/ | |
818 } | 823 } |
819 mUpdatesNewCertificates->setText("<h3>" + | 824 mUpdatesNewCertificates->setText("<h3>" + |
820 tr("Install new Certificates (%1/%2)") | 825 tr("Install new Certificates (%1/%2)") |
821 .arg(mUpdatesNew->selectedCertCount()) | 826 .arg(mUpdatesNew->selectedCertCount()) |
822 .arg(mUpdatesNew->certificates().size()) + | 827 .arg(mUpdatesNew->certificates().size()) + |
990 } | 995 } |
991 return; | 996 return; |
992 } | 997 } |
993 | 998 |
994 void MainWindow::toggleUpdatesNew() { | 999 void MainWindow::toggleUpdatesNew() { |
995 QSize old = mUpdatesWidget->size(); | |
996 if (!mUpdatesNew->isVisible()) { | 1000 if (!mUpdatesNew->isVisible()) { |
997 mUpdatesNew->show(); | 1001 mUpdatesNew->show(); |
998 if (mUpdatesNewSize == 0) { | 1002 if (mUpdatesNewSize == 0) { |
999 mUpdatesNewSize = mUpdatesNew->height(); | 1003 mUpdatesNewSize = mUpdatesNew->height(); |
1000 } | 1004 } |