aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-11-26 20:02:53 +0100
committerThomas White <taw@bitwiz.org.uk>2017-11-26 20:02:53 +0100
commit2bf28d3b9de3ae3af076c569ffaccb66e13857f1 (patch)
treedd2ef413583e63ea589019fe687b0b599059bd34 /src/narrative_window.c
parent86e80d221809201f4cab608c5312bce8c76618a8 (diff)
Use config file for image store pathname
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c12
1 files changed, 7 insertions, 5 deletions
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 <string.h>
#include <stdlib.h>
+#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;
}