search: Open event from search results

And this finally hooks up the last missing bit from the
search engine: opening events from search results.

All the necessary plumbing is there for extending search
with other commands or results, such as go to date, etc.
This commit is contained in:
Georges Basile Stavracas Neto
2019-04-29 17:08:54 -03:00
parent 1aecd1043d
commit d6c5bf032d
5 changed files with 51 additions and 4 deletions
+14
View File
@@ -22,6 +22,7 @@
#include "gcal-context.h"
#include "gcal-search-button.h"
#include "gcal-search-hit.h"
#include <math.h>
@@ -119,6 +120,14 @@ on_search_entry_changed_cb (GcalSearchButton *self)
g_object_ref (self));
}
static void
on_search_entry_suggestion_activated_cb (DzlSuggestionEntry *entry,
GcalSearchHit *search_hit,
GcalSearchButton *self)
{
gcal_search_hit_activate (search_hit, GTK_WIDGET (self));
}
static void
on_unfocus_action_activated_cb (GSimpleAction *action,
GVariant *param,
@@ -257,6 +266,11 @@ gcal_search_button_init (GcalSearchButton *self)
G_CALLBACK (on_search_entry_changed_cb),
self,
G_CONNECT_SWAPPED);
g_signal_connect_object (entry,
"suggestion-activated",
G_CALLBACK (on_search_entry_suggestion_activated_cb),
self,
0);
dzl_suggestion_entry_set_position_func (entry,
position_suggestion_popover_func,