aboutsummaryrefslogtreecommitdiff
path: root/src/about.cpp
diff options
context:
space:
mode:
authorLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-05 23:52:34 +0530
committerLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-05 23:52:34 +0530
commit939af726dc0b5e07e7d941719dfadf2c9831f4e0 (patch)
treebe02a45434a06dc77e10ab45e80017066a412287 /src/about.cpp
parentee687f769175b39b611424d5a7bdc11a93b3ba65 (diff)
downloadwhatsie-939af726dc0b5e07e7d941719dfadf2c9831f4e0.tar.gz
whatsie-939af726dc0b5e07e7d941719dfadf2c9831f4e0.zip
new about dialog
Diffstat (limited to 'src/about.cpp')
-rw-r--r--src/about.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/about.cpp b/src/about.cpp
new file mode 100644
index 0000000..c49e68b
--- /dev/null
+++ b/src/about.cpp
@@ -0,0 +1,48 @@
+#include "about.h"
+#include "ui_about.h"
+#include <QDesktopServices>
+#include <QGraphicsOpacityEffect>
+#include <QPropertyAnimation>
+#include <QUrl>
+
+About::About(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::About)
+{
+ ui->setupUi(this);
+
+ ui->version->setText("Version: "+QApplication::applicationVersion());
+
+ connect(ui->donate,&QPushButton::clicked,[=](){
+ QDesktopServices::openUrl(QUrl("https://paypal.me/keshavnrj/10"));
+ });
+
+ connect(ui->rate,&QPushButton::clicked,[=](){
+ QDesktopServices::openUrl(QUrl("snap://whatsie"));
+ });
+ connect(ui->more_apps,&QPushButton::clicked,[=](){
+ QDesktopServices::openUrl(QUrl("https://snapcraft.io/search?q=keshavnrj"));
+ });
+ connect(ui->source_code,&QPushButton::clicked,[=](){
+ QDesktopServices::openUrl(QUrl("https://github.com/keshavbhatt/whatsie"));
+ });
+
+ 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;
+}