mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
26cc119630
commit
8ee2861201
@ -1,5 +1,9 @@
|
|||||||
2006-02-24 Christian Stimming <stimming@tuhh.de>
|
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
|
* src/import-export/import-account-matcher.c: Don't allow
|
||||||
placeholder be selected for importing transactions. Fixes
|
placeholder be selected for importing transactions. Fixes
|
||||||
bug#327891.
|
bug#327891.
|
||||||
|
@ -399,7 +399,8 @@ on_accountlist_select_row (GtkCList *clist, gint row,
|
|||||||
GNC_COMMODITY_NS_ISO, AB_Account_GetCurrency (hbci_acc));
|
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);
|
old_value, NULL);
|
||||||
g_free(longname);
|
g_free(longname);
|
||||||
|
|
||||||
|
@ -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,
|
gboolean auto_create,
|
||||||
const gchar * account_human_description,
|
const gchar * account_human_description,
|
||||||
gnc_commodity * new_account_default_commodity,
|
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");
|
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");
|
picker->account_tree_sw = glade_xml_get_widget (xml, "account_tree_sw");
|
||||||
online_id_label = glade_xml_get_widget (xml, "online_id_label");
|
online_id_label = glade_xml_get_widget (xml, "online_id_label");
|
||||||
button = glade_xml_get_widget (xml, "newbutton");
|
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. */
|
/* See if the selected account is a placeholder. */
|
||||||
if (xaccAccountGetPlaceholder (retval)) {
|
if (xaccAccountGetPlaceholder (retval)) {
|
||||||
gnc_error_dialog (/* FIXME: add parent*/ NULL,
|
gnc_error_dialog
|
||||||
_("The account %s does not allow transactions."),
|
(picker->dialog,
|
||||||
|
_("The account %s is a placeholder account and does not allow "
|
||||||
|
"transactions. Please choose a different account."),
|
||||||
xaccAccountGetName (retval));
|
xaccAccountGetName (retval));
|
||||||
response = GNC_RESPONSE_NEW;
|
response = GNC_RESPONSE_NEW;
|
||||||
break;
|
break;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#define ACCOUNT_MATCHER_H
|
#define ACCOUNT_MATCHER_H
|
||||||
|
|
||||||
#include "Account.h"
|
#include "Account.h"
|
||||||
|
#include "gnc-ui-common.h"
|
||||||
|
|
||||||
/** Must be called with a string containing a unique identifier for the
|
/** Must be called with a string containing a unique identifier for the
|
||||||
account. If an account with a matching online_id kvp_frame is
|
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
|
again). If the user refuses to select or create an account, NULL is
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
|
@param parent The parent widget. Can be NULL.
|
||||||
|
|
||||||
@param account_online_id_value The string containing your unique
|
@param account_online_id_value The string containing your unique
|
||||||
account_id coming from some string of your module. This is the
|
account_id coming from some string of your module. This is the
|
||||||
normal mode of operation. Can be NULL.
|
normal mode of operation. Can be NULL.
|
||||||
@ -86,7 +89,8 @@
|
|||||||
@return A pointer to the found or created Account, or NULL if no
|
@return A pointer to the found or created Account, or NULL if no
|
||||||
account was found or created.
|
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,
|
gboolean auto_create,
|
||||||
const gchar * account_human_description,
|
const gchar * account_human_description,
|
||||||
gnc_commodity * new_account_default_commodity,
|
gnc_commodity * new_account_default_commodity,
|
||||||
|
@ -298,7 +298,8 @@ run_account_picker_dialog (GNCImportMainMatcher *info,
|
|||||||
gboolean ok_pressed;
|
gboolean ok_pressed;
|
||||||
g_assert (trans_info);
|
g_assert (trans_info);
|
||||||
old_acc = gnc_import_TransInfo_get_destacc (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,
|
TRUE,
|
||||||
_("Destination account for the auto-balance split."),
|
_("Destination account for the auto-balance split."),
|
||||||
xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
|
xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
|
||||||
|
@ -211,7 +211,8 @@ accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data) {
|
|||||||
AB_ImExporterAccountInfo_GetAccountName(accinfo);
|
AB_ImExporterAccountInfo_GetAccountName(accinfo);
|
||||||
gchar *online_id = g_strconcat (bank_code, account_number, NULL);
|
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);
|
NO_TYPE, NULL, NULL);
|
||||||
g_free(online_id);
|
g_free(online_id);
|
||||||
if (gnc_acc) {
|
if (gnc_acc) {
|
||||||
|
@ -122,7 +122,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
|
|||||||
g_assert(gnc_ofx_importer_gui);
|
g_assert(gnc_ofx_importer_gui);
|
||||||
|
|
||||||
if(data.account_id_valid==true){
|
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)
|
if(account!=NULL)
|
||||||
{
|
{
|
||||||
/********** Create the transaction and setup transaction data ************/
|
/********** 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. */
|
in any translations. */
|
||||||
_("Stock account for security \"%s\""),
|
_("Stock account for security \"%s\""),
|
||||||
data.security_data_ptr->secname);
|
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,
|
1,
|
||||||
investment_account_text,
|
investment_account_text,
|
||||||
investment_commodity,
|
investment_commodity,
|
||||||
@ -413,6 +415,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
|
|||||||
_("Income account for security \"%s\""),
|
_("Income account for security \"%s\""),
|
||||||
data.security_data_ptr->secname);
|
data.security_data_ptr->secname);
|
||||||
income_account=gnc_import_select_account(NULL,
|
income_account=gnc_import_select_account(NULL,
|
||||||
|
NULL,
|
||||||
1,
|
1,
|
||||||
investment_account_text,
|
investment_account_text,
|
||||||
currency,
|
currency,
|
||||||
@ -582,7 +585,10 @@ int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data)
|
|||||||
"%s \"%s\"",
|
"%s \"%s\"",
|
||||||
account_type_name,
|
account_type_name,
|
||||||
data.account_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_description);
|
||||||
g_free(account_type_name);
|
g_free(account_type_name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user