[nautilus-actions] Buttons reflect change of order mode



commit 13b15ac3f3bd5b7674f7b44ccd89a4f8e4229532
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Mar 24 21:09:36 2010 +0100

    Buttons reflect change of order mode

 ChangeLog                    |    8 ++++++++
 TODO                         |    4 ----
 src/nact/nact-main-window.c  |    1 +
 src/nact/nact-sort-buttons.c |   27 +++++++++++++++++++++++++++
 src/nact/nact-sort-buttons.h |    9 +++++----
 5 files changed, 41 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2c095e1..1368398 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-03-24 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-main-window.c
+	(ipivot_consumer_on_display_order_changed):
+	Relay NAIPivotConsumer notification to nact_sort_buttons.
+
+	* src/nact/nact-sort-buttons.c:
+	* src/nact/nact-sort-buttons.h
+	(nact_sort_buttons_display_order_change): New function.
+
 	* src/nact/nact-main-menubar.c (save_item):
 	Not only unref old origin, but also remove it from tree.
 
diff --git a/TODO b/TODO
index 1ab1932..e78329e 100644
--- a/TODO
+++ b/TODO
@@ -139,7 +139,3 @@
             command/
 
 - bug: when order changes, nact is not marked modified
-
-- bug: when we change order via preferences, the buttons should reflect this
-
-- bug: when one clicks on target location, no more able to cut paste
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 966712d..0931a59 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -1428,6 +1428,7 @@ ipivot_consumer_on_display_order_changed( NAIPivotConsumer *instance, gint order
 	/*self = NACT_MAIN_WINDOW( instance );*/
 
 	nact_iactions_list_display_order_change( NACT_IACTIONS_LIST( instance ), order_mode );
+	nact_sort_buttons_display_order_change( NACT_MAIN_WINDOW( instance ), order_mode );
 }
 
 static gchar *
diff --git a/src/nact/nact-sort-buttons.c b/src/nact/nact-sort-buttons.c
index 4692fce..3197b06 100644
--- a/src/nact/nact-sort-buttons.c
+++ b/src/nact/nact-sort-buttons.c
@@ -134,6 +134,33 @@ nact_sort_buttons_dispose( NactMainWindow *window )
 	g_debug( "%s: window=%p", thisfn, ( void * ) window );
 }
 
+/**
+ * nact_sort_buttons_display_order_change:
+ * @window: the #NactMainWindow.
+ * @order_mode: the new order mode.
+ *
+ * Relayed via NactMainWindow, this is a NAIPivotConsumer notification.
+ */
+void
+nact_sort_buttons_display_order_change( NactMainWindow *window, guint order_mode )
+{
+	static const gchar *thisfn = "nact_sort_buttons_display_order_change";
+	GtkToggleButton *button;
+
+	g_debug( "%s: window=%p", thisfn, ( void * ) window );
+
+	button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "SortUpButton" ));
+	gtk_toggle_button_set_active( button, FALSE );
+
+	button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "SortDownButton" ));
+	gtk_toggle_button_set_active( button, FALSE );
+
+	button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "SortManualButton" ));
+	gtk_toggle_button_set_active( button, FALSE );
+
+	display_sort_order( window, order_mode );
+}
+
 static void
 on_sort_down_button_toggled( GtkToggleButton *toggled_button, NactMainWindow *window )
 {
diff --git a/src/nact/nact-sort-buttons.h b/src/nact/nact-sort-buttons.h
index 53684bc..d102003 100644
--- a/src/nact/nact-sort-buttons.h
+++ b/src/nact/nact-sort-buttons.h
@@ -41,10 +41,11 @@
 
 G_BEGIN_DECLS
 
-void  nact_sort_buttons_initial_load      ( NactMainWindow *window );
-void  nact_sort_buttons_runtime_init      ( NactMainWindow *window );
-void  nact_sort_buttons_all_widgets_showed( NactMainWindow *window );
-void  nact_sort_buttons_dispose           ( NactMainWindow *window );
+void  nact_sort_buttons_initial_load        ( NactMainWindow *window );
+void  nact_sort_buttons_runtime_init        ( NactMainWindow *window );
+void  nact_sort_buttons_all_widgets_showed  ( NactMainWindow *window );
+void  nact_sort_buttons_dispose             ( NactMainWindow *window );
+void  nact_sort_buttons_display_order_change( NactMainWindow *window, guint order_mode );
 
 G_END_DECLS
 



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