Commit e78904db authored by Stavros Sachtouris's avatar Stavros Sachtouris Committed by Giorgos Korfiatis
Browse files

Ask user for settings on GUI startup, if needed

parent 33b1a413
......@@ -133,6 +133,11 @@ menu.append(new gui.MenuItem({
// Update progress
var client_ready = false;
window.setInterval(function() {
if (globals.open_settings) {
globals.open_settings = false;
settings_menu.click();
}
var menu_modified = false;
if (!client_ready) {
if (!globals.authenticated) return;
......
......@@ -21,6 +21,7 @@ var globals = {
},
'status': {"synced": 0, "unsynced": 0, "paused": null, "can_sync": false},
'authenticated': false,
'just_opened': false, 'open_settings': false
}
// Protocol: requests ::: responses
......@@ -73,6 +74,7 @@ socket.onmessage = function(e) {
get_settings(this);
get_status(this);
globals.authenticated = true;
globals.just_opened = true;
} else {
if (DEBUG) console.log('Helper: ' + JSON.stringify(r));
closeWindows();
......@@ -100,6 +102,10 @@ socket.onmessage = function(e) {
break;
case 'get status':
globals['status'] = r;
if (globals.just_opened) {
globals.just_opened = false;
globals.open_settings = !r.can_sync;
}
break;
default:
console.log('Incomprehensible response ' + r);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment