[Monodevelop-patches-list] r725 - trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Jan 30 16:55:07 EST 2004
Author: dkor
Date: 2004-01-30 16:55:07 -0500 (Fri, 30 Jan 2004)
New Revision: 725
Modified:
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs
Log:
Clean up and beautification folowing the CodeGenerationPanel.cs style
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs 2004-01-30 16:04:53 UTC (rev 724)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs 2004-01-30 21:55:07 UTC (rev 725)
@@ -24,62 +24,64 @@
{
public class SelectStylePanel : AbstractOptionPanel
{
+ PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
+ SelectStylePanelWidget widget;
+ const string selectStyleProperty = "SharpDevelop.UI.SelectStyleOptions";
+
+ public override void LoadPanelContents()
+ {
+ IProperties p = (IProperties) PropertyService.GetProperty (selectStyleProperty, new DefaultProperties ());
+ Add (widget = new SelectStylePanelWidget (p));
+ }
- //FIXME: Hashtables are wrong here.
- //FIXME: Yes, this is a dirty hack.
- //FIXME: Lets use something else.
- Hashtable MenuToValue = new Hashtable ();
- Hashtable ValueToMenu = new Hashtable ();
+ public override bool StorePanelContents()
+ {
+ IProperties p = (IProperties) PropertyService.GetProperty (selectStyleProperty, new DefaultProperties ());
+ widget.Store (p);
+ PropertyService.SetProperty(selectStyleProperty, p);
+ return true;
+ }
- PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
+ class SelectStylePanelWidget : GladeWidgetExtract
+ {
-
- class SelectStylePanelWidget : GladeWidgetExtract {
+ //FIXME: Hashtables are wrong here.
+ //FIXME: Yes, this is a dirty hack.
+ //FIXME: Lets use something else.
+ Hashtable MenuToValue = new Hashtable ();
+ Hashtable ValueToMenu = new Hashtable ();
public Gtk.Menu ambienceMenu;
[Glade.Widget] public Gtk.CheckButton extensionButton;
[Glade.Widget] public Gtk.OptionMenu option;
- public SelectStylePanelWidget () : base ("Base.glade", "SelectStylePanel")
+ public SelectStylePanelWidget (IProperties p) : base ("Base.glade", "SelectStylePanel")
{
ambienceMenu = new Gtk.Menu ();
option.Menu = ambienceMenu;
- }
- }
-
- public SelectStylePanel () : base ()
- {
- }
-
- SelectStylePanelWidget widget;
-
- public override void LoadPanelContents()
- {
- Add (widget = new SelectStylePanelWidget ());
-
- widget.extensionButton.Active = PropertyService.GetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", true);
-
- IAddInTreeNode treeNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences");
- string active = PropertyService.GetProperty ("SharpDevelop.UI.CurrentAmbience", "CSharp");
-
- //FIXME: Yes, I know for is better here
- uint im = 0;
- foreach (IAddInTreeNode childNode in treeNode.ChildNodes.Values) {
- Gtk.MenuItem i = Gtk.MenuItem.NewWithLabel (childNode.Codon.ID);
- widget.ambienceMenu.Append(i);
+ extensionButton.Active = p.GetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", true);
+ IAddInTreeNode treeNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences");
+ string active = p.GetProperty ("SharpDevelop.UI.CurrentAmbience", "CSharp");
+
+ //FIXME: Yes, I know for is better here
+ uint im = 0;
+ foreach (IAddInTreeNode childNode in treeNode.ChildNodes.Values)
+ {
+ Gtk.MenuItem i = Gtk.MenuItem.NewWithLabel (childNode.Codon.ID);
+ ambienceMenu.Append(i);
MenuToValue[i] = childNode.Codon.ID;
if (childNode.Codon.ID == active) {
- widget.option.SetHistory (im);
+ option.SetHistory (im);
}
im++;
- }
+ }
+
+ }
+ public void Store(IProperties p)
+ {
+ p.SetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", extensionButton.Active);
+ p.SetProperty("SharpDevelop.UI.CurrentAmbience", (string)MenuToValue[ambienceMenu.Active]);
+ }
}
-
- public override bool StorePanelContents()
- {
- PropertyService.SetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", widget.extensionButton.Active);
- PropertyService.SetProperty("SharpDevelop.UI.CurrentAmbience", (string)MenuToValue[widget.ambienceMenu.Active]);
- return true;
- }
}
}
More information about the Monodevelop-patches-list
mailing list