MSInterface::~MSInterface()
{
- logout();
+ if(autologout)logout();
if(sslexcept)delete sslexcept;
sslexcept=0;
if(temp)delete temp;
//message box
if(!didsslerror){
MBoxWrapper::warning(tr("Connection Error"),tr("There were problems while authenticating the server. Aborting. Check your configuration."));
+ didsslerror=true;
}
}
///return the parent directory of the base URL
QUrl parentUrl()const;
+
+ ///returns whether this instance automatically logs out on closure
+ bool autoLogout()const{return autologout;}
+
+ ///sets whether this instance automatically logs out on closure
+ void setAutoLogout(bool a){autologout=a;}
///return application main data directory
static QString appDataDir();
mutable QList<Right>userrights;
mutable QStringList userroles,userflags;
QByteArray servertranslation;
- MSslExceptions*sslexcept;
- bool didsslerror;
- MTemplateStore *temp;
+ MSslExceptions*sslexcept=nullptr;
+ bool didsslerror=false,autologout=false;
+ MTemplateStore *temp=nullptr;
};
-Subproject commit 3bd32ee1471e362af22682c72f562a1bfa761581
+Subproject commit fc4acf0513acbe6413187304fa65ce29b27f9901
pd.setVisible(true);
//create request object
MSInterface *mw=new MSInterface(profiles->itemData(profiles->currentIndex()).toString());
+ mw->setAutoLogout(true);//this is the session manager - it handles these things
//check server version
if(!mw->checkServer()){
//no need for messagebox: checkServer displays one if necessary
#include "../sesscli/scrand.h"
#include <msinterface.h>
+#include <WTransaction>
MSessionManager::MSessionManager ( QObject* parent ) : QObject ( parent )
{
app.setWindowIcon(QIcon(":/icon.png"));
MSInterface::setAppDataDir("$BASE/.magicSmoke2");
+ WTransaction::setLogPrefix("SM-T");
MBoxWrapper::setWarning([](QString title,QString text){QMessageBox::warning(nullptr,title,text);});
#include "msinterface.h"
#include "main.h"
+#include <WTransaction>
int MagicSmokeMain::realmain(int argc,char**argv)
sc.connect(&sc,SIGNAL(sessionLost()),&app,SLOT(quit()));
sc.connect(&sc,SIGNAL(managerLost()),&app,SLOT(quit()));
if(sc.waitForSessionAvailable()){
+ WTransaction::setLogPrefix("Main-T");
MSInterface*ms=new MSInterface(sc.currentProfileId());
ms->loginSession(sc.currentUsername(), sc.currentSessionId());
MOverview *mo=new MOverview(sc.currentProfileId());
void MOverview::closeEvent(QCloseEvent*ce)
{
- //make sure session is deleted
- req->logout();
//store geometry
QSettings set;
set.beginGroup(GEOGROUP);