aboutsummaryrefslogtreecommitdiff
path: root/src/presentation.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-01-16 22:42:26 +0100
committerThomas White <taw@bitwiz.org.uk>2017-01-16 22:42:26 +0100
commit4fc663655ff4a8ea990d7e4f4b7580cf63e233c4 (patch)
tree2b1e8141f2ada14987275da1adc15cbac7390a86 /src/presentation.c
parente93d3a16ac3bb381cf7d18a184fb4369c71d8caf (diff)
Titlebar stuff, keep track of when presentation has been changed
Diffstat (limited to 'src/presentation.c')
-rw-r--r--src/presentation.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/presentation.c b/src/presentation.c
index 1abf4fc..5b4a3de 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -90,7 +90,7 @@ static char *safe_basename(const char *in)
char *get_titlebar_string(struct presentation *p)
{
- if ( p->filename == NULL ) {
+ if ( p == NULL || p->filename == NULL ) {
return strdup("(untitled)");
} else {
return safe_basename(p->filename);
@@ -114,6 +114,7 @@ struct presentation *new_presentation()
new->slide_height = 768.0;
new->completely_empty = 1;
+ new->saved = 1;
new->stylesheet = NULL;
new->is = imagestore_new();
@@ -140,9 +141,10 @@ int save_presentation(struct presentation *p, const char *filename)
imagestore_set_presentation_file(p->is, filename);
p->filename = strdup(filename);
if ( old_fn != NULL ) free(old_fn);
- update_titlebar(p);
fclose(fh);
+ p->saved = 1;
+ update_titlebar(p->narrative_window);
return 0;
}
@@ -372,7 +374,6 @@ int load_presentation(struct presentation *p, const char *filename)
assert(p->filename == NULL);
p->filename = strdup(filename);
- update_titlebar(p);
imagestore_set_presentation_file(p->is, filename);
return 0;