aboutsummaryrefslogtreecommitdiff
path: root/src/about.cpp
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahm@jadupc.com>2023-03-07 21:11:06 +0600
committerLibravatar Mubashshir <ahm@jadupc.com>2023-03-07 21:11:06 +0600
commitd830bfc8ce7c6763d074beafdde7cab1835d31f9 (patch)
tree179f81f3b42779b1f6fb69deed6b69dab39f4f89 /src/about.cpp
downloadwhatsie-d830bfc8ce7c6763d074beafdde7cab1835d31f9.tar.gz
whatsie-d830bfc8ce7c6763d074beafdde7cab1835d31f9.zip
Import Upstream version 4.12.0upstream/4.12.0
Diffstat (limited to 'src/about.cpp')
-rw-r--r--src/about.cpp97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/about.cpp b/src/about.cpp
new file mode 100644
index 0000000..ba54a7e
--- /dev/null
+++ b/src/about.cpp
@@ -0,0 +1,97 @@
+#include "about.h"
+#include "ui_about.h"
+#include <QDesktopServices>
+#include <QGraphicsOpacityEffect>
+#include <QPropertyAnimation>
+#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 client 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 &amp; Developed "
+ "by:</span>"
+ " %1 </p><p><span style=' font-weight:600;'>"
+ "Email: </span>%2</p>"
+ "<p><span style=' font-weight:600;'>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();
+}
+
+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();
+ }
+}
+
+void About::on_donate_2_clicked() {
+ QDesktopServices::openUrl(QUrl("https://opencollective.com/whatsie"));
+}