diff --git a/src/GSvar/MainWindow.cpp b/src/GSvar/MainWindow.cpp index 57e3419bd..02b2f534c 100644 --- a/src/GSvar/MainWindow.cpp +++ b/src/GSvar/MainWindow.cpp @@ -300,9 +300,9 @@ MainWindow::MainWindow(QWidget *parent) { // renew existing session, if it is about to expire // a new token will be requested slightly in advance - QTimer *login_timer = new QTimer(this); - connect(login_timer, &QTimer::timeout, this, &LoginManager::renewLogin); - login_timer->start(20 * 60 * 1000); // every 20 minutes + QTimer *login_timer = new QTimer(this); + connect(login_timer, SIGNAL(timeout()), this, SLOT(updateSecureToken())); + login_timer->start(20 * 60 * 1000); // every 20 minutes //check if the server is running QTimer *server_ping_timer = new QTimer(this); @@ -6564,8 +6564,23 @@ void MainWindow::uploadToClinvar(int variant_index1, int variant_index2) } catch(Exception& e) { - GUIHelper::showException(this, e, "ClinVar submission error"); - } + GUIHelper::showException(this, e, "ClinVar submission error"); + } +} + +void MainWindow::updateSecureToken() +{ + if (ClientHelper::isClientServerMode()) + { + LoginManager::renewLogin(); + for(int i = 0; i < IgvSessionManager::count(); i++) + { + if (IgvSessionManager::get(i).isIgvRunning()) + { + IgvSessionManager::get(i).execute(QStringList() << "SetAccessToken " + LoginManager::userToken() + " *" + Settings::string("server_host") + "*", false); + } + } + } } void MainWindow::dragEnterEvent(QDragEnterEvent* e) diff --git a/src/GSvar/MainWindow.h b/src/GSvar/MainWindow.h index f33e3ea8b..51e40cf92 100644 --- a/src/GSvar/MainWindow.h +++ b/src/GSvar/MainWindow.h @@ -84,7 +84,9 @@ class MainWindow public slots: ///Upload variant to Clinvar - void uploadToClinvar(int variant_index1, int variant_index2=-1); + void uploadToClinvar(int variant_index1, int variant_index2=-1); + /// Updates (only in clinet-server mode) the secure token + void updateSecureToken(); /// Checks (only in clinet-server mode) if the server is currently running void checkServerAvailability(); /// Checks (only in clinet-server mode) if there is some new information needed to be displayed to the user (e.g. downtimes, maintenance, reboots, updates)