aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-11-09 19:23:19 +0100
committerThomas White <taw@bitwiz.org.uk>2011-11-09 19:23:19 +0100
commite471515d34ee636a23e763782cfd4ac80bf63eb1 (patch)
treed16a0a4c87c00b8c468b70ad39d149f52efc556b /src/mainwindow.c
parent9c4933dfe7306080056beaaff99c27991a7c473d (diff)
Implement File->New, don't quit until last file is closed
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r--src/mainwindow.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 8af543d..1c5f467 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -177,6 +177,21 @@ static gint open_sig(GtkWidget *widget, struct presentation *p)
}
+static gint new_sig(GtkWidget *widget, struct presentation *pnn)
+{
+ struct presentation *p;
+
+ p = new_presentation();
+ if ( p != NULL ) {
+ p->cur_edit_slide = add_slide(p, 0);
+ p->completely_empty = 1;
+ open_mainwindow(p);
+ }
+
+ return 0;
+}
+
+
static gint saveas_response_sig(GtkWidget *d, gint response,
struct presentation *p)
{
@@ -472,7 +487,7 @@ static void add_menu_bar(struct presentation *p, GtkWidget *vbox)
{ "FileAction", NULL, "_File", NULL, NULL, NULL },
{ "NewAction", GTK_STOCK_NEW, "_New",
- NULL, NULL, NULL },
+ NULL, NULL, G_CALLBACK(new_sig) },
{ "OpenAction", GTK_STOCK_OPEN, "_Open...",
NULL, NULL, G_CALLBACK(open_sig) },
{ "SaveAction", GTK_STOCK_SAVE, "_Save",
@@ -589,7 +604,7 @@ static void add_menu_bar(struct presentation *p, GtkWidget *vbox)
static gint close_sig(GtkWidget *window, struct presentation *p)
{
- gtk_main_quit();
+ free_presentation(p);
return 0;
}