fixes closing picture viewer exits client
This commit is contained in:
1 parent
36af584e1b
commit
918630e22e
2 files changed
+41
-22
No files matched your search
+31
-15
@@ -128,7 +128,7 @@ void ProxGuiQT::_ShowPictureWindow(char *fn) {
|
||||
makeFocusable();
|
||||
#endif
|
||||
|
||||
pictureWidget = new QWidget();
|
||||
pictureWidget = new PictureWidget();
|
||||
}
|
||||
|
||||
QPixmap pm;
|
||||
@@ -171,14 +171,6 @@ void ProxGuiQT::_Exit(void) {
|
||||
delete this;
|
||||
}
|
||||
|
||||
void ProxGuiQT::closeEvent(QCloseEvent *event) {
|
||||
event->ignore();
|
||||
pictureWidget->hide();
|
||||
}
|
||||
void ProxGuiQT::hideEvent(QHideEvent *event) {
|
||||
pictureWidget->hide();
|
||||
}
|
||||
|
||||
void ProxGuiQT::_StartProxmarkThread(void) {
|
||||
if (!proxmarkThread)
|
||||
return;
|
||||
@@ -194,10 +186,18 @@ void ProxGuiQT::MainLoop() {
|
||||
plotapp = new QApplication(argc, argv);
|
||||
|
||||
// Setup the picture widget
|
||||
pictureWidget = new QWidget();
|
||||
pictureWidget = new PictureWidget();
|
||||
pictureController = new Ui::PictureForm();
|
||||
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(RepaintGraphWindowSignal()), this, SLOT(_RepaintGraphWindow()));
|
||||
connect(this, SIGNAL(HideGraphWindowSignal()), this, SLOT(_HideGraphWindow()));
|
||||
@@ -209,7 +209,6 @@ void ProxGuiQT::MainLoop() {
|
||||
connect(this, SIGNAL(RepaintPictureWindowSignal()), this, SLOT(_RepaintPictureWindow()));
|
||||
connect(this, SIGNAL(HidePictureWindowSignal()), this, SLOT(_HidePictureWindow()));
|
||||
|
||||
|
||||
//start proxmark thread after starting event loop
|
||||
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
|
||||
// Event override functions
|
||||
@@ -320,8 +337,7 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) {
|
||||
resize(800, 400);
|
||||
|
||||
// Setup the controller widget
|
||||
controlWidget = new SliderWidget(); //new QWidget();
|
||||
|
||||
controlWidget = new SliderWidget();
|
||||
opsController = new Ui::Form();
|
||||
opsController->setupUi(controlWidget);
|
||||
//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();
|
||||
|
||||
// Set Slider/Overlay position if no settings.
|
||||
if (!session.preferences_loaded) {
|
||||
if (session.preferences_loaded == false) {
|
||||
// Move controller widget below plot
|
||||
controlWidget->move(x(), y() + frameSize().height());
|
||||
controlWidget->resize(size().width(), 200);
|
||||
|
||||
Reference in new issue
Block a user