From 45f71bc6abada7ad8eb0515959aa667208d78faf Mon Sep 17 00:00:00 2001 From: keshavbhatt Date: Wed, 7 Apr 2021 21:47:26 +0530 Subject: added debug info widget in about dialog --- src/about.cpp | 24 ++++++ src/about.h | 3 + src/about.ui | 252 +++++++++++++++++++++++++++++++--------------------------- 3 files changed, 162 insertions(+), 117 deletions(-) (limited to 'src') diff --git a/src/about.cpp b/src/about.cpp index c49e68b..b48c7e2 100644 --- a/src/about.cpp +++ b/src/about.cpp @@ -3,7 +3,9 @@ #include #include #include +#include #include +#include About::About(QWidget *parent) : QWidget(parent), @@ -11,6 +13,11 @@ About::About(QWidget *parent) : { ui->setupUi(this); + ui->debugInfoText->setHtml(utils::appDebugInfo()); + ui->debugInfoText->hide(); + ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); + + ui->version->setText("Version: "+QApplication::applicationVersion()); connect(ui->donate,&QPushButton::clicked,[=](){ @@ -46,3 +53,20 @@ About::~About() { delete ui; } + +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()); + }); + }else{ + ui->debugInfoText->show(); + ui->debugInfoButton->setText(QObject::tr("Hide Debug Info")); + this->adjustSize(); + } + +} diff --git a/src/about.h b/src/about.h index 360749f..89d279b 100644 --- a/src/about.h +++ b/src/about.h @@ -15,6 +15,9 @@ public: explicit About(QWidget *parent = nullptr); ~About(); +private slots: + void on_debugInfoButton_clicked(); + private: Ui::About *ui; }; diff --git a/src/about.ui b/src/about.ui index 0baa5a5..7d78f53 100644 --- a/src/about.ui +++ b/src/about.ui @@ -6,8 +6,8 @@ 0 0 - 509 - 267 + 522 + 454 @@ -30,126 +30,124 @@ - - - - - QLayout::SetDefaultConstraint - - - 12 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 100 - 100 - - - - - 100 - 100 - - - - - - - :/icons/app/icon-256.png - - - true - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - 0 - 0 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + 0 + 0 + + + + + + + QLayout::SetDefaultConstraint + + + 12 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 100 + 100 + + + + + 100 + 100 + + + + + + + :/icons/app/icon-256.png + + + true + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + <!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"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <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;">WhatSie</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">WhatsApp Web Client for Linux Desktop.</p></body></html> - - - true - - - true - - - - - - - - 0 - 0 - - - - - - - - - - - - <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> - - - - - - + + + true + + + true + + + + + + + - + + + + + + + <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> + + + + + + + + @@ -201,9 +199,29 @@ p, li { white-space: pre-wrap; } + + + + Debug Info + + + + + + + + 0 + 150 + + + + QAbstractScrollArea::AdjustToContentsOnFirstShow + + + -- cgit v1.2.3