From d89d8215a6aa357731ca465c404b8b05a78b06c6 Mon Sep 17 00:00:00 2001 From: keshavbhatt Date: Sun, 18 Apr 2021 13:10:38 +0530 Subject: updated class --- src/about.cpp | 52 +++++++++++++++++++++++++++++++++++++++++----------- src/about.h | 6 ++++++ src/about.ui | 6 +++--- 3 files changed, 50 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/about.cpp b/src/about.cpp index b48c7e2..617e773 100644 --- a/src/about.cpp +++ b/src/about.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -13,25 +12,58 @@ About::About(QWidget *parent) : { 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/whatsie"; + appRateLink = "snap://whatsie"; + + + ui->appNameDesc->setText(QString("

" + "%1

" + "

" + "%2

").arg(appName,appDescription)); + + ui->desc2->setText(QString("

Designed & Developed by:" + " %1

" + "Developer Email address: %2

" + "

Developer Website:" + " %3

").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")); + ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); - ui->version->setText("Version: "+QApplication::applicationVersion()); + if(isOpenSource == false){ + ui->source_code->hide(); + } connect(ui->donate,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl("https://paypal.me/keshavnrj/10")); + QDesktopServices::openUrl(QUrl(donateLink)); }); connect(ui->rate,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl("snap://whatsie")); + QDesktopServices::openUrl(QUrl(appRateLink)); }); connect(ui->more_apps,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl("https://snapcraft.io/search?q=keshavnrj")); + QDesktopServices::openUrl(QUrl(moreAppsLink)); }); connect(ui->source_code,&QPushButton::clicked,[=](){ - QDesktopServices::openUrl(QUrl("https://github.com/keshavbhatt/whatsie")); + QDesktopServices::openUrl(QUrl(appSourceCodeLink)); }); setWindowTitle(QApplication::applicationName() +" | About"); @@ -59,10 +91,8 @@ void About::on_debugInfoButton_clicked() if(ui->debugInfoText->isVisible()){ ui->debugInfoText->hide(); ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); - //update geometry after above loop is finished - QTimer::singleShot(300,this,[=]{ - this->resize(this->width(),this->minimumHeight()); - }); + + this->resize(this->width(),this->minimumHeight()); }else{ ui->debugInfoText->show(); ui->debugInfoButton->setText(QObject::tr("Hide Debug Info")); diff --git a/src/about.h b/src/about.h index 89d279b..34551b3 100644 --- a/src/about.h +++ b/src/about.h @@ -20,6 +20,12 @@ private slots: private: Ui::About *ui; + + QString appName, appDescription, + appSourceCodeLink, appAuthorLink, + appAuthorName, appAuthorEmail, + donateLink,moreAppsLink, appRateLink; + bool isOpenSource; }; #endif // ABOUT_H diff --git a/src/about.ui b/src/about.ui index 7d78f53..e8a09af 100644 --- a/src/about.ui +++ b/src/about.ui @@ -7,7 +7,7 @@ 0 0 522 - 454 + 486 @@ -112,7 +112,7 @@ - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -137,7 +137,7 @@ p, li { white-space: pre-wrap; } - + <html><head/><body><p><span style=" font-weight:600;">Designed &amp; Developed by:</span> Keshav Bhatt </p><p><span style=" font-weight:600;">Developer Email address: </span>keshavnrj@gmail.com</p><p><span style=" font-weight:600;">Developer Website:</span> http://ktechpit.com</p></body></html> -- cgit v1.2.3