Commit 49d3065d authored by Pierre Wieser's avatar Pierre Wieser

Remove BaseApplication::get_ui_filename() virtual method

Also remove base_application_get_ui_filename() function
+ src/nact/nact-application.c: updated accordingly.
parent 7dea783c
2011-01-21 Pierre Wieser <pwieser@trychlos.org>
* src/nact/base-application.c:
* src/nact/base-application.h
(base_application_get_ui_filename): Removed function.
(get_ui_filename): Removed virtual method.
* src/nact/nact-application.c
(appli_get_gtkbuilder_filename):Removed function.
* src/nact/base-window.c (base_window_init): Rewrite BaseWindow initialization.
* src/nact/nact-main-window.c (nact_main_window_new):
......
......@@ -740,38 +740,6 @@ base_application_get_builder( const BaseApplication *application )
return( builder );
}
/**
* base_application_get_ui_filename:
* @application: this #BaseApplication instance.
*
* Asks the #BaseApplication-derived class for the filename of the file
* which contains the XML definition of the user interface.
*
* Defaults to empty.
*
* Returns: a newly allocated string to be g_free() by the caller.
*/
gchar *
base_application_get_ui_filename( BaseApplication *application )
{
/*static const gchar *thisfn = "base_application_get_ui_filename";
g_debug( "%s: icon=%p", thisfn, application );*/
gchar *name = NULL;
g_return_val_if_fail( BASE_IS_APPLICATION( application ), NULL );
if( !application->private->dispose_has_run ){
if( BASE_APPLICATION_GET_CLASS( application )->get_ui_filename ){
name = BASE_APPLICATION_GET_CLASS( application )->get_ui_filename( application );
} else {
name = g_strdup( "" );
}
}
return( name );
}
/**
* base_application_message_dlg:
* @application: this #BaseApplication instance.
......
......@@ -135,23 +135,6 @@ typedef struct {
* -derived object. It may or may not have already been initialized.
*/
GObject * ( *main_window_new )( const BaseApplication *appli, int *code );
/**
* get_ui_filename:
* @appli: this #BaseApplication instance.
*
* Asks the derived class for the filename of the XML definition of
* the user interface. This XML definition must be suitable in order
* to be loaded via GtkBuilder.
*
* No default is provided by the base class. If the base class does
* not provide one, then the program stops and exits with the code
* %APPLICATION_ERROR_UI_FNAME.
*
* Returns: the filename of the XML definition, to be g_free() by
* the caller.
*/
gchar * ( *get_ui_filename ) ( BaseApplication *appli );
}
BaseApplicationClass;
......@@ -181,7 +164,11 @@ typedef enum {
BASE_EXIT_CODE_ARGS,
BASE_EXIT_CODE_UNIQUE_APP,
BASE_EXIT_CODE_MAIN_WINDOW,
BASE_EXIT_CODE_USER_APP
/*
* BaseApplication -derived class may use program return codes
* starting with this value
*/
BASE_EXIT_CODE_USER_APP = 32
}
BaseExitCode;
......@@ -192,8 +179,6 @@ int base_application_run( BaseApplication *application );
gchar *base_application_get_application_name( const BaseApplication *application );
BaseBuilder *base_application_get_builder ( const BaseApplication *application );
gchar *base_application_get_ui_filename( BaseApplication *application );
void base_application_message_dlg( BaseApplication *application, GSList *message );
void base_application_error_dlg( BaseApplication *application, GtkMessageType type, const gchar *first, const gchar *second );
gboolean base_application_yesno_dlg( BaseApplication *application, GtkMessageType type, const gchar *first, const gchar *second );
......
......@@ -92,8 +92,6 @@ static void instance_finalize( GObject *application );
static gboolean appli_manage_options( const BaseApplication *application, int *code );
static GObject *appli_main_window_new( const BaseApplication *application, int *code );
static gchar *appli_get_gtkbuilder_filename( BaseApplication *application );
GType
nact_application_get_type( void )
{
......@@ -161,8 +159,6 @@ class_init( NactApplicationClass *klass )
appli_class = BASE_APPLICATION_CLASS( klass );
appli_class->manage_options = appli_manage_options;
appli_class->main_window_new = appli_main_window_new;
appli_class->get_ui_filename = appli_get_gtkbuilder_filename;
}
static void
......@@ -387,9 +383,3 @@ nact_application_get_updater( NactApplication *application )
return( updater );
}
static gchar *
appli_get_gtkbuilder_filename( BaseApplication *application )
{
return( g_strdup( PKGDATADIR "/nautilus-actions-config-tool.ui" ));
}
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