#include <unistd.h>
+#include <errno.h>
#include <gtk/gtk.h>
#include <hildon/hildon.h>
#include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
g_free(cfg->text);
}
-static void do_test(struct espeaktime_settings *cfg)
+static void cfg_speak(struct espeaktime_settings *cfg, gboolean test_mode)
{
gchar astr[16], pstr[16], sstr[16];
gchar vstr[64];
res = execlp(ESPEAK_BIN, ESPEAK_BIN,
"-a", astr, "-p", pstr, "-s", sstr, "-v", vstr,
text, NULL);
- g_print("execlp: %d\n", res);
+ g_print("execlp: %d (%s)\n", res, g_strerror(errno));
+ exit(res);
}
switch (result) {
case 1:
g_print("Test button\n");
- do_test(&cfg);
+ cfg_speak(&cfg, TRUE);
continue;
case GTK_RESPONSE_OK:
g_print("Save\n");