示例#1
0
		public SdkLocationWidget (SdkLocationPanel panel) : base (false, 12)
		{
			this.panel = panel;
			
			this.PackStart (new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (panel.Label) + "</b>",
					Xalign = 0f,
			});
			var alignment = new Alignment (0f, 0f, 1f, 1f) { LeftPadding = 24 };
			this.PackStart (alignment);
			var vbox = new VBox (false , 6);
			var locationBox = new HBox (false, 6);
			var messageBox = new HBox (false, 6);
			alignment.Add (vbox);
			vbox.PackStart (messageBox, false, false, 0);
			vbox.PackStart (locationBox, false, false, 0);
			locationBox.PackStart (new Label (GettextCatalog.GetString ("Location:")), false, false, 0);
			locationBox.PackStart (locationEntry, true, true, 0);
			messageBox.PackStart (messageIcon, false, false, 0);
			messageBox.PackStart (messageLabel, true, true, 0);
			messageLabel.Xalign = 0f;
			
			string location = panel.LoadSdkLocationSetting ();
			locationEntry.Path = location ?? "";
			
			locationEntry.PathChanged += delegate {
				Validate ();
			};
			Validate ();
			ShowAll ();
		}
示例#2
0
		public SdkLocationWidget (SdkLocationPanel panel) : base (false, 12)
		{
			this.panel = panel;
			
			this.PackStart (new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (panel.Label) + "</b>",
					Xalign = 0f,
			});
			var alignment = new Alignment (0f, 0f, 1f, 1f) { LeftPadding = 24 };
			this.PackStart (alignment);
			var vbox = new VBox (false , 6);
			var locationBox = new HBox (false, 6);
			var messageBox = new HBox (false, 6);
			alignment.Add (vbox);
			vbox.PackStart (messageBox, false, false, 0);
			vbox.PackStart (locationBox, false, false, 0);
			locationBox.PackStart (new Label (GettextCatalog.GetString ("Location:")), false, false, 0);
			locationBox.PackStart (locationEntry, true, true, 0);
			messageBox.PackStart (messageIcon, false, false, 0);
			messageBox.PackStart (messageLabel, true, true, 0);
			messageLabel.Xalign = 0f;
			
			string location = panel.LoadSdkLocationSetting ();
			locationEntry.Path = location ?? "";
			
			locationEntry.PathChanged += delegate {
				Validate ();
			};
			Validate ();
			ShowAll ();
		}
示例#3
0
        public SdkLocationWidget(SdkLocationPanel panel) : base(false, 12)
        {
            this.panel = panel;

            this.PackStart(new Label()
            {
                Markup = "<b>" + GLib.Markup.EscapeText(panel.Label) + "</b>",
                Xalign = 0f,
            });
            var alignment = new Alignment(0f, 0f, 1f, 1f)
            {
                LeftPadding = 24
            };

            this.PackStart(alignment);
            var vbox        = new VBox(false, 6);
            var locationBox = new HBox(false, 6);
            var messageBox  = new HBox(false, 6);

            alignment.Add(vbox);
            vbox.PackStart(messageBox, false, false, 0);
            vbox.PackStart(locationBox, false, false, 0);
            locationBox.PackStart(new Label(GettextCatalog.GetString("Location:")), false, false, 0);
            locationBox.PackStart(locationEntry, true, true, 0);
            messageBox.PackStart(messageIcon, false, false, 0);
            messageBox.PackStart(messageLabel, true, true, 0);
            messageLabel.Xalign = 0f;

            string location = panel.LoadSdkLocationSetting();

            locationEntry.Path = location ?? "";

            locationEntry.PathChanged += delegate {
                Validate();
            };
            Validate();

            if (panel.RequiresRestart)
            {
                PackStart(new HSeparator(), false, false, 0);

                var tableRestart = new RestartPanel();
                tableRestart.RestartRequested += (sender, e) => {
                    ApplyChanges();
                    IdeApp.Restart(true).Ignore();
                };

                PackStart(tableRestart, false, false, 0);
            }

            ShowAll();
        }
示例#4
0
        public SdkLocationWidget(SdkLocationPanel panel) : base(false, 12)
        {
            this.panel = panel;

            this.PackStart(new Label()
            {
                Markup = "<b>" + GLib.Markup.EscapeText(panel.Label) + "</b>",
                Xalign = 0f,
            });
            var alignment = new Alignment(0f, 0f, 1f, 1f)
            {
                LeftPadding = 24
            };

            this.PackStart(alignment);
            var vbox        = new VBox(false, 6);
            var locationBox = new HBox(false, 6);
            var messageBox  = new HBox(false, 6);

            alignment.Add(vbox);
            vbox.PackStart(messageBox, false, false, 0);
            vbox.PackStart(locationBox, false, false, 0);
            locationBox.PackStart(new Label(GettextCatalog.GetString("Location:")), false, false, 0);
            locationBox.PackStart(locationEntry, true, true, 0);
            messageBox.PackStart(messageIcon, false, false, 0);
            messageBox.PackStart(messageLabel, true, true, 0);
            messageLabel.Xalign = 0f;

            string location = panel.LoadSdkLocationSetting();

            locationEntry.Path = location ?? "";

            locationEntry.PathChanged += delegate {
                Validate();
            };
            Validate();

            if (panel.RequiresRestart)
            {
                PackStart(new HSeparator(), false, false, 0);

                var tableRestart = new Table(2, 3, false)
                {
                    RowSpacing = 6, ColumnSpacing = 6
                };

                var btnRestart = new Button()
                {
                    Label    = GettextCatalog.GetString("Restart {0}", BrandingService.ApplicationName),
                    CanFocus = true, UseUnderline = true
                };
                tableRestart.Attach(btnRestart, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

                var imageRestart = new ImageView("md-information", IconSize.Menu);
                tableRestart.Attach(imageRestart, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

                var labelRestart = new Label(GettextCatalog.GetString("These preferences will take effect next time you start {0}", BrandingService.ApplicationName));
                tableRestart.Attach(labelRestart, 1, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

                PackStart(tableRestart, false, false, 0);

                btnRestart.Clicked += (sender, e) => {
                    ApplyChanges();
                    IdeApp.Restart(true);
                };
            }

            ShowAll();
        }
		public SdkLocationWidget (SdkLocationPanel panel) : base (false, 12)
		{
			this.panel = panel;
			
			this.PackStart (new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (panel.Label) + "</b>",
					Xalign = 0f,
			});
			var alignment = new Alignment (0f, 0f, 1f, 1f) { LeftPadding = 24 };
			this.PackStart (alignment);
			var vbox = new VBox (false , 6);
			var locationBox = new HBox (false, 6);
			var messageBox = new HBox (false, 6);
			alignment.Add (vbox);
			vbox.PackStart (messageBox, false, false, 0);
			vbox.PackStart (locationBox, false, false, 0);
			locationBox.PackStart (new Label (GettextCatalog.GetString ("Location:")), false, false, 0);
			locationBox.PackStart (locationEntry, true, true, 0);
			messageBox.PackStart (messageIcon, false, false, 0);
			messageBox.PackStart (messageLabel, true, true, 0);
			messageLabel.Xalign = 0f;
			
			string location = panel.LoadSdkLocationSetting ();
			locationEntry.Path = location ?? "";
			
			locationEntry.PathChanged += delegate {
				Validate ();
			};
			Validate ();

			if (panel.RequiresRestart) {
				PackStart (new HSeparator (), false, false, 0);

				var tableRestart = new Table (2, 3, false) {
					RowSpacing = 6, ColumnSpacing = 6
				};

				var btnRestart = new Button () {
					Label = GettextCatalog.GetString ("Restart {0}", BrandingService.ApplicationName),
					CanFocus = true, UseUnderline = true
				};
				tableRestart.Attach (btnRestart, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

				var imageRestart = new ImageView ("md-information", IconSize.Menu);
				tableRestart.Attach (imageRestart, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

				var labelRestart = new Label (GettextCatalog.GetString ("These preferences will take effect next time you start {0}", BrandingService.ApplicationName));
				tableRestart.Attach (labelRestart, 1, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

				PackStart (tableRestart, false, false, 0);

				btnRestart.Clicked += (sender, e) => {
					ApplyChanges ();
					IdeApp.Restart (true);
				};
			}

			ShowAll ();
		}