diff options
author | 2022-02-28 18:08:28 +0530 | |
---|---|---|
committer | 2022-02-28 18:08:28 +0530 | |
commit | 9867a6b6279229d53fe59854a511c9eea9888427 (patch) | |
tree | cefdf3aa78e35741100a554f0fc25d75c4ef3065 /src/about.cpp | |
parent | 020ac6daeac226da90bc0c884a9b22a7da9baa99 (diff) | |
download | whatsie-9867a6b6279229d53fe59854a511c9eea9888427.tar.gz whatsie-9867a6b6279229d53fe59854a511c9eea9888427.zip |
build: migrate to qt 5.15
Diffstat (limited to 'src/about.cpp')
-rw-r--r-- | src/about.cpp | 172 |
1 files changed, 81 insertions, 91 deletions
diff --git a/src/about.cpp b/src/about.cpp index 2212700..9038f20 100644 --- a/src/about.cpp +++ b/src/about.cpp @@ -6,102 +6,92 @@ #include <QUrl> #include <utils.h> -About::About(QWidget *parent) : - QWidget(parent), - ui(new Ui::About) -{ - ui->setupUi(this); - - //init - appName = QApplication::applicationName(); - appDescription = "WhatsApp Web clinet for Linux Desktop"; - isOpenSource = true; - appAuthorName = "Keshav Bhatt"; - appAuthorEmail = "keshavnrj@gmail.com"; - appAuthorLink = "http://ktechpit.com"; - donateLink = "https://paypal.me/keshavnrj/5"; - moreAppsLink = "https://snapcraft.io/search?q=keshavnrj"; - - appSourceCodeLink = "https://github.com/keshavbhatt/whatsie"; - appRateLink = "snap://whatsie"; - - - ui->appNameDesc->setText(QString("<p style=' margin-top:12px; margin-bottom:12px; margin-left:0px;" - " margin-right:0px; -qt-block-indent:0; text-indent:0px;'>" - "<span style=' font-size:18pt;'>%1</span></p>" - "<p style=' margin-top:12px; margin-bottom:12px; margin-left:0px;" - " margin-right:0px; -qt-block-indent:0; text-indent:0px;'>" - "%2</p>").arg(appName,appDescription)); - - ui->desc2->setText(QString("<p><span style=' font-weight:600;'>Designed & Developed by:</span>" - " %1 </p><p><span style=' font-weight:600;'>" - "Developer Email address: </span>%2</p>" - "<p><span style=' font-weight:600;'>Developer Website:</span>" - " %3</p>").arg(appAuthorName,appAuthorEmail,appAuthorLink)); - - - ui->version->setText("Version: "+QApplication::applicationVersion()); +About::About(QWidget *parent) : QWidget(parent), ui(new Ui::About) { + ui->setupUi(this); + + // init + appName = QApplication::applicationName(); + appDescription = "WhatsApp Web clinet for Linux Desktop"; + isOpenSource = true; + appAuthorName = "Keshav Bhatt"; + appAuthorEmail = "keshavnrj@gmail.com"; + appAuthorLink = "http://ktechpit.com"; + donateLink = "https://paypal.me/keshavnrj/5"; + moreAppsLink = "https://snapcraft.io/search?q=keshavnrj"; + + appSourceCodeLink = "https://github.com/keshavbhatt/whatsie"; + appRateLink = "snap://whatsie"; + + ui->appNameDesc->setText( + QString("<p style=' margin-top:12px; margin-bottom:12px; margin-left:0px;" + " margin-right:0px; -qt-block-indent:0; text-indent:0px;'>" + "<span style=' font-size:18pt;'>%1</span></p>" + "<p style=' margin-top:12px; margin-bottom:12px; margin-left:0px;" + " margin-right:0px; -qt-block-indent:0; text-indent:0px;'>" + "%2</p>") + .arg(appName, appDescription)); + + ui->desc2->setText( + QString("<p><span style=' font-weight:600;'>Designed & Developed " + "by:</span>" + " %1 </p><p><span style=' font-weight:600;'>" + "Developer Email address: </span>%2</p>" + "<p><span style=' font-weight:600;'>Developer Website:</span>" + " %3</p>") + .arg(appAuthorName, appAuthorEmail, appAuthorLink)); + + ui->version->setText("Version: " + QApplication::applicationVersion()); + + ui->debugInfoText->setHtml(utils::appDebugInfo()); + + ui->debugInfoText->hide(); + + ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); + + if (isOpenSource == false) { + ui->source_code->hide(); + } + + connect(ui->donate, &QPushButton::clicked, + [=]() { QDesktopServices::openUrl(QUrl(donateLink)); }); + + connect(ui->rate, &QPushButton::clicked, + [=]() { QDesktopServices::openUrl(QUrl(appRateLink)); }); + connect(ui->more_apps, &QPushButton::clicked, + [=]() { QDesktopServices::openUrl(QUrl(moreAppsLink)); }); + connect(ui->source_code, &QPushButton::clicked, + [=]() { QDesktopServices::openUrl(QUrl(appSourceCodeLink)); }); + + setWindowTitle(QApplication::applicationName() + " | About"); + + ui->centerWidget->hide(); + + QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this); + ui->centerWidget->setGraphicsEffect(eff); + QPropertyAnimation *a = new QPropertyAnimation(eff, "opacity"); + a->setDuration(1000); + a->setStartValue(0); + a->setEndValue(1); + a->setEasingCurve(QEasingCurve::InCurve); + a->start(QPropertyAnimation::DeleteWhenStopped); + ui->centerWidget->show(); +} - ui->debugInfoText->setHtml(utils::appDebugInfo()); +About::~About() { delete ui; } +void About::on_debugInfoButton_clicked() { + if (ui->debugInfoText->isVisible()) { ui->debugInfoText->hide(); - ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); - if(isOpenSource == false){ - ui->source_code->hide(); - } - - connect(ui->donate,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl(donateLink)); - }); - - connect(ui->rate,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl(appRateLink)); - }); - connect(ui->more_apps,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl(moreAppsLink)); - }); - connect(ui->source_code,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl(appSourceCodeLink)); - }); - - setWindowTitle(QApplication::applicationName() +" | About"); - - ui->centerWidget->hide(); - - QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this); - ui->centerWidget->setGraphicsEffect(eff); - QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); - a->setDuration(1000); - a->setStartValue(0); - a->setEndValue(1); - a->setEasingCurve(QEasingCurve::InCurve); - a->start(QPropertyAnimation::DeleteWhenStopped); - ui->centerWidget->show(); -} - -About::~About() -{ - delete ui; -} - -void About::on_debugInfoButton_clicked() -{ - if(ui->debugInfoText->isVisible()){ - ui->debugInfoText->hide(); - ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); - - this->resize(this->width(),this->minimumHeight()); - }else{ - ui->debugInfoText->show(); - ui->debugInfoButton->setText(QObject::tr("Hide Debug Info")); - this->adjustSize(); - } - + this->resize(this->width(), this->minimumHeight()); + } else { + ui->debugInfoText->show(); + ui->debugInfoButton->setText(QObject::tr("Hide Debug Info")); + this->adjustSize(); + } } -void About::on_donate_2_clicked() -{ - QDesktopServices::openUrl(QUrl("https://opencollective.com/whatsie")); +void About::on_donate_2_clicked() { + QDesktopServices::openUrl(QUrl("https://opencollective.com/whatsie")); } |