From 5bdbe8d9166296ca85ab2db14157941d36575bb0 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 19 May 2007 00:01:43 +0000 Subject: Updated login code Added dummy restart grid function --- .../GridServerConnectionManager.cs | 9 +++++++++ OpenGridServices.Manager/OpenGridServices.Manager/Main.cs | 15 ++++++++++++++- .../OpenGridServices.Manager/MainWindow.cs | 5 +++++ .../OpenGridServices.Manager.ConnectToGridServerDialog.cs | 6 ++++-- .../gtk-gui/OpenGridServices.Manager.MainWindow.cs | 2 +- .../OpenGridServices.Manager/gtk-gui/gui.stetic | 4 +++- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs index 8c933e1..afd9a69 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs @@ -2,12 +2,14 @@ using Nwc.XmlRpc; using System; using System.Collections; using System.Collections.Generic; +using libsecondlife; namespace OpenGridServices.Manager { public class GridServerConnectionManager { private string ServerURL; + public LLUUID SessionID; public bool Connect(string GridServerURL, string username, string password) { @@ -23,6 +25,8 @@ namespace OpenGridServices.Manager if(GridResp.IsFault) { return false; } else { + Hashtable gridrespData = (Hashtable)GridResp.Value; + this.SessionID = new LLUUID((string)gridrespData["session_id"]); return true; } } catch(Exception e) { @@ -30,5 +34,10 @@ namespace OpenGridServices.Manager return false; } } + + public bool RestartServer() + { + return true; + } } } diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs index 0e3f74d..d5a9688 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs +++ b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs @@ -40,11 +40,24 @@ namespace OpenGridServices.Manager case "connect_to_gridserver": win.SetStatus("Connecting to grid server..."); if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { - win.SetStatus("Connected OK"); + win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); + Thread.Sleep(3000); + win.SetStatus(""); } else { win.SetStatus("Could not connect"); } break; + + case "restart_gridserver": + win.SetStatus("Restarting grid server..."); + if(gridserverConn.RestartServer()) { + win.SetStatus("Restarted server OK"); + Thread.Sleep(3000); + win.SetStatus(""); + } else { + win.SetStatus("Error restarting grid server!!!"); + } + break; } } } diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs index 5a22221..5cf4bc1 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs +++ b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs @@ -35,6 +35,11 @@ namespace OpenGridServices.Manager { } + protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) + { + MainClass.PendingOperations.Enqueue("restart_gridserver"); + } + } } diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs index 0707b01..da6739e 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs +++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs @@ -45,6 +45,8 @@ namespace OpenGridServices.Manager { this.Events = ((Gdk.EventMask)(256)); this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog"; this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server"); + this.WindowPosition = ((Gtk.WindowPosition)(4)); + this.HasSeparator = false; // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox Gtk.VBox w1 = this.VBox; w1.Events = ((Gdk.EventMask)(256)); @@ -166,7 +168,7 @@ namespace OpenGridServices.Manager { w15.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild Gtk.Image w16 = new Gtk.Image(); - w16.Name = "image39"; + w16.Name = "image1"; w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0); w15.Add(w16); // Container child GtkHBox.Gtk.Container+ContainerChild @@ -196,7 +198,7 @@ namespace OpenGridServices.Manager { w24.Spacing = 2; // Container child GtkHBox1.Gtk.Container+ContainerChild Gtk.Image w25 = new Gtk.Image(); - w25.Name = "image40"; + w25.Name = "image2"; w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0); w24.Add(w25); // Container child GtkHBox1.Gtk.Container+ContainerChild diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs index 4047dec..c565b9b 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs +++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs @@ -202,7 +202,6 @@ namespace OpenGridServices.Manager { this.Name = "OpenGridServices.Manager.MainWindow"; this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager"); this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0); - this.WindowPosition = ((Gtk.WindowPosition)(0)); // Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild this.vbox1 = new Gtk.VBox(); this.vbox1.Name = "vbox1"; @@ -354,6 +353,7 @@ namespace OpenGridServices.Manager { this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); + this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu); } } } diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic index 12674c3..2e04efa 100644 --- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic +++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic @@ -105,6 +105,7 @@ Restart gridserver only Restart gridserver only gtk-refresh + Action @@ -169,7 +170,6 @@ 600 Open Grid Services Manager stock:gtk-network Dialog - None @@ -467,8 +467,10 @@ ButtonPressMask Connect to Grid server + CenterOnParent 2 False + False -- cgit v1.1