parent
02123f9036
commit
5bdbe8d916
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,11 @@ namespace OpenGridServices.Manager {
|
|||
|
||||
}
|
||||
|
||||
protected virtual void RestartGridserverMenu(object sender, System.EventArgs e)
|
||||
{
|
||||
MainClass.PendingOperations.Enqueue("restart_gridserver");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
<property name="Label" translatable="yes">Restart gridserver only</property>
|
||||
<property name="ShortLabel" translatable="yes">Restart gridserver only</property>
|
||||
<property name="StockId">gtk-refresh</property>
|
||||
<signal name="Activated" handler="RestartGridserverMenu" after="yes" />
|
||||
</action>
|
||||
<action id="DefaultLocalGridUserserver">
|
||||
<property name="Type">Action</property>
|
||||
|
@ -169,7 +170,6 @@
|
|||
<property name="HeightRequest">600</property>
|
||||
<property name="Title" translatable="yes">Open Grid Services Manager</property>
|
||||
<property name="Icon">stock:gtk-network Dialog</property>
|
||||
<property name="WindowPosition">None</property>
|
||||
<signal name="DeleteEvent" handler="OnDeleteEvent" />
|
||||
<child>
|
||||
<widget class="Gtk.VBox" id="vbox1">
|
||||
|
@ -467,8 +467,10 @@
|
|||
<property name="MemberName" />
|
||||
<property name="Events">ButtonPressMask</property>
|
||||
<property name="Title" translatable="yes">Connect to Grid server</property>
|
||||
<property name="WindowPosition">CenterOnParent</property>
|
||||
<property name="Buttons">2</property>
|
||||
<property name="HelpButton">False</property>
|
||||
<property name="HasSeparator">False</property>
|
||||
<signal name="Response" handler="OnResponse" />
|
||||
<child internal-child="VBox">
|
||||
<widget class="Gtk.VBox" id="dialog_VBox">
|
||||
|
|
Loading…
Reference in New Issue