Author: toshok
Date: 2007-12-27 05:05:41 -0500 (Thu, 27 Dec 2007)
New Revision: 91925

Modified:
   trunk/mono-tools/gui-compare/ChangeLog
   trunk/mono-tools/gui-compare/MainWindow.cs
   trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs
   trunk/mono-tools/gui-compare/gtk-gui/gui.stetic
Log:
* MainWindow.cs: repopulate the model if any of the View actions
  change.  also, take into account the view actions when populating
  the tree model.
* gtk-gui/MainWindow.cs, gtk-gui/gui.stetic: add a View menu for
  showing errors/missing/extra/present items

Modified: trunk/mono-tools/gui-compare/ChangeLog
===================================================================
--- trunk/mono-tools/gui-compare/ChangeLog      2007-12-27 09:59:45 UTC (rev 
91924)
+++ trunk/mono-tools/gui-compare/ChangeLog      2007-12-27 10:05:41 UTC (rev 
91925)
@@ -1,5 +1,12 @@
 2007-12-27  Chris Toshok <[EMAIL PROTECTED]> 
 
+       * MainWindow.cs: repopulate the model if any of the View actions 
change. 
+         also, take into account the view actions when populating the tree 
model.
+       * gtk-gui/MainWindow.cs, gtk-gui/gui.stetic: add a View menu for showing
+         errors/missing/extra/present items
+
+2007-12-27  Chris Toshok <[EMAIL PROTECTED]> 
+
        * CecilMetadata.cs: skip special named fields, and start dealing with
          attributes.
        * Metadata.cs: kinda gross, but make CompProperty subclass from

Modified: trunk/mono-tools/gui-compare/MainWindow.cs
===================================================================
--- trunk/mono-tools/gui-compare/MainWindow.cs  2007-12-27 09:59:45 UTC (rev 
91924)
+++ trunk/mono-tools/gui-compare/MainWindow.cs  2007-12-27 10:05:41 UTC (rev 
91925)
@@ -259,8 +259,15 @@
                
                Gtk.TreePath path = treeStore.GetPath (iter);
                
-               foreach (ComparisonNode n in root.children)
-                       PopulateTreeFromComparison (iter, n);
+               foreach (ComparisonNode n in root.children) {
+                       if ((ShowMissing.Active && (n.status == 
ComparisonStatus.Missing || n.Missing > 0)) ||
+                           (ShowExtra.Active && (n.status == 
ComparisonStatus.Extra || n.Extra > 0)) ||
+                           (ShowErrors.Active && (n.status == 
ComparisonStatus.Error || n.Warning > 0)) ||
+                           ShowPresent.Active) {
+                               
+                               PopulateTreeFromComparison (iter, n);
+                       }
+               }
                
                tree.ExpandRow (path, false);
        }
@@ -279,8 +286,16 @@
                                                node.Warning == 0 ? null : 
errorPixbuf,
                                                node.Warning == 0 ? null : 
String.Format (": {0}", node.Warning));
                
-               foreach (ComparisonNode n in node.children)
-                       PopulateTreeFromComparison (citer, n);
+               foreach (ComparisonNode n in node.children) {
+
+                       if ((ShowMissing.Active && (n.status == 
ComparisonStatus.Missing || n.Missing > 0)) ||
+                           (ShowExtra.Active && (n.status == 
ComparisonStatus.Extra || n.Extra > 0)) ||
+                           (ShowErrors.Active && (n.status == 
ComparisonStatus.Error || n.Warning > 0)) ||
+                           ShowPresent.Active) {
+                       
+                               PopulateTreeFromComparison (citer, n);
+                       }
+               }
        }
        
        protected void OnDeleteEvent (object sender, DeleteEventArgs a)
@@ -293,4 +308,36 @@
        {
                Application.Quit ();
        }
+
+       protected virtual void OnShowErrorsToggled (object sender, 
System.EventArgs e)
+       {
+               if (context != null && context.Comparison != null) {
+                       treeStore.Clear();
+                       PopulateTreeFromComparison (context.Comparison);
+               }
+       }
+
+       protected virtual void OnShowMissingToggled (object sender, 
System.EventArgs e)
+       {
+               if (context != null && context.Comparison != null) {
+                       treeStore.Clear();
+                       PopulateTreeFromComparison (context.Comparison);
+               }
+       }
+
+       protected virtual void OnShowPresentToggled (object sender, 
System.EventArgs e)
+       {
+               if (context != null && context.Comparison != null) {
+                       treeStore.Clear();
+                       PopulateTreeFromComparison (context.Comparison);
+               }
+       }
+       
+       protected virtual void OnShowExtraToggled (object sender, 
System.EventArgs e)
+       {
+               if (context != null && context.Comparison != null) {
+                       treeStore.Clear();
+                       PopulateTreeFromComparison (context.Comparison);
+               }
+       }
 }
\ No newline at end of file

Modified: trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs
===================================================================
--- trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs  2007-12-27 09:59:45 UTC 
(rev 91924)
+++ trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs  2007-12-27 10:05:41 UTC 
(rev 91925)
@@ -24,6 +24,16 @@
     
     private Gtk.Action b;
     
+    private Gtk.Action View;
+    
+    private Gtk.ToggleAction ShowMissing;
+    
+    private Gtk.ToggleAction ShowExtra;
+    
+    private Gtk.ToggleAction ShowPresent;
+    
+    private Gtk.ToggleAction ShowErrors;
+    
     private Gtk.VBox vbox1;
     
     private Gtk.MenuBar menubar1;
@@ -67,6 +77,25 @@
         this.b = new Gtk.Action("b", Mono.Unix.Catalog.GetString("b"), null, 
null);
         this.b.ShortLabel = Mono.Unix.Catalog.GetString("b");
         w2.Add(this.b, null);
+        this.View = new Gtk.Action("View", 
Mono.Unix.Catalog.GetString("_View"), null, null);
+        this.View.ShortLabel = Mono.Unix.Catalog.GetString("View");
+        w2.Add(this.View, null);
+        this.ShowMissing = new Gtk.ToggleAction("ShowMissing", 
Mono.Unix.Catalog.GetString("Show missing"), null, null);
+        this.ShowMissing.Active = true;
+        this.ShowMissing.ShortLabel = Mono.Unix.Catalog.GetString("Show 
missing");
+        w2.Add(this.ShowMissing, null);
+        this.ShowExtra = new Gtk.ToggleAction("ShowExtra", 
Mono.Unix.Catalog.GetString("Show extra"), null, null);
+        this.ShowExtra.Active = true;
+        this.ShowExtra.ShortLabel = Mono.Unix.Catalog.GetString("Show extra");
+        w2.Add(this.ShowExtra, null);
+        this.ShowPresent = new Gtk.ToggleAction("ShowPresent", 
Mono.Unix.Catalog.GetString("Show present"), null, null);
+        this.ShowPresent.Active = true;
+        this.ShowPresent.ShortLabel = Mono.Unix.Catalog.GetString("Show 
present");
+        w2.Add(this.ShowPresent, null);
+        this.ShowErrors = new Gtk.ToggleAction("ShowErrors", 
Mono.Unix.Catalog.GetString("Show errors"), null, null);
+        this.ShowErrors.Active = true;
+        this.ShowErrors.ShortLabel = Mono.Unix.Catalog.GetString("Show 
errors");
+        w2.Add(this.ShowErrors, null);
         w1.InsertActionGroup(w2, 0);
         this.AddAccelGroup(w1.AccelGroup);
         this.Name = "MainWindow";
@@ -77,7 +106,7 @@
         this.vbox1.Name = "vbox1";
         this.vbox1.Spacing = 6;
         // Container child vbox1.Gtk.Box+BoxChild
-        w1.AddUiFromString("<ui><menubar name='menubar1'><menu 
action='File'><menuitem action='quit'/></menu><menu action='Compare'><menuitem 
action='Custom'/><separator/></menu></menubar></ui>");
+        w1.AddUiFromString("<ui><menubar name='menubar1'><menu 
action='File'><menuitem action='quit'/></menu><menu action='Compare'><menuitem 
action='Custom'/><separator/></menu><menu action='View'><menuitem 
action='ShowMissing'/><menuitem action='ShowExtra'/><menuitem 
action='ShowPresent'/></menu></menubar></ui>");
         this.menubar1 = ((Gtk.MenuBar)(w1.GetWidget("/menubar1")));
         this.menubar1.Name = "menubar1";
         this.vbox1.Add(this.menubar1);
@@ -152,5 +181,9 @@
         this.Show();
         this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
         this.quit.Activated += new System.EventHandler(this.OnQuitActivated);
+        this.ShowMissing.Toggled += new 
System.EventHandler(this.OnShowMissingToggled);
+        this.ShowExtra.Toggled += new 
System.EventHandler(this.OnShowExtraToggled);
+        this.ShowPresent.Toggled += new 
System.EventHandler(this.OnShowPresentToggled);
+        this.ShowErrors.Toggled += new 
System.EventHandler(this.OnShowErrorsToggled);
     }
 }

Modified: trunk/mono-tools/gui-compare/gtk-gui/gui.stetic
===================================================================
--- trunk/mono-tools/gui-compare/gtk-gui/gui.stetic     2007-12-27 09:59:45 UTC 
(rev 91924)
+++ trunk/mono-tools/gui-compare/gtk-gui/gui.stetic     2007-12-27 10:05:41 UTC 
(rev 91925)
@@ -41,6 +41,43 @@
         <property name="Label" translatable="yes">b</property>
         <property name="ShortLabel" translatable="yes">b</property>
       </action>
+      <action id="View">
+        <property name="Type">Action</property>
+        <property name="Label" translatable="yes">_View</property>
+        <property name="ShortLabel" translatable="yes">View</property>
+      </action>
+      <action id="ShowMissing">
+        <property name="Type">Toggle</property>
+        <property name="Label" translatable="yes">Show missing</property>
+        <property name="ShortLabel" translatable="yes">Show missing</property>
+        <property name="DrawAsRadio">False</property>
+        <property name="Active">True</property>
+        <signal name="Toggled" handler="OnShowMissingToggled" />
+      </action>
+      <action id="ShowExtra">
+        <property name="Type">Toggle</property>
+        <property name="Label" translatable="yes">Show extra</property>
+        <property name="ShortLabel" translatable="yes">Show extra</property>
+        <property name="DrawAsRadio">False</property>
+        <property name="Active">True</property>
+        <signal name="Toggled" handler="OnShowExtraToggled" />
+      </action>
+      <action id="ShowPresent">
+        <property name="Type">Toggle</property>
+        <property name="Label" translatable="yes">Show present</property>
+        <property name="ShortLabel" translatable="yes">Show present</property>
+        <property name="DrawAsRadio">False</property>
+        <property name="Active">True</property>
+        <signal name="Toggled" handler="OnShowPresentToggled" />
+      </action>
+      <action id="ShowErrors">
+        <property name="Type">Toggle</property>
+        <property name="Label" translatable="yes">Show errors</property>
+        <property name="ShortLabel" translatable="yes">Show errors</property>
+        <property name="DrawAsRadio">False</property>
+        <property name="Active">True</property>
+        <signal name="Toggled" handler="OnShowErrorsToggled" />
+      </action>
     </action-group>
     <property name="MemberName" />
     <property name="Title" translatable="yes">MainWindow</property>
@@ -61,6 +98,12 @@
                 <node type="Menuitem" action="Custom" />
                 <node type="Separator" />
               </node>
+              <node type="Menu" action="View">
+                <node type="Menuitem" action="ShowErrors" />
+                <node type="Menuitem" action="ShowMissing" />
+                <node type="Menuitem" action="ShowExtra" />
+                <node type="Menuitem" action="ShowPresent" />
+              </node>
             </node>
           </widget>
           <packing>

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

Reply via email to