[gitg] Implement basic history search
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Implement basic history search
- Date: Sat, 20 Dec 2014 16:10:30 +0000 (UTC)
commit b757944e63792c5ff0694d8711e587335d820d67
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Dec 20 17:10:16 2014 +0100
Implement basic history search
gitg/gitg-dash-view.vala | 9 +++++++--
gitg/history/gitg-history.vala | 24 +++++++++++++++++++++++-
libgitg-ext/gitg-ext-searchable.vala | 1 +
3 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/gitg/gitg-dash-view.vala b/gitg/gitg-dash-view.vala
index d58cc53..7889ad4 100644
--- a/gitg/gitg-dash-view.vala
+++ b/gitg/gitg-dash-view.vala
@@ -107,6 +107,13 @@ class DashView : RepositoryListBox, GitgExt.UIElement, GitgExt.Activity, GitgExt
filter_text(d_search_text);
}
}
+
+ default = "";
+ }
+
+ public Gtk.Entry? search_entry
+ {
+ set {}
}
public bool search_visible { get; set; }
@@ -163,8 +170,6 @@ class DashView : RepositoryListBox, GitgExt.UIElement, GitgExt.Activity, GitgExt
construct
{
- d_search_text = "";
-
notify["mode"].connect(() => {
if (!d_setting_mode)
{
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index d5edf88..3869c06 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -22,7 +22,7 @@ namespace GitgHistory
/* The main history view. This view shows the equivalent of git log, but
* in a nice way with lanes, merges, ref labels etc.
*/
- public class Activity : Object, GitgExt.UIElement, GitgExt.Activity, GitgExt.Selectable,
GitgExt.History
+ public class Activity : Object, GitgExt.UIElement, GitgExt.Activity, GitgExt.Selectable,
GitgExt.Searchable, GitgExt.History
{
// Do this to pull in config.h before glib.h (for gettext...)
private const string version = Gitg.Config.VERSION;
@@ -637,6 +637,28 @@ namespace GitgHistory
return ab;
}
}
+
+ public Gtk.Entry? search_entry
+ {
+ set
+ {
+ int column = -1;
+
+ if (value != null)
+ {
+ column = (int)Gitg.CommitModelColumns.MESSAGE;
+ }
+
+ d_main.commit_list_view.set_search_entry(value);
+ d_main.commit_list_view.set_enable_search(value != null);
+
+ d_main.commit_list_view.set_search_column(column);
+ }
+ }
+
+ public string search_text { owned get; set; default = ""; }
+ public bool search_visible { get; set; }
+ public bool search_enabled { get; set; }
}
}
diff --git a/libgitg-ext/gitg-ext-searchable.vala b/libgitg-ext/gitg-ext-searchable.vala
index ec3c761..fe59644 100644
--- a/libgitg-ext/gitg-ext-searchable.vala
+++ b/libgitg-ext/gitg-ext-searchable.vala
@@ -31,6 +31,7 @@ public interface Searchable : Object, Activity
public abstract string search_text { owned get; set; }
public abstract bool search_visible { get; set; }
public abstract bool search_enabled { get; set; }
+ public abstract Gtk.Entry? search_entry { set; }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]