mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add a "book saved" hook. Use this to update the window titles after a
file is saved. Fixes 334789. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13660 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
199281f415
commit
2cd27a1b6e
@ -1,3 +1,10 @@
|
||||
2006-03-17 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-utils/gnc-file.c:
|
||||
* src/gnome-utils/gnc-main-window.c:
|
||||
* src/engine/gnc-hooks.[ch]: Add a "book saved" hook. Use this to
|
||||
update the window titles after a file is saved. Fixes 334789.
|
||||
|
||||
2006-03-17 Andreas Köhler <andi5.py@gmx.net>
|
||||
|
||||
* src/engine/Split.c: Fix return value of get_corr_account_split
|
||||
|
@ -323,6 +323,8 @@ gnc_hooks_init(void)
|
||||
"Run after book open. Hook args: <gnc:Session*>.");
|
||||
gnc_hook_create(HOOK_BOOK_CLOSED, 1,
|
||||
"Run before file close. Hook args: <gnc:Session*>");
|
||||
gnc_hook_create(HOOK_BOOK_SAVED, 1,
|
||||
"Run after file saved. Hook args: <gnc:Session*>");
|
||||
|
||||
LEAVE("");
|
||||
}
|
||||
|
@ -70,5 +70,6 @@ void gnc_hooks_init(void);
|
||||
/* Common session hook names */
|
||||
#define HOOK_BOOK_OPENED "hook_book_opened"
|
||||
#define HOOK_BOOK_CLOSED "hook_book_closed"
|
||||
#define HOOK_BOOK_SAVED "hook_book_saved"
|
||||
|
||||
#endif /* GNC_HOOKS_H */
|
||||
|
@ -965,6 +965,7 @@ gnc_file_save (void)
|
||||
}
|
||||
|
||||
gnc_add_history (session);
|
||||
gnc_hook_run(HOOK_BOOK_SAVED, session);
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
@ -1095,6 +1096,7 @@ gnc_file_save_as (void)
|
||||
save_in_progress--;
|
||||
|
||||
g_free (newfile);
|
||||
gnc_hook_run(HOOK_BOOK_SAVED, new_session);
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
|
@ -1166,6 +1166,14 @@ gnc_main_window_update_title (GncMainWindow *window)
|
||||
g_free(title);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_main_window_update_all_titles (void)
|
||||
{
|
||||
g_list_foreach(active_windows,
|
||||
(GFunc)gnc_main_window_update_title,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
/** This data structure is used to describe the requested state of a
|
||||
* GtkRadioAction, and us used to pass data among several
|
||||
@ -1669,6 +1677,8 @@ gnc_main_window_class_init (GncMainWindowClass *klass)
|
||||
gnc_gconf_general_register_cb (KEY_SHOW_CLOSE_BUTTON,
|
||||
gnc_main_window_update_tabs,
|
||||
NULL);
|
||||
gnc_hook_add_dangler(HOOK_BOOK_SAVED,
|
||||
(GFunc)gnc_main_window_update_all_titles, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user