r21654 - gnucash/trunk/src/import-export/qif-import - Bug #664877 - Migrate Qif Import Druid to an Assistant

Geert Janssens gjanssens at code.gnucash.org
Fri Dec 2 15:55:58 EST 2011


Author: gjanssens
Date: 2011-12-02 15:55:58 -0500 (Fri, 02 Dec 2011)
New Revision: 21654
Trac: http://svn.gnucash.org/trac/changeset/21654

Removed:
   gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c
   gnucash/trunk/src/import-export/qif-import/gnc-druid-test.h
Modified:
   gnucash/trunk/src/import-export/qif-import/Makefile.am
   gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
   gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h
Log:
Bug #664877 - Migrate Qif Import Druid to an Assistant
This patch removes some test druid files that were in the same directory
Patch by Robert Fewell

Modified: gnucash/trunk/src/import-export/qif-import/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/qif-import/Makefile.am	2011-12-02 20:55:43 UTC (rev 21653)
+++ gnucash/trunk/src/import-export/qif-import/Makefile.am	2011-12-02 20:55:58 UTC (rev 21654)
@@ -6,13 +6,11 @@
   dialog-account-picker.c \
   assistant-qif-import.c \
   gnc-plugin-qif-import.c \
-  gnc-druid-test.c \
   gncmod-qif-import.c
 
 noinst_HEADERS = \
   dialog-account-picker.h \
   assistant-qif-import.h \
-  gnc-druid-test.h \
   gnc-plugin-qif-import.h
 
 libgncmod_qif_import_la_LDFLAGS = -avoid-version

Deleted: gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c	2011-12-02 20:55:43 UTC (rev 21653)
+++ gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c	2011-12-02 20:55:58 UTC (rev 21654)
@@ -1,162 +0,0 @@
-#include "config.h"
-
-#include "gnc-druid.h"
-#include "gnc-druid-provider-desc-edge.h"
-#include "gnc-druid-provider-desc-file.h"
-#include "gnc-druid-provider-desc-multifile.h"
-#include "gnc-import-desc-format.h"
-#include "gnc-druid-test.h"
-
-#include <stdio.h>
-
-typedef struct _GncDruidTest
-{
-    GList *files;
-} GncDruidTest;
-
-static GList *
-gnc_dt_test_get_files(gpointer ctx)
-{
-    GncDruidTest *gdt = ctx;
-    return gdt->files;
-}
-
-static const gchar *
-gnc_dt_test_get_filename(gpointer ctx, gpointer file)
-{
-    return file;
-}
-
-static void
-gnc_dt_test_remove_file(gpointer ctx, gpointer file)
-{
-    GncDruidTest *gdt = ctx;
-    gdt->files = g_list_remove(gdt->files, file);
-    g_free(file);
-}
-
-static gboolean
-gnc_dt_test_add_file(GNCDruidCB *cb)
-{
-    GNCDruidProviderFileCB *cb_f = GNC_DRUID_PROVIDER_FILE_CB(cb);
-    GncDruidTest *gdt = cb->druid_ctx->be_ctx;
-
-    gdt->files = g_list_prepend(gdt->files, g_strdup(cb_f->filename));
-    cb_f->this_file = gdt->files->data;
-    return TRUE;
-}
-
-static gboolean
-gnc_dt_test_files_done(GNCDruidCB *cb)
-{
-    GncDruidTest *gdt = cb->druid_ctx->be_ctx;
-    fprintf(stderr, "Done adding files: %d files..\n", g_list_length(gdt->files));
-    return TRUE;
-}
-
-static GncImportFormat
-gnc_dt_test_get_formats(GNCImportFormatCB *cb)
-{
-    return GNCIF_DATE_YMD | GNCIF_DATE_YDM;
-}
-
-static const gchar *
-gnc_dt_test_get_sample(GNCImportFormatCB *cb)
-{
-    return "2004-10-11";
-}
-
-static gboolean
-gnc_dt_test_formats_done(GNCDruidCB *cb)
-{
-    GNCImportFormatCB *cb_f = GNC_IMPORT_FORMAT_CB(cb);
-    fprintf(stderr, "User selected format: %d\n", cb_f->format);
-    return TRUE;
-}
-
-static GList *
-gnc_dt_test_build_providers(void)
-{
-    GList *list = NULL;
-    GNCDruidProviderDescFile *desc_file;
-    GNCDruidProviderDescMultifile *desc_multifile;
-
-    /* Build the provider list in reverse order, because g_list_append is slow */
-    list =
-        g_list_prepend(list,
-                       gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_LAST,
-                               "Test Druid End",
-                               "Click finish to close the druid."));
-
-    desc_file =
-        gnc_druid_provider_desc_file_new_with_data("Test Druid New File",
-                "Choose a file",
-                "test-druid-history",
-                "/tmp",
-                TRUE,
-                gnc_dt_test_add_file,
-                gnc_dt_test_remove_file);
-
-    desc_multifile =
-        gnc_druid_provider_desc_multifile_new_with_data("Test Druid Files",
-                NULL,
-                desc_file,
-                gnc_dt_test_files_done,
-                gnc_dt_test_get_files,
-                gnc_dt_test_get_filename);
-    desc_file->multifile_provider = desc_multifile;
-
-    list = g_list_prepend(list, desc_multifile);
-    list = g_list_prepend(list,
-                          gnc_import_desc_format_new_with_data("Formats are Ambiguous",
-                                  "Choose your format!",
-                                  gnc_dt_test_formats_done,
-                                  gnc_dt_test_get_formats,
-                                  gnc_dt_test_get_sample));
-
-    list = g_list_prepend(list, desc_file);
-    list =
-        g_list_prepend(list,
-                       gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_FIRST,
-                               "Test Druid Start",
-                               "This is a test druid.  It doesn't do much."));
-
-    return list;
-}
-
-static gboolean
-gnc_dt_test_finish_cb(gpointer ctx)
-{
-    fprintf(stderr, "finish callback called...\n");
-    return TRUE;
-}
-
-static void
-gnc_dt_test_cancel_cb(gpointer ctx)
-{
-    GncDruidTest *gdt = ctx;
-    GList *node;
-
-    fprintf(stderr, "cancel callback called...(%p)\n", gdt);
-
-    for (node = gdt->files; node; node = node->next)
-        g_free(node->data);
-
-    g_list_free(gdt->files);
-    g_free(gdt);
-}
-
-GNCDruid *
-gnc_druid_gnome_test(void)
-{
-    GNCDruid * druid;
-    GList *providers;
-    GncDruidTest *gdt = g_new0(GncDruidTest, 1);
-
-    providers = gnc_dt_test_build_providers();
-
-    druid = gnc_druid_new("This is a test druid title",
-                          providers, gdt,
-                          gnc_dt_test_finish_cb, gnc_dt_test_cancel_cb);
-    return druid;
-}

Deleted: gnucash/trunk/src/import-export/qif-import/gnc-druid-test.h
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-druid-test.h	2011-12-02 20:55:43 UTC (rev 21653)
+++ gnucash/trunk/src/import-export/qif-import/gnc-druid-test.h	2011-12-02 20:55:58 UTC (rev 21654)
@@ -1,4 +0,0 @@
-
-#include "gnc-druid.h"
-
-GNCDruid * gnc_druid_gnome_test(void);

Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2011-12-02 20:55:43 UTC (rev 21653)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2011-12-02 20:55:58 UTC (rev 21654)
@@ -1,25 +1,25 @@
-/*
- * gnc-plugin-qif-import.c --
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- */
+/********************************************************************\
+ * gnc-plugin-qif-import.c -- window for importing QIF files        *
+ *                        (GnuCash)                                 *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>     *
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+\********************************************************************/
 
 #include "config.h"
 
@@ -28,7 +28,6 @@
 
 #include "dialog-preferences.h"
 #include "assistant-qif-import.h"
-#include "gnc-druid-test.h"
 #include "gnc-plugin-manager.h"
 #include "gnc-plugin-qif-import.h"
 
@@ -38,9 +37,7 @@
 
 /* Command callbacks */
 static void gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action, GncMainWindowActionData *data);
-/* static void gnc_plugin_qif_test_druid (GtkAction *action, GncMainWindowActionData *data); */
 
-
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-qif-import-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-qif-import-ui.xml"
 
@@ -51,10 +48,6 @@
         N_("Import a Quicken QIF file"),
         G_CALLBACK (gnc_plugin_qif_import_cmd_new_qif_import)
     },
-    /*
-    	{ "QIFTestDruid", GTK_STOCK_CONVERT, "_Test Druid...", NULL,
-    	  "Test the new Druid", G_CALLBACK(gnc_plugin_qif_test_druid) },
-    */
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
@@ -158,13 +151,6 @@
       gnc_file_qif_import();
 }
 
-/*
-static void
-gnc_plugin_qif_test_druid (GtkAction *action, GncMainWindowActionData *data)
-{
-	gnc_druid_gnome_test();
-}
-*/
 
 /************************************************************
  *                    Plugin Bootstrapping                   *

Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h	2011-12-02 20:55:43 UTC (rev 21653)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h	2011-12-02 20:55:58 UTC (rev 21654)
@@ -1,25 +1,25 @@
-/*
- * gnc-plugin-qif-import.h --
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- */
+/********************************************************************\
+ * gnc-plugin-qif-import.c -- window for importing QIF files        *
+ *                        (GnuCash)                                 *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>     *
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+\********************************************************************/
 
 #ifndef __GNC_PLUGIN_QIF_IMPORT_H
 #define __GNC_PLUGIN_QIF_IMPORT_H



More information about the gnucash-changes mailing list