GnuCash
2.6.99
|
Files | |
file | gnc-main-window.c |
Functions for adding content to a window. | |
file | gnc-main-window.h |
Functions for adding content to a window. | |
Data Structures | |
struct | GncMainWindowPrivate |
struct | MergedActionEntry |
struct | GncMainWindowSaveData |
struct | menu_update |
struct | _ActionStatus |
struct | GncMainWindow |
struct | GncMainWindowClass |
struct | GncMainWindowActionData |
Macros | |
#define | PLUGIN_PAGE_LABEL "plugin-page" |
#define | PLUGIN_PAGE_CLOSE_BUTTON "close-button" |
#define | PLUGIN_PAGE_TAB_LABEL "label" |
#define | GNC_PREF_SHOW_CLOSE_BUTTON "tab-close-buttons" |
#define | GNC_PREF_TAB_NEXT_RECENT "tab-next-recent" |
#define | GNC_PREF_TAB_POSITION_TOP "tab-position-top" |
#define | GNC_PREF_TAB_POSITION_BOTTOM "tab-position-bottom" |
#define | GNC_PREF_TAB_POSITION_LEFT "tab-position-left" |
#define | GNC_PREF_TAB_POSITION_RIGHT "tab-position-right" |
#define | GNC_PREF_TAB_WIDTH "tab-width" |
#define | GNC_PREF_TAB_COLOR "show-account-color-tabs" |
#define | GNC_PREF_SAVE_CLOSE_EXPIRES "save-on-close-expires" |
#define | GNC_PREF_SAVE_CLOSE_WAIT_TIME "save-on-close-wait-time" |
#define | GNC_MAIN_WINDOW_NAME "GncMainWindow" |
#define | MSG_AUTO_SAVE _("Changes will be saved automatically in %u seconds") |
#define | GNC_MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_MAIN_WINDOW, GncMainWindowPrivate)) |
#define | WINDOW_COUNT "WindowCount" |
#define | WINDOW_STRING "Window %d" |
#define | WINDOW_GEOMETRY "WindowGeometry" |
#define | WINDOW_POSITION "WindowPosition" |
#define | WINDOW_MAXIMIZED "WindowMaximized" |
#define | TOOLBAR_VISIBLE "ToolbarVisible" |
#define | STATUSBAR_VISIBLE "StatusbarVisible" |
#define | SUMMARYBAR_VISIBLE "SummarybarVisible" |
#define | WINDOW_FIRSTPAGE "FirstPage" |
#define | WINDOW_PAGECOUNT "PageCount" |
#define | WINDOW_PAGEORDER "PageOrder" |
#define | PAGE_TYPE "PageType" |
#define | PAGE_NAME "PageName" |
#define | PAGE_STRING "Page %d" |
#define | GNC_TYPE_MAIN_WINDOW (gnc_main_window_get_type ()) |
#define | GNC_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow)) |
#define | GNC_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass)) |
#define | GNC_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_MAIN_WINDOW)) |
#define | GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW)) |
#define | GNC_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass)) |
#define | PLUGIN_PAGE_IMMUTABLE "page-immutable" |
Typedefs | |
typedef struct GncMainWindowPrivate | GncMainWindowPrivate |
typedef struct _ActionStatus | ActionStatus |
typedef struct GncMainWindow | GncMainWindow |
typedef void(* | GncMainWindowFunc )(GncMainWindow *window, GncPluginPage *page) |
typedef void(* | GncMainWindowPageFunc )(GncPluginPage *page, gpointer user_data) |
Enumerations | |
enum | { PAGE_ADDED, PAGE_CHANGED, LAST_SIGNAL } |
Functions | |
void | gnc_main_window_foreach_page (GncMainWindowPageFunc fn, gpointer user_data) |
void | gnc_main_window_restore_all_windows (const GKeyFile *keyfile) |
void | gnc_main_window_restore_default_state (GncMainWindow *window) |
void | gnc_main_window_save_all_windows (GKeyFile *keyfile) |
gboolean | gnc_main_window_finish_pending (GncMainWindow *window) |
gboolean | gnc_main_window_all_finish_pending (void) |
void | main_window_update_page_name (GncPluginPage *page, const gchar *name_in) |
void | main_window_update_page_color (GncPluginPage *page, const gchar *color_in) |
GType | gnc_main_window_get_type (void) |
GncMainWindow * | gnc_main_window_new (void) |
void | gnc_main_window_display_page (GncPluginPage *page) |
void | gnc_main_window_open_page (GncMainWindow *window, GncPluginPage *page) |
void | gnc_main_window_close_page (GncPluginPage *page) |
GncPluginPage * | gnc_main_window_get_current_page (GncMainWindow *window) |
void | gnc_main_window_manual_merge_actions (GncMainWindow *window, const gchar *group_name, GtkActionGroup *group, guint merge_id) |
void | gnc_main_window_merge_actions (GncMainWindow *window, const gchar *group_name, GtkActionEntry *actions, guint n_actions, GtkToggleActionEntry *toggle_actions, guint n_toggle_actions, const gchar *filename, gpointer user_data) |
void | gnc_main_window_unmerge_actions (GncMainWindow *window, const gchar *group_name) |
void | gnc_main_window_actions_updated (GncMainWindow *window) |
GtkAction * | gnc_main_window_find_action (GncMainWindow *window, const gchar *name) |
GtkActionGroup * | gnc_main_window_get_action_group (GncMainWindow *window, const gchar *group_name) |
GtkWidget * | gnc_book_options_dialog_cb (gboolean modal, gchar *title) |
void | gnc_main_window_show_all_windows (void) |
GtkWidget * | gnc_ui_get_toplevel (void) |
void | gnc_main_window_set_progressbar_window (GncMainWindow *window) |
gboolean | gnc_main_window_button_press_cb (GtkWidget *whatever, GdkEventButton *event, GncPluginPage *page) |
void | gnc_gtk_action_group_set_translation_domain (GtkActionGroup *action_group, const gchar *domain) |
void | gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive) |
GtkUIManager * | gnc_main_window_get_uimanager (GncMainWindow *window) |
#define PLUGIN_PAGE_LABEL "plugin-page" |
This label is used to provide a mapping from a visible page widget back to the corresponding GncPluginPage object.
Definition at line 90 of file gnc-main-window.c.
typedef struct GncMainWindow GncMainWindow |
The instance data structure for a main window object.
typedef struct GncMainWindowPrivate GncMainWindowPrivate |
The instance private data structure for an embedded window object.
anonymous enum |
Names of signals generated by the main window.
Definition at line 81 of file gnc-main-window.c.
GtkWidget * gnc_book_options_dialog_cb | ( | gboolean | modal, |
gchar * | title | ||
) |
Opens the Book Options dialog.
modal | True to open in modal mode, false otherwise. |
title | Title of the dialog; "Book Options" if NULL. |
Definition at line 3981 of file gnc-main-window.c.
void gnc_gtk_action_group_set_translation_domain | ( | GtkActionGroup * | action_group, |
const gchar * | domain | ||
) |
gnc_gtk_action_group_set_translation_domain:
action_group | a #GtkActionGroup |
domain | the translation domain to use for dgettext() calls |
Sets the translation domain and uses dgettext() for translating the label and tooltip of #GtkActionEntrys added by gtk_action_group_add_actions().
This is copied from gtk's gtk_action_group_set_translation_domain() into GnuCash in order to fix problems when empty msgids were passed through gettext().
See http://bugzilla.gnome.org/show_bug.cgi?id=326200 . If that bug is fixed in the gtk that we can rely open, then gnc_gtk_action_group_set_translation_domain can be replaced by gtk_action_group_set_translation_domain again.
Definition at line 4707 of file gnc-main-window.c.
void gnc_main_window_actions_updated | ( | GncMainWindow * | window | ) |
Force a full update of the user interface for the specified window. This can be an expensive function, but is needed because the gtk ui manager doesn't always seem to update properly when actions are changed.
window | A pointer to the window whose user interface should be updated. |
Definition at line 3205 of file gnc-main-window.c.
void gnc_main_window_all_action_set_sensitive | ( | const gchar * | action_name, |
gboolean | sensitive | ||
) |
Change the sensitivity of a command in all windows. This can be used to serialize access to a command so that in cannot be reinvoked until the current invocation is finished.
action_name | The name of the command to modity. |
sensitive | Whether or not the user should be able to invoke this action. |
Definition at line 4720 of file gnc-main-window.c.
gboolean gnc_main_window_all_finish_pending | ( | void | ) |
Tell all pages in all windows to finish any outstanding activities. This function will call gnc_plugin_page_finish_pending for each installed page. If any page returns a failure indication, then the function stops walking pages and immediately returns a failure.
Definition at line 1112 of file gnc-main-window.c.
gboolean gnc_main_window_button_press_cb | ( | GtkWidget * | whatever, |
GdkEventButton * | event, | ||
GncPluginPage * | page | ||
) |
Callback function invoked when the user clicks in the content of any Gnucash window. If this was a "right-click" then Gnucash will popup the contextual menu.
whatever | Whatever widget had focus when the user issued the keyboard context-menu request. |
event | The event parameter describing where on the screen the mouse was pointing when clicked, type of click, modifiers, etc. |
page | This is the GncPluginPage corresponding to the visible page. |
Definition at line 4667 of file gnc-main-window.c.
void gnc_main_window_close_page | ( | GncPluginPage * | page | ) |
Remove a data plugin page from a window and display the previous page. If the page removed was the last page in the window, and there is more than one window open, then the entire window will be destroyed.
page | The page of data to be removed. |
Definition at line 3020 of file gnc-main-window.c.
void gnc_main_window_display_page | ( | GncPluginPage * | page | ) |
Bring the window containing the specified page to the top of the window stack, then switch the notebook to show the specified page.
page | The existing page to be displayed. |
Definition at line 2847 of file gnc-main-window.c.
GtkAction * gnc_main_window_find_action | ( | GncMainWindow * | window, |
const gchar * | name | ||
) |
Find action in main window.
window | Whe window which should be checked for the action. |
name | The name of the command to be retrieved. |
Definition at line 3224 of file gnc-main-window.c.
gboolean gnc_main_window_finish_pending | ( | GncMainWindow * | window | ) |
Tell a window to finish any outstanding activities. This function will call gnc_plugin_page_finish_pending for each installed page. If any page returns a failure indication, then the function stops walking pages and immediately returns a failure.
window | Whe window whose pages should be checked. |
Definition at line 1092 of file gnc-main-window.c.
GtkActionGroup * gnc_main_window_get_action_group | ( | GncMainWindow * | window, |
const gchar * | group_name | ||
) |
Retrieve a specific set of user interface actions from a window. This function can be used to get an group of action to be manipulated when the front page of a window has changed.
window | The window to check when looking for the action group. |
group_name | The name of a set of actions. This must be a name provided when the actions were installed. |
Definition at line 3245 of file gnc-main-window.c.
GncPluginPage * gnc_main_window_get_current_page | ( | GncMainWindow * | window | ) |
Retrieve a pointer to the page that is currently at the front of the specified window. Any plugin that needs to manipulate its menus based upon the currently selected menu page should connect to the "page_changed" signal on a window. The callback function from that signal can then call this function to obtain a pointer to the current page.
window | A pointer to the window whose front page should be returned. |
Definition at line 3065 of file gnc-main-window.c.
GType gnc_main_window_get_type | ( | void | ) |
Get the type of a gnc main window.
Definition at line 2419 of file gnc-main-window.c.
GtkUIManager * gnc_main_window_get_uimanager | ( | GncMainWindow * | window | ) |
Returns the pointer to the GtkUIManager which is used for the menu item merging.
Definition at line 4733 of file gnc-main-window.c.
void gnc_main_window_manual_merge_actions | ( | GncMainWindow * | window, |
const gchar * | group_name, | ||
GtkActionGroup * | group, | ||
guint | merge_id | ||
) |
Manually add a set of actions to the specified window. Plugins whose user interface is not hard coded (e.g. the menu-additions * plugin) must create their actions at run time, then use this * function to install them into the window.
window | A pointer to the window whose user interface should be updated. |
group_name | The name for this set of actions. This name should be unique among all groups added to the window, and will be needed to remove the actions from this window. |
group | A pointer to an array of GtkActions. These are the actions that will be added to the user interface. |
merge_id | A merge identifier retrieved from a call to gtk_ui_manager_new_merge_id(). |
Definition at line 3080 of file gnc-main-window.c.
void gnc_main_window_merge_actions | ( | GncMainWindow * | window, |
const gchar * | group_name, | ||
GtkActionEntry * | entries, | ||
guint | n_entries, | ||
GtkToggleActionEntry * | toggle_entries, | ||
guint | n_toggle_entries, | ||
const gchar * | filename, | ||
gpointer | user_data | ||
) |
Add a set of actions to the specified window. This function should not need to be called directly by plugin implementors. Correctly assigning values to the GncPluginClass fields during plugin initialization will cause this routine to be automatically called.
window | A pointer to the window whose user interface should be updated. |
group_name | The name for this set of actions. This name should be unique among all groups added to the window, and will be needed to remove the actions from this window. |
entries | A pointer to an array of GtkActionEntry. These are the actions that will be added to the user interface. |
n_entries | The number of actions in the array. |
toggle_entries | A pointer to an array of GtkToggleActionEntry. These are the toggle actions that will be added to the user interface. |
n_toggle_entries | The number of toggle actions in the array. |
filename | The filename containing the user interface definition that goes with this set of actions. |
user_data | The data to be provided to all callback functions. |
Definition at line 3109 of file gnc-main-window.c.
GncMainWindow * gnc_main_window_new | ( | void | ) |
Create a new gnc main window plugin.
Definition at line 2658 of file gnc-main-window.c.
void gnc_main_window_open_page | ( | GncMainWindow * | window, |
GncPluginPage * | page | ||
) |
Display a data plugin page in a window. If the page already exists in any window, then that window will be brought to the front and the notebook switch to display the specified page. If the page is new then it will be added to the specified window (unless the page itself requests otherwise.). If the window is NULL, the new page will be added to the first window.
window | The window to display a new page in. |
page | The new page of data to be displayed, or the existing page of data the should be brought to the top and displayed. |
Definition at line 2871 of file gnc-main-window.c.
void gnc_main_window_restore_all_windows | ( | const GKeyFile * | keyfile | ) |
Restore the persistent state of all windows.
keyfile | The GKeyFile containing persistent window state. |
Definition at line 904 of file gnc-main-window.c.
void gnc_main_window_restore_default_state | ( | GncMainWindow * | window | ) |
Restore the persistent state of one window to a sane default.
Definition at line 940 of file gnc-main-window.c.
void gnc_main_window_save_all_windows | ( | GKeyFile * | keyfile | ) |
Save the persistent state of all windows.
keyfile | The GKeyFile to contain persistent window state. |
Definition at line 1074 of file gnc-main-window.c.
void gnc_main_window_set_progressbar_window | ( | GncMainWindow * | window | ) |
Set the window where all progressbar updates should occur. This is a wrapper around the gnc_window_set_progressbar_window() function.
window | The window to use for all progressbar updates. |
Definition at line 4578 of file gnc-main-window.c.
void gnc_main_window_show_all_windows | ( | void | ) |
void gnc_main_window_unmerge_actions | ( | GncMainWindow * | window, |
const gchar * | group_name | ||
) |
Remove a set of actions from the specified window. This function should not need to be called directly by plugin implementors. It will automatically be called when a plugin is removed from a window.
window | A pointer to the window whose user interface should be updated. |
group_name | The name for this set of actions. This must be the same name provided when the actions were installed. |
Definition at line 3174 of file gnc-main-window.c.
GtkWidget* gnc_ui_get_toplevel | ( | void | ) |
Get a pointer to the first active top level window or NULL if there is none.
Definition at line 4466 of file gnc-main-window.c.
void main_window_update_page_color | ( | GncPluginPage * | page, |
const gchar * | color_in | ||
) |
Update the color on the page tabs in the main window.
page | The page to be updated. |
color_in | The new color string for the page tab. |
Definition at line 2278 of file gnc-main-window.c.
void main_window_update_page_name | ( | GncPluginPage * | page, |
const gchar * | name_in | ||
) |
Update the name of the page in the main window.
page | The page to be updated. |
name_in | The new name for the page. |
Definition at line 2195 of file gnc-main-window.c.