|
|
|
|
@ -403,6 +403,9 @@ static const gchar *multiple_page_actions[] = {
|
|
|
|
|
#define WINDOW_GEOMETRY "Window Geometry"
|
|
|
|
|
#define WINDOW_POSITION "Window Position"
|
|
|
|
|
#define WINDOW_MAXIMIZED "Window Maximized"
|
|
|
|
|
#define TOOLBAR_VISIBLE "Toolbar Visible"
|
|
|
|
|
#define STATUSBAR_VISIBLE "Statusbar Visible"
|
|
|
|
|
#define SUMMARYBAR_VISIBLE "Summarybar Visible"
|
|
|
|
|
#define WINDOW_FIRSTPAGE "First Page"
|
|
|
|
|
#define WINDOW_PAGECOUNT "Page Count"
|
|
|
|
|
#define WINDOW_PAGEORDER "Page Order"
|
|
|
|
|
@ -511,9 +514,10 @@ static void
|
|
|
|
|
gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *data)
|
|
|
|
|
{
|
|
|
|
|
GncMainWindowPrivate *priv;
|
|
|
|
|
GtkAction *action;
|
|
|
|
|
gint *pos, *geom, *order;
|
|
|
|
|
gsize length;
|
|
|
|
|
gboolean max;
|
|
|
|
|
gboolean max, visible, desired_visibility;
|
|
|
|
|
gchar *window_group;
|
|
|
|
|
gint page_start, page_count, i;
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
@ -612,6 +616,46 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
|
|
|
|
|
gtk_window_maximize(GTK_WINDOW(window));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Common view menu items */
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewToolbarAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
desired_visibility = g_key_file_get_boolean(data->key_file, window_group,
|
|
|
|
|
TOOLBAR_VISIBLE, &error);
|
|
|
|
|
if (error) {
|
|
|
|
|
g_warning("error reading group %s key %s: %s",
|
|
|
|
|
window_group, TOOLBAR_VISIBLE, error->message);
|
|
|
|
|
g_error_free(error);
|
|
|
|
|
error = NULL;
|
|
|
|
|
} else if (visible != desired_visibility) {
|
|
|
|
|
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),desired_visibility);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewSummaryAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
desired_visibility = g_key_file_get_boolean(data->key_file, window_group,
|
|
|
|
|
SUMMARYBAR_VISIBLE, &error);
|
|
|
|
|
if (error) {
|
|
|
|
|
g_warning("error reading group %s key %s: %s",
|
|
|
|
|
window_group, TOOLBAR_VISIBLE, error->message);
|
|
|
|
|
g_error_free(error);
|
|
|
|
|
error = NULL;
|
|
|
|
|
} else if (visible != desired_visibility) {
|
|
|
|
|
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),desired_visibility);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewStatusbarAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
desired_visibility = g_key_file_get_boolean(data->key_file, window_group,
|
|
|
|
|
STATUSBAR_VISIBLE, &error);
|
|
|
|
|
if (error) {
|
|
|
|
|
g_warning("error reading group %s key %s: %s",
|
|
|
|
|
window_group, TOOLBAR_VISIBLE, error->message);
|
|
|
|
|
g_error_free(error);
|
|
|
|
|
error = NULL;
|
|
|
|
|
} else if (visible != desired_visibility) {
|
|
|
|
|
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),desired_visibility);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now populate the window with pages. */
|
|
|
|
|
for (i = 0; i < page_count; i++) {
|
|
|
|
|
data->page_offset = page_start;
|
|
|
|
|
@ -752,8 +796,9 @@ static void
|
|
|
|
|
gnc_main_window_save_window (GncMainWindow *window, GncMainWindowSaveData *data)
|
|
|
|
|
{
|
|
|
|
|
GncMainWindowPrivate *priv;
|
|
|
|
|
GtkAction *action;
|
|
|
|
|
gint i, num_pages, coords[4], *order;
|
|
|
|
|
gboolean maximized;
|
|
|
|
|
gboolean maximized, visible;
|
|
|
|
|
gchar *window_group;
|
|
|
|
|
|
|
|
|
|
/* Setup */
|
|
|
|
|
@ -802,6 +847,20 @@ gnc_main_window_save_window (GncMainWindow *window, GncMainWindowSaveData *data)
|
|
|
|
|
coords[2], coords[3],
|
|
|
|
|
maximized ? "maximized" : "not maximized");
|
|
|
|
|
|
|
|
|
|
/* Common view menu items */
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewToolbarAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
g_key_file_set_boolean(data->key_file, window_group,
|
|
|
|
|
TOOLBAR_VISIBLE, visible);
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewSummaryAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
g_key_file_set_boolean(data->key_file, window_group,
|
|
|
|
|
SUMMARYBAR_VISIBLE, visible);
|
|
|
|
|
action = gnc_main_window_find_action(window, "ViewStatusbarAction");
|
|
|
|
|
visible = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
|
|
|
|
|
g_key_file_set_boolean(data->key_file, window_group,
|
|
|
|
|
STATUSBAR_VISIBLE, visible);
|
|
|
|
|
|
|
|
|
|
/* Save individual pages in this window */
|
|
|
|
|
g_list_foreach(priv->installed_pages, (GFunc)gnc_main_window_save_page, data);
|
|
|
|
|
|
|
|
|
|
|