summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mainwindow.cc2
-rw-r--r--client/netcom.cc8
-rw-r--r--client/netcom.h5
3 files changed, 10 insertions, 5 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 97c143e..03087ad 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -63,7 +63,7 @@ public:
MainWindow::MainWindow(QString cpr, QString templ, QString host,
quint16 port, QString user)
: QMainWindow(0, Qt::WindowContextHelpButtonHint),
- netcom(host, port)
+ netcom(this, host, port)
{
isStored = false;
diff --git a/client/netcom.cc b/client/netcom.cc
index 2798a59..9d9a5bb 100644
--- a/client/netcom.cc
+++ b/client/netcom.cc
@@ -50,8 +50,10 @@
#endif
#endif
-NetCom::NetCom(QString host, quint16 port)
+NetCom::NetCom(QWidget *wdg, QString host, quint16 port)
{
+ this->wdg = wdg;
+
//
// Setup connection
//
@@ -86,7 +88,7 @@ QDomDocument NetCom::makeTransfer(QDomDocument &doc, bool lockgui,
{
DEBUG(netcom, "Making transfer:\n%s", doc.toString().toStdString().c_str());
- if(lockgui && qApp->activeWindow()) qApp->activeWindow()->setEnabled(false);
+ if(lockgui && wdg) wdg->setEnabled(false);
if(lockgui) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
LOG(netcom, "SESSION ID: %s\n", sessionid.toStdString().c_str());
@@ -137,7 +139,7 @@ QDomDocument NetCom::makeTransfer(QDomDocument &doc, bool lockgui,
}
if(lockgui) QApplication::restoreOverrideCursor();
- if(lockgui && qApp->activeWindow()) qApp->activeWindow()->setEnabled(true);
+ if(lockgui && wdg) wdg->setEnabled(true);
return res_doc;
}
diff --git a/client/netcom.h b/client/netcom.h
index e6478a5..a8be6f6 100644
--- a/client/netcom.h
+++ b/client/netcom.h
@@ -34,6 +34,8 @@
#include <QNetworkAccessManager>
#include <QNetworkRequest>
+#include <QWidget>
+
//#define USE_SSL
//#include "widgets/widget.h"
@@ -49,7 +51,7 @@ typedef enum {
class NetCom : public QObject {
Q_OBJECT
public:
- NetCom(QString host, quint16 port);
+ NetCom(QWidget *wdg, QString host, quint16 port);
~NetCom();
QDomDocument send(QString templ, QString macro = "", bool lockgui = true);
@@ -73,6 +75,7 @@ private:
QNetworkRequest request;
// QString sessionid;
+ QWidget *wdg;
QMap<QNetworkReply *, bool> finished;