diff options
author | 2021-04-07 21:47:26 +0530 | |
---|---|---|
committer | 2021-04-07 21:47:26 +0530 | |
commit | 45f71bc6abada7ad8eb0515959aa667208d78faf (patch) | |
tree | 35b052037da1f3209f8c92e39add7c153c7dcf72 /src | |
parent | 3808c7afabaf3217b2641083cc3a07e771848eaa (diff) | |
download | whatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.tar.gz whatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.zip |
added debug info widget in about dialog
Diffstat (limited to 'src')
-rw-r--r-- | src/about.cpp | 24 | ||||
-rw-r--r-- | src/about.h | 3 | ||||
-rw-r--r-- | src/about.ui | 252 |
3 files changed, 162 insertions, 117 deletions
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 <QDesktopServices> #include <QGraphicsOpacityEffect> #include <QPropertyAnimation> +#include <QTimer> #include <QUrl> +#include <utils.h> 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 @@ <rect> <x>0</x> <y>0</y> - <width>509</width> - <height>267</height> + <width>522</width> + <height>454</height> </rect> </property> <property name="windowTitle"> @@ -30,126 +30,124 @@ <widget class="QWidget" name="centerWidget" native="true"> <layout class="QVBoxLayout" name="verticalLayout_5"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <property name="rightMargin"> - <number>12</number> - </property> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>100</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>100</width> - <height>100</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="icons.qrc">:/icons/app/icon-256.png</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <widget class="QWidget" name="topWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="rightMargin"> + <number>12</number> + </property> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>100</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>100</width> + <height>100</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="icons.qrc">:/icons/app/icon-256.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QWidget" name="info" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QLabel" name="label_2"> + <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"> 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></string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="version"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>-</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="version_2"> - <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> - </widget> - </item> - </layout> - </item> - </layout> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="version"> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="version_2"> + <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> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> </item> <item> <widget class="QWidget" name="widget" native="true"> @@ -201,9 +199,29 @@ p, li { white-space: pre-wrap; } </item> </layout> </item> + <item> + <widget class="QPushButton" name="debugInfoButton"> + <property name="text"> + <string>Debug Info</string> + </property> + </widget> + </item> </layout> </widget> </item> + <item> + <widget class="QTextBrowser" name="debugInfoText"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>150</height> + </size> + </property> + <property name="sizeAdjustPolicy"> + <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> + </property> + </widget> + </item> </layout> </widget> </item> |