Author: fejj
Date: 2007-03-14 16:13:12 -0500 (Wed, 14 Mar 2007)
New Revision: 74305

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
Log:
2007-03-14  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
        (InitializeComponents): Don't crash if no project is selected in
        the solution.
        (InitializeDialog): Clear the iconView.



Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog        2007-03-14 
21:07:23 UTC (rev 74304)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog        2007-03-14 
21:13:12 UTC (rev 74305)
@@ -1,3 +1,10 @@
+2007-03-14  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
+       (InitializeComponents): Don't crash if no project is selected in
+       the solution.
+       (InitializeDialog): Clear the iconView.
+
 2007-03-13  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
     2007-03-14 21:07:23 UTC (rev 74304)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
     2007-03-14 21:13:12 UTC (rev 74305)
@@ -81,6 +81,7 @@
                                projectLangs.Clear ();
                                categories.Clear ();
                                catStore.Clear ();
+                               icons.Clear ();
                        }
                        
                        Project project = null;
@@ -100,8 +101,10 @@
                        
                        InitializeTemplates ();
                        
-                       if (update)
+                       if (update) {
+                               iconView.Clear ();
                                InitializeView ();
+                       }
                }
                
                public override void Dispose ()
@@ -298,13 +301,15 @@
                        if (cat.Selected == false && titem.Template.WizardPath 
== null) {
                                cat.Selected = true;
                        }
+                       
                        if (!cat.HasSelectedTemplate && 
titem.Template.Files.Count == 1) {
                                if 
(((FileDescriptionTemplate)titem.Template.Files[0]).Name.StartsWith("Empty")) {
                                        //titem.Selected = true;
                                        cat.HasSelectedTemplate = true;
                                }
                        }
-                       alltemplates.Add(titem);                
+                       
+                       alltemplates.Add(titem);
                }
 
                //tree view event handler for double-click
@@ -501,7 +506,8 @@
                        Project project = solution.FindProject (projectName);
                        
                        if (project != null) {
-                               if (basePath == parentProject.BaseDirectory) {
+                               if (basePath == null || basePath == 
String.Empty ||
+                                   (parentProject != null && basePath == 
parentProject.BaseDirectory)) {
                                        basePath = project.BaseDirectory;
                                        projectFolderEntry.Path = basePath;
                                }
@@ -517,11 +523,6 @@
                        basePath = projectFolderEntry.Path;
                }
                
-               void NameActivated (object o, EventArgs e)
-               {
-                       okButton.Click ();
-               }
-               
                void InitializeComponents()
                {
                        catStore = new Gtk.TreeStore (typeof(string), 
typeof(ArrayList), typeof(ArrayList), typeof(Gdk.Pixbuf));
@@ -571,7 +572,7 @@
                        nameEntry = new Entry ();
                        nameBox.PackStart (nameEntry, true, true, 6);
                        nameEntry.Changed += new EventHandler (NameChanged);
-                       nameEntry.Activated += new EventHandler (NameActivated);
+                       nameEntry.Activated += new EventHandler (OpenEvent);
                        this.VBox.PackStart (nameBox, false, false, 6);
                        
                        CombineEntryCollection projects = null;
@@ -596,9 +597,11 @@
                                        projectNames[i++] = project.Name;
                                
                                Array.Sort (projectNames);
-                               for (i = 0; i < projectNames.Length; i++) {
-                                       if (projectNames[i] == curProject.Name)
-                                               break;
+                               if (curProject != null) {
+                                       for (i = 0; i < projectNames.Length; 
i++) {
+                                               if (projectNames[i] == 
curProject.Name)
+                                                       break;
+                                       }
                                }
                                
                                projectAddCombo = new ComboBox (projectNames);
@@ -617,14 +620,17 @@
                                
                                projectFolderEntry = new FolderEntry ();
                                projectFolderEntry.Sensitive = false;
-                               projectFolderEntry.Path = 
curProject.BaseDirectory;
+                               if (curProject != null)
+                                       projectFolderEntry.Path = 
curProject.BaseDirectory;
                                projectFolderEntry.PathChanged += new 
EventHandler (AddToProjectPathChanged);
                                hbox.PackStart (projectFolderEntry, true, true, 
6);
                                
                                this.VBox.PackStart (hbox, true, true, 6);
                                
-                               basePath = curProject.BaseDirectory;
-                               parentProject = curProject;
+                               if (curProject != null) {
+                                       basePath = curProject.BaseDirectory;
+                                       parentProject = curProject;
+                               }
                        }
                        
                        cat_imglist = new PixbufList();

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

Reply via email to