public EnableStartupNotesPreference()
        {
            IPropertyEditorBool enableStartupNotes_peditor;

            Gtk.CheckButton enableStartupNotesCheckbox;
            Gtk.Label       enableStartupNotesLabel;

            // Enable Startup Notes option
            enableStartupNotesLabel           = new Gtk.Label(Catalog.GetString("Enable startup notes"));
            enableStartupNotesLabel.UseMarkup = true;
            enableStartupNotesLabel.Justify   = Gtk.Justification.Left;
            enableStartupNotesLabel.SetAlignment(0.0f, 0.5f);
            enableStartupNotesLabel.Show();

            enableStartupNotesCheckbox = new Gtk.CheckButton();
            enableStartupNotesCheckbox.Add(enableStartupNotesLabel);
            enableStartupNotesCheckbox.Show();

            enableStartupNotes_peditor =
                Services.Factory.CreatePropertyEditorToggleButton(Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
            Preferences.Get(enableStartupNotes_peditor.Key);
            enableStartupNotes_peditor.Setup();

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(enableStartupNotesCheckbox);
        }
        public LiveAnalysisPreferences()
        {
            this.Build ();

            rendercb = new CheckButton ();
            table1.Attach (rendercb, 1, 2, 0, 1,
                AttachOptions.Shrink,
                AttachOptions.Shrink, 0, 0);
            rendercb.CanFocus = false;
            rendercb.Show ();
            rendercb.Active = App.Current.Config.AutoRenderPlaysInLive;
            rendercb.Toggled += (sender, e) => {
                App.Current.Config.AutoRenderPlaysInLive = rendercb.Active;
            };

            reviewcb = new CheckButton ();
            table1.Attach (reviewcb, 1, 2, 2, 3,
                AttachOptions.Shrink,
                AttachOptions.Shrink, 0, 0);
            reviewcb.CanFocus = false;
            reviewcb.Show ();
            reviewcb.Active = App.Current.Config.ReviewPlaysInSameWindow;
            reviewcb.Toggled += (sender, e) => {
                App.Current.Config.ReviewPlaysInSameWindow = reviewcb.Active;
            };

            mediafilechooser1.FileChooserMode = FileChooserMode.Directory;
            mediafilechooser1.CurrentPath = App.Current.Config.AutoRenderDir;
            mediafilechooser1.ChangedEvent += HandleChangedEvent;
        }
		public EnableStartupNotesPreference ()
		{
			IPropertyEditorBool enableStartupNotes_peditor;
			Gtk.CheckButton enableStartupNotesCheckbox;
			Gtk.Label enableStartupNotesLabel;

			// Enable Startup Notes option
			enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
			enableStartupNotesLabel.UseMarkup = true;
			enableStartupNotesLabel.Justify = Gtk.Justification.Left;
			enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
			enableStartupNotesLabel.Show ();

			enableStartupNotesCheckbox = new Gtk.CheckButton ();
			enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
			enableStartupNotesCheckbox.Show ();

			enableStartupNotes_peditor =
				Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
			Preferences.Get (enableStartupNotes_peditor.Key);
			enableStartupNotes_peditor.Setup ();

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (enableStartupNotesCheckbox);
		}
			public WidgetBuilderOptionPanelWidget (Project project) : base (false, 6)
			{
				this.project = project as DotNetProject;

				Gtk.HBox box = new Gtk.HBox (false, 3);
				Gtk.Label lbl = new Gtk.Label (GettextCatalog.GetString ("Target Gtk# version:"));
				box.PackStart (lbl, false, false, 0);
				comboVersions = ComboBox.NewText ();
				ReferenceManager refmgr = new ReferenceManager (project as DotNetProject);
				foreach (string v in refmgr.SupportedGtkVersions)
					comboVersions.AppendText (v);
				comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf (refmgr.GtkPackageVersion);
				refmgr.Dispose ();
				box.PackStart (comboVersions, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				HSeparator sep = new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				if (!GtkDesignInfo.HasDesignedObjects (project))
					return;

				GtkDesignInfo designInfo = GtkDesignInfo.FromProject (project);
				checkGettext = new CheckButton (GettextCatalog.GetString ("Enable gettext support"));
				checkGettext.Active = designInfo.GenerateGettext;
				checkGettext.Show ();
				PackStart (checkGettext, false, false, 0);
				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Gettext class:")), false, false, 0);
				entryGettext = new Gtk.Entry ();
				entryGettext.Text = designInfo.GettextClass;
				entryGettext.Sensitive = checkGettext.Active;
				box.PackStart (entryGettext, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);
				
				sep= new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Stetic folder name :")), false, false, 0);
				entryFolderName = new Gtk.Entry ();
				entryFolderName.Text = designInfo.SteticFolderName;
				entryFolderName.Sensitive = false;
				box.PackStart (entryFolderName, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);
				
				checkHideFiles = new CheckButton (GettextCatalog.GetString ("Hide designer files"));
				checkHideFiles.Active = designInfo.HideGtkxFiles;
				checkHideFiles.Show ();
				PackStart (checkHideFiles, false, false, 0);
			}
            public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6)
            {
                this.project = project as DotNetProject;

                Gtk.HBox  box = new Gtk.HBox(false, 3);
                Gtk.Label lbl = new Gtk.Label(GettextCatalog.GetString("Target Gtk# version:"));
                box.PackStart(lbl, false, false, 0);
                comboVersions = ComboBox.NewText();
                ReferenceManager refmgr = new ReferenceManager(project as DotNetProject);

                foreach (string v in refmgr.SupportedGtkVersions)
                {
                    comboVersions.AppendText(v);
                }
                comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf(refmgr.GtkPackageVersion);
                refmgr.Dispose();
                box.PackStart(comboVersions, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                HSeparator sep = new HSeparator();

                sep.Show();
                PackStart(sep, false, false, 0);

                if (!GtkDesignInfo.HasDesignedObjects(project))
                {
                    return;
                }

                GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project);

                checkGettext        = new CheckButton(GettextCatalog.GetString("Enable gettext support"));
                checkGettext.Active = designInfo.GenerateGettext;
                checkGettext.Show();
                PackStart(checkGettext, false, false, 0);
                box = new Gtk.HBox(false, 3);
                box.PackStart(new Label(GettextCatalog.GetString("Gettext class:")), false, false, 0);
                entryGettext           = new Gtk.Entry();
                entryGettext.Text      = designInfo.GettextClass;
                entryGettext.Sensitive = checkGettext.Active;
                box.PackStart(entryGettext, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                checkGettext.Clicked += delegate
                {
                    box.Sensitive = checkGettext.Active;
                    if (checkGettext.Active)
                    {
                        entryGettext.Text = "Mono.Unix.Catalog";
                    }
                };
            }
Example #6
0
 private void on_cb_jumps_reactive_clicked(object o, EventArgs args)
 {
     if (cb_jumps_reactive.Active)
     {
         cb_jumps_reactive_with_subjumps.Show();
     }
     else
     {
         cb_jumps_reactive_with_subjumps.Hide();
     }
 }
Example #7
0
 private void on_cb_runs_interval_clicked(object o, EventArgs args)
 {
     if (cb_runs_interval.Active)
     {
         cb_runs_interval_with_subruns.Show();
     }
     else
     {
         cb_runs_interval_with_subruns.Hide();
     }
 }
			public WidgetBuilderOptionPanelWidget (Project project) : base (false, 6)
			{
				this.project = project as DotNetProject;

				Gtk.HBox box = new Gtk.HBox (false, 3);
				Gtk.Label lbl = new Gtk.Label (GettextCatalog.GetString ("Target Gtk# version:"));
				box.PackStart (lbl, false, false, 0);
				comboVersions = ComboBox.NewText ();
				ReferenceManager refmgr = new ReferenceManager (project as DotNetProject);
				foreach (string v in refmgr.SupportedGtkVersions)
					comboVersions.AppendText (v);
				comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf (refmgr.GtkPackageVersion);
				refmgr.Dispose ();
				box.PackStart (comboVersions, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				HSeparator sep = new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				if (!GtkDesignInfo.HasDesignedObjects (project))
					return;

				GtkDesignInfo designInfo = GtkDesignInfo.FromProject (project);
				checkGettext = new CheckButton (GettextCatalog.GetString ("Enable gettext support"));
				checkGettext.Active = designInfo.GenerateGettext;
				checkGettext.Show ();
				PackStart (checkGettext, false, false, 0);

				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Gettext class:")), false, false, 0);
				entryGettext = new Gtk.Entry ();
				entryGettext.Text = designInfo.GettextClass;
				entryGettext.Sensitive = checkGettext.Active;
				box.PackStart (entryGettext, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Resource loader class:")), false, false, 0);
				entryResourceLoader = new Gtk.Entry ();
				entryResourceLoader.Text = designInfo.ImageResourceLoaderClass;
				entryResourceLoader.Sensitive = checkGettext.Active;
				box.PackStart (entryResourceLoader, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				checkGettext.Clicked += delegate {
					box.Sensitive = checkGettext.Active;
					if (checkGettext.Active)
						entryGettext.Text = "Mono.Unix.Catalog";
				};
			}
 public GeneralPreferencesPanel()
 {
     this.Build ();
     FillLangs ();
     FillTemplates ();
     autosavecb = new CheckButton ();
     table1.Attach (autosavecb, 1, 2, 1, 2,
         AttachOptions.Shrink,
         AttachOptions.Shrink, 0, 0);
     autosavecb.CanFocus = false;
     autosavecb.Show ();
     autosavecb.Active = App.Current.Config.AutoSave;
     autosavecb.Toggled += (sender, e) => {
         App.Current.Config.AutoSave = autosavecb.Active;
     };
 }
        private DefaultApplicationHelperDialog()
            : base(null, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.None,
                                                         Catalog.GetString ("Make Banshee the default media player?"),
                                                         Catalog.GetString ("Currently another program is configured as the default media player.  Would you prefer Banshee to be the default?"))
        {
            remember = new CheckButton (Catalog.GetString ("Do not ask me this again"));
            remember.UseUnderline = true;
            remember.Active = DefaultApplicationHelper.EverAskedSchema.Get ()
                ? DefaultApplicationHelper.RememberChoiceSchema.Get () : false;
            remember.Show ();

            Alignment align = new Alignment (0f, 0f, 1f, 1f);
            align.TopPadding = 6;
            align.Child = remember;
            align.Show ();

            LabelVBox.PackEnd (align, false, false, 0);

            AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.No, false);
            AddCustomButton (Catalog.GetString ("Make Banshee the Default"), Gtk.ResponseType.Yes, true).HasFocus = true;
        }
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultHeight = 500;
			DefaultWidth = 600;
			VBox.Spacing = 0;

			VBox.PackStart (CreateExceptionHeader (), false, true, 0);

			var paned = new VPaned ();
			paned.Add1 (CreateExceptionValueTreeView ());
			paned.Add2 (CreateStackTraceTreeView ());
			paned.Show ();

			var vbox = new VBox (false, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (paned, true, true, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.Show ();

			VBox.PackStart (vbox, true, true, 0);

			var actionArea = new HBox (false, 12) { BorderWidth = 6 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();
			OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.Show ();

			VBox.PackStart (actionArea, false, true, 0);
			ActionArea.Hide ();
		}
		public PortableRuntimeOptionsPanelWidget (PortableDotNetProject project, IEnumerable<ItemConfiguration> configurations)
		{
			this.project = project;
			this.Build ();
			
			SortedDictionary<string, List<Framework>> options = new SortedDictionary<string, List<Framework>> ();
			
			foreach (var fx in Runtime.SystemAssemblyService.GetTargetFrameworks ()) {
				if (fx.Hidden || fx.Id.Identifier != ".NETPortable" || !project.TargetRuntime.IsInstalled (fx))
					continue;
				
				foreach (var sfx in fx.SupportedFrameworks) {
					List<Framework> list;
					
					if (!options.TryGetValue (sfx.DisplayName, out list)) {
						list = new List<Framework> ();
						options.Add (sfx.DisplayName, list);
					}
					
					list.Add (sfx);
				}
			}
			
			foreach (var opt in options) {
				var alignment = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) { LeftPadding = 18 };
				List<Framework> versions = opt.Value;
				CheckButton check;
				
				// FIXME: VS11 introduces comboboxes for some of these... which I suspect will need to sort based on version
				//versions.Sort (CompareFrameworksByVersion);
				check = new CheckButton (versions[0].DisplayName + " " + versions[0].MinimumVersionDisplayName);
				check.Sensitive = false; // Desensitize until we support changing these values...
				foreach (var ver in versions) {
					if (ver.TargetFramework == project.TargetFramework) {
						check.Active = true;
						break;
					}
				}
				check.Show ();
				
				alignment.Add (check);
				alignment.Show ();
				
				vbox1.PackStart (alignment, false, false, 0);
			}
		}
        private HBox BuildMatchHeader()
        {
            HBox matchHeader = new HBox();
            matchHeader.Show();

            matchCheckBox = new CheckButton("Match");
            matchCheckBox.Show();
            matchCheckBox.Toggled += OnMatchCheckBoxToggled;
            matchHeader.PackStart(matchCheckBox, false, false, 0);

            matchLogicCombo = ComboBox.NewText();
            matchLogicCombo.AppendText("all");
            matchLogicCombo.AppendText("any");
            matchLogicCombo.Show();
            matchLogicCombo.Active = 0;
            matchHeader.PackStart(matchLogicCombo, false, false, 0);

            matchLabelFollowing = new Label("of the following:");
            matchLabelFollowing.Show();
            matchLabelFollowing.Xalign = 0.0f;
            matchHeader.PackStart(matchLabelFollowing, true, true, 0);

            matchHeader.Spacing = 5;

            matchCheckBox.Active = false;
            OnMatchCheckBoxToggled(matchCheckBox, null);

            return matchHeader;
        }
Example #14
0
        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox(false, 6);

            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox  sectionVBox = new VBox(false, 4);
            Label l           = new Label();

            l.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                     Catalog.GetString("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            backendComboBox = ComboBox.NewText();
            backendComboMap = new Dictionary <int, string> ();
            // Fill out the ComboBox
            int i = 0;

            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends)
            {
                backendComboBox.AppendText(backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                {
                    selectedBackend = i;
                }
                i++;
            }
            if (selectedBackend >= 0)
            {
                backendComboBox.Active = selectedBackend;
            }
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show();

            HBox hbox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            hbox.PackStart(l, false, false, 0);
            hbox.PackStart(backendComboBox, false, false, 0);
            hbox.Show();
            sectionVBox.PackStart(hbox, false, false, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox(false, 4);
            l           = new Label();
            l.Markup    = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                        Catalog.GetString("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            HBox sectionHBox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            sectionHBox.PackStart(l, false, false, 0);
            VBox innerSectionVBox = new VBox(false, 6);

            hbox = new HBox(false, 6);

            bool showCompletedTasks = application.Preferences.GetBool(
                PreferencesKeys.ShowCompletedTasksKey);

            showCompletedTasksCheckButton =
                new CheckButton(Catalog.GetString("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active       = showCompletedTasks;
            showCompletedTasksCheckButton.Show();
            hbox.PackStart(showCompletedTasksCheckButton, true, true, 0);
            hbox.Show();
            innerSectionVBox.PackStart(hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label(Catalog.GetString("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign       = 0;
            l.Show();
            innerSectionVBox.PackStart(l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow();

            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType       = ShadowType.EtchedIn;

            taskListsTree = new TreeView();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint      = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget             = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            column.Title     = Catalog.GetString("Task List");
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;

            Gtk.CellRendererToggle toggleCr = new CellRendererToggle();
            toggleCr.Toggled += OnTaskListToggled;
            column.PackStart(toggleCr, false);
            column.SetCellDataFunc(toggleCr,
                                   new Gtk.TreeCellDataFunc(ToggleCellDataFunc));

            Gtk.CellRendererText textCr = new CellRendererText();
            column.PackStart(textCr, true);
            column.SetCellDataFunc(textCr,
                                   new Gtk.TreeCellDataFunc(TextCellDataFunc));

            taskListsTree.AppendColumn(column);

            taskListsTree.Show();
            sw.Add(taskListsTree);
            sw.Show();
            innerSectionVBox.PackStart(sw, true, true, 0);
            innerSectionVBox.Show();

            sectionHBox.PackStart(innerSectionVBox, true, true, 0);
            sectionHBox.Show();
            sectionVBox.PackStart(sectionHBox, true, true, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, true, true, 0);

            return(vbox);
        }
		void AddSingleOptionCheckbox (string label, List<TargetFramework> targetFrameworks)
		{
			var alignment = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) { LeftPadding = 18 };
			var check = new CheckButton (label);

			foreach (var fx in targetFrameworks) {
				if (fx.Id.Equals (project.TargetFramework.Id)) {
					check.Active = true;
					break;
				}
			}

			check.Toggled += (sender, e) => {
				TargetFrameworkChanged (check, targetFrameworks);
			};

			checkboxes.Add (check, targetFrameworks);

			check.Show ();
			alignment.Add (check);
			alignment.Show ();

			vbox1.PackStart (alignment, false, false, 0);
		}
		void AddMultiOptionCombo (SortedDictionary<string, List<TargetFramework>> options)
		{
			var alignment = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) { LeftPadding = 18 };
			var model = new ListStore (new Type[] { typeof (string), typeof (object) });
			var renderer = new CellRendererText ();
			var combo = new ComboBox (model);
			var check = new CheckButton ();
			List<TargetFramework> targets;
			var hbox = new HBox ();
			int current = 0;
			int active = -1;
			string label;

			foreach (var kvp in options) {
				label = kvp.Key;

				if (current + 1 < options.Count)
					label += " or later";

				targets = kvp.Value;
				if (active == -1) {
					foreach (var target in targets) {
						if (target.Id.Equals (project.TargetFramework.Id)) {
							active = current;
							break;
						}
					}
				}

				model.AppendValues (label, targets);
				current++;
			}

			combo.PackStart (renderer, true);
			combo.AddAttribute (renderer, "text", 0);

			check.Show ();
			combo.Show ();

			if (active != -1) {
				combo.Active = active;
				check.Active = true;
			} else {
				check.Active = false;
				combo.Active = 0;
			}

			combo.Changed += (sender, e) => {
				if (check.Active)
					TargetFrameworkChanged (check, combo);
			};
			check.Toggled += (sender, e) => {
				TargetFrameworkChanged (check, combo);
			};

			comboboxes.Add (check, combo);

			hbox.PackStart (check, false, false, 0);
			hbox.PackStart (combo, false, true, 0);
			hbox.Show ();

			alignment.Add (hbox);
			alignment.Show ();

			vbox1.PackStart (alignment, false, false, 0);
		}
        public VideoPreferencesPanel()
        {
            this.Build ();

            if (App.Current.Config.FPS_N == 30) {
                fpscombobox.Active = 1;
            } else if (App.Current.Config.FPS_N == 50) {
                fpscombobox.Active = 2;
            } else if (App.Current.Config.FPS_N == 60) {
                fpscombobox.Active = 3;
            } else {
                fpscombobox.Active = 0;
            }
            fpscombobox.Changed += HandleFPSChanged;
            Misc.FillImageFormat (renderimagecombo, VideoStandards.Rendering, App.Current.Config.RenderVideoStandard);
            Misc.FillEncodingFormat (renderenccombo, App.Current.Config.RenderEncodingProfile);
            Misc.FillQuality (renderqualcombo, App.Current.Config.RenderEncodingQuality);

            Misc.FillImageFormat (captureimagecombo, VideoStandards.Capture, App.Current.Config.CaptureVideoStandard);
            Misc.FillEncodingFormat (captureenccombo, App.Current.Config.CaptureEncodingProfile);
            Misc.FillQuality (capturequalcombo, App.Current.Config.CaptureEncodingQuality);

            renderimagecombo.Changed += HandleImageChanged;
            captureimagecombo.Changed += HandleImageChanged;

            renderenccombo.Changed += HandleEncodingChanged;
            captureenccombo.Changed += HandleEncodingChanged;

            renderqualcombo.Changed += HandleQualityChanged;
            capturequalcombo.Changed += HandleQualityChanged;

            enableSound = new CheckButton ();
            rendertable.Attach (enableSound, 1, 2, 3, 4,
                AttachOptions.Fill,
                AttachOptions.Fill, 0, 0);
            enableSound.CanFocus = false;
            enableSound.Show ();
            enableSound.Active = App.Current.Config.EnableAudio;
            enableSound.Toggled += (sender, e) => {
                App.Current.Config.EnableAudio = enableSound.Active;
            };

            overlayTitle = new CheckButton ();
            rendertable.Attach (overlayTitle, 1, 2, 4, 5,
                AttachOptions.Fill,
                AttachOptions.Fill, 0, 0);
            overlayTitle.CanFocus = false;
            overlayTitle.Show ();
            overlayTitle.Active = App.Current.Config.OverlayTitle;
            overlayTitle.Toggled += (sender, e) => {
                App.Current.Config.OverlayTitle = overlayTitle.Active;
            };

            SizeGroup sgroup = new SizeGroup (SizeGroupMode.Horizontal);
            SizeGroup sgroup2 = new SizeGroup (SizeGroupMode.Horizontal);
            foreach (Widget w in generaltable) {
                if (w is Label) {
                    sgroup.AddWidget (w);
                } else {
                    sgroup2.AddWidget (w);
                }
            }
            foreach (Widget w in capturetable) {
                if (w is Label) {
                    sgroup.AddWidget (w);
                } else {
                    sgroup2.AddWidget (w);
                }
            }
            foreach (Widget w in rendertable) {
                if (w is Label) {
                    sgroup.AddWidget (w);
                } else {
                    sgroup2.AddWidget (w);
                }
            }
        }
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultHeight = 350;
			DefaultWidth = 500;
			VBox.Spacing = 0;

			VBox.PackStart (CreateExceptionHeader (), false, true, 0);

			var vbox = new VBox (false, 0);

			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (CreateExceptionValueTreeView (), true, true, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (CreateStackTraceTreeView (), true, true, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.Show ();

			VBox.PackStart (vbox, true, true, 0);

			var actionArea = new HBox (false, 12) { BorderWidth = 6 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.Show ();

			VBox.PackStart (actionArea, false, true, 0);
			ActionArea.Hide ();
		}
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultWidth = 500;
			DefaultHeight = 500;
			HeightRequest = 350;
			WidthRequest = 350;
			VBox.Foreach (VBox.Remove);
			VBox.PackStart (CreateExceptionHeader (), false, true, 0);
			paned = new VPanedThin ();
			paned.GrabAreaSize = 10;
			paned.Pack1 (CreateStackTraceTreeView (), true, false);
			paned.Pack2 (CreateExceptionValueTreeView (), true, false);
			paned.Show ();
			var vbox = new VBox (false, 0);
			var whiteBackground = new EventBox ();
			whiteBackground.Show ();
			whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
			whiteBackground.Add (vbox);
			hadInnerException = HasInnerException ();
			if (hadInnerException) {
				vbox.PackStart (new VBox (), false, false, 6);
				vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
				vbox.ShowAll ();
			}
			vbox.PackStart (paned, true, true, 0);
			vbox.Show ();

			if (hadInnerException) {
				var box = new HBox ();
				box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
				box.PackStart (whiteBackground, true, true, 0);
				box.Show ();
				VBox.PackStart (box, true, true, 0);
				DefaultWidth = 900;
				DefaultHeight = 700;
				WidthRequest = 550;
				HeightRequest = 450;
			} else {
				VBox.PackStart (whiteBackground, true, true, 0);
			}
			var actionArea = new HBox (false, 0) { BorderWidth = 14 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();
			OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
			actionArea.ShowAll ();

			VBox.PackStart (actionArea, false, true, 0);
		}
Example #20
0
        private HBox BuildMatchHeader ()
        {
            HBox header = new HBox ();
            header.Show ();

            terms_enabled_checkbox = new CheckButton (Catalog.GetString ("_Match"));
            terms_enabled_checkbox.Show ();
            terms_enabled_checkbox.Active = true;
            terms_enabled_checkbox.Toggled += OnMatchCheckBoxToggled;
            header.PackStart (terms_enabled_checkbox, false, false, 0);

            terms_logic_combo = ComboBox.NewText ();
            terms_logic_combo.AppendText (Catalog.GetString ("all"));
            terms_logic_combo.AppendText (Catalog.GetString ("any"));
            terms_logic_combo.Show ();
            terms_logic_combo.Active = 0;
            header.PackStart (terms_logic_combo, false, false, 0);

            terms_label = new Label (Catalog.GetString ("of the following:"));
            terms_label.Show ();
            terms_label.Xalign = 0.0f;
            header.PackStart (terms_label, true, true, 0);

            header.Spacing = 5;

            return header;
        }
Example #21
0
		public void HandleOpenWith (object sender, ApplicationActivatedEventArgs e)
		{
			GLib.AppInfo application = e.AppInfo;
			Photo[] selected = SelectedPhotos ();

			if (selected == null || selected.Length < 1)
				return;

			string header = Catalog.GetPluralString ("Create New Version?", "Create New Versions?", selected.Length);
			string msg = String.Format (Catalog.GetPluralString (
				             "Before launching {1}, should F-Spot create a new version of the selected photo to preserve the original?",
				             "Before launching {1}, should F-Spot create new versions of the selected photos to preserve the originals?", selected.Length),
				             selected.Length, application.Name);

			// FIXME add cancel button? add help button?
			HigMessageDialog hmd = new HigMessageDialog (GetToplevel (sender), DialogFlags.DestroyWithParent,
				                       MessageType.Question, Gtk.ButtonsType.None,
				                       header, msg);

			hmd.AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
			//hmd.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			hmd.AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);

			bool support_xcf = false;
			;
			if (application.Id == "gimp.desktop")
				foreach (PixbufFormat format in Gdk.Pixbuf.Formats.Where(format => format.Name == "xcf"))
					support_xcf = true;

			//This allows creating a version with a .xcf extension.
			//There's no need to convert the file to xcf file format, gimp will take care of this
			if (support_xcf) {
				CheckButton cb = new CheckButton (Catalog.GetString ("XCF version"));
				cb.Active = Preferences.Get<bool> (Preferences.EDIT_CREATE_XCF_VERSION);
				hmd.VBox.Add (cb);
				cb.Toggled += (s, ea) => Preferences.Set (Preferences.EDIT_CREATE_XCF_VERSION, (s as CheckButton).Active);
				cb.Show ();
			}

			Gtk.ResponseType response = Gtk.ResponseType.Cancel;

			try {
				response = (Gtk.ResponseType)hmd.Run ();
			} finally {
				hmd.Destroy ();
			}

			bool create_xcf = false;
			if (support_xcf)
				create_xcf = Preferences.Get<bool> (Preferences.EDIT_CREATE_XCF_VERSION);

			Log.DebugFormat ("XCF ? {0}", create_xcf);

			if (response == Gtk.ResponseType.Cancel)
				return;

			bool create_new_versions = (response == Gtk.ResponseType.Yes);

			List<EditException> errors = new List<EditException> ();
			GLib.List uri_list = new GLib.List (typeof(string));
			foreach (Photo photo in selected) {
				try {
					if (create_new_versions) {
						uint version = photo.CreateNamedVersion (application.Name, create_xcf ? ".xcf" : null, photo.DefaultVersionId, true);
						photo.DefaultVersionId = version;
					}
				} catch (Exception ex) {
					errors.Add (new EditException (photo, ex));
				}

				uri_list.Append (photo.DefaultVersion.Uri.ToString ());
			}

			// FIXME need to clean up the error dialog here.
			if (errors.Count > 0) {
				Dialog md = new EditExceptionDialog (GetToplevel (sender), errors.ToArray ());
				md.Run ();
				md.Destroy ();
			}

			if (create_new_versions)
				Database.Photos.Commit (selected);

			try {
				application.LaunchUris (uri_list, null);
			} catch (Exception) {
				Log.ErrorFormat ("Failed to lauch {0}", application.Name);
			}
		}
Example #22
0
        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox (false, 6);
            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox sectionVBox = new VBox (false, 4);
            Label l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            backendComboBox = ComboBox.NewText ();
            backendComboMap = new Dictionary<int, string> ();
            // Fill out the ComboBox
            int i = 0;
            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends) {
                backendComboBox.AppendText (backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                    selectedBackend = i;
                i++;
            }
            if (selectedBackend >= 0)
                backendComboBox.Active = selectedBackend;
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show ();

            HBox hbox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            hbox.PackStart (l, false, false, 0);
            hbox.PackStart (backendComboBox, false, false, 0);
            hbox.Show ();
            sectionVBox.PackStart (hbox, false, false, 0);
            sectionVBox.Show ();
            vbox.PackStart (sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox (false, 4);
            l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            HBox sectionHBox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            sectionHBox.PackStart (l, false, false, 0);
            VBox innerSectionVBox = new VBox (false, 6);
            hbox = new HBox (false, 6);

            bool showCompletedTasks = application.Preferences.GetBool (
                PreferencesKeys.ShowCompletedTasksKey);
            showCompletedTasksCheckButton =
                new CheckButton (Catalog.GetString ("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active = showCompletedTasks;
            showCompletedTasksCheckButton.Show ();
            hbox.PackStart (showCompletedTasksCheckButton, true, true, 0);
            hbox.Show ();
            innerSectionVBox.PackStart (hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label (Catalog.GetString ("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign = 0;
            l.Show ();
            innerSectionVBox.PackStart (l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType = ShadowType.EtchedIn;

            taskListsTree = new TreeView ();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
            column.Title = Catalog.GetString ("Task List");
            column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;

            Gtk.CellRendererToggle toggleCr = new CellRendererToggle ();
            toggleCr.Toggled += OnTaskListToggled;
            column.PackStart (toggleCr, false);
            column.SetCellDataFunc (toggleCr,
                        new Gtk.TreeCellDataFunc (ToggleCellDataFunc));

            Gtk.CellRendererText textCr = new CellRendererText ();
            column.PackStart (textCr, true);
            column.SetCellDataFunc (textCr,
                        new Gtk.TreeCellDataFunc (TextCellDataFunc));

            taskListsTree.AppendColumn (column);

            taskListsTree.Show ();
            sw.Add (taskListsTree);
            sw.Show ();
            innerSectionVBox.PackStart (sw, true, true, 0);
            innerSectionVBox.Show ();

            sectionHBox.PackStart (innerSectionVBox, true, true, 0);
            sectionHBox.Show ();
            sectionVBox.PackStart (sectionHBox, true, true, 0);
            sectionVBox.Show ();
            vbox.PackStart (sectionVBox, true, true, 0);

            return vbox;
        }
Example #23
0
		static Gtk.CheckButton MakeCheckButton (string label_text)
		{
			Gtk.Label label = MakeLabel (label_text);

			Gtk.CheckButton check = new Gtk.CheckButton ();
			check.Add (label);
			check.Show ();

			return check;
		}
        private HBox BuildLimitFooter()
        {
            HBox limitFooter = new HBox();
            limitFooter.Show();
            limitFooter.Spacing = 5;

            limitCheckBox = new CheckButton("Limit to");
            limitCheckBox.Show();
            limitCheckBox.Toggled += OnLimitCheckBoxToggled;
            limitFooter.PackStart(limitCheckBox, false, false, 0);

            limitEntry = new Entry("25");
            limitEntry.Show();
            limitEntry.SetSizeRequest(50, -1);
            limitFooter.PackStart(limitEntry, false, false, 0);

            limitComboBox = ComboBox.NewText();
            limitComboBox.Show();
            foreach(string criteria in model.LimitCriteria)
                limitComboBox.AppendText(criteria);
            limitComboBox.Active = 0;
            limitFooter.PackStart(limitComboBox, false, false, 0);

            Label orderLabel = new Label("selected by");
            orderLabel.Show();
            limitFooter.PackStart(orderLabel, false, false, 0);

            orderComboBox = ComboBox.NewText();
            orderComboBox.Show();
            foreach(string order in model.OrderCriteria)
                orderComboBox.AppendText(order);
            orderComboBox.Active = 0;
            limitFooter.PackStart(orderComboBox, false, false, 0);

            limitCheckBox.Active = false;
            OnLimitCheckBoxToggled(limitCheckBox, null);

            return limitFooter;
        }
        private Widget BuildCheck(PipelineVariable variable)
        {
            CheckButton check = new CheckButton(variable.Name);

            check.Toggled += delegate {
                variable.CurrentValue = Convert.ToString(check.Active ? 1 : 0);

                for(int i = 0; i < variable.Enables.Length; i++) {
                   if(variable_widgets.ContainsKey(variable.Enables[i])) {
                       variable_widgets[variable.Enables[i]].Visible = check.Active;
                       variable_widgets[".label." + variable.Enables[i]].Visible = check.Active;
                   }
                }

                for(int i = 0; i < variable.Disables.Length; i++) {
                   if(variable_widgets.ContainsKey(variable.Disables[i])) {
                       variable_widgets[variable.Disables[i]].Visible = !check.Active;
                       variable_widgets[".label." + variable.Disables[i]].Visible = !check.Active;
                   }
                }
            };

            check.Active = ((int)variable.CurrentValueNumeric.Value) != 0;
            check.Show();
            return check;
        }
Example #26
0
		void ShowDirectoryPathUI ()
		{
			if (labelPath != null)
				return;
			
			// We want to add the Path combo box right below the Scope 
			uint row = TableGetRowForItem (tableFindAndReplace, labelScope) + 1;
			
			// DirectoryScope
			labelPath = new Label {
				LabelProp = GettextCatalog.GetString ("_Path:"),
				UseUnderline = true, 
				Xalign = 0f
			};
			labelPath.Show ();
			
			hboxPath = new HBox ();
			comboboxentryPath = new ComboBoxEntry ();
			comboboxentryPath.Destroyed += ComboboxentryPathDestroyed;
			LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath);
			comboboxentryPath.Show ();
			hboxPath.PackStart (comboboxentryPath);
			
			labelPath.MnemonicWidget = comboboxentryPath;
			
			buttonBrowsePaths = new Button { Label = "..." };
			buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked;
			buttonBrowsePaths.Show ();
			hboxPath.PackStart (buttonBrowsePaths, false, false, 0);
			hboxPath.Show ();
			
			// Add the Directory Path row to the table
			TableAddRow (tableFindAndReplace, row++, labelPath, hboxPath);
			
			// Add a checkbox for searching the directory recursively...
			checkbuttonRecursively = new CheckButton {
				Label = GettextCatalog.GetString ("Re_cursively"),
				Active = properties.Get ("SearchPathRecursively", true),
				UseUnderline = true
			};
			
			checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed;
			checkbuttonRecursively.Show ();
			
			TableAddRow (tableFindAndReplace, row, null, checkbuttonRecursively);
		}
Example #27
0
        public ProgressBarSample()
        {
            Gtk.HSeparator  separator;
            Gtk.Table       table;
            Gtk.Button      button;
            Gtk.CheckButton check;
            Gtk.VBox        vbox;

            //Application.Init ();

            /* Allocate memory for the data that is passed to the callbacks*/
            pdata = new ProgressData();
            pdata.activity_mode    = false;
            pdata.window           = new Gtk.Window(Gtk.WindowType.Toplevel);
            pdata.window.Resizable = true;

            pdata.window.DeleteEvent += destroy_progress;
            pdata.window.Title        = "GtkProgressBar";
            pdata.window.BorderWidth  = 0;

            vbox             = new Gtk.VBox(false, 5);
            vbox.BorderWidth = 10;
            pdata.window.Add(vbox);
            vbox.Show();

            /* Create a centering alignment object */
            Gtk.Alignment align = new Gtk.Alignment(1, 1, 0, 0);
            vbox.PackStart(align, false, false, 5);
            align.Show();

            /* Create the GtkProgressBar */
            pdata.pbar      = new Gtk.ProgressBar();
            pdata.pbar.Text = "";
            align.Add(pdata.pbar);
            pdata.pbar.Show();

            /* Add a timer callback to update the value of the progress bar*/
            pdata.timer = GLib.Timeout.Add(10000, new GLib.TimeoutHandler(progress_timeout));


            separator = new Gtk.HSeparator();
            vbox.PackStart(separator, false, false, 0);
            separator.Show();

            /* rows, columns, homogeneous */
            table = new Gtk.Table(2, 3, false);
            vbox.PackStart(table, false, true, 0);
            table.Show();

            /* Add a check button to select displaying of the trough text*/
            check = new Gtk.CheckButton("Query cada 1 minuto");
            table.Attach(check, 0, 1, 0, 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_show_text;
            check.Show();

            /* Add a check button to toggle activity mode */
            check = new Gtk.CheckButton("Activity mode");
            table.Attach(check, 0, 1, 1, 2,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_activity_mode;
            check.Active   = true;
            check.Show();

            /* Add a check button to toggle orientation */
            check = new Gtk.CheckButton("Right to Left");
            table.Attach(check, 0, 1, 2, 3,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_orientation;
            check.Show();

            /* Add a button to exit the program */
            button          = new Gtk.Button("close");
            button.Clicked += button_click;
            vbox.PackStart(button, false, false, 0);

            /* This makes it so the button is the default. */
            button.CanDefault = true;

            /* This grabs this button to be the default button. Simply hitting
             * the "Enter" key will cause this button to activate. */
            button.GrabDefault();
            button.Show();

            pdata.window.ShowAll();

            //Application.Run ();
        }
Example #28
0
        void LoadAddin(AddinDescription addin, List<ConfigurablePlugin> plugins)
        {
            if (addin == null) {
                vbox1.Visible = false;
                return;
            }
            vbox1.Visible = true;
            namelabel.Text = addin.Name;
            desclabel.Text = addin.Description;
            authorlabel.Text = addin.Author;
            filelabel.Text = addin.AddinFile;

            if (plugins != null && plugins.Count > 0) {
                configframe.Visible = true;
                foreach (Widget w in configbox.Children) {
                    configbox.Remove (w);
                    w.Destroy ();
                }
                foreach (ConfigurablePlugin plugin in plugins) {
                    foreach (AttributeAndProperty attrprop in plugin.Properties) {
                        if (attrprop.Property.PropertyType == typeof(Boolean)) {
                            CheckButton button = new CheckButton (attrprop.Attribute.description);
                            button.Active = (bool)attrprop.Property.GetValue (plugin, null);
                            button.Clicked += (sender, e) => {
                                attrprop.Property.SetValue (plugin, button.Active, null);
                            };
                            button.Show ();
                            configbox.PackStart (button, false, true, 0);
                        }
                    }
                }
            } else {
                configframe.Visible = false;
            }
        }
Example #29
0
		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

			accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

			vbox.PackStart (sw, true, true, 0);

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Due Date
			///
			hbox = new HBox (false, 4);
			due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:"));
			if (task.DueDate != DateTime.MinValue)
				due_date_check_button.Active = true;
			due_date_check_button.Toggled += OnDueDateCheckButtonToggled;
			due_date_check_button.Show ();
			hbox.PackStart (due_date_check_button, false, false, 0);

			due_date_button =
			        new Gtk.Extras.DateButton (task.DueDate, false);
			if (task.DueDate == DateTime.MinValue)
				due_date_button.Sensitive = false;
			due_date_button.Show ();
			hbox.PackStart (due_date_button, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Priority
			///
			hbox = new HBox (false, 4);
			priority_check_button = new CheckButton (Catalog.GetString ("Priority:"));
			if (task.Priority != TaskPriority.Undefined)
				priority_check_button.Active = true;
			priority_check_button.Toggled += OnPriorityCheckButtonToggled;
			priority_check_button.Show ();
			hbox.PackStart (priority_check_button, false, false, 0);

			priority_combo_box = ComboBox.NewText ();
			priority_combo_box.AppendText (Catalog.GetString ("None"));
			priority_combo_box.AppendText (Catalog.GetString ("Low"));
			priority_combo_box.AppendText (Catalog.GetString ("Normal"));
			priority_combo_box.AppendText (Catalog.GetString ("High"));
			if (task.Priority == TaskPriority.Undefined)
				priority_combo_box.Sensitive = false;
			priority_combo_box.Active = (int) task.Priority;
			priority_combo_box.Changed += OnPriorityComboBoxChanged;
			priority_combo_box.Show ();
			hbox.PackStart (priority_combo_box, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);
			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true);

//   if (parent != null)
//    TransientFor = parent;

//   if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
//    Modal = true;

//   if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
//    DestroyWithParent = true;
		}