Commit 35b3cdd5 authored by Pierre Wieser's avatar Pierre Wieser

Rename base_builder_load_named_toplevel() as base_builder_get_toplevel_by_name()

parent b6e861a8
2011-01-22 Pierre Wieser <pwieser@trychlos.org>
* src/nact/base-builder.c:
* src/nact/base-builder.h (base_builder_load_named_toplevel):
Renamed as base_builder_get_toplevel_by_name().
* src/nact/base-window.c: Updated accordingly.
2011-01-21 Pierre Wieser <pwieser@trychlos.org>
* src/nact/base-window.c:
......
......@@ -231,7 +231,7 @@ base_builder_add_from_file( BaseBuilder *builder, const gchar *filename, GError
}
/**
* base_builder_load_named_toplevel:
* base_builder_get_toplevel_by_name:
* @builder: this #BaseBuilder object.
* @name: the name of the searched toplevel window.
*
......@@ -243,7 +243,7 @@ base_builder_add_from_file( BaseBuilder *builder, const gchar *filename, GError
* g_free() nor g_object_unref() by the caller.
*/
GtkWindow *
base_builder_load_named_toplevel( BaseBuilder *builder, const gchar *name )
base_builder_get_toplevel_by_name( BaseBuilder *builder, const gchar *name )
{
GtkWindow *toplevel = NULL;
......
......@@ -74,11 +74,13 @@ typedef struct {
GType base_builder_get_type( void );
BaseBuilder *base_builder_new( void );
BaseBuilder *base_builder_new ( void );
gboolean base_builder_add_from_file( BaseBuilder *builder, const gchar *filename, GError **error );
gboolean base_builder_add_from_file ( BaseBuilder *builder, const gchar *filename, GError **error );
GtkWindow *base_builder_load_named_toplevel( BaseBuilder *builder, const gchar *name );
GtkWindow *base_builder_get_toplevel_by_name( BaseBuilder *builder, const gchar *name );
/*GtkWidget *base_builder_get_gtk_widget_by_name ( BaseBuilder *builder, GtkWindow *toplevel, const gchar *name );*/
G_END_DECLS
......
......@@ -663,7 +663,7 @@ load_gtk_toplevel( const BaseWindow *window )
if( toplevel_name ){
if( strlen( toplevel_name )){
g_return_val_if_fail( BASE_IS_BUILDER( window->private->builder ), FALSE );
gtk_toplevel = base_builder_load_named_toplevel( window->private->builder, toplevel_name );
gtk_toplevel = base_builder_get_toplevel_by_name( window->private->builder, toplevel_name );
if( !gtk_toplevel ){
msg = g_strdup_printf( _( "Unable to load %s dialog definition." ), toplevel_name );
......@@ -784,33 +784,6 @@ base_window_get_application( const BaseWindow *window )
return( application );
}
/**
* base_window_get_gtk_toplevel_by_name:
* @window: this #BaseWindow instance.
* @name: the name of the searched GtkWindow.
*
* Returns: the named top-level GtkWindow.
*
* This is just a convenience function to be able to open quickly a
* window (e.g. Legend dialog).
*
* The caller may close the window by g_object_unref()-ing the returned
* #GtkWindow.
*/
GtkWindow *
base_window_get_gtk_toplevel_by_name( const BaseWindow *window, const gchar *name )
{
GtkWindow *toplevel = NULL;
g_return_val_if_fail( BASE_IS_WINDOW( window ), NULL );
if( !window->private->dispose_has_run ){
toplevel = load_named_toplevel( window, name );
}
return( toplevel );
}
/**
* base_window_get_parent:
* @window: this #BaseWindow instance..
......@@ -857,6 +830,33 @@ base_window_get_gtk_toplevel( const BaseWindow *window )
return( toplevel );
}
/**
* base_window_get_gtk_toplevel_by_name:
* @window: this #BaseWindow instance.
* @name: the name of the searched GtkWindow.
*
* Returns: the named top-level GtkWindow.
*
* This is just a convenience function to be able to open quickly a
* window (e.g. Legend dialog).
*
* The caller may close the window by g_object_unref()-ing the returned
* #GtkWindow.
*/
GtkWindow *
base_window_get_gtk_toplevel_by_name( const BaseWindow *window, const gchar *name )
{
GtkWindow *toplevel = NULL;
g_return_val_if_fail( BASE_IS_WINDOW( window ), NULL );
if( !window->private->dispose_has_run ){
toplevel = load_named_toplevel( window, name );
}
return( toplevel );
}
/**
* base_window_get_widget:
* @window: this #BaseWindow instance.
......@@ -1227,13 +1227,13 @@ load_named_toplevel( const BaseWindow *window, const gchar *name )
if( window->private->builder ){
g_return_val_if_fail( BASE_IS_BUILDER( window->private->builder ), NULL );
toplevel = base_builder_load_named_toplevel( window->private->builder, name );
toplevel = base_builder_get_toplevel_by_name( window->private->builder, name );
}
if( !toplevel ){
application = base_window_get_application( window );
builder = base_application_get_builder( application );
toplevel = base_builder_load_named_toplevel( builder, name );
toplevel = base_builder_get_toplevel_by_name( builder, name );
}
if( !toplevel ){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment