engine.evalFile("startup.js");
}
+#define GEOGROUP "magicSmokeClient/MainWindow/state"
+
void MOverview::closeEvent(QCloseEvent*ce)
{
//make sure session is deleted
req->logout();
+ //store geometry
+ QSettings set;
+ set.beginGroup(GEOGROUP);
+ set.setValue("geometry",saveGeometry());
+ set.setValue("state",saveState());
//actually close window
QMainWindow::closeEvent(ce);
}
+void MOverview::showRestored()
+{
+ QSettings set;
+ set.beginGroup(GEOGROUP);
+ if(!restoreGeometry(set.value("geometry").toByteArray())||!restoreState(set.value("state").toByteArray()))
+ showMaximized();
+ else
+ show();
+}
+
MOverview::~MOverview()
{
qDebug()<<"destructing overview"<<hex<<(long)this;
~MOverview();
protected:
/**handle closing the window: close the session too*/
- void closeEvent(QCloseEvent*);
+ void closeEvent(QCloseEvent*) override;
private slots:
/**try to log in again*/
void userAudit();
public slots:
+ ///restore the window
+ void showRestored();
+
/**manage customers*/
void customerMgmt();