From 6a1b787436cc59043a26a296781e7a7b5ea0c67b Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 14 May 2008 05:33:32 +0000 Subject: More formatting cleanup. --- .../ConnectToGridServerDialog.cs | 3 +- .../GridServerConnectionManager.cs | 28 +++++++++---- .../Grid/Manager/OpenGridServices.Manager/Main.cs | 32 +++++++++----- .../Grid/Manager/OpenGridServices.Manager/Util.cs | 2 +- ...idServices.Manager.ConnectToGridServerDialog.cs | 27 ++++-------- .../gtk-gui/OpenGridServices.Manager.MainWindow.cs | 49 ++++------------------ .../OpenGridServices.Manager/gtk-gui/generated.cs | 26 ++++++------ 7 files changed, 73 insertions(+), 94 deletions(-) (limited to 'OpenSim/Grid/Manager') diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs index b6b2b64..210e195 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs @@ -39,7 +39,8 @@ namespace OpenGridServices.Manager protected virtual void OnResponse(object o, Gtk.ResponseArgs args) { - switch (args.ResponseId) { + switch (args.ResponseId) + { case Gtk.ResponseType.Ok: MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); break; diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs index a386fa8..cf44ac2 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs @@ -46,7 +46,8 @@ namespace OpenGridServices.Manager public bool Connect(string GridServerURL, string username, string password) { - try { + try + { this.ServerURL=GridServerURL; Hashtable LoginParamsHT = new Hashtable(); LoginParamsHT["username"]=username; @@ -55,16 +56,21 @@ namespace OpenGridServices.Manager LoginParams.Add(LoginParamsHT); XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); - if (GridResp.IsFault) { + if (GridResp.IsFault) + { connected=false; return false; - } else { + } + else + { Hashtable gridrespData = (Hashtable)GridResp.Value; this.SessionID = new LLUUID((string)gridrespData["session_id"]); connected=true; return true; } - } catch(Exception e) { + } + catch(Exception e) + { Console.WriteLine(e.ToString()); connected=false; return false; @@ -107,20 +113,26 @@ namespace OpenGridServices.Manager public bool ShutdownServer() { - try { + try + { Hashtable ShutdownParamsHT = new Hashtable(); ArrayList ShutdownParams = new ArrayList(); ShutdownParamsHT["session_id"]=this.SessionID.ToString(); ShutdownParams.Add(ShutdownParamsHT); XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL, 3000); - if (GridResp.IsFault) { + if (GridResp.IsFault) + { return false; - } else { + } + else + { connected=false; return true; } - } catch(Exception e) { + } + catch(Exception e) + { Console.WriteLine(e.ToString()); return false; } diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs index 6b7a5ab..7700229 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs @@ -62,47 +62,57 @@ namespace OpenGridServices.Manager operation=PendingOperations.Dequeue(); Console.WriteLine(operation); cmd = operation.Split(sep)[0]; - switch (cmd) { + switch (cmd) + { 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])) { + if (gridserverConn.Connect(operation.Split(sep)[1], operation.Split(sep)[2], operation.Split(sep)[3])) + { win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); win.SetGridServerConnected(true); Thread.Sleep(3000); win.SetStatus("Downloading region maps..."); gridserverConn.DownloadMap(); - } else { + } + else + { win.SetStatus("Could not connect"); } - break; + break; case "restart_gridserver": win.SetStatus("Restarting grid server..."); - if (gridserverConn.RestartServer()) { + if (gridserverConn.RestartServer()) + { win.SetStatus("Restarted server OK"); Thread.Sleep(3000); win.SetStatus(""); - } else { + } + else + { win.SetStatus("Error restarting grid server!!!"); } - break; + break; case "shutdown_gridserver": win.SetStatus("Shutting down grid server..."); - if (gridserverConn.ShutdownServer()) { + if (gridserverConn.ShutdownServer()) + { win.SetStatus("Grid server shutdown"); win.SetGridServerConnected(false); Thread.Sleep(3000); win.SetStatus(""); - } else { + } + else + { win.SetStatus("Could not shutdown grid server!!!"); } - break; + break; case "disconnect_gridserver": gridserverConn.DisconnectServer(); win.SetGridServerConnected(false); - break; + break; } } } diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs index fcc5574..aff4719 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Util.cs @@ -55,7 +55,7 @@ namespace OpenSim.Framework.Utilities public static uint GetNextXferID() { uint id = 0; - lock(XferLock) + lock (XferLock) { id = nextXferID; nextXferID++; diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs index d082a3b..a5a4ec8 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs @@ -35,38 +35,26 @@ // // ------------------------------------------------------------------------------ -namespace OpenGridServices.Manager { - - - public partial class ConnectToGridServerDialog { - +namespace OpenGridServices.Manager +{ + public partial class ConnectToGridServerDialog + { private Gtk.VBox vbox2; - private Gtk.VBox vbox3; - private Gtk.HBox hbox1; - private Gtk.Label label1; - private Gtk.Entry entry1; - private Gtk.HBox hbox2; - private Gtk.Label label2; - private Gtk.Entry entry2; - private Gtk.HBox hbox3; - private Gtk.Label label3; - private Gtk.Entry entry3; - private Gtk.Button button2; - private Gtk.Button button8; - protected virtual void Build() { + protected virtual void Build() + { Stetic.Gui.Initialize(); // Widget OpenGridServices.Manager.ConnectToGridServerDialog this.Events = ((Gdk.EventMask)(256)); @@ -241,7 +229,8 @@ namespace OpenGridServices.Manager { w31.Position = 1; w31.Expand = false; w31.Fill = false; - if ((this.Child != null)) { + if (this.Child != null) + { this.Child.ShowAll(); } this.DefaultWidth = 476; diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs index 9d3cdaf..9707aee 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs @@ -35,82 +35,48 @@ // // ------------------------------------------------------------------------------ -namespace OpenGridServices.Manager { - - - public partial class MainWindow { - +namespace OpenGridServices.Manager +{ + public partial class MainWindow + { private Gtk.Action Grid; - private Gtk.Action User; - private Gtk.Action Asset; - private Gtk.Action Region; - private Gtk.Action Services; - private Gtk.Action ConnectToGridserver; - private Gtk.Action RestartWholeGrid; - private Gtk.Action ShutdownWholeGrid; - private Gtk.Action ExitGridManager; - private Gtk.Action ConnectToUserserver; - private Gtk.Action AccountManagment; - private Gtk.Action GlobalNotice; - private Gtk.Action DisableAllLogins; - private Gtk.Action DisableNonGodUsersOnly; - private Gtk.Action ShutdownUserServer; - private Gtk.Action ShutdownGridserverOnly; - private Gtk.Action RestartGridserverOnly; - private Gtk.Action DefaultLocalGridUserserver; - private Gtk.Action CustomUserserver; - private Gtk.Action RemoteGridDefaultUserserver; - private Gtk.Action DisconnectFromGridServer; - private Gtk.Action UploadAsset; - private Gtk.Action AssetManagement; - private Gtk.Action ConnectToAssetServer; - private Gtk.Action ConnectToDefaultAssetServerForGrid; - private Gtk.Action DefaultForLocalGrid; - private Gtk.Action DefaultForRemoteGrid; - private Gtk.Action CustomAssetServer; - private Gtk.VBox vbox1; - private Gtk.MenuBar menubar2; - private Gtk.HBox hbox1; - private Gtk.ScrolledWindow scrolledwindow1; - private Gtk.DrawingArea drawingarea1; - private Gtk.TreeView treeview1; - private Gtk.Statusbar statusbar1; - protected virtual void Build() { + protected virtual void Build() + { Stetic.Gui.Initialize(); // Widget OpenGridServices.Manager.MainWindow Gtk.UIManager w1 = new Gtk.UIManager(); @@ -266,7 +232,8 @@ namespace OpenGridServices.Manager { w10.Expand = false; w10.Fill = false; this.Add(this.vbox1); - if ((this.Child != null)) { + if (this.Child != null) + { this.Child.ShowAll(); } this.DefaultWidth = 800; diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs index b297b16..46dec05 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/gtk-gui/generated.cs @@ -35,27 +35,27 @@ // // ------------------------------------------------------------------------------ -namespace Stetic { - - - internal class Gui { - +namespace Stetic +{ + internal class Gui + { private static bool initialized; - internal static void Initialize() { - if ((Stetic.Gui.initialized == false)) { - Stetic.Gui.initialized = true; - } + internal static void Initialize() + { + Stetic.Gui.initialized = true; } } - internal class ActionGroups { - - public static Gtk.ActionGroup GetActionGroup(System.Type type) { + internal class ActionGroups + { + public static Gtk.ActionGroup GetActionGroup(System.Type type) + { return Stetic.ActionGroups.GetActionGroup(type.FullName); } - public static Gtk.ActionGroup GetActionGroup(string name) { + public static Gtk.ActionGroup GetActionGroup(string name) + { return null; } } -- cgit v1.1