Added CrashDialog to GTK engine for Universal Editor

This commit is contained in:
Michael Becker 2014-10-22 23:31:02 -04:00
parent d96f8461d0
commit 1528b51821
4 changed files with 364 additions and 15 deletions

View File

@ -27,6 +27,31 @@ namespace UniversalEditor.Engines.GTK.Dialogs
{
this.Build();
}
private Exception mvarException = null;
public Exception Exception
{
get { return mvarException; }
set
{
mvarException = value;
if (mvarException == null)
{
txtException.Text = String.Empty;
txtMessage.Buffer.Text = String.Empty;
txtSource.Text = String.Empty;
txtStackTrace.Buffer.Text = String.Empty;
}
else
{
txtException.Text = mvarException.GetType().Name;
txtMessage.Buffer.Text = mvarException.Message;
txtSource.Text = mvarException.Source;
txtStackTrace.Buffer.Text = mvarException.StackTrace;
}
}
}
}
}

View File

@ -40,6 +40,7 @@ namespace UniversalEditor.Engines.GTK
protected override void ShowCrashDialog(Exception ex)
{
Dialogs.CrashDialog dlg = new Dialogs.CrashDialog();
dlg.Exception = ex;
switch ((ResponseType)dlg.Run())
{
case ResponseType.Ok:

View File

@ -4,6 +4,17 @@ namespace UniversalEditor.Engines.GTK.Dialogs
{
public partial class CrashDialog
{
private global::Gtk.Table table1;
private global::Gtk.ScrolledWindow GtkScrolledWindow;
private global::Gtk.TextView txtMessage;
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
private global::Gtk.TextView txtStackTrace;
private global::Gtk.Label label1;
private global::Gtk.Label label2;
private global::Gtk.Label label3;
private global::Gtk.Label label4;
private global::Gtk.Entry txtException;
private global::Gtk.Entry txtSource;
private global::Gtk.Button buttonCancel;
private global::Gtk.Button buttonOk;
@ -18,12 +29,128 @@ namespace UniversalEditor.Engines.GTK.Dialogs
global::Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false);
this.table1.Name = "table1";
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
// Container child table1.Gtk.Table+TableChild
this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
this.txtMessage = new global::Gtk.TextView ();
this.txtMessage.CanFocus = true;
this.txtMessage.Name = "txtMessage";
this.txtMessage.Editable = false;
this.txtMessage.WrapMode = ((global::Gtk.WrapMode)(2));
this.GtkScrolledWindow.Add (this.txtMessage);
this.table1.Add (this.GtkScrolledWindow);
global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow]));
w3.TopAttach = ((uint)(2));
w3.BottomAttach = ((uint)(3));
w3.LeftAttach = ((uint)(1));
w3.RightAttach = ((uint)(2));
// Container child table1.Gtk.Table+TableChild
this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
this.txtStackTrace = new global::Gtk.TextView ();
this.txtStackTrace.CanFocus = true;
this.txtStackTrace.Name = "txtStackTrace";
this.txtStackTrace.Editable = false;
this.txtStackTrace.WrapMode = ((global::Gtk.WrapMode)(2));
this.GtkScrolledWindow1.Add (this.txtStackTrace);
this.table1.Add (this.GtkScrolledWindow1);
global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow1]));
w5.TopAttach = ((uint)(3));
w5.BottomAttach = ((uint)(4));
w5.LeftAttach = ((uint)(1));
w5.RightAttach = ((uint)(2));
// Container child table1.Gtk.Table+TableChild
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.Xalign = 0F;
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Exception:");
this.label1.UseUnderline = true;
this.table1.Add (this.label1);
global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1]));
w6.XOptions = ((global::Gtk.AttachOptions)(4));
w6.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
this.label2.Xalign = 0F;
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Source:");
this.label2.UseUnderline = true;
this.table1.Add (this.label2);
global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2]));
w7.TopAttach = ((uint)(1));
w7.BottomAttach = ((uint)(2));
w7.XOptions = ((global::Gtk.AttachOptions)(4));
w7.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.label3 = new global::Gtk.Label ();
this.label3.Name = "label3";
this.label3.Xalign = 0F;
this.label3.Yalign = 0F;
this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("_Message:");
this.label3.UseUnderline = true;
this.table1.Add (this.label3);
global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
w8.TopAttach = ((uint)(2));
w8.BottomAttach = ((uint)(3));
w8.XOptions = ((global::Gtk.AttachOptions)(4));
w8.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.label4 = new global::Gtk.Label ();
this.label4.Name = "label4";
this.label4.Xalign = 0F;
this.label4.Yalign = 0F;
this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("_Stack trace:");
this.label4.UseUnderline = true;
this.table1.Add (this.label4);
global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4]));
w9.TopAttach = ((uint)(3));
w9.BottomAttach = ((uint)(4));
w9.XOptions = ((global::Gtk.AttachOptions)(4));
w9.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.txtException = new global::Gtk.Entry ();
this.txtException.CanFocus = true;
this.txtException.Name = "txtException";
this.txtException.IsEditable = true;
this.txtException.InvisibleChar = '•';
this.table1.Add (this.txtException);
global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.txtException]));
w10.LeftAttach = ((uint)(1));
w10.RightAttach = ((uint)(2));
w10.XOptions = ((global::Gtk.AttachOptions)(4));
w10.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.txtSource = new global::Gtk.Entry ();
this.txtSource.CanFocus = true;
this.txtSource.Name = "txtSource";
this.txtSource.IsEditable = true;
this.txtSource.InvisibleChar = '•';
this.table1.Add (this.txtSource);
global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.txtSource]));
w11.TopAttach = ((uint)(1));
w11.BottomAttach = ((uint)(2));
w11.LeftAttach = ((uint)(1));
w11.RightAttach = ((uint)(2));
w11.XOptions = ((global::Gtk.AttachOptions)(4));
w11.YOptions = ((global::Gtk.AttachOptions)(4));
w1.Add (this.table1);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(w1 [this.table1]));
w12.Position = 0;
// Internal child UniversalEditor.Engines.GTK.Dialogs.CrashDialog.ActionArea
global::Gtk.HButtonBox w2 = this.ActionArea;
w2.Name = "dialog1_ActionArea";
w2.Spacing = 10;
w2.BorderWidth = ((uint)(5));
w2.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
global::Gtk.HButtonBox w13 = this.ActionArea;
w13.Name = "dialog1_ActionArea";
w13.Spacing = 10;
w13.BorderWidth = ((uint)(5));
w13.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new global::Gtk.Button ();
this.buttonCancel.CanDefault = true;
@ -33,9 +160,9 @@ namespace UniversalEditor.Engines.GTK.Dialogs
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget (this.buttonCancel, -6);
global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonCancel]));
w3.Expand = false;
w3.Fill = false;
global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13 [this.buttonCancel]));
w14.Expand = false;
w14.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@ -45,15 +172,15 @@ namespace UniversalEditor.Engines.GTK.Dialogs
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
this.AddActionWidget (this.buttonOk, -5);
global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonOk]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13 [this.buttonOk]));
w15.Position = 1;
w15.Expand = false;
w15.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
this.DefaultWidth = 400;
this.DefaultHeight = 300;
this.DefaultHeight = 355;
this.Show ();
}
}

View File

@ -625,7 +625,7 @@ This implementation of the Universal Editor Platform is primarily developed and
</widget>
</child>
</widget>
<widget class="Gtk.Dialog" id="UniversalEditor.Engines.GTK.Dialogs.CrashDialog" design-size="400 300">
<widget class="Gtk.Dialog" id="UniversalEditor.Engines.GTK.Dialogs.CrashDialog" design-size="400 355">
<property name="MemberName" />
<property name="Title" translatable="yes">Fatal Error</property>
<property name="WindowPosition">CenterOnParent</property>
@ -636,7 +636,203 @@ This implementation of the Universal Editor Platform is primarily developed and
<property name="MemberName" />
<property name="BorderWidth">2</property>
<child>
<placeholder />
<widget class="Gtk.Table" id="table1">
<property name="MemberName" />
<property name="NRows">4</property>
<property name="NColumns">2</property>
<property name="RowSpacing">6</property>
<property name="ColumnSpacing">6</property>
<child>
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.TextView" id="txtMessage">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
<property name="Editable">False</property>
<property name="Text" translatable="yes" />
<property name="WrapMode">Word</property>
</widget>
</child>
</widget>
<packing>
<property name="TopAttach">2</property>
<property name="BottomAttach">3</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">False</property>
<property name="XExpand">True</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">True</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.TextView" id="txtStackTrace">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
<property name="Editable">False</property>
<property name="Text" translatable="yes" />
<property name="WrapMode">Word</property>
</widget>
</child>
</widget>
<packing>
<property name="TopAttach">3</property>
<property name="BottomAttach">4</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">False</property>
<property name="XExpand">True</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">True</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">_Exception:</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label2">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">_Source:</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label3">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
<property name="LabelProp" translatable="yes">_Message:</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="TopAttach">2</property>
<property name="BottomAttach">3</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label4">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
<property name="LabelProp" translatable="yes">_Stack trace:</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="TopAttach">3</property>
<property name="BottomAttach">4</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="txtException">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
</widget>
<packing>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="txtSource">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
</widget>
</child>