Commit 851ce6a0 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

Ask user to confirm start syncing

parent fbb2c3e7
......@@ -28,6 +28,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="wrapper"><form>
<h4 id="text">Do you agree to a fuzzy question which will be used against you in the future?</h4>
<div class="clearfix small-12 columns">
<div id="ticker" class="small-12 columns">
<input id="ticker_tick" type="checkbox" name="ticker_tick" class="right" style="display: inline"
onchange="d.terms.ticker.checked = !d.terms.ticker.checked;"></input>
<label id="ticker_label" for="ticker_tick" class="left" style="display: inline"></label>
<div>&nbsp;</div>
</div>
<a id="OK" class="button right" onclick="set_dialogue(d.msg, d.terms, true); window.close();">OK</a>
<a id="CANCEL" class="button right" onclick="window.close()">Cancel</a>
</div>
......@@ -37,6 +43,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
document.getElementById('text').innerHTML = d.msg;
document.getElementById('OK').innerHTML = d.terms.OK;
document.getElementById('CANCEL').innerHTML = d.terms.CANCEL;
var ticker = d.terms.ticker || null;
if (ticker !== null) {
document.getElementById('ticker_label').innerHTML = ticker.msg;
document.getElementById('ticker_tick').checked = ticker.checked;
$('#ticker').show();
} else $('#ticker').hide();
</script>
</body>
</html>
......@@ -251,7 +251,30 @@ window.setInterval(function() {
break;
case STATUS['READY']:
if (status_unchanged) break;
post_start(socket);
if (globals.settings.ask_to_sync){
set_dialogue(COMMON.DIALOGUE["ASK TO SYNC"], {
ticker: {msg: COMMON.SETTINGS["ASK TO SYNC"], checked: true},
OK: COMMON.DIALOGUE["START AND SYNC"],
CANCEL: COMMON.DIALOGUE["START AND PAUSE"],
}, false);
if (windows.dialogue === null) {
windows['dialogue'] = gui.Window.open(
'dialogue.html', {
toolbar: false, focus: true, width: 420, height: 220});
windows['dialogue'].on('closed', function() {
var d = get_dialogue();
if (!d.terms.ticker.checked) {
globals.settings.ask_to_sync = d.terms.ticker.checked;
put_settings(socket, globals.settings);
get_settings(socket);
}
if (d.response) post_start(socket);
else post_pause(socket);
windows['dialogue'] = null;
});
}
} else post_start(socket);
activate_menu();
break;
case STATUS['SYNCING']:
notify('info');
......
......@@ -35,7 +35,10 @@
"203": "Η Agkyra έχει απενεργοποιηθεί διότι ο τοπικός φάκελος \"%s\" έχει εξαφανιστεί. Επιθυμείτε τη δημιουργία του εκ νέου και την επανεκκίνηση του συγχρονισμού;",
"204": "Η Agkyra έχει απενεργοποιηθεί διότι ο απομακρυσμένος περιέκτης (container) \"%s\" έχει εξαφανιστεί. Επιθυμείτε τη δημιουργία του εκ νέου και την επανεκκίνηση του συγχρονισμού;",
"OK": "Εντάξει",
"CANCEL": "Άκυρο"
"CANCEL": "Άκυρο",
"ASK TO SYNC": "Να ξεκινήσει η Agkyra να συγχρονίζει τα αρχεία σας;",
"START AND SYNC": "Εκκίνηση συγχρονισμού",
"START AND PAUSE": "Παραμονή σε παύση"
},
"MENU": {
"TITLE": "Συγχρονιστής αρχείων Agkyra",
......@@ -61,6 +64,7 @@
"TITLE": "Ρυθμίσεις",
"GENERAL": "Γενικές ρυθμίσεις",
"LANGUAGE": "Γλώσσα",
"ASK TO SYNC": "Να ερωτάμαι πριν την εκκίνηση του συγχρονισμού",
"CLOUD": "Απομακρυσμένο σύστημα (νέφος)",
"URL": "Διεύθυνση (URL) νέφους",
"TOKEN": "Κλειδί token",
......
......@@ -35,7 +35,10 @@
"203": "Agkyra is deactivated because local directory \"%s\" has disappeared. Would you like Agkyra to create it again and restart syncing?",
"204": "Agkyra is deactivated because remote container \"%s\" has disappeared. Would you like Agkyra to create it again and restart syncing?",
"OK": "OK",
"CANCEL": "Cancel"
"CANCEL": "Cancel",
"ASK TO SYNC": "Should Agkyra start syncing your files?",
"START AND SYNC": "Start syncing",
"START AND PAUSE": "Stay paused"
},
"MENU": {
"TITLE": "Agkyra File Syncer",
......@@ -61,6 +64,7 @@
"TITLE": "Settings",
"GENERAL": "General Settings",
"LANGUAGE": "Language",
"ASK TO SYNC": "Always ask before starting sync",
"CLOUD": "Cloud",
"URL": "Cloud URL",
"TOKEN": "User Token",
......
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