mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
fixes closing picture viewer exits client
This commit is contained in:
parent
36af584e1b
commit
918630e22e
2 changed files with 41 additions and 22 deletions
|
@ -128,7 +128,7 @@ void ProxGuiQT::_ShowPictureWindow(char *fn) {
|
||||||
makeFocusable();
|
makeFocusable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pictureWidget = new QWidget();
|
pictureWidget = new PictureWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
|
@ -171,14 +171,6 @@ void ProxGuiQT::_Exit(void) {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProxGuiQT::closeEvent(QCloseEvent *event) {
|
|
||||||
event->ignore();
|
|
||||||
pictureWidget->hide();
|
|
||||||
}
|
|
||||||
void ProxGuiQT::hideEvent(QHideEvent *event) {
|
|
||||||
pictureWidget->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProxGuiQT::_StartProxmarkThread(void) {
|
void ProxGuiQT::_StartProxmarkThread(void) {
|
||||||
if (!proxmarkThread)
|
if (!proxmarkThread)
|
||||||
return;
|
return;
|
||||||
|
@ -194,9 +186,17 @@ void ProxGuiQT::MainLoop() {
|
||||||
plotapp = new QApplication(argc, argv);
|
plotapp = new QApplication(argc, argv);
|
||||||
|
|
||||||
// Setup the picture widget
|
// Setup the picture widget
|
||||||
pictureWidget = new QWidget();
|
pictureWidget = new PictureWidget();
|
||||||
pictureController = new Ui::PictureForm();
|
pictureController = new Ui::PictureForm();
|
||||||
pictureController->setupUi(pictureWidget);
|
pictureController->setupUi(pictureWidget);
|
||||||
|
// pictureWidget->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||||
|
|
||||||
|
// Set picture widget position if no settings.
|
||||||
|
if (session.preferences_loaded == false) {
|
||||||
|
// Move controller widget below plot
|
||||||
|
//pictureController->move(x(), y() + frameSize().height());
|
||||||
|
//pictureController->resize(size().width(), 200);
|
||||||
|
}
|
||||||
|
|
||||||
connect(this, SIGNAL(ShowGraphWindowSignal()), this, SLOT(_ShowGraphWindow()));
|
connect(this, SIGNAL(ShowGraphWindowSignal()), this, SLOT(_ShowGraphWindow()));
|
||||||
connect(this, SIGNAL(RepaintGraphWindowSignal()), this, SLOT(_RepaintGraphWindow()));
|
connect(this, SIGNAL(RepaintGraphWindowSignal()), this, SLOT(_RepaintGraphWindow()));
|
||||||
|
@ -209,7 +209,6 @@ void ProxGuiQT::MainLoop() {
|
||||||
connect(this, SIGNAL(RepaintPictureWindowSignal()), this, SLOT(_RepaintPictureWindow()));
|
connect(this, SIGNAL(RepaintPictureWindowSignal()), this, SLOT(_RepaintPictureWindow()));
|
||||||
connect(this, SIGNAL(HidePictureWindowSignal()), this, SLOT(_HidePictureWindow()));
|
connect(this, SIGNAL(HidePictureWindowSignal()), this, SLOT(_HidePictureWindow()));
|
||||||
|
|
||||||
|
|
||||||
//start proxmark thread after starting event loop
|
//start proxmark thread after starting event loop
|
||||||
QTimer::singleShot(200, this, SLOT(_StartProxmarkThread()));
|
QTimer::singleShot(200, this, SLOT(_StartProxmarkThread()));
|
||||||
|
|
||||||
|
@ -245,6 +244,24 @@ ProxGuiQT::~ProxGuiQT(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------
|
||||||
|
// Slider Widget form based on a class to enable
|
||||||
|
// Event override functions
|
||||||
|
// -------------------------------------------------
|
||||||
|
PictureWidget::PictureWidget() {
|
||||||
|
// Set the initail postion and size from settings
|
||||||
|
// if (session.preferences_loaded)
|
||||||
|
// setGeometry(session.pw.x, session.pw.y, session.pw.w, session.pw.h);
|
||||||
|
// else
|
||||||
|
resize(400, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PictureWidget::closeEvent(QCloseEvent *event) {
|
||||||
|
this->hide();
|
||||||
|
event->ignore();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
// Slider Widget form based on a class to enable
|
// Slider Widget form based on a class to enable
|
||||||
// Event override functions
|
// Event override functions
|
||||||
|
@ -320,8 +337,7 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) {
|
||||||
resize(800, 400);
|
resize(800, 400);
|
||||||
|
|
||||||
// Setup the controller widget
|
// Setup the controller widget
|
||||||
controlWidget = new SliderWidget(); //new QWidget();
|
controlWidget = new SliderWidget();
|
||||||
|
|
||||||
opsController = new Ui::Form();
|
opsController = new Ui::Form();
|
||||||
opsController->setupUi(controlWidget);
|
opsController->setupUi(controlWidget);
|
||||||
//Due to quirks in QT Designer, we need to fiddle a bit
|
//Due to quirks in QT Designer, we need to fiddle a bit
|
||||||
|
@ -357,7 +373,7 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) {
|
||||||
show();
|
show();
|
||||||
|
|
||||||
// Set Slider/Overlay position if no settings.
|
// Set Slider/Overlay position if no settings.
|
||||||
if (!session.preferences_loaded) {
|
if (session.preferences_loaded == false) {
|
||||||
// Move controller widget below plot
|
// Move controller widget below plot
|
||||||
controlWidget->move(x(), y() + frameSize().height());
|
controlWidget->move(x(), y() + frameSize().height());
|
||||||
controlWidget->resize(size().width(), 200);
|
controlWidget->resize(size().width(), 200);
|
||||||
|
|
|
@ -71,6 +71,14 @@ class SliderWidget : public QWidget {
|
||||||
SliderWidget();
|
SliderWidget();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Added class for SliderWidget to allow move/resize event override
|
||||||
|
class PictureWidget : public QWidget {
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent *event);
|
||||||
|
public:
|
||||||
|
PictureWidget();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The window with plot and controls
|
* The window with plot and controls
|
||||||
*/
|
*/
|
||||||
|
@ -126,9 +134,8 @@ class ProxGuiQT : public QObject {
|
||||||
private:
|
private:
|
||||||
QApplication *plotapp;
|
QApplication *plotapp;
|
||||||
ProxWidget *plotwidget;
|
ProxWidget *plotwidget;
|
||||||
|
|
||||||
Ui::PictureForm *pictureController;
|
Ui::PictureForm *pictureController;
|
||||||
QWidget *pictureWidget;
|
PictureWidget *pictureWidget;
|
||||||
|
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
@ -150,10 +157,6 @@ class ProxGuiQT : public QObject {
|
||||||
void MainLoop(void);
|
void MainLoop(void);
|
||||||
void Exit(void);
|
void Exit(void);
|
||||||
|
|
||||||
protected:
|
|
||||||
void closeEvent(QCloseEvent *event);
|
|
||||||
void hideEvent(QHideEvent *event);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void _ShowGraphWindow(void);
|
void _ShowGraphWindow(void);
|
||||||
void _RepaintGraphWindow(void);
|
void _RepaintGraphWindow(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue