ora alcuni bottoni funzionano. In più l'aggiornamento della lista

Leonardo Robol [2010-02-10 15:02]
ora alcuni bottoni funzionano. In più l'aggiornamento della lista
è stato spostato nel thread principale, così dà meno problemi.
Filename
Dizzy/EventManager.cs
Dizzy/File.cs
Dizzy/FileTreeView.cs
Dizzy/Log.cs
Dizzy/MainWindow.cs
Dizzy/Protocol.cs
Dizzy/TaskTreeView.cs
config.make
dizzy
gtk-gui/Dizzy.AuthDialog.cs
gtk-gui/MainWindow.cs
gtk-gui/gui.stetic
diff --git a/Dizzy/EventManager.cs b/Dizzy/EventManager.cs
index 324087c..2edcb6e 100644
--- a/Dizzy/EventManager.cs
+++ b/Dizzy/EventManager.cs
@@ -22,6 +22,7 @@ namespace Dizzy
 	{

 		public static MessageDialog searchInProgress = null;
+		public static MessageDialog listUpdate = null;

 		// Gestione dei file e dei task. Questi devono essere inizializzati
 		// Appena sono creati.
@@ -63,24 +64,63 @@ namespace Dizzy
 			                                     true, "");
 			searchInProgress.Markup = "Ricerca in corso, attendere.";
 			GLib.Idle.Add (delegate {
-				EventManager.searchInProgress.Run ();
+				if (EventManager.searchInProgress != null)
+					EventManager.searchInProgress.Run ();
 				return false;
 			});
 		}

 		public static void SearchFinished () {
 			if (searchInProgress == null)
+			{
+				Log.Warning ("Sembra che la ricerca sia già morta di per sè");
 				return;
+			}
 			else
 			{
 				GLib.Idle.Add(delegate {
 					searchInProgress.Destroy ();
+					Log.Info ("Ricerca distrutta");
 					searchInProgress = null;
 					return false;
 				});
 			}
 		}

+		// Metodi per gestire l'update della lista
+		public static void ListUpdateStarted () {
+
+			// Questo significa che stiamo già effettuando una ricerca
+			if (listUpdate != null)
+				return;
+
+			listUpdate = new MessageDialog(null,
+			                                     DialogFlags.Modal,
+			                                     MessageType.Info,
+			                                     ButtonsType.None,
+			                                     true, "");
+			listUpdate.Markup = "Aggiornamento della lista in corso";
+			GLib.Idle.Add (delegate {
+				if (EventManager.listUpdate != null)
+					EventManager.listUpdate.Run ();
+				return false;
+			});
+		}
+
+		public static void ListUpdateFinished () {
+			if (listUpdate == null)
+				return;
+			else
+			{
+				GLib.Idle.Add(delegate {
+					listUpdate.Destroy ();
+					Log.Info ("Aggiornamento completato");
+					EventManager.listUpdate = null;
+					return false;
+				});
+			}
+		}
+
 		public static void FileTreeViewAddFile(File f)
 		{
 			if (fileTreeView == null) { return; }
diff --git a/Dizzy/File.cs b/Dizzy/File.cs
index 4ecc683..85e0d17 100644
--- a/Dizzy/File.cs
+++ b/Dizzy/File.cs
@@ -71,10 +71,8 @@ namespace Dizzy
 				string[] pieces = path.Split ('/');
 				name = pieces[pieces.Length - 1];
 			}
-			else
-			{
-				this.name = name;
-			}
+
+			this.name = name;

 		}

diff --git a/Dizzy/FileTreeView.cs b/Dizzy/FileTreeView.cs
index b06fd2a..3f018fb 100644
--- a/Dizzy/FileTreeView.cs
+++ b/Dizzy/FileTreeView.cs
@@ -22,11 +22,11 @@ namespace Dizzy

 		public FileTreeView (Gtk.TreeView tree)
 		{
-			Log.Lock ("FileTreeView() locking");
-			lock (this) {
+
 			// Costruisco la ListStore e popolo di colonne
 			// la TreeView
 			this.tree = tree;
+			this.tree.ResizeMode = ResizeMode.Immediate;
 			this.filenameColumn = new Gtk.TreeViewColumn ();
 			filenameColumn.Title = "Nome del file";

@@ -50,23 +50,22 @@ namespace Dizzy
 			this.tree.Model = fileListStore;

 			CellSetup ();
-			}
-			Log.Lock ("FileTreeView() unlocking");
-		}
+	}

 		protected void CellSetup()
 		{
 			// lock (this) {
 				// Filename
 				Gtk.CellRendererText filenameRenderer = new Gtk.CellRendererText ();
-				filenameColumn.Resizable = true;
 				filenameColumn.PackStart (filenameRenderer, true);
 				filenameColumn.AddAttribute (filenameRenderer, "text", 0);
+				filenameColumn.Resizable = true;

 				// Dimensione
 				Gtk.CellRendererText sizeRenderer = new Gtk.CellRendererText ();
 				sizeColumn.PackStart (sizeRenderer, true);
 				sizeColumn.AddAttribute (sizeRenderer, "text", 3);
+				filenameColumn.Resizable = true;

 				// Utente
 				Gtk.CellRendererText userRenderer = new Gtk.CellRendererText ();
@@ -78,33 +77,30 @@ namespace Dizzy

 		public void AddFile(Dizzy.File file)
 		{
-			lock (this) {
-				Log.Lock ("AddFile() locking");
-				// Aggiungo i valori effettivi nel liststore.
-				fileListStore.AppendValues(	file.name,
-			                           		file.user,
-			                           		file.path,
-				                           	file.SizeToString ());
-				Log.Lock ("AddFile() unlocking");
-			}
+
+			// Aggiungo i valori effettivi nel liststore.
+			fileListStore.AppendValues(	file.name,
+		    	                		file.user,
+		            		           	file.path,
+			                    		file.SizeToString ());
+
 		}

 		public void Clear ()
 		{
-			lock (this) {
-				Log.Lock ("Clear() locking");
-				fileListStore.Clear ();
-				Log.Lock ("Clear() unlocking");
-			}
+			fileListStore.Clear ();
 		}


 		public File GetFileFromPath (TreePath path)
 		{
 			TreeIter iter = new TreeIter ();
+
 			fileListStore.GetIter(out iter, path);
 			File f = new File((string) fileListStore.GetValue(iter, 2),
 			                  (string) fileListStore.GetValue(iter, 1));
+			                  // (string) fileListStore.GetValue(iter, 0));
+			Log.Info ("Richiesto " + f.path);
 			return f;
 		}

diff --git a/Dizzy/Log.cs b/Dizzy/Log.cs
index 1d14b09..0f9750a 100644
--- a/Dizzy/Log.cs
+++ b/Dizzy/Log.cs
@@ -46,7 +46,8 @@ namespace Dizzy
 			Console.ForegroundColor = initial;
 			Console.WriteLine (message);

-			StatusBarUpdate(message);
+			try {StatusBarUpdate(message);}
+			catch (Exception e) { Log.Error ("Impossibile loggare sulla statusbar"); }
 		}

 		public static void Lock (string message)
diff --git a/Dizzy/MainWindow.cs b/Dizzy/MainWindow.cs
index 7a65bb4..dac3760 100644
--- a/Dizzy/MainWindow.cs
+++ b/Dizzy/MainWindow.cs
@@ -25,16 +25,19 @@ public partial class MainWindow : Gtk.Window
 		tasks = new Dizzy.TaskTreeView (tasklist);
 		EventManager.RegisterTaskTreeView (ref tasks);

+
 		// Carichiamo qualche impostazione di default
 		string downloadpath = config.GetValue("download_folder");
 		if (downloadpath != "")
 			downloadpathchooser.SetFilename(downloadpath);

-		this.protocol = new Protocol (ref this.config);

+
+		this.protocol = new Protocol (ref this.config);
 		this.protocol.AuthenticationRequired += this.Connect;
+
 		Log.StatusBarUpdate += this.OnStatusBarUpdate;
-
+
 	}

 	public void OnStatusBarUpdate (string message)
@@ -91,4 +94,16 @@ public partial class MainWindow : Gtk.Window
 		config.InsertValue("download_folder", downloadpathchooser.Filename);
 	}

+	protected virtual void OnListUpdateRequired (object sender, System.EventArgs e)
+	{
+		this.protocol.UpdateFileList ();
+	}
+
+	protected virtual void OnDisconnectionRequested (object sender, System.EventArgs e)
+	{
+		this.config.authenticated = false;
+	}
+
+
+
 }
diff --git a/Dizzy/Protocol.cs b/Dizzy/Protocol.cs
index 53ef0b9..ef066a2 100644
--- a/Dizzy/Protocol.cs
+++ b/Dizzy/Protocol.cs
@@ -48,7 +48,7 @@ namespace Dizzy
 		public Protocol (ref GlobalConfig config)
 		{
 			this.config = config;
-			this.UpdateFileList ();
+			// this.UpdateFileList ();
 		}

 		public void Search(string keyword)
@@ -113,21 +113,24 @@ namespace Dizzy

 		public void UpdateFileList ()
 		{
-			if(this.listUpdater != null && this.listUpdater.IsAlive)
+			/*if(this.listUpdater != null && this.listUpdater.IsAlive)
 			{
 				Log.Warning ("La lista è già in fase di aggiornamento, non faccio nulla");
 				return;
 			}
+

 			this.listUpdater = new Thread (new ThreadStart (this._UpdateFileList));
-			this.listUpdater.Start ();
+			this.listUpdater.Start (); */
+			_UpdateFileList ();
 		}



 		protected void _UpdateFileList ()
 		{
-			SFTPConnection s;
+			// SFTPConnection s;
+			Sftp s;

 			if (!this.config.authenticated)
 			{
@@ -139,10 +142,14 @@ namespace Dizzy
 				Log.Info ("Ho acquisito utente e password");
 			}

+			EventManager.ListUpdateStarted ();
+
 			// Inizializziamo la connessione con i dati che supponiamo
 			// di avere.
-			s = new SFTPConnection (this.config.GetValue("user"),
-			                       	this.config.password);
+			// s = new SFTPConnection (this.config.GetValue("user"),
+			//                       	this.config.password);
+			s = new Sftp("poisson.phc.unipi.it", this.config.GetValue("user"),
+			             this.config.password);

 			try {
 				s.Connect ();
@@ -160,12 +167,15 @@ namespace Dizzy
 			{
 				Log.Info ("Aggiornamento della lista avviato");

-				s.Download (new File("/nobackup/robol/index.db", "robol"),
-					            this.config.ConfigDir ());
+				// s.Download (new File("/nobackup/robol/index.db", "robol"),
+				//	            this.config.ConfigDir ());
+				s.Get("/nobackup/robol/index.db", this.config.ConfigDir() +
+				      System.IO.Path.DirectorySeparatorChar + "index.db");

 				Log.Info ("Lista Aggiornata");
-				s.Disconnect ();
+				s.Close ();
 			}
+			EventManager.ListUpdateFinished ();
 		}


diff --git a/Dizzy/TaskTreeView.cs b/Dizzy/TaskTreeView.cs
index 6e0b471..8f90d4b 100644
--- a/Dizzy/TaskTreeView.cs
+++ b/Dizzy/TaskTreeView.cs
@@ -18,6 +18,7 @@ namespace Dizzy
 		public TaskTreeView (Gtk.TreeView tree)
 		{
 			this.tree = tree;
+			this.tree.ResizeMode = ResizeMode.Immediate;

 			fileColumn = new TreeViewColumn ();
 			fileColumn.Resizable = true;
diff --git a/config.make b/config.make
index b51a86d..6988b80 100644
--- a/config.make
+++ b/config.make
@@ -1,9 +1,9 @@
-prefix=/usr/local/
-libdir=/usr/local//lib
-bindir=/usr/local//bin
-datadir=/usr/local//share
+prefix=/usr/local
+libdir=/usr/local/lib
+bindir=/usr/local/bin
+datadir=/usr/local/share
 RUNTIME=mono
 ASSEMBLY_VERSION=0.1.0.0
 VERSION=0.1
 PACKAGE=dizzy
-CONFIG=DEBUG_X86
+CONFIG=RELEASE_X86
diff --git a/dizzy b/dizzy
index 8a9b565..84ae502 100644
--- a/dizzy
+++ b/dizzy
@@ -1,3 +1,3 @@
 #!/bin/sh

-exec mono "/usr/local//lib/dizzy/Dizzy.exe" "$@"
+exec mono "/usr/local/lib/dizzy/Dizzy.exe" "$@"
diff --git a/gtk-gui/Dizzy.AuthDialog.cs b/gtk-gui/Dizzy.AuthDialog.cs
index 6695d49..220c412 100644
--- a/gtk-gui/Dizzy.AuthDialog.cs
+++ b/gtk-gui/Dizzy.AuthDialog.cs
@@ -59,7 +59,6 @@ namespace Dizzy {
             w2.Fill = false;
             // Container child vbox2.Gtk.Box+BoxChild
             this.table1 = new Gtk.Table(((uint)(2)), ((uint)(2)), false);
-            this.table1.Name = "table1";
             this.table1.RowSpacing = ((uint)(6));
             this.table1.ColumnSpacing = ((uint)(6));
             // Container child table1.Gtk.Table+TableChild
diff --git a/gtk-gui/MainWindow.cs b/gtk-gui/MainWindow.cs
index 974702f..a626dac 100644
--- a/gtk-gui/MainWindow.cs
+++ b/gtk-gui/MainWindow.cs
@@ -54,6 +54,14 @@ public partial class MainWindow {

     private Gtk.Table table2;

+    private Gtk.Alignment alignment1;
+
+    private Gtk.Label label10;
+
+    private Gtk.Alignment alignment2;
+
+    private Gtk.Label label5;
+
     private Gtk.Button button182;

     private Gtk.Button button183;
@@ -88,14 +96,13 @@ public partial class MainWindow {
         this.notebook1 = new Gtk.Notebook();
         this.notebook1.CanFocus = true;
         this.notebook1.Name = "notebook1";
-        this.notebook1.CurrentPage = 0;
+        this.notebook1.CurrentPage = 2;
         // Container child notebook1.Gtk.Notebook+NotebookChild
         this.vbox3 = new Gtk.VBox();
         this.vbox3.Name = "vbox3";
         this.vbox3.Spacing = 6;
         // Container child vbox3.Gtk.Box+BoxChild
         this.table1 = new Gtk.Table(((uint)(2)), ((uint)(3)), false);
-        this.table1.Name = "table1";
         this.table1.RowSpacing = ((uint)(6));
         this.table1.ColumnSpacing = ((uint)(6));
         this.table1.BorderWidth = ((uint)(5));
@@ -182,7 +189,6 @@ public partial class MainWindow {
         this.filelist = new Gtk.TreeView();
         this.filelist.CanFocus = true;
         this.filelist.Name = "filelist";
-        this.filelist.Reorderable = true;
         this.GtkScrolledWindow.Add(this.filelist);
         this.vbox3.Add(this.GtkScrolledWindow);
         Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox3[this.GtkScrolledWindow]));
@@ -245,25 +251,55 @@ public partial class MainWindow {
         this.notebook1.SetTabLabel(this.vbox2, this.label3);
         this.label3.ShowAll();
         // Container child notebook1.Gtk.Notebook+NotebookChild
-        this.table2 = new Gtk.Table(((uint)(4)), ((uint)(2)), false);
+        this.table2 = new Gtk.Table(((uint)(5)), ((uint)(2)), false);
         this.table2.Name = "table2";
         this.table2.RowSpacing = ((uint)(6));
         this.table2.ColumnSpacing = ((uint)(6));
         this.table2.BorderWidth = ((uint)(5));
         // Container child table2.Gtk.Table+TableChild
+        this.alignment1 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
+        this.alignment1.Name = "alignment1";
+        // Container child alignment1.Gtk.Container+ContainerChild
+        this.label10 = new Gtk.Label();
+        this.label10.Name = "label10";
+        this.label10.Xalign = 0F;
+        this.label10.LabelProp = Mono.Unix.Catalog.GetString("<b>Utility</b>");
+        this.label10.UseMarkup = true;
+        this.alignment1.Add(this.label10);
+        this.table2.Add(this.alignment1);
+        Gtk.Table.TableChild w18 = ((Gtk.Table.TableChild)(this.table2[this.alignment1]));
+        w18.TopAttach = ((uint)(3));
+        w18.BottomAttach = ((uint)(4));
+        w18.XOptions = ((Gtk.AttachOptions)(4));
+        w18.YOptions = ((Gtk.AttachOptions)(4));
+        // Container child table2.Gtk.Table+TableChild
+        this.alignment2 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
+        this.alignment2.Name = "alignment2";
+        // Container child alignment2.Gtk.Container+ContainerChild
+        this.label5 = new Gtk.Label();
+        this.label5.Name = "label5";
+        this.label5.Xalign = 0F;
+        this.label5.LabelProp = Mono.Unix.Catalog.GetString("<b>Configurazione</b>");
+        this.label5.UseMarkup = true;
+        this.alignment2.Add(this.label5);
+        this.table2.Add(this.alignment2);
+        Gtk.Table.TableChild w20 = ((Gtk.Table.TableChild)(this.table2[this.alignment2]));
+        w20.XOptions = ((Gtk.AttachOptions)(4));
+        w20.YOptions = ((Gtk.AttachOptions)(4));
+        // Container child table2.Gtk.Table+TableChild
         this.button182 = new Gtk.Button();
         this.button182.CanFocus = true;
         this.button182.Name = "button182";
         this.button182.UseUnderline = true;
         this.button182.Label = Mono.Unix.Catalog.GetString("Disconnetti");
         this.table2.Add(this.button182);
-        Gtk.Table.TableChild w17 = ((Gtk.Table.TableChild)(this.table2[this.button182]));
-        w17.TopAttach = ((uint)(1));
-        w17.BottomAttach = ((uint)(2));
-        w17.LeftAttach = ((uint)(1));
-        w17.RightAttach = ((uint)(2));
-        w17.XOptions = ((Gtk.AttachOptions)(4));
-        w17.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w21 = ((Gtk.Table.TableChild)(this.table2[this.button182]));
+        w21.TopAttach = ((uint)(1));
+        w21.BottomAttach = ((uint)(2));
+        w21.LeftAttach = ((uint)(1));
+        w21.RightAttach = ((uint)(2));
+        w21.XOptions = ((Gtk.AttachOptions)(4));
+        w21.YOptions = ((Gtk.AttachOptions)(4));
         // Container child table2.Gtk.Table+TableChild
         this.button183 = new Gtk.Button();
         this.button183.CanFocus = true;
@@ -271,13 +307,13 @@ public partial class MainWindow {
         this.button183.UseUnderline = true;
         this.button183.Label = Mono.Unix.Catalog.GetString("Aggiorna lista");
         this.table2.Add(this.button183);
-        Gtk.Table.TableChild w18 = ((Gtk.Table.TableChild)(this.table2[this.button183]));
-        w18.TopAttach = ((uint)(2));
-        w18.BottomAttach = ((uint)(3));
-        w18.LeftAttach = ((uint)(1));
-        w18.RightAttach = ((uint)(2));
-        w18.XOptions = ((Gtk.AttachOptions)(4));
-        w18.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w22 = ((Gtk.Table.TableChild)(this.table2[this.button183]));
+        w22.TopAttach = ((uint)(2));
+        w22.BottomAttach = ((uint)(3));
+        w22.LeftAttach = ((uint)(1));
+        w22.RightAttach = ((uint)(2));
+        w22.XOptions = ((Gtk.AttachOptions)(4));
+        w22.YOptions = ((Gtk.AttachOptions)(4));
         // Container child table2.Gtk.Table+TableChild
         this.button184 = new Gtk.Button();
         this.button184.CanFocus = true;
@@ -285,45 +321,45 @@ public partial class MainWindow {
         this.button184.UseUnderline = true;
         this.button184.Label = Mono.Unix.Catalog.GetString("Carica file");
         this.table2.Add(this.button184);
-        Gtk.Table.TableChild w19 = ((Gtk.Table.TableChild)(this.table2[this.button184]));
-        w19.TopAttach = ((uint)(3));
-        w19.BottomAttach = ((uint)(4));
-        w19.LeftAttach = ((uint)(1));
-        w19.RightAttach = ((uint)(2));
-        w19.XOptions = ((Gtk.AttachOptions)(4));
-        w19.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w23 = ((Gtk.Table.TableChild)(this.table2[this.button184]));
+        w23.TopAttach = ((uint)(4));
+        w23.BottomAttach = ((uint)(5));
+        w23.LeftAttach = ((uint)(1));
+        w23.RightAttach = ((uint)(2));
+        w23.XOptions = ((Gtk.AttachOptions)(4));
+        w23.YOptions = ((Gtk.AttachOptions)(4));
         // Container child table2.Gtk.Table+TableChild
         this.filechooserbutton1 = new Gtk.FileChooserButton(Mono.Unix.Catalog.GetString("Seleziona un file"), ((Gtk.FileChooserAction)(0)));
         this.filechooserbutton1.Name = "filechooserbutton1";
         this.table2.Add(this.filechooserbutton1);
-        Gtk.Table.TableChild w20 = ((Gtk.Table.TableChild)(this.table2[this.filechooserbutton1]));
-        w20.TopAttach = ((uint)(3));
-        w20.BottomAttach = ((uint)(4));
-        w20.XOptions = ((Gtk.AttachOptions)(4));
-        w20.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w24 = ((Gtk.Table.TableChild)(this.table2[this.filechooserbutton1]));
+        w24.TopAttach = ((uint)(4));
+        w24.BottomAttach = ((uint)(5));
+        w24.XOptions = ((Gtk.AttachOptions)(4));
+        w24.YOptions = ((Gtk.AttachOptions)(4));
         // Container child table2.Gtk.Table+TableChild
         this.label8 = new Gtk.Label();
         this.label8.Name = "label8";
         this.label8.LabelProp = Mono.Unix.Catalog.GetString("Il programma chiederà nuovamente utente e password quando necessario");
         this.label8.Wrap = true;
         this.table2.Add(this.label8);
-        Gtk.Table.TableChild w21 = ((Gtk.Table.TableChild)(this.table2[this.label8]));
-        w21.TopAttach = ((uint)(1));
-        w21.BottomAttach = ((uint)(2));
-        w21.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w25 = ((Gtk.Table.TableChild)(this.table2[this.label8]));
+        w25.TopAttach = ((uint)(1));
+        w25.BottomAttach = ((uint)(2));
+        w25.YOptions = ((Gtk.AttachOptions)(4));
         // Container child table2.Gtk.Table+TableChild
         this.label9 = new Gtk.Label();
         this.label9.Name = "label9";
         this.label9.LabelProp = Mono.Unix.Catalog.GetString("Aggiornare la lista permette di trovare i file più recenti. Ogni volta che il programma viene avviato cerca di farlo autonomamente. La lista sul server viene aggiornata ogni ora.");
         this.label9.Wrap = true;
         this.table2.Add(this.label9);
-        Gtk.Table.TableChild w22 = ((Gtk.Table.TableChild)(this.table2[this.label9]));
-        w22.TopAttach = ((uint)(2));
-        w22.BottomAttach = ((uint)(3));
-        w22.YOptions = ((Gtk.AttachOptions)(4));
+        Gtk.Table.TableChild w26 = ((Gtk.Table.TableChild)(this.table2[this.label9]));
+        w26.TopAttach = ((uint)(2));
+        w26.BottomAttach = ((uint)(3));
+        w26.YOptions = ((Gtk.AttachOptions)(4));
         this.notebook1.Add(this.table2);
-        Gtk.Notebook.NotebookChild w23 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.table2]));
-        w23.Position = 2;
+        Gtk.Notebook.NotebookChild w27 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.table2]));
+        w27.Position = 2;
         // Notebook tab
         this.label7 = new Gtk.Label();
         this.label7.Name = "label7";
@@ -331,17 +367,17 @@ public partial class MainWindow {
         this.notebook1.SetTabLabel(this.table2, this.label7);
         this.label7.ShowAll();
         this.vbox1.Add(this.notebook1);
-        Gtk.Box.BoxChild w24 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
-        w24.Position = 0;
+        Gtk.Box.BoxChild w28 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
+        w28.Position = 0;
         // Container child vbox1.Gtk.Box+BoxChild
         this.dizzystatus = new Gtk.Statusbar();
         this.dizzystatus.Name = "dizzystatus";
         this.dizzystatus.Spacing = 6;
         this.vbox1.Add(this.dizzystatus);
-        Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox1[this.dizzystatus]));
-        w25.Position = 1;
-        w25.Expand = false;
-        w25.Fill = false;
+        Gtk.Box.BoxChild w29 = ((Gtk.Box.BoxChild)(this.vbox1[this.dizzystatus]));
+        w29.Position = 1;
+        w29.Expand = false;
+        w29.Fill = false;
         this.Add(this.vbox1);
         if ((this.Child != null)) {
             this.Child.ShowAll();
@@ -351,5 +387,7 @@ public partial class MainWindow {
         this.button1.Clicked += new System.EventHandler(this.OnSearchRequested);
         this.filelist.RowActivated += new Gtk.RowActivatedHandler(this.OnRowActivated);
         this.downloadpathchooser.SelectionChanged += new System.EventHandler(this.OnDownloadPathSelectionChanged);
+        this.button183.Clicked += new System.EventHandler(this.OnListUpdateRequired);
+        this.button182.Clicked += new System.EventHandler(this.OnDisconnectionRequested);
     }
 }
diff --git a/gtk-gui/gui.stetic b/gtk-gui/gui.stetic
index 71809dc..27c0187 100644
--- a/gtk-gui/gui.stetic
+++ b/gtk-gui/gui.stetic
@@ -8,7 +8,7 @@
     <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <widget-library name="../bin/Release/Dizzy.exe" internal="true" />
   </import>
-  <widget class="Gtk.Window" id="MainWindow" design-size="555 349">
+  <widget class="Gtk.Window" id="MainWindow" design-size="568 349">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Dizzy PreRelease</property>
     <property name="Icon">stock:stock_connect Menu</property>
@@ -25,7 +25,7 @@
           <widget class="Gtk.Notebook" id="notebook1">
             <property name="MemberName" />
             <property name="CanFocus">True</property>
-            <property name="CurrentPage">0</property>
+            <property name="CurrentPage">2</property>
             <child>
               <widget class="Gtk.VBox" id="vbox3">
                 <property name="MemberName" />
@@ -182,7 +182,6 @@ Libro</property>
                         <property name="MemberName" />
                         <property name="CanFocus">True</property>
                         <property name="ShowScrollbars">True</property>
-                        <property name="Reorderable">True</property>
                         <signal name="RowActivated" handler="OnRowActivated" />
                       </widget>
                     </child>
@@ -221,7 +220,7 @@ Libro</property>
                   </widget>
                   <packing>
                     <property name="Position">0</property>
-                    <property name="AutoSize">True</property>
+                    <property name="AutoSize">False</property>
                   </packing>
                 </child>
                 <child>
@@ -278,7 +277,7 @@ Libro</property>
             <child>
               <widget class="Gtk.Table" id="table2">
                 <property name="MemberName" />
-                <property name="NRows">4</property>
+                <property name="NRows">5</property>
                 <property name="NColumns">2</property>
                 <property name="RowSpacing">6</property>
                 <property name="ColumnSpacing">6</property>
@@ -290,12 +289,63 @@ Libro</property>
                   <placeholder />
                 </child>
                 <child>
+                  <widget class="Gtk.Alignment" id="alignment1">
+                    <property name="MemberName" />
+                    <child>
+                      <widget class="Gtk.Label" id="label10">
+                        <property name="MemberName" />
+                        <property name="Xalign">0</property>
+                        <property name="LabelProp" translatable="yes">&lt;b&gt;Utility&lt;/b&gt;</property>
+                        <property name="UseMarkup">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="TopAttach">3</property>
+                    <property name="BottomAttach">4</property>
+                    <property name="AutoSize">True</property>
+                    <property name="XOptions">Fill</property>
+                    <property name="YOptions">Fill</property>
+                    <property name="XExpand">False</property>
+                    <property name="XFill">True</property>
+                    <property name="XShrink">False</property>
+                    <property name="YExpand">False</property>
+                    <property name="YFill">True</property>
+                    <property name="YShrink">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Alignment" id="alignment2">
+                    <property name="MemberName" />
+                    <child>
+                      <widget class="Gtk.Label" id="label5">
+                        <property name="MemberName" />
+                        <property name="Xalign">0</property>
+                        <property name="LabelProp" translatable="yes">&lt;b&gt;Configurazione&lt;/b&gt;</property>
+                        <property name="UseMarkup">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="AutoSize">True</property>
+                    <property name="XOptions">Fill</property>
+                    <property name="YOptions">Fill</property>
+                    <property name="XExpand">False</property>
+                    <property name="XFill">True</property>
+                    <property name="XShrink">False</property>
+                    <property name="YExpand">False</property>
+                    <property name="YFill">True</property>
+                    <property name="YShrink">False</property>
+                  </packing>
+                </child>
+                <child>
                   <widget class="Gtk.Button" id="button182">
                     <property name="MemberName" />
                     <property name="CanFocus">True</property>
                     <property name="Type">TextOnly</property>
                     <property name="Label" translatable="yes">Disconnetti</property>
                     <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnDisconnectionRequested" />
                   </widget>
                   <packing>
                     <property name="TopAttach">1</property>
@@ -320,6 +370,7 @@ Libro</property>
                     <property name="Type">TextOnly</property>
                     <property name="Label" translatable="yes">Aggiorna lista</property>
                     <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnListUpdateRequired" />
                   </widget>
                   <packing>
                     <property name="TopAttach">2</property>
@@ -346,8 +397,8 @@ Libro</property>
                     <property name="UseUnderline">True</property>
                   </widget>
                   <packing>
-                    <property name="TopAttach">3</property>
-                    <property name="BottomAttach">4</property>
+                    <property name="TopAttach">4</property>
+                    <property name="BottomAttach">5</property>
                     <property name="LeftAttach">1</property>
                     <property name="RightAttach">2</property>
                     <property name="AutoSize">True</property>
@@ -366,8 +417,8 @@ Libro</property>
                     <property name="MemberName" />
                   </widget>
                   <packing>
-                    <property name="TopAttach">3</property>
-                    <property name="BottomAttach">4</property>
+                    <property name="TopAttach">4</property>
+                    <property name="BottomAttach">5</property>
                     <property name="AutoSize">True</property>
                     <property name="XOptions">Fill</property>
                     <property name="YOptions">Fill</property>
@@ -434,7 +485,7 @@ Libro</property>
           </widget>
           <packing>
             <property name="Position">0</property>
-            <property name="AutoSize">True</property>
+            <property name="AutoSize">False</property>
           </packing>
         </child>
         <child>
ViewGit