GnuCash  4.12-68-g5dc52459a1+
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 #include "gnc-component-manager.h"
42 
43 #include "dialog-doclink.h"
44 #include "dialog-book-close.h"
45 #include "dialog-file-access.h"
46 #include "dialog-fincalc.h"
47 #include "dialog-find-transactions.h"
48 #include "dialog-find-transactions2.h"
49 #include "dialog-imap-editor.h"
50 #include "dialog-sx-since-last-run.h"
51 #include "dialog-totd.h"
52 #include "assistant-acct-period.h"
53 #include "assistant-loan.h"
54 #include "gnc-engine.h"
55 #include "gnc-file.h"
56 #include "gnc-gui-query.h"
57 #include "gnc-main-window.h"
58 #include "gnc-ui.h"
59 #include "gnc-window.h"
60 #include "gnc-session.h"
61 #include "gnc-plugin-page-sx-list.h"
63 
64 /* This static indicates the debugging module that this .o belongs to. */
65 G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI;
66 
67 static void gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass);
68 static void gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin);
69 static void gnc_plugin_basic_commands_finalize (GObject *object);
70 
71 static void gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
72 static void gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window, GncPluginPage *page, gpointer user_data);
73 
74 /* Command callbacks */
75 static void gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data);
76 static void gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data);
77 static void gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data);
78 static void gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data);
79 static void gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data);
80 static void gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data);
81 static void gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data);
82 static void gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data);
83 static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data);
84 static void gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data);
85 
86 #if CLOSE_BOOKS_ACTUALLY_WORKS
87 static void gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data);
88 #endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
89 
90 static void gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data);
91 static void gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data);
92 static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data);
93 static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data);
94 static void gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data);
95 static void gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data);
96 static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data);
97 static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data);
98 
99 
100 
101 #define PLUGIN_ACTIONS_NAME "gnc-plugin-basic-commands-actions"
102 #define PLUGIN_UI_FILENAME "gnc-plugin-basic-commands-ui.xml"
103 
106 static GtkActionEntry gnc_plugin_actions [] =
107 {
108 
109  /* File menu */
110 
111  {
112  "FileNewAction", "document-new", N_("New _File"), "<primary>n",
113  N_("Create a new file"),
114  G_CALLBACK (gnc_main_window_cmd_file_new)
115  },
116  {
117  "FileOpenAction", "document-open", N_("_Open..."), "<primary>o",
118  N_("Open an existing GnuCash file"),
119  G_CALLBACK (gnc_main_window_cmd_file_open)
120  },
121  {
122  "FileSaveAction", "document-save", N_("_Save"), "<primary>s",
123  N_("Save the current file"),
124  G_CALLBACK (gnc_main_window_cmd_file_save)
125  },
126  {
127  "FileSaveAsAction", "document-save-as", N_("Save _As..."), "<shift><primary>s",
128  N_("Save this file with a different name"),
129  G_CALLBACK (gnc_main_window_cmd_file_save_as)
130  },
131  {
132  "FileRevertAction", "document-revert", N_("Re_vert"), NULL,
133  N_("Reload the current database, reverting all unsaved changes"),
134  G_CALLBACK (gnc_main_window_cmd_file_revert)
135  },
136  {
137  "FileExportAccountsAction", "go-next",
138  N_("Export _Accounts"), NULL,
139  N_("Export the account hierarchy to a new GnuCash datafile"),
140  G_CALLBACK (gnc_main_window_cmd_file_export_accounts)
141  },
142 
143  /* Edit menu */
144 
145  {
146  "EditFindTransactionsAction", "edit-find", N_("_Find..."), "<primary>f",
147  N_("Find transactions with a search"),
148  G_CALLBACK (gnc_main_window_cmd_tools_find_transactions)
149  },
150  {
151  "EditTaxOptionsAction", NULL,
152  /* Translators: remember to reuse this
153  translation in dialog-account.glade */
154  N_("Ta_x Report Options"), NULL,
155  /* Translators: currently implemented are
156  US: income tax and
157  DE: VAT
158  So adjust this string */
159  N_("Setup relevant accounts for tax reports, e.g. US income tax"),
160  G_CALLBACK (gnc_main_window_cmd_edit_tax_options)
161  },
162 
163  /* Actions menu */
164 
165  { "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
166  {
167  "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
168  N_("The list of Scheduled Transactions"),
169  G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor)
170  },
171  {
172  "ActionsSinceLastRunAction", NULL, N_("Since _Last Run..."), NULL,
173  N_("Create Scheduled Transactions since the last time run"),
174  G_CALLBACK (gnc_main_window_cmd_actions_since_last_run)
175  },
176  {
177  "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
178  N_("Setup scheduled transactions for repayment of a loan"),
179  G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan)
180  },
181  { "ActionsBudgetAction", NULL, N_("B_udget"), NULL, NULL, NULL },
182 #ifdef CLOSE_BOOKS_ACTUALLY_WORKS
183  {
184  "ActionsCloseBooksAction", NULL, N_("Close _Books"), NULL,
185  N_("Archive old data using accounting periods"),
186  G_CALLBACK (gnc_main_window_cmd_actions_close_books)
187  },
188 #endif // CLOSE_BOOKS_ACTUALLY_WORKS
189 
190  /* Tools menu */
191  {
192  "ToolsPriceEditorAction", NULL, N_("_Price Database"), NULL,
193  N_("View and edit the prices for stocks and mutual funds"),
194  G_CALLBACK (gnc_main_window_cmd_tools_price_editor)
195  },
196  {
197  "ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL,
198  N_("View and edit the commodities for stocks and mutual funds"),
199  G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor)
200  },
201  {
202  "ToolsFinancialCalculatorAction", NULL, N_("_Loan Repayment Calculator"), NULL,
203  N_("Use the loan/mortgage repayment calculator"),
204  G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator)
205  },
206  {
207  "ToolsBookCloseAction", NULL, N_("_Close Book"), NULL,
208  N_("Close the Book at the end of the Period"),
209  G_CALLBACK (gnc_main_window_cmd_tools_close_book)
210  },
211  {
212  "ToolsImapEditorAction", NULL, N_("_Import Map Editor"), NULL,
213  N_("View and Delete Bayesian and non-Bayesian information"),
214  G_CALLBACK (gnc_main_window_cmd_tools_imap_editor)
215  },
216  {
217  "ToolsTransLinkedDocsAction", NULL, N_("_Transaction Linked Documents"), NULL,
218  N_("View all Transaction Linked Documents"),
219  G_CALLBACK (gnc_main_window_cmd_tools_trans_doclink)
220  },
221 
222  /* Help menu */
223 
224  {
225  "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
226  N_("View the Tips of the Day"),
227  G_CALLBACK (gnc_main_window_cmd_help_totd)
228  },
229 };
231 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
232 
233 
237 static const gchar *gnc_plugin_important_actions[] =
238 {
239  "FileSaveAction",
240  NULL,
241 };
242 
245 static const gchar *gnc_plugin_initially_insensitive_actions[] =
246 {
247  "FileSaveAction",
248  NULL,
249 };
250 
255 static const gchar *readwrite_only_active_actions[] =
256 {
257  "ToolsBookCloseAction",
258  NULL
259 };
260 
267 static const gchar *dirty_only_active_actions[] =
268 {
269  "FileSaveAction",
270  "FileRevertAction",
271  NULL
272 };
273 
277 {
278  gpointer dummy;
280 
281 #define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
282  ((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private((GncPluginBasicCommands*)o))
283 
285 static GObjectClass *parent_class = NULL;
286 
288 GncPlugin *
290 {
291  GncPluginBasicCommands *plugin;
292 
293  /* We just need to mention it, so the GType is registered and will be
294  * reflected during plugin-page restore. */
296 
297  plugin = g_object_new (GNC_TYPE_PLUGIN_BASIC_COMMANDS, NULL);
298 
299  return GNC_PLUGIN (plugin);
300 }
301 
316 static void
317 gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
318  GncMainWindow *window,
319  GQuark type)
320 {
321  GtkActionGroup *action_group =
323  gnc_plugin_update_actions(action_group,
324  gnc_plugin_initially_insensitive_actions,
325  "sensitive", FALSE);
326  g_signal_connect(window, "page_changed",
327  G_CALLBACK(gnc_plugin_basic_commands_main_window_page_changed),
328  plugin);
329 }
330 
333 static void update_inactive_actions(GncPluginPage *plugin_page)
334 {
335  GncMainWindow *window;
336  GtkActionGroup *action_group;
337 
338  // We are readonly - so we have to switch particular actions to inactive.
339  gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
340  gboolean is_dirty = qof_book_session_not_saved (gnc_get_current_book ());
341 
342  // We continue only if the current page is a plugin page
343  if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page))
344  return;
345 
346  window = GNC_MAIN_WINDOW(plugin_page->window);
347  g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
349  g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
350 
351  /* Set the action's sensitivity */
352  gnc_plugin_update_actions (action_group, readwrite_only_active_actions,
353  "sensitive", is_readwrite);
354  gnc_plugin_update_actions (action_group, dirty_only_active_actions,
355  "sensitive", is_dirty);
356 }
357 
358 static void
359 gnc_plugin_basic_commands_main_window_page_changed(GncMainWindow *window,
360  GncPluginPage *page,
361  gpointer user_data)
362 {
363  /* Make sure not to call this with a NULL GncPluginPage */
364  if (page)
365  {
366  // Update the action sensitivity due to read-only
367  update_inactive_actions(page);
368  }
369 }
370 
371 G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN)
372 
373 
380 static void
381 gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass)
382 {
383  GObjectClass *object_class = G_OBJECT_CLASS (klass);
384  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
385 
386  parent_class = g_type_class_peek_parent (klass);
387 
388  object_class->finalize = gnc_plugin_basic_commands_finalize;
389 
390  /* plugin info */
391  plugin_class->plugin_name = GNC_PLUGIN_BASIC_COMMANDS_NAME;
392 
393  /* function overrides */
394  plugin_class->add_to_window = gnc_plugin_basic_commands_add_to_window;
395 
396  /* widget addition/removal */
397  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
398  plugin_class->actions = gnc_plugin_actions;
399  plugin_class->n_actions = gnc_plugin_n_actions;
400  plugin_class->important_actions = gnc_plugin_important_actions;
401  plugin_class->ui_filename = PLUGIN_UI_FILENAME;
402 }
403 
404 
410 static void
411 gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin)
412 {
413 }
414 
415 
424 static void
425 gnc_plugin_basic_commands_finalize (GObject *object)
426 {
427  g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
428 
429  G_OBJECT_CLASS (parent_class)->finalize (object);
430 }
431 
432 /************************************************************
433  * Command Callbacks *
434  ************************************************************/
435 
436 static void
437 gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data)
438 {
440  return;
441 
442  gnc_file_new (GTK_WINDOW (data->window));
443 }
444 
445 static void
446 gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data)
447 {
448  g_return_if_fail (data != NULL);
449 
451  return;
452 
453  /* Reset the flag that indicates the conversion of the bayes KVP
454  * entries has been run */
456 
457  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
458 #ifdef HAVE_DBI_DBI_H
459  gnc_ui_file_access_for_open (GTK_WINDOW (data->window));
460 #else
461  gnc_file_open (GTK_WINDOW (data->window));
462 #endif
463  gnc_window_set_progressbar_window (NULL);
464 }
465 
466 static void
467 gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data)
468 {
469  g_return_if_fail (data != NULL);
470 
472  return;
473 
474  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
475  gnc_file_save (GTK_WINDOW (data->window));
476  gnc_window_set_progressbar_window (NULL);
477 }
478 
479 static void
480 gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data)
481 {
482  g_return_if_fail (data != NULL);
483 
485  return;
486 
487  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
488 #ifdef HAVE_DBI_DBI_H
489  gnc_ui_file_access_for_save_as (GTK_WINDOW (data->window));
490 #else
491  gnc_file_save_as (GTK_WINDOW (data->window));
492 #endif
493  gnc_window_set_progressbar_window (NULL);
494 }
495 
496 static void
497 gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data)
498 {
499  g_return_if_fail (data != NULL);
500 
502  return;
503 
504  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
505  gnc_file_revert(GTK_WINDOW (data->window));
506  gnc_window_set_progressbar_window (NULL);
507 }
508 
509 static void
510 gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data)
511 {
512  g_return_if_fail (data != NULL);
513 
514  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
515 #ifdef HAVE_DBI_DBI_H
516  gnc_ui_file_access_for_export (GTK_WINDOW (data->window));
517 #else
518  gnc_file_export (GTK_WINDOW (data->window));
519 #endif
520  gnc_window_set_progressbar_window (NULL);
521 }
522 
523 static void
524 gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data)
525 {
526  g_return_if_fail (data != NULL);
527 
528  gnc_tax_info_dialog (GTK_WIDGET (data->window), NULL);
529 }
530 
531 static void
532 gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data)
533 {
535  gnc_main_window_open_page(NULL, page);
536 }
537 
538 static void
539 gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data)
540 {
541  GtkWindow *window;
542  GncSxInstanceModel *sx_instances;
543  GncSxSummary summary;
544  GList *auto_created_txns = NULL;
545  const char *nothing_to_do_msg =
546  _( "There are no Scheduled Transactions to be entered at this time." );
547 
548  g_return_if_fail (data != NULL);
549 
550  window = GTK_WINDOW (data->window);
551 
552  if (qof_book_is_readonly(gnc_get_current_book()))
553  {
554  /* Is the book read-only? Then don't change anything here. */
555  return;
556  }
557 
558  sx_instances = gnc_sx_get_current_instances();
559  gnc_sx_instance_model_summarize(sx_instances, &summary);
560  gnc_sx_instance_model_effect_change(sx_instances, TRUE, &auto_created_txns, NULL);
561 
562  if (auto_created_txns)
563  gnc_gui_refresh_all();
564 
565  if (summary.need_dialog)
566  {
567  gnc_ui_sx_since_last_run_dialog (window, sx_instances, auto_created_txns);
568  auto_created_txns = NULL;
569  }
570  else
571  {
572  if (summary.num_auto_create_no_notify_instances == 0)
573  {
574  gnc_info_dialog (window, "%s", nothing_to_do_msg);
575  }
576  else
577  {
578  gnc_info_dialog(window, ngettext
579  /* Translators: %d is the number of transactions. This is a
580  ngettext(3) message. */
581  ("There are no Scheduled Transactions to be entered at this time. "
582  "(%d transaction automatically created)",
583  "There are no Scheduled Transactions to be entered at this time. "
584  "(%d transactions automatically created)",
587  }
588  }
589  g_list_free(auto_created_txns);
590  g_object_unref(G_OBJECT(sx_instances));
591 }
592 
593 static void
594 gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data)
595 {
596  gnc_ui_sx_loan_assistant_create ();
597 }
598 #ifdef CLOSE_BOOKS_ACTUALLY_WORKS
599 static void
600 gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data)
601 {
602  gnc_acct_period_dialog();
603 }
604 #endif /* CLOSE_BOOKS_ACTUALLY_WORKS */
605 
606 static void
607 gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data)
608 {
609  gnc_set_busy_cursor(NULL, TRUE);
610  gnc_imap_dialog (GTK_WIDGET (data->window));
611  gnc_unset_busy_cursor(NULL);
612 }
613 
614 static void
615 gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data)
616 {
617  gnc_set_busy_cursor (NULL, TRUE);
618  gnc_doclink_trans_dialog (GTK_WINDOW (data->window));
619  gnc_unset_busy_cursor (NULL);
620 }
621 
622 static void
623 gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data)
624 {
625  gnc_set_busy_cursor(NULL, TRUE);
626  gnc_prices_dialog (GTK_WIDGET (data->window));
627  gnc_unset_busy_cursor(NULL);
628 }
629 
630 static void
631 gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data)
632 {
633  gnc_set_busy_cursor(NULL, TRUE);
634  gnc_commodities_dialog (GTK_WIDGET (data->window));
635  gnc_unset_busy_cursor(NULL);
636 }
637 
638 static void
639 gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data)
640 {
641  gnc_ui_fincalc_dialog_create(GTK_WINDOW (data->window));
642 }
643 
644 static void
645 gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data)
646 {
647  gnc_ui_close_book(gnc_get_current_book(), GTK_WINDOW (data->window));
648 }
649 
650 static void
651 gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data)
652 {
653 
654 #ifdef REGISTER2_ENABLED
655  /*################## Added for Reg2 #################*/
656  gnc_ui_find_transactions_dialog_create2 (NULL);
657  /*################## Added for Reg2 #################*/
658 #else
659  gnc_ui_find_transactions_dialog_create (GTK_WINDOW(data->window), NULL);
660 #endif
661 }
662 
663 static void
664 gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data)
665 {
666  g_return_if_fail (data != NULL);
667 
668  gnc_totd_dialog(GTK_WINDOW(data->window), FALSE);
669 }
670 
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:461
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:582
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.