Allow proxy to not exit on command args errors.

Validate port in Gtk GridProxy. Persist it
This commit is contained in:
Latif Khalifa
2013-12-21 19:08:26 +01:00
parent 67bc3d6df0
commit a7c3e18cd8
5 changed files with 36 additions and 6 deletions

View File

@@ -61,6 +61,16 @@ public partial class MainWindow : Gtk.Window
font = "monospace 9";
}
btnLoadPlugin.Sensitive = false;
txtPort.TextInserted += (object o, TextInsertedArgs args) =>
{
if (args.Length != 1) return;
if (!char.IsDigit(args.Text[0]))
{
txtPort.DeleteText(args.Position - 1, args.Position);
}
};
txtRequest.ModifyFont(Pango.FontDescription.FromString(font));
CreateTags(txtRequest.Buffer);
txtRequestRaw.ModifyFont(Pango.FontDescription.FromString(font));
@@ -297,10 +307,11 @@ public partial class MainWindow : Gtk.Window
{
proxy = new ProxyManager(txtPort.Text, cbListen.ActiveText, cbLoginURL.ActiveText);
proxy.Start();
btnLoadPlugin.Sensitive = true;
}
catch
catch (Exception ex)
{
Logger.Log("Failed to start proxy", OpenMetaverse.Helpers.LogLevel.Error);
Logger.Log("Failed to start proxy: " + ex.Message, OpenMetaverse.Helpers.LogLevel.Error);
try
{
proxy.Stop();
@@ -321,6 +332,7 @@ public partial class MainWindow : Gtk.Window
containerFilterUDP.Remove(child);
}
plugins.Store.Clear();
btnLoadPlugin.Sensitive = false;
}
protected void OnDeleteEvent(object sender, DeleteEventArgs a)