Author: toshok
Date: 2007-12-27 05:39:21 -0500 (Thu, 27 Dec 2007)
New Revision: 91926

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: add handling for the refresh button.  also, remove the
  counts of various things if the View menu has them disabled.
* gtk-gui/MainWindow.cs, gtk-gui/gui.stetic: add a refresh button to
  re-run the current comparison.  this is a stopgap for the planned
  inotify/fam/whatever based code that will notice when the assembly
  changes and will automatically refresh.

Modified: trunk/mono-tools/gui-compare/ChangeLog
===================================================================
--- trunk/mono-tools/gui-compare/ChangeLog      2007-12-27 10:05:41 UTC (rev 
91925)
+++ trunk/mono-tools/gui-compare/ChangeLog      2007-12-27 10:39:21 UTC (rev 
91926)
@@ -1,5 +1,14 @@
 2007-12-27  Chris Toshok <[EMAIL PROTECTED]> 
 
+       * MainWindow.cs: add handling for the refresh button.  also, remove the
+         counts of various things if the View menu has them disabled.
+       * gtk-gui/MainWindow.cs, gtk-gui/gui.stetic: add a refresh button to 
re-run
+         the current comparison.  this is a stopgap for the planned
+         inotify/fam/whatever based code that will notice when the assembly
+         changes and will automatically refresh.
+
+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

Modified: trunk/mono-tools/gui-compare/MainWindow.cs
===================================================================
--- trunk/mono-tools/gui-compare/MainWindow.cs  2007-12-27 10:05:41 UTC (rev 
91925)
+++ trunk/mono-tools/gui-compare/MainWindow.cs  2007-12-27 10:39:21 UTC (rev 
91926)
@@ -250,12 +250,12 @@
                        treeStore.AppendValues (root.name,
                                                TypePixbufFromComparisonNode 
(root),
                                                StatusPixbufFromComparisonNode 
(root),
-                                               root.Missing == 0 ? null : 
missingPixbuf,
-                                               root.Missing == 0 ? null : 
String.Format (": {0}", root.Missing),
-                                               root.Extra == 0 ? null : 
extraPixbuf,
-                                               root.Extra == 0 ? null : 
String.Format (": {0}", root.Extra),
-                                               root.Warning == 0 ? null : 
errorPixbuf,
-                                               root.Warning == 0 ? null : 
String.Format (": {0}", root.Warning));
+                                               !ShowMissing.Active || 
root.Missing == 0 ? null : missingPixbuf,
+                                               !ShowMissing.Active || 
root.Missing == 0 ? null : String.Format (": {0}", root.Missing),
+                                               !ShowExtra.Active || root.Extra 
== 0 ? null : extraPixbuf,
+                                               !ShowExtra.Active || root.Extra 
== 0 ? null : String.Format (": {0}", root.Extra),
+                                               !ShowErrors.Active || 
root.Warning == 0 ? null : errorPixbuf,
+                                               !ShowErrors.Active || 
root.Warning == 0 ? null : String.Format (": {0}", root.Warning));
                
                Gtk.TreePath path = treeStore.GetPath (iter);
                
@@ -279,12 +279,12 @@
                                                node.name,
                                                TypePixbufFromComparisonNode 
(node),
                                                StatusPixbufFromComparisonNode 
(node),
-                                               node.Missing == 0 ? null : 
missingPixbuf,
-                                               node.Missing == 0 ? null : 
String.Format (": {0}", node.Missing),
-                                               node.Extra == 0 ? null : 
extraPixbuf,
-                                               node.Extra == 0 ? null : 
String.Format (": {0}", node.Extra),
-                                               node.Warning == 0 ? null : 
errorPixbuf,
-                                               node.Warning == 0 ? null : 
String.Format (": {0}", node.Warning));
+                                               !ShowMissing.Active || 
node.Missing == 0 ? null : missingPixbuf,
+                                               !ShowMissing.Active || 
node.Missing == 0 ? null : String.Format (": {0}", node.Missing),
+                                               !ShowExtra.Active || node.Extra 
== 0 ? null : extraPixbuf,
+                                               !ShowExtra.Active || node.Extra 
== 0 ? null : String.Format (": {0}", node.Extra),
+                                               !ShowErrors.Active || 
node.Warning == 0 ? null : errorPixbuf,
+                                               !ShowErrors.Active || 
node.Warning == 0 ? null : String.Format (": {0}", node.Warning));
                
                foreach (ComparisonNode n in node.children) {
 
@@ -340,4 +340,9 @@
                        PopulateTreeFromComparison (context.Comparison);
                }
        }
+
+       protected virtual void OnRefreshActivated (object sender, 
System.EventArgs e)
+       {
+               StartCompare (delegate {});
+       }
 }
\ 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 10:05:41 UTC 
(rev 91925)
+++ trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs  2007-12-27 10:39:21 UTC 
(rev 91926)
@@ -34,10 +34,14 @@
     
     private Gtk.ToggleAction ShowErrors;
     
+    private Gtk.Action Refresh;
+    
     private Gtk.VBox vbox1;
     
     private Gtk.MenuBar menubar1;
     
+    private Gtk.Toolbar toolbar3;
+    
     private Gtk.Notebook notebook1;
     
     private Gtk.ScrolledWindow GtkScrolledWindow;
@@ -96,6 +100,9 @@
         this.ShowErrors.Active = true;
         this.ShowErrors.ShortLabel = Mono.Unix.Catalog.GetString("Show 
errors");
         w2.Add(this.ShowErrors, null);
+        this.Refresh = new Gtk.Action("Refresh", 
Mono.Unix.Catalog.GetString("Refresh"), null, "gtk-refresh");
+        this.Refresh.ShortLabel = Mono.Unix.Catalog.GetString("Refresh");
+        w2.Add(this.Refresh, "<Control>r");
         w1.InsertActionGroup(w2, 0);
         this.AddAccelGroup(w1.AccelGroup);
         this.Name = "MainWindow";
@@ -106,7 +113,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><menu action='View'><menuitem 
action='ShowMissing'/><menuitem action='ShowExtra'/><menuitem 
action='ShowPresent'/></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='ShowErrors'/><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);
@@ -115,6 +122,17 @@
         w3.Expand = false;
         w3.Fill = false;
         // Container child vbox1.Gtk.Box+BoxChild
+        w1.AddUiFromString("<ui><toolbar name='toolbar3'><toolitem 
action='Refresh'/></toolbar></ui>");
+        this.toolbar3 = ((Gtk.Toolbar)(w1.GetWidget("/toolbar3")));
+        this.toolbar3.Name = "toolbar3";
+        this.toolbar3.ShowArrow = false;
+        this.toolbar3.ToolbarStyle = ((Gtk.ToolbarStyle)(0));
+        this.vbox1.Add(this.toolbar3);
+        Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox1[this.toolbar3]));
+        w4.Position = 1;
+        w4.Expand = false;
+        w4.Fill = false;
+        // Container child vbox1.Gtk.Box+BoxChild
         this.notebook1 = new Gtk.Notebook();
         this.notebook1.CanFocus = true;
         this.notebook1.Name = "notebook1";
@@ -146,8 +164,8 @@
         this.label3.LabelProp = Mono.Unix.Catalog.GetString("This tool allows 
you to compare the API of assemblies.\n\nTo initiate a comparison, use the 
\"Compare\" menu and use one of the presets based on the assemblies you  have 
installed on your system and some popular profiles, or use \"Custom\" to define 
your own comparison");
         this.label3.Wrap = true;
         this.notebook1.Add(this.label3);
-        Gtk.Notebook.NotebookChild w6 = 
((Gtk.Notebook.NotebookChild)(this.notebook1[this.label3]));
-        w6.Position = 1;
+        Gtk.Notebook.NotebookChild w7 = 
((Gtk.Notebook.NotebookChild)(this.notebook1[this.label3]));
+        w7.Position = 1;
         // Notebook tab
         this.label2 = new Gtk.Label();
         this.label2.Name = "label2";
@@ -155,8 +173,8 @@
         this.notebook1.SetTabLabel(this.label3, this.label2);
         this.label2.ShowAll();
         this.vbox1.Add(this.notebook1);
-        Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
-        w7.Position = 1;
+        Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
+        w8.Position = 2;
         // Container child vbox1.Gtk.Box+BoxChild
         this.statusbar1 = new Gtk.Statusbar();
         this.statusbar1.Name = "statusbar1";
@@ -165,13 +183,13 @@
         this.progressbar1 = new Gtk.ProgressBar();
         this.progressbar1.Name = "progressbar1";
         this.statusbar1.Add(this.progressbar1);
-        Gtk.Box.BoxChild w8 = 
((Gtk.Box.BoxChild)(this.statusbar1[this.progressbar1]));
-        w8.Position = 2;
+        Gtk.Box.BoxChild w9 = 
((Gtk.Box.BoxChild)(this.statusbar1[this.progressbar1]));
+        w9.Position = 2;
         this.vbox1.Add(this.statusbar1);
-        Gtk.Box.BoxChild w9 = 
((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
-        w9.Position = 2;
-        w9.Expand = false;
-        w9.Fill = false;
+        Gtk.Box.BoxChild w10 = 
((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
+        w10.Position = 3;
+        w10.Expand = false;
+        w10.Fill = false;
         this.Add(this.vbox1);
         if ((this.Child != null)) {
             this.Child.ShowAll();
@@ -185,5 +203,6 @@
         this.ShowExtra.Toggled += new 
System.EventHandler(this.OnShowExtraToggled);
         this.ShowPresent.Toggled += new 
System.EventHandler(this.OnShowPresentToggled);
         this.ShowErrors.Toggled += new 
System.EventHandler(this.OnShowErrorsToggled);
+        this.Refresh.Activated += new 
System.EventHandler(this.OnRefreshActivated);
     }
 }

Modified: trunk/mono-tools/gui-compare/gtk-gui/gui.stetic
===================================================================
--- trunk/mono-tools/gui-compare/gtk-gui/gui.stetic     2007-12-27 10:05:41 UTC 
(rev 91925)
+++ trunk/mono-tools/gui-compare/gtk-gui/gui.stetic     2007-12-27 10:39:21 UTC 
(rev 91926)
@@ -78,6 +78,14 @@
         <property name="Active">True</property>
         <signal name="Toggled" handler="OnShowErrorsToggled" />
       </action>
+      <action id="Refresh">
+        <property name="Type">Action</property>
+        <property name="Accelerator">&lt;Control&gt;r</property>
+        <property name="Label" translatable="yes">Refresh</property>
+        <property name="ShortLabel" translatable="yes">Refresh</property>
+        <property name="StockId">gtk-refresh</property>
+        <signal name="Activated" handler="OnRefreshActivated" />
+      </action>
     </action-group>
     <property name="MemberName" />
     <property name="Title" translatable="yes">MainWindow</property>
@@ -114,6 +122,22 @@
           </packing>
         </child>
         <child>
+          <widget class="Gtk.Toolbar" id="toolbar3">
+            <property name="MemberName" />
+            <property name="ShowArrow">False</property>
+            <property name="ButtonStyle">Icons</property>
+            <node name="toolbar3" type="Menubar">
+              <node type="Toolitem" action="Refresh" />
+            </node>
+          </widget>
+          <packing>
+            <property name="Position">1</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+        <child>
           <widget class="Gtk.Notebook" id="notebook1">
             <property name="MemberName" />
             <property name="CanFocus">True</property>
@@ -168,7 +192,7 @@
             </child>
           </widget>
           <packing>
-            <property name="Position">1</property>
+            <property name="Position">2</property>
             <property name="AutoSize">True</property>
           </packing>
         </child>
@@ -190,7 +214,7 @@
             </child>
           </widget>
           <packing>
-            <property name="Position">2</property>
+            <property name="Position">3</property>
             <property name="AutoSize">True</property>
             <property name="Expand">False</property>
             <property name="Fill">False</property>

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

Reply via email to