aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-09-23 20:55:32 +0200
committerThomas White <taw@bitwiz.org.uk>2013-09-23 20:55:32 +0200
commitdd96572950db971746a46964e381b02c1aa25114 (patch)
tree3a2dc0095caf3fc79398d349231daf784a2545e8 /src
parent3af904c7741111d2a3e408646fd5b0e4d6ffb4e5 (diff)
Add "Delete frame"
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.c20
-rw-r--r--src/presentation.c2
-rw-r--r--src/presentation.h2
3 files changed, 21 insertions, 3 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 00667a3..fcd49a1 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -731,6 +731,22 @@ static gint open_slidesorter_sig(GtkWidget *widget, struct presentation *p)
return FALSE;
}
+static gint delete_frame_sig(GtkWidget *widget, struct presentation *p)
+{
+ int i;
+
+ for ( i=0; i<p->n_selection; i++ ) {
+ delete_subframe(p->cur_edit_slide, p->selection[i]);
+ }
+ p->n_selection = 0;
+
+ rerender_slide(p);
+ redraw_editor(p);
+
+ return FALSE;
+}
+
+
static void add_menu_bar(struct presentation *p, GtkWidget *vbox)
{
GError *error = NULL;
@@ -771,8 +787,8 @@ static void add_menu_bar(struct presentation *p, GtkWidget *vbox)
NULL, NULL, NULL },
{ "PasteAction", GTK_STOCK_PASTE, "Paste",
NULL, NULL, NULL },
- { "DeleteAction", GTK_STOCK_DELETE, "Delete",
- NULL, NULL, NULL },
+ { "DeleteFrameAction", GTK_STOCK_DELETE, "Delete Frame",
+ NULL, NULL, G_CALLBACK(delete_frame_sig) },
{ "EditStyleAction", NULL, "Stylesheet...",
NULL, NULL, G_CALLBACK(open_stylesheet_sig) },
diff --git a/src/presentation.c b/src/presentation.c
index 4612f03..426783f 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -609,7 +609,7 @@ static struct frame *find_parent(struct frame *fr, struct frame *search)
}
-static void delete_subframe(struct slide *s, struct frame *fr)
+void delete_subframe(struct slide *s, struct frame *fr)
{
struct frame *parent;
int i, idx, found;
diff --git a/src/presentation.h b/src/presentation.h
index 3bb96ed..2294c48 100644
--- a/src/presentation.h
+++ b/src/presentation.h
@@ -201,6 +201,8 @@ extern int insert_slide(struct presentation *p, struct slide *s, int pos);
extern void free_slide(struct slide *s);
extern void delete_slide(struct presentation *p, struct slide *s);
+extern void delete_subframe(struct slide *s, struct frame *fr);
+
extern void get_titlebar_string(struct presentation *p);
extern char *packed_sc(struct frame *fr, StyleSheet *ss);