[gnome-software] GsShell: Add an api to start a search



commit 7016b482f2144fb8adda3c3d8470566b63c33b22
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 11 20:52:37 2013 -0400

    GsShell: Add an api to start a search
    
    This function will be used in a future GNOME shell
    search provider.

 src/gs-shell.c |   11 +++++++++++
 src/gs-shell.h |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index f1b436a..a3097fd 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -580,6 +580,17 @@ gs_shell_show_category (GsShell *shell, GsCategory *category)
        gs_shell_change_mode (shell, GS_SHELL_MODE_CATEGORY, NULL, category, TRUE);
 }
 
+void
+gs_shell_show_search (GsShell *shell, const gchar *search)
+{
+       GsShellPrivate *priv = shell->priv;
+       GtkWidget *widget;
+
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
+       gtk_entry_set_text (GTK_ENTRY (widget), search);
+       gs_shell_change_mode (shell, GS_SHELL_MODE_SEARCH, NULL, NULL, TRUE);
+}
+
 /**
  * gs_shell_class_init:
  **/
diff --git a/src/gs-shell.h b/src/gs-shell.h
index d56e1c7..2c9e212 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -77,6 +77,8 @@ void           gs_shell_show_app              (GsShell        *shell,
                                                 GsApp          *app);
 void            gs_shell_show_category         (GsShell        *shell,
                                                 GsCategory     *category);
+void            gs_shell_show_search           (GsShell        *shell,
+                                                const gchar    *search);
 GtkWindow      *gs_shell_setup                 (GsShell        *shell,
                                                 GsPluginLoader *plugin_loader,
                                                 GCancellable   *cancellable);


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