void on_text_received (Gtk.Clipboard clipboard, string text) {
var clip_pattern = new LedPatternRX51 ();
- if (clip_pattern.parse (text)) {
+ try {
+ clip_pattern.parse (text);
lpv.pattern.replace_with (clip_pattern);
- } else {
+ } catch (LedPatternError e) {
Hildon.Banner.show_information (null, null, "Not a valid pattern");
}
}