aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.Manager
diff options
context:
space:
mode:
Diffstat (limited to 'OpenGridServices.Manager')
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/Main.cs1
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp1
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/Util.cs133
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/ConnectToGridServerDialog.cs8
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/MainWindow.cs5
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic7
6 files changed, 149 insertions, 6 deletions
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
index 598a342..2921573 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
@@ -6,6 +6,7 @@ namespace OpenGridServices.Manager
6{ 6{
7 class MainClass 7 class MainClass
8 { 8 {
9
9 public static void Main (string[] args) 10 public static void Main (string[] args)
10 { 11 {
11 Application.Init (); 12 Application.Init ();
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp b/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
index d3b87e9..c8baa00 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
@@ -22,6 +22,7 @@
22 <File name="./AssemblyInfo.cs" subtype="Code" buildaction="Compile" /> 22 <File name="./AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
23 <File name="./ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" /> 23 <File name="./ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
24 <File name="./gtk-gui/ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" /> 24 <File name="./gtk-gui/ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
25 <File name="./Util.cs" subtype="Code" buildaction="Compile" />
25 </Contents> 26 </Contents>
26 <References> 27 <References>
27 <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 28 <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs b/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs
new file mode 100644
index 0000000..5bf7ff9
--- /dev/null
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/Util.cs
@@ -0,0 +1,133 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6
7namespace OpenSim.Framework.Utilities
8{
9 public class Util
10 {
11 private static Random randomClass = new Random();
12 private static uint nextXferID = 5000;
13 private static object XferLock = new object();
14
15 public static ulong UIntsToLong(uint X, uint Y)
16 {
17 return Helpers.UIntsToLong(X, Y);
18 }
19
20 public static Random RandomClass
21 {
22 get
23 {
24 return randomClass;
25 }
26 }
27
28 public static uint GetNextXferID()
29 {
30 uint id = 0;
31 lock(XferLock)
32 {
33 id = nextXferID;
34 nextXferID++;
35 }
36 return id;
37 }
38
39 //public static int fast_distance2d(int x, int y)
40 //{
41 // x = System.Math.Abs(x);
42 // y = System.Math.Abs(y);
43
44 // int min = System.Math.Min(x, y);
45
46 // return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
47 //}
48
49 public static string FieldToString(byte[] bytes)
50 {
51 return FieldToString(bytes, String.Empty);
52 }
53
54 /// <summary>
55 /// Convert a variable length field (byte array) to a string, with a
56 /// field name prepended to each line of the output
57 /// </summary>
58 /// <remarks>If the byte array has unprintable characters in it, a
59 /// hex dump will be put in the string instead</remarks>
60 /// <param name="bytes">The byte array to convert to a string</param>
61 /// <param name="fieldName">A field name to prepend to each line of output</param>
62 /// <returns>An ASCII string or a string containing a hex dump, minus
63 /// the null terminator</returns>
64 public static string FieldToString(byte[] bytes, string fieldName)
65 {
66 // Check for a common case
67 if (bytes.Length == 0) return String.Empty;
68
69 StringBuilder output = new StringBuilder();
70 bool printable = true;
71
72 for (int i = 0; i < bytes.Length; ++i)
73 {
74 // Check if there are any unprintable characters in the array
75 if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
76 && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
77 {
78 printable = false;
79 break;
80 }
81 }
82
83 if (printable)
84 {
85 if (fieldName.Length > 0)
86 {
87 output.Append(fieldName);
88 output.Append(": ");
89 }
90
91 if (bytes[bytes.Length - 1] == 0x00)
92 output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
93 else
94 output.Append(UTF8Encoding.UTF8.GetString(bytes));
95 }
96 else
97 {
98 for (int i = 0; i < bytes.Length; i += 16)
99 {
100 if (i != 0)
101 output.Append(Environment.NewLine);
102 if (fieldName.Length > 0)
103 {
104 output.Append(fieldName);
105 output.Append(": ");
106 }
107
108 for (int j = 0; j < 16; j++)
109 {
110 if ((i + j) < bytes.Length)
111 output.Append(String.Format("{0:X2} ", bytes[i + j]));
112 else
113 output.Append(" ");
114 }
115
116 for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
117 {
118 if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
119 output.Append((char)bytes[i + j]);
120 else
121 output.Append(".");
122 }
123 }
124 }
125
126 return output.ToString();
127 }
128 public Util()
129 {
130
131 }
132 }
133}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/ConnectToGridServerDialog.cs b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/ConnectToGridServerDialog.cs
index a7c8d43..e147f63 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/ConnectToGridServerDialog.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/ConnectToGridServerDialog.cs
@@ -28,6 +28,8 @@ public partial class ConnectToGridServerDialog {
28 this.Events = ((Gdk.EventMask)(256)); 28 this.Events = ((Gdk.EventMask)(256));
29 this.Name = "ConnectToGridServerDialog"; 29 this.Name = "ConnectToGridServerDialog";
30 this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server"); 30 this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server");
31 this.WindowPosition = ((Gtk.WindowPosition)(4));
32 this.HasSeparator = false;
31 // Internal child ConnectToGridServerDialog.VBox 33 // Internal child ConnectToGridServerDialog.VBox
32 Gtk.VBox w1 = this.VBox; 34 Gtk.VBox w1 = this.VBox;
33 w1.Events = ((Gdk.EventMask)(256)); 35 w1.Events = ((Gdk.EventMask)(256));
@@ -85,7 +87,7 @@ public partial class ConnectToGridServerDialog {
85 w7.Spacing = 2; 87 w7.Spacing = 2;
86 // Container child GtkHBox.Gtk.Container+ContainerChild 88 // Container child GtkHBox.Gtk.Container+ContainerChild
87 Gtk.Image w8 = new Gtk.Image(); 89 Gtk.Image w8 = new Gtk.Image();
88 w8.Name = "image11"; 90 w8.Name = "image1";
89 w8.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0); 91 w8.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0);
90 w7.Add(w8); 92 w7.Add(w8);
91 // Container child GtkHBox.Gtk.Container+ContainerChild 93 // Container child GtkHBox.Gtk.Container+ContainerChild
@@ -115,7 +117,7 @@ public partial class ConnectToGridServerDialog {
115 w16.Spacing = 2; 117 w16.Spacing = 2;
116 // Container child GtkHBox1.Gtk.Container+ContainerChild 118 // Container child GtkHBox1.Gtk.Container+ContainerChild
117 Gtk.Image w17 = new Gtk.Image(); 119 Gtk.Image w17 = new Gtk.Image();
118 w17.Name = "image12"; 120 w17.Name = "image2";
119 w17.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0); 121 w17.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0);
120 w16.Add(w17); 122 w16.Add(w17);
121 // Container child GtkHBox1.Gtk.Container+ContainerChild 123 // Container child GtkHBox1.Gtk.Container+ContainerChild
@@ -137,5 +139,7 @@ public partial class ConnectToGridServerDialog {
137 this.DefaultWidth = 476; 139 this.DefaultWidth = 476;
138 this.DefaultHeight = 107; 140 this.DefaultHeight = 107;
139 this.Show(); 141 this.Show();
142 this.button2.Activated += new System.EventHandler(this.ConnectBtn);
143 this.button8.Activated += new System.EventHandler(this.CancelBtn);
140 } 144 }
141} 145}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/MainWindow.cs
index 43c2f64..74e7185 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/MainWindow.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/MainWindow.cs
@@ -196,10 +196,11 @@ public partial class MainWindow {
196 w2.Add(this.CustomAssetServer, null); 196 w2.Add(this.CustomAssetServer, null);
197 w1.InsertActionGroup(w2, 0); 197 w1.InsertActionGroup(w2, 0);
198 this.AddAccelGroup(w1.AccelGroup); 198 this.AddAccelGroup(w1.AccelGroup);
199 this.WidthRequest = 600; 199 this.WidthRequest = 800;
200 this.HeightRequest = 800; 200 this.HeightRequest = 600;
201 this.Name = "MainWindow"; 201 this.Name = "MainWindow";
202 this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager"); 202 this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager");
203 this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0);
203 // Container child MainWindow.Gtk.Container+ContainerChild 204 // Container child MainWindow.Gtk.Container+ContainerChild
204 this.vbox1 = new Gtk.VBox(); 205 this.vbox1 = new Gtk.VBox();
205 this.vbox1.Name = "vbox1"; 206 this.vbox1.Name = "vbox1";
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
index 3908ac4..72586a7 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
@@ -165,9 +165,10 @@
165 </action> 165 </action>
166 </action-group> 166 </action-group>
167 <property name="MemberName" /> 167 <property name="MemberName" />
168 <property name="WidthRequest">600</property> 168 <property name="WidthRequest">800</property>
169 <property name="HeightRequest">800</property> 169 <property name="HeightRequest">600</property>
170 <property name="Title" translatable="yes">Open Grid Services Manager</property> 170 <property name="Title" translatable="yes">Open Grid Services Manager</property>
171 <property name="Icon">stock:gtk-network Dialog</property>
171 <signal name="DeleteEvent" handler="OnDeleteEvent" /> 172 <signal name="DeleteEvent" handler="OnDeleteEvent" />
172 <child> 173 <child>
173 <widget class="Gtk.VBox" id="vbox1"> 174 <widget class="Gtk.VBox" id="vbox1">
@@ -465,8 +466,10 @@
465 <property name="MemberName" /> 466 <property name="MemberName" />
466 <property name="Events">ButtonPressMask</property> 467 <property name="Events">ButtonPressMask</property>
467 <property name="Title" translatable="yes">Connect to Grid server</property> 468 <property name="Title" translatable="yes">Connect to Grid server</property>
469 <property name="WindowPosition">CenterOnParent</property>
468 <property name="Buttons">2</property> 470 <property name="Buttons">2</property>
469 <property name="HelpButton">False</property> 471 <property name="HelpButton">False</property>
472 <property name="HasSeparator">False</property>
470 <child internal-child="VBox"> 473 <child internal-child="VBox">
471 <widget class="Gtk.VBox" id="dialog_VBox"> 474 <widget class="Gtk.VBox" id="dialog_VBox">
472 <property name="MemberName" /> 475 <property name="MemberName" />