GUI: added little popup dialog on closing
This commit is contained in:
parent
4ef1fc9e40
commit
04fadb5f46
|
@ -69,7 +69,8 @@ SOURCES += \
|
|||
Src/Utils/Configuration.cpp \
|
||||
Src/Gui/CPUSideBar.cpp \
|
||||
Src/Gui/AppearanceDialog.cpp \
|
||||
Src/Disassembler/BeaTokenizer.cpp
|
||||
Src/Disassembler/BeaTokenizer.cpp \
|
||||
Src/Gui/CloseDialog.cpp
|
||||
|
||||
|
||||
HEADERS += \
|
||||
|
@ -117,7 +118,8 @@ HEADERS += \
|
|||
Src/Utils/Configuration.h \
|
||||
Src/Gui/CPUSideBar.h \
|
||||
Src/Gui/AppearanceDialog.h \
|
||||
Src/Disassembler/BeaTokenizer.h
|
||||
Src/Disassembler/BeaTokenizer.h \
|
||||
Src/Gui/CloseDialog.h
|
||||
|
||||
|
||||
INCLUDEPATH += \
|
||||
|
@ -144,7 +146,8 @@ FORMS += \
|
|||
Src/Gui/SettingsDialog.ui \
|
||||
Src/Gui/ExceptionRangeDialog.ui \
|
||||
Src/Gui/CommandHelpView.ui \
|
||||
Src/Gui/AppearanceDialog.ui
|
||||
Src/Gui/AppearanceDialog.ui \
|
||||
Src/Gui/CloseDialog.ui
|
||||
|
||||
INCLUDEPATH += $$PWD/Src/Bridge
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#include "CloseDialog.h"
|
||||
#include "ui_CloseDialog.h"
|
||||
|
||||
CloseDialog::CloseDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CloseDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setModal(true);
|
||||
setWindowFlags((Qt::Tool | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint) & ~Qt::WindowCloseButtonHint);
|
||||
setFixedSize(this->size()); //fixed size
|
||||
//setWindowFlags(((windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint));
|
||||
}
|
||||
|
||||
CloseDialog::~CloseDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef CLOSEDIALOG_H
|
||||
#define CLOSEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class CloseDialog;
|
||||
}
|
||||
|
||||
class CloseDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CloseDialog(QWidget *parent = 0);
|
||||
~CloseDialog();
|
||||
|
||||
private:
|
||||
Ui::CloseDialog *ui;
|
||||
};
|
||||
|
||||
#endif // CLOSEDIALOG_H
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CloseDialog</class>
|
||||
<widget class="QDialog" name="CloseDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>220</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>220</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Closing Debugger...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -154,6 +154,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
initMenuApi();
|
||||
|
||||
bClose=false;
|
||||
mCloseDialog = new CloseDialog(this);
|
||||
}
|
||||
|
||||
DWORD WINAPI MainWindow::closeThread(void* ptr)
|
||||
|
@ -171,6 +172,7 @@ DWORD WINAPI MainWindow::closeThread(void* ptr)
|
|||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
mCloseDialog->show();
|
||||
CloseHandle(CreateThread(0, 0, closeThread, this, 0, 0));
|
||||
if(bClose)
|
||||
event->accept();
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "tabwidget.h"
|
||||
#include "Configuration.h"
|
||||
#include "AppearanceDialog.h"
|
||||
#include "CloseDialog.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
@ -79,6 +80,7 @@ public slots:
|
|||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
CloseDialog* mCloseDialog;
|
||||
|
||||
CommandLineEdit* mCmdLineEdit;
|
||||
MHTabWidget* mTabWidget;
|
||||
|
|
Loading…
Reference in New Issue