From 0cc6344c37f01fd8960c0d89454232f710278444 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 2 Jul 2014 19:15:54 +0200 Subject: [PATCH] Change to chart view when opening an existing chart --- src/ag-app.c | 1 + src/ag-window.c | 5 +++++ src/ag-window.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/ag-app.c b/src/ag-app.c index fff9627..38273e1 100644 --- a/src/ag-app.c +++ b/src/ag-app.c @@ -126,6 +126,7 @@ ag_app_open_chart(AgApp *app, GFile *file) uri = g_file_get_uri(file); ag_window_set_uri(AG_WINDOW(window), uri); g_free(uri); + ag_window_open_chart_tab(window); } static void diff --git a/src/ag-window.c b/src/ag-window.c index 4003f54..fc35dd8 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -813,3 +813,8 @@ ag_window_settings_save(GtkWindow *window, GSettings *settings) g_settings_set_int(settings, "height", height); } +void +ag_window_open_chart_tab(AgWindow *window) +{ + gtk_stack_set_visible_child_name(GTK_STACK(window->priv->stack), "chart"); +} diff --git a/src/ag-window.h b/src/ag-window.h index ef33e80..c4d34ed 100644 --- a/src/ag-window.h +++ b/src/ag-window.h @@ -45,6 +45,7 @@ void ag_window_settings_restore(GtkWindow *window, GSettings *settings); void ag_window_settings_save(GtkWindow *window, GSettings *settings); +void ag_window_open_chart_tab(AgWindow *window); #define AG_WINDOW_ERROR (ag_window_error_quark()) GQuark ag_window_error_quark(void);