Author: ankit
Date: 2007-05-30 11:31:29 -0400 (Wed, 30 May 2007)
New Revision: 78228

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
Log:
* MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
(.ctor): If CombineExecuteDefinition is invalid then load an empty
default set.
(AddEmptyExecuteDefinitions): New.


Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog       
2007-05-30 15:14:27 UTC (rev 78227)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog       
2007-05-30 15:31:29 UTC (rev 78228)
@@ -1,3 +1,10 @@
+2007-05-30  Ankit Jain  <[EMAIL PROTECTED]>
+
+       * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
+       (.ctor): If CombineExecuteDefinition is invalid then load an empty
+       default set.
+       (AddEmptyExecuteDefinitions): New.
+
 2007-05-21  Ankit Jain  <[EMAIL PROTECTED]>
 
        * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CustomCommandWidget.cs:

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
    2007-05-30 15:14:27 UTC (rev 78227)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CombineStartupPanel.cs
    2007-05-30 15:31:29 UTC (rev 78228)
@@ -76,7 +76,6 @@
                                actionCombo.Changed += new 
EventHandler(OptionsChanged);
 
                                // Populating entryTreeView                     
                
-                               CombineExecuteDefinition edef;
                                store = new ListStore (typeof(string), 
typeof(string), typeof(CombineExecuteDefinition) );
                                entryTreeView.Model = store;
                                
@@ -89,22 +88,18 @@
                                if(combine.CombineExecuteDefinitions.Count == 
combine.Entries.Count) {
                                        // add the previously saved execute 
definitions to the treeview list
                                        for (int n = 0; n < 
combine.CombineExecuteDefinitions.Count; n++) {
-                                               edef = 
(CombineExecuteDefinition)combine.CombineExecuteDefinitions[n];
+                                               CombineExecuteDefinition edef = 
(CombineExecuteDefinition)combine.CombineExecuteDefinitions[n];
+                                               if (edef == null || edef.Entry 
== null) {
+                                                       // Invalid
+                                                       store.Clear ();
+                                                       
AddEmptyExecuteDefinitions ();
+                                                       break;
+                                               }
                                                string action = edef.Type == 
EntryExecuteType.None ? GettextCatalog.GetString ("None") : 
GettextCatalog.GetString ("Execute");
                                                store.AppendValues 
(edef.Entry.Name, action, edef);
                                        }
                                } else {
-                                       // add an empty set of execute 
definitions
-                                       for (int n = 0; n < 
combine.Entries.Count; n++) {
-                                               edef = new 
CombineExecuteDefinition ((CombineEntry) 
combine.Entries[n],EntryExecuteType.None);
-                                               string action = edef.Type == 
EntryExecuteType.None ? GettextCatalog.GetString ("None") : 
GettextCatalog.GetString ("Execute");
-                                               store.AppendValues 
(edef.Entry.Name, action, edef);
-                                       }
-                                       
-                                       // tell the user we encountered and 
worked around an issue
-                                       Gtk.Application.Invoke (delegate {
-                                               
Services.MessageService.ShowError (null, GettextCatalog.GetString ("The 
Solution Execute Definitions for this Solution were invalid. A new empty set of 
Execute Definitions has been created."), (Gtk.Window) Toplevel, true);
-                                       });
+                                       AddEmptyExecuteDefinitions ();
                                }
                                        
                                entryTreeView.Selection.Changed += new 
EventHandler(SelectedEntryChanged);
@@ -116,7 +111,21 @@
 
                                OnSingleRadioButtonClicked(null, null);         
                
                        }
-                                               
+
+                       void AddEmptyExecuteDefinitions ()
+                       {
+                               for (int n = 0; n < combine.Entries.Count; n++) 
{
+                                       CombineExecuteDefinition edef = new 
CombineExecuteDefinition ((CombineEntry) 
combine.Entries[n],EntryExecuteType.None);
+                                       string action = edef.Type == 
EntryExecuteType.None ? GettextCatalog.GetString ("None") : 
GettextCatalog.GetString ("Execute");
+                                       store.AppendValues (edef.Entry.Name, 
action, edef);
+                               }
+                               
+                               // tell the user we encountered and worked 
around an issue
+                               Gtk.Application.Invoke (delegate {
+                                       Services.MessageService.ShowError 
(null, GettextCatalog.GetString ("The Solution Execute Definitions for this 
Solution were invalid. A new empty set of Execute Definitions has been 
created."), (Gtk.Window) Toplevel, true);
+                               });
+                       }
+                                       
                        protected void OnMoveUpButtonClicked(object sender, 
EventArgs e)
                        {
                                if(entryTreeView.Selection.CountSelectedRows() 
== 1)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to