Let the account matcher accept a parent widget to avoid windows that

are lost behind other windows. Adapt importer modules accordingly.




git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13382 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-02-24 22:22:44 +00:00
parent 26cc119630
commit 8ee2861201
7 changed files with 34 additions and 11 deletions

View File

@ -1,5 +1,9 @@
2006-02-24 Christian Stimming <stimming@tuhh.de>
* src/import-export/import-account-matcher.h: Let the account
matcher accept a parent widget to avoid windows that are lost
behind other windows. Adapt importer modules accordingly.
* src/import-export/import-account-matcher.c: Don't allow
placeholder be selected for importing transactions. Fixes
bug#327891.

View File

@ -399,7 +399,8 @@ on_accountlist_select_row (GtkCList *clist, gint row,
GNC_COMMODITY_NS_ISO, AB_Account_GetCurrency (hbci_acc));
}
gnc_acc = gnc_import_select_account(NULL, TRUE, longname, currency, BANK,
gnc_acc = gnc_import_select_account(info->window,
NULL, TRUE, longname, currency, BANK,
old_value, NULL);
g_free(longname);

View File

@ -121,7 +121,8 @@ static gpointer test_acct_online_id_match(Account *acct, gpointer param_online_i
}
}
Account * gnc_import_select_account(const gchar * account_online_id_value,
Account * gnc_import_select_account(gncUIWidget parent,
const gchar * account_online_id_value,
gboolean auto_create,
const gchar * account_human_description,
gnc_commodity * new_account_default_commodity,
@ -168,6 +169,9 @@ Account * gnc_import_select_account(const gchar * account_online_id_value,
}
picker->dialog = glade_xml_get_widget (xml, "Generic Import Account Picker");
if (parent)
gtk_window_set_transient_for (GTK_WINDOW (picker->dialog),
GTK_WINDOW (parent));
picker->account_tree_sw = glade_xml_get_widget (xml, "account_tree_sw");
online_id_label = glade_xml_get_widget (xml, "online_id_label");
button = glade_xml_get_widget (xml, "newbutton");
@ -205,8 +209,10 @@ Account * gnc_import_select_account(const gchar * account_online_id_value,
/* See if the selected account is a placeholder. */
if (xaccAccountGetPlaceholder (retval)) {
gnc_error_dialog (/* FIXME: add parent*/ NULL,
_("The account %s does not allow transactions."),
gnc_error_dialog
(picker->dialog,
_("The account %s is a placeholder account and does not allow "
"transactions. Please choose a different account."),
xaccAccountGetName (retval));
response = GNC_RESPONSE_NEW;
break;

View File

@ -26,6 +26,7 @@
#define ACCOUNT_MATCHER_H
#include "Account.h"
#include "gnc-ui-common.h"
/** Must be called with a string containing a unique identifier for the
account. If an account with a matching online_id kvp_frame is
@ -36,6 +37,8 @@
again). If the user refuses to select or create an account, NULL is
returned.
@param parent The parent widget. Can be NULL.
@param account_online_id_value The string containing your unique
account_id coming from some string of your module. This is the
normal mode of operation. Can be NULL.
@ -86,7 +89,8 @@
@return A pointer to the found or created Account, or NULL if no
account was found or created.
*/
Account * gnc_import_select_account(const gchar * account_online_id_value,
Account * gnc_import_select_account(gncUIWidget parent,
const gchar * account_online_id_value,
gboolean auto_create,
const gchar * account_human_description,
gnc_commodity * new_account_default_commodity,

View File

@ -298,7 +298,8 @@ run_account_picker_dialog (GNCImportMainMatcher *info,
gboolean ok_pressed;
g_assert (trans_info);
old_acc = gnc_import_TransInfo_get_destacc (trans_info);
new_acc = gnc_import_select_account(NULL,
new_acc = gnc_import_select_account(info->dialog,
NULL,
TRUE,
_("Destination account for the auto-balance split."),
xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),

View File

@ -211,7 +211,8 @@ accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data) {
AB_ImExporterAccountInfo_GetAccountName(accinfo);
gchar *online_id = g_strconcat (bank_code, account_number, NULL);
gnc_acc = gnc_import_select_account(online_id, 1, account_name, NULL,
gnc_acc = gnc_import_select_account(NULL,
online_id, 1, account_name, NULL,
NO_TYPE, NULL, NULL);
g_free(online_id);
if (gnc_acc) {

View File

@ -122,7 +122,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
g_assert(gnc_ofx_importer_gui);
if(data.account_id_valid==true){
account = gnc_import_select_account(data.account_id, 0, NULL, NULL, NO_TYPE, NULL, NULL);
account = gnc_import_select_account(NULL,
data.account_id, 0, NULL, NULL, NO_TYPE, NULL, NULL);
if(account!=NULL)
{
/********** Create the transaction and setup transaction data ************/
@ -347,7 +348,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
in any translations. */
_("Stock account for security \"%s\""),
data.security_data_ptr->secname);
investment_account = gnc_import_select_account(data.unique_id,
investment_account = gnc_import_select_account(NULL,
data.unique_id,
1,
investment_account_text,
investment_commodity,
@ -413,6 +415,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
_("Income account for security \"%s\""),
data.security_data_ptr->secname);
income_account=gnc_import_select_account(NULL,
NULL,
1,
investment_account_text,
currency,
@ -582,7 +585,10 @@ int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data)
"%s \"%s\"",
account_type_name,
data.account_name);
selected_account = gnc_import_select_account(data.account_id, 1, account_description, default_commodity, default_type, NULL, NULL);
selected_account = gnc_import_select_account(NULL,
data.account_id, 1,
account_description, default_commodity,
default_type, NULL, NULL);
g_free(account_description);
g_free(account_type_name);
}