diff options
author | 2021-04-18 13:10:38 +0530 | |
---|---|---|
committer | 2021-04-18 13:10:38 +0530 | |
commit | d89d8215a6aa357731ca465c404b8b05a78b06c6 (patch) | |
tree | 3aad2c1cd356db3e79f82d072a1422bededc68c4 | |
parent | a6f0d4166e202f889c988de2a6a7ddad9ad240a9 (diff) | |
download | whatsie-d89d8215a6aa357731ca465c404b8b05a78b06c6.tar.gz whatsie-d89d8215a6aa357731ca465c404b8b05a78b06c6.zip |
updated class
-rw-r--r-- | src/about.cpp | 52 | ||||
-rw-r--r-- | src/about.h | 6 | ||||
-rw-r--r-- | src/about.ui | 6 |
3 files changed, 50 insertions, 14 deletions
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 <QDesktopServices> #include <QGraphicsOpacityEffect> #include <QPropertyAnimation> -#include <QTimer> #include <QUrl> #include <utils.h> @@ -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("<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")); + 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 @@ <x>0</x> <y>0</y> <width>522</width> - <height>454</height> + <height>486</height> </rect> </property> <property name="windowTitle"> @@ -112,7 +112,7 @@ <widget class="QWidget" name="info" native="true"> <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <widget class="QLabel" name="label_2"> + <widget class="QLabel" name="appNameDesc"> <property name="text"> <string><!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; } </widget> </item> <item> - <widget class="QLabel" name="version_2"> + <widget class="QLabel" name="desc2"> <property name="text"> <string><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></string> </property> |