GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-plugin-aqbanking.c
1 /*
2  * gnc-plugin-aqbanking.c --
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, contact:
16  *
17  * Free Software Foundation Voice: +1-617-542-5942
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
19  * Boston, MA 02110-1301, USA [email protected]
20  */
21 
31 #include "config.h"
32 
33 #include <glib/gi18n.h>
34 
35 #include "Account.h"
36 #include "dialog-ab-trans.h"
37 #include "assistant-ab-initial.h"
38 #include "gnc-ab-getbalance.h"
39 #include "gnc-ab-gettrans.h"
40 #include "gnc-ab-transfer.h"
41 #include "gnc-ab-utils.h"
42 #include "gnc-ab-kvp.h"
43 #include "gnc-gwen-gui.h"
44 #include "gnc-file-aqb-import.h"
45 #include "gnc-plugin-aqbanking.h"
46 #include "gnc-plugin-manager.h"
49 #include "gnc-plugin-page-register2.h"
50 #include "gnc-main-window.h"
51 #include "gnc-prefs.h"
52 #include "gnc-ui-util.h" // for gnc_get_current_book
53 
54 /* This static indicates the debugging module that this .o belongs to. */
55 static QofLogModule log_module = G_LOG_DOMAIN;
56 
57 static void gnc_plugin_aqbanking_class_init(GncPluginAqBankingClass *klass);
58 static void gnc_plugin_aqbanking_init(GncPluginAqBanking *plugin);
59 static void gnc_plugin_aqbanking_add_to_window(GncPlugin *plugin, GncMainWindow *window, GQuark type);
60 static void gnc_plugin_aqbanking_remove_from_window(GncPlugin *plugin, GncMainWindow *window, GQuark type);
61 
62 /* Object callbacks */
63 static void gnc_plugin_ab_main_window_page_added(GncMainWindow *window, GncPluginPage *page, gpointer user_data);
64 static void gnc_plugin_ab_main_window_page_changed(GncMainWindow *window, GncPluginPage *page, gpointer user_data);
65 static void gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *account, gpointer user_data);
66 
67 /* Auxiliary functions */
68 static Account *main_window_to_account(GncMainWindow *window);
69 
70 /* Command callbacks */
71 static void gnc_plugin_ab_cmd_setup(GtkAction *action, GncMainWindowActionData *data);
72 static void gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data);
73 static void gnc_plugin_ab_cmd_get_transactions(GtkAction *action, GncMainWindowActionData *data);
74 static void gnc_plugin_ab_cmd_issue_transaction(GtkAction *action, GncMainWindowActionData *data);
75 static void gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action, GncMainWindowActionData *data);
76 static void gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action, GncMainWindowActionData *data);
77 static void gnc_plugin_ab_cmd_issue_direct_debit(GtkAction *action, GncMainWindowActionData *data);
78 static void gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action, GncMainWindowActionData *data);
79 static void gnc_plugin_ab_cmd_view_logwindow(GtkToggleAction *action, GncMainWindow *window);
80 static void gnc_plugin_ab_cmd_mt940_import(GtkAction *action, GncMainWindowActionData *data);
81 static void gnc_plugin_ab_cmd_mt942_import(GtkAction *action, GncMainWindowActionData *data);
82 static void gnc_plugin_ab_cmd_dtaus_import(GtkAction *action, GncMainWindowActionData *data);
83 static void gnc_plugin_ab_cmd_dtaus_importsend(GtkAction *action, GncMainWindowActionData *data);
84 
85 #define PLUGIN_ACTIONS_NAME "gnc-plugin-aqbanking-actions"
86 #define PLUGIN_UI_FILENAME "gnc-plugin-aqbanking-ui.xml"
87 
88 #define MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW "ABViewLogwindowAction"
89 
90 
91 static GtkActionEntry gnc_plugin_actions [] =
92 {
93  /* Menus */
94  { "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
95 
96  /* Menu Items */
97  {
98  "ABSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
99  N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
100  G_CALLBACK(gnc_plugin_ab_cmd_setup)
101  },
102  {
103  "ABGetBalanceAction", NULL, N_("Get _Balance"), NULL,
104  N_("Get the account balance online through Online Banking"),
105  G_CALLBACK(gnc_plugin_ab_cmd_get_balance)
106  },
107  {
108  "ABGetTransAction", NULL, N_("Get _Transactions..."), NULL,
109  N_("Get the transactions online through Online Banking"),
110  G_CALLBACK(gnc_plugin_ab_cmd_get_transactions)
111  },
112  {
113  "ABIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
114  N_("Issue a new transaction online through Online Banking"),
115  G_CALLBACK(gnc_plugin_ab_cmd_issue_transaction)
116  },
117  {
118  "ABIssueSepaTransAction", NULL, N_("_Issue SEPA Transaction..."), NULL,
119  N_("Issue a new international European (SEPA) transaction online through Online Banking"),
120  G_CALLBACK(gnc_plugin_ab_cmd_issue_sepatransaction)
121  },
122  {
123  "ABIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
124  N_("Issue a new bank-internal transaction online through Online Banking"),
125  G_CALLBACK(gnc_plugin_ab_cmd_issue_inttransaction)
126  },
127  {
128  "ABIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
129  N_("Issue a new direct debit note online through Online Banking"),
130  G_CALLBACK(gnc_plugin_ab_cmd_issue_direct_debit)
131  },
132  {
133  "ABIssueSepaDirectDebitAction", NULL, N_("_Issue SEPA Direct Debit..."), NULL,
134  N_("Issue a new international European (SEPA) direct debit note online through Online Banking"),
135  G_CALLBACK(gnc_plugin_ab_cmd_issue_sepa_direct_debit)
136  },
137 
138  /* File -> Import menu item */
139  {
140  "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
141  N_("Import a MT940 file into GnuCash"),
142  G_CALLBACK(gnc_plugin_ab_cmd_mt940_import)
143  },
144  {
145  "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
146  N_("Import a MT942 file into GnuCash"),
147  G_CALLBACK(gnc_plugin_ab_cmd_mt942_import)
148  },
149  {
150  "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
151  N_("Import a DTAUS file into GnuCash"),
152  G_CALLBACK(gnc_plugin_ab_cmd_dtaus_import)
153  },
154  /* #ifdef CSV_IMPORT_FUNCTIONAL */
155  /* { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL, */
156  /* N_("Import a CSV file into GnuCash"), */
157  /* G_CALLBACK(gnc_plugin_ab_cmd_csv_import) }, */
158  /* { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL, */
159  /* N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"), */
160  /* G_CALLBACK(gnc_plugin_ab_cmd_csv_importsend) }, */
161  /* #endif */
162  {
163  "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
164  N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
165  G_CALLBACK(gnc_plugin_ab_cmd_dtaus_importsend)
166  },
167 };
168 static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
169 
170 static GtkToggleActionEntry gnc_plugin_toggle_actions [] =
171 {
172  {
173  MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW, NULL,
174  N_("Show _log window"), NULL,
175  N_("Show the online banking log window."),
176  G_CALLBACK(gnc_plugin_ab_cmd_view_logwindow), TRUE
177  },
178 };
179 static guint gnc_plugin_n_toggle_actions = G_N_ELEMENTS(gnc_plugin_toggle_actions);
180 
181 static const gchar *need_account_actions[] =
182 {
183  "ABGetBalanceAction",
184  "ABGetTransAction",
185  "ABIssueTransAction",
186  "ABIssueSepaTransAction",
187  "ABIssueIntTransAction",
188  "ABIssueDirectDebitAction",
189  "ABIssueSepaDirectDebitAction",
190  NULL
191 };
192 
193 static const gchar *readonly_inactive_actions[] =
194 {
195  "OnlineActionsAction",
196  "ABSetupAction",
197  NULL
198 };
199 
200 static GncMainWindow *gnc_main_window = NULL;
201 
202 /************************************************************
203  * Object Implementation *
204  ************************************************************/
205 
206 G_DEFINE_TYPE(GncPluginAqBanking, gnc_plugin_aqbanking, GNC_TYPE_PLUGIN)
207 
208 GncPlugin *
210 {
211  return GNC_PLUGIN(g_object_new(GNC_TYPE_PLUGIN_AQBANKING, (gchar*) NULL));
212 }
213 
214 static void
215 gnc_plugin_aqbanking_class_init(GncPluginAqBankingClass *klass)
216 {
217  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass);
218 
219  /* plugin info */
220  plugin_class->plugin_name = GNC_PLUGIN_AQBANKING_NAME;
221 
222  /* widget addition/removal */
223  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
224  plugin_class->actions = gnc_plugin_actions;
225  plugin_class->n_actions = gnc_plugin_n_actions;
226  plugin_class->toggle_actions = gnc_plugin_toggle_actions;
227  plugin_class->n_toggle_actions = gnc_plugin_n_toggle_actions;
228  plugin_class->ui_filename = PLUGIN_UI_FILENAME;
229  plugin_class->add_to_window = gnc_plugin_aqbanking_add_to_window;
230  plugin_class->remove_from_window = gnc_plugin_aqbanking_remove_from_window;
231 }
232 
233 static void
234 gnc_plugin_aqbanking_init(GncPluginAqBanking *plugin)
235 {
236 }
237 
242 static void
243 gnc_plugin_aqbanking_add_to_window(GncPlugin *plugin, GncMainWindow *window,
244  GQuark type)
245 {
246  GtkAction *action;
247 
248  gnc_main_window = window;
249 
250  g_signal_connect(window, "page_added",
251  G_CALLBACK(gnc_plugin_ab_main_window_page_added),
252  plugin);
253  g_signal_connect(window, "page_changed",
254  G_CALLBACK(gnc_plugin_ab_main_window_page_changed),
255  plugin);
256 
257  action = gnc_main_window_find_action(window, MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
258 
259  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
260 }
261 
262 static void
263 gnc_plugin_aqbanking_remove_from_window(GncPlugin *plugin, GncMainWindow *window,
264  GQuark type)
265 {
266  g_signal_handlers_disconnect_by_func(
267  window, G_CALLBACK(gnc_plugin_ab_main_window_page_changed), plugin);
268  g_signal_handlers_disconnect_by_func(
269  window, G_CALLBACK(gnc_plugin_ab_main_window_page_added), plugin);
270 }
271 
272 /************************************************************
273  * Object Callbacks *
274  ************************************************************/
275 
280 static void
281 gnc_plugin_ab_main_window_page_added(GncMainWindow *window, GncPluginPage *page,
282  gpointer user_data)
283 {
284  const gchar *page_name;
285 
286  ENTER("main window %p, page %p", window, page);
287  if (!GNC_IS_PLUGIN_PAGE(page))
288  {
289  LEAVE("no plugin_page");
290  return;
291  }
292 
293  page_name = gnc_plugin_page_get_plugin_name(page);
294  if (!page_name)
295  {
296  LEAVE("no page_name of plugin_page");
297  return;
298  }
299 
300  if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
301  {
302  DEBUG("account tree page, adding signal");
303  g_signal_connect(page, "account_selected",
304  G_CALLBACK(gnc_plugin_ab_account_selected), NULL);
305  }
306 
307  gnc_plugin_ab_main_window_page_changed(window, page, user_data);
308 
309  LEAVE(" ");
310 }
311 
314 static void update_inactive_actions(GncPluginPage *plugin_page)
315 {
316  GncMainWindow *window;
317  GtkActionGroup *action_group;
318 
319  // We are readonly - so we have to switch particular actions to inactive.
320  gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
321 
322  // We continue only if the current page is a plugin page
323  if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page))
324  return;
325 
326  window = GNC_MAIN_WINDOW(plugin_page->window);
327  g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
329  g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
330 
331  /* Set the action's sensitivity */
332  gnc_plugin_update_actions (action_group, readonly_inactive_actions,
333  "sensitive", is_readwrite);
334 }
335 
336 
341 static void
342 gnc_plugin_ab_main_window_page_changed(GncMainWindow *window,
343  GncPluginPage *page, gpointer user_data)
344 {
345  Account *account = main_window_to_account(window);
346 
347  /* Make sure not to call this with a NULL GncPluginPage */
348  if (page)
349  {
350  // Update the menu items according to the selected account
351  gnc_plugin_ab_account_selected(page, account, user_data);
352 
353  // Also update the action sensitivity due to read-only
354  update_inactive_actions(page);
355  }
356 }
357 
362 static void
363 gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *account,
364  gpointer user_data)
365 {
366  GncMainWindow *window;
367  GtkActionGroup *action_group;
368  const gchar *bankcode = NULL;
369  const gchar *accountid = NULL;
370 
371  g_return_if_fail(GNC_IS_PLUGIN_PAGE(plugin_page));
372  window = GNC_MAIN_WINDOW(plugin_page->window);
373  g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
375  g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
376 
377  if (account)
378  {
379  bankcode = gnc_ab_get_account_bankcode(account);
380  accountid = gnc_ab_get_account_accountid(account);
381 
382  gnc_plugin_update_actions(action_group, need_account_actions,
383  "sensitive",
384  (account && bankcode && *bankcode
385  && accountid && *accountid));
386  gnc_plugin_update_actions(action_group, need_account_actions,
387  "visible", TRUE);
388  }
389  else
390  {
391  gnc_plugin_update_actions(action_group, need_account_actions,
392  "sensitive", FALSE);
393  gnc_plugin_update_actions(action_group, need_account_actions,
394  "visible", FALSE);
395  }
396 
397 }
398 
399 /************************************************************
400  * Auxiliary Functions *
401  ************************************************************/
402 
414 static Account *
415 main_window_to_account(GncMainWindow *window)
416 {
417  GncPluginPage *page;
418  const gchar *page_name;
419  Account *account = NULL;
420  const gchar *account_name;
421 
422  ENTER("main window %p", window);
423  if (!GNC_IS_MAIN_WINDOW(window))
424  {
425  LEAVE("no main_window");
426  return NULL;
427  }
428 
429  page = gnc_main_window_get_current_page(window);
430  if (!GNC_IS_PLUGIN_PAGE(page))
431  {
432  LEAVE("no plugin_page");
433  return NULL;
434  }
435  page_name = gnc_plugin_page_get_plugin_name(page);
436  if (!page_name)
437  {
438  LEAVE("no page_name of plugin_page");
439  return NULL;
440  }
441 
442  if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
443  {
444  DEBUG("register page");
446  GNC_PLUGIN_PAGE_REGISTER(page));
447  }
448  else if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER2_NAME) == 0)
449  {
450  DEBUG("register2 page");
452  GNC_PLUGIN_PAGE_REGISTER2(page));
453  }
454  else if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
455  {
456  DEBUG("account tree page");
458  GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
459  }
460  else
461  {
462  account = NULL;
463  }
464  account_name = account ? xaccAccountGetName(account) : NULL;
465  LEAVE("account %s(%p)", account_name ? account_name : "(null)", account);
466  return account;
467 }
468 
469 void
471 {
472  GtkAction *action;
473 
474  action = gnc_main_window_find_action(gnc_main_window,
475  MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
476  if (action)
477  {
478  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),
479  logwindow_visible);
480  }
481 }
482 
483 /************************************************************
484  * Command Callbacks *
485  ************************************************************/
486 
487 static void
488 gnc_plugin_ab_cmd_setup(GtkAction *action, GncMainWindowActionData *data)
489 {
490  ENTER("action %p, main window data %p", action, data);
491  gnc_main_window = data->window;
493  LEAVE(" ");
494 }
495 
496 static void
497 gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data)
498 {
499  Account *account;
500 
501  ENTER("action %p, main window data %p", action, data);
502  account = main_window_to_account(data->window);
503  if (account == NULL)
504  {
505  g_message("No AqBanking account selected");
506  LEAVE("no account");
507  return;
508  }
509 
510  gnc_main_window = data->window;
511  gnc_ab_getbalance(GTK_WIDGET(data->window), account);
512 
513  LEAVE(" ");
514 }
515 
516 static void
517 gnc_plugin_ab_cmd_get_transactions(GtkAction *action,
519 {
520  Account *account;
521 
522  ENTER("action %p, main window data %p", action, data);
523  account = main_window_to_account(data->window);
524  if (account == NULL)
525  {
526  g_message("No AqBanking account selected");
527  LEAVE("no account");
528  return;
529  }
530 
531  gnc_main_window = data->window;
532  gnc_ab_gettrans(GTK_WIDGET(data->window), account);
533 
534  LEAVE(" ");
535 }
536 
537 static void
538 gnc_plugin_ab_cmd_issue_transaction(GtkAction *action,
540 {
541  Account *account;
542 
543  ENTER("action %p, main window data %p", action, data);
544  account = main_window_to_account(data->window);
545  if (account == NULL)
546  {
547  g_message("No AqBanking account selected");
548  LEAVE("no account");
549  return;
550  }
551 
552  gnc_main_window = data->window;
553  gnc_ab_maketrans(GTK_WIDGET(data->window), account, SINGLE_TRANSFER);
554 
555  LEAVE(" ");
556 }
557 
558 static void
559 gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action,
561 {
562  Account *account;
563 
564  ENTER("action %p, main window data %p", action, data);
565  account = main_window_to_account(data->window);
566  if (account == NULL)
567  {
568  g_message("No AqBanking account selected");
569  LEAVE("no account");
570  return;
571  }
572 
573  gnc_main_window = data->window;
574  gnc_ab_maketrans(GTK_WIDGET(data->window), account, SEPA_TRANSFER);
575 
576  LEAVE(" ");
577 }
578 
579 static void
580 gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action,
582 {
583  Account *account;
584 
585  ENTER("action %p, main window data %p", action, data);
586  account = main_window_to_account(data->window);
587  if (account == NULL)
588  {
589  g_message("No AqBanking account selected");
590  LEAVE("no account");
591  return;
592  }
593 
594  gnc_main_window = data->window;
595  gnc_ab_maketrans(GTK_WIDGET(data->window), account,
596  SINGLE_INTERNAL_TRANSFER);
597 
598  LEAVE(" ");
599 }
600 
601 static void
602 gnc_plugin_ab_cmd_issue_direct_debit(GtkAction *action,
604 {
605  Account *account;
606 
607  ENTER("action %p, main window data %p", action, data);
608  account = main_window_to_account(data->window);
609  if (account == NULL)
610  {
611  g_message("No AqBanking account selected");
612  LEAVE("no account");
613  return;
614  }
615 
616  gnc_main_window = data->window;
617  gnc_ab_maketrans(GTK_WIDGET(data->window), account, SINGLE_DEBITNOTE);
618 
619  LEAVE(" ");
620 }
621 
622 static void
623 gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action,
625 {
626  Account *account;
627 
628  ENTER("action %p, main window data %p", action, data);
629  account = main_window_to_account(data->window);
630  if (account == NULL)
631  {
632  g_message("No AqBanking account selected");
633  LEAVE("no account");
634  return;
635  }
636 
637  gnc_main_window = data->window;
638  gnc_ab_maketrans(GTK_WIDGET(data->window), account, SEPA_DEBITNOTE);
639 
640  LEAVE(" ");
641 }
642 
643 static void
644 gnc_plugin_ab_cmd_view_logwindow(GtkToggleAction *action, GncMainWindow *window)
645 {
646  if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)))
647  {
649  {
650  /* Log window could not be made visible */
651  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
652  }
653  }
654  else
655  {
657  }
658 }
659 
660 
661 static void
662 gnc_plugin_ab_cmd_mt940_import(GtkAction *action, GncMainWindowActionData *data)
663 {
664  gchar *format = gnc_prefs_get_string(GNC_PREFS_GROUP_AQBANKING,
665  GNC_PREF_FORMAT_SWIFT940);
666  gnc_main_window = data->window;
667  gnc_file_aqbanking_import("swift", format ? format : "swift-mt940", FALSE);
668  g_free(format);
669 }
670 
671 static void
672 gnc_plugin_ab_cmd_mt942_import(GtkAction *action, GncMainWindowActionData *data)
673 {
674  gchar *format = gnc_prefs_get_string(GNC_PREFS_GROUP_AQBANKING,
675  GNC_PREF_FORMAT_SWIFT942);
676  gnc_main_window = data->window;
677  gnc_file_aqbanking_import("swift", format ? format : "swift-mt942", FALSE);
678  g_free(format);
679 }
680 
681 static void
682 gnc_plugin_ab_cmd_dtaus_import(GtkAction *action, GncMainWindowActionData *data)
683 {
684  gchar *format = gnc_prefs_get_string(GNC_PREFS_GROUP_AQBANKING,
685  GNC_PREF_FORMAT_DTAUS);
686  gnc_main_window = data->window;
687  gnc_file_aqbanking_import("dtaus", format ? format : "default", FALSE);
688  g_free(format);
689 }
690 
691 static void
692 gnc_plugin_ab_cmd_dtaus_importsend(GtkAction *action,
694 {
695  gchar *format = gnc_prefs_get_string(GNC_PREFS_GROUP_AQBANKING,
696  GNC_PREF_FORMAT_DTAUS);
697  gnc_main_window = data->window;
698  gnc_file_aqbanking_import("dtaus", format ? format : "default", TRUE);
699  g_free(format);
700 }
701 
702 /************************************************************
703  * Plugin Bootstrapping *
704  ************************************************************/
705 
706 void
708 {
710 
712 }
Dialog for AqBanking transaction data.
gboolean gnc_GWEN_Gui_show_dialog()
Definition: gnc-gwen-gui.c:416
Account * gnc_plugin_page_account_tree_get_current_account(GncPluginPageAccountTree *page)
gchar * gnc_prefs_get_string(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:237
utility functions for the GnuCash UI
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
AqBanking setup functionality.
#define DEBUG(format, args...)
Definition: qoflog.h:255
Plugin management functions for the GnuCash UI.
GtkWidget * window
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
const gchar * gnc_ab_get_account_bankcode(const Account *a)
Definition: gnc-ab-kvp.c:59
#define ENTER(format, args...)
Definition: qoflog.h:261
guint n_toggle_actions
Definition: gnc-plugin.h:129
const gchar * ui_filename
Definition: gnc-plugin.h:137
GncPluginPage * gnc_main_window_get_current_page(GncMainWindow *window)
Functions for adding content to a window.
AqBanking getbalance functions.
GtkActionEntry * actions
Definition: gnc-plugin.h:122
Functions providing a register page for the GnuCash UI.
Account handling public routines.
Dialog for AqBanking transaction data.
void(* remove_from_window)(GncPlugin *plugin, GncMainWindow *window, GQuark type)
Definition: gnc-plugin.h:171
void gnc_plugin_aqbanking_set_logwindow_visible(gboolean logwindow_visible)
Account * gnc_plugin_page_register2_get_account(GncPluginPageRegister2 *page)
void gnc_file_aqbanking_import(const gchar *aqbanking_importername, const gchar *aqbanking_profilename, gboolean execute_transactions)
GncPluginManager * gnc_plugin_manager_get(void)
GtkToggleActionEntry * toggle_actions
Definition: gnc-plugin.h:127
const gchar * actions_name
Definition: gnc-plugin.h:119
Generic api to store and retrieve preferences.
Functions providing a chart of account page.
GtkActionGroup * gnc_main_window_get_action_group(GncMainWindow *window, const gchar *group_name)
gboolean qof_book_is_readonly(const QofBook *book)
const gchar * plugin_name
Definition: gnc-plugin.h:112
void gnc_plugin_update_actions(GtkActionGroup *action_group, const gchar **action_names, const gchar *property_name, gboolean value)
Definition: gnc-plugin.c:313
Plugin registration of the AqBanking module.
#define PLUGIN_ACTIONS_NAME
#define LEAVE(format, args...)
Definition: qoflog.h:271
void(* add_to_window)(GncPlugin *plugin, GncMainWindow *window, GQuark type)
Definition: gnc-plugin.h:155
GncPlugin * gnc_plugin_aqbanking_new(void)
Account * gnc_plugin_page_register_get_account(GncPluginPageRegister *page)
void gnc_ab_initial_assistant(void)
void gnc_plugin_aqbanking_create_plugin(void)
const gchar * gnc_ab_get_account_accountid(const Account *a)
Definition: gnc-ab-kvp.c:39
void gnc_ab_getbalance(GtkWidget *parent, Account *gnc_acc)
const char * xaccAccountGetName(const Account *acc)
Definition: Account.c:3031
AqBanking KVP handling.
GUI callbacks for AqBanking.
void gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
AqBanking utility functions.
GtkAction * gnc_main_window_find_action(GncMainWindow *window, const gchar *name)
#define PLUGIN_UI_FILENAME
void gnc_GWEN_Gui_hide_dialog()
Definition: gnc-gwen-gui.c:444
const gchar * QofLogModule
Definition: qofid.h:89
const gchar * gnc_plugin_page_get_plugin_name(GncPluginPage *plugin_page)
void gnc_ab_maketrans(GtkWidget *parent, Account *gnc_acc, GncABTransType trans_type)