[f-spot] Use ComplexMenuItem from Hyena



commit 5b1990929a912d0c3b65e2aac04c895f4496e4dd
Author: Mike Gemünde <mike gemuende de>
Date:   Mon Aug 23 20:08:10 2010 +0200

    Use ComplexMenuItem from Hyena
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627835

 .../FSpot.Extensions/ComplexMenuItemNode.cs        |   20 ++--
 .../MainApp/FSpot.Widgets/RatingMenuItem.cs        |    4 +-
 .../FSpot.Gui/FSpot.Widgets/ComplexMenuItem.cs     |  119 --------------------
 src/Core/FSpot.Gui/Makefile.am                     |    1 -
 4 files changed, 14 insertions(+), 130 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs b/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
index 86bfa5b..1f27f3e 100644
--- a/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
+++ b/src/Clients/MainApp/FSpot.Extensions/ComplexMenuItemNode.cs
@@ -12,6 +12,8 @@ using Mono.Addins;
 using FSpot.Widgets;
 using System;
 
+using Hyena.Widgets;
+
 namespace FSpot.Extensions
 {
 	[ExtensionNode ("ComplexMenuItem")]
@@ -30,16 +32,16 @@ namespace FSpot.Extensions
 			ComplexMenuItem item = System.Activator.CreateInstance (Type.GetType (widget_type), parent) as ComplexMenuItem;
 			cmd = (ICommand) Addin.CreateInstance (command_type);
 
-			if (item != null)
-				item.Changed += OnChanged;
-			return item;
-		}
+            if (item != null)
+                item.Activated += OnActivated;
+            return item;
+        }
 
-		private void OnChanged (object o, EventArgs e)
-		{
-			if (cmd != null)
-				cmd.Run (o, e);
-		}
+        private void OnActivated (object o, EventArgs e)
+        {
+            if (cmd != null)
+                cmd.Run (o, e);
+        }
 	}
 
 }
diff --git a/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs b/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
index 1fc8b3e..6116a36 100644
--- a/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/RatingMenuItem.cs
@@ -29,7 +29,9 @@
 using System;
 using Gtk;
 using Mono.Unix;
+
 using Hyena;
+using Hyena.Widgets;
 
 namespace FSpot.Widgets
 {
@@ -135,7 +137,7 @@ namespace FSpot.Widgets
 		{
 			if (can_activate) {
 				Activate ();
-				OnChanged (o, args);
+				OnSelected ();
 			}
 		}
 
diff --git a/src/Core/FSpot.Gui/Makefile.am b/src/Core/FSpot.Gui/Makefile.am
index 144e313..bc26a2f 100644
--- a/src/Core/FSpot.Gui/Makefile.am
+++ b/src/Core/FSpot.Gui/Makefile.am
@@ -12,7 +12,6 @@ SOURCES =  \
 	FSpot.Widgets/ApplicationActivatedEventArgs.cs \
 	FSpot.Widgets/BuilderWindow.cs \
 	FSpot.Widgets/CheckPattern.cs \
-	FSpot.Widgets/ComplexMenuItem.cs \
 	FSpot.Widgets/Curve.cs \
 	FSpot.Widgets/CurveType.cs \
 	FSpot.Widgets/CustomPrintWidget.cs \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]