[gnome-builder/wip/commands] commands: add command not found when we don't find one.



commit aabb1e12b517af3074a3c3036877dd5ff1377556
Author: Christian Hergert <christian hergert me>
Date:   Wed Oct 8 02:20:18 2014 -0700

    commands: add command not found when we don't find one.

 src/commands/gb-command-bar.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/commands/gb-command-bar.c b/src/commands/gb-command-bar.c
index 58efc75..1352565 100644
--- a/src/commands/gb-command-bar.c
+++ b/src/commands/gb-command-bar.c
@@ -138,6 +138,19 @@ gb_command_bar_on_entry_activate (GbCommandBar *bar,
           if (task)
             gb_command_bar_push_task (bar, task);
         }
+      else
+        {
+          gchar *errmsg;
+
+          errmsg = g_strdup_printf (_("Command not found: %s"), text);
+          task = g_object_new (GB_TYPE_COMMAND_TASK,
+                               "active", FALSE,
+                               "command-text", errmsg,
+                               NULL);
+          gb_command_bar_push_task (bar, task);
+          g_object_unref (task);
+          g_free (errmsg);
+        }
 
       g_clear_object (&task);
       g_clear_object (&command);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]