diff options
author | Tedd Hansen | 2008-12-06 03:28:34 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-12-06 03:28:34 +0000 |
commit | f2cbc48a9e704da8e86ed659437c1e338e212c50 (patch) | |
tree | 483255008f063c08d541ae56760f894273eaf041 /OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs | |
parent | Minor formatting cleanup. (diff) | |
download | opensim-SC-f2cbc48a9e704da8e86ed659437c1e338e212c50.zip opensim-SC-f2cbc48a9e704da8e86ed659437c1e338e212c50.tar.gz opensim-SC-f2cbc48a9e704da8e86ed659437c1e338e212c50.tar.bz2 opensim-SC-f2cbc48a9e704da8e86ed659437c1e338e212c50.tar.xz |
GUI for launching grids. Early version, but should work fine.
Will execute all OpenSim services redirect their input/output/errors to the selected "GUI module".
This version has following "GUI modules":
* Windows Forms
* Windows Service (doesn't work yet)
* Console
* TCP daemon
This means that OpenSim can now run in a single console for those who want that.
Console functionallity is not too rich yet, but code/framework is there... more to come. :)
Diffstat (limited to 'OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs')
-rw-r--r-- | OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs new file mode 100644 index 0000000..7b35c15 --- /dev/null +++ b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs | |||
@@ -0,0 +1,54 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.ComponentModel; | ||
4 | using System.Drawing; | ||
5 | using System.Data; | ||
6 | using System.Text; | ||
7 | using System.Windows.Forms; | ||
8 | |||
9 | namespace OpenSim.GridLaunch.GUI.WinForm | ||
10 | { | ||
11 | public partial class ucLogWindow : UserControl | ||
12 | { | ||
13 | // If text in window is more than this | ||
14 | private static readonly int logWindowMaxTextLength = 20000; | ||
15 | // Remove this much from start of it | ||
16 | private static int logWindowTrunlTextLength = 10000; | ||
17 | |||
18 | public ucLogWindow() | ||
19 | { | ||
20 | if (logWindowMaxTextLength < logWindowTrunlTextLength) | ||
21 | logWindowTrunlTextLength = logWindowMaxTextLength / 2; | ||
22 | |||
23 | InitializeComponent(); | ||
24 | } | ||
25 | |||
26 | public delegate void textWriteDelegate(Color color, string LogText); | ||
27 | public void Write(Color color, string LogText) | ||
28 | { | ||
29 | // Check if we to pass task on to GUI thread | ||
30 | if (this.InvokeRequired) | ||
31 | { | ||
32 | this.Invoke(new textWriteDelegate(Write), color, LogText); | ||
33 | return; | ||
34 | } | ||
35 | // Append to window | ||
36 | try | ||
37 | { | ||
38 | if (!txtLog.IsDisposed) | ||
39 | txtLog.AppendText(LogText); | ||
40 | } catch { } | ||
41 | } | ||
42 | |||
43 | private void txtLog_TextChanged(object sender, EventArgs e) | ||
44 | { | ||
45 | // Go to bottom of window | ||
46 | txtLog.ScrollToCaret(); | ||
47 | |||
48 | // Make sure amount of text in window doesn't grow too big | ||
49 | if (txtLog.Text.Length > logWindowMaxTextLength) | ||
50 | txtLog.Text = txtLog.Text.Remove(0, logWindowTrunlTextLength); | ||
51 | } | ||
52 | |||
53 | } | ||
54 | } | ||