r15336 - gnucash/trunk/src/import-export/qif-import - Use double-clicks in the qif import druid. Fix #395325.
Andreas Köhler
andi5 at cvs.gnucash.org
Thu Jan 11 17:16:27 EST 2007
Author: andi5
Date: 2007-01-11 17:16:23 -0500 (Thu, 11 Jan 2007)
New Revision: 15336
Trac: http://svn.gnucash.org/trac/changeset/15336
Modified:
gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
gnucash/trunk/src/import-export/qif-import/qif.glade
Log:
Use double-clicks in the qif import druid. Fix #395325.
In the account picker dialogs, double clicks now close the dialogs. More
importantly, these dialogs are showed as a result of double clicks
(row-activated) instead of selection changes. This lets the user choose
the matching account more than once if there is only one item to match.
Introduces new i18n strings
Modified: gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c 2007-01-10 16:53:18 UTC (rev 15335)
+++ gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c 2007-01-11 22:16:23 UTC (rev 15336)
@@ -211,7 +211,17 @@
}
}
+static void
+gnc_ui_qif_account_picker_row_activated_cb (GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
+{
+ QIFAccountPickerDialog *wind = user_data;
+ g_return_if_fail (wind);
+ gtk_dialog_response (GTK_DIALOG (wind->dialog), GTK_RESPONSE_OK);
+}
+
static int
gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
{
@@ -291,6 +301,9 @@
selection = gtk_tree_view_get_selection(wind->treeview);
g_signal_connect(selection, "changed",
G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
+ g_signal_connect(wind->treeview, "row-activated",
+ G_CALLBACK(gnc_ui_qif_account_picker_row_activated_cb),
+ wind);
}
g_signal_connect_after(wind->dialog, "map",
Modified: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2007-01-10 16:53:18 UTC (rev 15335)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2007-01-11 22:16:23 UTC (rev 15336)
@@ -1020,7 +1020,6 @@
GtkListStore *store;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_BOOLEAN);
@@ -1049,8 +1048,7 @@
gtk_tree_view_append_column(view, column);
g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
- selection = gtk_tree_view_get_selection(view);
- g_signal_connect(selection, "changed", callback, user_data);
+ g_signal_connect(view, "row-activated", G_CALLBACK(callback), user_data);
}
/********************************************************************
@@ -1070,14 +1068,11 @@
SCM selected_acct;
GtkTreeModel *model;
GtkTreeIter iter;
- gint row, prev_row;
+ gint row;
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
return;
gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
- prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(model), PREV_ROW));
- if (row == prev_row)
- return;
g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
if (row == -1)
return;
@@ -1101,10 +1096,16 @@
********************************************************************/
static void
-gnc_ui_qif_import_account_line_select_cb(GtkTreeSelection *selection,
- gpointer user_data)
+gnc_ui_qif_import_account_line_select_cb(GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
{
- QIFImportWindow * wind = user_data;
+ QIFImportWindow *wind = user_data;
+ GtkTreeSelection *selection;
+
+ g_return_if_fail (view && wind);
+ selection = gtk_tree_view_get_selection (view);
+
select_line (wind, selection, wind->acct_display_info, wind->acct_map_info,
update_accounts_page);
}
@@ -1116,10 +1117,16 @@
********************************************************************/
static void
-gnc_ui_qif_import_category_line_select_cb(GtkTreeSelection *selection,
- gpointer user_data)
+gnc_ui_qif_import_category_line_select_cb(GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
{
- QIFImportWindow * wind = user_data;
+ QIFImportWindow *wind = user_data;
+ GtkTreeSelection *selection;
+
+ g_return_if_fail (view && wind);
+ selection = gtk_tree_view_get_selection (view);
+
select_line (wind, selection, wind->acct_display_info, wind->acct_map_info,
update_categories_page);
}
@@ -1131,10 +1138,16 @@
********************************************************************/
static void
-gnc_ui_qif_import_memo_line_select_cb(GtkTreeSelection *selection,
- gpointer user_data)
+gnc_ui_qif_import_memo_line_select_cb(GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
{
- QIFImportWindow * wind = user_data;
+ QIFImportWindow *wind = user_data;
+ GtkTreeSelection *selection;
+
+ g_return_if_fail (view && wind);
+ selection = gtk_tree_view_get_selection (view);
+
select_line (wind, selection, wind->memo_display_info, wind->memo_map_info,
update_memo_page);
}
Modified: gnucash/trunk/src/import-export/qif-import/qif.glade
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif.glade 2007-01-10 16:53:18 UTC (rev 15335)
+++ gnucash/trunk/src/import-export/qif-import/qif.glade 2007-01-11 22:16:23 UTC (rev 15336)
@@ -602,7 +602,7 @@
<child>
<widget class="GtkLabel" id="label830">
<property name="visible">True</property>
- <property name="label" translatable="yes">On the next page, the accounts in your QIF files and any stocks or mutual funds you own will be matched with GnuCash accounts. If a GnuCash account already exists with the same name, or a similar name and compatible type, that account will be used as a match; otherwise, GnuCash will create a new account with the same name and type as the QIF account. If you do not like the suggested GnuCash account, click to change it.
+ <property name="label" translatable="yes">On the next page, the accounts in your QIF files and any stocks or mutual funds you own will be matched with GnuCash accounts. If a GnuCash account already exists with the same name, or a similar name and compatible type, that account will be used as a match; otherwise, GnuCash will create a new account with the same name and type as the QIF account. If you do not like the suggested GnuCash account, double-click to change it.
Note that GnuCash will be creating many accounts that did not exist on your other personal finance program, including a separate account for each stock you own, separate accounts for the brokerage commissions, special "Equity" accounts (subaccounts of Retained Earnings, by default) which are the source of your opening balances, etc. All of these accounts will appear on the next page so you can change them if you want to, but it is safe to leave them alone.
</property>
@@ -716,7 +716,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">GnuCash uses separate Income and Expense accounts rather than categories to classify your transactions. Each of the categories in your QIF file will be converted to a GnuCash account.
-On the next page, you will have an opportunity to look at the suggested matches between QIF categories and GnuCash accounts. You may change matches that you do not like by clicking on the line containing the category name.
+On the next page, you will have an opportunity to look at the suggested matches between QIF categories and GnuCash accounts. You may change matches that you do not like by double-clicking on the line containing the category name.
If you change your mind later, you can reorganize the account structure safely within GnuCash.</property>
<property name="use_underline">False</property>
@@ -1041,7 +1041,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">If you are importing a QIF file downloaded from a bank or other financial institution, some of the information in the QIF file may duplicate information already in your GnuCash accounts. GnuCash will try to detect duplicates of existing transactions.
-On the next page, you will be asked to confirm that an existing transaction matches an imported transaction. Imported transactions are shown on the left side of the page, and possible matches for the selected left-hand transaction are shown to the right. There may be several old transactions that could match an imported transaction; you will be able to select the correct one by clicking in the "Dup?" column of the correct transaction.
+On the next page, you will be asked to confirm that an existing transaction matches an imported transaction. Imported transactions are shown on the left side of the page, and possible matches for the selected left-hand transaction are shown to the right. There may be several old transactions that could match an imported transaction; you will be able to select the correct one by double-clicking in the "Dup?" column of the correct transaction.
You can control the rules used by GnuCash to find duplicate transactions in the "QIF Import" section of the GnuCash Preferences dialog.
More information about the gnucash-changes
mailing list