GnuCash  4.11-11-ge9df8d41d2+
gnc-plugin-basic-commands.c
Go to the documentation of this file.
1 /*
2  * gnc-plugin-basic-commands.c --
3  *
4  * Copyright (C) 2005 David Hampton <hampton@employees.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, contact:
18  *
19  * Free Software Foundation Voice: +1-617-542-5942
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
21  * Boston, MA 02110-1301, USA gnu@gnu.org
22  */
23 
33 #include <config.h>
34 
35 #include <gtk/gtk.h>
36 #include <glib/gi18n.h>
37 #include <string.h>
38 
40 #include "gnc-ui-util.h"
41 
42 #include "dialog-doclink.h"
43 #include "dialog-book-close.h"
44 #include "dialog-file-access.h"
45 #include "dialog-fincalc.h"
46 #include "dialog-find-transactions.h"
47 #include "dialog-find-transactions2.h"
48 #include "dialog-imap-editor.h"
49 #include "dialog-sx-since-last-run.h"
50 #include "dialog-totd.h"
51 #include "assistant-acct-period.h"
52 #include "assistant-loan.h"
53 #include "gnc-engine.h"
54 #include "gnc-file.h"
55 #include "gnc-gui-query.h"
56 #include "gnc-main-window.h"
57 #include "gnc-ui.h"
58 #include "gnc-window.h"
59 #include "gnc-session.h"
60 #include "gnc-plugin-page-sx-list.h"
62 
63 /* This static indicates the debugging module that this .o belongs to. */
64 G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI;
65 
66 static void gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass);
67 static void gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin);
68 static void gnc_plugin_basic_commands_finalize (GObject *object);
69 
70 static void gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
71 static void gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window, GncPluginPage *page, gpointer user_data);
72 
73 /* Command callbacks */
74 static void gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data);
75 static void gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data);
76 static void gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data);
77 static void gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data);
78 static void gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data);
79 static void gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data);
80 static void gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data);
81 static void gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data);
82 static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data);
83 static void gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data);
84 
85 #if CLOSE_BOOKS_ACTUALLY_WORKS
86 static void gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data);
87 #endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
88 
89 static void gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data);
90 static void gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data);
91 static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data);
92 static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data);
93 static void gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data);
94 static void gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data);
95 static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data);
96 static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data);
97 
98 
99 
100 #define PLUGIN_ACTIONS_NAME "gnc-plugin-basic-commands-actions"
101 #define PLUGIN_UI_FILENAME "gnc-plugin-basic-commands-ui.xml"
102 
105 static GtkActionEntry gnc_plugin_actions [] =
106 {
107 
108  /* File menu */
109 
110  {
111  "FileNewAction", "document-new", N_("New _File"), "<primary>n",
112  N_("Create a new file"),
113  G_CALLBACK (gnc_main_window_cmd_file_new)
114  },
115  {
116  "FileOpenAction", "document-open", N_("_Open..."), "<primary>o",
117  N_("Open an existing GnuCash file"),
118  G_CALLBACK (gnc_main_window_cmd_file_open)
119  },
120  {
121  "FileSaveAction", "document-save", N_("_Save"), "<primary>s",
122  N_("Save the current file"),
123  G_CALLBACK (gnc_main_window_cmd_file_save)
124  },
125  {
126  "FileSaveAsAction", "document-save-as", N_("Save _As..."), "<shift><primary>s",
127  N_("Save this file with a different name"),
128  G_CALLBACK (gnc_main_window_cmd_file_save_as)
129  },
130  {
131  "FileRevertAction", "document-revert", N_("Re_vert"), NULL,
132  N_("Reload the current database, reverting all unsaved changes"),
133  G_CALLBACK (gnc_main_window_cmd_file_revert)
134  },
135  {
136  "FileExportAccountsAction", "go-next",
137  N_("Export _Accounts"), NULL,
138  N_("Export the account hierarchy to a new GnuCash datafile"),
139  G_CALLBACK (gnc_main_window_cmd_file_export_accounts)
140  },
141 
142  /* Edit menu */
143 
144  {
145  "EditFindTransactionsAction", "edit-find", N_("_Find..."), "<primary>f",
146  N_("Find transactions with a search"),
147  G_CALLBACK (gnc_main_window_cmd_tools_find_transactions)
148  },
149  {
150  "EditTaxOptionsAction", NULL,
151  /* Translators: remember to reuse this
152  translation in dialog-account.glade */
153  N_("Ta_x Report Options"), NULL,
154  /* Translators: currently implemented are
155  US: income tax and
156  DE: VAT
157  So adjust this string */
158  N_("Setup relevant accounts for tax reports, e.g. US income tax"),
159  G_CALLBACK (gnc_main_window_cmd_edit_tax_options)
160  },
161 
162  /* Actions menu */
163 
164  { "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
165  {
166  "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
167  N_("The list of Scheduled Transactions"),
168  G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor)
169  },
170  {
171  "ActionsSinceLastRunAction", NULL, N_("Since _Last Run..."), NULL,
172  N_("Create Scheduled Transactions since the last time run"),
173  G_CALLBACK (gnc_main_window_cmd_actions_since_last_run)
174  },
175  {
176  "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
177  N_("Setup scheduled transactions for repayment of a loan"),
178  G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan)
179  },
180  { "ActionsBudgetAction", NULL, N_("B_udget"), NULL, NULL, NULL },
181 #ifdef CLOSE_BOOKS_ACTUALLY_WORKS
182  {
183  "ActionsCloseBooksAction", NULL, N_("Close _Books"), NULL,
184  N_("Archive old data using accounting periods"),
185  G_CALLBACK (gnc_main_window_cmd_actions_close_books)
186  },
187 #endif // CLOSE_BOOKS_ACTUALLY_WORKS
188 
189  /* Tools menu */
190  {
191  "ToolsPriceEditorAction", NULL, N_("_Price Database"), NULL,
192  N_("View and edit the prices for stocks and mutual funds"),
193  G_CALLBACK (gnc_main_window_cmd_tools_price_editor)
194  },
195  {
196  "ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL,
197  N_("View and edit the commodities for stocks and mutual funds"),
198  G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor)
199  },
200  {
201  "ToolsFinancialCalculatorAction", NULL, N_("_Loan Repayment Calculator"), NULL,
202  N_("Use the loan/mortgage repayment calculator"),
203  G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator)
204  },
205  {
206  "ToolsBookCloseAction", NULL, N_("_Close Book"), NULL,
207  N_("Close the Book at the end of the Period"),
208  G_CALLBACK (gnc_main_window_cmd_tools_close_book)
209  },
210  {
211  "ToolsImapEditorAction", NULL, N_("_Import Map Editor"), NULL,
212  N_("View and Delete Bayesian and non-Bayesian information"),
213  G_CALLBACK (gnc_main_window_cmd_tools_imap_editor)
214  },
215  {
216  "ToolsTransLinkedDocsAction", NULL, N_("_Transaction Linked Documents"), NULL,
217  N_("View all Transaction Linked Documents"),
218  G_CALLBACK (gnc_main_window_cmd_tools_trans_doclink)
219  },
220 
221  /* Help menu */
222 
223  {
224  "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
225  N_("View the Tips of the Day"),
226  G_CALLBACK (gnc_main_window_cmd_help_totd)
227  },
228 };
230 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
231 
232 
236 static const gchar *gnc_plugin_important_actions[] =
237 {
238  "FileSaveAction",
239  NULL,
240 };
241 
244 static const gchar *gnc_plugin_initially_insensitive_actions[] =
245 {
246  "FileSaveAction",
247  NULL,
248 };
249 
254 static const gchar *readwrite_only_active_actions[] =
255 {
256  "ToolsBookCloseAction",
257  NULL
258 };
259 
266 static const gchar *dirty_only_active_actions[] =
267 {
268  "FileSaveAction",
269  "FileRevertAction",
270  NULL
271 };
272 
276 {
277  gpointer dummy;
279 
280 #define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
281  ((GncPluginBasicCommandsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BASIC_COMMANDS))
282 
284 static GObjectClass *parent_class = NULL;
285 
287 GncPlugin *
289 {
290  GncPluginBasicCommands *plugin;
291 
292  /* We just need to mention it, so the GType is registered and will be
293  * reflected during plugin-page restore. */
295 
296  plugin = g_object_new (GNC_TYPE_PLUGIN_BASIC_COMMANDS, NULL);
297 
298  return GNC_PLUGIN (plugin);
299 }
300 
315 static void
316 gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
317  GncMainWindow *window,
318  GQuark type)
319 {
320  GtkActionGroup *action_group =
322  gnc_plugin_update_actions(action_group,
323  gnc_plugin_initially_insensitive_actions,
324  "sensitive", FALSE);
325  g_signal_connect(window, "page_changed",
326  G_CALLBACK(gnc_plugin_basic_commands_main_window_page_changed),
327  plugin);
328 }
329 
332 static void update_inactive_actions(GncPluginPage *plugin_page)
333 {
334  GncMainWindow *window;
335  GtkActionGroup *action_group;
336 
337  // We are readonly - so we have to switch particular actions to inactive.
338  gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
339  gboolean is_dirty = qof_book_session_not_saved (gnc_get_current_book ());
340 
341  // We continue only if the current page is a plugin page
342  if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page))
343  return;
344 
345  window = GNC_MAIN_WINDOW(plugin_page->window);
346  g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
348  g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
349 
350  /* Set the action's sensitivity */
351  gnc_plugin_update_actions (action_group, readwrite_only_active_actions,
352  "sensitive", is_readwrite);
353  gnc_plugin_update_actions (action_group, dirty_only_active_actions,
354  "sensitive", is_dirty);
355 }
356 
357 static void
358 gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window,
359  GncPluginPage *page,
360  gpointer user_data)
361 {
362  /* Make sure not to call this with a NULL GncPluginPage */
363  if (page)
364  {
365  // Update the action sensitivity due to read-only
366  update_inactive_actions(page);
367  }
368 }
369 
370 G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN)
371 
372 
379 static void
380 gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass)
381 {
382  GObjectClass *object_class = G_OBJECT_CLASS (klass);
383  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
384 
385  parent_class = g_type_class_peek_parent (klass);
386 
387  object_class->finalize = gnc_plugin_basic_commands_finalize;
388 
389  /* plugin info */
390  plugin_class->plugin_name = GNC_PLUGIN_BASIC_COMMANDS_NAME;
391 
392  /* function overrides */
393  plugin_class->add_to_window = gnc_plugin_basic_commands_add_to_window;
394 
395  /* widget addition/removal */
396  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
397  plugin_class->actions = gnc_plugin_actions;
398  plugin_class->n_actions = gnc_plugin_n_actions;
399  plugin_class->important_actions = gnc_plugin_important_actions;
400  plugin_class->ui_filename = PLUGIN_UI_FILENAME;
401 }
402 
403 
409 static void
410 gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin)
411 {
412 }
413 
414 
423 static void
424 gnc_plugin_basic_commands_finalize (GObject *object)
425 {
426  g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
427 
428  G_OBJECT_CLASS (parent_class)->finalize (object);
429 }
430 
431 /************************************************************
432  * Command Callbacks *
433  ************************************************************/
434 
435 static void
436 gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data)
437 {
439  return;
440 
441  gnc_file_new (GTK_WINDOW (data->window));
442 }
443 
444 static void
445 gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data)
446 {
447  g_return_if_fail (data != NULL);
448 
450  return;
451 
452  /* Reset the flag that indicates the conversion of the bayes KVP
453  * entries has been run */
455 
456  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
457 #ifdef HAVE_DBI_DBI_H
458  gnc_ui_file_access_for_open (GTK_WINDOW (data->window));
459 #else
460  gnc_file_open (GTK_WINDOW (data->window));
461 #endif
462  gnc_window_set_progressbar_window (NULL);
463 }
464 
465 static void
466 gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data)
467 {
468  g_return_if_fail (data != NULL);
469 
471  return;
472 
473  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
474  gnc_file_save (GTK_WINDOW (data->window));
475  gnc_window_set_progressbar_window (NULL);
476 }
477 
478 static void
479 gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data)
480 {
481  g_return_if_fail (data != NULL);
482 
484  return;
485 
486  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
487 #ifdef HAVE_DBI_DBI_H
488  gnc_ui_file_access_for_save_as (GTK_WINDOW (data->window));
489 #else
490  gnc_file_save_as (GTK_WINDOW (data->window));
491 #endif
492  gnc_window_set_progressbar_window (NULL);
493 }
494 
495 static void
496 gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data)
497 {
498  g_return_if_fail (data != NULL);
499 
501  return;
502 
503  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
504  gnc_file_revert(GTK_WINDOW (data->window));
505  gnc_window_set_progressbar_window (NULL);
506 }
507 
508 static void
509 gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data)
510 {
511  g_return_if_fail (data != NULL);
512 
513  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
514 #ifdef HAVE_DBI_DBI_H
515  gnc_ui_file_access_for_export (GTK_WINDOW (data->window));
516 #else
517  gnc_file_export (GTK_WINDOW (data->window));
518 #endif
519  gnc_window_set_progressbar_window (NULL);
520 }
521 
522 static void
523 gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data)
524 {
525  g_return_if_fail (data != NULL);
526 
527  gnc_tax_info_dialog (GTK_WIDGET (data->window), NULL);
528 }
529 
530 static void
531 gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data)
532 {
534  gnc_main_window_open_page(NULL, page);
535 }
536 
537 static void
538 gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data)
539 {
540  GtkWindow *window;
541  GncSxInstanceModel *sx_instances;
542  GncSxSummary summary;
543  GList *auto_created_txns = NULL;
544  const char *nothing_to_do_msg =
545  _( "There are no Scheduled Transactions to be entered at this time." );
546 
547  g_return_if_fail (data != NULL);
548 
549  window = GTK_WINDOW (data->window);
550 
551  if (qof_book_is_readonly(gnc_get_current_book()))
552  {
553  /* Is the book read-only? Then don't change anything here. */
554  return;
555  }
556 
557  sx_instances = gnc_sx_get_current_instances();
558  gnc_sx_instance_model_summarize(sx_instances, &summary);
559  gnc_sx_instance_model_effect_change(sx_instances, TRUE, &auto_created_txns, NULL);
560  if (summary.need_dialog)
561  {
562  gnc_ui_sx_since_last_run_dialog (window, sx_instances, auto_created_txns);
563  auto_created_txns = NULL;
564  }
565  else
566  {
567  if (summary.num_auto_create_no_notify_instances == 0)
568  {
569  gnc_info_dialog (window, "%s", nothing_to_do_msg);
570  }
571  else
572  {
573  gnc_info_dialog(window, ngettext
574  /* Translators: %d is the number of transactions. This is a
575  ngettext(3) message. */
576  ("There are no Scheduled Transactions to be entered at this time. "
577  "(%d transaction automatically created)",
578  "There are no Scheduled Transactions to be entered at this time. "
579  "(%d transactions automatically created)",
582  }
583  }
584  g_list_free(auto_created_txns);
585  g_object_unref(G_OBJECT(sx_instances));
586 }
587 
588 static void
589 gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data)
590 {
591  gnc_ui_sx_loan_assistant_create ();
592 }
593 #ifdef CLOSE_BOOKS_ACTUALLY_WORKS
594 static void
595 gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data)
596 {
597  gnc_acct_period_dialog();
598 }
599 #endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
600 
601 static void
602 gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data)
603 {
604  gnc_set_busy_cursor(NULL, TRUE);
605  gnc_imap_dialog (GTK_WIDGET (data->window));
606  gnc_unset_busy_cursor(NULL);
607 }
608 
609 static void
610 gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data)
611 {
612  gnc_set_busy_cursor (NULL, TRUE);
613  gnc_doclink_trans_dialog (GTK_WINDOW (data->window));
614  gnc_unset_busy_cursor (NULL);
615 }
616 
617 static void
618 gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data)
619 {
620  gnc_set_busy_cursor(NULL, TRUE);
621  gnc_prices_dialog (GTK_WIDGET (data->window));
622  gnc_unset_busy_cursor(NULL);
623 }
624 
625 static void
626 gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data)
627 {
628  gnc_set_busy_cursor(NULL, TRUE);
629  gnc_commodities_dialog (GTK_WIDGET (data->window));
630  gnc_unset_busy_cursor(NULL);
631 }
632 
633 static void
634 gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data)
635 {
636  gnc_ui_fincalc_dialog_create(GTK_WINDOW (data->window));
637 }
638 
639 static void
640 gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data)
641 {
642  gnc_ui_close_book(gnc_get_current_book(), GTK_WINDOW (data->window));
643 }
644 
645 static void
646 gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data)
647 {
648 
649 #ifdef REGISTER2_ENABLED
650  /*################## Added for Reg2 #################*/
651  gnc_ui_find_transactions_dialog_create2 (NULL);
652  /*################## Added for Reg2 #################*/
653 #else
654  gnc_ui_find_transactions_dialog_create (GTK_WINDOW(data->window), NULL);
655 #endif
656 }
657 
658 static void
659 gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data)
660 {
661  g_return_if_fail (data != NULL);
662 
663  gnc_totd_dialog(GTK_WINDOW(data->window), FALSE);
664 }
665 
The instance data structure for an basic commands menu plugin.
guint n_actions
The number of actions in the actions array.
Definition: gnc-plugin.h:124
The instance data structure for a content plugin.
utility functions for the GnuCash UI
gint num_auto_create_no_notify_instances
The number of automatically-created instances that do no request notification.
This file contains the functions to present a GUI to select a book closing date and accounts into whi...
Functions that are supported by all types of windows.
GtkWidget * window
The window that contains the display widget for this plugin.
void gnc_sx_instance_model_summarize(GncSxInstanceModel *model, GncSxSummary *summary)
void gnc_sx_instance_model_effect_change(GncSxInstanceModel *model, gboolean auto_create_only, GList **created_transaction_guids, GList **creation_errors)
Really ("effectively") create the transactions from the SX instances in the given model...
The class data structure for a menu-only plugin.
Definition: gnc-plugin.h:107
void gnc_ui_close_book(QofBook *book, GtkWindow *parent)
Create and run the dialog to close the book.
const gchar * ui_filename
The relative name of the XML file describing the menu/toolbar action items.
Definition: gnc-plugin.h:137
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Display a data plugin page in a window.
Functions for adding content to a window.
GtkActionEntry * actions
An array of actions that should automatically be added to any GnuCash "main" content window that is o...
Definition: gnc-plugin.h:122
Functions providing the file history menu.
void gnc_account_reset_convert_bayes_to_flat(void)
Reset the flag that indicates the function imap_convert_bayes_to_flat has been run.
Definition: Account.cpp:5815
The class data structure for a basic commands menu plugin.
const gchar ** important_actions
A NULL terminated list of actions that should be considered important.
Definition: gnc-plugin.h:134
GncPlugin * gnc_plugin_basic_commands_new(void)
Create a new basic commands menu plugin.
gboolean qof_book_session_not_saved(const QofBook *book)
qof_book_not_saved() returns the value of the session_dirty flag, set when changes to any object in t...
Definition: qofbook.cpp:459
All type declarations for the whole Gnucash engine.
void(* add_to_window)(GncPlugin *plugin, GncMainWindow *window, GQuark type)
A callback that will be invoked when this plugin is added to a window.
Definition: gnc-plugin.h:155
const gchar * actions_name
A name for the set of actions that will be added by this plugin.
Definition: gnc-plugin.h:119
The instance private data structure for an basic commands plugin.
GtkActionGroup * gnc_main_window_get_action_group(GncMainWindow *window, const gchar *group_name)
Retrieve a specific set of user interface actions from a window.
gboolean qof_book_is_readonly(const QofBook *book)
Return whether the book is read only.
Definition: qofbook.cpp:580
const gchar * plugin_name
The textual name of this plugin.
Definition: gnc-plugin.h:112
void gnc_plugin_update_actions(GtkActionGroup *action_group, const gchar **action_names, const gchar *property_name, gboolean value)
Update a property on a set of existing GtkActions.
Definition: gnc-plugin.c:280
The instance data structure for a menu-only plugin.
Definition: gnc-plugin.h:100
#define PLUGIN_ACTIONS_NAME
The label given to the main window for this plugin.
GncSxInstanceModel * gnc_sx_get_current_instances(void)
Shorthand for get_instances(now, FALSE);.
#define GNC_TYPE_PLUGIN_PAGE_SX_LIST
Functions providing a list of scheduled transactions as a plugin page.
GncPluginPage * gnc_plugin_page_sx_list_new(void)
This file contains the functions to present a GUI to select a file or a database connection.
The instance data structure for a main window object.
gboolean gnc_main_window_all_finish_pending(void)
Tell all pages in all windows to finish any outstanding activities.
gboolean need_dialog
If the dialog needs to be displayed.
Functions providing a basic set of menu items.
#define PLUGIN_UI_FILENAME
The name of the UI description file for this plugin.