WIP: Main message scroller rudimentally working

This commit is contained in:
Latif Khalifa
2013-12-01 19:33:47 +01:00
parent 4a58176cac
commit 956a4e85e5
7 changed files with 1128 additions and 150 deletions

View File

@@ -5,12 +5,36 @@ using GridProxyGUI;
namespace GridProxyGUI
{
public class UDPFilterItem
public enum ItemType : int
{
public bool Enabled;
public string Name;
Unknown = 0,
Login,
UDP,
Cap,
EQ
}
public class FilterItem
{
public delegate void FilterItemChangedDelegate(object sender, EventArgs e);
public event FilterItemChangedDelegate FilterItemChanged;
bool enabled;
public bool Enabled
{
get { return enabled; }
set
{
enabled = value;
if (FilterItemChanged != null)
{
FilterItemChanged(this, EventArgs.Empty);
}
}
}
public string Name;
public ItemType Type;
}
public class FilterScroller : ScrolledWindow
{
@@ -56,7 +80,7 @@ namespace GridProxyGUI
TreeIter iter;
if (store.GetIterFromString(out iter, args.Path))
{
UDPFilterItem item = store.GetValue(iter, 0) as UDPFilterItem;
FilterItem item = store.GetValue(iter, 0) as FilterItem;
if (null != item)
{
item.Enabled = !item.Enabled;
@@ -67,7 +91,7 @@ namespace GridProxyGUI
void renderTextCell(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = model.GetValue(iter, 0) as UDPFilterItem;
var item = model.GetValue(iter, 0) as FilterItem;
if (item != null)
{
((CellRendererText)cell).Text = item.Name;
@@ -76,7 +100,7 @@ namespace GridProxyGUI
void renderToggleCell(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = model.GetValue(iter, 0) as UDPFilterItem;
var item = model.GetValue(iter, 0) as FilterItem;
if (item != null)
{
((CellRendererToggle)cell).Active = item.Enabled;

195
Programs/GridProxyGUI/MainWindow.cs Normal file → Executable file
View File

@@ -3,16 +3,30 @@ using System.Collections.Generic;
using System.Collections.Concurrent;
using Gtk;
using GridProxyGUI;
using WinGridProxy;
using OpenMetaverse.Packets;
using System.Timers;
public partial class MainWindow : Gtk.Window
{
ProxyManager proxy = null;
ConcurrentDictionary<string, UDPFilterItem> UDPFilterItems = new ConcurrentDictionary<string, UDPFilterItem>();
ConcurrentDictionary<string, UDPFilterItem> CapFilterItems = new ConcurrentDictionary<string, UDPFilterItem>();
ConcurrentDictionary<string, FilterItem> UDPFilterItems = new ConcurrentDictionary<string, FilterItem>();
ConcurrentDictionary<string, FilterItem> CapFilterItems = new ConcurrentDictionary<string, FilterItem>();
ListStore udpStore, capStore;
FilterScroller capScroller;
MessageScroller messages;
// stats tracking
int PacketCounter;
int CapsInCounter;
int CapsInBytes;
int CapsOutCounter;
int CapsOutBytes;
int PacketsInCounter;
int PacketsInBytes;
int PacketsOutCounter;
int PacketsOutBytes;
Timer StatsTimer;
public MainWindow()
: base(Gtk.WindowType.Toplevel)
@@ -22,26 +36,67 @@ public partial class MainWindow : Gtk.Window
tabsMain.Page = 1;
mainSplit.Position = 600;
txtSummary.ModifyFont(Pango.FontDescription.FromString("monospace bold 9"));
sessionLogScroller.Add(messages = new MessageScroller());
StatsTimer = new Timer(1000.0);
StatsTimer.Elapsed += StatsTimer_Elapsed;
StatsTimer.Enabled = true;
ProxyLogger.Init();
ProxyManager.OnPacketLog += ProxyManager_OnPacketLog;
ProxyManager.OnCapabilityAdded += new ProxyManager.CapsAddedHandler(ProxyManager_OnCapabilityAdded);
ProxyManager.OnEventMessageLog += new ProxyManager.EventQueueMessageHandler(ProxyManager_OnEventMessageLog);
ProxyManager.OnMessageLog += new ProxyManager.MessageLogHandler(ProxyManager_OnMessageLog);
}
void ProxyManager_OnPacketLog(Packet packet, GridProxy.Direction direction, System.Net.IPEndPoint endpoint)
{
Application.Invoke((xsender, xe) =>
{
PacketCounter++;
if (direction == GridProxy.Direction.Incoming)
{
PacketsInCounter++;
PacketsInBytes += packet.Length;
}
else
{
PacketsOutCounter++;
PacketsOutBytes += packet.Length;
}
SessionPacket sessionPacket = new SessionPacket(packet, direction, endpoint,
PacketDecoder.InterpretOptions(packet.Header) + " Seq: " + packet.Header.Sequence.ToString() + " Freq:" + packet.Header.Frequency.ToString());
sessionPacket.Columns = new string[] { PacketCounter.ToString(), sessionPacket.TimeStamp.ToString("HH:mm:ss.fff"), sessionPacket.Protocol, sessionPacket.Name, sessionPacket.Length.ToString(), sessionPacket.Host, sessionPacket.ContentType };
messages.AddSession(sessionPacket);
});
}
void StatsTimer_Elapsed(object sender, ElapsedEventArgs e)
{
Application.Invoke((xsender, xe) =>
{
});
}
void ProxyManager_OnCapabilityAdded(GridProxy.CapInfo cap)
{
Application.Invoke((sender, e) =>
{
if (null == capStore)
{
capStore = new ListStore(typeof(UDPFilterItem));
capStore = new ListStore(typeof(FilterItem));
}
if (!CapFilterItems.ContainsKey(cap.CapType))
{
UDPFilterItem item = new UDPFilterItem() { Enabled = true, Name = cap.CapType };
FilterItem item = new FilterItem() { Name = cap.CapType, Type = ItemType.Cap };
item.FilterItemChanged += item_FilterItemChanged;
item.Enabled = true;
CapFilterItems[item.Name] = item;
capStore.AppendValues(item);
}
@@ -59,29 +114,95 @@ public partial class MainWindow : Gtk.Window
{
if (null == capStore)
{
capStore = new ListStore(typeof(UDPFilterItem));
}
if (!CapFilterItems.ContainsKey(req.Info.CapType))
{
UDPFilterItem item = new UDPFilterItem() { Enabled = true, Name = req.Info.CapType };
CapFilterItems[item.Name] = item;
capStore.AppendValues(item);
}
else
{
ProxyManager_OnMessageLog(req, GridProxy.CapsStage.Response);
capStore = new ListStore(typeof(FilterItem));
}
if (null == capScroller)
{
capScroller = new FilterScroller(containerFilterCap, capStore);
}
if (!CapFilterItems.ContainsKey(req.Info.CapType))
{
FilterItem item = new FilterItem() { Enabled = true, Name = req.Info.CapType, Type = ItemType.EQ };
item.FilterItemChanged += item_FilterItemChanged;
CapFilterItems[item.Name] = item;
capStore.AppendValues(item);
}
ProxyManager_OnMessageLog(req, GridProxy.CapsStage.Response);
});
}
void ProxyManager_OnMessageLog(GridProxy.CapsRequest req, GridProxy.CapsStage stage)
{
Application.Invoke((sender, e) =>
{
if (CapFilterItems.ContainsKey(req.Info.CapType))
{
var filter = CapFilterItems[req.Info.CapType];
if (!filter.Enabled) return;
PacketCounter++;
int size = 0;
string contentType = String.Empty;
if (req.RawRequest != null)
{
size += req.RawRequest.Length;
contentType = req.RequestHeaders.Get("Content-Type");
}
if (req.RawResponse != null)
{
size += req.RawResponse.Length;
contentType = req.ResponseHeaders.Get("Content-Type");
}
GridProxy.Direction direction;
if (stage == GridProxy.CapsStage.Request)
{
CapsOutCounter++;
CapsOutBytes += req.Request.ToString().Length;
direction = GridProxy.Direction.Outgoing;
}
else
{
CapsInCounter++;
CapsInBytes += req.Response.ToString().Length;
direction = GridProxy.Direction.Incoming;
}
string proto = filter.Type.ToString();
Session capsSession = null;
if (filter.Type == ItemType.Cap)
{
capsSession = new SessionCaps(req.RawRequest, req.RawResponse, req.RequestHeaders,
req.ResponseHeaders, direction, req.Info.URI, req.Info.CapType, proto, req.FullUri);
}
else
{
capsSession = new SessionEvent(req.RawResponse, req.ResponseHeaders, req.Info.URI, req.Info.CapType, proto);
}
capsSession.Columns = new string[] { PacketCounter.ToString(), capsSession.TimeStamp.ToString("HH:mm:ss.fff"), capsSession.Protocol, capsSession.Name, capsSession.Length.ToString(), capsSession.Host, capsSession.ContentType };
messages.AddSession(capsSession);
}
});
}
void item_FilterItemChanged(object sender, EventArgs e)
{
FilterItem item = (FilterItem)sender;
if (item.Type == ItemType.Cap)
{
proxy.AddCapsDelegate(item.Name, item.Enabled);
}
else if (item.Type == ItemType.UDP)
{
proxy.AddUDPDelegate(item.Name, item.Enabled);
}
}
void Logger_OnLogLine(object sender, LogEventArgs e)
@@ -149,14 +270,15 @@ public partial class MainWindow : Gtk.Window
void InitUDPFilters()
{
if (UDPFilterItems.Count > 0) return;
UDPFilterItems["Login Request"] = new UDPFilterItem() { Enabled = false, Name = "Login Request" };
UDPFilterItems["Login Response"] = new UDPFilterItem() { Enabled = true, Name = "Login Response" };
UDPFilterItems["Login Request"] = new FilterItem() { Enabled = false, Name = "Login Request", Type = ItemType.Login };
UDPFilterItems["Login Response"] = new FilterItem() { Enabled = true, Name = "Login Response", Type = ItemType.Login};
foreach (string name in Enum.GetNames(typeof(PacketType)))
{
if (!string.IsNullOrEmpty(name))
{
UDPFilterItems[name] = new UDPFilterItem() { Enabled = false, Name = name };
var item = new FilterItem() { Enabled = false, Name = name, Type = ItemType.UDP };
UDPFilterItems[name] = item;
}
}
}
@@ -165,7 +287,7 @@ public partial class MainWindow : Gtk.Window
{
InitUDPFilters();
udpStore = new ListStore(typeof(UDPFilterItem));
udpStore = new ListStore(typeof(FilterItem));
List<string> keys = new List<string>(UDPFilterItems.Keys);
keys.Sort((a, b) => { return string.Compare(a.ToLower(), b.ToLower()); });
@@ -174,11 +296,38 @@ public partial class MainWindow : Gtk.Window
foreach (var key in keys)
{
if (key == "Login Request" || key == "Login Response") continue;
UDPFilterItems[key].FilterItemChanged += item_FilterItemChanged;
if (UDPFilterItems[key].Type == ItemType.Login) continue;
udpStore.AppendValues(UDPFilterItems[key]);
}
new FilterScroller(containerFilterUDP, udpStore);
}
void SetAllToggles(bool on, ListStore store)
{
if (null == store) return;
store.Foreach((model, path, iter) =>
{
var item = model.GetValue(iter, 0) as FilterItem;
if (null != item)
{
item.Enabled = on;
model.SetValue(iter, 0, item);
}
return false;
});
}
protected void OnCbSelectAllUDPToggled(object sender, EventArgs e)
{
SetAllToggles(cbSelectAllUDP.Active, udpStore);
}
protected void OnCbSelectAllCapToggled(object sender, EventArgs e)
{
SetAllToggles(cbSelectAllCap.Active, capStore);
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using Gtk;
namespace GridProxyGUI
{
internal class MessageScroller : TreeView
{
public static string[] ColumnLabels = { "Counter", "Timestamp", "Protocol", "Type", "Size", "URL", "Content Type" };
Dictionary<string, int> ColumnMap = new Dictionary<string,int>();
public ListStore Messages;
public MessageScroller()
{
for (int i = 0; i < ColumnLabels.Length; i++)
{
CellRendererText cell = new CellRendererText();
AppendColumn(ColumnLabels[i], cell, "text", 0);
GetColumn(i).SetCellDataFunc(cell, CellDataFunc);
ColumnMap[ColumnLabels[i]] = i;
}
Model = Messages = new ListStore(typeof(Session));
HeadersVisible = true;
ShowAll();
}
void CellDataFunc(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = model.GetValue(iter, 0) as Session;
if (item != null)
{
if (ColumnMap.ContainsKey(column.Title))
{
int pos =ColumnMap[column.Title];
if (pos < item.Columns.Length)
{
((CellRendererText)cell).Text = item.Columns[pos];
}
}
}
}
public void AddSession(Session s)
{
Messages.AppendValues(s);
}
}
}

View File

@@ -36,7 +36,7 @@ using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenMetaverse;
namespace WinGridProxy
namespace GridProxyGUI
{
public class ProxyManager
{
@@ -201,6 +201,23 @@ namespace WinGridProxy
return false;
}
private static PacketType PacketTypeFromName(string name)
{
Type packetTypeType = typeof(PacketType);
System.Reflection.FieldInfo f = packetTypeType.GetField(name);
if (f == null)
{//throw new ArgumentException("Bad packet type");
return PacketType.Error;
}
return (PacketType)Enum.ToObject(packetTypeType, (int)f.GetValue(packetTypeType));
}
internal void AddUDPDelegate(string packetType, bool add)
{
AddUDPDelegate(PacketTypeFromName(packetType), add);
}
internal void AddUDPDelegate(PacketType packetType, bool add)
{
if (add)

View File

@@ -0,0 +1,762 @@
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Net;
using System.Text;
using System.Reflection;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenMetaverse.Messages;
using OpenMetaverse.StructuredData;
using OpenMetaverse.Interfaces;
using GridProxy;
namespace GridProxyGUI
{
#region Base Class
internal abstract class Session
{
internal const string EmptyXml = "<?xml version=\"1.0\"?><Empty>XML representation of this item is not available.</Empty>";
internal const string EmptyString = "String representation of this item is not available.";
internal const string EmptyNotation = "Notation representation of this item is not available.";
public Direction Direction { get; set; }
public String Host { get; set; }
public String Protocol { get; set; }
public String Name { get; set; }
public String ContentType { get; set; }
public int Length { get; set; }
public DateTime TimeStamp { get; set; }
// listview specific stuff, not serialized or deserialized
public bool Selected { get; set; }
//public System.Drawing.Color BackColor { get; set; }
public Session()
{
this.TimeStamp = DateTime.UtcNow;
this.Host = this.Protocol = this.Name = String.Empty;
this.Length = 0;
this.ContentType = String.Empty;
}
public virtual string ToRawString(Direction direction)
{
return EmptyString;
}
public virtual byte[] ToBytes(Direction direction)
{
return OpenMetaverse.Utils.EmptyBytes;
}
public virtual string ToXml(Direction direction)
{
return EmptyXml;
}
public virtual string ToStringNotation(Direction direction)
{
return EmptyNotation;
}
public abstract string ToPrettyString(Direction direction);
public abstract byte[] Serialize();
public abstract Session Deserialize(byte[] bytes);
public string[] Columns;
}
#endregion
#region Packets
internal sealed class SessionPacket : Session
{
public Packet Packet { get; set; }
public SessionPacket() : base() { this.Protocol = "UDP"; }
public SessionPacket(Packet packet, Direction direction, IPEndPoint endpoint, String contentType)
: base()
{
this.Packet = packet;
this.Name = packet.Type.ToString();
this.Direction = direction;
this.Host = String.Format("{0}:{1}", endpoint.Address, endpoint.Port);
this.ContentType = contentType;
this.Length = packet.Length;
this.Protocol = "UDP";
}
public override string ToPrettyString(Direction direction)
{
if (direction == this.Direction)
return PacketDecoder.PacketToString(this.Packet);
else
return String.Empty;
}
public override string ToRawString(Direction direction)
{
if (direction == this.Direction)
return PacketDecoder.PacketToString(this.Packet);
else
return String.Empty;
}
public override byte[] ToBytes(Direction direction)
{
if (direction == this.Direction)
return Packet.ToBytes();
else
return base.ToBytes(direction);
}
//public override string ToXml(Direction direction)
//{
// if (direction == this.Direction)
// return Packet.ToXmlString(this.Packet);
// else
// return base.ToXml(direction);
//}
//public override string ToStringNotation(Direction direction)
//{
// if (direction == this.Direction)
// return Packet.GetLLSD(this.Packet).ToString();
// else
// return base.ToStringNotation(direction);
//}
public override byte[] Serialize()
{
OSDMap map = new OSDMap(5);
map["Name"] = OSD.FromString(this.Name);
map["Host"] = OSD.FromString(this.Host);
map["PacketBytes"] = OSD.FromBinary(this.Packet.ToBytes());
map["Direction"] = OSD.FromInteger((int)this.Direction);
map["ContentType"] = OSD.FromString(this.ContentType);
return OpenMetaverse.Utils.StringToBytes(map.ToString());
}
public override Session Deserialize(byte[] bytes)
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes));
this.Host = map["Host"].AsString();
this.Direction = (Direction)map["Direction"].AsInteger();
this.ContentType = map["ContentType"].AsString();
byte[] packetData = map["PacketBytes"].AsBinary();
this.Length = packetData.Length;
int packetEnd = packetData.Length - 1;
this.Packet = Packet.BuildPacket(packetData, ref packetEnd, null);
this.Name = this.Packet.Type.ToString();
return this;
}
}
#endregion Packets
#region Capabilities
internal sealed class SessionCaps : Session
{
byte[] RequestBytes { get; set; }
byte[] ResponseBytes { get; set; }
WebHeaderCollection RequestHeaders { get; set; }
WebHeaderCollection ResponseHeaders { get; set; }
string FullUri { get; set; }
public SessionCaps() : base() { /*this.Protocol = "Caps";*/ }
public SessionCaps(byte[] requestBytes, byte[] responseBytes,
WebHeaderCollection requestHeaders, WebHeaderCollection responseHeaders,
Direction direction, string uri, string capsKey, String proto, string fullUri)
: base()
{
if (requestBytes != null)
this.RequestBytes = requestBytes;
else
this.RequestBytes = OpenMetaverse.Utils.EmptyBytes;
if (responseBytes != null)
this.ResponseBytes = responseBytes;
else
this.ResponseBytes = OpenMetaverse.Utils.EmptyBytes;
this.RequestHeaders = requestHeaders;
this.ResponseHeaders = responseHeaders;
this.Protocol = proto;
this.FullUri = fullUri;
this.Name = capsKey;
this.Direction = direction;
this.Host = uri;
this.ContentType = (direction == Direction.Incoming) ? this.ResponseHeaders.Get("Content-Type") : this.RequestHeaders.Get("Content-Type");
this.Length = (requestBytes != null) ? requestBytes.Length : 0;
this.Length += (responseBytes != null) ? responseBytes.Length : 0;
}
public override string ToPrettyString(Direction direction)
{
try
{
if (direction == Direction.Incoming)
{
if (this.ResponseBytes != null && this.ResponseBytes.Length > 0)
{
IMessage message = null;
OSD osd = OSDParser.Deserialize(this.ResponseBytes);
if (osd is OSDMap)
{
OSDMap data = (OSDMap)osd;
if (data.ContainsKey("body"))
message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]);
else
message = OpenMetaverse.Messages.MessageUtils.DecodeEvent(this.Name, data);
if (message != null)
return PacketDecoder.MessageToString(message, 0);
else
return "No Decoder for " + this.Name + Environment.NewLine +
OSDParser.SerializeLLSDNotationFormatted(data) + Environment.NewLine +
"Please report this at http://jira.openmetaverse.org Be sure to include the entire message.";
}
}
}
else
{
if (this.RequestBytes != null && this.RequestBytes.Length > 0)
{
if (this.RequestBytes[0] == 60)
{
OSD osd = OSDParser.Deserialize(this.RequestBytes);
if (osd is OSDMap)
{
IMessage message = null;
OSDMap data = (OSDMap)osd;
if (data.ContainsKey("body"))
message = MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]);
else
message = MessageUtils.DecodeEvent(this.Name, data);
if (message != null)
return PacketDecoder.MessageToString(message, 0);
else
return "No Decoder for " + this.Name + Environment.NewLine +
OSDParser.SerializeLLSDNotationFormatted(data) + Environment.NewLine +
"Please report this at http://jira.openmetaverse.org Be sure to include the entire message.";
}
else
{
return osd.ToString();
}
}
else
{
// this means its probably a script or asset using the uploader capability
// so we'll just return the raw bytes as a string
//if (this.RequestBytes[0] == 100)
//{
return Utils.BytesToString(this.RequestBytes);
//}
}
}
else
{
return String.Empty;
}
}
}
catch { }
return String.Empty;
}
public override string ToRawString(Direction direction)
{
try
{
if (direction == Direction.Incoming)
{
if (this.ResponseBytes != null)
{
StringBuilder result = new StringBuilder();
foreach (String key in ResponseHeaders.Keys)
{
result.AppendFormat("{0} {1}" + Environment.NewLine, key, ResponseHeaders[key]);
}
result.AppendLine();
result.AppendLine(OpenMetaverse.Utils.BytesToString(this.ResponseBytes));
return result.ToString();
}
else
return String.Empty;
}
else
{
if (this.RequestBytes != null)
{
StringBuilder result = new StringBuilder();
result.AppendFormat("Request URI: {0}{1}", FullUri, Environment.NewLine);
foreach (String key in RequestHeaders.Keys)
{
result.AppendFormat("{0}: {1}" + Environment.NewLine, key, RequestHeaders[key]);
}
result.AppendLine();
result.AppendLine(OpenMetaverse.Utils.BytesToString(this.RequestBytes));
return result.ToString();
}
else
return String.Empty;
}
}
catch { }
return string.Empty;
}
public override byte[] ToBytes(Direction direction)
{
if (direction == Direction.Incoming)
{
if (this.ResponseBytes != null)
return this.ResponseBytes;
else
return base.ToBytes(direction);
}
else
{
if (this.RequestBytes != null)
return this.RequestBytes;
else
return base.ToBytes(direction);
}
}
public override string ToStringNotation(Direction direction)
{
try
{
if (direction == Direction.Incoming)
{
if (this.ResponseBytes != null)
return BytesToOsd(this.ResponseBytes);
//return this.ResponseBytes;
else
return base.ToStringNotation(direction);
}
else
{
if (this.RequestBytes != null)
{
return BytesToOsd(this.RequestBytes);
}
else
return base.ToStringNotation(direction);
}
}
catch { }
return string.Empty;
}
public override string ToXml(Direction direction)
{
try
{
if (direction == Direction.Incoming)
{
if (this.ResponseBytes != null)
return BytesToXml(this.ResponseBytes);
else
return base.ToXml(direction);
}
else
{
if (this.RequestBytes != null)
return BytesToXml(this.RequestBytes);
else
return base.ToXml(direction);
}
}
catch { }
return string.Empty;
}
// Sanity check the bytes are infact OSD
private string BytesToOsd(byte[] bytes)
{
try
{
OSD osd = OSDParser.Deserialize(bytes);
return OSDParser.SerializeLLSDNotationFormatted(osd);
}
catch (LitJson.JsonException)
{
// unable to decode as notation format
return base.ToStringNotation(this.Direction);
}
}
// Sanity check the bytes are infact an XML
private string BytesToXml(byte[] bytes)
{
String result = Utils.BytesToString(bytes);
if (result.StartsWith("<?xml"))
return result;
else
return base.ToXml(this.Direction);
}
public override byte[] Serialize()
{
OSDMap map = new OSDMap(5);
map["Name"] = OSD.FromString(this.Name);
map["Host"] = OSD.FromString(this.Host);
map["RequestBytes"] = OSD.FromBinary(this.RequestBytes);
map["ResponseBytes"] = OSD.FromBinary(this.ResponseBytes);
map["Direction"] = OSD.FromInteger((int)this.Direction);
map["ContentType"] = OSD.FromString(this.ContentType);
map["Protocol"] = OSD.FromString(this.Protocol);
OSDArray requestHeadersArray = new OSDArray();
foreach (String key in this.RequestHeaders.Keys)
{
OSDMap rMap = new OSDMap(1);
rMap[key] = OSD.FromString(this.RequestHeaders[key]);
requestHeadersArray.Add(rMap);
}
if (requestHeadersArray.Count > 0)
map["RequestHeaders"] = requestHeadersArray;
OSDArray responseHeadersArray = new OSDArray();
foreach (String key in this.ResponseHeaders.Keys)
{
OSDMap rMap = new OSDMap(1);
rMap[key] = OSD.FromString(this.ResponseHeaders[key]);
responseHeadersArray.Add(rMap);
}
if (responseHeadersArray.Count > 0)
map["ResponseHeaders"] = responseHeadersArray;
return OpenMetaverse.Utils.StringToBytes(map.ToString());
}
public override Session Deserialize(byte[] bytes)
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes));
this.Name = map["Name"].AsString();
this.Host = map["Host"].AsString();
this.RequestBytes = map["RequestBytes"].AsBinary();
this.ResponseBytes = map["ResponseBytes"].AsBinary();
this.Direction = (Direction)map["Direction"].AsInteger();
this.Length = ResponseBytes.Length + RequestBytes.Length;
this.ContentType = map["ContentType"].AsString();
this.Protocol = map["Protocol"].AsString();
this.RequestHeaders = new WebHeaderCollection();
if (map.ContainsKey("RequestHeaders"))
{
OSDArray requestHeadersArray = (OSDArray)map["RequestHeaders"];
for (int i = 0; i < requestHeadersArray.Count; i++)
{
OSDMap rMap = (OSDMap)requestHeadersArray[i];
foreach (string key in rMap.Keys)
{
this.RequestHeaders.Add(key, rMap[key].AsString());
}
}
}
this.ResponseHeaders = new WebHeaderCollection();
if (map.ContainsKey("ResponseHeaders"))
{
OSDArray responseHeadersArray = (OSDArray)map["ResponseHeaders"];
for (int i = 0; i < responseHeadersArray.Count; i++)
{
OSDMap rMap = (OSDMap)responseHeadersArray[i];
foreach (string key in rMap.Keys)
{
this.ResponseHeaders.Add(key, rMap[key].AsString());
}
}
}
return this;
}
}
#endregion Capabilities
#region Login
internal sealed class SessionLogin : Session
{
private object Data { get; set; }
//request, direction, comboBoxLoginURL.Text
public SessionLogin() : base() { this.Protocol = "https"; }
public SessionLogin(object request, Direction direction, String url, String contentType)
: base()
{
this.Data = request;
this.Direction = direction;
this.Host = url;
this.ContentType = contentType;
this.Name = (direction == Direction.Incoming) ? "Login Response" : "Login Request";
this.Protocol = "https";
this.Length = this.Data.ToString().Length;
}
public override string ToPrettyString(Direction direction)
{
if (direction == this.Direction)
{
return this.Data.ToString();
}
else
{
return String.Empty;
}
}
public override string ToRawString(Direction direction)
{
if (direction == this.Direction)
{
return this.Data.ToString();
}
else
{
return String.Empty;
}
}
public override string ToXml(Direction direction)
{
return base.ToXml(direction);
//if (direction == this.Direction)
//{
// return this.Data.ToString();
//}
//else
//{
// return base.ToXml(direction);
//}
}
public override byte[] ToBytes(Direction direction)
{
if (direction == this.Direction)
{
return OpenMetaverse.Utils.StringToBytes(this.Data.ToString());
}
else
{
return base.ToBytes(direction);
}
}
public override byte[] Serialize()
{
OSDMap map = new OSDMap(6);
map["Name"] = OSD.FromString(this.Name);
map["Host"] = OSD.FromString(this.Host);
map["Data"] = OSD.FromString(this.Data.ToString());
map["Direction"] = OSD.FromInteger((int)this.Direction);
map["ContentType"] = OSD.FromString(this.ContentType);
map["Protocol"] = OSD.FromString(this.Protocol);
return OpenMetaverse.Utils.StringToBytes(map.ToString());
}
public override Session Deserialize(byte[] bytes)
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes));
this.Name = map["Name"].AsString();
this.Host = map["Host"].AsString();
this.Data = map["Data"].AsString();
this.Length = this.Data.ToString().Length;
this.Direction = (Direction)map["Direction"].AsInteger();
this.ContentType = map["ContentType"].AsString();
this.Protocol = map["Protocol"].AsString();
return this;
}
}
#endregion Login
#region EventQueue Messages
internal class SessionEvent : Session
{
private byte[] ResponseBytes;
private WebHeaderCollection ResponseHeaders;
public SessionEvent() : base() { this.Protocol = "EventQ"; }
public SessionEvent(byte[] responseBytes, WebHeaderCollection responseHeaders,
String uri, String capsKey, String proto)
: base()
{
this.Protocol = proto;
this.Direction = Direction.Incoming; // EventQueue Messages are always inbound from the simulator
this.ResponseBytes = responseBytes;
this.ResponseHeaders = responseHeaders;
this.Host = uri;
this.Name = capsKey;
this.ContentType = responseHeaders.Get("Content-Type");
this.Length = Int32.Parse(responseHeaders.Get("Content-Length"));
}
public override string ToPrettyString(Direction direction)
{
if (direction == this.Direction)
{
IMessage message = null;
OSD osd = OSDParser.Deserialize(this.ResponseBytes);
OSDMap data = (OSDMap)osd;
if (data.ContainsKey("body"))
message = MessageUtils.DecodeEvent(this.Name, (OSDMap)data["body"]);
else
message = MessageUtils.DecodeEvent(this.Name, data);
if (message != null)
return PacketDecoder.MessageToString(message, 0);
else
return "No Decoder for " + this.Name + Environment.NewLine + osd.ToString();
}
else
{
return String.Empty;
}
}
public override byte[] ToBytes(Direction direction)
{
if (direction == this.Direction)
{
return this.ResponseBytes;
}
else
{
return base.ToBytes(direction);
}
}
public override string ToRawString(Direction direction)
{
if (direction == this.Direction)
{
StringBuilder result = new StringBuilder();
foreach (String key in ResponseHeaders.Keys)
{
result.AppendFormat("{0} {1}" + Environment.NewLine, key, ResponseHeaders[key]);
}
result.AppendLine();
result.AppendLine(this.ToXml(direction));
return result.ToString();
}
else
{
return String.Empty;
}
}
public override string ToXml(Direction direction)
{
if (direction == this.Direction)
{
return OpenMetaverse.Utils.BytesToString(this.ResponseBytes);
}
else
{
return base.ToXml(direction);
}
}
public override string ToStringNotation(Direction direction)
{
if (direction == this.Direction)
{
OSD osd = OSDParser.DeserializeLLSDXml(this.ResponseBytes);
return osd.ToString();
}
else
{
return base.ToStringNotation(direction);
}
}
public override byte[] Serialize()
{
OSDMap map = new OSDMap(7);
map["Name"] = OSD.FromString(this.Name);
map["Host"] = OSD.FromString(this.Host);
map["ResponseBytes"] = OSD.FromBinary(this.ResponseBytes);
map["Direction"] = OSD.FromInteger((int)this.Direction);
map["ContentType"] = OSD.FromString(this.ContentType);
map["Protocol"] = OSD.FromString(this.Protocol);
OSDArray responseHeadersArray = new OSDArray();
foreach (String key in this.ResponseHeaders.Keys)
{
OSDMap rMap = new OSDMap(1);
rMap[key] = OSD.FromString(this.ResponseHeaders[key]);
responseHeadersArray.Add(rMap);
}
map["ResponseHeaders"] = responseHeadersArray;
return Utils.StringToBytes(map.ToString());
}
public override Session Deserialize(byte[] bytes)
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes));
this.Name = map["Name"].AsString();
this.Host = map["Host"].AsString();
this.ResponseBytes = map["ResponseBytes"].AsBinary();
this.Direction = (Direction)map["Direction"].AsInteger();
this.ContentType = map["ContentType"].AsString();
this.Protocol = map["Protocol"].AsString();
this.Length = ResponseBytes.Length;
if (map.ContainsKey("ResponseHeaders"))
{
this.ResponseHeaders = new WebHeaderCollection();
OSDArray responseHeadersArray = (OSDArray)map["ResponseHeaders"];
for (int i = 0; i < responseHeadersArray.Count; i++)
{
OSDMap rMap = (OSDMap)responseHeadersArray[i];
foreach (string key in rMap.Keys)
{
this.ResponseHeaders.Add(key, rMap[key].AsString());
}
}
}
return this;
}
}
#endregion
}

193
Programs/GridProxyGUI/gtk-gui/MainWindow.cs Normal file → Executable file
View File

@@ -18,8 +18,8 @@ public partial class MainWindow
private global::Gtk.Action OpenSessionAction;
private global::Gtk.Action SaveSessionAction;
private global::Gtk.Action SaveSessionAsAction;
private global::Gtk.VBox vbox1;
private global::Gtk.HBox boxTopMenu;
private global::Gtk.VBox vboxMenuMain;
private global::Gtk.HBox hboxMenu;
private global::Gtk.Alignment alignment2;
private global::Gtk.MenuBar menubar1;
private global::Gtk.VSeparator vseparator1;
@@ -32,7 +32,6 @@ public partial class MainWindow
private global::Gtk.Button btnStart;
private global::Gtk.HPaned mainSplit;
private global::Gtk.ScrolledWindow sessionLogScroller;
private global::Gtk.TreeView treeview1;
private global::Gtk.Notebook tabsMain;
private global::Gtk.ScrolledWindow logFileScroller;
private global::Gtk.TextView txtSummary;
@@ -41,7 +40,6 @@ public partial class MainWindow
private global::Gtk.HBox hbox2;
private global::Gtk.Button btnLoadFilters;
private global::Gtk.Button btnSaveFilters;
private global::Gtk.CheckButton cbAutoCheckCaps;
private global::Gtk.HBox hbox3;
private global::Gtk.Frame frameFilterUDP;
private global::Gtk.Alignment containerFilterUDP;
@@ -110,15 +108,15 @@ public partial class MainWindow
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.AllowShrink = true;
// Container child MainWindow.Gtk.Container+ContainerChild
this.vbox1 = new global::Gtk.VBox ();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
this.boxTopMenu = new global::Gtk.HBox ();
this.boxTopMenu.Name = "hbox1";
this.boxTopMenu.Spacing = 6;
this.boxTopMenu.BorderWidth = ((uint)(3));
// Container child hbox1.Gtk.Box+BoxChild
this.vboxMenuMain = new global::Gtk.VBox ();
this.vboxMenuMain.Name = "vboxMenuMain";
this.vboxMenuMain.Spacing = 6;
// Container child vboxMenuMain.Gtk.Box+BoxChild
this.hboxMenu = new global::Gtk.HBox ();
this.hboxMenu.Name = "hboxMenu";
this.hboxMenu.Spacing = 6;
this.hboxMenu.BorderWidth = ((uint)(3));
// Container child hboxMenu.Gtk.Box+BoxChild
this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
this.alignment2.Name = "alignment2";
// Container child alignment2.Gtk.Container+ContainerChild
@@ -126,50 +124,50 @@ public partial class MainWindow
this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
this.menubar1.Name = "menubar1";
this.alignment2.Add (this.menubar1);
this.boxTopMenu.Add (this.alignment2);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.alignment2]));
this.hboxMenu.Add (this.alignment2);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.alignment2]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.vseparator1 = new global::Gtk.VSeparator ();
this.vseparator1.Name = "vseparator1";
this.boxTopMenu.Add (this.vseparator1);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.vseparator1]));
this.hboxMenu.Add (this.vseparator1);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.vseparator1]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Listen IP Address:");
this.boxTopMenu.Add (this.label1);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label1]));
this.hboxMenu.Add (this.label1);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.label1]));
w5.Position = 2;
w5.Expand = false;
w5.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.cbListen = global::Gtk.ComboBoxEntry.NewText ();
this.cbListen.AppendText (global::Mono.Unix.Catalog.GetString ("127.0.0.1"));
this.cbListen.AppendText (global::Mono.Unix.Catalog.GetString ("0.0.0.0"));
this.cbListen.WidthRequest = 100;
this.cbListen.Name = "cbListen";
this.cbListen.Active = 0;
this.boxTopMenu.Add (this.cbListen);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.cbListen]));
this.hboxMenu.Add (this.cbListen);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.cbListen]));
w6.Position = 3;
w6.Expand = false;
w6.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Port");
this.boxTopMenu.Add (this.label2);
global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label2]));
this.hboxMenu.Add (this.label2);
global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.label2]));
w7.Position = 4;
w7.Expand = false;
w7.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.txtPort = new global::Gtk.Entry ();
this.txtPort.WidthRequest = 50;
this.txtPort.CanFocus = true;
@@ -178,20 +176,20 @@ public partial class MainWindow
this.txtPort.IsEditable = true;
this.txtPort.MaxLength = 5;
this.txtPort.InvisibleChar = '●';
this.boxTopMenu.Add (this.txtPort);
global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.txtPort]));
this.hboxMenu.Add (this.txtPort);
global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.txtPort]));
w8.Position = 5;
w8.Expand = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.label3 = new global::Gtk.Label ();
this.label3.Name = "label3";
this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Login URL");
this.boxTopMenu.Add (this.label3);
global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label3]));
this.hboxMenu.Add (this.label3);
global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.label3]));
w9.Position = 6;
w9.Expand = false;
w9.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.cbLoginURL = global::Gtk.ComboBoxEntry.NewText ();
this.cbLoginURL.AppendText (global::Mono.Unix.Catalog.GetString ("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
this.cbLoginURL.AppendText (global::Mono.Unix.Catalog.GetString ("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
@@ -199,44 +197,40 @@ public partial class MainWindow
this.cbLoginURL.WidthRequest = 300;
this.cbLoginURL.Name = "cbLoginURL";
this.cbLoginURL.Active = 0;
this.boxTopMenu.Add (this.cbLoginURL);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.cbLoginURL]));
this.hboxMenu.Add (this.cbLoginURL);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.cbLoginURL]));
w10.Position = 7;
w10.Expand = false;
w10.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
// Container child hboxMenu.Gtk.Box+BoxChild
this.btnStart = new global::Gtk.Button ();
this.btnStart.CanFocus = true;
this.btnStart.Name = "btnStart";
this.btnStart.UseUnderline = true;
this.btnStart.Label = global::Mono.Unix.Catalog.GetString ("Start Proxy");
this.boxTopMenu.Add (this.btnStart);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.btnStart]));
this.hboxMenu.Add (this.btnStart);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hboxMenu [this.btnStart]));
w11.Position = 8;
w11.Expand = false;
w11.Fill = false;
this.vbox1.Add (this.boxTopMenu);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.boxTopMenu]));
this.vboxMenuMain.Add (this.hboxMenu);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vboxMenuMain [this.hboxMenu]));
w12.Position = 0;
w12.Expand = false;
w12.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
// Container child vboxMenuMain.Gtk.Box+BoxChild
this.mainSplit = new global::Gtk.HPaned ();
this.mainSplit.CanFocus = true;
this.mainSplit.Name = "mainSplit";
this.mainSplit.Position = 1;
this.mainSplit.Position = 400;
// Container child mainSplit.Gtk.Paned+PanedChild
this.sessionLogScroller = new global::Gtk.ScrolledWindow ();
this.sessionLogScroller.Name = "GtkScrolledWindow1";
this.sessionLogScroller.CanFocus = true;
this.sessionLogScroller.Name = "sessionLogScroller";
this.sessionLogScroller.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
this.treeview1 = new global::Gtk.TreeView ();
this.treeview1.CanFocus = true;
this.treeview1.Name = "treeview1";
this.sessionLogScroller.Add (this.treeview1);
this.mainSplit.Add (this.sessionLogScroller);
global::Gtk.Paned.PanedChild w14 = ((global::Gtk.Paned.PanedChild)(this.mainSplit [this.sessionLogScroller]));
w14.Resize = false;
global::Gtk.Paned.PanedChild w13 = ((global::Gtk.Paned.PanedChild)(this.mainSplit [this.sessionLogScroller]));
w13.Resize = false;
// Container child mainSplit.Gtk.Paned+PanedChild
this.tabsMain = new global::Gtk.Notebook ();
this.tabsMain.CanFocus = true;
@@ -275,44 +269,33 @@ public partial class MainWindow
this.btnLoadFilters.Name = "btnLoadFilters";
this.btnLoadFilters.UseUnderline = true;
this.btnLoadFilters.Label = global::Mono.Unix.Catalog.GetString ("Load");
global::Gtk.Image w17 = new global::Gtk.Image ();
w17.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-open", global::Gtk.IconSize.Menu);
this.btnLoadFilters.Image = w17;
global::Gtk.Image w16 = new global::Gtk.Image ();
w16.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-open", global::Gtk.IconSize.Menu);
this.btnLoadFilters.Image = w16;
this.hbox2.Add (this.btnLoadFilters);
global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnLoadFilters]));
w18.Position = 0;
w18.Expand = false;
w18.Fill = false;
global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnLoadFilters]));
w17.Position = 0;
w17.Expand = false;
w17.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.btnSaveFilters = new global::Gtk.Button ();
this.btnSaveFilters.CanFocus = true;
this.btnSaveFilters.Name = "btnSaveFilters";
this.btnSaveFilters.UseUnderline = true;
this.btnSaveFilters.Label = global::Mono.Unix.Catalog.GetString ("Save");
global::Gtk.Image w19 = new global::Gtk.Image ();
w19.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Menu);
this.btnSaveFilters.Image = w19;
global::Gtk.Image w18 = new global::Gtk.Image ();
w18.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Menu);
this.btnSaveFilters.Image = w18;
this.hbox2.Add (this.btnSaveFilters);
global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnSaveFilters]));
w20.Position = 1;
global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnSaveFilters]));
w19.Position = 1;
w19.Expand = false;
w19.Fill = false;
this.filterBox.Add (this.hbox2);
global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox2]));
w20.Position = 0;
w20.Expand = false;
w20.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.cbAutoCheckCaps = new global::Gtk.CheckButton ();
this.cbAutoCheckCaps.CanFocus = true;
this.cbAutoCheckCaps.Name = "cbAutoCheckCaps";
this.cbAutoCheckCaps.Label = global::Mono.Unix.Catalog.GetString ("Auto Check New Capabilities");
this.cbAutoCheckCaps.Active = true;
this.cbAutoCheckCaps.DrawIndicator = true;
this.cbAutoCheckCaps.UseUnderline = true;
this.hbox2.Add (this.cbAutoCheckCaps);
global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.cbAutoCheckCaps]));
w21.Position = 2;
this.filterBox.Add (this.hbox2);
global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox2]));
w22.Position = 0;
w22.Expand = false;
w22.Fill = false;
// Container child filterBox.Gtk.Box+BoxChild
this.hbox3 = new global::Gtk.HBox ();
this.hbox3.Name = "hbox3";
@@ -333,8 +316,8 @@ public partial class MainWindow
this.GtkLabel7.LabelProp = global::Mono.Unix.Catalog.GetString ("UDP Packets & Login");
this.frameFilterUDP.LabelWidget = this.GtkLabel7;
this.hbox3.Add (this.frameFilterUDP);
global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterUDP]));
w24.Position = 0;
global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterUDP]));
w22.Position = 0;
// Container child hbox3.Gtk.Box+BoxChild
this.frameFilterCap = new global::Gtk.Frame ();
this.frameFilterCap.Name = "frameFilterCap";
@@ -350,11 +333,11 @@ public partial class MainWindow
this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("Capabilities & EventQueue Messages");
this.frameFilterCap.LabelWidget = this.GtkLabel8;
this.hbox3.Add (this.frameFilterCap);
global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterCap]));
w26.Position = 1;
global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterCap]));
w24.Position = 1;
this.filterBox.Add (this.hbox3);
global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox3]));
w27.Position = 1;
global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox3]));
w25.Position = 1;
// Container child filterBox.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4";
@@ -368,8 +351,8 @@ public partial class MainWindow
this.cbSelectAllUDP.DrawIndicator = true;
this.cbSelectAllUDP.UseUnderline = true;
this.hbox4.Add (this.cbSelectAllUDP);
global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllUDP]));
w28.Position = 0;
global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllUDP]));
w26.Position = 0;
// Container child hbox4.Gtk.Box+BoxChild
this.cbSelectAllCap = new global::Gtk.CheckButton ();
this.cbSelectAllCap.CanFocus = true;
@@ -378,17 +361,17 @@ public partial class MainWindow
this.cbSelectAllCap.DrawIndicator = true;
this.cbSelectAllCap.UseUnderline = true;
this.hbox4.Add (this.cbSelectAllCap);
global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllCap]));
w29.Position = 1;
global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllCap]));
w27.Position = 1;
this.filterBox.Add (this.hbox4);
global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox4]));
w30.PackType = ((global::Gtk.PackType)(1));
w30.Position = 2;
w30.Expand = false;
w30.Fill = false;
global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox4]));
w28.PackType = ((global::Gtk.PackType)(1));
w28.Position = 2;
w28.Expand = false;
w28.Fill = false;
this.tabsMain.Add (this.filterBox);
global::Gtk.Notebook.NotebookChild w31 = ((global::Gtk.Notebook.NotebookChild)(this.tabsMain [this.filterBox]));
w31.Position = 1;
global::Gtk.Notebook.NotebookChild w29 = ((global::Gtk.Notebook.NotebookChild)(this.tabsMain [this.filterBox]));
w29.Position = 1;
// Notebook tab
this.label5 = new global::Gtk.Label ();
this.label5.Name = "label5";
@@ -396,19 +379,19 @@ public partial class MainWindow
this.tabsMain.SetTabLabel (this.filterBox, this.label5);
this.label5.ShowAll ();
// Notebook tab
global::Gtk.Label w32 = new global::Gtk.Label ();
w32.Visible = true;
this.tabsMain.Add (w32);
global::Gtk.Label w30 = new global::Gtk.Label ();
w30.Visible = true;
this.tabsMain.Add (w30);
this.label6 = new global::Gtk.Label ();
this.label6.Name = "label6";
this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Inspector");
this.tabsMain.SetTabLabel (w32, this.label6);
this.tabsMain.SetTabLabel (w30, this.label6);
this.label6.ShowAll ();
this.mainSplit.Add (this.tabsMain);
this.vbox1.Add (this.mainSplit);
global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.mainSplit]));
w34.Position = 1;
this.Add (this.vbox1);
this.vboxMenuMain.Add (this.mainSplit);
global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vboxMenuMain [this.mainSplit]));
w32.Position = 1;
this.Add (this.vboxMenuMain);
if ((this.Child != null)) {
this.Child.ShowAll ();
}
@@ -418,5 +401,7 @@ public partial class MainWindow
this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
this.ExitAction.Activated += new global::System.EventHandler (this.OnExitActionActivated);
this.btnStart.Clicked += new global::System.EventHandler (this.OnBtnStartClicked);
this.cbSelectAllUDP.Toggled += new global::System.EventHandler (this.OnCbSelectAllUDPToggled);
this.cbSelectAllCap.Toggled += new global::System.EventHandler (this.OnCbSelectAllCapToggled);
}
}

View File

@@ -92,11 +92,11 @@
<property name="AllowShrink">True</property>
<signal name="DeleteEvent" handler="OnDeleteEvent" />
<child>
<widget class="Gtk.VBox" id="vbox1">
<widget class="Gtk.VBox" id="vboxMenuMain">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.HBox" id="hbox1">
<widget class="Gtk.HBox" id="hboxMenu">
<property name="MemberName" />
<property name="Spacing">6</property>
<property name="BorderWidth">3</property>
@@ -265,7 +265,7 @@ http://login.orgrid.org/</property>
<property name="CanFocus">True</property>
<property name="Position">400</property>
<child>
<widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
<widget class="Gtk.ScrolledWindow" id="sessionLogScroller">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShadowType">In</property>
@@ -355,19 +355,7 @@ http://login.orgrid.org/</property>
</packing>
</child>
<child>
<widget class="Gtk.CheckButton" id="cbAutoCheckCaps">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Auto Check New Capabilities</property>
<property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
</packing>
<placeholder />
</child>
</widget>
<packing>
@@ -463,6 +451,7 @@ http://login.orgrid.org/</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
<signal name="Toggled" handler="OnCbSelectAllUDPToggled" />
</widget>
<packing>
<property name="Position">0</property>
@@ -477,6 +466,7 @@ http://login.orgrid.org/</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
<signal name="Toggled" handler="OnCbSelectAllCapToggled" />
</widget>
<packing>
<property name="Position">1</property>