diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/colloquium.c | 4 | ||||
-rw-r--r-- | src/narrative_window.c | 21 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/colloquium.c b/src/colloquium.c index 436ac86..93f3229 100644 --- a/src/colloquium.c +++ b/src/colloquium.c @@ -242,6 +242,10 @@ static void colloquium_startup(GApplication *app) " <attribute name='label'>Delete frame</attribute>" " <attribute name='action'>win.deleteframe</attribute>" " </item>" + " <item>" + " <attribute name='label'>Delete slide</attribute>" + " <attribute name='action'>win.deleteslide</attribute>" + " </item>" " </section>" " <section>" " <item>" diff --git a/src/narrative_window.c b/src/narrative_window.c index 1c8fc14..5b32c36 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -140,9 +140,24 @@ static void open_slidesorter_sig(GSimpleAction *action, GVariant *parameter, } -static void delete_frame_sig(GSimpleAction *action, GVariant *parameter, - gpointer vp) +static void delete_slide_sig(GSimpleAction *action, GVariant *parameter, + gpointer vp) { + SCBlock *ns; + NarrativeWindow *nw = vp; + + /* Get the SCBlock corresponding to the slide */ + ns = sc_editor_get_cursor_bvp(nw->sceditor); + if ( ns == NULL ) { + fprintf(stderr, "Not a slide!\n"); + return; + } + + sc_block_delete(nw->p->scblocks, ns); + + /* Full rerender */ + sc_editor_set_scblock(nw->sceditor, + sc_editor_get_scblock(nw->sceditor)); } @@ -466,7 +481,7 @@ GActionEntry nw_entries[] = { { "save", save_sig, NULL, NULL, NULL }, { "saveas", saveas_sig, NULL, NULL, NULL }, { "sorter", open_slidesorter_sig, NULL, NULL, NULL }, - { "deleteframe", delete_frame_sig, NULL, NULL, NULL }, + { "deleteslide", delete_slide_sig, NULL, NULL, NULL }, { "slide", add_slide_sig, NULL, NULL, NULL }, { "startslideshow", start_slideshow_sig, NULL, NULL, NULL }, { "notes", open_notes_sig, NULL, NULL, NULL }, |