diff options
Diffstat (limited to 'OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs')
-rw-r--r-- | OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs new file mode 100644 index 0000000..1db38f0 --- /dev/null +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs | |||
@@ -0,0 +1,76 @@ | |||
1 | using System; | ||
2 | using Gtk; | ||
3 | |||
4 | namespace OpenGridServices.Manager { | ||
5 | public partial class MainWindow: Gtk.Window | ||
6 | { | ||
7 | public MainWindow (): base (Gtk.WindowType.Toplevel) | ||
8 | { | ||
9 | Build (); | ||
10 | } | ||
11 | |||
12 | public void SetStatus(string statustext) | ||
13 | { | ||
14 | this.statusbar1.Pop(0); | ||
15 | this.statusbar1.Push(0,statustext); | ||
16 | } | ||
17 | |||
18 | public void DrawGrid(RegionBlock[][] regions) | ||
19 | { | ||
20 | for(int x=0; x<=regions.GetUpperBound(0); x++) { | ||
21 | for(int y=0; y<=regions.GetUpperBound(1); y++) { | ||
22 | Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); | ||
23 | this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | |||
28 | public void SetGridServerConnected(bool connected) | ||
29 | { | ||
30 | if(connected) { | ||
31 | this.ConnectToGridserver.Visible=false; | ||
32 | this.DisconnectFromGridServer.Visible=true; | ||
33 | } else { | ||
34 | this.ConnectToGridserver.Visible=true; | ||
35 | this.DisconnectFromGridServer.Visible=false; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) | ||
40 | { | ||
41 | Application.Quit (); | ||
42 | MainClass.QuitReq=true; | ||
43 | a.RetVal = true; | ||
44 | } | ||
45 | |||
46 | protected virtual void QuitMenu(object sender, System.EventArgs e) | ||
47 | { | ||
48 | MainClass.QuitReq=true; | ||
49 | Application.Quit(); | ||
50 | } | ||
51 | |||
52 | protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e) | ||
53 | { | ||
54 | ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog (); | ||
55 | griddialog.Show(); | ||
56 | } | ||
57 | |||
58 | protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) | ||
59 | { | ||
60 | MainClass.PendingOperations.Enqueue("restart_gridserver"); | ||
61 | } | ||
62 | |||
63 | protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) | ||
64 | { | ||
65 | MainClass.PendingOperations.Enqueue("shutdown_gridserver"); | ||
66 | } | ||
67 | |||
68 | protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e) | ||
69 | { | ||
70 | MainClass.PendingOperations.Enqueue("disconnect_gridserver"); | ||
71 | } | ||
72 | |||
73 | } | ||
74 | } | ||
75 | |||
76 | \ No newline at end of file | ||