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

Update and enhance GUI icons

parent bccf7a47
......@@ -2,7 +2,7 @@
<head><title>Agkyra Syncing Client for Pithos+</title></head>
<body style="-webkit-app-region: drag; text-align: center">
<div>
<img src="icons/logo.png" style="width: 64px; height: 64px;" />
<img src="images/logo.png" style="width: 64px; height: 64px;" />
<h1>Agkyra</h1>
<h2>... it syncs</h2>
<p>&nbsp;</p>
......
There must be some logs
......@@ -131,37 +131,39 @@ function closeWindows() {
var tray = new gui.Tray({
// tooltip: 'Paused (0% synced)',
title: 'Agkyra syncs with Pithos+',
icon: 'icons/tray.png'
icon: 'images/tray.png'
});
var menu = new gui.Menu();
// Progress and Pause
var start_syncing = 'Start syncing';
var pause_syncing = 'Pause syncing';
var start_syncing = 'Start Syncing';
var start_icon = 'images/play.png';
var pause_syncing = 'Pause Syncing';
var paused = true;
progress_item = new gui.MenuItem({
// progress menu item
label: 'Initializing',
type: 'normal'
type: 'normal',
enabled: false
});
menu.append(progress_item);
menu.append(new gui.MenuItem({type: 'separator'}));
pause_item = new gui.MenuItem({
// pause menu item
icon: 'images/play_pause.png',
label: '',
type: 'normal',
click: function() {
if(paused) {post_start(socket);}
else {post_pause(socket);}
if (paused) {post_start(socket);} else {post_pause(socket);}
}
});
pause_item.enabled = false;
menu.append(pause_item);
// Update progress
function reset_status() {
window.setInterval(function() {
var status = globals['status'];
var new_progress = progress_item.label;
var new_pause = pause_item.label;
......@@ -172,25 +174,22 @@ function reset_status() {
// Update to "Paused - start syncing"
paused = true;
new_pause = start_syncing;
progress_item.enabled = false;
menu_modified = true;
} // else continue syncing
new_progress = 'Progress: ' + status['progress'] + '%';
new_progress = status['progress'] + '%' + ' synced';
break;
case start_syncing: if (status['paused']) return;
// else update to "Syncing - pause syncing"
paused = false;
new_pause = pause_syncing;
progress_item.enabled = true;
new_progress = 'Progress: ' + status['progress'] + '%';
new_progress = status['progress'] + '%' + ' synced';
menu_modified = true;
break;
default:
if (status['paused']) {new_pause = start_syncing; paused=true;}
else {new_pause = pause_syncing; paused=false;}
new_progress = 'Progress: ' + status['progress'] + '%';
new_progress = status['progress'] + '%' + ' synced';
pause_item.enabled = true;
progress_item.enabled = true;
menu_modified = true;
}
}
......@@ -202,16 +201,17 @@ function reset_status() {
progress_item.label = new_progress;
menu_modified = true;
}
if (menu_modified) tray.menu = menu;
if (menu_modified) {
if (paused) progress_item.label += ' - paused';
tray.menu = menu;
}
get_status(socket);
}
window.setInterval(reset_status, 1000);
}, 1500);
// Menu actions contents
menu.append(new gui.MenuItem({type: 'separator'}));
menu.append(new gui.MenuItem({
label: 'Open local folder',
icon: 'icons/folder.png',
icon: 'images/folder.png',
click: function () {
var dir = globals['settings']['directory'];
console.log('Open ' + dir);
......@@ -221,7 +221,7 @@ menu.append(new gui.MenuItem({
menu.append(new gui.MenuItem({
label: 'Launch Pithos+ page',
icon: 'icons/pithos.png',
icon: 'images/pithos.png',
click: function () {
var pithos_url = globals['settings']['pithos_url'];
console.log('Visit ' + pithos_url);
......@@ -229,17 +229,11 @@ menu.append(new gui.MenuItem({
}
}));
menu.append(new gui.MenuItem({
label: 'Recently changed files',
icon: 'icons/logs.png',
click: function () {gui.Shell.openItem('logs.txt');}
}));
// Settings and About
menu.append(new gui.MenuItem({type: 'separator'}));
menu.append(new gui.MenuItem({
label: 'Settings',
icon: 'icons/settings.png',
icon: 'images/settings.png',
click: function () {
if (windows['settings']) windows['settings'].close();
windows['settings'] = gui.Window.open("settings.html", {
......@@ -249,7 +243,7 @@ menu.append(new gui.MenuItem({
menu.append(new gui.MenuItem({
label: 'About',
icon: 'icons/about.png',
icon: 'images/about.png',
click: function () {
if (windows['about']) windows['about'].close();
windows['about'] = gui.Window.open("about.html", {
......@@ -261,7 +255,7 @@ menu.append(new gui.MenuItem({
menu.append(new gui.MenuItem({type: 'separator'}));
menu.append(new gui.MenuItem({
label: 'Quit Agkyra',
icon: 'icons/exit.png',
icon: 'images/exit.png',
click: function() {post_shutdown(socket);}
}));
......
<html><head>
<script>
// Read config file
var socket = new WebSocket("ws://83.212.96.33:8888");
socket.onopen = function() {
console.log('open dude!');
this.send('Hello World!');
};
socket.onmessage = function(e) {
console.log('message', e.data);
};
socket.onerror = function() {
console.log('error');
};
socket.onclose = function(e) {
console.log('close', e.code, e.reason);
};
</script>
</head><body></body></html>
\ No newline at end of file
......@@ -61,11 +61,13 @@ class WebSocketProtocol(WebSocket):
directory='/tmp/.',
exclude='agkyra.log',
pithos_url='https://pithos.okeanos.grnet.gr/ui/')
status = dict(progress=-1, paused=False)
status = dict(progress=0, paused=False)
# Syncer-related methods
def get_status(self):
self.status['progress'] += 1
from random import randint
if self.status['progress'] < 100:
self.status['progress'] += 0 if randint(0, 2) else 1
return self.status
def get_settings(self):
......
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