summaryrefslogtreecommitdiffstats
path: root/src/wins.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wins.c')
-rwxr-xr-xsrc/wins.c33
1 files changed, 31 insertions, 2 deletions
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);
+}