[nautilus-actions] Refactoring: update nact classes
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Refactoring: update nact classes
- Date: Fri, 19 Feb 2010 02:28:07 +0000 (UTC)
commit 59538d1f330c5711f71ea4cb0af2c1069fb578a9
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Feb 17 11:05:29 2010 +0100
Refactoring: update nact classes
ChangeLog | 10 ++
src/nact/nact-assistant-export.c | 137 +++++------------------
src/nact/nact-assistant-export.h | 4 +-
src/nact/nact-assistant-export.ui | 221 +++----------------------------------
src/nact/nact-assistant-import.c | 6 +-
src/nact/nact-import-ask.c | 138 ++++++++++-------------
src/nact/nact-import-ask.h | 44 ++++----
src/nact/nact-iprefs.c | 73 ++++++-------
src/nact/nact-iprefs.h | 15 ++-
src/nact/nact-tree-model.h | 2 +-
10 files changed, 194 insertions(+), 456 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index db7a274..021f31e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2009-02-17 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-assistant-export.c:
+ * src/nact/nact-assistant-export.h:
+ * src/nact/nact-assistant-export.ui:
+ * src/nact/nact-assistant-import.c:
+ * src/nact/nact-import-ask.c:
+ * src/nact/nact-import-ask.h:
+ * src/nact/nact-iprefs.c:
+ * src/nact/nact-iprefs.h:
+ * src/nact/nact-tree-model.h: Update Nact classes.
+
Refactor: move all XML code to src/io-xml plugin.
* src/nact/Makefile.am:
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 6cb647b..b118853 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -40,15 +40,16 @@
#include <api/na-object-api.h>
#include <core/na-iprefs.h>
+#include <core/na-exporter.h>
#include "base-iprefs.h"
#include "nact-application.h"
#include "nact-iprefs.h"
#include "nact-main-window.h"
#include "nact-assistant-export.h"
-#include "nact-assistant-export-ask.h"
+#include "nact-export-ask.h"
+#include "nact-export-format.h"
#include "nact-iactions-list.h"
-#include "na-exporter.h"
/* Export Assistant
*
@@ -86,10 +87,10 @@ struct NactAssistantExportPrivate {
};
typedef struct {
- NAObjectAction *action;
- GSList *msg;
- gchar *fname;
- gint format;
+ NAObjectItem *item;
+ GSList *msg;
+ gchar *fname;
+ GQuark format;
}
ExportStruct;
@@ -126,11 +127,7 @@ static void on_folder_selection_changed( GtkFileChooser *chooser, gpo
static void assist_initial_load_format( NactAssistantExport *window, GtkAssistant *assistant );
static void assist_runtime_init_format( NactAssistantExport *window, GtkAssistant *assistant );
-static GtkWidget *get_gconfschemav1_button( NactAssistantExport *window );
-static GtkWidget *get_gconfschemav2_button( NactAssistantExport *window );
-static GtkWidget *get_gconfdump_button( NactAssistantExport *window );
-static GtkWidget *get_ask_button( NactAssistantExport *window );
-static gint get_export_format( NactAssistantExport *window );
+static GQuark get_export_format( NactAssistantExport *window );
static void assist_initial_load_confirm( NactAssistantExport *window, GtkAssistant *assistant );
static void assist_runtime_init_confirm( NactAssistantExport *window, GtkAssistant *assistant );
@@ -558,88 +555,39 @@ on_folder_selection_changed( GtkFileChooser *chooser, gpointer user_data )
static void
assist_initial_load_format( NactAssistantExport *window, GtkAssistant *assistant )
{
+ NactApplication *application;
+ NAUpdater *updater;
+ GtkWidget *container;
+
+ application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
+ updater = nact_application_get_updater( application );
+ container = base_window_get_widget( BASE_WINDOW( window ), "AssistantExportFormatVBox" );
+ nact_export_format_display( NA_PIVOT( updater ), container, EXPORT_FORMAT_DISPLAY_ASSISTANT );
}
static void
assist_runtime_init_format( NactAssistantExport *window, GtkAssistant *assistant )
{
- GtkToggleButton *button;
GtkWidget *content;
- guint format;
+ GtkWidget *container;
+ GQuark format;
format = nact_iprefs_get_export_format( BASE_WINDOW( window ), IPREFS_EXPORT_FORMAT );
-
- switch( format ){
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1:
- button = GTK_TOGGLE_BUTTON( get_gconfschemav1_button( window ));
- gtk_toggle_button_set_active( button, TRUE );
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V2:
- button = GTK_TOGGLE_BUTTON( get_gconfschemav2_button( window ));
- gtk_toggle_button_set_active( button, TRUE );
- break;
-
- case IPREFS_EXPORT_FORMAT_ASK:
- button = GTK_TOGGLE_BUTTON( get_ask_button( window ));
- gtk_toggle_button_set_active( button, TRUE );
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_ENTRY:
- default:
- button = GTK_TOGGLE_BUTTON( get_gconfdump_button( window ));
- gtk_toggle_button_set_active( button, TRUE );
- break;
- }
+ container = base_window_get_widget( BASE_WINDOW( window ), "AssistantExportFormatVBox" );
+ nact_export_format_select( container, format );
content = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION );
gtk_assistant_set_page_complete( assistant, content, TRUE );
}
-static GtkWidget *
-get_gconfschemav1_button( NactAssistantExport *window )
-{
- return( base_window_get_widget( BASE_WINDOW( window ), "ExportSchemaV1Button" ));
-}
-
-static GtkWidget *
-get_gconfschemav2_button( NactAssistantExport *window )
-{
- return( base_window_get_widget( BASE_WINDOW( window ), "ExportSchemaV2Button" ));
-}
-
-static GtkWidget *
-get_gconfdump_button( NactAssistantExport *window )
-{
- return( base_window_get_widget( BASE_WINDOW( window ), "ExportGConfDumpButton" ));
-}
-
-static GtkWidget *
-get_ask_button( NactAssistantExport *window )
-{
- return( base_window_get_widget( BASE_WINDOW( window ), "ExportAskButton" ));
-}
-
-static gint
+static GQuark
get_export_format( NactAssistantExport *window )
{
- GtkToggleButton *gconf_schema_v1_button;
- GtkToggleButton *gconf_schema_v2_button;
- GtkToggleButton *ask_button;
- gint format;
+ GtkWidget *container;
+ GQuark format;
- gconf_schema_v1_button = GTK_TOGGLE_BUTTON( get_gconfschemav1_button( window ));
- gconf_schema_v2_button = GTK_TOGGLE_BUTTON( get_gconfschemav2_button( window ));
- ask_button = GTK_TOGGLE_BUTTON( get_ask_button( window ));
-
- format = IPREFS_EXPORT_FORMAT_GCONF_ENTRY;
- if( gtk_toggle_button_get_active( gconf_schema_v1_button )){
- format = IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1;
- } else if( gtk_toggle_button_get_active( gconf_schema_v2_button )){
- format = IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V2;
- } else if( gtk_toggle_button_get_active( ask_button )){
- format = IPREFS_EXPORT_FORMAT_ASK;
- }
+ container = base_window_get_widget( BASE_WINDOW( window ), "AssistantExportFormatVBox" );
+ format = nact_export_format_get_select( container );
return( format );
}
@@ -726,31 +674,8 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
label1 = NULL;
label2 = NULL;
format = get_export_format( window );
- switch( format ){
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1:
- label1 = g_strdup( gtk_button_get_label( GTK_BUTTON( get_gconfschemav1_button( window ))));
- label2 = g_strdup( gtk_label_get_text( GTK_LABEL( base_window_get_widget( BASE_WINDOW( window ), "ExportSchemaV1Label"))));
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V2:
- label1 = g_strdup( gtk_button_get_label( GTK_BUTTON( get_gconfschemav2_button( window ))));
- label2 = g_strdup( gtk_label_get_text( GTK_LABEL( base_window_get_widget( BASE_WINDOW( window ), "ExportSchemaV2Label"))));
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_ENTRY:
- label1 = g_strdup( gtk_button_get_label( GTK_BUTTON( get_gconfdump_button( window ))));
- label2 = g_strdup( gtk_label_get_text( GTK_LABEL( base_window_get_widget( BASE_WINDOW( window ), "ExportGConfDumpLabel"))));
- break;
-
- case IPREFS_EXPORT_FORMAT_ASK:
- label1 = g_strdup( gtk_button_get_label( GTK_BUTTON( get_ask_button( window ))));
- label2 = g_strdup( gtk_label_get_text( GTK_LABEL( base_window_get_widget( BASE_WINDOW( window ), "ExportAskLabel"))));
- break;
-
- default:
- g_return_if_reached();
- break;
- }
+ label1 = nact_export_format_get_label( format );
+ label2 = nact_export_format_get_description( format );
nact_iprefs_set_export_format( BASE_WINDOW( window ), IPREFS_EXPORT_FORMAT, format );
label3 = na_core_utils_str_add_prefix( "\t", label2 );
@@ -792,18 +717,18 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
str = g_new0( ExportStruct, 1 );
window->private->results = g_list_append( window->private->results, str );
- str->action = NA_OBJECT_ACTION( na_iduplicable_get_origin( NA_IDUPLICABLE( ia->data )));
+ str->item = NA_OBJECT_ITEM( na_object_get_origin( NA_IDUPLICABLE( ia->data )));
str->format = nact_iprefs_get_export_format( BASE_WINDOW( wnd ), IPREFS_EXPORT_FORMAT );
if( str->format == IPREFS_EXPORT_FORMAT_ASK ){
- str->format = nact_assistant_export_ask_user( BASE_WINDOW( wnd ), NA_OBJECT_ITEM( str->action ));
+ str->format = nact_export_ask_user( BASE_WINDOW( wnd ), str->item );
if( str->format == IPREFS_EXPORT_NO_EXPORT ){
str->msg = g_slist_append( NULL, g_strdup( _( "Export canceled due to user action." )));
}
}
if( str->format != IPREFS_EXPORT_NO_EXPORT ){
- str->fname = na_exporter_export( NA_OBJECT_ITEM( str->action ), window->private->uri, str->format, &str->msg );
+ str->fname = na_exporter_export( str->item, window->private->uri, str->format, &str->msg );
}
}
@@ -835,7 +760,7 @@ assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant,
for( ir = window->private->results ; ir ; ir = ir->next ){
str = ( ExportStruct * ) ir->data;
- label = na_object_get_label( str->action );
+ label = na_object_get_label( str->item );
tmp = g_strdup_printf( "%s\t%s\n", text, label );
g_free( text );
text = tmp;
diff --git a/src/nact/nact-assistant-export.h b/src/nact/nact-assistant-export.h
index e719876..e2e7be4 100644
--- a/src/nact/nact-assistant-export.h
+++ b/src/nact/nact-assistant-export.h
@@ -73,7 +73,7 @@ G_BEGIN_DECLS
#define NACT_IS_ASSISTANT_EXPORT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_ASSISTANT_EXPORT_TYPE ))
#define NACT_ASSISTANT_EXPORT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_ASSISTANT_EXPORT_TYPE, NactAssistantExportClass ))
-typedef struct NactAssistantExportPrivate NactAssistantExportPrivate;
+typedef struct NactAssistantExportPrivate NactAssistantExportPrivate;
typedef struct {
BaseAssistant parent;
@@ -91,7 +91,7 @@ typedef struct {
GType nact_assistant_export_get_type( void );
-void nact_assistant_export_run( BaseWindow *main );
+void nact_assistant_export_run( BaseWindow *parent );
G_END_DECLS
diff --git a/src/nact/nact-assistant-export.ui b/src/nact/nact-assistant-export.ui
index 21edf62..1b4b358 100644
--- a/src/nact/nact-assistant-export.ui
+++ b/src/nact/nact-assistant-export.ui
@@ -2,6 +2,7 @@
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkListStore" id="liststore1"/>
<object class="GtkAssistant" id="ExportAssistant">
<property name="events">GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK</property>
<property name="border_width">12</property>
@@ -12,6 +13,9 @@
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="label" translatable="yes">This assistant will guide you through the process of exporting actions.</property>
@@ -90,10 +94,10 @@ to extend a selection.</property>
<child>
<object class="GtkFileChooserWidget" id="ExportFolderChooser">
<property name="visible">True</property>
- <property name="action">select-folder</property>
<property name="use_preview_label">False</property>
<property name="local_only">False</property>
<property name="preview_widget_active">False</property>
+ <property name="action">select-folder</property>
</object>
<packing>
<property name="position">0</property>
@@ -111,156 +115,10 @@ to extend a selection.</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
- <object class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="ExportSchemaV1Button">
- <property name="label" translatable="yes">Export as a GConf schema file with full key descriptions</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">This used to be the historical export format.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="ExportSchemaV1Label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">16</property>
- <property name="label" translatable="yes">This used to be the historical export format.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- </object>
- <packing>
- <property name="padding">4</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="ExportSchemaV2Button">
- <property name="label" translatable="yes">Export as a light GConf schema file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">ExportSchemaV1Button</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="ExportSchemaV2Label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">16</property>
- <property name="label" translatable="yes">The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- </object>
- <packing>
- <property name="padding">4</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="ExportGConfDumpButton">
- <property name="label" translatable="yes">Export as a GConf dump file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">This should be the preferred format for newly exported actions.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --load command-line tool.</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">ExportSchemaV1Button</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="ExportGConfDumpLabel">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">16</property>
- <property name="label" translatable="yes">This should be the preferred format for newly exported actions.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --load command-line tool.</property>
- </object>
- <packing>
- <property name="padding">4</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">3</property>
- </packing>
+ <placeholder/>
</child>
<child>
- <object class="GtkVBox" id="vbox5">
+ <object class="GtkVBox" id="AssistantExportFormatVBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
@@ -301,7 +159,7 @@ The exported file may later be imported via :
</object>
<packing>
<property name="expand">False</property>
- <property name="position">4</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
@@ -378,61 +236,9 @@ The exported file may later be imported via :
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox38">
+ <object class="GtkVBox" id="ExportFormatAskVBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="AskGConfSchemaV1Button">
- <property name="label" translatable="yes">Export as a GConf schema (v_1) file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">This used to be the historical export format.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="AskGConfSchemaV2Button">
- <property name="label" translatable="yes">Export as a GConf _schema (v2) file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --import-schema-file command-line tool.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">AskGConfSchemaV1Button</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="AskGConfEntryButton">
- <property name="label" translatable="yes">Export as a GConf _entry file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">This should be the preferred format for newly exported actions.
-The exported file may later be imported via :
-- Import assistant of the Nautilus Actions Configuration Tool,
-- or via the gconftool-2 --load command-line tool.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">AskGConfSchemaV1Button</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -440,12 +246,15 @@ The exported file may later be imported via :
</packing>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -454,7 +263,7 @@ The exported file may later be imported via :
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="AskKeepChoiceButton">
- <property name="label" translatable="yes">Re_member my choice in future import operations</property>
+ <property name="label" translatable="yes">Re_member my choice in future export operations</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -468,7 +277,7 @@ The exported file may later be imported via :
</object>
<packing>
<property name="expand">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index 99de8ca..103d5c9 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -38,13 +38,13 @@
#include <api/na-object-api.h>
#include <api/na-core-utils.h>
+#include <core/na-importer.h>
+
#include "nact-application.h"
#include "nact-iprefs.h"
#include "nact-iactions-list.h"
#include "nact-assistant-import.h"
-#include "nact-assistant-import-ask.h"
#include "nact-main-window.h"
-#include "na-importer.h"
/* Import Assistant
*
@@ -674,7 +674,7 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
for( is = uris ; is ; is = is->next ){
msg = NULL;
- item = na_importer_import( BASE_WINDOW( window ), items, ( const gchar * ) is->data, mode, &msg );
+ item = na_importer_import( items, ( const gchar * ) is->data, mode, &msg );
str = g_new0( ImportUriStruct, 1 );
str->uri = g_strdup(( const gchar * ) is->data );
diff --git a/src/nact/nact-import-ask.c b/src/nact/nact-import-ask.c
index fe53914..a774b6a 100644
--- a/src/nact/nact-import-ask.c
+++ b/src/nact/nact-import-ask.c
@@ -36,21 +36,19 @@
#include <api/na-object-api.h>
-#include <core/na-iprefs.h>
-
#include "nact-application.h"
#include "nact-iprefs.h"
-#include "nact-assistant-import-ask.h"
+#include "nact-import-ask.h"
/* private class data
*/
-struct NactAssistantImportAskClassPrivate {
+struct NactImportAskClassPrivate {
void *empty; /* so that gcc -pedantic is happy */
};
/* private instance data
*/
-struct NactAssistantImportAskPrivate {
+struct NactImportAskPrivate {
gboolean dispose_has_run;
NactMainWindow *parent;
const gchar *uri;
@@ -62,25 +60,25 @@ struct NactAssistantImportAskPrivate {
static BaseDialogClass *st_parent_class = NULL;
static GType register_type( void );
-static void class_init( NactAssistantImportAskClass *klass );
+static void class_init( NactImportAskClass *klass );
static void instance_init( GTypeInstance *instance, gpointer klass );
static void instance_dispose( GObject *dialog );
static void instance_finalize( GObject *dialog );
-static NactAssistantImportAsk *assistant_import_ask_new( BaseWindow *parent );
+static NactImportAsk *import_ask_new( BaseWindow *parent );
static gchar *base_get_iprefs_window_id( const BaseWindow *window );
static gchar *base_get_dialog_name( const BaseWindow *window );
-static void on_base_initial_load_dialog( NactAssistantImportAsk *editor, gpointer user_data );
-static void on_base_runtime_init_dialog( NactAssistantImportAsk *editor, gpointer user_data );
-static void on_base_all_widgets_showed( NactAssistantImportAsk *editor, gpointer user_data );
-static void on_cancel_clicked( GtkButton *button, NactAssistantImportAsk *editor );
-static void on_ok_clicked( GtkButton *button, NactAssistantImportAsk *editor );
-static void get_mode( NactAssistantImportAsk *editor );
+static void on_base_initial_load_dialog( NactImportAsk *editor, gpointer user_data );
+static void on_base_runtime_init_dialog( NactImportAsk *editor, gpointer user_data );
+static void on_base_all_widgets_showed( NactImportAsk *editor, gpointer user_data );
+static void on_cancel_clicked( GtkButton *button, NactImportAsk *editor );
+static void on_ok_clicked( GtkButton *button, NactImportAsk *editor );
+static void get_mode( NactImportAsk *editor );
static gboolean base_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window );
GType
-nact_assistant_import_ask_get_type( void )
+nact_import_ask_get_type( void )
{
static GType dialog_type = 0;
@@ -94,32 +92,32 @@ nact_assistant_import_ask_get_type( void )
static GType
register_type( void )
{
- static const gchar *thisfn = "nact_assistant_import_ask_register_type";
+ static const gchar *thisfn = "nact_import_ask_register_type";
GType type;
static GTypeInfo info = {
- sizeof( NactAssistantImportAskClass ),
+ sizeof( NactImportAskClass ),
( GBaseInitFunc ) NULL,
( GBaseFinalizeFunc ) NULL,
( GClassInitFunc ) class_init,
NULL,
NULL,
- sizeof( NactAssistantImportAsk ),
+ sizeof( NactImportAsk ),
0,
( GInstanceInitFunc ) instance_init
};
g_debug( "%s", thisfn );
- type = g_type_register_static( BASE_DIALOG_TYPE, "NactAssistantImportAsk", &info, 0 );
+ type = g_type_register_static( BASE_DIALOG_TYPE, "NactImportAsk", &info, 0 );
return( type );
}
static void
-class_init( NactAssistantImportAskClass *klass )
+class_init( NactImportAskClass *klass )
{
- static const gchar *thisfn = "nact_assistant_import_ask_class_init";
+ static const gchar *thisfn = "nact_import_ask_class_init";
GObjectClass *object_class;
BaseWindowClass *base_class;
@@ -131,7 +129,7 @@ class_init( NactAssistantImportAskClass *klass )
object_class->dispose = instance_dispose;
object_class->finalize = instance_finalize;
- klass->private = g_new0( NactAssistantImportAskClassPrivate, 1 );
+ klass->private = g_new0( NactImportAskClassPrivate, 1 );
base_class = BASE_WINDOW_CLASS( klass );
base_class->dialog_response = base_dialog_response;
@@ -142,15 +140,15 @@ class_init( NactAssistantImportAskClass *klass )
static void
instance_init( GTypeInstance *instance, gpointer klass )
{
- static const gchar *thisfn = "nact_assistant_import_ask_instance_init";
- NactAssistantImportAsk *self;
+ static const gchar *thisfn = "nact_import_ask_instance_init";
+ NactImportAsk *self;
g_debug( "%s: instance=%p (%s), klass=%p",
thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass );
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( instance ));
- self = NACT_ASSISTANT_IMPORT_ASK( instance );
+ g_return_if_fail( NACT_IS_IMPORT_ASK( instance ));
+ self = NACT_IMPORT_ASK( instance );
- self->private = g_new0( NactAssistantImportAskPrivate, 1 );
+ self->private = g_new0( NactImportAskPrivate, 1 );
base_window_signal_connect(
BASE_WINDOW( instance ),
@@ -176,12 +174,12 @@ instance_init( GTypeInstance *instance, gpointer klass )
static void
instance_dispose( GObject *dialog )
{
- static const gchar *thisfn = "nact_assistant_import_ask_instance_dispose";
- NactAssistantImportAsk *self;
+ static const gchar *thisfn = "nact_import_ask_instance_dispose";
+ NactImportAsk *self;
g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( dialog ));
- self = NACT_ASSISTANT_IMPORT_ASK( dialog );
+ g_return_if_fail( NACT_IS_IMPORT_ASK( dialog ));
+ self = NACT_IMPORT_ASK( dialog );
if( !self->private->dispose_has_run ){
@@ -197,12 +195,12 @@ instance_dispose( GObject *dialog )
static void
instance_finalize( GObject *dialog )
{
- static const gchar *thisfn = "nact_assistant_import_ask_instance_finalize";
- NactAssistantImportAsk *self;
+ static const gchar *thisfn = "nact_import_ask_instance_finalize";
+ NactImportAsk *self;
g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( dialog ));
- self = NACT_ASSISTANT_IMPORT_ASK( dialog );
+ g_return_if_fail( NACT_IS_IMPORT_ASK( dialog ));
+ self = NACT_IMPORT_ASK( dialog );
g_free( self->private );
@@ -213,16 +211,16 @@ instance_finalize( GObject *dialog )
}
/*
- * Returns a newly allocated NactAssistantImportAsk object.
+ * Returns a newly allocated NactImportAsk object.
*/
-static NactAssistantImportAsk *
-assistant_import_ask_new( BaseWindow *parent )
+static NactImportAsk *
+import_ask_new( BaseWindow *parent )
{
- return( g_object_new( NACT_ASSISTANT_IMPORT_ASK_TYPE, BASE_WINDOW_PROP_PARENT, parent, NULL ));
+ return( g_object_new( NACT_IMPORT_ASK_TYPE, BASE_WINDOW_PROP_PARENT, parent, NULL ));
}
/**
- * nact_assistant_import_ask_run:
+ * nact_import_ask_run:
* @parent: the NactMainWindow parent of this dialog.
* @uri:
* @item:
@@ -236,33 +234,25 @@ assistant_import_ask_new( BaseWindow *parent )
* becomes his preference import mode.
*/
gint
-nact_assistant_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObjectItem *item, NAObjectItem *exist )
+nact_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObjectItem *item, NAObjectItem *exist )
{
- static const gchar *thisfn = "nact_assistant_import_ask_run";
- NactApplication *application;
- NAPivot *pivot;
- NactAssistantImportAsk *editor;
+ static const gchar *thisfn = "nact_import_ask_run";
+ NactImportAsk *editor;
gint mode;
g_debug( "%s: parent=%p", thisfn, ( void * ) parent );
g_return_val_if_fail( BASE_IS_WINDOW( parent ), IPREFS_IMPORT_NO_IMPORT );
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( parent )));
- g_return_val_if_fail( NACT_IS_APPLICATION( application ), IPREFS_IMPORT_NO_IMPORT );
-
- pivot = nact_application_get_pivot( application );
- g_return_val_if_fail( NA_IS_PIVOT( pivot ), IPREFS_IMPORT_NO_IMPORT );
-
- editor = assistant_import_ask_new( BASE_WINDOW( parent ));
+ editor = import_ask_new( BASE_WINDOW( parent ));
editor->private->parent = parent;
editor->private->uri = uri;
editor->private->item = item;
editor->private->exist = exist;
- editor->private->mode = na_iprefs_get_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ASK_LAST_MODE );
+ editor->private->mode = nact_iprefs_get_import_mode( BASE_WINDOW( parent ), IPREFS_IMPORT_ASK_LAST_MODE );
base_window_run( BASE_WINDOW( editor ));
- na_iprefs_set_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ASK_LAST_MODE, editor->private->mode );
+ nact_iprefs_set_import_mode( BASE_WINDOW( parent ), IPREFS_IMPORT_ASK_LAST_MODE, editor->private->mode );
mode = editor->private->mode;
g_object_unref( editor );
@@ -278,31 +268,31 @@ base_get_iprefs_window_id( const BaseWindow *window )
static gchar *
base_get_dialog_name( const BaseWindow *window )
{
- return( g_strdup( "AssistantImportAsk" ));
+ return( g_strdup( "ImportAsk" ));
}
static void
-on_base_initial_load_dialog( NactAssistantImportAsk *editor, gpointer user_data )
+on_base_initial_load_dialog( NactImportAsk *editor, gpointer user_data )
{
- static const gchar *thisfn = "nact_assistant_import_ask_on_initial_load_dialog";
+ static const gchar *thisfn = "nact_import_ask_on_initial_load_dialog";
g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( editor ));
+ g_return_if_fail( NACT_IS_IMPORT_ASK( editor ));
}
static void
-on_base_runtime_init_dialog( NactAssistantImportAsk *editor, gpointer user_data )
+on_base_runtime_init_dialog( NactImportAsk *editor, gpointer user_data )
{
- static const gchar *thisfn = "nact_assistant_import_ask_on_runtime_init_dialog";
+ static const gchar *thisfn = "nact_import_ask_on_runtime_init_dialog";
gchar *action_label, *exist_label;
gchar *label;
GtkWidget *widget;
GtkWidget *button;
g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( editor ));
+ g_return_if_fail( NACT_IS_IMPORT_ASK( editor ));
- action_label = na_object_get_label( editor->private->action );
+ action_label = na_object_get_label( editor->private->item );
exist_label = na_object_get_label( editor->private->exist );
/* i18n: The action <action_label> imported from <file> has the same id than <existing_label> */
@@ -347,34 +337,32 @@ on_base_runtime_init_dialog( NactAssistantImportAsk *editor, gpointer user_data
}
static void
-on_base_all_widgets_showed( NactAssistantImportAsk *editor, gpointer user_data )
+on_base_all_widgets_showed( NactImportAsk *editor, gpointer user_data )
{
- static const gchar *thisfn = "nact_assistant_import_ask_on_all_widgets_showed";
+ static const gchar *thisfn = "nact_import_ask_on_all_widgets_showed";
g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
- g_return_if_fail( NACT_IS_ASSISTANT_IMPORT_ASK( editor ));
+ g_return_if_fail( NACT_IS_IMPORT_ASK( editor ));
}
static void
-on_cancel_clicked( GtkButton *button, NactAssistantImportAsk *editor )
+on_cancel_clicked( GtkButton *button, NactImportAsk *editor )
{
GtkWindow *toplevel = base_window_get_toplevel( BASE_WINDOW( editor ));
gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_CLOSE );
}
static void
-on_ok_clicked( GtkButton *button, NactAssistantImportAsk *editor )
+on_ok_clicked( GtkButton *button, NactImportAsk *editor )
{
GtkWindow *toplevel = base_window_get_toplevel( BASE_WINDOW( editor ));
gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_OK );
}
static void
-get_mode( NactAssistantImportAsk *editor )
+get_mode( NactImportAsk *editor )
{
gint import_mode;
- NactApplication *application;
- NAPivot *pivot;
GtkWidget *button;
gboolean keep;
@@ -394,21 +382,19 @@ get_mode( NactAssistantImportAsk *editor )
button = base_window_get_widget( BASE_WINDOW( editor ), "AskKeepChoiceButton" );
keep = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ));
if( keep ){
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( editor )));
- pivot = nact_application_get_pivot( application );
- na_iprefs_set_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ACTIONS_IMPORT_MODE, import_mode );
+ nact_iprefs_set_import_mode( BASE_WINDOW( editor ), IPREFS_IMPORT_ITEMS_IMPORT_MODE, import_mode );
}
}
static gboolean
base_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window )
{
- static const gchar *thisfn = "nact_assistant_import_ask_on_dialog_response";
- NactAssistantImportAsk *editor;
+ static const gchar *thisfn = "nact_import_ask_on_dialog_response";
+ NactImportAsk *editor;
g_debug( "%s: dialog=%p, code=%d, window=%p", thisfn, ( void * ) dialog, code, ( void * ) window );
- g_assert( NACT_IS_ASSISTANT_IMPORT_ASK( window ));
- editor = NACT_ASSISTANT_IMPORT_ASK( window );
+ g_assert( NACT_IS_IMPORT_ASK( window ));
+ editor = NACT_IMPORT_ASK( window );
switch( code ){
case GTK_RESPONSE_NONE:
diff --git a/src/nact/nact-import-ask.h b/src/nact/nact-import-ask.h
index 2b1201b..69cda0b 100644
--- a/src/nact/nact-import-ask.h
+++ b/src/nact/nact-import-ask.h
@@ -28,13 +28,13 @@
* ... and many others (see AUTHORS)
*/
-#ifndef __NACT_ASSISTANT_IMPORT_ASK_H__
-#define __NACT_ASSISTANT_IMPORT_ASK_H__
+#ifndef __NACT_IMPORT_ASK_H__
+#define __NACT_IMPORT_ASK_H__
/**
- * SECTION: nact_assistant_import_ask
- * @short_description: #NactAssistantImportAsk class definition.
- * @include: nact/nact-assistant-import-ask.h
+ * SECTION: nact_import_ask
+ * @short_description: #NactImportAsk class definition.
+ * @include: nact/nact-import-ask.h
*
* This class is derived from BaseDialog.
* It is ran each time an imported action as the same UUID as an
@@ -49,33 +49,33 @@
G_BEGIN_DECLS
-#define NACT_ASSISTANT_IMPORT_ASK_TYPE ( nact_assistant_import_ask_get_type())
-#define NACT_ASSISTANT_IMPORT_ASK( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ASSISTANT_IMPORT_ASK_TYPE, NactAssistantImportAsk ))
-#define NACT_ASSISTANT_IMPORT_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_ASSISTANT_IMPORT_ASK_TYPE, NactAssistantImportAskClass ))
-#define NACT_IS_ASSISTANT_IMPORT_ASK( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ASSISTANT_IMPORT_ASK_TYPE ))
-#define NACT_IS_ASSISTANT_IMPORT_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_ASSISTANT_IMPORT_ASK_TYPE ))
-#define NACT_ASSISTANT_IMPORT_ASK_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_ASSISTANT_IMPORT_ASK_TYPE, NactAssistantImportAskClass ))
+#define NACT_IMPORT_ASK_TYPE ( nact_import_ask_get_type())
+#define NACT_IMPORT_ASK( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_IMPORT_ASK_TYPE, NactImportAsk ))
+#define NACT_IMPORT_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_IMPORT_ASK_TYPE, NactImportAskClass ))
+#define NACT_IS_IMPORT_ASK( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_IMPORT_ASK_TYPE ))
+#define NACT_IS_IMPORT_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_IMPORT_ASK_TYPE ))
+#define NACT_IMPORT_ASK_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_IMPORT_ASK_TYPE, NactImportAskClass ))
-typedef struct NactAssistantImportAskPrivate NactAssistantImportAskPrivate;
+typedef struct NactImportAskPrivate NactImportAskPrivate;
typedef struct {
- BaseDialog parent;
- NactAssistantImportAskPrivate *private;
+ BaseDialog parent;
+ NactImportAskPrivate *private;
}
- NactAssistantImportAsk;
+ NactImportAsk;
-typedef struct NactAssistantImportAskClassPrivate NactAssistantImportAskClassPrivate;
+typedef struct NactImportAskClassPrivate NactImportAskClassPrivate;
typedef struct {
- BaseDialogClass parent;
- NactAssistantImportAskClassPrivate *private;
+ BaseDialogClass parent;
+ NactImportAskClassPrivate *private;
}
- NactAssistantImportAskClass;
+ NactImportAskClass;
-GType nact_assistant_import_ask_get_type( void );
+GType nact_import_ask_get_type( void );
-gint nact_assistant_import_ask_user( NactMainWindow *window, const gchar *uri, NAObjectItem *new_item, NAObjectItem *current );
+gint nact_import_ask_user( NactMainWindow *window, const gchar *uri, NAObjectItem *new_item, NAObjectItem *current );
G_END_DECLS
-#endif /* __NACT_ASSISTANT_IMPORT_ASK_H__ */
+#endif /* __NACT_IMPORT_ASK_H__ */
diff --git a/src/nact/nact-iprefs.c b/src/nact/nact-iprefs.c
index 085de53..98861c1 100644
--- a/src/nact/nact-iprefs.c
+++ b/src/nact/nact-iprefs.c
@@ -43,6 +43,7 @@ struct NactIPrefsInterfacePrivate {
GConfClient *client;
};
+#if 0
#define DEFAULT_EXPORT_FORMAT_INT IPREFS_EXPORT_FORMAT_GCONF_ENTRY
#define DEFAULT_EXPORT_FORMAT_STR "GConfEntry"
@@ -53,6 +54,7 @@ static GConfEnumStringPair export_format_table[] = {
{ IPREFS_EXPORT_FORMAT_ASK, "Ask" },
{ 0, NULL }
};
+#endif
#define DEFAULT_IMPORT_MODE_INT IPREFS_IMPORT_NO_IMPORT
#define DEFAULT_IMPORT_MODE_STR "NoImport"
@@ -148,24 +150,24 @@ interface_nact_finalize( NactIPrefsInterface *klass )
* @window: this #BaseWindow-derived window.
* @name: name of the export format key to be readen
*
- * Returns: the export format currently set.
+ * Returns: the export format currently set as a #GQuark.
*
- * Note: this function returns a suitable default value even if the key
- * is not found in GConf preferences or no schema has been installed.
+ * Defaults to exporting as a GConfEntry (see. #nact-iprefs.h)
*
* Note: please take care of keeping the default value synchronized with
* those defined in schemas.
*/
-guint
+GQuark
nact_iprefs_get_export_format( const BaseWindow *window, const gchar *name )
{
- guint export_format;
- guint format_int;
- gchar *format_str;
+ GQuark export_format;
NactApplication *application;
NAUpdater *updater;
+ gchar *format_str;
- export_format = DEFAULT_EXPORT_FORMAT_INT;
+ guint format_int;
+
+ export_format = g_quark_from_static_string( IPREFS_EXPORT_FORMAT_DEFAULT );
g_return_val_if_fail( BASE_IS_WINDOW, export_format );
@@ -177,11 +179,9 @@ nact_iprefs_get_export_format( const BaseWindow *window, const gchar *name )
format_str = na_iprefs_read_string(
NA_IPREFS( updater ),
name,
- DEFAULT_EXPORT_FORMAT_STR );
+ IPREFS_EXPORT_FORMAT_DEFAULT );
- if( gconf_string_to_enum( export_format_table, format_str, &format_int )){
- export_format = format_int;
- }
+ export_format = g_quark_from_string( format_str );
g_free( format_str );
}
@@ -190,6 +190,29 @@ nact_iprefs_get_export_format( const BaseWindow *window, const gchar *name )
}
/**
+ * nact_iprefs_set_export_format:
+ * @window: this #BaseWindow-derived window.
+ * @format: the new value to be written.
+ *
+ * Writes the preferred export format' to the GConf preference system.
+ */
+void
+nact_iprefs_set_export_format( const BaseWindow *window, const gchar *name, GQuark format )
+{
+ const gchar *format_str;
+
+ g_return_if_fail( NA_IS_IPREFS( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ nact_iprefs_write_string(
+ window,
+ name,
+ g_quark_to_string( format ));
+ }
+}
+
+/**
* nact_iprefs_get_import_mode:
* @instance: this #NAIPrefs interface instance.
* @name: name of the import key to be readen
@@ -234,32 +257,6 @@ nact_iprefs_get_import_mode( const BaseWindow *window, const gchar *name )
}
/**
- * nact_iprefs_set_export_format:
- * @window: this #BaseWindow-derived window.
- * @format: the new value to be written.
- *
- * Writes the current status of 'import/export format' to the GConf
- * preference system.
- */
-void
-nact_iprefs_set_export_format( const BaseWindow *window, const gchar *name, gint format )
-{
- const gchar *format_str;
-
- g_return_if_fail( NA_IS_IPREFS( instance ));
-
- if( st_initialized && !st_finalized ){
-
- format_str = gconf_enum_to_string( export_format_table, format );
-
- nact_iprefs_write_string(
- window,
- name,
- format_str ? format_str : DEFAULT_EXPORT_FORMAT_STR );
- }
-}
-
-/**
* nact_iprefs_set_import_mode:
* @instance: this #NAIPrefs interface instance.
* @mode: the new value to be written.
diff --git a/src/nact/nact-iprefs.h b/src/nact/nact-iprefs.h
index cfa7418..6bf476f 100644
--- a/src/nact/nact-iprefs.h
+++ b/src/nact/nact-iprefs.h
@@ -64,6 +64,8 @@ typedef struct {
#define IPREFS_EXPORT_FORMAT "export-format"
#define IPREFS_EXPORT_ASK_LAST_FORMAT "export-ask-user-last-format"
+#define IPREFS_EXPORT_FORMAT_DEFAULT "GConfEntry"
+
#define IPREFS_IMPORT_ITEMS_FOLDER_URI "import-folder-uri"
#define IPREFS_IMPORT_ITEMS_IMPORT_MODE "import-mode"
#define IPREFS_IMPORT_ASK_LAST_MODE "import-ask-user-last-mode"
@@ -71,12 +73,21 @@ typedef struct {
#define IPREFS_ASSIST_ESC_QUIT "assistant-esc-quit"
#define IPREFS_ASSIST_ESC_CONFIRM "assistant-esc-confirm"
+/* these are special export formats
+ */
+enum {
+ IPREFS_EXPORT_NO_EXPORT = 1,
+ IPREFS_EXPORT_FORMAT_ASK,
+ IPREFS_EXPORT_FORMAT_GCONF_SCHEMA
+};
+
GType nact_iprefs_get_type( void );
-guint nact_iprefs_get_export_format( const BaseWindow *window, const gchar *pref );
+GQuark nact_iprefs_get_export_format( const BaseWindow *window, const gchar *pref );
+void nact_iprefs_set_export_format( const BaseWindow *window, const gchar *pref, GQuark format );
+
gint nact_iprefs_get_import_mode ( const BaseWindow *window, const gchar *pref );
-void nact_iprefs_set_export_format( const BaseWindow *window, const gchar *pref, gint format );
void nact_iprefs_set_import_mode ( const BaseWindow *window, const gchar *pref, gint mode );
void nact_iprefs_write_string( const BaseWindow *window, const gchar *name, const gchar *value );
diff --git a/src/nact/nact-tree-model.h b/src/nact/nact-tree-model.h
index da5ef97..e20a13e 100644
--- a/src/nact/nact-tree-model.h
+++ b/src/nact/nact-tree-model.h
@@ -47,7 +47,7 @@
#include <gtk/gtk.h>
-#include <private/na-object-class.h>
+#include <api/na-object.h>
#include "base-window.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]