aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-07 21:47:26 +0530
committerLibravatar keshavbhatt <keshavnrj@gmail.com>2021-04-07 21:47:26 +0530
commit45f71bc6abada7ad8eb0515959aa667208d78faf (patch)
tree35b052037da1f3209f8c92e39add7c153c7dcf72
parent3808c7afabaf3217b2641083cc3a07e771848eaa (diff)
downloadwhatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.tar.gz
whatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.zip
added debug info widget in about dialog
-rw-r--r--src/about.cpp24
-rw-r--r--src/about.h3
-rw-r--r--src/about.ui252
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>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+ <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>&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;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;WhatSie&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;WhatsApp Web Client for Linux Desktop.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>&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>
- </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>&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>
+ </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>