[beast/devel: 53/77] BSE: fix script messages
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 53/77] BSE: fix script messages
- Date: Wed, 1 May 2013 17:31:47 +0000 (UTC)
commit e93c3fb0aa4451ef1f351dc5672fd1886b71c64f
Author: Tim Janik <timj gnu org>
Date: Thu Apr 11 02:19:02 2013 +0200
BSE: fix script messages
bse/bsejanitor.proc | 21 +++++++++++++++------
library/scripts/song-parts-operations.scm | 2 +-
2 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/bse/bsejanitor.proc b/bse/bsejanitor.proc
index bccbf9e..61c81b8 100644
--- a/bse/bsejanitor.proc
+++ b/bse/bsejanitor.proc
@@ -316,15 +316,24 @@ PROCEDURE (bse-script-send-message, "Script/Message") {
const gchar *text3 = sfi_value_get_string (in_values++);
const gchar *check = sfi_value_get_string (in_values++);
- Bse::printerr ("FIXME: mtype=%s\n", mtype);
- if (text0)
+ auto stupid_convert = [] (char c) {
+ switch (c)
+ {
+ case 'E': case 'e': return Bse::ERROR;
+ case 'W': case 'w': return Bse::WARNING;
+ default:
+ case 'I': case 'i': return Bse::INFO;
+ case 'D': case 'd': return Bse::DEBUG;
+ }
+ };
+
+ if (text1)
{
using namespace Bse;
UserMessage umsg;
- umsg.type = Bse::WARNING;
- umsg.title = text0;
- if (text1)
- umsg.text1 = text1;
+ umsg.type = stupid_convert (mtype ? mtype[0] : 0);
+ umsg.title = text0 ? text0 : "WARNING";
+ umsg.text1 = text1;
if (text2)
umsg.text2 = text2;
if (text3)
diff --git a/library/scripts/song-parts-operations.scm b/library/scripts/song-parts-operations.scm
index c1b8e73..ce25639 100644
--- a/library/scripts/song-parts-operations.scm
+++ b/library/scripts/song-parts-operations.scm
@@ -41,7 +41,7 @@
'text1 errtitle
'text2 (_ "The loop range of the specified song contains no parts "
"or is unset, so no parts can be identified to operate on.")
- 'check (_ "Show messages about empty part range")))))
+ 'check (_ "empty part range")))))
;; algorithm for cropping parts
(define (song-parts-crop song)
(song-parts-operation song (_ "Failed to crop part range.")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]