1
0
Fork 0

New about box dialog (#1618)

* New about box dialog

* Minor fixes
This commit is contained in:
ThunderCls 2017-06-21 09:54:21 -04:00 committed by Duncan Ogilvie
parent ca060c17c1
commit ebd47a88a1
12 changed files with 439 additions and 34 deletions

View File

@ -0,0 +1,46 @@
#include "AboutDialog.h"
#include "UpdateChecker.h"
#include "ui_AboutDialog.h"
#include <StringUtil.h>
#include <QDesktopServices>
#include <QUrl>
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
//set window flags
setModal(true);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::MSWindowsFixedSizeDialogHint);
ui->lblVersion->setText(ToDateString(GetCompileDate()) + ", " __TIME__);
// Create updatechecker
mUpdateChecker = new UpdateChecker(this);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::on_lblWebsite_linkActivated(const QString &link)
{
QDesktopServices::openUrl(QUrl(link));
}
void AboutDialog::on_lblVersion_7_linkActivated(const QString &link)
{
QDesktopServices::openUrl(QUrl(link));
}
void AboutDialog::on_lblAbout_2_linkActivated(const QString &link)
{
QDesktopServices::openUrl(QUrl(link));
}
void AboutDialog::on_btnCheckUpdates_clicked()
{
mUpdateChecker->checkForUpdates();
}

View File

@ -0,0 +1,31 @@
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H
#include <QDialog>
class UpdateChecker;
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();
private slots:
void on_lblWebsite_linkActivated(const QString &link);
void on_lblVersion_7_linkActivated(const QString &link);
void on_btnCheckUpdates_clicked();
void on_lblAbout_2_linkActivated(const QString &link);
private:
Ui::AboutDialog *ui;
UpdateChecker* mUpdateChecker;
};
#endif // ABOUTDIALOG_H

View File

@ -0,0 +1,341 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>326</width>
<height>384</height>
</rect>
</property>
<property name="windowTitle">
<string>About x64dbg</string>
</property>
<property name="windowIcon">
<iconset resource="../../resource.qrc">
<normaloff>:/icons/images/information.png</normaloff>:/icons/images/information.png</iconset>
</property>
<widget class="QLabel" name="lblLogoImage">
<property name="geometry">
<rect>
<x>48</x>
<y>30</y>
<width>81</width>
<height>81</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../resource.qrc">:/icons/images/bug.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="lblWebsite">
<property name="geometry">
<rect>
<x>158</x>
<y>47</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://x64dbg.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://x64dbg.com&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
<widget class="QLabel" name="lblWebsiteTitle">
<property name="geometry">
<rect>
<x>158</x>
<y>30</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>Website:</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="lblVersionTitle">
<property name="geometry">
<rect>
<x>158</x>
<y>71</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>Version</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="lblVersion">
<property name="geometry">
<rect>
<x>158</x>
<y>88</y>
<width>141</width>
<height>16</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string/>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="lblAbout">
<property name="geometry">
<rect>
<x>46</x>
<y>126</y>
<width>241</width>
<height>20</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>An open-source x64/x32 debugger for windows.</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="btnCheckUpdates">
<property name="geometry">
<rect>
<x>100</x>
<y>164</y>
<width>121</width>
<height>28</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Check for Updates</string>
</property>
</widget>
<widget class="QLabel" name="lblDonation_2">
<property name="geometry">
<rect>
<x>21</x>
<y>276</y>
<width>201</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Consider donating using bitcoins using the following QR Code or just through the address: &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>
<widget class="QLabel" name="lblDonation">
<property name="geometry">
<rect>
<x>20</x>
<y>256</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Donations:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="lblDonation_3">
<property name="geometry">
<rect>
<x>22</x>
<y>336</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;You can also donate through the following link:&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>
<widget class="QLabel" name="lblVersion_7">
<property name="geometry">
<rect>
<x>45</x>
<y>350</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://donate.x64dbg.com&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;donate.x64dbg.com&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
<widget class="QLabel" name="lblQrImage">
<property name="geometry">
<rect>
<x>237</x>
<y>266</y>
<width>71</width>
<height>71</height>
</rect>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="pixmap">
<pixmap resource="../../resource.qrc">:/icons/images/donation_qr.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="lblAbout_2">
<property name="geometry">
<rect>
<x>20</x>
<y>314</y>
<width>201</width>
<height>20</height>
</rect>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://blockchain.info/address/1GuXgtCrLk4aYgivAT7xAi8zVHWk5CkEoY&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;1GuXgtCrLk4aYgivAT7xAi8zVHWk5CkEoY&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</widget>
<resources>
<include location="../../resource.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -33,7 +33,6 @@
#include "CalculatorDialog.h"
#include "DebugStatusLabel.h"
#include "LogStatusLabel.h"
#include "UpdateChecker.h"
#include "SourceViewerManager.h"
#include "SnowmanView.h"
#include "HandlesView.h"
@ -51,6 +50,7 @@
#include "SimpleTraceDialog.h"
#include "CPUArgumentWidget.h"
#include "MRUList.h"
#include "AboutDialog.h"
QString MainWindow::windowTitle = "";
@ -294,7 +294,6 @@ MainWindow::MainWindow(QWidget* parent)
connect(ui->actionLabels, SIGNAL(triggered()), this, SLOT(displayLabels()));
connect(ui->actionBookmarks, SIGNAL(triggered()), this, SLOT(displayBookmarks()));
connect(ui->actionFunctions, SIGNAL(triggered()), this, SLOT(displayFunctions()));
connect(ui->actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdates()));
connect(ui->actionCallStack, SIGNAL(triggered()), this, SLOT(displayCallstack()));
connect(ui->actionSEHChain, SIGNAL(triggered()), this, SLOT(displaySEHChain()));
connect(ui->actionDonate, SIGNAL(triggered()), this, SLOT(donate()));
@ -355,10 +354,11 @@ MainWindow::MainWindow(QWidget* parent)
defaultSettings.SaveSettings();
// Don't need to set shortcuts because the code above will signal refreshShortcuts()
// Create updatechecker
mUpdateChecker = new UpdateChecker(this);
mSimpleTraceDialog = new SimpleTraceDialog(this);
// About dialog
mAboutDialog = new AboutDialog(this);
// Setup close thread and dialog
bCanClose = false;
mCloseThread = new MainWindowCloseThread(this);
@ -703,7 +703,6 @@ void MainWindow::refreshShortcuts()
setGlobalShortcut(ui->actionAbout, ConfigShortcut("HelpAbout"));
setGlobalShortcut(ui->actionBlog, ConfigShortcut("HelpBlog"));
setGlobalShortcut(ui->actionDonate, ConfigShortcut("HelpDonate"));
setGlobalShortcut(ui->actionCheckUpdates, ConfigShortcut("HelpCheckForUpdates"));
setGlobalShortcut(ui->actionCalculator, ConfigShortcut("HelpCalculator"));
setGlobalShortcut(ui->actionReportBug, ConfigShortcut("HelpReportBug"));
setGlobalShortcut(ui->actionManual, ConfigShortcut("HelpManual"));
@ -813,18 +812,7 @@ void MainWindow::displayScriptWidget()
void MainWindow::displayAboutWidget()
{
#ifdef _WIN64
QString title = tr("About x64dbg");
#else
QString title = tr("About x32dbg");
#endif //_WIN64
title += QString().sprintf(" v%d", BridgeGetDbgVersion());
QMessageBox msg(QMessageBox::Information, title, tr("Website:<br><a href=\"http://x64dbg.com\">http://x64dbg.com</a><br><br>Attribution:<br><a href=\"http://icons8.com\">Icons8</a><br><a href=\"http://p.yusukekamiyamane.com\">Yusuke Kamiyamane</a><br><br>Compiled on:<br>") + ToDateString(GetCompileDate()) + ", " __TIME__);
msg.setWindowIcon(DIcon("information.png"));
msg.setTextFormat(Qt::RichText);
msg.setParent(this, Qt::Dialog);
msg.setWindowFlags(msg.windowFlags() & (~Qt::WindowContextHelpButtonHint));
msg.exec();
mAboutDialog->exec();
}
void MainWindow::openFileSlot()
@ -1386,11 +1374,6 @@ void MainWindow::displayFunctions()
displayReferencesWidget();
}
void MainWindow::checkUpdates()
{
mUpdateChecker->checkForUpdates();
}
void MainWindow::displayCallstack()
{
showQWidgetTab(mCallStackView);

View File

@ -23,7 +23,6 @@ class PatchDialog;
class CalculatorDialog;
class DebugStatusLabel;
class LogStatusLabel;
class UpdateChecker;
class SourceViewerManager;
class HandlesView;
class MainWindowCloseThread;
@ -33,6 +32,7 @@ class SettingsDialog;
class DisassemblerGraphView;
class SimpleTraceDialog;
class MRUList;
class AboutDialog;
namespace Ui
{
@ -121,7 +121,6 @@ public slots:
void displayLabels();
void displayBookmarks();
void displayFunctions();
void checkUpdates();
void crashDump();
void displayCallstack();
void displaySEHChain();
@ -178,11 +177,10 @@ private:
NotesManager* mNotesManager;
DisassemblerGraphView* mGraphView;
SimpleTraceDialog* mSimpleTraceDialog;
AboutDialog *mAboutDialog;
DebugStatusLabel* mStatusLabel;
LogStatusLabel* mLastLogLabel;
UpdateChecker* mUpdateChecker;
TimeWastedCounter* mTimeWastedCounter;
QString mWindowMainTitle;

View File

@ -143,7 +143,6 @@
<string>&amp;Help</string>
</property>
<addaction name="actionCalculator"/>
<addaction name="actionCheckUpdates"/>
<addaction name="actionBlog"/>
<addaction name="actionDonate"/>
<addaction name="actionReportBug"/>

View File

@ -430,7 +430,6 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultShortcuts.insert("HelpAbout", Shortcut({tr("Help"), tr("About")}, "", true));
defaultShortcuts.insert("HelpBlog", Shortcut({tr("Help"), tr("Blog")}, "", true));
defaultShortcuts.insert("HelpDonate", Shortcut({tr("Help"), tr("Donate")}, "", true));
defaultShortcuts.insert("HelpCheckForUpdates", Shortcut({tr("Help"), tr("Check for Updates")}, "", true));
defaultShortcuts.insert("HelpCalculator", Shortcut({tr("Help"), tr("Calculator")}, "?"));
defaultShortcuts.insert("HelpReportBug", Shortcut({tr("Help"), tr("Report Bug")}, "", true));
defaultShortcuts.insert("HelpManual", Shortcut({tr("Help"), tr("Manual")}, "F1", true));

BIN
src/gui/images/bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -309,5 +309,7 @@
<file>images/localvars.png</file>
<file>images/nextref.png</file>
<file>images/prevref.png</file>
<file>images/donation_qr.png</file>
<file>images/bug.png</file>
</qresource>
</RCC>

View File

@ -178,7 +178,8 @@ SOURCES += \
Src/Gui/BreakpointsViewTable.cpp \
Src/Utils/MRUList.cpp \
Src/Gui/LocalVarsView.cpp \
Src/Gui/MessagesBreakpoints.cpp
Src/Gui/MessagesBreakpoints.cpp \
Src/Gui/AboutDialog.cpp
HEADERS += \
@ -291,7 +292,8 @@ HEADERS += \
Src/Gui/BreakpointsViewTable.h \
Src/Utils/MRUList.h \
Src/Gui/LocalVarsView.h \
Src/Gui/MessagesBreakpoints.h
Src/Gui/MessagesBreakpoints.h \
Src/Gui/AboutDialog.h
FORMS += \
@ -331,7 +333,8 @@ FORMS += \
Src/Gui/CustomizeMenuDialog.ui \
Src/Gui/StructWidget.ui \
Src/Gui/SimpleTraceDialog.ui \
Src/Gui/MessagesBreakpoints.ui
Src/Gui/MessagesBreakpoints.ui \
Src/Gui/AboutDialog.ui
##
## Libraries

View File

@ -218,7 +218,8 @@ SOURCES += \
dbg/typesparser.cpp \
gui/Src/Utils/MRUList.cpp \
gui/Src/Gui/LocalVarsView.cpp \
gui/Src/Gui/MessagesBreakpoints.cpp
gui/Src/Gui/MessagesBreakpoints.cpp \
gui/Src/Gui/AboutDialog.cpp
HEADERS += \
gui/Src/Exports.h \
@ -447,7 +448,8 @@ HEADERS += \
dbg/types.h \
gui/Src/Utils/MRUList.h \
gui/Src/Gui/LocalVarsView.h \
gui/Src/Gui/MessagesBreakpoints.cpp
gui/Src/Gui/MessagesBreakpoints.h \
gui/Src/Gui/AboutDialog.h
FORMS += \
gui/Src/Gui/AppearanceDialog.ui \
@ -486,7 +488,8 @@ FORMS += \
gui/Src/Gui/CustomizeMenuDialog.ui \
gui/Src/Gui/SimpleTraceDialog.ui \
gui/Src/Gui/StructWidget.ui \
gui/Src/Gui/MessagesBreakpoints.ui
gui/Src/Gui/MessagesBreakpoints.ui \
gui/Src/Gui/AboutDialog.ui
TRANSLATIONS += \
gui/Translations/x64dbg.ts