Added uri to AgWindow's private structure, for saving purposes

This commit is contained in:
Gergely Polonkai 2013-09-18 10:37:48 +02:00
parent c921e29c4a
commit bdf318a2ad
2 changed files with 20 additions and 0 deletions

View File

@ -38,6 +38,7 @@ struct _AgWindowPrivate {
GsweTimestamp *timestamp; GsweTimestamp *timestamp;
AgChart *chart; AgChart *chart;
gchar *uri;
}; };
G_DEFINE_TYPE(AgWindow, ag_window, GTK_TYPE_APPLICATION_WINDOW); G_DEFINE_TYPE(AgWindow, ag_window, GTK_TYPE_APPLICATION_WINDOW);
@ -285,6 +286,7 @@ ag_window_init(AgWindow *window)
priv->timestamp = NULL; priv->timestamp = NULL;
priv->chart = NULL; priv->chart = NULL;
priv->uri = NULL;
gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(window), TRUE); gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(window), TRUE);
@ -489,3 +491,19 @@ ag_window_get_chart(AgWindow *window)
return window->priv->chart; return window->priv->chart;
} }
void
ag_window_set_uri(AgWindow *window, const gchar *uri)
{
if (window->priv->uri != NULL) {
g_free(window->priv->uri);
}
window->priv->uri = g_strdup(uri);
}
gchar *
ag_window_get_uri(AgWindow *window)
{
return g_strdup(window->priv->uri);
}

View File

@ -32,6 +32,8 @@ GtkWidget *ag_window_new(AgApp *app);
void ag_window_set_chart(AgWindow *window, AgChart *chart); void ag_window_set_chart(AgWindow *window, AgChart *chart);
AgChart *ag_window_get_chart(AgWindow *window); AgChart *ag_window_get_chart(AgWindow *window);
void ag_window_update_from_chart(AgWindow *window); void ag_window_update_from_chart(AgWindow *window);
void ag_window_set_uri(AgWindow *window, const gchar *uri);
gchar *ag_window_get_uri(AgWindow *window);
G_END_DECLS G_END_DECLS