From 8d76bdf1efced3360aaea7df500156aa87c80411 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 2 Aug 2014 20:00:24 +0200 Subject: [PATCH] ag_window_new_chart_action() goes to chart tab if chart was not correctly closed --- src/ag-window.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ag-window.c b/src/ag-window.c index 6dcb6dd..f244b3c 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -983,6 +983,20 @@ ag_window_new_chart_action(GSimpleAction *action, AgWindow *window = AG_WINDOW(user_data); AgWindowPrivate *priv = ag_window_get_instance_private(window); + if (priv->chart) { + ag_app_message_dialog( + GTK_WIDGET(window), + GTK_MESSAGE_ERROR, + "This window already has a chart. " \ + "This should not happen, " \ + "please consider issuing a bug report!" + ); + + gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "chart"); + + return; + } + gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "edit"); }