GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Files | Data Structures | Macros | Typedefs | Enumerations | Functions
Common object and functions

Files

file  gnc-plugin-page.c
 Functions for adding plugins to a GnuCash window.
 
file  gnc-plugin-page.h
 Functions for adding plugins to a GnuCash window.
 

Data Structures

struct  _GncPluginPagePrivate
 
struct  GncPluginPage
 
struct  GncPluginPageClass
 

Macros

#define GNC_PLUGIN_PAGE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPagePrivate))
 
#define GNC_PREF_SUMMARYBAR_POSITION_TOP   "summarybar-position-top"
 
#define GNC_PREF_SUMMARYBAR_POSITION_BOTTOM   "summarybar-position-bottom"
 
#define GNC_TYPE_PLUGIN_PAGE   (gnc_plugin_page_get_type ())
 
#define GNC_PLUGIN_PAGE(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPage))
 
#define GNC_PLUGIN_PAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE, GncPluginPageClass))
 
#define GNC_IS_PLUGIN_PAGE(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN_PAGE))
 
#define GNC_IS_PLUGIN_PAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE))
 
#define GNC_PLUGIN_PAGE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN_PAGE, GncPluginPageClass))
 

Typedefs

typedef struct
_GncPluginPagePrivate 
GncPluginPagePrivate
 
typedef struct GncPluginPage GncPluginPage
 

Enumerations

enum  {
  INSERTED, REMOVED, SELECTED, UNSELECTED,
  LAST_SIGNAL
}
 
enum  {
  PROP_0, PROP_PAGE_NAME, PROP_PAGE_COLOR, PROP_PAGE_URI,
  PROP_BOOK, PROP_STATUSBAR_TEXT, PROP_USE_NEW_WINDOW, PROP_UI_DESCRIPTION,
  PROP_UI_MERGE, PROP_ACTION_GROUP
}
 

Functions

GType gnc_plugin_page_get_type (void)
 
GtkWidget * gnc_plugin_page_create_widget (GncPluginPage *plugin_page)
 
void gnc_plugin_page_destroy_widget (GncPluginPage *plugin_page)
 
void gnc_plugin_page_show_summarybar (GncPluginPage *page, gboolean visible)
 
void gnc_plugin_page_save_page (GncPluginPage *page, GKeyFile *key_file, const gchar *group_name)
 
GncPluginPagegnc_plugin_page_recreate_page (GtkWidget *window, const gchar *page_type, GKeyFile *key_file, const gchar *page_group)
 
void gnc_plugin_page_merge_actions (GncPluginPage *page, GtkUIManager *ui_merge)
 
void gnc_plugin_page_unmerge_actions (GncPluginPage *page, GtkUIManager *ui_merge)
 
GtkAction * gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name)
 
const gchar * gnc_plugin_page_get_plugin_name (GncPluginPage *plugin_page)
 
void gnc_plugin_page_inserted (GncPluginPage *plugin_page)
 
void gnc_plugin_page_removed (GncPluginPage *plugin_page)
 
void gnc_plugin_page_selected (GncPluginPage *plugin_page)
 
void gnc_plugin_page_unselected (GncPluginPage *plugin_page)
 
void gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book)
 
gboolean gnc_plugin_page_has_book (GncPluginPage *page, QofBook *book)
 
gboolean gnc_plugin_page_has_books (GncPluginPage *page)
 
GtkWidget * gnc_plugin_page_get_window (GncPluginPage *page)
 
const gchar * gnc_plugin_page_get_page_name (GncPluginPage *page)
 
void gnc_plugin_page_set_page_name (GncPluginPage *page, const gchar *name)
 
const gchar * gnc_plugin_page_get_page_long_name (GncPluginPage *page)
 
void gnc_plugin_page_set_page_long_name (GncPluginPage *page, const gchar *name)
 
const gchar * gnc_plugin_page_get_page_color (GncPluginPage *page)
 
void gnc_plugin_page_set_page_color (GncPluginPage *page, const gchar *color)
 
const gchar * gnc_plugin_page_get_uri (GncPluginPage *page)
 
void gnc_plugin_page_set_uri (GncPluginPage *page, const gchar *name)
 
const gchar * gnc_plugin_page_get_statusbar_text (GncPluginPage *page)
 
void gnc_plugin_page_set_statusbar_text (GncPluginPage *page, const gchar *message)
 
gboolean gnc_plugin_page_get_use_new_window (GncPluginPage *page)
 
void gnc_plugin_page_set_use_new_window (GncPluginPage *page, gboolean use_new)
 
const gchar * gnc_plugin_page_get_ui_description (GncPluginPage *page)
 
void gnc_plugin_page_set_ui_description (GncPluginPage *page, const char *ui_filename)
 
GtkUIManager * gnc_plugin_page_get_ui_merge (GncPluginPage *page)
 
GtkActionGroup * gnc_plugin_page_get_action_group (GncPluginPage *page)
 
GtkActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page, const gchar *group_name)
 
gboolean gnc_plugin_page_finish_pending (GncPluginPage *page)
 
void gnc_plugin_page_set_page_name (GncPluginPage *page, const char *name)
 
void gnc_plugin_page_set_page_long_name (GncPluginPage *page, const char *name)
 
void gnc_plugin_page_set_page_color (GncPluginPage *page, const char *color)
 
void gnc_plugin_page_set_uri (GncPluginPage *page, const char *name)
 
void gnc_plugin_page_set_statusbar_text (GncPluginPage *page, const char *name)
 

Detailed Description

Typedef Documentation

typedef struct GncPluginPage GncPluginPage

The instance data structure for a content plugin.

The instance private data for a content plugin.

Function Documentation

void gnc_plugin_page_add_book ( GncPluginPage page,
QofBook book 
)

Add a book reference to the specified page.

Parameters
pageThe page to be modified.
bookThe book referenced by this page.

Definition at line 720 of file gnc-plugin-page.c.

721 {
722  GncPluginPagePrivate *priv;
723 
724  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
725  g_return_if_fail (book != NULL);
726 
727  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
728  priv->books = g_list_append(priv->books, book);
729 }
GtkActionGroup * gnc_plugin_page_create_action_group ( GncPluginPage page,
const gchar *  group_name 
)

Create the GtkActionGroup object associated with this page.

Parameters
pageThe page whose menu/toolbar action group should be created.
group_nameThe name associate with this action group. The name is used to associate key bindings with actions, so it should be consistent across all pages of the same type.
Returns
A pointer to the newly created GtkActionGroup object for this page.

Definition at line 1018 of file gnc-plugin-page.c.

1019 {
1020  GncPluginPagePrivate *priv;
1021  GtkActionGroup *group;
1022 
1023  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
1024  group = gtk_action_group_new(group_name);
1025  gnc_gtk_action_group_set_translation_domain(group, GETTEXT_PACKAGE);
1026  priv->action_group = group;
1027  return group;
1028 }
GtkActionGroup * action_group
void gnc_gtk_action_group_set_translation_domain(GtkActionGroup *action_group, const gchar *domain)
GtkWidget * gnc_plugin_page_create_widget ( GncPluginPage plugin_page)

Create the display widget that corresponds to this plugin. This function will be called by the main/embedded window manipulation code to create a widget that they can display. The returned widget should encompass all information that goes with this page, including scroll bars, a summary bar, etc.

Parameters
plugin_pageA pointer to the plugin for which a display widget should be created.
Returns
A displayable gtk widget.

Definition at line 146 of file gnc-plugin-page.c.

147 {
148  GncPluginPageClass *klass;
149  GtkWidget *widget;
150 
151  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
152 
153  klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
154  g_return_val_if_fail (klass != NULL, NULL);
155  g_return_val_if_fail (klass->create_widget != NULL, NULL);
156 
157  widget = klass->create_widget (plugin_page);
158 
159  /*
160  * If there is a destroy function, add a ref so that the
161  * widgets will exists when the destroy function is called.
162  * Otherwise it will be destroyed when it is removed from the
163  * main notebook for the window.
164  */
165  if (klass->destroy_widget)
166  g_object_ref(widget);
167 
168  return widget;
169 }
void(* destroy_widget)(GncPluginPage *plugin_page)
GtkWidget *(* create_widget)(GncPluginPage *plugin_page)
void gnc_plugin_page_destroy_widget ( GncPluginPage plugin_page)

Destroy the display widget that corresponds to this plugin. This function will be called by the main/embedded window manipulation code when a page is closed.

Parameters
plugin_pageA pointer to the plugin whose display widget should be destroyed.

Definition at line 176 of file gnc-plugin-page.c.

177 {
178  GncPluginPageClass *klass;
179 
180  g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
181 
182  klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
183  g_return_if_fail (klass != NULL);
184  g_return_if_fail (klass->destroy_widget != NULL);
185 
186  klass->destroy_widget (plugin_page);
187 }
void(* destroy_widget)(GncPluginPage *plugin_page)
gboolean gnc_plugin_page_finish_pending ( GncPluginPage plugin_page)

Tell a page to finish any outstanding activities.

Parameters
plugin_pageA page.
Returns
FALSE if the page could not or would not comply, which should cancel the pending operation. TRUE otherwise

Definition at line 1031 of file gnc-plugin-page.c.

1032 {
1033  if (!page)
1034  return TRUE;
1035  if (!GNC_IS_PLUGIN_PAGE(page))
1036  return TRUE;
1037 
1038  if (!GNC_PLUGIN_PAGE_GET_CLASS(page)->finish_pending)
1039  return TRUE;
1040  return (GNC_PLUGIN_PAGE_GET_CLASS(page)->finish_pending)(page);
1041 }
GtkAction * gnc_plugin_page_get_action ( GncPluginPage page,
const gchar *  name 
)

Retrieve a GtkAction object associated with this page.

Parameters
pageThe page whose menu/toolbar action group should be retrieved.
nameThe name of the GtkAction to find.
Returns
A pointer to the retuested GtkAction object or NULL.

Definition at line 318 of file gnc-plugin-page.c.

319 {
320  GncPluginPagePrivate *priv;
321 
322  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), NULL);
323  g_return_val_if_fail(name != NULL, NULL);
324 
325  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
326  if (!priv->action_group)
327  return NULL;
328  return gtk_action_group_get_action (priv->action_group, name);
329 }
GtkActionGroup * action_group
GtkActionGroup * gnc_plugin_page_get_action_group ( GncPluginPage page)

Retrieve the GtkActionGroup object associated with this page.

Parameters
pageThe page whose menu/toolbar action group should be retrieved.
Returns
A pointer to the GtkActionGroup object for this page.

Definition at line 1006 of file gnc-plugin-page.c.

1007 {
1008  GncPluginPagePrivate *priv;
1009 
1010  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
1011  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
1012  return priv->action_group;
1013 }
GtkActionGroup * action_group
const gchar * gnc_plugin_page_get_page_color ( GncPluginPage page)

Retrieve the color of this page. This is the color string used in the notebook tab.

Parameters
pageThe page whose name should be retrieved.
Returns
The color for this page. This string is owned by the page and should not be freed by the caller.

Definition at line 849 of file gnc-plugin-page.c.

850 {
851  GncPluginPagePrivate *priv;
852 
853  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
854 
855  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
856  return priv->page_color;
857 }
const gchar * gnc_plugin_page_get_page_long_name ( GncPluginPage page)

Retrieve the long name of this page. This is the string used in the tooltip that is attached to the page name in the notebook tab.

Parameters
pageThe page whose name should be retrieved.
Returns
The page's name. This string is owned by the page and should not be freed by the caller.

Definition at line 820 of file gnc-plugin-page.c.

821 {
822  GncPluginPagePrivate *priv;
823 
824  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
825 
826  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
827  return priv->page_long_name;
828 }
const gchar * gnc_plugin_page_get_page_name ( GncPluginPage page)

Retrieve the name of this page. This is the string used in the window title, and in the notebook tab and page selection menus.

Parameters
pageThe page whose name should be retrieved.
Returns
The page's name. This string is owned by the page and should not be freed by the caller.

Definition at line 781 of file gnc-plugin-page.c.

782 {
783  GncPluginPagePrivate *priv;
784 
785  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
786 
787  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
788  return priv->page_name;
789 }
const gchar * gnc_plugin_page_get_plugin_name ( GncPluginPage plugin_page)

Retrieve the textual name of a plugin.

Parameters
plugin_pageA pointer to the page whose actions name should be retrieved.
Returns
The name of this plugin. This string is owned by the plugin.

Definition at line 334 of file gnc-plugin-page.c.

335 {
336  GncPluginPageClass *klass;
337 
338  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
339 
340  klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
341  g_return_val_if_fail (klass != NULL, NULL);
342 
343  return (klass->plugin_name);
344 }
const gchar * plugin_name
const gchar * gnc_plugin_page_get_statusbar_text ( GncPluginPage page)

Retrieve the statusbar text associated with this page.

Parameters
pageThe page whose statusbar should text be retrieved.
Returns
A pointer to the statusbar text for this page. This string is owned by the page and should not be freed by the caller.

Definition at line 906 of file gnc-plugin-page.c.

907 {
908  GncPluginPagePrivate *priv;
909 
910  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
911 
912  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
913  return priv->statusbar_text;
914 }
GType gnc_plugin_page_get_type ( void  )

Get the type of a content plugin.

Returns
A GType.

Definition at line 111 of file gnc-plugin-page.c.

112 {
113  static GType gnc_plugin_page_type = 0;
114 
115  if (gnc_plugin_page_type == 0)
116  {
117  static const GTypeInfo our_info =
118  {
119 
120  sizeof (GncPluginPageClass),
121  NULL, /* base_init */
122  NULL, /* base_finalize */
123  (GClassInitFunc) gnc_plugin_page_class_init,
124  NULL, /* class_finalize */
125  NULL, /* class_data */
126  sizeof (GncPluginPage),
127  0, /* n_preallocs */
128  (GInstanceInitFunc) gnc_plugin_page_init,
129  };
130 
131  gnc_plugin_page_type = g_type_register_static (G_TYPE_OBJECT,
132  "GncPluginPage",
133  &our_info, 0);
134  }
135 
136  return gnc_plugin_page_type;
137 }
struct GncPluginPage GncPluginPage
const char * gnc_plugin_page_get_ui_description ( GncPluginPage page)

Retrieve the name of the XML UI file associated with this page.

Parameters
pageThe page whose setting should be retrieved.
Returns
A pointer to the filename used for the UI. This string is owned by the page and should not be freed by the caller.

Definition at line 963 of file gnc-plugin-page.c.

964 {
965  GncPluginPagePrivate *priv;
966 
967  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
968 
969  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
970  return priv->ui_description;
971 }
GtkUIManager * gnc_plugin_page_get_ui_merge ( GncPluginPage page)

Retrieve the GtkUIManager object associated with this page.

Parameters
pageThe page whose UI information should be retrieved.
Returns
A pointer to the GtkUIManager object for this page.

Definition at line 993 of file gnc-plugin-page.c.

994 {
995  GncPluginPagePrivate *priv;
996 
997  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), NULL);
998 
999  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
1000  return priv->ui_merge;
1001 }
const gchar * gnc_plugin_page_get_uri ( GncPluginPage page)

Retrieve the Uniform Resource Identifier for this page.

Parameters
pageThe page whose URI should be retrieved.
Returns
The URI for this page. This string is owned by the page and should not be freed by the caller.

Definition at line 878 of file gnc-plugin-page.c.

879 {
880  GncPluginPagePrivate *priv;
881 
882  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
883 
884  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
885  return priv->uri;
886 }
gboolean gnc_plugin_page_get_use_new_window ( GncPluginPage page)

Retrieve the "use new window" setting associated with this page.

Parameters
pageThe page whose setting should be retrieved.
Returns
Whether this page should be created in a new window.

Definition at line 934 of file gnc-plugin-page.c.

935 {
936  GncPluginPagePrivate *priv;
937 
938  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
939 
940  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
941  return priv->use_new_window;
942 }
GtkWidget * gnc_plugin_page_get_window ( GncPluginPage page)

Retrieve a pointer to the GncMainWindow (GtkWindow) containing this page.

Parameters
pageThe page whose window should be retrieved.
Returns
A pointer to the window.

Definition at line 770 of file gnc-plugin-page.c.

771 {
772  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), NULL);
773 
774  return page->window;
775 }
GtkWidget * window
gboolean gnc_plugin_page_has_book ( GncPluginPage page,
QofBook book 
)

Query a page to see if it has a reference to a given book. This function takes a guid instead of a QofBook because that's what the engine event mechanism provides.

Parameters
pageThe page to query.
bookThe guid of the book in question.
Returns
TRUE if the page refers to the specified book. FALSE otherwise.

Definition at line 734 of file gnc-plugin-page.c.

735 {
736  GncPluginPagePrivate *priv;
737  GList *item;
738 
739  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
740  g_return_val_if_fail (book != NULL, FALSE);
741 
742  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
743  for (item = priv->books; item; item = g_list_next(item))
744  {
745  if (item->data == book)
746  {
747  return TRUE;
748  }
749  }
750  return FALSE;
751 }
gboolean gnc_plugin_page_has_books ( GncPluginPage page)

Query a page to see if it has a reference to any book.

Parameters
pageThe page to query.
Returns
TRUE if the page references any books. FALSE otherwise.

Definition at line 756 of file gnc-plugin-page.c.

757 {
758  GncPluginPagePrivate *priv;
759 
760  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
761 
762  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
763  return (priv->books != NULL);
764 }
void gnc_plugin_page_merge_actions ( GncPluginPage plugin_page,
GtkUIManager *  merge 
)

Add the actions for a content page to the specified window.

Parameters
plugin_pageA pointer to the page whose actions should be added to the user interface.
mergeA pointer to the UI manager data structure for a window.

Definition at line 281 of file gnc-plugin-page.c.

283 {
284  GncPluginPagePrivate *priv;
285 
286  g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
287 
288  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
289  priv->ui_merge = ui_merge;
290  priv->merge_id = gnc_plugin_add_actions(priv->ui_merge,
291  priv->action_group,
292  priv->ui_description);
293 }
GtkActionGroup * action_group
gint gnc_plugin_add_actions(GtkUIManager *ui_merge, GtkActionGroup *action_group, const gchar *filename)
Definition: gnc-plugin.c:346
GncPluginPage * gnc_plugin_page_recreate_page ( GtkWidget *  window,
const gchar *  page_type,
GKeyFile *  key_file,
const gchar *  group_name 
)

This function looks up a specific plugin type by name, and then calls a plugin specific function to create a new page and restore its content to a previous state.

Parameters
windowThe window where this page should be installed.
page_typeThe name of the page type to create.
key_fileA pointer to the GKeyFile data structure where the page information should be read.
group_nameThe group name to use when restoring data.

Definition at line 240 of file gnc-plugin-page.c.

244 {
245  GncPluginPageClass *klass;
246  GncPluginPage *page = NULL;
247  GType type;
248 
249  ENTER("type %s, keyfile %p, group %s", page_type, key_file, page_group);
250  type = g_type_from_name(page_type);
251  if (type == 0)
252  {
253  LEAVE("Cannot find type named %s", page_type);
254  return NULL;
255  }
256 
257  klass = g_type_class_ref(type);
258  if (klass == NULL)
259  {
260  const gchar *type_name = g_type_name(type);
261  LEAVE("Cannot create class %s(%s)", page_type, type_name ? type_name : "invalid type");
262  return NULL;
263  }
264 
265  if (!klass->recreate_page)
266  {
267  LEAVE("Class %shas no recreate function.", page_type);
268  g_type_class_unref(klass);
269  return NULL;
270  }
271 
272  page = (klass->recreate_page)(window, key_file, page_group);
273  g_type_class_unref(klass);
274  LEAVE(" ");
275  return page;
276 }
GncPluginPage *(* recreate_page)(GtkWidget *window, GKeyFile *file, const gchar *group)
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_plugin_page_save_page ( GncPluginPage page,
GKeyFile *  key_file,
const gchar *  group_name 
)

Call the plugin specific function that will save the state of a content page to a disk. That function must save enough information about the page that it can be recreated next time the user starts gnucash.

Parameters
pageThe page to save.
key_fileA pointer to the GKeyFile data structure where the page information should be written.
group_nameThe group name to use when saving data.

Definition at line 216 of file gnc-plugin-page.c.

219 {
220  GncPluginPageClass *klass;
221 
222  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
223  g_return_if_fail (key_file != NULL);
224  g_return_if_fail (group_name != NULL);
225 
226  ENTER(" ");
227  klass = GNC_PLUGIN_PAGE_GET_CLASS (page);
228  g_return_if_fail (klass != NULL);
229  g_return_if_fail (klass->save_page != NULL);
230 
231  klass->save_page(page, key_file, group_name);
232  LEAVE(" ");
233 }
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void(* save_page)(GncPluginPage *page, GKeyFile *file, const gchar *group)
void gnc_plugin_page_set_page_color ( GncPluginPage page,
const char *  color 
)

Set the color of this page. This is the color string used in the notebook tab.

Parameters
pageThe page whose name should be retrieved.
Returns
The color for this page. This string is owned by the page and should not be freed by the caller.
void gnc_plugin_page_set_page_long_name ( GncPluginPage page,
const char *  name 
)

Set the long name of this page. This is the string used in the tooltip that is attached to the page name in the notebook tab.

Parameters
pageThe page whose name should be set.
nameThe new string for the name.
void gnc_plugin_page_set_page_name ( GncPluginPage page,
const char *  name 
)

Set the name of this page. This is the string used in the window title, and in the notebook tab and page selection menus.

Parameters
pageThe page whose name should be set.
nameThe new string for the name.
void gnc_plugin_page_set_statusbar_text ( GncPluginPage page,
const char *  name 
)

Set the statusbar text associated with this page.

Parameters
pageThe page whose statusbar text should be set.
nameThe new statusbar text for the page.
void gnc_plugin_page_set_ui_description ( GncPluginPage page,
const char *  ui_filename 
)

Set an alternate UI for the specified page. This alternate ui may only use actions specified in the source for the page.

Note
This function must be called before the page is installed into a window.
Parameters
pageThe page to modify.
ui_filenameThe filename (no path) of the alternate UI.

Definition at line 977 of file gnc-plugin-page.c.

979 {
980  GncPluginPagePrivate *priv;
981 
982  g_return_if_fail(GNC_IS_PLUGIN_PAGE(page));
983 
984  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
985  if (priv->ui_description)
986  g_free(priv->ui_description);
987  priv->ui_description = g_strdup(ui_filename);
988 }
void gnc_plugin_page_set_uri ( GncPluginPage page,
const char *  name 
)

Set the Uniform Resource Identifier for this page.

Parameters
pageThe page whose URI should be set.
nameThe new URI for the page.
void gnc_plugin_page_set_use_new_window ( GncPluginPage page,
gboolean  use_new 
)

Set the "use new window" setting associated with this page. If this setting is TRUE, the page will be installed into a new window. Otherwise the page will be installed into an existing window.

Parameters
pageThe page whose setting should be updated.
use_newThe new value for this setting.

Definition at line 950 of file gnc-plugin-page.c.

951 {
952  GncPluginPagePrivate *priv;
953 
954  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
955 
956  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
957  priv->use_new_window = use_new;
958 }
void gnc_plugin_page_show_summarybar ( GncPluginPage page,
gboolean  visible 
)

Show/hide the summarybar associated with this page.

Parameters
pageThe page whose summarybar visibility should be changed.
visibleWhether or not the summarybar should be shown..

Definition at line 192 of file gnc-plugin-page.c.

194 {
195  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
196 
197  if (!page->summarybar)
198  return;
199 
200  if (visible)
201  {
202  gtk_widget_show(page->summarybar);
203  }
204  else
205  {
206  gtk_widget_hide(page->summarybar);
207  }
208 }
GtkWidget * summarybar
void gnc_plugin_page_unmerge_actions ( GncPluginPage plugin_page,
GtkUIManager *  merge 
)

Remove the actions for a content page from the specified window.

Parameters
plugin_pageA pointer to the page whose actions should be removed from the user interface.
mergeA pointer to the UI manager data structure for a window.

Definition at line 298 of file gnc-plugin-page.c.

300 {
301  GncPluginPagePrivate *priv;
302 
303  priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
304 
305  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
306  g_return_if_fail (priv->merge_id != 0);
307  g_return_if_fail (priv->action_group != NULL);
308 
309  gtk_ui_manager_remove_ui(ui_merge, priv->merge_id);
310  gtk_ui_manager_remove_action_group(ui_merge, priv->action_group);
311 
312  priv->ui_merge = NULL;
313  priv->merge_id = 0;
314 }
GtkActionGroup * action_group