Always recreate pages in the given window.

Even if registers, reports or invoice pages have been configured to open
in new windows they should not do so when restored at the startup of
gnucash.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16965 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2008-02-27 20:55:33 +00:00
parent 93ca33e0b5
commit e26b1d6bcf
5 changed files with 23 additions and 9 deletions

View File

@ -1654,7 +1654,8 @@ find_handler (gpointer find_data, gpointer user_data)
static InvoiceWindow *
gnc_invoice_new_page (GNCBook *bookp, InvoiceDialogType type,
GncInvoice *invoice, GncOwner *owner)
GncInvoice *invoice, GncOwner *owner,
GncMainWindow *window)
{
InvoiceWindow *iw;
GncOwner *billto;
@ -1698,7 +1699,12 @@ gnc_invoice_new_page (GNCBook *bookp, InvoiceDialogType type,
/* Now create the plugin page for this invoice and display it. */
new_page = gnc_plugin_page_invoice_new (iw);
gnc_main_window_open_page (gnc_plugin_business_get_window(), new_page);
if (window)
gnc_plugin_page_set_use_new_window (new_page, FALSE);
else
window = gnc_plugin_business_get_window ();
gnc_main_window_open_page (window, new_page);
/* Initialize the summary bar */
gnc_invoice_redraw_all_cb(iw->reg, iw);
@ -1712,7 +1718,8 @@ gnc_invoice_new_page (GNCBook *bookp, InvoiceDialogType type,
#define KEY_OWNER_GUID "OwnerGUID"
GncPluginPage *
gnc_invoice_recreate_page (GKeyFile *key_file,
gnc_invoice_recreate_page (GncMainWindow *window,
GKeyFile *key_file,
const gchar *group_name)
{
InvoiceWindow *iw;
@ -1784,7 +1791,7 @@ gnc_invoice_recreate_page (GKeyFile *key_file,
g_free(tmp_string);
g_free(owner_type);
iw = gnc_invoice_new_page (book, type, invoice, &owner);
iw = gnc_invoice_new_page (book, type, invoice, &owner, window);
return iw->page;
give_up:
@ -2117,7 +2124,7 @@ gnc_ui_invoice_edit (GncInvoice *invoice)
type = EDIT_INVOICE;
iw = gnc_invoice_new_page (gncInvoiceGetBook(invoice), type,
invoice, gncInvoiceGetOwner (invoice));
invoice, gncInvoiceGetOwner (invoice), NULL);
return iw;
}

View File

@ -80,7 +80,8 @@ gchar *gnc_invoice_get_help (InvoiceWindow *iw);
gchar *gnc_invoice_get_title (InvoiceWindow *iw);
#ifdef __GNC_PLUGIN_PAGE_H
GncPluginPage *gnc_invoice_recreate_page (GKeyFile *key_file, const gchar *group_name);
#include "gnc-main-window.h"
GncPluginPage *gnc_invoice_recreate_page (GncMainWindow *window, GKeyFile *key_file, const gchar *group_name);
void gnc_invoice_save_page (InvoiceWindow *iw, GKeyFile *key_file, const gchar *group_name);
#endif

View File

@ -496,13 +496,15 @@ gnc_plugin_page_invoice_recreate_page (GtkWidget *window,
const gchar *group_name)
{
GncPluginPage *page;
g_return_val_if_fail(GNC_IS_MAIN_WINDOW(window), NULL);
g_return_val_if_fail(key_file, NULL);
g_return_val_if_fail(group_name, NULL);
ENTER("key_file %p, group_name %s", key_file, group_name);
/* Create the new page. */
page = gnc_invoice_recreate_page(key_file, group_name);
page = gnc_invoice_recreate_page(GNC_MAIN_WINDOW(window),
key_file, group_name);
LEAVE(" ");
return page;

View File

@ -503,7 +503,8 @@ gnc_main_window_restore_page (GncMainWindow *window,
if (page) {
/* Does the page still need to be installed into the window? */
if (page->window == NULL) {
gnc_main_window_open_page(window, page);
gnc_plugin_page_set_use_new_window(page, FALSE);
gnc_main_window_open_page(window, page);
}
/* Restore the page name */

View File

@ -1024,6 +1024,9 @@ gnc_plugin_page_register_recreate_page (GtkWidget *window,
}
g_free(reg_type);
/* Recreate page in given window */
gnc_plugin_page_set_use_new_window(page, FALSE);
/* Install it now so we can them manipulate the created widget */
gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);