[nautilus-actions] BaseIPrefs interface: remove get_wp_id() method
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] BaseIPrefs interface: remove get_wp_id() method
- Date: Thu, 3 Feb 2011 00:51:30 +0000 (UTC)
commit d608f3ebae1b3950529f17b90c1535ceb6263687
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Feb 2 21:56:36 2011 +0100
BaseIPrefs interface: remove get_wp_id() method
Convert it to a base-window-wsp-name BaseWindow property.
ChangeLog | 28 +++++++
src/core/na-settings.c | 1 +
src/core/na-settings.h | 1 +
src/nact/base-iprefs.c | 144 ++++++++------------------------
src/nact/base-iprefs.h | 21 +----
src/nact/base-window.c | 80 +++++++------------
src/nact/base-window.h | 16 +----
src/nact/nact-add-capability-dialog.c | 13 +---
src/nact/nact-add-scheme-dialog.c | 13 +---
src/nact/nact-assistant-export.c | 13 +---
src/nact/nact-assistant-import.c | 13 +---
src/nact/nact-confirm-logout.c | 2 +
src/nact/nact-export-ask.c | 13 +---
src/nact/nact-gtk-utils.c | 22 +++---
src/nact/nact-icommand-tab.c | 4 +-
src/nact/nact-icon-chooser.c | 25 ++----
src/nact/nact-ifolders-tab.c | 4 +-
src/nact/nact-main-window.c | 10 +--
src/nact/nact-preferences-editor.c | 13 +---
19 files changed, 139 insertions(+), 297 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3d8a00b..d4ae293 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,33 @@
2011-02-02 Pierre Wieser <pwieser trychlos org>
+ Convert the get_wp_id() BaseIPrefsInterface method to "base-window-wsp-name"
+ BaseWindow property
+
+ * src/core/na-settings.c:
+ * src/core/na-settings.h: New NA_IPREFS_CONFIRM_LOGOUT_WSP user preference.
+
+ * src/nact/base-iprefs.c:
+ * src/nact/base-iprefs.h
+ (base_iprefs_position_named_window, base_iprefs_save_named_window_position):
+ Removed functions.
+ (get_wsp_id): Remove interface method.
+
+ * src/nact/base-window.c:
+ * src/nact/base-window.h: New BASE_PROP_WSP_NAME BaseWindow property.
+
+ * src/nact/nact-add-capability-dialog.c:
+ * src/nact/nact-add-scheme-dialog.c:
+ * src/nact/nact-assistant-export.c:
+ * src/nact/nact-assistant-import.c:
+ * src/nact/nact-confirm-logout.c:
+ * src/nact/nact-export-ask.c:
+ * src/nact/nact-gtk-utils.c:
+ * src/nact/nact-icommand-tab.c:
+ * src/nact/nact-icon-chooser.c:
+ * src/nact/nact-ifolders-tab.c:
+ * src/nact/nact-main-window.c:
+ * src/nact/nact-preferences-editor.c: Updated accordingly.
+
* src/core/na-updater.c:
* src/core/na-updater.h (na_updater_are_preferences_locked): New function.
diff --git a/src/core/na-settings.c b/src/core/na-settings.c
index 3c57926..23deb1f 100644
--- a/src/core/na-settings.c
+++ b/src/core/na-settings.c
@@ -112,6 +112,7 @@ static const KeyDef st_def_keys[] = {
{ NA_IPREFS_COMMAND_CHOOSER_WSP, GROUP_NACT, NA_BOXED_TYPE_UINT_LIST, "" },
{ NA_IPREFS_COMMAND_CHOOSER_URI, GROUP_NACT, NA_BOXED_TYPE_STRING, "file:///bin" },
{ NA_IPREFS_COMMAND_LEGEND_WSP, GROUP_NACT, NA_BOXED_TYPE_UINT_LIST, "" },
+ { NA_IPREFS_CONFIRM_LOGOUT_WSP, GROUP_NACT, NA_BOXED_TYPE_UINT_LIST, "" },
{ NA_IPREFS_WORKING_DIR_WSP, GROUP_NACT, NA_BOXED_TYPE_UINT_LIST, "" },
{ NA_IPREFS_WORKING_DIR_URI, GROUP_NACT, NA_BOXED_TYPE_STRING, "file:///" },
{ NA_IPREFS_SHOW_IF_RUNNING_WSP, GROUP_NACT, NA_BOXED_TYPE_UINT_LIST, "" },
diff --git a/src/core/na-settings.h b/src/core/na-settings.h
index 152e800..ac4b468 100644
--- a/src/core/na-settings.h
+++ b/src/core/na-settings.h
@@ -103,6 +103,7 @@ GType na_settings_get_type( void );
#define NA_IPREFS_COMMAND_CHOOSER_WSP "command-command-chooser-wsp"
#define NA_IPREFS_COMMAND_CHOOSER_URI "command-command-chooser-lfu"
#define NA_IPREFS_COMMAND_LEGEND_WSP "command-legend-wsp"
+#define NA_IPREFS_CONFIRM_LOGOUT_WSP "confirm-logout-wsp"
#define NA_IPREFS_WORKING_DIR_WSP "command-working-dir-chooser-wsp"
#define NA_IPREFS_WORKING_DIR_URI "command-working-dir-chooser-lfu"
#define NA_IPREFS_SHOW_IF_RUNNING_WSP "environment-show-if-running-wsp"
diff --git a/src/nact/base-iprefs.c b/src/nact/base-iprefs.c
index 2d61428..527230d 100644
--- a/src/nact/base-iprefs.c
+++ b/src/nact/base-iprefs.c
@@ -33,6 +33,8 @@
#include <config.h>
#endif
+#include <string.h>
+
#include <core/na-iprefs.h>
#include <core/na-settings.h>
@@ -52,8 +54,6 @@ static GType register_type( void );
static void interface_base_init( BaseIPrefsInterface *klass );
static void interface_base_finalize( BaseIPrefsInterface *klass );
-static gchar *get_wsp_id( const BaseWindow *window );
-
static NASettings *get_settings( const BaseWindow *window );
static GList *read_int_list( const BaseWindow *window, const gchar *key );
static void write_int_list( const BaseWindow *window, const gchar *key, GList *list );
@@ -111,8 +111,6 @@ interface_base_init( BaseIPrefsInterface *klass )
klass->private = g_new0( BaseIPrefsInterfacePrivate, 1 );
- klass->get_wsp_id = NULL;
-
st_initialized = TRUE;
}
}
@@ -135,46 +133,17 @@ interface_base_finalize( BaseIPrefsInterface *klass )
/**
* base_iprefs_position_window:
* @window: this #BaseWindow-derived window.
+ * @wsp_name: the string which handles the window size and position in user preferences.
*
* Position the specified window on the screen.
*
* A window position is stored as a list of integers "x,y,width,height".
*/
void
-base_iprefs_position_window( const BaseWindow *window )
+base_iprefs_restore_window_position( const BaseWindow *window, const gchar *wsp_name )
{
+ static const gchar *thisfn = "base_iprefs_restore_window_position";
GtkWindow *toplevel;
- gchar *key;
-
- g_return_if_fail( BASE_IS_WINDOW( window ));
- g_return_if_fail( BASE_IS_IPREFS( window ));
-
- if( st_initialized && !st_finalized ){
-
- key = get_wsp_id( window );
- if( key ){
- toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( window ));
- base_iprefs_position_named_window( window, toplevel, key );
- g_free( key );
- }
- }
-}
-
-/**
- * base_iprefs_position_named_window:
- * @window: this #BaseWindow-derived window.
- * @toplevel: the toplevel #GtkWindow whose size and position are to be
- * set.
- * @key: the string id of this toplevel.
- *
- * Positions the specified window on the screen, maximizing it by the
- * actual current screen size. Note that this is a rough approximation
- * as some of the screen is reserved by deskbars and so...
- */
-void
-base_iprefs_position_named_window( const BaseWindow *window, GtkWindow *toplevel, const gchar *key )
-{
- static const gchar *thisfn = "base_iprefs_position_named_window";
GList *list;
gint x=0, y=0, width=0, height=0;
GdkDisplay *display;
@@ -182,32 +151,31 @@ base_iprefs_position_named_window( const BaseWindow *window, GtkWindow *toplevel
gint screen_width, screen_height;
g_return_if_fail( BASE_IS_WINDOW( window ));
- g_return_if_fail( BASE_IS_IPREFS( window ));
+ g_return_if_fail( wsp_name && strlen( wsp_name ));
- if( st_initialized && !st_finalized ){
+ toplevel = base_window_get_gtk_toplevel( window );
- g_debug( "%s: window=%p (%s), toplevel=%p (%s), key=%s",
- thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window ),
- ( void * ) toplevel, G_OBJECT_TYPE_NAME( toplevel ), key );
+ g_debug( "%s: window=%p (%s), toplevel=%p (%s), wsp_name=%s",
+ thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window ),
+ ( void * ) toplevel, G_OBJECT_TYPE_NAME( toplevel ), wsp_name );
- list = read_int_list( window, key );
+ list = read_int_list( window, wsp_name );
- if( list ){
- int_list_to_position( window, list, &x, &y, &width, &height );
- g_debug( "%s: key=%s, x=%d, y=%d, width=%d, height=%d", thisfn, key, x, y, width, height );
- free_int_list( list );
- }
+ if( list ){
+ int_list_to_position( window, list, &x, &y, &width, &height );
+ g_debug( "%s: wsp_name=%s, x=%d, y=%d, width=%d, height=%d", thisfn, wsp_name, x, y, width, height );
+ free_int_list( list );
+ }
- if( width > 0 && height > 0 ){
- display = gdk_display_get_default();
- screen = gdk_display_get_screen( display, 0 );
- screen_width = gdk_screen_get_width( screen );
- screen_height = gdk_screen_get_height( screen );
+ if( width > 0 && height > 0 ){
+ display = gdk_display_get_default();
+ screen = gdk_display_get_screen( display, 0 );
+ screen_width = gdk_screen_get_width( screen );
+ screen_height = gdk_screen_get_height( screen );
- if(( x+width < screen_width ) && ( y+height < screen_height )){
- gtk_window_move( toplevel, x, y );
- gtk_window_resize( toplevel, width, height );
- }
+ if(( x+width < screen_width ) && ( y+height < screen_height )){
+ gtk_window_move( toplevel, x, y );
+ gtk_window_resize( toplevel, width, height );
}
}
}
@@ -215,71 +183,31 @@ base_iprefs_position_named_window( const BaseWindow *window, GtkWindow *toplevel
/**
* base_iprefs_save_window_position:
* @window: this #BaseWindow-derived window.
+ * @wsp_name: the string which handles the window size and position in user preferences.
*
* Save the size and position of the specified window.
*/
void
-base_iprefs_save_window_position( const BaseWindow *window )
+base_iprefs_save_window_position( const BaseWindow *window, const gchar *wsp_name )
{
+ static const gchar *thisfn = "base_iprefs_save_window_position";
GtkWindow *toplevel;
- gchar *key;
-
- g_return_if_fail( BASE_IS_WINDOW( window ));
- g_return_if_fail( BASE_IS_IPREFS( window ));
-
- if( st_initialized && !st_finalized ){
-
- key = get_wsp_id( window );
- if( key ){
- toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( window ));
- base_iprefs_save_named_window_position( window, toplevel, key );
- g_free( key );
- }
- }
-}
-
-/**
- * base_iprefs_save_named_window_position:
- * @window: this #BaseWindow-derived window.
- * @toplevel: the #GtkWindow whose size and position are to be saved.
- * @key: the name of the window.
- *
- * Save size and position of the specified window.
- */
-void
-base_iprefs_save_named_window_position( const BaseWindow *window, GtkWindow *toplevel, const gchar *key )
-{
- static const gchar *thisfn = "base_iprefs_save_named_window_position";
gint x, y, width, height;
GList *list;
g_return_if_fail( BASE_IS_WINDOW( window ));
- g_return_if_fail( BASE_IS_IPREFS( window ));
-
- if( st_initialized && !st_finalized ){
+ g_return_if_fail( wsp_name && strlen( wsp_name ));
- if( GTK_IS_WINDOW( toplevel )){
- gtk_window_get_position( toplevel, &x, &y );
- gtk_window_get_size( toplevel, &width, &height );
- g_debug( "%s: key=%s, x=%d, y=%d, width=%d, height=%d", thisfn, key, x, y, width, height );
+ toplevel = base_window_get_gtk_toplevel( window );
+ g_return_if_fail( GTK_IS_WINDOW( toplevel ));
- list = position_to_int_list( window, x, y, width, height );
- write_int_list( window, key, list );
- free_int_list( list );
- }
- }
-}
-
-static gchar *
-get_wsp_id( const BaseWindow *window )
-{
- g_return_val_if_fail( BASE_IS_IPREFS( window ), NULL );
-
- if( BASE_IPREFS_GET_INTERFACE( window )->get_wsp_id ){
- return( BASE_IPREFS_GET_INTERFACE( window )->get_wsp_id( window ));
- }
+ gtk_window_get_position( toplevel, &x, &y );
+ gtk_window_get_size( toplevel, &width, &height );
+ g_debug( "%s: wsp_name=%s, x=%d, y=%d, width=%d, height=%d", thisfn, wsp_name, x, y, width, height );
- return( NULL );
+ list = position_to_int_list( window, x, y, width, height );
+ write_int_list( window, wsp_name, list );
+ free_int_list( list );
}
/* It seems inevitable that preferences are attached to the application.
diff --git a/src/nact/base-iprefs.h b/src/nact/base-iprefs.h
index 5ce3c74..a1b553b 100644
--- a/src/nact/base-iprefs.h
+++ b/src/nact/base-iprefs.h
@@ -60,28 +60,15 @@ typedef struct {
/*< private >*/
GTypeInterface parent;
BaseIPrefsInterfacePrivate *private;
-
- /*< public >*/
- /**
- * get_wsp_id:
- * @window: the #BaseWindow which implements this interface.
- *
- * Invoked when we need the string which holds the size and position
- * of the window in the user preferences.
- *
- * The implementation should returns a newly allocated ASCII string
- * which will be g_free() by #BaseIPrefs internals.
- */
- gchar * ( *get_wsp_id )( const BaseWindow *window );
}
BaseIPrefsInterface;
GType base_iprefs_get_type( void );
-void base_iprefs_position_window ( const BaseWindow *window );
-void base_iprefs_position_named_window ( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );
-void base_iprefs_save_window_position ( const BaseWindow *window );
-void base_iprefs_save_named_window_position( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );
+void base_iprefs_restore_window_position ( const BaseWindow *window, const gchar *wsp_name );
+/*void base_iprefs_position_named_window ( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );*/
+void base_iprefs_save_window_position ( const BaseWindow *window, const gchar *wsp_name );
+/*void base_iprefs_save_named_window_position( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );*/
G_END_DECLS
diff --git a/src/nact/base-window.c b/src/nact/base-window.c
index 9374822..c4999dd 100644
--- a/src/nact/base-window.c
+++ b/src/nact/base-window.c
@@ -60,6 +60,7 @@ struct _BaseWindowPrivate {
gchar *xmlui_filename;
gboolean has_own_builder;
gchar *toplevel_name;
+ gchar *wsp_name;
/* internals
*/
@@ -87,6 +88,7 @@ enum {
BASE_PROP_XMLUI_FILENAME_ID,
BASE_PROP_HAS_OWN_BUILDER_ID,
BASE_PROP_TOPLEVEL_NAME_ID,
+ BASE_PROP_WSP_NAME_ID,
BASE_PROP_N_PROPERTIES
};
@@ -127,7 +129,6 @@ static void do_initialize_gtk_toplevel( BaseWindow *window, GtkWindow *tople
*/
static void on_initialize_base_window_class_handler( BaseWindow *window );
static void do_initialize_base_window( BaseWindow *window );
-static gchar *get_wsp_id( const BaseWindow *window );
static void on_all_widgets_showed_class_handler( BaseWindow *window );
static gboolean do_run( BaseWindow *window, GtkWindow *toplevel );
static gboolean is_main_window( BaseWindow *window );
@@ -235,11 +236,18 @@ class_init( BaseWindowClass *klass )
"",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE ));
+ g_object_class_install_property( object_class, BASE_PROP_WSP_NAME_ID,
+ g_param_spec_string(
+ BASE_PROP_WSP_NAME,
+ _( "WSP name" ),
+ _( "The string which handles the window size and position in user preferences" ),
+ "",
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE ));
+
klass->private = g_new0( BaseWindowClassPrivate, 1 );
klass->initialize_gtk_toplevel = do_initialize_gtk_toplevel;
klass->initialize_base_window = do_initialize_base_window;
- klass->get_wsp_id = NULL;
klass->all_widgets_showed = NULL;
klass->run = do_run;
klass->is_willing_to_quit = NULL;
@@ -313,8 +321,6 @@ iprefs_base_iface_init( BaseIPrefsInterface *iface )
static const gchar *thisfn = "base_window_iprefs_base_iface_init";
g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
-
- iface->get_wsp_id = get_wsp_id;
}
static void
@@ -374,6 +380,10 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
g_value_set_string( value, self->private->toplevel_name );
break;
+ case BASE_PROP_WSP_NAME_ID:
+ g_value_set_string( value, self->private->wsp_name );
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
break;
@@ -414,6 +424,11 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
self->private->toplevel_name = g_value_dup_string( value );
break;
+ case BASE_PROP_WSP_NAME_ID:
+ g_free( self->private->wsp_name );
+ self->private->wsp_name = g_value_dup_string( value );
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
break;
@@ -436,7 +451,7 @@ instance_dispose( GObject *window )
g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window ));
- base_iprefs_save_window_position( self );
+ base_iprefs_save_window_position( self, self->private->wsp_name );
/* signals must be deconnected before quitting main loop
*/
@@ -760,31 +775,6 @@ base_window_run( BaseWindow *window )
if( BASE_WINDOW_GET_CLASS( window )->run ){
code = BASE_WINDOW_GET_CLASS( window )->run( window, window->private->gtk_toplevel );
}
-
-#if 0
- if( is_main_window( window )){
- if( GTK_IS_DIALOG( window->private->gtk_toplevel )){
- g_signal_connect( G_OBJECT( window->private->gtk_toplevel ), "response", G_CALLBACK( on_dialog_response ), window );
- } else {
- g_signal_connect( G_OBJECT( window->private->gtk_toplevel ), "delete-event", G_CALLBACK( on_delete_event ), window );
- }
-
- g_debug( "%s: application=%p, starting gtk_main", thisfn, ( void * ) window->private->application );
- gtk_main();
-
- } else if( GTK_IS_ASSISTANT( window->private->gtk_toplevel )){
- g_debug( "%s: starting gtk_main", thisfn );
- gtk_main();
-
- } else {
- g_return_val_if_fail( GTK_IS_DIALOG( window->private->gtk_toplevel ), code );
- g_debug( "%s: starting gtk_dialog_run", thisfn );
- do {
- code = gtk_dialog_run( GTK_DIALOG( toplevel ));
- }
- while( !on_dialog_response( GTK_DIALOG( toplevel ), code, window ));
- }
-#endif
}
}
@@ -823,27 +813,10 @@ do_initialize_base_window( BaseWindow *window )
if( !window->private->dispose_has_run ){
- base_iprefs_position_window( window );
+ base_iprefs_restore_window_position( window, window->private->wsp_name );
}
}
-static gchar *
-get_wsp_id( const BaseWindow *window )
-{
- gchar *id = NULL;
-
- g_return_val_if_fail( BASE_IS_WINDOW( window ), NULL );
-
- if( !window->private->dispose_has_run ){
-
- if( BASE_WINDOW_GET_CLASS( window )->get_wsp_id ){
- id = BASE_WINDOW_GET_CLASS( window )->get_wsp_id( window );
- }
- }
-
- return( id );
-}
-
static void
on_all_widgets_showed_class_handler( BaseWindow *window )
{
@@ -903,10 +876,15 @@ is_main_window( BaseWindow *window )
}
/*
- * handler of "delete-event" message connected on the main window Gtk toplevel
- * our own function does nothing, and let the signal be propagated
+ * Handler of "delete-event" message connected on the main window Gtk toplevel
+ *
+ * Our own function does nothing, and let the signal be propagated
* it so ends up in the default class handler for this signal
- * which just destroys the toplevel
+ * which just destroys the toplevel.
+ *
+ * The main window should really connect to this signal and stop its
+ * propagation, at least if it does not want the user be able to abruptly
+ * terminate the application.
*/
static gboolean
on_delete_event( GtkWidget *toplevel, GdkEvent *event, BaseWindow *window )
diff --git a/src/nact/base-window.h b/src/nact/base-window.h
index dbc5ab9..0a14a5e 100644
--- a/src/nact/base-window.h
+++ b/src/nact/base-window.h
@@ -98,7 +98,6 @@ typedef struct _BaseWindowClassPrivate BaseWindowClassPrivate;
* BaseWindowClass:
* @initialize_gtk_toplevel: initialize the toplevel GtkWindow
* @initialize_base_window: initialize the BaseWindow
- * @get_wsp_id: returns the string which handles size and position preferences
* @all_widgets_showed: all widgets have been showed
* @run: run the dialog box loop
* @is_willing_to_quit: asks if the window is willing to quit
@@ -145,20 +144,6 @@ typedef struct {
void ( *initialize_base_window ) ( BaseWindow *window );
/**
- * get_wsp_id:
- * @window: this #BaseWindow instance.
- *
- * Asks the derived class for the string which must be used to
- * store last size and position of the window in user preferences.
- *
- * The returned string will be g_free() by the BaseIPrefs internals.
- *
- * This delegates to #BaseWindow -derived classes the BaseIPrefs
- * interface method.
- */
- gchar * ( *get_wsp_id ) ( const BaseWindow *window );
-
- /**
* all_widgets_showed:
* @window: this #BaseWindow instance.
*
@@ -213,6 +198,7 @@ typedef struct {
#define BASE_PROP_XMLUI_FILENAME "base-window-xmlui-filename"
#define BASE_PROP_HAS_OWN_BUILDER "base-window-has-own-builder"
#define BASE_PROP_TOPLEVEL_NAME "base-window-toplevel-name"
+#define BASE_PROP_WSP_NAME "base-window-wsp-name"
/**
* Signals defined by the BaseWindow class.
diff --git a/src/nact/nact-add-capability-dialog.c b/src/nact/nact-add-capability-dialog.c
index d914ae4..71a92f4 100644
--- a/src/nact/nact-add-capability-dialog.c
+++ b/src/nact/nact-add-capability-dialog.c
@@ -82,6 +82,7 @@ static CapabilityTextStruct st_caps[] = {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-add-capability.ui";
static const gchar *st_toplevel_name = "AddCapabilityDialog";
+static const gchar *st_wsp_name = NA_IPREFS_CAPABILITY_ADD_CAPABILITY_WSP;
static GObjectClass *st_parent_class = NULL;
@@ -93,7 +94,6 @@ static void instance_finalize( GObject *dialog );
static void on_base_initialize_gtk_toplevel( NactAddCapabilityDialog *editor, GtkDialog *toplevel );
static void on_base_initialize_base_window( NactAddCapabilityDialog *editor );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactAddCapabilityDialog *editor );
static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddCapabilityDialog *editor );
static void on_cancel_clicked( GtkButton *button, NactAddCapabilityDialog *editor );
@@ -149,7 +149,6 @@ class_init( NactAddCapabilityDialogClass *klass )
{
static const gchar *thisfn = "nact_add_capability_dialog_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseDialogClass *dialog_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -162,9 +161,6 @@ class_init( NactAddCapabilityDialogClass *klass )
klass->private = g_new0( NactAddCapabilityDialogClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
dialog_class = BASE_DIALOG_CLASS( klass );
dialog_class->ok = on_dialog_ok;
}
@@ -276,6 +272,7 @@ nact_add_capability_dialog_run( BaseWindow *parent, GSList *capabilities )
BASE_PROP_PARENT, parent,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
dialog->private->already_used = na_core_utils_slist_duplicate( capabilities );
@@ -382,12 +379,6 @@ on_base_initialize_base_window( NactAddCapabilityDialog *dialog )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_CAPABILITY_ADD_CAPABILITY_WSP ));
-}
-
static void
on_base_all_widgets_showed( NactAddCapabilityDialog *dialog )
{
diff --git a/src/nact/nact-add-scheme-dialog.c b/src/nact/nact-add-scheme-dialog.c
index 9b32737..a5d821d 100644
--- a/src/nact/nact-add-scheme-dialog.c
+++ b/src/nact/nact-add-scheme-dialog.c
@@ -57,6 +57,7 @@ struct _NactAddSchemeDialogPrivate {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-add-scheme.ui";
static const gchar *st_toplevel_name = "AddSchemeDialog";
+static const gchar *st_wsp_name = NA_IPREFS_SCHEME_ADD_SCHEME_WSP;
static GObjectClass *st_parent_class = NULL;
@@ -68,7 +69,6 @@ static void instance_finalize( GObject *dialog );
static void on_base_initialize_gtk_toplevel( NactAddSchemeDialog *editor, GtkDialog *toplevel );
static void on_base_initialize_base_window( NactAddSchemeDialog *editor );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactAddSchemeDialog *editor );
static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddSchemeDialog *dialog );
static void on_cancel_clicked( GtkButton *button, NactAddSchemeDialog *editor );
@@ -120,7 +120,6 @@ class_init( NactAddSchemeDialogClass *klass )
{
static const gchar *thisfn = "nact_add_scheme_dialog_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseDialogClass *dialog_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -133,9 +132,6 @@ class_init( NactAddSchemeDialogClass *klass )
klass->private = g_new0( NactAddSchemeDialogClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
dialog_class = BASE_DIALOG_CLASS( klass );
dialog_class->ok = on_dialog_ok;
}
@@ -248,6 +244,7 @@ nact_add_scheme_dialog_run( BaseWindow *parent, GSList *schemes )
BASE_PROP_PARENT, parent,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
dialog->private->already_used = na_core_utils_slist_duplicate( schemes );
@@ -317,12 +314,6 @@ on_base_initialize_base_window( NactAddSchemeDialog *dialog )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_SCHEME_ADD_SCHEME_WSP ));
-}
-
static void
on_base_all_widgets_showed( NactAddSchemeDialog *dialog )
{
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 9a4de24..41f580a 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -96,6 +96,7 @@ typedef struct {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-assistant-export.ui";
static const gchar *st_toplevel_name = "ExportAssistant";
+static const gchar *st_wsp_name = NA_IPREFS_EXPORT_ASSISTANT_WSP;
static BaseAssistantClass *st_parent_class = NULL;
@@ -108,7 +109,6 @@ static void instance_finalize( GObject *application );
static void on_base_initialize_gtk_toplevel( NactAssistantExport *dialog, GtkAssistant *toplevel );
static void on_base_initialize_base_window( NactAssistantExport *dialog );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactAssistantExport *dialog );
static void assist_initial_load_intro( NactAssistantExport *window, GtkAssistant *assistant );
@@ -190,7 +190,6 @@ class_init( NactAssistantExportClass *klass )
{
static const gchar *thisfn = "nact_assistant_export_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseAssistantClass *assist_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -203,9 +202,6 @@ class_init( NactAssistantExportClass *klass )
klass->private = g_new0( NactAssistantExportClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
assist_class = BASE_ASSISTANT_CLASS( klass );
assist_class->apply = assistant_apply;
assist_class->prepare = assistant_prepare;
@@ -322,6 +318,7 @@ nact_assistant_export_run( BaseWindow *main_window )
BASE_PROP_HAS_OWN_BUILDER, TRUE,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
BASE_PROP_QUIT_ON_ESCAPE, esc_quit,
BASE_PROP_WARN_ON_ESCAPE, esc_confirm,
NULL );
@@ -384,12 +381,6 @@ on_base_initialize_base_window( NactAssistantExport *dialog )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_EXPORT_ASSISTANT_WSP ));
-}
-
static void
on_base_all_widgets_showed( NactAssistantExport *dialog )
{
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index 53042dc..e092027 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -80,6 +80,7 @@ struct _NactAssistantImportPrivate {
static const gchar *st_xmlui_filename = PKGDATADIR "/nautilus-actions-config-tool.ui";
static const gchar *st_toplevel_name = "ImportAssistant";
+static const gchar *st_wsp_name = NA_IPREFS_IMPORT_ASSISTANT_WSP;
static BaseAssistantClass *st_parent_class = NULL;
@@ -90,7 +91,6 @@ static void instance_dispose( GObject *application );
static void instance_finalize( GObject *application );
static void on_base_initialize_base_window( NactAssistantImport *dialog );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void runtime_init_intro( NactAssistantImport *window, GtkAssistant *assistant );
static void runtime_init_file_selector( NactAssistantImport *window, GtkAssistant *assistant );
static void on_file_selection_changed( GtkFileChooser *chooser, gpointer user_data );
@@ -149,7 +149,6 @@ class_init( NactAssistantImportClass *klass )
{
static const gchar *thisfn = "nact_assistant_import_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseAssistantClass *assist_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -162,9 +161,6 @@ class_init( NactAssistantImportClass *klass )
klass->private = g_new0( NactAssistantImportClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
assist_class = BASE_ASSISTANT_CLASS( klass );
assist_class->apply = assistant_apply;
assist_class->prepare = assistant_prepare;
@@ -266,6 +262,7 @@ nact_assistant_import_run( BaseWindow *main_window )
BASE_PROP_HAS_OWN_BUILDER, TRUE,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
BASE_PROP_QUIT_ON_ESCAPE, esc_quit,
BASE_PROP_WARN_ON_ESCAPE, esc_confirm,
NULL );
@@ -292,12 +289,6 @@ on_base_initialize_base_window( NactAssistantImport *dialog )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_IMPORT_ASSISTANT_WSP ));
-}
-
static void
runtime_init_intro( NactAssistantImport *window, GtkAssistant *assistant )
{
diff --git a/src/nact/nact-confirm-logout.c b/src/nact/nact-confirm-logout.c
index f5112dc..1266a44 100644
--- a/src/nact/nact-confirm-logout.c
+++ b/src/nact/nact-confirm-logout.c
@@ -55,6 +55,7 @@ enum {
};
static const gchar *st_toplevel_name = "ConfirmLogoutDialog";
+static const gchar *st_wsp_name = NA_IPREFS_CONFIRM_LOGOUT_WSP;
static BaseDialogClass *st_parent_class = NULL;
@@ -203,6 +204,7 @@ nact_confirm_logout_run( NactMainWindow *parent )
dialog = g_object_new( NACT_CONFIRM_LOGOUT_TYPE,
BASE_PROP_PARENT, parent,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
base_window_run( BASE_WINDOW( dialog ));
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index 752de87..c3d45ff 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -65,6 +65,7 @@ struct _NactExportAskPrivate {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-assistant-export.ui";
static const gchar *st_toplevel_name = "ExportAskDialog";
+static const gchar *st_wsp_name = NA_IPREFS_EXPORT_ASK_USER_WSP;
static BaseDialogClass *st_parent_class = NULL;
@@ -76,7 +77,6 @@ static void instance_finalize( GObject *dialog );
static void on_base_initialize_gtk_toplevel( NactExportAsk *editor, GtkDialog *toplevel );
static void on_base_initialize_base_window( NactExportAsk *editor );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void keep_choice_on_toggled( GtkToggleButton *button, NactExportAsk *editor );
static void on_cancel_clicked( GtkButton *button, NactExportAsk *editor );
static void on_ok_clicked( GtkButton *button, NactExportAsk *editor );
@@ -124,7 +124,6 @@ class_init( NactExportAskClass *klass )
{
static const gchar *thisfn = "nact_export_ask_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -135,9 +134,6 @@ class_init( NactExportAskClass *klass )
object_class->finalize = instance_finalize;
klass->private = g_new0( NactExportAskClassPrivate, 1 );
-
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
}
static void
@@ -258,6 +254,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
BASE_PROP_PARENT, parent,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
editor->private->format = format;
@@ -347,12 +344,6 @@ on_base_initialize_base_window( NactExportAsk *editor )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_EXPORT_ASK_USER_WSP ));
-}
-
static void
keep_choice_on_toggled( GtkToggleButton *button, NactExportAsk *editor )
{
diff --git a/src/nact/nact-gtk-utils.c b/src/nact/nact-gtk-utils.c
index dd58226..9d134ce 100644
--- a/src/nact/nact-gtk-utils.c
+++ b/src/nact/nact-gtk-utils.c
@@ -393,7 +393,7 @@ nact_gtk_utils_render( const gchar *name, GtkImage *widget, GtkIconSize size )
* nact_gtk_utils_select_file:
* @window: the #BaseWindow which will be the parent of the dialog box.
* @title: the title of the dialog box.
- * @dialog_name: the name of the dialog box in Preferences to read/write
+ * @wsp_name: the name of the dialog box in Preferences to read/write
* its size and position.
* @entry: the #GtkEntry which is associated with the selected file.
* @entry_name: the name of the entry in Preferences to be read/written.
@@ -408,18 +408,18 @@ nact_gtk_utils_render( const gchar *name, GtkImage *widget, GtkIconSize size )
*/
void
nact_gtk_utils_select_file( BaseWindow *window,
- const gchar *title, const gchar *dialog_name,
+ const gchar *title, const gchar *wsp_name,
GtkWidget *entry, const gchar *entry_name )
{
nact_gtk_utils_select_file_with_preview(
- window, title, dialog_name, entry, entry_name, NULL );
+ window, title, wsp_name, entry, entry_name, NULL );
}
/**
* nact_gtk_utils_select_file_with_preview:
* @window: the #BaseWindow which will be the parent of the dialog box.
* @title: the title of the dialog box.
- * @dialog_name: the name of the dialog box in Preferences to read/write
+ * @wsp_name: the name of the dialog box in Preferences to read/write
* its size and position.
* @entry: the #GtkEntry which is associated with the selected file.
* @entry_name: the name of the entry in Preferences to be read/written.
@@ -436,7 +436,7 @@ nact_gtk_utils_select_file( BaseWindow *window,
*/
void
nact_gtk_utils_select_file_with_preview( BaseWindow *window,
- const gchar *title, const gchar *dialog_name,
+ const gchar *title, const gchar *wsp_name,
GtkWidget *entry, const gchar *entry_name,
GCallback update_preview_cb )
{
@@ -469,7 +469,7 @@ nact_gtk_utils_select_file_with_preview( BaseWindow *window,
g_signal_connect( dialog, "update-preview", update_preview_cb, preview );
}
- base_iprefs_position_named_window( window, GTK_WINDOW( dialog ), dialog_name );
+ base_iprefs_restore_window_position( window, wsp_name );
text = gtk_entry_get_text( GTK_ENTRY( entry ));
@@ -494,7 +494,7 @@ nact_gtk_utils_select_file_with_preview( BaseWindow *window,
na_settings_set_string( settings, entry_name, uri );
g_free( uri );
- base_iprefs_save_named_window_position( window, GTK_WINDOW( dialog ), dialog_name );
+ base_iprefs_save_window_position( window, wsp_name );
gtk_widget_destroy( dialog );
}
@@ -503,7 +503,7 @@ nact_gtk_utils_select_file_with_preview( BaseWindow *window,
* nact_gtk_utils_select_dir:
* @window: the #BaseWindow which will be the parent of the dialog box.
* @title: the title of the dialog box.
- * @dialog_name: the name of the dialog box in Preferences to read/write
+ * @wsp_name: the name of the dialog box in Preferences to read/write
* its size and position.
* @entry: the #GtkEntry which is associated with the field.
* @entry_name: the name of the entry in Preferences to be read/written.
@@ -520,7 +520,7 @@ nact_gtk_utils_select_file_with_preview( BaseWindow *window,
*/
void
nact_gtk_utils_select_dir( BaseWindow *window,
- const gchar *title, const gchar *dialog_name,
+ const gchar *title, const gchar *wsp_name,
GtkWidget *entry, const gchar *entry_name )
{
NactApplication *application;
@@ -545,7 +545,7 @@ nact_gtk_utils_select_dir( BaseWindow *window,
NULL
);
- base_iprefs_position_named_window( window, GTK_WINDOW( dialog ), dialog_name );
+ base_iprefs_restore_window_position( window, wsp_name );
text = gtk_entry_get_text( GTK_ENTRY( entry ));
@@ -570,7 +570,7 @@ nact_gtk_utils_select_dir( BaseWindow *window,
na_settings_set_string( settings, entry_name, uri );
g_free( uri );
- base_iprefs_save_named_window_position( window, GTK_WINDOW( dialog ), dialog_name );
+ base_iprefs_save_window_position( window, wsp_name );
gtk_widget_destroy( dialog );
}
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index 8b38aa6..aad7558 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -465,7 +465,7 @@ legend_dialog_hide( NactICommandTab *instance )
if( is_visible ){
g_return_if_fail( GTK_IS_WINDOW( legend_dialog ));
- base_iprefs_save_named_window_position( BASE_WINDOW( instance ), legend_dialog, NA_IPREFS_COMMAND_LEGEND_WSP );
+ base_iprefs_save_window_position( BASE_WINDOW( instance ), NA_IPREFS_COMMAND_LEGEND_WSP );
gtk_widget_hide( GTK_WIDGET( legend_dialog ));
/* set the legend button state consistent for when the dialog is
@@ -490,7 +490,7 @@ legend_dialog_show( NactICommandTab *instance )
toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( instance ));
gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
- base_iprefs_position_named_window( BASE_WINDOW( instance ), legend_dialog, NA_IPREFS_COMMAND_LEGEND_WSP );
+ base_iprefs_restore_window_position( BASE_WINDOW( instance ), NA_IPREFS_COMMAND_LEGEND_WSP );
gtk_widget_show( GTK_WIDGET( legend_dialog ));
g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( TRUE ));
diff --git a/src/nact/nact-icon-chooser.c b/src/nact/nact-icon-chooser.c
index 54230a3..8f895ac 100644
--- a/src/nact/nact-icon-chooser.c
+++ b/src/nact/nact-icon-chooser.c
@@ -91,6 +91,7 @@ enum {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-icon-chooser.ui";
static const gchar *st_toplevel_name = "IconChooserDialog";
+static const gchar *st_wsp_name = NA_IPREFS_ICON_CHOOSER_WSP;
static BaseDialogClass *st_parent_class = NULL;
@@ -106,7 +107,6 @@ static void do_initialize_icons_by_path( NactIconChooser *editor );
static void on_base_initialize_base_window( NactIconChooser *editor );
static void fillup_themed_icons( NactIconChooser *editor );
static void fillup_icons_by_path( NactIconChooser *editor );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactIconChooser *editor );
static void on_cancel_clicked( GtkButton *button, NactIconChooser *editor );
@@ -168,7 +168,6 @@ class_init( NactIconChooserClass *klass )
{
static const gchar *thisfn = "nact_icon_chooser_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseDialogClass *dialog_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -181,9 +180,6 @@ class_init( NactIconChooserClass *klass )
klass->private = g_new0( NactIconChooserClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
dialog_class = BASE_DIALOG_CLASS( klass );
dialog_class->cancel = on_dialog_cancel;
}
@@ -300,6 +296,7 @@ nact_icon_chooser_choose_icon( BaseWindow *parent, const gchar *icon_name )
BASE_PROP_PARENT, parent,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
editor->private->main_window = parent;
@@ -517,20 +514,14 @@ fillup_icons_by_path( NactIconChooser *editor )
gtk_file_chooser_set_filename( file_chooser, editor->private->current_icon );
}
- base_window_signal_connect(
- BASE_WINDOW( editor ), G_OBJECT( file_chooser ), "selection-changed", G_CALLBACK( on_path_selection_changed ));
+ base_window_signal_connect( BASE_WINDOW( editor ),
+ G_OBJECT( file_chooser ), "selection-changed", G_CALLBACK( on_path_selection_changed ));
- base_window_signal_connect(
- BASE_WINDOW( editor ), G_OBJECT( file_chooser ), "update-preview", G_CALLBACK( on_path_update_preview ));
+ base_window_signal_connect( BASE_WINDOW( editor ),
+ G_OBJECT( file_chooser ), "update-preview", G_CALLBACK( on_path_update_preview ));
- base_window_signal_connect_by_name(
- BASE_WINDOW( editor ), "PathApplyButton", "clicked", G_CALLBACK( on_path_apply_button_clicked ));
-}
-
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_ICON_CHOOSER_WSP ));
+ base_window_signal_connect_by_name( BASE_WINDOW( editor ),
+ "PathApplyButton", "clicked", G_CALLBACK( on_path_apply_button_clicked ));
}
static void
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index 949c23d..8cefca5 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -290,7 +290,7 @@ on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
updater = nact_application_get_updater( application );
settings = na_pivot_get_settings( NA_PIVOT( updater ));
- base_iprefs_position_named_window( window, GTK_WINDOW( dialog ), NA_IPREFS_FOLDER_CHOOSER_WSP );
+ base_iprefs_restore_window_position( window, NA_IPREFS_FOLDER_CHOOSER_WSP );
uri = na_settings_get_string( settings, NA_IPREFS_FOLDER_CHOOSER_URI, NULL, NULL );
if( uri && g_utf8_strlen( uri, -1 )){
@@ -309,7 +309,7 @@ on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
g_free( uri );
}
- base_iprefs_save_named_window_position( window, GTK_WINDOW( dialog ), NA_IPREFS_FOLDER_CHOOSER_WSP );
+ base_iprefs_save_window_position( window, NA_IPREFS_FOLDER_CHOOSER_WSP );
gtk_widget_destroy( dialog );
}
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 70e2692..ec67618 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -141,6 +141,7 @@ enum {
static const gchar *st_xmlui_filename = PKGDATADIR "/nautilus-actions-config-tool.ui";
static const gchar *st_toplevel_name = "MainWindow";
+static const gchar *st_wsp_name = NA_IPREFS_MAIN_WINDOW_WSP;
static NactWindowClass *st_parent_class = NULL;
static gint st_signals[ LAST_SIGNAL ] = { 0 };
@@ -168,7 +169,6 @@ static void instance_finalize( GObject *application );
static void on_base_initialize_gtk_toplevel( NactMainWindow *window, GtkWindow *toplevel, gpointer user_data );
static void on_base_initialize_base_window( NactMainWindow *window, gpointer user_data );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactMainWindow *window, gpointer user_data );
static gboolean actually_delete_item( NactMainWindow *window, NAObject *item, NAUpdater *updater, GList **not_deleted, GSList **messages );
@@ -390,7 +390,6 @@ class_init( NactMainWindowClass *klass )
klass->private = g_new0( NactMainWindowClassPrivate, 1 );
base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
base_class->is_willing_to_quit = base_is_willing_to_quit;
/**
@@ -807,6 +806,7 @@ nact_main_window_new( const NactApplication *application )
BASE_PROP_APPLICATION, application,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
nact_menubar_new( BASE_WINDOW( window ));
@@ -917,12 +917,6 @@ on_base_initialize_base_window( NactMainWindow *window, gpointer user_data )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_MAIN_WINDOW_WSP ));
-}
-
static void
on_base_all_widgets_showed( NactMainWindow *window, gpointer user_data )
{
diff --git a/src/nact/nact-preferences-editor.c b/src/nact/nact-preferences-editor.c
index 1de566e..5d6fb9c 100644
--- a/src/nact/nact-preferences-editor.c
+++ b/src/nact/nact-preferences-editor.c
@@ -92,6 +92,7 @@ struct _NactPreferencesEditorPrivate {
static const gchar *st_xmlui_filename = PKGDATADIR "/nact-preferences.ui";
static const gchar *st_toplevel_name = "PreferencesDialog";
+static const gchar *st_wsp_name = NA_IPREFS_PREFERENCES_WSP;
static GObjectClass *st_parent_class = NULL;
static guint st_last_tab = 0;
@@ -104,7 +105,6 @@ static void instance_finalize( GObject *dialog );
static void on_base_initialize_gtk_toplevel( NactPreferencesEditor *editor, GtkDialog *toplevel );
static void on_base_initialize_base_window( NactPreferencesEditor *editor );
-static gchar *on_base_get_wsp_id( const BaseWindow *window );
static void on_base_all_widgets_showed( NactPreferencesEditor *editor );
static void order_mode_setup( NactPreferencesEditor *editor, NAPivot *pivot );
static void order_mode_on_alpha_asc_toggled( GtkToggleButton *togglebutton, NactPreferencesEditor *editor );
@@ -180,7 +180,6 @@ class_init( NactPreferencesEditorClass *klass )
{
static const gchar *thisfn = "nact_preferences_editor_class_init";
GObjectClass *object_class;
- BaseWindowClass *base_class;
BaseDialogClass *dialog_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -193,9 +192,6 @@ class_init( NactPreferencesEditorClass *klass )
klass->private = g_new0( NactPreferencesEditorClassPrivate, 1 );
- base_class = BASE_WINDOW_CLASS( klass );
- base_class->get_wsp_id = on_base_get_wsp_id;
-
dialog_class = BASE_DIALOG_CLASS( klass );
dialog_class->ok = on_dialog_ok;
}
@@ -297,6 +293,7 @@ nact_preferences_editor_run( BaseWindow *parent )
BASE_PROP_PARENT, parent,
BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
BASE_PROP_TOPLEVEL_NAME, st_toplevel_name,
+ BASE_PROP_WSP_NAME, st_wsp_name,
NULL );
application = NACT_APPLICATION( base_window_get_application( parent ));
@@ -414,12 +411,6 @@ on_base_initialize_base_window( NactPreferencesEditor *editor )
}
}
-static gchar *
-on_base_get_wsp_id( const BaseWindow *window )
-{
- return( g_strdup( NA_IPREFS_PREFERENCES_WSP ));
-}
-
static void
on_base_all_widgets_showed( NactPreferencesEditor *editor )
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]