~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.GtkCore/libstetic/wrapper/AboutDialog.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
 
 
3
namespace Stetic.Wrapper {
 
4
 
 
5
        public class AboutDialog : Window {
 
6
 
 
7
                public override void Wrap (object obj, bool initialized)
 
8
                {
 
9
                        base.Wrap (obj, initialized);
 
10
 
 
11
                        if (!initialized) {
 
12
                                // FIXME; set from Project eventually
 
13
                                about.Name = "My Application";
 
14
                        }
 
15
                }
 
16
 
 
17
                Gtk.AboutDialog about {
 
18
                        get {
 
19
                                return (Gtk.AboutDialog)Wrapped;
 
20
                        }
 
21
                }
 
22
 
 
23
                string logo;
 
24
                public string Logo {
 
25
                        get {
 
26
                                return logo;
 
27
                        }
 
28
                        set {
 
29
                                logo = value;
 
30
                                about.Logo = new Gdk.Pixbuf (logo);
 
31
                        }
 
32
                }
 
33
 
 
34
                // In the underlying representation, WebsiteLabel is always set
 
35
                // if Website is; if you set Website to something, and WebsiteLabel
 
36
                // is null, then WebsiteLabel gets set to match Website. There are
 
37
                // two problems with this for us:
 
38
                //
 
39
                //   1. If you type "http..." into Website while WebsiteLabel is
 
40
                //      blank, WebsiteLabel ends up being forcibly set to just "h".
 
41
                //
 
42
                //   2. If the user decides s/he wants to get rid of WebsiteLabel,
 
43
                //      they have to actually copy the URL from Website over it.
 
44
                //
 
45
                // In Stetic's representation, WebsiteLabel is always "what to show
 
46
                // *instead of* Website", and if it's empty, then you see the raw URL.
 
47
 
 
48
                public string Website {
 
49
                        get {
 
50
                                return about.Website;
 
51
                        }
 
52
                        set {
 
53
                                if (website_label == null)
 
54
                                        about.WebsiteLabel = value;
 
55
                                about.Website = value;
 
56
                        }
 
57
                }
 
58
 
 
59
                string website_label;
 
60
                public string WebsiteLabel {
 
61
                        get {
 
62
                                return website_label;
 
63
                        }
 
64
                        set {
 
65
                                if (value == "" || value == null) {
 
66
                                        about.WebsiteLabel = about.Website;
 
67
                                        website_label = null;
 
68
                                } else {
 
69
                                        about.WebsiteLabel = value;
 
70
                                        website_label = value;
 
71
                                }
 
72
                        }
 
73
                }
 
74
        }
 
75
}