Updated login code

Added dummy restart grid function
zircon^2
gareth 2007-05-19 00:01:43 +00:00
parent 02123f9036
commit 5bdbe8d916
6 changed files with 36 additions and 5 deletions

View File

@ -2,12 +2,14 @@ using Nwc.XmlRpc;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using libsecondlife;
namespace OpenGridServices.Manager namespace OpenGridServices.Manager
{ {
public class GridServerConnectionManager public class GridServerConnectionManager
{ {
private string ServerURL; private string ServerURL;
public LLUUID SessionID;
public bool Connect(string GridServerURL, string username, string password) public bool Connect(string GridServerURL, string username, string password)
{ {
@ -23,6 +25,8 @@ namespace OpenGridServices.Manager
if(GridResp.IsFault) { if(GridResp.IsFault) {
return false; return false;
} else { } else {
Hashtable gridrespData = (Hashtable)GridResp.Value;
this.SessionID = new LLUUID((string)gridrespData["session_id"]);
return true; return true;
} }
} catch(Exception e) { } catch(Exception e) {
@ -30,5 +34,10 @@ namespace OpenGridServices.Manager
return false; return false;
} }
} }
public bool RestartServer()
{
return true;
}
} }
} }

View File

@ -40,11 +40,24 @@ namespace OpenGridServices.Manager
case "connect_to_gridserver": case "connect_to_gridserver":
win.SetStatus("Connecting to grid server..."); win.SetStatus("Connecting to grid server...");
if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { 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 { } else {
win.SetStatus("Could not connect"); win.SetStatus("Could not connect");
} }
break; 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;
} }
} }
} }

View File

@ -35,6 +35,11 @@ namespace OpenGridServices.Manager {
} }
protected virtual void RestartGridserverMenu(object sender, System.EventArgs e)
{
MainClass.PendingOperations.Enqueue("restart_gridserver");
}
} }
} }

View File

@ -45,6 +45,8 @@ namespace OpenGridServices.Manager {
this.Events = ((Gdk.EventMask)(256)); this.Events = ((Gdk.EventMask)(256));
this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog"; this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog";
this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server"); this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server");
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.HasSeparator = false;
// Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox // Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox
Gtk.VBox w1 = this.VBox; Gtk.VBox w1 = this.VBox;
w1.Events = ((Gdk.EventMask)(256)); w1.Events = ((Gdk.EventMask)(256));
@ -166,7 +168,7 @@ namespace OpenGridServices.Manager {
w15.Spacing = 2; w15.Spacing = 2;
// Container child GtkHBox.Gtk.Container+ContainerChild // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w16 = new Gtk.Image(); Gtk.Image w16 = new Gtk.Image();
w16.Name = "image39"; w16.Name = "image1";
w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0); w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0);
w15.Add(w16); w15.Add(w16);
// Container child GtkHBox.Gtk.Container+ContainerChild // Container child GtkHBox.Gtk.Container+ContainerChild
@ -196,7 +198,7 @@ namespace OpenGridServices.Manager {
w24.Spacing = 2; w24.Spacing = 2;
// Container child GtkHBox1.Gtk.Container+ContainerChild // Container child GtkHBox1.Gtk.Container+ContainerChild
Gtk.Image w25 = new Gtk.Image(); Gtk.Image w25 = new Gtk.Image();
w25.Name = "image40"; w25.Name = "image2";
w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0); w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0);
w24.Add(w25); w24.Add(w25);
// Container child GtkHBox1.Gtk.Container+ContainerChild // Container child GtkHBox1.Gtk.Container+ContainerChild

View File

@ -202,7 +202,6 @@ namespace OpenGridServices.Manager {
this.Name = "OpenGridServices.Manager.MainWindow"; this.Name = "OpenGridServices.Manager.MainWindow";
this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager"); this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager");
this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0); this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0);
this.WindowPosition = ((Gtk.WindowPosition)(0));
// Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild // Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild
this.vbox1 = new Gtk.VBox(); this.vbox1 = new Gtk.VBox();
this.vbox1.Name = "vbox1"; this.vbox1.Name = "vbox1";
@ -354,6 +353,7 @@ namespace OpenGridServices.Manager {
this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu);
this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu);
this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu);
} }
} }
} }

View File

@ -105,6 +105,7 @@
<property name="Label" translatable="yes">Restart gridserver only</property> <property name="Label" translatable="yes">Restart gridserver only</property>
<property name="ShortLabel" translatable="yes">Restart gridserver only</property> <property name="ShortLabel" translatable="yes">Restart gridserver only</property>
<property name="StockId">gtk-refresh</property> <property name="StockId">gtk-refresh</property>
<signal name="Activated" handler="RestartGridserverMenu" after="yes" />
</action> </action>
<action id="DefaultLocalGridUserserver"> <action id="DefaultLocalGridUserserver">
<property name="Type">Action</property> <property name="Type">Action</property>
@ -169,7 +170,6 @@
<property name="HeightRequest">600</property> <property name="HeightRequest">600</property>
<property name="Title" translatable="yes">Open Grid Services Manager</property> <property name="Title" translatable="yes">Open Grid Services Manager</property>
<property name="Icon">stock:gtk-network Dialog</property> <property name="Icon">stock:gtk-network Dialog</property>
<property name="WindowPosition">None</property>
<signal name="DeleteEvent" handler="OnDeleteEvent" /> <signal name="DeleteEvent" handler="OnDeleteEvent" />
<child> <child>
<widget class="Gtk.VBox" id="vbox1"> <widget class="Gtk.VBox" id="vbox1">
@ -467,8 +467,10 @@
<property name="MemberName" /> <property name="MemberName" />
<property name="Events">ButtonPressMask</property> <property name="Events">ButtonPressMask</property>
<property name="Title" translatable="yes">Connect to Grid server</property> <property name="Title" translatable="yes">Connect to Grid server</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property> <property name="Buttons">2</property>
<property name="HelpButton">False</property> <property name="HelpButton">False</property>
<property name="HasSeparator">False</property>
<signal name="Response" handler="OnResponse" /> <signal name="Response" handler="OnResponse" />
<child internal-child="VBox"> <child internal-child="VBox">
<widget class="Gtk.VBox" id="dialog_VBox"> <widget class="Gtk.VBox" id="dialog_VBox">