[Monodevelop-patches-list] r547 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 18 15:03:11 EST 2004


Author: benm
Date: 2004-01-18 15:03:11 -0500 (Sun, 18 Jan 2004)
New Revision: 547

Modified:
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.cs
Log:
gladify

Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-18 19:53:09 UTC (rev 546)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-18 20:03:11 UTC (rev 547)
@@ -882,4 +882,292 @@
   </child>
 </widget>
 
+<widget class="GtkWindow" id="CodeGenerationOptionsPanel">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">window1</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="vbox8">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">12</property>
+
+      <child>
+	<widget class="GtkVBox" id="vbox9">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="hdr_code_generation_options">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Code generation options&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox6">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label16">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">    </property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox11">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_blk_on_same_line">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Start code block on the same line</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_else_on_same_line">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Else on same line as closing bracket</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_blank_lines">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Insert blank lines between members</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_full_type_names">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Use full type names</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox10">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="hdr_comment_generation_options">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Comment generation options&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox7">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label15">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">    </property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox12">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_doc_comments">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Generate _documentation comments</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="chk_other_comments">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Generate _additional comments</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.cs	2004-01-18 19:53:09 UTC (rev 546)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.cs	2004-01-18 20:03:11 UTC (rev 547)
@@ -18,87 +18,94 @@
 using ICSharpCode.Core.AddIns;
 
 using Gtk;
+using MonoDevelop.Gui;
 
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels
-{
-	public class CodeGenerationPanel : AbstractOptionPanel
-	{
-		// Gtk Controls
-		CheckButton generateAdditonalCommentsCheckBox;
-		CheckButton generateDocCommentsCheckBox;
-		CheckButton useFullTypeNamesCheckBox; 
-		CheckButton blankLinesBetweenMemberCheckBox;
-		CheckButton elseOnClosingCheckBox;
-		CheckButton startBlockOnTheSameLineCheckBox; 
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels {
+	public class CodeGenerationPanel : AbstractOptionPanel {
 		
-		// Services
-		StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
-		PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
-		static readonly string codeGenerationProperty = "SharpDevelop.UI.CodeGenerationOptions";
-		
-		public override void LoadPanelContents()
-		{
-			// set up the form controls instance
-			SetupPanelInstance();
+		class CodeGenerationPanelWidget : GladeWidgetExtract {
+			StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
 			
-			IProperties p = (IProperties)PropertyService.GetProperty(codeGenerationProperty, new DefaultProperties());
+			[Glade.Widget] Label hdr_code_generation_options;
 			
-			generateAdditonalCommentsCheckBox.Active = p.GetProperty("GenerateAdditionalComments", true);
-			generateDocCommentsCheckBox.Active       = p.GetProperty("GenerateDocumentComments", true);
-			useFullTypeNamesCheckBox.Active          = p.GetProperty("UseFullyQualifiedNames", true);
+			[Glade.Widget] CheckButton
+				chk_blk_on_same_line,
+				chk_else_on_same_line,
+				chk_blank_lines,
+				chk_full_type_names;
 			
-			blankLinesBetweenMemberCheckBox.Active   = p.GetProperty("BlankLinesBetweenMembers", true);
-			elseOnClosingCheckBox.Active             = p.GetProperty("ElseOnClosing", true);
-			startBlockOnTheSameLineCheckBox.Active   = p.GetProperty("StartBlockOnSameLine", true);
+			[Glade.Widget] Label hdr_comment_generation_options;
+			
+			[Glade.Widget] CheckButton
+				chk_doc_comments,
+				chk_other_comments;
+			
+			public CodeGenerationPanelWidget (IProperties p) : base ("Base.glade", "CodeGenerationOptionsPanel")
+			{
+				i18nizeHeader (hdr_code_generation_options, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.CodeGenerationOptionsGroupBox}");
+				i18nizeHeader (hdr_comment_generation_options, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.CommentGenerationOptionsGroupBox}");
+				
+				i18nize (chk_blk_on_same_line, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.StartBlockOnTheSameLineCheckBox}");
+				i18nize (chk_else_on_same_line, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.ElseOnClosingCheckBox}");
+				i18nize (chk_blank_lines, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.BlankLinesBetweenMembersCheckBox}");
+				i18nize (chk_full_type_names, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.UseFullTypeNamesCheckBox}");
+				
+				i18nize (chk_doc_comments, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.GenerateDocCommentsCheckBox}");
+				i18nize (chk_other_comments, "${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.GenerateAdditionalCommentsCheckBox}");
+				
+				chk_blk_on_same_line.Active   = p.GetProperty("StartBlockOnSameLine", true);
+				chk_else_on_same_line.Active  = p.GetProperty("ElseOnClosing", true);
+				chk_blank_lines.Active        = p.GetProperty("BlankLinesBetweenMembers", true);
+				chk_full_type_names.Active    = p.GetProperty("UseFullyQualifiedNames", true);
+			
+				chk_doc_comments.Active       = p.GetProperty("GenerateDocumentComments", true);
+				chk_other_comments.Active     = p.GetProperty("GenerateAdditionalComments", true);
+			}
+			
+			public void Store (IProperties p)
+			{
+				p.SetProperty ("StartBlockOnSameLine",       chk_blk_on_same_line.Active);
+				p.SetProperty ("ElseOnClosing",              chk_else_on_same_line.Active);
+				p.SetProperty ("BlankLinesBetweenMembers",   chk_blank_lines.Active);
+				p.SetProperty ("UseFullyQualifiedNames",     chk_full_type_names.Active);
+				
+				p.SetProperty ("GenerateDocumentComments",   chk_doc_comments.Active);
+				p.SetProperty ("GenerateAdditionalComments", chk_other_comments.Active);
+			}
+			
+			void i18nizeHeader (Label l, string key)
+			{
+				// TODO: use the real pango stuff
+				// otherwise, excaping is a problem
+				l.Markup = "<b>" + StringParserService.Parse (key) + "</b>";
+				
+			}
+			
+			void i18nize (CheckButton c, string key)
+			{
+				c.Label = StringParserService.Parse (key);
+			}
 		}
 		
-		public override bool StorePanelContents()
+		CodeGenerationPanelWidget widget;
+		
+		PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
+		const string codeGenerationProperty = "SharpDevelop.UI.CodeGenerationOptions";
+		
+		public override void LoadPanelContents ()
 		{
-			IProperties p = (IProperties)PropertyService.GetProperty(codeGenerationProperty, new DefaultProperties());
-			p.SetProperty("GenerateAdditionalComments", generateAdditonalCommentsCheckBox.Active);
-			p.SetProperty("GenerateDocumentComments",   generateDocCommentsCheckBox.Active);
-			p.SetProperty("UseFullyQualifiedNames",     useFullTypeNamesCheckBox.Active);
-			p.SetProperty("BlankLinesBetweenMembers",   blankLinesBetweenMemberCheckBox.Active);
-			p.SetProperty("ElseOnClosing",              elseOnClosingCheckBox.Active);
-			p.SetProperty("StartBlockOnSameLine",       startBlockOnTheSameLineCheckBox.Active);
-			PropertyService.SetProperty(codeGenerationProperty, p);
-			return true;
+			IProperties p = (IProperties) PropertyService.GetProperty (codeGenerationProperty, new DefaultProperties ());
+			Add (widget = new CodeGenerationPanelWidget (p));
 		}
 		
-		private void SetupPanelInstance()
+		public override bool StorePanelContents ()
 		{
-			// instantiate all the controls in the first group
-			Gtk.Frame frame1 = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.CodeGenerationOptionsGroupBox}"));
-			Gtk.VBox vBox1 = new Gtk.VBox(false,2);			
-			useFullTypeNamesCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.UseFullTypeNamesCheckBox}")); 
-			blankLinesBetweenMemberCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.BlankLinesBetweenMembersCheckBox}"));
-			elseOnClosingCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.ElseOnClosingCheckBox}"));
-			startBlockOnTheSameLineCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.StartBlockOnTheSameLineCheckBox}")); 
+			IProperties p = (IProperties) PropertyService.GetProperty (codeGenerationProperty, new DefaultProperties ());
 			
-			// pack all controls in first group
-			vBox1.PackStart(startBlockOnTheSameLineCheckBox, false, false, 2);
-			vBox1.PackStart(elseOnClosingCheckBox, false, false, 2);
-			vBox1.PackStart(blankLinesBetweenMemberCheckBox, false, false, 2);
-			vBox1.PackStart(useFullTypeNamesCheckBox, false, false, 2);
-			frame1.Add(vBox1);
+			widget.Store (p);
 			
-			// instantiate all the controls in the second group
-			Gtk.Frame frame2 = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.CommentGenerationOptionsGroupBox}"));
-			Gtk.VBox vBox2 = new Gtk.VBox(false,2);			
-			generateAdditonalCommentsCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.GenerateAdditionalCommentsCheckBox}"));
-			generateDocCommentsCheckBox = CheckButton.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.CodeGenerationOptionsPanel.GenerateDocCommentsCheckBox}"));
-			
-			// pack all controls in second group
-			vBox2.PackStart(generateDocCommentsCheckBox, false, false, 2);
-			vBox2.PackStart(generateAdditonalCommentsCheckBox, false, false, 2);
-			frame2.Add(vBox2);
-			
-			// pack all the groups
-			Gtk.VBox mainBox = new Gtk.VBox(false,2);
-			mainBox.PackStart(frame1, false, false, 2);
-			mainBox.PackStart(frame2, false, false, 2);
-			this.Add(mainBox);
+			PropertyService.SetProperty(codeGenerationProperty, p);
+			return true;
 		}
-
 	}
 }




More information about the Monodevelop-patches-list mailing list