[nautilus-actions] Take advantage of new statusbar management functions



commit a7e4cbf5a1bb4f9719c53e9142607518103dc1f0
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Aug 19 21:46:07 2009 +0200

    Take advantage of new statusbar management functions
    
    New functions are nact_statusbar_display_status() and nact_statusbar_hide_status().
    Virtual function get_status_bar is removed from the interfaces.

 ChangeLog                    |   12 +++++++
 src/nact/Makefile.am         |    2 +
 src/nact/nact-iaction-tab.c  |   57 ++------------------------------
 src/nact/nact-iaction-tab.h  |    1 -
 src/nact/nact-icommand-tab.c |   61 ++--------------------------------
 src/nact/nact-icommand-tab.h |    1 -
 src/nact/nact-imenubar.c     |   75 +++++++----------------------------------
 src/nact/nact-imenubar.h     |    1 -
 src/nact/nact-main-window.c  |   35 +++++++------------
 src/nact/nact-main-window.h  |    1 +
 10 files changed, 48 insertions(+), 198 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6e01f70..9cdb506 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,18 @@
 	* src/nact/nact-statusbar.c:
 	* src/nact/nact-statusbar.h: New files.
 
+	* src/nact/nact-iaction-tab.c:
+	* src/nact/nact-iaction-tab.h:
+	* src/nact/nact-icommand-tab.c:
+	* src/nact/nact-icommand-tab.h:
+	* src/nact/nact-imenubar.c:
+	* src/nact/nact-imenubar.h:
+	* src/nact/nact-main-window.c:
+	* src/nact/nact-main-window.h:
+	Updated to take advantage of new nact_statusbar_display_status()
+	and nact_statusbar_hide_status() functions.
+	Removed get_status_bar() virtual functions from the interfaces.
+
 2009-08-18 Pierre Wieser <pwieser trychlos org>
 
 	* src/nact/base-application-class.h:
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 72d6e3d..a52c660 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -70,6 +70,8 @@ nautilus_actions_config_tool_SOURCES = \
 	nact-main.c											\
 	nact-main-window.c									\
 	nact-main-window.h									\
+	nact-statusbar.c									\
+	nact-statusbar.h									\
 	nact-window.c										\
 	nact-window.h										\
 	nact-xml-reader.c									\
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index d8637c9..62db79d 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -36,7 +36,7 @@
 #include <string.h>
 
 #include "nact-application.h"
-#include "nact-main-window.h"
+#include "nact-statusbar.h"
 #include "nact-iaction-tab.h"
 
 /* private interface data
@@ -60,7 +60,6 @@ static GType         register_type( void );
 static void          interface_base_init( NactIActionTabInterface *klass );
 static void          interface_base_finalize( NactIActionTabInterface *klass );
 
-static GtkWidget    *v_get_status_bar( NactWindow *window );
 static NAObject     *v_get_selected( NactWindow *window );
 static NAAction     *v_get_edited_action( NactWindow *window );
 static void          v_field_modified( NactWindow *window );
@@ -79,11 +78,6 @@ static void          display_icon( NactWindow *window, GtkWidget *image, gboolea
 static void          on_enabled_toggled( GtkToggleButton *button, gpointer user_data );
 static GtkButton    *get_enabled_button( NactWindow *window );
 
-static void          display_status( NactWindow *window, const gchar *status );
-static void          hide_status( NactWindow *window );
-static guint         get_status_context( NactWindow *window );
-static void          set_status_context( NactWindow *window, guint context );
-
 GType
 nact_iaction_tab_get_type( void )
 {
@@ -163,13 +157,6 @@ nact_iaction_tab_initial_load( NactWindow *dialog )
 	GtkWidget *icon_widget = base_window_get_widget( BASE_WINDOW( dialog ), "ActionIconComboBoxEntry" );
 	gtk_combo_box_set_model( GTK_COMBO_BOX( icon_widget ), create_stock_icon_model());
 	icon_combo_list_fill( GTK_COMBO_BOX_ENTRY( icon_widget ));
-
-	GtkWidget *status_bar = v_get_status_bar( dialog );
-	if( status_bar ){
-		g_assert( GTK_IS_STATUSBAR( status_bar ));
-		guint context = gtk_statusbar_get_context_id( GTK_STATUSBAR( status_bar ), "nact-iaction-tab" );
-		set_status_context( dialog, context );
-	}
 }
 
 void
@@ -271,16 +258,6 @@ nact_iaction_tab_has_label( NactWindow *window )
 	return( g_utf8_strlen( label, -1 ) > 0 );
 }
 
-static GtkWidget *
-v_get_status_bar( NactWindow *window )
-{
-	if( NACT_IACTION_TAB_GET_INTERFACE( window )->get_status_bar ){
-		return( NACT_IACTION_TAB_GET_INTERFACE( window )->get_status_bar( window ));
-	}
-
-	return( NULL );
-}
-
 static NAObject *
 v_get_selected( NactWindow *window )
 {
@@ -345,14 +322,14 @@ on_label_changed( GtkEntry *entry, gpointer user_data )
 static void
 check_for_label( NactWindow *window, GtkEntry *entry, const gchar *label )
 {
-	hide_status( window );
+	nact_statusbar_hide_status( NACT_MAIN_WINDOW( window ), PROP_IACTION_TAB_STATUS_CONTEXT );
 	set_label_label( window, "black" );
 
 	NAAction *edited = v_get_edited_action( window );
 
 	if( edited && g_utf8_strlen( label, -1 ) == 0 ){
 		/* i18n: status bar message when the action label is empty */
-		display_status( window, _( "Caution: a label is mandatory for the action." ));
+		nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IACTION_TAB_STATUS_CONTEXT, _( "Caution: a label is mandatory for the action." ));
 		set_label_label( window, "red" );
 	}
 }
@@ -604,31 +581,3 @@ get_enabled_button( NactWindow *window )
 {
 	return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "ActionEnabledButton" )));
 }
-
-static void
-display_status( NactWindow *window, const gchar *status )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( window );
-	gtk_statusbar_push( GTK_STATUSBAR( bar ), context, status );
-}
-
-static void
-hide_status( NactWindow *window )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( window );
-	gtk_statusbar_pop( GTK_STATUSBAR( bar ), context );
-}
-
-static guint
-get_status_context( NactWindow *window )
-{
-	return( GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( window ), PROP_IACTION_TAB_STATUS_CONTEXT )));
-}
-
-static void
-set_status_context( NactWindow *window, guint context )
-{
-	g_object_set_data( G_OBJECT( window ), PROP_IACTION_TAB_STATUS_CONTEXT, GUINT_TO_POINTER( context ));
-}
diff --git a/src/nact/nact-iaction-tab.h b/src/nact/nact-iaction-tab.h
index 4939879..9c27655 100644
--- a/src/nact/nact-iaction-tab.h
+++ b/src/nact/nact-iaction-tab.h
@@ -55,7 +55,6 @@ typedef struct {
 	NactIActionTabInterfacePrivate *private;
 
 	/* api */
-	GtkWidget * ( *get_status_bar )   ( NactWindow *window );
 	NAObject *  ( *get_selected )     ( NactWindow *window );
 	NAAction *  ( *get_edited_action )( NactWindow *window );
 	void        ( *field_modified )   ( NactWindow *window );
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index 1813b05..bf5f36d 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -38,9 +38,9 @@
 #include <common/na-utils.h>
 
 #include "nact-application.h"
-#include "nact-main-window.h"
-#include "nact-icommand-tab.h"
+#include "nact-statusbar.h"
 #include "nact-iprefs.h"
+#include "nact-icommand-tab.h"
 
 /* private interface data
  */
@@ -56,15 +56,12 @@ struct NactICommandTabInterfacePrivate {
  */
 #define LEGEND_DIALOG_IS_VISIBLE			"iconditions-legend-dialog-visible"
 
-/* ICommandTab properties, set on the main window
- */
 #define PROP_ICOMMAND_TAB_STATUS_CONTEXT	"iconditions-status-context"
 
 static GType            register_type( void );
 static void             interface_base_init( NactICommandTabInterface *klass );
 static void             interface_base_finalize( NactICommandTabInterface *klass );
 
-static GtkWidget       *v_get_status_bar( NactWindow *window );
 static NAActionProfile *v_get_edited_profile( NactWindow *window );
 static void             v_field_modified( NactWindow *window );
 static void             v_get_isfiledir( NactWindow *window, gboolean *isfile, gboolean *isdir );
@@ -89,11 +86,6 @@ static void             hide_legend_dialog( NactWindow *window );
 static GtkButton       *get_legend_button( NactWindow *window );
 static GtkWindow       *get_legend_dialog( NactWindow *window );
 
-static void             display_status( NactWindow *window, const gchar *status );
-static void             hide_status( NactWindow *window );
-static guint            get_status_context( NactWindow *window );
-static void             set_status_context( NactWindow *window, guint context );
-
 GType
 nact_icommand_tab_get_type( void )
 {
@@ -169,13 +161,6 @@ nact_icommand_tab_initial_load( NactWindow *dialog )
 {
 	static const gchar *thisfn = "nact_icommand_tab_initial_load";
 	g_debug( "%s: dialog=%p", thisfn, dialog );
-
-	GtkWidget *status_bar = v_get_status_bar( dialog );
-	if( status_bar ){
-		g_assert( GTK_IS_STATUSBAR( status_bar ));
-		guint context = gtk_statusbar_get_context_id( GTK_STATUSBAR( status_bar ), "nact-iaction-tab" );
-		set_status_context( dialog, context );
-	}
 }
 
 void
@@ -263,16 +248,6 @@ nact_icommand_tab_has_label( NactWindow *window )
 	return( g_utf8_strlen( label, -1 ) > 0 );
 }
 
-static GtkWidget *
-v_get_status_bar( NactWindow *window )
-{
-	if( NACT_ICOMMAND_TAB_GET_INTERFACE( window )->get_status_bar ){
-		return( NACT_ICOMMAND_TAB_GET_INTERFACE( window )->get_status_bar( window ));
-	}
-
-	return( NULL );
-}
-
 static NAActionProfile *
 v_get_edited_profile( NactWindow *window )
 {
@@ -352,14 +327,14 @@ on_label_changed( GtkEntry *entry, gpointer user_data )
 static void
 check_for_label( NactWindow *window, GtkEntry *entry, const gchar *label )
 {
-	hide_status( window );
+	nact_statusbar_hide_status( NACT_MAIN_WINDOW( window ), PROP_ICOMMAND_TAB_STATUS_CONTEXT );
 	set_label_label( window, "black" );
 
 	NAActionProfile *edited = v_get_edited_profile( window );
 
 	if( edited && g_utf8_strlen( label, -1 ) == 0 ){
 		/* i18n: status bar message when the profile label is empty */
-		display_status( window, _( "Caution: a label is mandatory for the profile." ));
+		nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_ICOMMAND_TAB_STATUS_CONTEXT, _( "Caution: a label is mandatory for the profile." ));
 		set_label_label( window, "red" );
 	}
 }
@@ -740,31 +715,3 @@ get_legend_dialog( NactWindow *window )
 {
 	return( base_window_get_dialog( BASE_WINDOW( window ), "LegendDialog" ));
 }
-
-static void
-display_status( NactWindow *window, const gchar *status )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( window );
-	gtk_statusbar_push( GTK_STATUSBAR( bar ), context, status );
-}
-
-static void
-hide_status( NactWindow *window )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( window );
-	gtk_statusbar_pop( GTK_STATUSBAR( bar ), context );
-}
-
-static guint
-get_status_context( NactWindow *window )
-{
-	return( GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( window ), PROP_ICOMMAND_TAB_STATUS_CONTEXT )));
-}
-
-static void
-set_status_context( NactWindow *window, guint context )
-{
-	g_object_set_data( G_OBJECT( window ), PROP_ICOMMAND_TAB_STATUS_CONTEXT, GUINT_TO_POINTER( context ));
-}
diff --git a/src/nact/nact-icommand-tab.h b/src/nact/nact-icommand-tab.h
index 4fa8ff1..18895c3 100644
--- a/src/nact/nact-icommand-tab.h
+++ b/src/nact/nact-icommand-tab.h
@@ -55,7 +55,6 @@ typedef struct {
 	NactICommandTabInterfacePrivate *private;
 
 	/* api */
-	GtkWidget *       ( *get_status_bar )    ( NactWindow *window );
 	NAActionProfile * ( *get_edited_profile )( NactWindow *window );
 	void              ( *field_modified )    ( NactWindow *window );
 	void              ( *get_isfiledir )     ( NactWindow *window, gboolean *is_file, gboolean *is_dir );
diff --git a/src/nact/nact-imenubar.c b/src/nact/nact-imenubar.c
index 24079c5..c601f17 100644
--- a/src/nact/nact-imenubar.c
+++ b/src/nact/nact-imenubar.c
@@ -37,6 +37,7 @@
 #include "nact-application.h"
 #include "nact-assistant-export.h"
 #include "nact-assistant-import.h"
+#include "nact-statusbar.h"
 #include "nact-imenubar.h"
 
 /* private interface data
@@ -96,8 +97,6 @@ static void       on_about_activated( GtkMenuItem *item, NactWindow *window );
 static void       on_about_selected( GtkItem *item, NactWindow *window );
 
 static void       on_menu_item_deselected( GtkItem *item, NactWindow *window );
-static void       display_status( NactWindow *window, const gchar *status );
-static void       hide_status( NactWindow *window );
 
 static void       v_add_action( NactWindow *window, NAAction *action );
 static void       v_add_profile( NactWindow *window, NAActionProfile *profile );
@@ -107,7 +106,6 @@ static void       v_free_deleted_actions( NactWindow *window );
 static void       v_push_removed_action( NactWindow *window, NAAction *action );
 static GSList    *v_get_actions( NactWindow *window );
 static NAObject  *v_get_selected( NactWindow *window );
-static GtkWidget *v_get_status_bar( NactWindow *window );
 static void       v_setup_dialog_title( NactWindow *window );
 static void       v_update_actions_list( NactWindow *window );
 static void       v_select_actions_list( NactWindow *window, GType type, const gchar *uuid, const gchar *label );
@@ -116,8 +114,6 @@ static gint       v_count_modified_actions( NactWindow *window );
 static void       v_reload_actions( NactWindow *window );
 static void       v_on_save( NactWindow *window );
 
-static guint      get_status_context( NactMainWindow *window );
-static void       set_status_context( NactMainWindow *window, guint context );
 static GtkWidget *get_new_profile_item( NactWindow *window );
 static void       set_new_profile_item( NactWindow *window, GtkWidget *item );
 static GtkWidget *get_save_item( NactWindow *window );
@@ -241,13 +237,6 @@ nact_imenubar_init( NactMainWindow *window )
 	create_edit_menu( window, GTK_MENU_BAR( menubar ));
 	create_tools_menu( window, GTK_MENU_BAR( menubar ));
 	create_help_menu( window, GTK_MENU_BAR( menubar ));
-
-	GtkWidget *status_bar = v_get_status_bar( NACT_WINDOW( window ));
-	if( status_bar ){
-		g_assert( GTK_IS_STATUSBAR( status_bar ));
-		guint context = gtk_statusbar_get_context_id( GTK_STATUSBAR( status_bar ), "nact-imenubar" );
-		set_status_context( window, context );
-	}
 }
 
 /**
@@ -438,7 +427,7 @@ static void
 on_new_action_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the 'New action' item */
-	display_status( window, _( "Define a new action." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Define a new action." ));
 }
 
 static void
@@ -464,7 +453,7 @@ static void
 on_new_profile_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the 'New profile' item */
-	display_status( window, _( "Define a new profile attached to the current action." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Define a new profile attached to the current action." ));
 }
 
 static void
@@ -560,7 +549,7 @@ static void
 on_save_selected( GtkMenuItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting 'Save' item */
-	display_status( window, _( "Record all the modified actions. Invalid actions will be silently ignored." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Record all the modified actions. Invalid actions will be silently ignored." ));
 }
 
 static void
@@ -579,7 +568,7 @@ static void
 on_quit_selected( GtkMenuItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting 'Quit' item */
-	display_status( window, _( "Quit the application." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Quit the application." ));
 }
 
 static void
@@ -683,7 +672,7 @@ static void
 on_duplicate_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the Duplicate item */
-	display_status( window, _( "Create a copy of the selected action or profile." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Create a copy of the selected action or profile." ));
 }
 
 static void
@@ -727,7 +716,7 @@ static void
 on_delete_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the Delete item */
-	display_status( window, _( "Remove the selected action or profile from your configuration." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Remove the selected action or profile from your configuration." ));
 }
 
 static void
@@ -759,7 +748,7 @@ static void
 on_reload_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the 'Reload' item */
-	display_status( window, _( " Cancel your current modifications and reload the list of actions." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( " Cancel your current modifications and reload the list of actions." ));
 }
 
 static void
@@ -784,7 +773,7 @@ static void
 on_import_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the Import item */
-	display_status( window, _( "Import one or more actions from external (XML) files into your configuration." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Import one or more actions from external (XML) files into your configuration." ));
 }
 
 static void
@@ -804,7 +793,7 @@ static void
 on_export_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the Export item */
-	display_status( window, _( "Export one or more actions from your configuration to external XML files." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Export one or more actions from your configuration to external XML files." ));
 }
 
 static void
@@ -816,7 +805,7 @@ static void
 on_help_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the Help item */
-	display_status( window, _( "Display help about this program." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Display help about this program." ));
 }
 
 /* TODO: make the website url and the mail addresses clickables
@@ -890,29 +879,13 @@ static void
 on_about_selected( GtkItem *item, NactWindow *window )
 {
 	/* i18n: tooltip displayed in the status bar when selecting the About item */
-	display_status( window, _( "Display informations about this program." ));
+	nact_statusbar_display_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT, _( "Display informations about this program." ));
 }
 
 static void
 on_menu_item_deselected( GtkItem *item, NactWindow *window )
 {
-	hide_status( window );
-}
-
-static void
-display_status( NactWindow *window, const gchar *status )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( NACT_MAIN_WINDOW( window ));
-	gtk_statusbar_push( GTK_STATUSBAR( bar ), context, status );
-}
-
-static void
-hide_status( NactWindow *window )
-{
-	GtkWidget *bar = v_get_status_bar( window );
-	guint context = get_status_context( NACT_MAIN_WINDOW( window ));
-	gtk_statusbar_pop( GTK_STATUSBAR( bar ), context );
+	nact_statusbar_hide_status( NACT_MAIN_WINDOW( window ), PROP_IMENUBAR_STATUS_CONTEXT );
 }
 
 static void
@@ -985,16 +958,6 @@ v_get_selected( NactWindow *window )
 	return( NULL );
 }
 
-static GtkWidget *
-v_get_status_bar( NactWindow *window )
-{
-	if( NACT_IMENUBAR_GET_INTERFACE( window )->get_status_bar ){
-		return( NACT_IMENUBAR_GET_INTERFACE( window )->get_status_bar( window ));
-	}
-
-	return( NULL );
-}
-
 static void
 v_setup_dialog_title( NactWindow *window )
 {
@@ -1055,18 +1018,6 @@ v_on_save( NactWindow *window )
 	}
 }
 
-static guint
-get_status_context( NactMainWindow *window )
-{
-	return( GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( window ), PROP_IMENUBAR_STATUS_CONTEXT )));
-}
-
-static void
-set_status_context( NactMainWindow *window, guint context )
-{
-	g_object_set_data( G_OBJECT( window ), PROP_IMENUBAR_STATUS_CONTEXT, GUINT_TO_POINTER( context ));
-}
-
 static GtkWidget *
 get_new_profile_item( NactWindow *window )
 {
diff --git a/src/nact/nact-imenubar.h b/src/nact/nact-imenubar.h
index 024255d..c9410ca 100644
--- a/src/nact/nact-imenubar.h
+++ b/src/nact/nact-imenubar.h
@@ -63,7 +63,6 @@ typedef struct {
 	void        ( *push_removed_action )   ( NactWindow *window, NAAction *action );
 	GSList *    ( *get_actions )           ( NactWindow *window );
 	NAObject *  ( *get_selected )          ( NactWindow *window );
-	GtkWidget * ( *get_status_bar )        ( NactWindow *window );
 	void        ( *setup_dialog_title )    ( NactWindow *window );
 	void        ( *update_actions_list )   ( NactWindow *window );
 	void        ( *select_actions_list )   ( NactWindow *window, GType type, const gchar *uuid, const gchar *label );
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 4a08492..216d7f1 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -60,8 +60,6 @@ struct NactMainWindowClassPrivate {
  */
 struct NactMainWindowPrivate {
 	gboolean         dispose_has_run;
-	GtkStatusbar    *status_bar;
-	guint            status_context;
 	gint             initial_count;
 	GSList          *actions;
 	NAAction        *edited_action;
@@ -92,7 +90,6 @@ static void             instance_finalize( GObject *application );
 static gchar           *get_iprefs_window_id( NactWindow *window );
 static gchar           *get_toplevel_name( BaseWindow *window );
 static GSList          *get_actions( NactWindow *window );
-static GtkWidget       *get_status_bar( NactWindow *window );
 
 static void             on_initial_load_toplevel( BaseWindow *window );
 static void             on_runtime_init_toplevel( BaseWindow *window );
@@ -123,12 +120,6 @@ static GSList          *get_deleted_actions( NactWindow *window );
 static void             free_deleted_actions( NactWindow *window );
 static void             push_removed_action( NactWindow *window, NAAction *action );
 
-/*static void     on_new_button_clicked( GtkButton *button, gpointer user_data );
-static void     on_edit_button_clicked( GtkButton *button, gpointer user_data );
-static void     on_duplicate_button_clicked( GtkButton *button, gpointer user_data );
-static void     on_delete_button_clicked( GtkButton *button, gpointer user_data );
-static gboolean on_dialog_response( GtkDialog *dialog, gint response_id, BaseWindow *window );*/
-
 static void             update_actions_list( NactWindow *window );
 static gboolean         on_delete_event( BaseWindow *window, GtkWindow *toplevel, GdkEvent *event );
 static gint             count_actions( NactWindow *window );
@@ -282,7 +273,6 @@ iaction_tab_iface_init( NactIActionTabInterface *iface )
 	static const gchar *thisfn = "nact_main_window_iaction_tab_iface_init";
 	g_debug( "%s: iface=%p", thisfn, iface );
 
-	iface->get_status_bar = get_status_bar;
 	iface->get_selected = nact_iactions_list_get_selected_object;
 	iface->get_edited_action = get_edited_action;
 	iface->field_modified = on_modified_field;
@@ -294,7 +284,6 @@ icommand_tab_iface_init( NactICommandTabInterface *iface )
 	static const gchar *thisfn = "nact_main_window_icommand_tab_iface_init";
 	g_debug( "%s: iface=%p", thisfn, iface );
 
-	iface->get_status_bar = get_status_bar;
 	iface->get_edited_profile = get_edited_profile;
 	iface->field_modified = on_modified_field;
 	iface->get_isfiledir = get_isfiledir;
@@ -336,7 +325,6 @@ imenubar_iface_init( NactIMenubarInterface *iface )
 	iface->push_removed_action = push_removed_action;
 	iface->get_actions = get_actions;
 	iface->get_selected = nact_iactions_list_get_selected_object;
-	iface->get_status_bar = get_status_bar;
 	iface->setup_dialog_title = setup_dialog_title;
 	iface->update_actions_list = update_actions_list;
 	iface->select_actions_list = nact_iactions_list_set_selection;
@@ -458,6 +446,19 @@ nact_main_window_action_exists( const NactMainWindow *window, const gchar *uuid
 	return( FALSE );
 }
 
+/**
+ * Returns the status bar widget
+ */
+GtkStatusbar *
+nact_main_window_get_statusbar( const NactMainWindow *window )
+{
+	g_assert( NACT_IS_MAIN_WINDOW( window ));
+
+	GtkWidget *statusbar = base_window_get_widget( BASE_WINDOW( window ), "StatusBar" );
+
+	return( GTK_STATUSBAR( statusbar ));
+}
+
 static gchar *
 get_iprefs_window_id( NactWindow *window )
 {
@@ -477,13 +478,6 @@ get_actions( NactWindow *window )
 	return( NACT_MAIN_WINDOW( window )->private->actions );
 }
 
-static GtkWidget *
-get_status_bar( NactWindow *window )
-{
-	g_assert( NACT_IS_MAIN_WINDOW( window ));
-	return( GTK_WIDGET( NACT_MAIN_WINDOW( window )->private->status_bar ));
-}
-
 /*
  * note that for this NactMainWindow, on_initial_load_toplevel and
  * on_runtime_init_toplevel are equivalent, as there is only one
@@ -504,9 +498,6 @@ on_initial_load_toplevel( BaseWindow *window )
 	g_assert( NACT_IS_MAIN_WINDOW( window ));
 	NactMainWindow *wnd = NACT_MAIN_WINDOW( window );
 
-	wnd->private->status_bar = GTK_STATUSBAR( base_window_get_widget( window, "StatusBar" ));
-	wnd->private->status_context = gtk_statusbar_get_context_id( wnd->private->status_bar, "nact-main-window" );
-
 	nact_imenubar_init( wnd );
 
 	g_assert( NACT_IS_IACTIONS_LIST( window ));
diff --git a/src/nact/nact-main-window.h b/src/nact/nact-main-window.h
index 6058e9f..77cbd45 100644
--- a/src/nact/nact-main-window.h
+++ b/src/nact/nact-main-window.h
@@ -70,6 +70,7 @@ NactMainWindow *nact_main_window_new( BaseApplication *application );
 
 GSList         *nact_main_window_get_actions( const NactMainWindow *window );
 gboolean        nact_main_window_action_exists( const NactMainWindow *window, const gchar *uuid );
+GtkStatusbar   *nact_main_window_get_statusbar( const NactMainWindow *window );
 
 enum {
 	ACTION_TAB = 0,



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