From 2bf28d3b9de3ae3af076c569ffaccb66e13857f1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 26 Nov 2017 20:02:53 +0100 Subject: Use config file for image store pathname --- src/narrative_window.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/narrative_window.c') diff --git a/src/narrative_window.c b/src/narrative_window.c index 72968c9..1552845 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -30,6 +30,7 @@ #include #include +#include "colloquium.h" #include "presentation.h" #include "narrative_window.h" #include "sc_editor.h" @@ -692,7 +693,7 @@ void update_titlebar(NarrativeWindow *nw) } -NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) +NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *papp) { NarrativeWindow *nw; GtkWidget *vbox; @@ -702,6 +703,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) SCBlock **stylesheets; SCCallbackList *cbl; GtkWidget *image; + Colloquium *app = COLLOQUIUM(papp); if ( p->narrative_window != NULL ) { fprintf(stderr, "Narrative window is already open!\n"); @@ -711,7 +713,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) nw = calloc(1, sizeof(NarrativeWindow)); if ( nw == NULL ) return NULL; - nw->app = app; + nw->app = papp; nw->p = p; nw->window = gtk_application_window_new(GTK_APPLICATION(app)); @@ -734,7 +736,8 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) nw->p->scblocks = sc_parse(""); } - nw->sceditor = sc_editor_new(nw->p->scblocks, stylesheets, p->lang); + nw->sceditor = sc_editor_new(nw->p->scblocks, stylesheets, p->lang, + colloquium_get_imagestore(app)); free(stylesheets); cbl = sc_callback_list_new(); sc_callback_list_add_callback(cbl, "sthumb", create_thumbnail, @@ -823,8 +826,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) GTK_WIDGET(nw->sceditor)); gtk_widget_show_all(nw->window); - nw->app = app; - g_application_hold(app); + g_application_hold(papp); return nw; } -- cgit v1.2.3