From: Kaj-Michael Lang Date: Mon, 3 Mar 2008 13:07:44 +0000 (+0200) Subject: Display a generic error message if record or playback failes to start. Don't use... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f849acb5b501380769b10d595eb561cb130386c9;p=mapper Display a generic error message if record or playback failes to start. Don't use : in note filename as it won't work on FAT fs as used on the tablets. --- diff --git a/src/audio-note.c b/src/audio-note.c index ceb1953..4187e27 100644 --- a/src/audio-note.c +++ b/src/audio-note.c @@ -100,7 +100,9 @@ if (tmp == NULL) { MACRO_BANNER_SHOW_INFO(_window, _("Failed to get timestamp for file!")); return TRUE; } -strftime(buffer, sizeof(buffer), "%Y-%m-%d-%H:%M:%S", tmp); + +/* Bah, stupid FAT can't use : in filenames */ +strftime(buffer, sizeof(buffer), "%Y-%m-%d-%H%M%S", tmp); if (ui->cfile) g_free(ui->cfile); @@ -113,6 +115,8 @@ if (audio_note_record(ui->cfile)==TRUE) { gtk_widget_set_sensitive(ui->btn_play, FALSE); gtk_widget_set_sensitive(ui->btn_record, FALSE); gtk_widget_set_sensitive(ui->btn_stop, TRUE); +} else { + popup_error(_window, _("Failed to start recording.")); } return TRUE; @@ -124,7 +128,7 @@ audio_note_play_cb(GtkWidget *widget, gpointer data) audio_note_ui *ui=(audio_note_ui *)data; if (!ui->cfile) { - MACRO_BANNER_SHOW_INFO(_window, _("No active audio note.")); + MACRO_BANNER_SHOW_INFO(_window, _("No active audio note. Record something first.")); return TRUE; } @@ -134,6 +138,8 @@ if (audio_note_play(ui->cfile)==TRUE) { gtk_widget_set_sensitive(ui->btn_play, FALSE); gtk_widget_set_sensitive(ui->btn_record, FALSE); gtk_widget_set_sensitive(ui->btn_stop, TRUE); +} else { + popup_error(_window, _("Failed to start playing.")); } return TRUE; }