~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2012-02-05 10:49:36 UTC
  • mto: (10.3.1)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20120205104936-4ujoylapu24cquuo
Tags: upstream-2.8.6.3+dfsg
ImportĀ upstreamĀ versionĀ 2.8.6.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
// THE SOFTWARE.
26
26
 
27
27
using System;
 
28
using MonoDevelop.Ide;
28
29
 
29
30
namespace MonoDevelop.Components.Extensions
30
31
{
34
35
        
35
36
        public class ExceptionDialogData : PlatformDialogData
36
37
        {
 
38
                public AlertButton[] Buttons { get; set; }
37
39
                public string Message { get; set; }
38
40
                public Exception Exception { get; set; }
 
41
                public AlertButton ResultButton {  get; set; }
39
42
        }
40
43
        
41
44
        public class ExceptionDialog : PlatformDialog<ExceptionDialogData>
42
45
        {
 
46
                public AlertButton[] Buttons {
 
47
                        get { return data.Buttons; }
 
48
                        set { data.Buttons = value; }
 
49
                }
 
50
 
43
51
                public string Message {
44
52
                        get { return data.Message; }
45
53
                        set { data.Message = value; }
50
58
                        set { data.Exception = value; }
51
59
                }
52
60
                
 
61
                public AlertButton ResultButton {
 
62
                        get { return data.ResultButton; }
 
63
                        private set { data.ResultButton = value; }
 
64
                }
 
65
 
53
66
                protected override bool RunDefault ()
54
67
                {
55
 
                        var errorDialog = new MonoDevelop.Ide.Gui.Dialogs.GtkErrorDialog (TransientFor);
56
 
                        errorDialog.Message = Message;
 
68
                        var errorDialog = new MonoDevelop.Ide.Gui.Dialogs.GtkErrorDialog (TransientFor, Title, Message, Buttons);
57
69
                        errorDialog.AddDetails (Exception.ToString (), false);
58
 
                        MonoDevelop.Ide.MessageService.ShowCustomDialog (errorDialog, TransientFor);
 
70
                        int result = MonoDevelop.Ide.MessageService.ShowCustomDialog (errorDialog);
 
71
                        ResultButton = result >= 0 ? Buttons [result] : null;
59
72
                        return true;
60
73
                }
61
74
        }
62
 
}
63
 
 
 
75
}
 
 
b'\\ No newline at end of file'