[Monodevelop-patches-list] r713 - 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
Thu Jan 29 12:11:40 EST 2004
Author: dkor
Date: 2004-01-29 12:11:40 -0500 (Thu, 29 Jan 2004)
New Revision: 713
Modified:
trunk/MonoDevelop/data/resources/glade/Base.glade
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs
Log:
The Load/Save option panel was Gladed and redesigned to comply with UI Gnome Guideles
Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade 2004-01-29 16:37:46 UTC (rev 712)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade 2004-01-29 17:11:40 UTC (rev 713)
@@ -1254,4 +1254,406 @@
</child>
</widget>
+<widget class="GtkWindow" id="SelectStylePanel">
+ <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="vbox13">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="extensionButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show Extensions in project scout</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="GtkOptionMenu" id="option">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="history">-1</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkWindow" id="LoadSavePanel">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">LoadSavePanel</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="vbox17">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox18">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="load">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Load</b>-</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="hbox14">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label25">
+ <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="GtkHBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="loadUserDataCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Load user-specific settings with the document-</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>
+
+ <child>
+ <widget class="GtkVBox" id="vbox19">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="save">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Save</b>-</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="hbox11">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label21">
+ <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="vbox20">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="createBackupCopyCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Allways create backup copy-</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="GtkLabel" id="terminator">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Line Terminator Style-</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="hbox12">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox13">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label24">
+ <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="vbox21">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkRadioButton" id="windowsRadioButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Windows-</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="GtkRadioButton" id="macintoshRadioButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Macintosh-</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>
+ <property name="group">windowsRadioButton</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="unixRadioButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Unix-</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>
+ <property name="group">windowsRadioButton</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">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">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/LoadSavePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs 2004-01-29 16:37:46 UTC (rev 712)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs 2004-01-29 17:11:40 UTC (rev 713)
@@ -8,12 +8,14 @@
using System;
using System.IO;
using System.Collections;
-//using System.Windows.Forms;
-using Gtk;
+
using ICSharpCode.SharpDevelop.Gui.Dialogs;
using ICSharpCode.Core.Services;
using ICSharpCode.Core.AddIns.Codons;
+using Gtk;
+using MonoDevelop.Gui.Widgets;
+
namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels
{
public enum LineTerminatorStyle {
@@ -27,63 +29,70 @@
/// </summary>
public class LoadSavePanel : AbstractOptionPanel
{
- //FIXME: Hashtables are wrong here.
- //FIXME: Yes, this is a dirty hack.
- //FIXME: Lets use something else.
- Hashtable MenuToValue = new Hashtable ();
+ class LoadSavePanelWidget : GladeWidgetExtract
+ {
+
+ //
+ // Gtk controls
+ //
+
+ [Glade.Widget] public Gtk.CheckButton loadUserDataCheckBox;
+ [Glade.Widget] public Gtk.CheckButton createBackupCopyCheckBox;
+ [Glade.Widget] public Gtk.RadioButton windowsRadioButton, macintoshRadioButton, unixRadioButton;
+ [Glade.Widget] public Gtk.Label load, save, terminator;
+
+ public LoadSavePanelWidget () : base ("Base.glade", "LoadSavePanel")
+ {
+
+ }
+ }
- //
- // Gtk controls
- //
- Gtk.CheckButton loadUserDataCheckBox;
- Gtk.CheckButton createBackupCopyCheckBox;
- Gtk.Menu lineTerminatorStyleComboBoxMenu;
- Gtk.OptionMenu lineTerminatorStyleComboBox;
+ public LoadSavePanel () : base ()
+ {
+ }
// services needed
StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
+ LoadSavePanelWidget widget;
+
public override void LoadPanelContents()
{
- SetupPanelInstance();
+ Add (widget = new LoadSavePanelWidget ());
- //
- // load the data
- //
- loadUserDataCheckBox.Active = PropertyService.GetProperty("SharpDevelop.LoadDocumentProperties", true);
- createBackupCopyCheckBox.Active = PropertyService.GetProperty("SharpDevelop.CreateBackupCopy", false);
-
- lineTerminatorStyleComboBoxMenu.Append(
- Gtk.MenuItem.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.WindowsRadioButton}")));
- MenuToValue[0] = StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.WindowsRadioButton}");
+ SetupPanelInstance();
- lineTerminatorStyleComboBoxMenu.Append(
- Gtk.MenuItem.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.MacintoshRadioButton}")));
- MenuToValue[1] = StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.MacintoshRadioButton}");
-
- lineTerminatorStyleComboBoxMenu.Append(
- Gtk.MenuItem.NewWithLabel(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.UnixRadioButton}")));
- MenuToValue[2] = StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.UnixRadioButton}");
-
- //FIXME: need Gtk# fix here for mapping menu item to index
- string selectedItem = Enum.GetName(typeof(LineTerminatorStyle), PropertyService.GetProperty("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix));
- for(int i = 0; i < MenuToValue.Count; i++)
- {
- if(MenuToValue[i].ToString().Equals(selectedItem))
- {
- lineTerminatorStyleComboBox.SetHistory((uint)i);
- break;
- }
- }
-
+ //
+ // load the data
+ //
+ widget.loadUserDataCheckBox.Active = PropertyService.GetProperty ("SharpDevelop.LoadDocumentProperties", true);
+ widget.createBackupCopyCheckBox.Active = PropertyService.GetProperty ("SharpDevelop.CreateBackupCopy", false);
+
+ if (LineTerminatorStyle.Windows.Equals (
+ PropertyService.GetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ widget.windowsRadioButton.Active = true;}
+ else if (LineTerminatorStyle.Macintosh.Equals (
+ PropertyService.GetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ widget.macintoshRadioButton.Active = true;}
+ else if (LineTerminatorStyle.Unix.Equals (
+ PropertyService.GetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ widget.unixRadioButton.Active = true;}
+ // Finish here
+
+
}
public override bool StorePanelContents()
{
- PropertyService.SetProperty("SharpDevelop.LoadDocumentProperties", loadUserDataCheckBox.Active);
- PropertyService.SetProperty("SharpDevelop.CreateBackupCopy", createBackupCopyCheckBox.Active);
- PropertyService.SetProperty("SharpDevelop.LineTerminatorStyle", (LineTerminatorStyle)lineTerminatorStyleComboBox.History);
+ PropertyService.SetProperty ("SharpDevelop.LoadDocumentProperties", widget.loadUserDataCheckBox.Active);
+ PropertyService.SetProperty ("SharpDevelop.CreateBackupCopy", widget.createBackupCopyCheckBox.Active);
+ if (widget.windowsRadioButton.Active) {
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Windows);}
+ else if (widget.macintoshRadioButton.Active) {
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Macintosh);}
+ else if (widget.unixRadioButton.Active){
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix);}
return true;
}
@@ -92,42 +101,31 @@
private void SetupPanelInstance()
{
- //
- // set up the load options
- //
- Gtk.Frame loadContainer = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}"));
- loadUserDataCheckBox = new Gtk.CheckButton (StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}"));
- loadContainer.Add(loadUserDataCheckBox);
-
- //
- // setup the save options
- //
- Gtk.Frame saveContainer = new Gtk.Frame(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}"));
- Gtk.VBox saveVBox = new Gtk.VBox(false, 2);
-
- // the backup checkbox
- createBackupCopyCheckBox = new Gtk.CheckButton (StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}"));
- saveVBox.PackStart(createBackupCopyCheckBox, false, false, 2);
-
- // the terminator label
- Gtk.Label label1 = new Gtk.Label(StringParserService.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.LineTerminatorStyleGroupBox}"));
- saveVBox.PackStart(label1, false, false, 2);
-
- // the terminator menu
- lineTerminatorStyleComboBoxMenu = new Gtk.Menu();
- lineTerminatorStyleComboBox = new Gtk.OptionMenu();
- lineTerminatorStyleComboBox.Menu = lineTerminatorStyleComboBoxMenu;
- saveVBox.PackStart(lineTerminatorStyleComboBox, false, false, 2);
-
- // add the vbox
- saveContainer.Add(saveVBox);
-
- // create the main box
- Gtk.VBox mainBox = new Gtk.VBox(false, 2);
- mainBox.PackStart(loadContainer, false, false, 2);
- mainBox.PackStart(saveContainer, false, false, 2);
-
- this.Add(mainBox);
+ //
+ // set up the load options
+ //
+ widget.load.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}") + " </b>";
+ widget.loadUserDataCheckBox.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}");
+ //
+ // setup the save options
+ //
+ widget.save.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}")+ "</b>";
+ // the backup checkbox
+ widget.createBackupCopyCheckBox.Label =StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}");
+ // the terminator label
+ widget.terminator.TextWithMnemonic = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LineTerminatorStyleGroupBox}");
+ // the terminator radiobutton
+ widget.windowsRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.WindowsRadioButton}");
+ widget.macintoshRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.MacintoshRadioButton}");
+ widget.unixRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.UnixRadioButton}");
}
#endregion
More information about the Monodevelop-patches-list
mailing list