From 478b2762e61cee2aa2b073e37cfcdaf220692acf Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Sun, 30 Dec 2007 16:27:58 +0000 Subject: Ability to attach notes to todo items added --- src/wins.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/wins.c') diff --git a/src/wins.c b/src/wins.c index b238996..fe79588 100755 --- a/src/wins.c +++ b/src/wins.c @@ -1,4 +1,4 @@ -/* $Id: wins.c,v 1.8 2007/10/21 13:39:49 culot Exp $ */ +/* $Id: wins.c,v 1.9 2007/12/30 16:27:59 culot Exp $ */ /* * Calcurse - text-based organizer @@ -337,7 +337,8 @@ wins_update(void) break; default: - ierror(_("FATAL ERROR in wins_update: no window selected\n")); + ierror(_("FATAL ERROR in wins_update: no window selected\n"), + IERROR_FATAL); /* NOTREACHED */ } @@ -361,3 +362,31 @@ wins_reset(void) wins_reinit(); wins_update(); } + +/* + * While inside interactive mode, launch the external command cmd on the given + * file. + */ +void +wins_launch_external(const char *file, const char *cmd) +{ + char *p; + + if (asprintf(&p, "%s %s", cmd, file) == -1) + return; + + if (notify_bar()) + notify_stop_main_thread(); + def_prog_mode(); + endwin(); + clear(); + refresh(); + system(p); + reset_prog_mode(); + clearok(curscr, TRUE); + curs_set(0); + refresh(); + if (notify_bar()) + notify_start_main_thread(); + free(p); +} -- cgit v1.2.3