[gitg/wip/guyou/path-filtering: 3/119] Initial implementation
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/guyou/path-filtering: 3/119] Initial implementation
- Date: Mon, 7 Jan 2019 11:45:22 +0000 (UTC)
commit fbf8a0936220b014bcbd1ea8c88b5593c7bd1034
Author: Guilhem Bonnefille <guilhem bonnefille gmail com>
Date: Thu Mar 26 14:19:01 2009 +0100
Initial implementation
gitg/gitg-ui.xml | 15 +++++++++++++++
gitg/gitg-window.c | 22 +++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
---
diff --git a/gitg/gitg-ui.xml b/gitg/gitg-ui.xml
index 9a06aeff..641290ce 100644
--- a/gitg/gitg-ui.xml
+++ b/gitg/gitg-ui.xml
@@ -224,6 +224,21 @@
<property name="expand">False</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label_path">
+ <property name="label" translatable="yes">Path:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_path">
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index c0645f0c..22446cfa 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -57,6 +57,7 @@ struct _GitgWindowPrivate
GitgCommitView *commit_view;
GtkWidget *search_popup;
GtkComboBox *combo_branches;
+ GtkEntry *entry_path;
GtkWidget *vpaned_main;
GtkWidget *hpaned_commit;
@@ -282,6 +283,22 @@ branches_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
return ret;
}
+static void
+on_path_activate(GtkEntry *entry, GitgWindow *window)
+{
+ gchar **args;
+ const gchar *path;
+
+ path = gtk_entry_get_text(window->priv->entry_path);
+
+ args = g_new(gchar*, 3);
+ args[0] = g_strdup("--all");
+ args[1] = g_strdup("--");
+ args[2] = g_strdup(path);
+ gitg_repository_load(window->priv->repository, 3, args, NULL);
+ /*g_strfreev(args);*/
+}
+
static void
on_branches_combo_changed(GtkComboBox *combo, GitgWindow *window)
{
@@ -372,6 +389,7 @@ gitg_window_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
window->priv->revision_view = GITG_REVISION_VIEW(gtk_builder_get_object(builder, "revision_view"));
window->priv->revision_tree_view = GITG_REVISION_TREE_VIEW(gtk_builder_get_object(builder,
"revision_tree_view"));
window->priv->commit_view = GITG_COMMIT_VIEW(gtk_builder_get_object(builder, "hpaned_commit"));
+ window->priv->entry_path = GTK_ENTRY(gtk_builder_get_object(builder, "entry_path"));
restore_state(window);
@@ -400,7 +418,9 @@ gitg_window_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
GtkTreeSelection *selection = gtk_tree_view_get_selection(window->priv->tree_view);
g_signal_connect(selection, "changed", G_CALLBACK(on_selection_changed), window);
g_signal_connect(window->priv->revision_view, "parent-activated", G_CALLBACK(on_parent_activated),
window);
-
+
+ g_signal_connect(window->priv->entry_path, "activate", G_CALLBACK(on_path_activate), window);
+
g_signal_connect(window->priv->tree_view, "motion-notify-event", G_CALLBACK(on_tree_view_motion),
window);
g_signal_connect(window->priv->tree_view, "button-release-event",
G_CALLBACK(on_tree_view_button_release), window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]