~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CustomCommandPanel.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
 
29
29
using System;
 
30
using System.Collections.Generic;
30
31
using MonoDevelop.Core.Gui.Dialogs;
31
32
using MonoDevelop.Projects;
32
33
using MonoDevelop.Core;
33
34
 
34
35
namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels
35
36
{
36
 
        internal class CustomCommandPanel: AbstractOptionPanel
 
37
        internal class CustomCommandPanel: MultiConfigItemOptionsPanel
37
38
        {
38
 
                AbstractConfiguration configuration;
39
 
                CustomCommandCollection commands;
40
 
                
41
 
                public override void LoadPanelContents ()
42
 
                {
43
 
                        Properties props = (Properties) CustomizationObject;
44
 
                        configuration = props.Get<AbstractConfiguration> ("Config");
45
 
                        if (configuration != null) {
46
 
                                CombineEntry entry = props.Get<CombineEntry> ("CombineEntry");
47
 
                                commands = configuration.CustomCommands.Clone ();
48
 
                                Add (new CustomCommandPanelWidget (entry, commands));
49
 
                        }
 
39
                CustomCommandPanelWidget widget;
 
40
                
 
41
                public override Gtk.Widget CreatePanelWidget ()
 
42
                {
 
43
                        return (widget = new CustomCommandPanelWidget ());
 
44
                }
 
45
                
 
46
                public override void LoadConfigData ()
 
47
                {
 
48
                        widget.Load (ConfiguredSolutionItem, CurrentConfiguration.CustomCommands);
50
49
                }
51
50
 
52
 
                public override bool StorePanelContents ()
 
51
                public override void ApplyChanges ()
53
52
                {
54
 
                        if (configuration != null) {
55
 
                                configuration.CustomCommands.CopyFrom (commands);
56
 
                                // Remove empty commands
57
 
                                for (int n=0; n<configuration.CustomCommands.Count; n++) {
58
 
                                        if (configuration.CustomCommands [n].Command == "") {
59
 
                                                configuration.CustomCommands.RemoveAt (n);
60
 
                                                n--;
61
 
                                        }
62
 
                                }
63
 
                        }
64
 
                        return true;
 
53
                        // Do nothing. Changes to cloned configurations are automatically applied.
65
54
                }
66
55
        }
67
56
}