aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-18 13:10:38 +0530
committerLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-18 13:10:38 +0530
commitd89d8215a6aa357731ca465c404b8b05a78b06c6 (patch)
tree3aad2c1cd356db3e79f82d072a1422bededc68c4
parenta6f0d4166e202f889c988de2a6a7ddad9ad240a9 (diff)
downloadwhatsie-d89d8215a6aa357731ca465c404b8b05a78b06c6.tar.gz
whatsie-d89d8215a6aa357731ca465c404b8b05a78b06c6.zip
updated class
-rw-r--r--src/about.cpp52
-rw-r--r--src/about.h6
-rw-r--r--src/about.ui6
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 &amp; 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>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
@@ -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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Designed &amp;amp; Developed by:&lt;/span&gt; Keshav Bhatt &lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Developer Email address: &lt;/span&gt;keshavnrj@gmail.com&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Developer Website:&lt;/span&gt; http://ktechpit.com&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>