[Monodevelop-patches-list] r1142 - 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 Mar 11 13:44:37 EST 2004
Author: dkor
Date: 2004-03-11 13:44:37 -0500 (Thu, 11 Mar 2004)
New Revision: 1142
Modified:
trunk/MonoDevelop/data/resources/glade/Base.glade
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs
Log:
Partially fixed 53845: moved options from Load/Save to ProjectAndCombinePanel and beatified crappy, ugly, dirty LoadSavePanel code
Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade 2004-03-11 04:21:09 UTC (rev 1141)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade 2004-03-11 18:44:37 UTC (rev 1142)
@@ -1431,13 +1431,75 @@
<property name="spacing">6</property>
<child>
+ <widget class="GtkVBox" id="vbox26">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="locationLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Default _combine location-</property>
+ <property name="use_underline">True</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</property>
+ <property name="yalign">0</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="GnomeFileEntry" id="projectLocationTextBox">
+ <property name="visible">True</property>
+ <property name="max_saved">10</property>
+ <property name="directory_entry">False</property>
+ <property name="modal">False</property>
+
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="combo-entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ </child>
+ </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>
+
+ <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">
+ <widget class="GtkLabel" id="loadLabel">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Load</b>-</property>
<property name="use_underline">False</property>
@@ -1491,15 +1553,46 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="loadUserDataCheckBox">
+ <widget class="GtkVBox" id="vbox65">
<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>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="loadUserDataCheckButton">
+ <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>
+
+ <child>
+ <widget class="GtkCheckButton" id="loadPrevProjectCheckButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Load previous combine on startup-</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>
@@ -1536,7 +1629,7 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="save">
+ <widget class="GtkLabel" id="saveLabel">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Save</b>-</property>
<property name="use_underline">False</property>
@@ -1590,7 +1683,7 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="createBackupCopyCheckBox">
+ <widget class="GtkCheckButton" id="createBackupCopyCheckButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Allways create backup copy-</property>
@@ -1608,7 +1701,7 @@
</child>
<child>
- <widget class="GtkLabel" id="terminator">
+ <widget class="GtkLabel" id="terminatorLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Line Terminator Style-</property>
<property name="use_underline">False</property>
@@ -1760,7 +1853,7 @@
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
@@ -2022,48 +2115,27 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkVBox" id="vbox24">
+ <widget class="GtkVBox" id="vbox27">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="settingsLabel">
+ <widget class="GtkVBox" id="vbox28">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Settings-</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="hbox15">
- <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label26">
+ <widget class="GtkLabel" id="onBuildRequest">
<property name="visible">True</property>
- <property name="label" translatable="yes"> </property>
+ <property name="label" translatable="yes"><b>On build request</b></property>
<property name="use_underline">False</property>
- <property name="use_markup">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.5</property>
+ <property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
@@ -2076,22 +2148,22 @@
</child>
<child>
- <widget class="GtkVBox" id="vbox26">
+ <widget class="GtkHBox" id="hbox43">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="locationLabel">
+ <widget class="GtkLabel" id="label69">
<property name="visible">True</property>
- <property name="label" translatable="yes">Default _combine location-</property>
- <property name="use_underline">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</property>
- <property name="yalign">0</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
@@ -2103,135 +2175,8 @@
</child>
<child>
- <widget class="GnomeFileEntry" id="projectLocationTextBox">
+ <widget class="GtkVBox" id="vbox66">
<property name="visible">True</property>
- <property name="max_saved">10</property>
- <property name="directory_entry">False</property>
- <property name="modal">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="combo-entry1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="loadPrevProjectCheckBox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Load previous combine on startup-</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">False</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="vbox25">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="buildAndRunOptionsLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Build And Run Options-</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="hbox16">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label28">
- <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="vbox27">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox28">
- <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
@@ -2333,57 +2278,57 @@
</widget>
<packing>
<property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="showOutputCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show _task list pad if build finished with errors-</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="showTaskListCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show _output pad when build starts-</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="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
-
- <child>
- <widget class="GtkCheckButton" id="showOutputCheckBox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show _task list pad if build finished with errors-</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="showTaskListCheckBox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show _output pad when build starts-</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="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs 2004-03-11 04:21:09 UTC (rev 1141)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs 2004-03-11 18:44:37 UTC (rev 1142)
@@ -18,132 +18,150 @@
namespace MonoDevelop.Gui.Dialogs.OptionPanels
{
-
- public enum LineTerminatorStyle {
- Windows,
- Macintosh,
- Unix
- }
-
/// <summary>
/// Summary description for Form1.
/// </summary>
+
public class LoadSavePanel : AbstractOptionPanel
{
//FIXME: Add mneumonics for Window, Macintosh and Unix Radio Buttons.
// Remove mneumonic from terminator label.
+ LoadSavePanelWidget widget;
+
+ public override void LoadPanelContents()
+ {
+ Add (widget = new LoadSavePanelWidget ());
+ }
+
+ public override bool StorePanelContents()
+ {
+ bool succes = widget.Store();
+ return succes;
+ }
+
class LoadSavePanelWidget : GladeWidgetExtract
{
-
//
// Gtk controls
//
+ [Glade.Widget] public Gnome.FileEntry projectLocationTextBox;
+ [Glade.Widget] public Gtk.CheckButton loadUserDataCheckButton;
+ [Glade.Widget] public Gtk.CheckButton createBackupCopyCheckButton;
+ [Glade.Widget] public Gtk.CheckButton loadPrevProjectCheckButton;
+ [Glade.Widget] public Gtk.RadioButton windowsRadioButton;
+ [Glade.Widget] public Gtk.RadioButton macintoshRadioButton;
+ [Glade.Widget] public Gtk.RadioButton unixRadioButton;
+ [Glade.Widget] public Gtk.Label loadLabel;
+ [Glade.Widget] public Gtk.Label saveLabel;
+ [Glade.Widget] public Gtk.Label terminatorLabel;
+ [Glade.Widget] public Gtk.Label locationLabel;
- [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;
+ // services needed
+ StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (
+ typeof (StringParserService));
+ PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (
+ typeof (PropertyService));
+ FileUtilityService FileUtilityService = (FileUtilityService)ServiceManager.Services.GetService (
+ typeof (FileUtilityService));
+ MessageService MessageService = (MessageService)ServiceManager.Services.GetService (
+ typeof (MessageService));
+
+ public enum LineTerminatorStyle {
+ Windows,
+ Macintosh,
+ Unix
+ }
public LoadSavePanelWidget () : base ("Base.glade", "LoadSavePanel")
{
+ //
+ // load the internationalized strings.
+ //
+ loadLabel.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}") + " </b>";
+ saveLabel.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}")+ "</b>";
+ loadUserDataCheckButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}");
+ loadPrevProjectCheckButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.LoadPrevProjectCheckBox}");
+ createBackupCopyCheckButton.Label =StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}");
+
+ terminatorLabel.TextWithMnemonic = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.LineTerminatorStyleGroupBox}");
+ windowsRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.WindowsRadioButton}");
+ macintoshRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.MacintoshRadioButton}");
+ unixRadioButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.LoadSaveOptions.UnixRadioButton}");
+
+ projectLocationTextBox.GtkEntry.Text = PropertyService.GetProperty(
+ "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
+ System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
+ "MonoDevelopProjects")).ToString();
+ projectLocationTextBox.DirectoryEntry = true;
+ locationLabel.TextWithMnemonic = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ProjectLocationLabel}");
+ //
+ // setup the properties
+ //
+ loadUserDataCheckButton.Active = PropertyService.GetProperty (
+ "SharpDevelop.LoadDocumentProperties", true);
+ createBackupCopyCheckButton.Active = PropertyService.GetProperty (
+ "SharpDevelop.CreateBackupCopy", false);
+ loadPrevProjectCheckButton.Active = (bool) PropertyService.GetProperty(
+ "SharpDevelop.LoadPrevProjectOnStartup", false);
+
+ if (LineTerminatorStyle.Windows.Equals (
+ PropertyService.GetProperty (
+ "SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ windowsRadioButton.Active = true;}
+ else if (LineTerminatorStyle.Macintosh.Equals (
+ PropertyService.GetProperty
+ ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ macintoshRadioButton.Active = true;}
+ else if (LineTerminatorStyle.Unix.Equals (
+ PropertyService.GetProperty (
+ "SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix))) {
+ unixRadioButton.Active = true;}
+
+ // FIXME: renable all terminator style radio buttons when they're implemented.
+ unixRadioButton.Sensitive = false;
+ macintoshRadioButton.Sensitive = false;
+ windowsRadioButton.Sensitive = false;
+ terminatorLabel.Sensitive = false;
}
+
+ public bool Store ()
+ {
+ PropertyService.SetProperty("SharpDevelop.LoadPrevProjectOnStartup", loadPrevProjectCheckButton.Active);
+ PropertyService.SetProperty ("SharpDevelop.LoadDocumentProperties", loadUserDataCheckButton.Active);
+ PropertyService.SetProperty ("SharpDevelop.CreateBackupCopy", createBackupCopyCheckButton.Active);
+
+ if (windowsRadioButton.Active) {
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Windows);}
+ else if (macintoshRadioButton.Active) {
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Macintosh);}
+ else if (unixRadioButton.Active){
+ PropertyService.SetProperty ("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Unix);}
+
+ // check for correct settings
+ string projectPath = projectLocationTextBox.GtkEntry.Text;
+ if (projectPath.Length > 0) {
+ if (!FileUtilityService.IsValidFileName(projectPath)) {
+ MessageService.ShowError("Invalid project path specified");
+ return false;
+ }
+ }
+ PropertyService.SetProperty("MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", projectPath);
+
+ return true;
+ }
}
-
- public LoadSavePanel () : base ()
- {
- }
-
- public override Gtk.Image Icon {
- get {
- return new Gtk.Image (Gtk.Stock.SaveAs, Gtk.IconSize.Button);
- }
- }
-
- // services needed
- StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
- PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
-
- LoadSavePanelWidget widget;
-
- public override void LoadPanelContents()
- {
- Add (widget = new LoadSavePanelWidget ());
-
- SetupPanelInstance();
-
- //
- // 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
-
- // FIXME: renable all terminatore style radio buttons when they're implemented
- widget.unixRadioButton.Sensitive = false;
- widget.macintoshRadioButton.Sensitive = false;
- widget.windowsRadioButton.Sensitive = false;
- widget.terminator.Sensitive = false;
-
- }
-
- public override bool StorePanelContents()
- {
- 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;
- }
-
- #region jba added methods
-
- private void SetupPanelInstance()
- {
- //
- // 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
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs 2004-03-11 04:21:09 UTC (rev 1141)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs 2004-03-11 18:44:37 UTC (rev 1142)
@@ -29,8 +29,6 @@
// service instances needed
PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
- FileUtilityService FileUtilityService = (FileUtilityService)ServiceManager.Services.GetService (typeof (FileUtilityService));
- MessageService MessageService = (MessageService)ServiceManager.Services.GetService (typeof (MessageService));
ProjectAndCombinePanelWidget widget;
const string projectAndCombineProperty = "SharpDevelop.UI.ProjectAndCombineOptions";
@@ -42,55 +40,35 @@
public override bool StorePanelContents()
{
-
- // check for correct settings
- string projectPath = widget.projectLocationTextBox.GtkEntry.Text;
- if (projectPath.Length > 0) {
- if (!FileUtilityService.IsValidFileName(projectPath)) {
- MessageService.ShowError("Invalid project path specified");
- return false;
- }
- }
- PropertyService.SetProperty("MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", projectPath);
-
widget.Store ();
return true;
}
-
public class ProjectAndCombinePanelWidget : GladeWidgetExtract
{
- // service instances needed
- StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
- PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
-
//
// Gtk controls
//
- [Glade.Widget] public Gnome.FileEntry projectLocationTextBox;
- [Glade.Widget] public Gtk.RadioButton saveChangesRadioButton, promptChangesRadioButton, noSaveRadioButton;
- [Glade.Widget] public Gtk.CheckButton loadPrevProjectCheckBox, showTaskListCheckBox, showOutputCheckBox;
- [Glade.Widget] public Gtk.Label locationLabel, settingsLabel, buildAndRunOptionsLabel;
+ [Glade.Widget] public Gtk.RadioButton saveChangesRadioButton;
+ [Glade.Widget] public Gtk.RadioButton promptChangesRadioButton;
+ [Glade.Widget] public Gtk.RadioButton noSaveRadioButton;
+ [Glade.Widget] public Gtk.CheckButton showTaskListCheckBox;
+ [Glade.Widget] public Gtk.CheckButton showOutputCheckBox;
+ [Glade.Widget] public Gtk.Label settingsLabel;
+ [Glade.Widget] public Gtk.Label buildAndRunOptionsLabel;
+
+ // service instances needed
+ StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (
+ typeof (StringParserService));
+ PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (
+ typeof (PropertyService));
+
public ProjectAndCombinePanelWidget () : base ("Base.glade", "ProjectAndCombinePanel")
{
-
- settingsLabel.Markup = "<b> " + StringParserService.Parse(
- "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SettingsGroupBox}") + "</b>";
- //
- // set up the Project Settings options
- //
- locationLabel.TextWithMnemonic = StringParserService.Parse(
- "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ProjectLocationLabel}");
- //projectLocationTextBox = new Gnome.FileEntry ("", "Choose Location");
- projectLocationTextBox.DirectoryEntry = true;
- loadPrevProjectCheckBox.Label = StringParserService.Parse(
- "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.LoadPrevProjectCheckBox}");
//
- // setup the save options
+ // getting internationalized strings
//
- buildAndRunOptionsLabel.Markup = "<b> " + StringParserService.Parse(
- "${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.BuildAndRunGroupBox}") + "</b>";
saveChangesRadioButton.Label = StringParserService.Parse(
"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.SaveChangesRadioButton}");
promptChangesRadioButton.Label = StringParserService.Parse(
@@ -101,19 +79,15 @@
"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowOutputPadCheckBox}");
showTaskListCheckBox.Label = StringParserService.Parse(
"${res:Dialog.Options.IDEOptions.ProjectAndCombineOptions.ShowTaskListPadCheckBox}");
- // read properties
- projectLocationTextBox.GtkEntry.Text = PropertyService.GetProperty(
- "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
- System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
- "MonoDevelopProjects")).ToString();
+ //
+ // reading properties
+ //
BeforeCompileAction action = (BeforeCompileAction) PropertyService.GetProperty(
"SharpDevelop.Services.DefaultParserService.BeforeCompileAction",
BeforeCompileAction.SaveAllFiles);
saveChangesRadioButton.Active = action.Equals(BeforeCompileAction.SaveAllFiles);
promptChangesRadioButton.Active = action.Equals(BeforeCompileAction.PromptForSave);
noSaveRadioButton.Active = action.Equals(BeforeCompileAction.Nothing);
- loadPrevProjectCheckBox.Active = (bool)PropertyService.GetProperty(
- "SharpDevelop.LoadPrevProjectOnStartup", false);
showTaskListCheckBox.Active = (bool)PropertyService.GetProperty(
"SharpDevelop.ShowTaskListAfterBuild", true);
showOutputCheckBox.Active = (bool)PropertyService.GetProperty(
@@ -134,7 +108,6 @@
BeforeCompileAction.Nothing);
}
- PropertyService.SetProperty("SharpDevelop.LoadPrevProjectOnStartup", loadPrevProjectCheckBox.Active);
PropertyService.SetProperty("SharpDevelop.ShowTaskListAfterBuild", showTaskListCheckBox.Active);
PropertyService.SetProperty("SharpDevelop.ShowOutputWindowAtBuild", showOutputCheckBox.Active);
}
More information about the Monodevelop-patches-list
mailing list