[gitg] Added configuration preferences and repository properties
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Subject: [gitg] Added configuration preferences and repository properties
- Date: Sun, 5 Jul 2009 01:12:39 +0000 (UTC)
commit 1215f49d58f2efc3a2e3614c2ad07abb35297f3a
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Jun 28 01:44:58 2009 +0200
Added configuration preferences and repository properties
This adds configuration for user name and email to the global preferences
(from the global git config). Per repository configuration has also been
added. In addition to user name and e-mail, remotes can now be
added/removed/fetched/renamed from the repository properties dialog.
gitg/Makefile.am | 9 +-
gitg/gitg-commit-menu.ui | 41 +
gitg/gitg-commit-view.c | 19 +-
gitg/gitg-config.c | 360 +++++++++
gitg/gitg-config.h | 42 +
gitg/gitg-preferences-dialog.c | 42 +-
gitg/{gitg-preferences.xml => gitg-preferences.ui} | 175 ++++-
gitg/gitg-repository-dialog.c | 765 ++++++++++++++++++
gitg/gitg-repository-dialog.h | 40 +
gitg/gitg-repository.ui | 305 +++++++
gitg/gitg-ui.xml | 828 +-------------------
gitg/gitg-window.c | 53 +-
gitg/gitg-window.h | 2 +
gitg/gitg-window.ui | 805 +++++++++++++++++++
gitg/gitg.c | 2 +-
15 files changed, 2624 insertions(+), 864 deletions(-)
---
diff --git a/gitg/Makefile.am b/gitg/Makefile.am
index f23c32d..c0ca9c0 100644
--- a/gitg/Makefile.am
+++ b/gitg/Makefile.am
@@ -18,6 +18,7 @@ NOINST_H_FILES = \
gitg-cell-renderer-path.h \
gitg-changed-file.h \
gitg-color.h \
+ gitg-config.h \
gitg-commit.h \
gitg-commit-view.h \
gitg-data-binding.h \
@@ -31,6 +32,7 @@ NOINST_H_FILES = \
gitg-preferences.h \
gitg-ref.h \
gitg-repository.h \
+ gitg-repository-dialog.h \
gitg-revision.h \
gitg-revision-tree-store.h \
gitg-revision-tree-view.h \
@@ -48,6 +50,7 @@ gitg_SOURCES = \
gitg-cell-renderer-path.c \
gitg-changed-file.c \
gitg-color.c \
+ gitg-config.c \
gitg-commit.c \
gitg-commit-view.c \
gitg-data-binding.c \
@@ -61,6 +64,7 @@ gitg_SOURCES = \
gitg-preferences-dialog.c \
gitg-ref.c \
gitg-repository.c \
+ gitg-repository-dialog.c \
gitg-revision.c \
gitg-revision-tree-store.c \
gitg-revision-tree-view.c \
@@ -80,9 +84,12 @@ gitg_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
uidir = $(datadir)/gitg/ui/
ui_DATA = \
+ gitg-window.ui \
+ gitg-commit-menu.ui \
gitg-ui.xml \
gitg-menus.xml \
- gitg-preferences.xml
+ gitg-preferences.ui \
+ gitg-repository.ui
gitg-enum-types.h: gitg-enum-types.h.template $(ENUM_H_FILES) $(GLIB_MKENUMS)
(cd $(srcdir) && $(GLIB_MKENUMS) --template gitg-enum-types.h.template $(ENUM_H_FILES)) > $@
diff --git a/gitg/gitg-commit-menu.ui b/gitg/gitg-commit-menu.ui
new file mode 100644
index 0000000..696c4ce
--- /dev/null
+++ b/gitg/gitg-commit-menu.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<interface>
+ <object class="GtkUIManager" id="uiman">
+ <child>
+ <object class="GtkActionGroup" id="action_group_commit_context">
+ <child>
+ <object class="GtkAction" id="StageChangesAction">
+ <property name="label" translatable="yes">Stage</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="UnstageChangesAction">
+ <property name="label" translatable="yes">Unstage</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="RevertChangesAction">
+ <property name="label" translatable="yes">Revert</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="IgnoreFileAction">
+ <property name="label" translatable="yes">Ignore</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <ui>
+ <popup name="popup_commit_stage">
+ <menuitem action="StageChangesAction"/>
+ <menuitem action="RevertChangesAction"/>
+ <menuitem action="IgnoreFileAction"/>
+ </popup>
+ <popup name="popup_commit_unstage">
+ <menuitem action="UnstageChangesAction"/>
+ </popup>
+ </ui>
+ </object>
+</interface>
+
+<!-- vi:ts=2:et -->
diff --git a/gitg/gitg-commit-view.c b/gitg/gitg-commit-view.c
index 86744ee..35aca78 100644
--- a/gitg/gitg-commit-view.c
+++ b/gitg/gitg-commit-view.c
@@ -912,7 +912,18 @@ gitg_commit_view_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
/* Store widgets */
GitgCommitView *self = GITG_COMMIT_VIEW(buildable);
- self->priv->ui_manager = g_object_ref(gtk_builder_get_object(builder, "uiman"));
+ GtkBuilder *b = gitg_utils_new_builder("gitg-commit-menu.ui");
+ self->priv->ui_manager = g_object_ref(gtk_builder_get_object(b, "uiman"));
+
+ g_signal_connect(gtk_builder_get_object(b, "StageChangesAction"), "activate", G_CALLBACK(on_stage_changes), self);
+ g_signal_connect(gtk_builder_get_object(b, "RevertChangesAction"), "activate", G_CALLBACK(on_revert_changes), self);
+ g_signal_connect(gtk_builder_get_object(b, "IgnoreFileAction"), "activate", G_CALLBACK(on_ignore_file), self);
+ g_signal_connect(gtk_builder_get_object(b, "UnstageChangesAction"), "activate", G_CALLBACK(on_unstage_changes), self);
+
+ self->priv->group_context = GTK_ACTION_GROUP(gtk_builder_get_object(b, "action_group_commit_context"));
+
+ g_object_unref(b);
+
self->priv->tree_view_unstaged = GTK_TREE_VIEW(gtk_builder_get_object(builder, "tree_view_unstaged"));
self->priv->tree_view_staged = GTK_TREE_VIEW(gtk_builder_get_object(builder, "tree_view_staged"));
@@ -935,7 +946,6 @@ gitg_commit_view_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
self->priv->comment_view, "right-margin-position");
self->priv->hscale_context = GTK_HSCALE(gtk_builder_get_object(builder, "hscale_context"));
- self->priv->group_context = GTK_ACTION_GROUP(gtk_builder_get_object(builder, "action_group_commit_context"));
initialize_dnd_staged(self);
initialize_dnd_unstaged(self);
@@ -993,11 +1003,6 @@ gitg_commit_view_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
g_signal_connect(gtk_builder_get_object(builder, "button_commit"), "clicked", G_CALLBACK(on_commit_clicked), self);
g_signal_connect(self->priv->hscale_context, "value-changed", G_CALLBACK(on_context_value_changed), self);
-
- g_signal_connect(gtk_builder_get_object(builder, "StageChangesAction"), "activate", G_CALLBACK(on_stage_changes), self);
- g_signal_connect(gtk_builder_get_object(builder, "RevertChangesAction"), "activate", G_CALLBACK(on_revert_changes), self);
- g_signal_connect(gtk_builder_get_object(builder, "IgnoreFileAction"), "activate", G_CALLBACK(on_ignore_file), self);
- g_signal_connect(gtk_builder_get_object(builder, "UnstageChangesAction"), "activate", G_CALLBACK(on_unstage_changes), self);
}
static void
diff --git a/gitg/gitg-config.c b/gitg/gitg-config.c
new file mode 100644
index 0000000..518bec8
--- /dev/null
+++ b/gitg/gitg-config.c
@@ -0,0 +1,360 @@
+#include "gitg-config.h"
+
+
+#define GITG_CONFIG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GITG_TYPE_CONFIG, GitgConfigPrivate))
+
+enum
+{
+ PROP_0,
+ PROP_REPOSITORY
+};
+
+struct _GitgConfigPrivate
+{
+ GitgRepository *repository;
+ GitgRunner *runner;
+
+ GString *accumulated;
+};
+
+G_DEFINE_TYPE (GitgConfig, gitg_config, G_TYPE_OBJECT)
+
+static void
+gitg_config_finalize (GObject *object)
+{
+ GitgConfig *config = GITG_CONFIG (object);
+
+ if (config->priv->repository)
+ {
+ g_object_unref(config->priv->repository);
+ }
+
+ g_string_free (config->priv->accumulated, TRUE);
+
+ G_OBJECT_CLASS (gitg_config_parent_class)->finalize (object);
+}
+
+static void
+gitg_config_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ GitgConfig *self = GITG_CONFIG (object);
+
+ switch (prop_id)
+ {
+ case PROP_REPOSITORY:
+ if (self->priv->repository)
+ {
+ g_object_unref(self->priv->repository);
+ }
+
+ self->priv->repository = GITG_REPOSITORY (g_value_dup_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gitg_config_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ GitgConfig *self = GITG_CONFIG (object);
+
+ switch (prop_id)
+ {
+ case PROP_REPOSITORY:
+ g_value_set_object (value, self->priv->repository);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gitg_config_class_init (GitgConfigClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gitg_config_finalize;
+ object_class->get_property = gitg_config_get_property;
+ object_class->set_property = gitg_config_set_property;
+
+ g_object_class_install_property(object_class, PROP_REPOSITORY,
+ g_param_spec_object("repository",
+ "REPOSITORY",
+ "The repository",
+ GITG_TYPE_REPOSITORY,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_type_class_add_private (object_class, sizeof(GitgConfigPrivate));
+}
+
+static void
+gitg_config_accumulate (GitgRunner *runner, gchar **buffer, GitgConfig *config)
+{
+ gchar **ptr = buffer;
+
+ while (*ptr)
+ {
+ if (config->priv->accumulated->len != 0)
+ {
+ g_string_append_c (config->priv->accumulated, '\n');
+ }
+
+ g_string_append (config->priv->accumulated, *ptr);
+ ++ptr;
+ }
+}
+
+static void
+gitg_config_begin_loading (GitgRunner *runner, GitgConfig *config)
+{
+ g_string_erase (config->priv->accumulated, 0, -1);
+}
+
+static void
+gitg_config_init (GitgConfig *self)
+{
+ self->priv = GITG_CONFIG_GET_PRIVATE (self);
+
+ self->priv->runner = gitg_runner_new_synchronized (1000);
+
+ self->priv->accumulated = g_string_new ("");
+
+ g_signal_connect (self->priv->runner,
+ "update",
+ G_CALLBACK (gitg_config_accumulate),
+ self);
+
+ g_signal_connect (self->priv->runner,
+ "begin-loading",
+ G_CALLBACK (gitg_config_begin_loading),
+ self);
+}
+
+GitgConfig *
+gitg_config_new (GitgRepository *repository)
+{
+ return g_object_new (GITG_TYPE_CONFIG, "repository", repository, NULL);
+}
+
+static gchar *
+get_value_process (GitgConfig *config, gboolean ret)
+{
+ gchar *res;
+
+ if (ret)
+ {
+ res = g_strndup (config->priv->accumulated->str, config->priv->accumulated->len);
+ }
+ else
+ {
+ res = NULL;
+ }
+
+ return res;
+}
+
+static gchar *
+get_value_global (GitgConfig *config, gchar const *key)
+{
+ gchar const *argv[] = {
+ "git",
+ "config",
+ "--global",
+ key,
+ NULL
+ };
+
+ gboolean ret = gitg_runner_run (config->priv->runner, argv, NULL);
+ return get_value_process (config, ret);
+}
+
+static gchar *
+get_value_global_regex (GitgConfig *config, gchar const *regex)
+{
+ gchar const *argv[] = {
+ "git",
+ "config",
+ "--global",
+ "--get-regexp",
+ regex,
+ NULL
+ };
+
+ gboolean ret = gitg_runner_run (config->priv->runner, argv, NULL);
+ return get_value_process (config, ret);
+}
+
+static gchar *
+get_value_local (GitgConfig *config, gchar const *key)
+{
+ gboolean ret;
+ gchar const *path = gitg_repository_get_path (config->priv->repository);
+ gchar *cfg = g_build_filename (path, ".git", "config", NULL);
+
+ ret = gitg_repository_run_commandv (config->priv->repository,
+ config->priv->runner,
+ NULL,
+ "config",
+ "--file",
+ cfg,
+ key,
+ NULL);
+ g_free (cfg);
+
+ return get_value_process (config, ret);
+}
+
+static gchar *
+get_value_local_regex (GitgConfig *config, gchar const *regex)
+{
+ gboolean ret;
+ gchar const *path = gitg_repository_get_path (config->priv->repository);
+ gchar *cfg = g_build_filename (path, ".git", "config", NULL);
+
+ ret = gitg_repository_run_commandv (config->priv->repository,
+ config->priv->runner,
+ NULL,
+ "config",
+ "--file",
+ cfg,
+ "--get-regexp",
+ regex,
+ NULL);
+ g_free (cfg);
+
+ return get_value_process (config, ret);
+}
+
+static gboolean
+set_value_global (GitgConfig *config, gchar const *key, gchar const *value)
+{
+ gchar const *argv[] = {
+ "git",
+ "config",
+ "--global",
+ value == NULL ? "--unset" : key,
+ value == NULL ? key : value,
+ NULL
+ };
+
+ return gitg_runner_run (config->priv->runner, argv, NULL);
+}
+
+static gboolean
+set_value_local (GitgConfig *config, gchar const *key, gchar const *value)
+{
+ gchar const *path = gitg_repository_get_path (config->priv->repository);
+ gchar *cfg = g_build_filename (path, ".git", "config", NULL);
+
+ return gitg_repository_run_commandv (config->priv->repository,
+ config->priv->runner,
+ NULL,
+ "config",
+ "--file",
+ cfg,
+ value == NULL ? "--unset" : key,
+ value == NULL ? key : value,
+ NULL);
+}
+
+static gboolean
+rename_global (GitgConfig *config, gchar const *old, gchar const *nw)
+{
+ gchar const *argv[] = {
+ "git",
+ "config",
+ "--global",
+ "--rename-section",
+ old,
+ nw,
+ NULL
+ };
+
+ return gitg_runner_run (config->priv->runner, argv, NULL);
+}
+
+static gboolean
+rename_local (GitgConfig *config, gchar const *old, gchar const *nw)
+{
+ gchar const *path = gitg_repository_get_path (config->priv->repository);
+ gchar *cfg = g_build_filename (path, ".git", "config", NULL);
+
+ return gitg_repository_run_commandv (config->priv->repository,
+ config->priv->runner,
+ NULL,
+ "config",
+ "--file",
+ cfg,
+ "--rename-section",
+ old,
+ nw,
+ NULL);
+}
+
+gchar *
+gitg_config_get_value (GitgConfig *config, gchar const *key)
+{
+ g_return_val_if_fail (GITG_IS_CONFIG (config), NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ if (config->priv->repository != NULL)
+ {
+ return get_value_local (config, key);
+ }
+ else
+ {
+ return get_value_global (config, key);
+ }
+}
+
+gchar *
+gitg_config_get_value_regex (GitgConfig *config, gchar const *regex)
+{
+ g_return_val_if_fail (GITG_IS_CONFIG (config), NULL);
+ g_return_val_if_fail (regex != NULL, NULL);
+
+ if (config->priv->repository != NULL)
+ {
+ return get_value_local_regex (config, regex);
+ }
+ else
+ {
+ return get_value_global_regex (config, regex);
+ }
+}
+
+gboolean
+gitg_config_set_value (GitgConfig *config, gchar const *key, gchar const *value)
+{
+ g_return_val_if_fail (GITG_IS_CONFIG (config), FALSE);
+ g_return_val_if_fail (key != NULL, FALSE);
+
+ if (config->priv->repository != NULL)
+ {
+ return set_value_local (config, key, value);
+ }
+ else
+ {
+ return set_value_global (config, key, value);
+ }
+}
+
+gboolean
+gitg_config_rename (GitgConfig *config, gchar const *old, gchar const *nw)
+{
+ g_return_val_if_fail (GITG_IS_CONFIG (config), FALSE);
+ g_return_val_if_fail (old != NULL, FALSE);
+ g_return_val_if_fail (nw != NULL, FALSE);
+
+ if (config->priv->repository != NULL)
+ {
+ return rename_local (config, old, nw);
+ }
+ else
+ {
+ return rename_global (config, old, nw);
+ }
+}
diff --git a/gitg/gitg-config.h b/gitg/gitg-config.h
new file mode 100644
index 0000000..591860e
--- /dev/null
+++ b/gitg/gitg-config.h
@@ -0,0 +1,42 @@
+#ifndef __GITG_CONFIG_H__
+#define __GITG_CONFIG_H__
+
+#include <glib-object.h>
+#include "gitg-repository.h"
+
+G_BEGIN_DECLS
+
+#define GITG_TYPE_CONFIG (gitg_config_get_type ())
+#define GITG_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_CONFIG, GitgConfig))
+#define GITG_CONFIG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_CONFIG, GitgConfig const))
+#define GITG_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_CONFIG, GitgConfigClass))
+#define GITG_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_CONFIG))
+#define GITG_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_CONFIG))
+#define GITG_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_CONFIG, GitgConfigClass))
+
+typedef struct _GitgConfig GitgConfig;
+typedef struct _GitgConfigClass GitgConfigClass;
+typedef struct _GitgConfigPrivate GitgConfigPrivate;
+
+struct _GitgConfig {
+ GObject parent;
+
+ GitgConfigPrivate *priv;
+};
+
+struct _GitgConfigClass {
+ GObjectClass parent_class;
+};
+
+GType gitg_config_get_type (void) G_GNUC_CONST;
+GitgConfig *gitg_config_new (GitgRepository *repository);
+
+gchar *gitg_config_get_value (GitgConfig *config, gchar const *key);
+gchar *gitg_config_get_value_regex (GitgConfig *config, gchar const *regex);
+
+gboolean gitg_config_rename (GitgConfig *config, gchar const *old, gchar const *nw);
+gboolean gitg_config_set_value (GitgConfig *config, gchar const *key, gchar const *value);
+
+G_END_DECLS
+
+#endif /* __GITG_CONFIG_H__ */
diff --git a/gitg/gitg-preferences-dialog.c b/gitg/gitg-preferences-dialog.c
index 4dd72b2..20f5c5b 100644
--- a/gitg/gitg-preferences-dialog.c
+++ b/gitg/gitg-preferences-dialog.c
@@ -25,6 +25,7 @@
#include "gitg-preferences.h"
#include "gitg-data-binding.h"
#include "gitg-utils.h"
+#include "gitg-config.h"
#include <stdlib.h>
#include <glib/gi18n.h>
@@ -42,6 +43,8 @@ static GitgPreferencesDialog *preferences_dialog;
struct _GitgPreferencesDialogPrivate
{
+ GitgConfig *config;
+
GtkCheckButton *history_search_filter;
GtkAdjustment *collapse_inactive_lanes;
GtkCheckButton *history_show_virtual_stash;
@@ -53,6 +56,9 @@ struct _GitgPreferencesDialogPrivate
GtkLabel *label_right_margin;
GtkSpinButton *spin_button_right_margin;
+ GtkEntry *entry_configuration_user_name;
+ GtkEntry *entry_configuration_user_email;
+
GtkWidget *table;
gint prev_value;
@@ -71,6 +77,10 @@ round_val(gdouble val)
static void
gitg_preferences_dialog_finalize(GObject *object)
{
+ GitgPreferencesDialog *dialog = GITG_PREFERENCES_DIALOG (object);
+
+ g_object_unref (dialog->priv->config);
+
G_OBJECT_CLASS(gitg_preferences_dialog_parent_class)->finalize(object);
}
@@ -88,6 +98,8 @@ static void
gitg_preferences_dialog_init(GitgPreferencesDialog *self)
{
self->priv = GITG_PREFERENCES_DIALOG_GET_PRIVATE(self);
+
+ self->priv->config = gitg_config_new (NULL);
}
static void
@@ -188,7 +200,7 @@ initialize_view(GitgPreferencesDialog *dialog)
static void
create_preferences_dialog()
{
- GtkBuilder *b = gitg_utils_new_builder("gitg-preferences.xml");
+ GtkBuilder *b = gitg_utils_new_builder("gitg-preferences.ui");
preferences_dialog = GITG_PREFERENCES_DIALOG(gtk_builder_get_object(b, "dialog_preferences"));
g_object_add_weak_pointer(G_OBJECT(preferences_dialog), (gpointer *)&preferences_dialog);
@@ -213,9 +225,22 @@ create_preferences_dialog()
g_signal_connect(preferences_dialog, "response", G_CALLBACK(on_response), NULL);
initialize_view(preferences_dialog);
+
+ priv->entry_configuration_user_name = GTK_ENTRY(gtk_builder_get_object(b, "entry_configuration_user_name"));
+ priv->entry_configuration_user_email = GTK_ENTRY(gtk_builder_get_object(b, "entry_configuration_user_email"));
gtk_builder_connect_signals(b, preferences_dialog);
g_object_unref(b);
+
+ gchar *val;
+
+ val = gitg_config_get_value (priv->config, "user.name");
+ gtk_entry_set_text (priv->entry_configuration_user_name, val ? val : "");
+ g_free (val);
+
+ val = gitg_config_get_value (priv->config, "user.email");
+ gtk_entry_set_text (priv->entry_configuration_user_email, val ? val : "");
+ g_free (val);
}
GitgPreferencesDialog *
@@ -242,3 +267,18 @@ on_collapse_inactive_lanes_changed(GtkAdjustment *adjustment, GParamSpec *spec,
g_signal_handlers_unblock_by_func(adjustment, G_CALLBACK(on_collapse_inactive_lanes_changed), dialog);
}
}
+
+gboolean
+on_entry_configuration_user_name_focus_out_event(GtkEntry *entry, GdkEventFocus *event, GitgPreferencesDialog *dialog)
+{
+ gitg_config_set_value (dialog->priv->config, "user.name", gtk_entry_get_text (entry));
+ return FALSE;
+}
+
+gboolean
+on_entry_configuration_user_email_focus_out_event(GtkEntry *entry, GdkEventFocus *event, GitgPreferencesDialog *dialog)
+{
+ gitg_config_set_value (dialog->priv->config, "user.email", gtk_entry_get_text (entry));
+ return FALSE;
+}
+
diff --git a/gitg/gitg-preferences.xml b/gitg/gitg-preferences.ui
similarity index 73%
rename from gitg/gitg-preferences.xml
rename to gitg/gitg-preferences.ui
index ad89ad9..d19c884 100644
--- a/gitg/gitg-preferences.xml
+++ b/gitg/gitg-preferences.ui
@@ -1,21 +1,22 @@
<?xml version="1.0"?>
<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-requires gitg 0.2 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment_collapse_inactive_lanes">
<property name="value">2</property>
- <property name="lower">0</property>
<property name="upper">5</property>
<property name="step_increment">1</property>
<property name="page_increment">1</property>
<property name="page_size">1</property>
- <signal after="False" name="notify::value" handler="on_collapse_inactive_lanes_changed"/>
+ <signal name="notify::value" handler="on_collapse_inactive_lanes_changed"/>
</object>
<object class="GtkAdjustment" id="spin_button_right_margin_adjustment">
- <property name="upper">160</property>
+ <property name="value">72</property>
<property name="lower">1</property>
- <property name="page_increment">10</property>
+ <property name="upper">160</property>
<property name="step_increment">1</property>
- <property name="page_size">0</property>
- <property name="value">72</property>
+ <property name="page_increment">10</property>
</object>
<object class="GitgPreferencesDialog" id="dialog_preferences">
<property name="border_width">5</property>
@@ -74,7 +75,6 @@
<child>
<object class="GtkCheckButton" id="check_button_history_search_filter">
<property name="label" translatable="yes">Search filters revisions in the history view</property>
- <property name="visible">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
@@ -89,8 +89,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
<property name="active">True</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">1</property>
@@ -108,11 +108,10 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">adjustment_collapse_inactive_lanes</property>
- <property name="draw_value">False</property>
<property name="digits">0</property>
+ <property name="draw_value">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
<property name="right_attach">2</property>
</packing>
</child>
@@ -123,8 +122,6 @@
<property name="label" translatable="yes">Early</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
@@ -184,7 +181,6 @@
<child>
<object class="GtkCheckButton" id="check_button_history_show_virtual_unstaged">
<property name="label" translatable="yes">Show unstaged changes in history</property>
- <property name="visible">true</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
@@ -214,6 +210,7 @@
<child type="tab">
<object class="GtkLabel" id="label_view">
<property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Preferences that apply to the revision view</property>
<property name="label" translatable="yes">View</property>
</object>
<packing>
@@ -230,7 +227,7 @@
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label10">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes"><b>Commit Message</b></property>
@@ -245,7 +242,7 @@
<object class="GtkHBox" id="hbox_commit_message">
<property name="visible">True</property>
<child>
- <object class="GtkLabel" id="label12">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label"> </property>
</object>
@@ -262,12 +259,12 @@
<child>
<object class="GtkCheckButton" id="check_button_show_right_margin">
<property name="label" translatable="yes">Display right _margin</property>
- <property name="use_underline">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="use_underline">True</property>
<property name="active">True</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">0</property>
@@ -280,42 +277,35 @@
<child>
<object class="GtkLabel" id="label_right_margin">
<property name="visible">True</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">_Right margin at column:</property>
<property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
</object>
<packing>
- <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spin_button_right_margin">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="adjustment">spin_button_right_margin_adjustment</property>
<property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">True</property>
- <property name="wrap">False</property>
- <property name="adjustment">spin_button_right_margin_adjustment</property>
+ <property name="numeric">True</property>
</object>
<packing>
- <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
@@ -334,13 +324,132 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label_commit">
<property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Preferences that apply to the commit view</property>
<property name="label" translatable="yes">Commit</property>
</object>
<packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_commit_intern1">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>User</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_commit_message1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label_configuration_user_name">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_configuration_user_email">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">E-mail:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_configuration_user_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="focus_out_event" handler="on_entry_configuration_user_name_focus_out_event"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_configuration_user_email">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="focus_out_event" handler="on_entry_configuration_user_email_focus_out_event"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Configure global git settings. This corresponds to the settings as stored in ~/.gitconfig. Repository specific settings can be configured at the repository properties.</property>
+ <property name="label" translatable="yes">Configuration</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
@@ -362,6 +471,8 @@
<property name="use_stock">True</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
diff --git a/gitg/gitg-repository-dialog.c b/gitg/gitg-repository-dialog.c
new file mode 100644
index 0000000..aea8b5c
--- /dev/null
+++ b/gitg/gitg-repository-dialog.c
@@ -0,0 +1,765 @@
+#include <glib/gi18n.h>
+
+#include "gitg-repository-dialog.h"
+#include "gitg-utils.h"
+#include "gitg-config.h"
+
+#define GITG_REPOSITORY_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GITG_TYPE_REPOSITORY_DIALOG, GitgRepositoryDialogPrivate))
+
+static GitgRepositoryDialog *repository_dialog = NULL;
+
+enum
+{
+ COLUMN_NAME,
+ COLUMN_URL,
+ COLUMN_FETCH
+};
+
+struct _GitgRepositoryDialogPrivate
+{
+ GitgRepository *repository;
+ GitgConfig *config;
+
+ GtkEntry *entry_repository_user_name;
+ GtkEntry *entry_repository_user_email;
+
+ GtkTreeView *tree_view_remotes;
+ GtkListStore *list_store_remotes;
+
+ GtkButton *button_remove_remote;
+ GtkButton *button_fetch_remote;
+ GtkImage *image_fetch_remote;
+
+ GList *fetchers;
+ gboolean show_fetch;
+};
+
+G_DEFINE_TYPE (GitgRepositoryDialog, gitg_repository_dialog, GTK_TYPE_DIALOG)
+
+typedef struct
+{
+ GitgRepositoryDialog *dialog;
+ GitgRunner *runner;
+ GtkTreeRowReference *reference;
+
+ guint timeout_id;
+} FetchInfo;
+
+static void
+fetch_cleanup (FetchInfo *info)
+{
+ if (info->timeout_id)
+ {
+ g_source_remove (info->timeout_id);
+ }
+
+ info->dialog->priv->fetchers = g_list_remove (info->dialog->priv->fetchers, info);
+
+ if (gtk_tree_row_reference_valid (info->reference))
+ {
+ GtkTreeIter iter;
+ GtkTreePath *path = gtk_tree_row_reference_get_path (info->reference);
+
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (info->dialog->priv->list_store_remotes),
+ &iter,
+ path);
+
+ gtk_list_store_set (info->dialog->priv->list_store_remotes,
+ &iter,
+ COLUMN_FETCH, G_MAXULONG,
+ -1);
+
+ gtk_tree_path_free (path);
+ }
+
+ gtk_tree_row_reference_free (info->reference);
+ g_object_unref (info->runner);
+
+ g_slice_free (FetchInfo, info);
+}
+
+static void
+gitg_repository_dialog_finalize (GObject *object)
+{
+ GitgRepositoryDialog *dialog = GITG_REPOSITORY_DIALOG (object);
+
+ if (dialog->priv->repository)
+ {
+ g_object_unref (dialog->priv->repository);
+ }
+
+ if (dialog->priv->config)
+ {
+ g_object_unref (dialog->priv->config);
+ }
+
+ GList *copy = g_list_copy (dialog->priv->fetchers);
+ GList *item;
+
+ for (item = copy; item; item = g_list_next (item))
+ {
+ gitg_runner_cancel (((FetchInfo *)item->data)->runner);
+ }
+
+ g_list_free (copy);
+ g_list_foreach (dialog->priv->fetchers, (GFunc)fetch_cleanup, NULL);
+
+ G_OBJECT_CLASS (gitg_repository_dialog_parent_class)->finalize (object);
+}
+
+static void
+gitg_repository_dialog_class_init (GitgRepositoryDialogClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gitg_repository_dialog_finalize;
+
+ g_type_class_add_private (object_class, sizeof(GitgRepositoryDialogPrivate));
+}
+
+static void
+gitg_repository_dialog_init (GitgRepositoryDialog *self)
+{
+ self->priv = GITG_REPOSITORY_DIALOG_GET_PRIVATE (self);
+}
+
+static void
+on_response(GtkWidget *dialog, gint response, gpointer data)
+{
+ gtk_widget_destroy(dialog);
+}
+
+static void
+update_fetch (GitgRepositoryDialog *dialog)
+{
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (dialog->priv->tree_view_remotes);
+ GList *rows;
+ GtkTreeModel *model;
+
+ rows = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ GList *item;
+ gboolean show_fetch = FALSE;
+
+ for (item = rows; item; item = g_list_next (item))
+ {
+ GtkTreePath *path = (GtkTreePath *)item->data;
+ GtkTreeIter iter;
+ guint num;
+
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, COLUMN_FETCH, &num, -1);
+
+ if (num == G_MAXULONG)
+ {
+ show_fetch = TRUE;
+ }
+ }
+
+ if (!rows)
+ {
+ show_fetch = TRUE;
+ }
+
+ if (show_fetch)
+ {
+ gtk_image_set_from_stock (dialog->priv->image_fetch_remote, GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_label (dialog->priv->button_fetch_remote, _("Fetch"));
+ }
+ else
+ {
+ gtk_image_set_from_stock (dialog->priv->image_fetch_remote, GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_label (dialog->priv->button_fetch_remote, _("Cancel"));
+ }
+
+ dialog->priv->show_fetch = show_fetch;
+
+ g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
+ g_list_free (rows);
+}
+
+static void
+update_sensitivity (GitgRepositoryDialog *dialog)
+{
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (dialog->priv->tree_view_remotes);
+ GList *rows;
+ GtkTreeModel *model;
+
+ rows = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ gtk_widget_set_sensitive (GTK_WIDGET (dialog->priv->button_remove_remote), rows != NULL);
+ gtk_widget_set_sensitive (GTK_WIDGET (dialog->priv->button_fetch_remote), rows != NULL);
+
+ update_fetch (dialog);
+
+ g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
+ g_list_free (rows);
+}
+
+static void
+add_remote (GitgRepositoryDialog *dialog, gchar const *name, gchar const *url, GtkTreeIter *iter)
+{
+ GtkTreeIter it;
+
+ gtk_list_store_append (dialog->priv->list_store_remotes, iter ? iter : &it);
+ gtk_list_store_set (dialog->priv->list_store_remotes,
+ iter ? iter : &it,
+ COLUMN_NAME, name,
+ COLUMN_URL, url,
+ COLUMN_FETCH, G_MAXULONG,
+ -1);
+}
+
+static gboolean
+fetch_timeout_cb (FetchInfo *info)
+{
+ GtkTreeIter iter;
+ GtkTreePath *path = gtk_tree_row_reference_get_path (info->reference);
+ GtkTreeModel *model = GTK_TREE_MODEL (info->dialog->priv->list_store_remotes);
+ guint num;
+
+ gtk_tree_model_get_iter (model,
+ &iter,
+ path);
+
+ gtk_tree_model_get (model, &iter, COLUMN_FETCH, &num, -1);
+ gtk_list_store_set (info->dialog->priv->list_store_remotes,
+ &iter,
+ COLUMN_FETCH, num + 1,
+ -1);
+
+ return TRUE;
+}
+
+static void
+on_fetch_begin_loading (GitgRunner *runner, FetchInfo *info)
+{
+ GtkTreeIter iter;
+ GtkTreePath *path = gtk_tree_row_reference_get_path (info->reference);
+
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (info->dialog->priv->list_store_remotes),
+ &iter,
+ path);
+
+ gtk_list_store_set (info->dialog->priv->list_store_remotes,
+ &iter,
+ COLUMN_FETCH, 0,
+ -1);
+
+ gtk_tree_path_free (path);
+
+ info->timeout_id = g_timeout_add (100, (GSourceFunc)fetch_timeout_cb, info);
+}
+
+static void
+on_fetch_end_loading (GitgRunner *runner, gboolean cancelled, FetchInfo *info)
+{
+ if (cancelled || !gtk_tree_row_reference_valid (info->reference))
+ {
+ fetch_cleanup (info);
+ return;
+ }
+
+ GitgRepositoryDialog *dialog = info->dialog;
+ fetch_cleanup (info);
+
+ update_fetch (dialog);
+ gitg_repository_reload (dialog->priv->repository);
+}
+
+static void
+fetch_remote (GitgRepositoryDialog *dialog, GtkTreeIter *iter)
+{
+ GitgRunner *runner = gitg_runner_new (1000);
+ FetchInfo *info = g_slice_new (FetchInfo);
+ GtkTreeModel *model = GTK_TREE_MODEL (dialog->priv->list_store_remotes);
+
+ GtkTreePath *path = gtk_tree_model_get_path (model, iter);
+
+ info->dialog = dialog;
+ info->reference = gtk_tree_row_reference_new (model, path);
+ info->timeout_id = 0;
+ info->runner = runner;
+
+ gtk_tree_path_free (path);
+
+ g_signal_connect (runner,
+ "begin-loading",
+ G_CALLBACK (on_fetch_begin_loading),
+ info);
+
+ g_signal_connect (runner,
+ "end-loading",
+ G_CALLBACK (on_fetch_end_loading),
+ info);
+
+ dialog->priv->fetchers = g_list_prepend (dialog->priv->fetchers, info);
+
+ gchar *name;
+ gtk_tree_model_get (model, iter, COLUMN_NAME, &name, -1);
+
+ gitg_repository_run_commandv (dialog->priv->repository,
+ runner,
+ NULL,
+ "fetch",
+ name,
+ NULL);
+
+ g_free (name);
+}
+
+static void
+on_selection_changed (GtkTreeSelection *selection, GitgRepositoryDialog *dialog)
+{
+ update_sensitivity (dialog);
+}
+
+static void
+init_remotes(GitgRepositoryDialog *dialog)
+{
+ gchar *ret = gitg_config_get_value_regex (dialog->priv->config, "remote\\..*\\.url");
+
+ if (!ret)
+ {
+ return;
+ }
+
+ gchar **lines = g_strsplit(ret, "\n", -1);
+ gchar **ptr = lines;
+
+ GRegex *regex = g_regex_new ("remote\\.(.+?)\\.url\\s+(.*)", 0, 0, NULL);
+
+ while (*ptr)
+ {
+ GMatchInfo *info = NULL;
+
+ if (g_regex_match (regex, *ptr, 0, &info))
+ {
+ gchar *name = g_match_info_fetch (info, 1);
+ gchar *url = g_match_info_fetch (info, 2);
+
+ add_remote (dialog, name, url, NULL);
+
+ g_free (name);
+ g_free (url);
+ }
+
+ g_match_info_free (info);
+ ++ptr;
+ }
+
+ g_regex_unref (regex);
+ g_strfreev (lines);
+ g_free (ret);
+
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection (dialog->priv->tree_view_remotes);
+
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+ g_signal_connect (selection, "changed", G_CALLBACK (on_selection_changed), dialog);
+
+ update_sensitivity (dialog);
+}
+
+static void
+init_properties(GitgRepositoryDialog *dialog)
+{
+ gchar *val;
+
+ val = gitg_config_get_value (dialog->priv->config, "user.name");
+ gtk_entry_set_text (dialog->priv->entry_repository_user_name, val ? val : "");
+ g_free (val);
+
+ val = gitg_config_get_value (dialog->priv->config, "user.email");
+ gtk_entry_set_text (dialog->priv->entry_repository_user_email, val ? val : "");
+ g_free (val);
+
+ init_remotes(dialog);
+}
+
+static void
+fetch_data_cb (GtkTreeViewColumn *column, GtkCellRendererProgress *cell, GtkTreeModel *model, GtkTreeIter *iter, GitgRepositoryDialog *dialog)
+{
+ guint num;
+
+ gtk_tree_model_get (model, iter, COLUMN_FETCH, &num, -1);
+
+ g_object_set (cell,
+ "pulse", num,
+ "visible", num != G_MAXULONG,
+ "xalign", 1.0,
+ NULL);
+}
+
+static void
+create_repository_dialog (GitgWindow *window)
+{
+ GitgRepository *repository = gitg_window_get_repository (window);
+
+ if (!repository)
+ {
+ return;
+ }
+
+ GtkBuilder *b = gitg_utils_new_builder("gitg-repository.ui");
+
+ repository_dialog = GITG_REPOSITORY_DIALOG(gtk_builder_get_object(b, "dialog_repository"));
+ g_object_add_weak_pointer(G_OBJECT(repository_dialog), (gpointer *)&repository_dialog);
+
+ repository_dialog->priv->repository = g_object_ref (repository);
+ repository_dialog->priv->config = gitg_config_new (repository);
+
+ repository_dialog->priv->entry_repository_user_name = GTK_ENTRY(gtk_builder_get_object(b, "entry_repository_user_name"));
+ repository_dialog->priv->entry_repository_user_email = GTK_ENTRY(gtk_builder_get_object(b, "entry_repository_user_email"));
+
+ repository_dialog->priv->tree_view_remotes = GTK_TREE_VIEW(gtk_builder_get_object(b, "tree_view_remotes"));
+ repository_dialog->priv->list_store_remotes = GTK_LIST_STORE(gtk_builder_get_object(b, "list_store_remotes"));
+
+ repository_dialog->priv->button_remove_remote = GTK_BUTTON(gtk_builder_get_object(b, "button_remove_remote"));
+ repository_dialog->priv->button_fetch_remote = GTK_BUTTON(gtk_builder_get_object(b, "button_fetch_remote"));
+ repository_dialog->priv->image_fetch_remote = GTK_IMAGE(gtk_builder_get_object(b, "image_fetch_remote"));
+
+ GtkCellRenderer *renderer = gtk_cell_renderer_progress_new ();
+
+ GObject *column = gtk_builder_get_object (b, "tree_view_remotes_column_url");
+ gtk_tree_view_column_pack_end (GTK_TREE_VIEW_COLUMN (column), renderer, TRUE);
+
+ gtk_tree_view_column_set_cell_data_func (GTK_TREE_VIEW_COLUMN (column),
+ renderer,
+ (GtkTreeCellDataFunc)fetch_data_cb,
+ repository_dialog,
+ NULL);
+
+ gtk_builder_connect_signals(b, repository_dialog);
+ g_object_unref (b);
+
+ gchar *basename = g_path_get_basename(gitg_repository_get_path(repository));
+ gchar *title = g_strdup_printf("%s - %s", _("Properties"), basename);
+
+ gtk_window_set_title(GTK_WINDOW(repository_dialog), title);
+ g_free (title);
+ g_free (basename);
+
+ g_signal_connect(repository_dialog, "response", G_CALLBACK(on_response), NULL);
+
+ init_properties(repository_dialog);
+}
+
+GitgRepositoryDialog *
+gitg_repository_dialog_present(GitgWindow *window)
+{
+ if (!repository_dialog)
+ create_repository_dialog(window);
+
+ gtk_window_set_transient_for(GTK_WINDOW(repository_dialog), GTK_WINDOW (window));
+ gtk_window_present(GTK_WINDOW(repository_dialog));
+
+ return repository_dialog;
+}
+
+void
+gitg_repository_dialog_close ()
+{
+ if (repository_dialog)
+ {
+ gtk_widget_destroy (GTK_WIDGET (repository_dialog));
+ }
+}
+
+static void
+fetch_remote_cancel (GitgRepositoryDialog *dialog, GtkTreeIter *iter)
+{
+ GList *item;
+ GtkTreePath *orig;
+ GtkTreeModel *model = GTK_TREE_MODEL (dialog->priv->list_store_remotes);
+
+ orig = gtk_tree_model_get_path (model, iter);
+
+ for (item = dialog->priv->fetchers; item; item = g_list_next (item))
+ {
+ FetchInfo *info = (FetchInfo *)item->data;
+ GtkTreePath *ref = gtk_tree_row_reference_get_path (info->reference);
+ gboolean equal = gtk_tree_path_compare (orig, ref) == 0;
+
+ gtk_tree_path_free (ref);
+
+ if (equal)
+ {
+ gitg_runner_cancel (info->runner);
+ break;
+ }
+ }
+
+ gtk_tree_path_free (orig);
+}
+
+void
+on_button_fetch_remote_clicked (GtkButton *button, GitgRepositoryDialog *dialog)
+{
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+
+ selection = gtk_tree_view_get_selection (dialog->priv->tree_view_remotes);
+
+ GList *rows = gtk_tree_selection_get_selected_rows (selection, &model);
+ GList *item;
+
+ for (item = rows; item; item = g_list_next (item))
+ {
+ GtkTreePath *path = (GtkTreePath *)item->data;
+ GtkTreeIter iter;
+ guint num;
+
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, COLUMN_FETCH, &num, -1);
+
+ if (num == G_MAXULONG && dialog->priv->show_fetch)
+ {
+ fetch_remote (dialog, &iter);
+ }
+ else if (num != G_MAXULONG && !dialog->priv->show_fetch)
+ {
+ fetch_remote_cancel (dialog, &iter);
+ }
+
+ gtk_tree_path_free (path);
+ }
+
+ if (rows)
+ {
+ update_fetch (dialog);
+ }
+
+ g_list_free (rows);
+}
+
+static gboolean
+remove_remote (GitgRepositoryDialog *dialog, gchar const *name)
+{
+ return gitg_repository_commandv (dialog->priv->repository,
+ NULL,
+ "remote",
+ "rm",
+ name,
+ NULL);
+}
+
+void
+on_button_remove_remote_clicked (GtkButton *button, GitgRepositoryDialog *dialog)
+{
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+
+ selection = gtk_tree_view_get_selection (dialog->priv->tree_view_remotes);
+
+ GList *rows = gtk_tree_selection_get_selected_rows (selection, &model);
+ GList *refs = NULL;
+ GList *item;
+
+ for (item = rows; item; item = g_list_next (item))
+ {
+ GtkTreeRowReference *ref;
+ GtkTreePath *path = (GtkTreePath *)item->data;
+
+ ref = gtk_tree_row_reference_new (model, path);
+ refs = g_list_prepend (refs, ref);
+
+ gtk_tree_path_free (path);
+ }
+
+ refs = g_list_reverse (refs);
+ g_list_free (rows);
+
+ for (item = refs; item; item = g_list_next (item))
+ {
+ GtkTreeRowReference *ref = (GtkTreeRowReference *)item->data;
+ GtkTreePath *path = gtk_tree_row_reference_get_path (ref);
+ GtkTreeIter iter;
+ gchar *name;
+
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, COLUMN_NAME, &name, -1);
+
+ gboolean ret = remove_remote (dialog, name);
+
+ if (ret)
+ {
+ gtk_list_store_remove (dialog->priv->list_store_remotes, &iter);
+ }
+
+ gtk_tree_row_reference_free (ref);
+ gtk_tree_path_free (path);
+ }
+
+ g_list_free (refs);
+}
+
+void
+on_button_add_remote_clicked (GtkButton *button, GitgRepositoryDialog *dialog)
+{
+ GtkTreeModel *model = GTK_TREE_MODEL (dialog->priv->list_store_remotes);
+ GtkTreeIter iter;
+
+ gint num = 0;
+
+ if (gtk_tree_model_get_iter_first (model, &iter))
+ {
+ do
+ {
+ gchar *name;
+ gtk_tree_model_get (model, &iter, COLUMN_NAME, &name, -1);
+
+ if (g_str_has_prefix (name, "remote"))
+ {
+ gint n = atoi (name + 6);
+
+ if (n > num)
+ {
+ num = n;
+ }
+ }
+
+ g_free (name);
+ } while (gtk_tree_model_iter_next (model, &iter));
+ }
+
+ gchar *name = g_strdup_printf ("remote%d", num + 1);
+ gchar const url[] = "git://example.com/repository.git";
+
+ if (gitg_repository_commandv (dialog->priv->repository, NULL, "remote", "add", name, url, NULL))
+ {
+ GtkTreeIter iter;
+ GtkTreePath *path;
+
+ add_remote (dialog, name, url, &iter);
+
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (dialog->priv->list_store_remotes), &iter);
+
+ gtk_tree_view_set_cursor_on_cell (dialog->priv->tree_view_remotes,
+ path,
+ gtk_tree_view_get_column (dialog->priv->tree_view_remotes, 0),
+ NULL,
+ TRUE);
+
+ gtk_tree_path_free (path);
+ }
+
+ g_free (name);
+}
+
+gboolean
+on_entry_repository_user_name_focus_out_event (GtkEntry *entry, GdkEventFocus *focus, GitgRepositoryDialog *dialog)
+{
+ gchar const *text;
+
+ text = gtk_entry_get_text (entry);
+ gitg_config_set_value (dialog->priv->config, "user.name", *text ? text : NULL);
+
+ return FALSE;
+}
+
+gboolean
+on_entry_repository_user_email_focus_out_event (GtkEntry *entry, GdkEventFocus *focus, GitgRepositoryDialog *dialog)
+{
+ gchar const *text;
+
+ text = gtk_entry_get_text (entry);
+ gitg_config_set_value (dialog->priv->config, "user.email", *text ? text : NULL);
+
+ return FALSE;
+}
+
+void
+on_remote_name_edited(GtkCellRendererText *renderer, gchar *path, gchar *new_text, GitgRepositoryDialog *dialog)
+{
+ if (!*new_text)
+ {
+ return;
+ }
+
+ GtkTreePath *tp = gtk_tree_path_new_from_string (path);
+ GtkTreeIter iter;
+
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->priv->list_store_remotes),
+ &iter,
+ tp);
+
+ gchar *oldname;
+ gchar *url;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list_store_remotes),
+ &iter,
+ COLUMN_NAME, &oldname,
+ COLUMN_URL, &url,
+ -1);
+
+ if (gitg_repository_commandv (dialog->priv->repository, NULL, "remote", "add", new_text, url, NULL))
+ {
+ remove_remote (dialog, oldname);
+
+ gtk_list_store_set (dialog->priv->list_store_remotes,
+ &iter,
+ COLUMN_NAME, new_text,
+ -1);
+
+ fetch_remote (dialog, &iter);
+ }
+
+ g_free (oldname);
+ g_free (url);
+
+ gtk_tree_path_free (tp);
+}
+
+void
+on_remote_url_edited(GtkCellRendererText *renderer, gchar *path, gchar *new_text, GitgRepositoryDialog *dialog)
+{
+ if (!*new_text)
+ {
+ return;
+ }
+
+ GtkTreePath *tp = gtk_tree_path_new_from_string (path);
+ GtkTreeIter iter;
+
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->priv->list_store_remotes),
+ &iter,
+ tp);
+
+ gchar *name;
+ gchar *url;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list_store_remotes),
+ &iter,
+ COLUMN_NAME, &name,
+ COLUMN_URL, &url,
+ -1);
+
+ if (g_strcmp0 (url, new_text) == 0)
+ {
+ g_free (name);
+ g_free (url);
+
+ gtk_tree_path_free (tp);
+
+ return;
+ }
+
+ g_free (url);
+
+ gchar *key = g_strconcat ("remote.", name, ".url", NULL);
+ g_free (name);
+
+ if (gitg_config_set_value (dialog->priv->config, key, new_text))
+ {
+ gtk_list_store_set (dialog->priv->list_store_remotes,
+ &iter,
+ COLUMN_URL, new_text,
+ -1);
+
+ fetch_remote (dialog, &iter);
+ }
+
+ g_free (key);
+ gtk_tree_path_free (tp);
+}
diff --git a/gitg/gitg-repository-dialog.h b/gitg/gitg-repository-dialog.h
new file mode 100644
index 0000000..33dd9d7
--- /dev/null
+++ b/gitg/gitg-repository-dialog.h
@@ -0,0 +1,40 @@
+#ifndef __GITG_REPOSITORY_DIALOG_H__
+#define __GITG_REPOSITORY_DIALOG_H__
+
+#include <gtk/gtk.h>
+#include "gitg-window.h"
+
+G_BEGIN_DECLS
+
+#define GITG_TYPE_REPOSITORY_DIALOG (gitg_repository_dialog_get_type ())
+#define GITG_REPOSITORY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REPOSITORY_DIALOG, GitgRepositoryDialog))
+#define GITG_REPOSITORY_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REPOSITORY_DIALOG, GitgRepositoryDialog const))
+#define GITG_REPOSITORY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REPOSITORY_DIALOG, GitgRepositoryDialogClass))
+#define GITG_IS_REPOSITORY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REPOSITORY_DIALOG))
+#define GITG_IS_REPOSITORY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REPOSITORY_DIALOG))
+#define GITG_REPOSITORY_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REPOSITORY_DIALOG, GitgRepositoryDialogClass))
+
+typedef struct _GitgRepositoryDialog GitgRepositoryDialog;
+typedef struct _GitgRepositoryDialogClass GitgRepositoryDialogClass;
+typedef struct _GitgRepositoryDialogPrivate GitgRepositoryDialogPrivate;
+
+struct _GitgRepositoryDialog
+{
+ GtkDialog parent;
+
+ GitgRepositoryDialogPrivate *priv;
+};
+
+struct _GitgRepositoryDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+GType gitg_repository_dialog_get_type (void) G_GNUC_CONST;
+GitgRepositoryDialog *gitg_repository_dialog_present(GitgWindow *window);
+
+void gitg_repository_dialog_close ();
+
+G_END_DECLS
+
+#endif /* __GITG_REPOSITORY_DIALOG_H__ */
diff --git a/gitg/gitg-repository.ui b/gitg/gitg-repository.ui
new file mode 100644
index 0000000..bddb6e7
--- /dev/null
+++ b/gitg/gitg-repository.ui
@@ -0,0 +1,305 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-requires gitg 0.2 -->
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkListStore" id="list_store_remotes">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ <!-- column-name url -->
+ <column type="gchararray"/>
+ <!-- column-name fetch -->
+ <column type="gulong"/>
+ </columns>
+ </object>
+ <object class="GitgRepositoryDialog" id="dialog_repository">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Properties</property>
+ <property name="default_width">500</property>
+ <property name="default_height">300</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog_vbox_main">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkNotebook" id="notebook_main">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox_remotes_intern">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_remotes">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="tree_view_remotes">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">list_store_remotes</property>
+ <property name="rules_hint">True</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="tree_view_remotes_column_name">
+ <property name="title">Name</property>
+ <child>
+ <object class="GtkCellRendererText" id="tree_view_remotes_renderer_name">
+ <property name="editable">True</property>
+ <signal name="edited" handler="on_remote_name_edited"/>
+ </object>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="tree_view_remotes_column_url">
+ <property name="title">URL</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="tree_view_remotes_renderer_url">
+ <property name="editable">True</property>
+ <signal name="edited" handler="on_remote_url_edited"/>
+ </object>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="button_fetch_remote">
+ <property name="label" translatable="yes">Fetch</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image_fetch_remote</property>
+ <signal name="clicked" handler="on_button_fetch_remote_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_add_remote">
+ <property name="label" translatable="yes">gtk-add</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_button_add_remote_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_remove_remote">
+ <property name="label" translatable="yes">gtk-remove</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_button_remove_remote_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label_remotes">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Remotes</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_configuration_intern">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label_user">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>User</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_configuration_message">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label_spacer">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label_configuration_user_name">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_configuration_user_email">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">E-mail:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_repository_user_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="focus_out_event" handler="on_entry_repository_user_name_focus_out_event"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_repository_user_email">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="focus_out_event" handler="on_entry_repository_user_email_focus_out_event"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label_configuration">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Configuration</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog_action_area">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button_close">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">button_close</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkImage" id="image_fetch_remote">
+ <property name="visible">True</property>
+ <property name="stock">gtk-refresh</property>
+ </object>
+</interface>
diff --git a/gitg/gitg-ui.xml b/gitg/gitg-ui.xml
index 9ea723e..660b123 100644
--- a/gitg/gitg-ui.xml
+++ b/gitg/gitg-ui.xml
@@ -1,11 +1,5 @@
<?xml version="1.0"?>
-<!--Generated with glade3 3.4.2 on Thu Jun 26 12:26:40 2008 -->
<interface>
- <object class="GtkImage" id="image_commit">
- <property name="visible">True</property>
- <property name="stock">gtk-apply</property>
- <property name="icon-size">4</property>
- </object>
<object class="GtkUIManager" id="uiman">
<child>
<object class="GtkActionGroup" id="action_group_menu">
@@ -25,6 +19,11 @@
</object>
</child>
<child>
+ <object class="GtkAction" id="RepositoryAction">
+ <property name="label" translatable="yes">_Repository</property>
+ </object>
+ </child>
+ <child>
<object class="GtkAction" id="HelpAction">
<property name="label" translatable="yes">_Help</property>
</object>
@@ -94,6 +93,16 @@
</object>
</child>
<child>
+ <object class="GtkActionGroup" id="action_group_menu_repository">
+ <child>
+ <object class="GtkAction" id="RepositoryPropertiesAction">
+ <property name="stock-id">gtk-properties</property>
+ <signal name="activate" handler="on_repository_properties"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
<object class="GtkActionGroup" id="action_group_menu_help">
<child>
<object class="GtkAction" id="HelpAboutAction">
@@ -145,6 +154,9 @@
<menu action="ViewAction">
<menuitem action="ViewRefreshAction"/>
</menu>
+ <menu action="RepositoryAction">
+ <menuitem action="RepositoryPropertiesAction"/>
+ </menu>
<menu action="HelpAction">
<menuitem action="HelpAboutAction"/>
</menu>
@@ -159,808 +171,8 @@
</popup>
</ui>
</object>
- <object class="GtkAdjustment" id="adjustment_context">
- <property name="lower">1</property>
- <property name="upper">10</property>
- <property name="step_increment">1</property>
- <property name="page_increment">1</property>
- <property name="page_size">1</property>
- <property name="value">3</property>
- </object>
- <object class="GitgWindow" id="window">
- <property name="title" translatable="yes">gitg</property>
- <property name="default_width">800</property>
- <property name="default_height">800</property>
- <property name="visible">False</property>
- <signal name="set-focus" handler="on_window_set_focus"/>
- <signal name="window-state-event" handler="on_window_state_event"/>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <child>
- <object class="GtkMenuBar" id="menubar_main" constructor="uiman">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkNotebook" id="notebook_main">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkVBox" id="vbox_history">
- <property name="visible">True</property>
- <child>
- <object class="GtkVPaned" id="vpaned_main">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">350</property>
- <child>
- <object class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <child>
- <object class="GtkHBox" id="hbox_top">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel" id="label_branches">
- <property name="label" translatable="yes">Branch:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="combo_box_branches">
- <child>
- <object class="GtkCellRendererPixbuf" id="branches_renderer_icon"/>
- <attributes>
- <attribute name="stock-id">2</attribute>
- </attributes>
- </child>
- <child>
- <object class="GtkCellRendererText" id="branches_renderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="padding">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="tree_view_rv">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_clickable">True</property>
- <property name="rules_hint">True</property>
- <property name="search_column">1</property>
- <property name="fixed_height_mode">True</property>
- <child>
- <object class="GtkTreeViewColumn" id="rv_column_subject">
- <property name="title" translatable="yes">Subject</property>
- <property name="fixed-width">400</property>
- <property name="sizing">fixed</property>
- <property name="resizable">True</property>
- <property name="expand">True</property>
- <child>
- <object class="GitgCellRendererPath" id="rv_renderer_subject"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="rv_column2">
- <property name="title" translatable="yes">Author</property>
- <property name="fixed-width">200</property>
- <property name="sizing">fixed</property>
- <property name="resizable">True</property>
- <child>
- <object class="GtkCellRendererText" id="rv_renderer_author"/>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="rv_column3">
- <property name="title" translatable="yes">Date</property>
- <property name="fixed-width">200</property>
- <property name="sizing">fixed</property>
- <property name="resizable">True</property>
- <child>
- <object class="GtkCellRendererText" id="rv_renderer_date"/>
- <attributes>
- <attribute name="text">3</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkNotebook" id="notebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GitgRevisionView" id="revision_view">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">2</property>
- <child>
- <object class="GtkTable" id="table_parents">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">3</property>
- <property name="row_spacing">2</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_subject">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="use_markup">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_date">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="use_markup">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_author">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="use_markup">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_sha">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="use_markup">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_parent_lbl">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Parent:</property>
- </object>
- <packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_subject_lbl">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Subject:</property>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_date_lbl">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Date:</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_author_lbl">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Author:</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_sha_lbl">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">SHA:</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="padding">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHPaned" id="hpaned_revision_view">
- <property name="visible">True</property>
- <property name="position">200</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_revision_files">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="tree_view_revision_files">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <child>
- <object class="GtkTreeViewColumn" id="revision_files_column_icon">
- <property name="title" translatable="no">Icon</property>
- <property name="resizable">False</property>
- <property name="fixed-width">20</property>
- <property name="sizing">fixed</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="revision_files_cell_renderer_icon"/>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="revision_files_column_name">
- <property name="title" translatable="no">Filename</property>
- <property name="resizable">False</property>
- <child>
- <object class="GtkCellRendererText" id="revision_files_cell_renderer_name"/>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_details">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GitgDiffView" id="revision_diff">
- <property name="tab-width">4</property>
- <property name="editable">False</property>
- <property name="cursor-visible">False</property>
- <property name="diff-enabled">True</property>
- <property name="show-line-numbers">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Details</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GitgRevisionTreeView" id="revision_tree_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">200</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="revision_tree">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers-visible">False</property>
- <child>
- <object class="GtkTreeViewColumn" id="revision_tree_column">
- <property name="title" translatable="yes">Filename</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="renderer_icon"/>
- <attributes>
- <attribute name="pixbuf">0</attribute>
- </attributes>
- </child>
- <child>
- <object class="GtkCellRendererText" id="renderer_date"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_tree_contents">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkSourceView" id="revision_tree_contents">
- <property name="editable">False</property>
- <property name="show-line-numbers">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Tree</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label_history">
- <property name="visible">True</property>
- <property name="label" translatable="yes">History</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GitgCommitView" id="hpaned_commit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">200</property>
- <child>
- <object class="GtkVBox" id="vbox_staging">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel" id="label_unstaged">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">_Unstaged</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">tree_view_unstaged</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_unstaged">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="tree_view_unstaged">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <child>
- <object class="GtkTreeViewColumn" id="unstaged_column_icon">
- <property name="title" translatable="no"></property>
- <property name="resizable">False</property>
- <property name="fixed-width">20</property>
- <property name="sizing">fixed</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="unstaged_cell_renderer_icon"/>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="unstaged_column_name">
- <property name="title" translatable="yes">Unstaged</property>
- <property name="resizable">True</property>
- <child>
- <object class="GtkCellRendererText" id="unstaged_cell_renderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_staged">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Staged</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">tree_view_staged</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_staged">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="tree_view_staged">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <child>
- <object class="GtkTreeViewColumn" id="staged_column_icon">
- <property name="title" translatable="no"></property>
- <property name="resizable">False</property>
- <property name="fixed-width">20</property>
- <property name="sizing">fixed</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="staged_cell_renderer_icon"/>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="staged_column_name">
- <property name="title" translatable="no"></property>
- <property name="resizable">True</property>
- <child>
- <object class="GtkCellRendererText" id="staged_cell_renderer_name"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkVPaned" id="vpaned_commit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">450</property>
- <child>
- <object class="GtkVBox" id="vbox_changes">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkHBox" id="hbox_changes">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel" id="label_changes">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">_Changes</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">source_view_changes</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHScale" id="hscale_context">
- <property name="value-pos">right</property>
- <property name="digits">0</property>
- <property name="adjustment">adjustment_context</property>
- <property name="width-request">200</property>
- <property name="sensitive">False</property>
- <property name="show-fill-level">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack-type">end</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_context">
- <property name="label" translatable="yes">Context:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack-type">end</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_changes">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GitgDiffView" id="source_view_changes">
- <property name="tab-width">4</property>
- <property name="editable">False</property>
- <property name="cursor-visible">False</property>
- <property name="show-line-numbers">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox_comment">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel" id="label_comment">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">Co_mmit message</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">text_view_comment</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolled_window_comment">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkSourceView" id="text_view_comment">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="wrap_mode">word-char</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_commit">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkButton" id="button_commit">
- <property name="label" translatable="yes">Commit</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">image_commit</property>
- </object>
- <packing>
- <property name="position">0</property>
- <property name="pack-type">end</property>
- <property name="expand">false</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="check_button_signed_off_by">
- <property name="visible">true</property>
- <property name="label" translatable="yes">Add signed-off-by</property>
- </object>
- <packing>
- <property name="pack-type">start</property>
- <property name="expand">false</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label_commit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Commit</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkStatusbar" id="statusbar">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
+ <object class="GtkMenuBar" id="menubar_main" constructor="uiman">
+ <property name="visible">True</property>
</object>
</interface>
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index 6f9ef80..77ac492 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -39,6 +39,7 @@
#include "gitg-commit-view.h"
#include "gitg-settings.h"
#include "gitg-preferences-dialog.h"
+#include "gitg-repository-dialog.h"
#define GITG_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GITG_TYPE_WINDOW, GitgWindowPrivate))
@@ -212,9 +213,9 @@ build_search_entry(GitgWindow *window, GtkBuilder *builder)
gtk_widget_show(entry);
gtk_box_pack_end(GTK_BOX(box), entry, FALSE, FALSE, 0);
- GtkBuilder *b = gitg_utils_new_builder( "gitg-menus.xml");
-
+ GtkBuilder *b = gitg_utils_new_builder("gitg-menus.xml");
GtkUIManager *manager = GTK_UI_MANAGER(gtk_builder_get_object(b, "uiman"));
+
window->priv->search_popup = GTK_WIDGET(g_object_ref(gtk_ui_manager_get_widget(manager, "/ui/search_popup")));
gtk_builder_connect_signals(b, window);
@@ -428,6 +429,25 @@ gitg_window_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
// Store widgets
GitgWindow *window = GITG_WINDOW(buildable);
+ // Insert menu from second ui file
+ GtkBuilder *b = gitg_utils_new_builder("gitg-ui.xml");
+ GtkWidget *menu = GTK_WIDGET(gtk_builder_get_object(b, "menubar_main"));
+ GtkWidget *vbox = GTK_WIDGET(gtk_builder_get_object(builder, "vbox_main"));
+
+ gtk_box_pack_start(GTK_BOX(vbox), menu, FALSE, FALSE, 0);
+ gtk_box_reorder_child(GTK_BOX(vbox), menu, 0);
+
+ GtkRecentChooser *chooser = GTK_RECENT_CHOOSER(gtk_builder_get_object(b, "RecentOpenAction"));
+ GtkRecentFilter *filter = gtk_recent_filter_new();
+ gtk_recent_filter_add_group(filter, "gitg");
+
+ gtk_recent_chooser_add_filter(chooser, filter);
+
+ window->priv->edit_group = GTK_ACTION_GROUP(gtk_builder_get_object(b, "action_group_menu_edit"));
+
+ gtk_builder_connect_signals(b, window);
+ g_object_unref(b);
+
window->priv->vpaned_main = GTK_WIDGET(gtk_builder_get_object(builder, "vpaned_main"));
window->priv->hpaned_commit = GTK_WIDGET(gtk_builder_get_object(builder, "hpaned_commit"));
window->priv->vpaned_commit = GTK_WIDGET(gtk_builder_get_object(builder, "vpaned_commit"));
@@ -441,19 +461,11 @@ gitg_window_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
restore_state(window);
- window->priv->edit_group = GTK_ACTION_GROUP(gtk_builder_get_object(builder, "action_group_menu_edit"));
-
GtkTreeViewColumn *col = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "rv_column_subject"));
window->priv->renderer_path = GITG_CELL_RENDERER_PATH(gtk_builder_get_object(builder, "rv_renderer_subject"));
gtk_tree_view_column_set_cell_data_func(col, GTK_CELL_RENDERER(window->priv->renderer_path), (GtkTreeCellDataFunc)on_renderer_path, window, NULL);
- GtkRecentFilter *filter = gtk_recent_filter_new();
- gtk_recent_filter_add_group(filter, "gitg");
-
- GtkRecentChooser *chooser = GTK_RECENT_CHOOSER(gtk_builder_get_object(builder, "RecentOpenAction"));
- gtk_recent_chooser_add_filter(chooser, filter);
-
// Intialize branches
build_branches_combo(window, builder);
@@ -794,6 +806,7 @@ static void
on_repository_load(GitgRepository *repository, GitgWindow *window)
{
g_signal_handlers_block_by_func(window->priv->combo_branches, on_branches_combo_changed, window);
+ clear_branches_combo(window);
fill_branches_combo(window);
g_signal_handlers_unblock_by_func(window->priv->combo_branches, on_branches_combo_changed, window);
}
@@ -832,6 +845,8 @@ load_repository(GitgWindow *window, gchar const *path, gint argc, gchar const **
g_object_unref(window->priv->repository);
window->priv->repository = NULL;
+
+ gitg_repository_dialog_close ();
}
gboolean haspath = create_repository(window, path, usewd);
@@ -913,6 +928,14 @@ gitg_window_show_commit(GitgWindow *window)
gtk_notebook_set_current_page(window->priv->notebook_main, 1);
}
+GitgRepository *
+gitg_window_get_repository(GitgWindow *window)
+{
+ g_return_val_if_fail(GITG_IS_WINDOW(window), NULL);
+
+ return window->priv->repository;
+}
+
void
on_file_quit(GtkAction *action, GitgWindow *window)
{
@@ -994,10 +1017,6 @@ on_view_refresh(GtkAction *action, GitgWindow *window)
{
if (window->priv->repository && gitg_repository_get_path(window->priv->repository) != NULL)
{
- g_signal_handlers_block_by_func(window->priv->combo_branches, on_branches_combo_changed, window);
- clear_branches_combo(window);
- g_signal_handlers_unblock_by_func(window->priv->combo_branches, on_branches_combo_changed, window);
-
gitg_repository_reload(window->priv->repository);
}
}
@@ -1218,3 +1237,9 @@ on_edit_preferences(GtkAction *action, GitgWindow *window)
{
gitg_preferences_dialog_present(GTK_WINDOW(window));
}
+
+void
+on_repository_properties(GtkAction *action, GitgWindow *window)
+{
+ gitg_repository_dialog_present (window);
+}
diff --git a/gitg/gitg-window.h b/gitg/gitg-window.h
index acaefae..58c70dc 100644
--- a/gitg/gitg-window.h
+++ b/gitg/gitg-window.h
@@ -24,6 +24,7 @@
#define __GITG_WINDOW_H__
#include <gtk/gtk.h>
+#include "gitg-repository.h"
G_BEGIN_DECLS
@@ -53,6 +54,7 @@ GType gitg_window_get_type (void) G_GNUC_CONST;
void gitg_window_load_repository(GitgWindow *window, gchar const *path, gint argc, gchar const **argv);
void gitg_window_show_commit(GitgWindow *window);
+GitgRepository *gitg_window_get_repository(GitgWindow *window);
G_END_DECLS
diff --git a/gitg/gitg-window.ui b/gitg/gitg-window.ui
new file mode 100644
index 0000000..d4984a5
--- /dev/null
+++ b/gitg/gitg-window.ui
@@ -0,0 +1,805 @@
+<?xml version="1.0"?>
+<interface>
+ <object class="GtkImage" id="image_commit">
+ <property name="visible">True</property>
+ <property name="stock">gtk-apply</property>
+ <property name="icon-size">4</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment_context">
+ <property name="lower">1</property>
+ <property name="upper">10</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">1</property>
+ <property name="page_size">1</property>
+ <property name="value">3</property>
+ </object>
+ <object class="GitgWindow" id="window">
+ <property name="title" translatable="yes">gitg</property>
+ <property name="default_width">800</property>
+ <property name="default_height">800</property>
+ <property name="visible">False</property>
+ <signal name="set-focus" handler="on_window_set_focus"/>
+ <signal name="window-state-event" handler="on_window_state_event"/>
+ <child>
+ <object class="GtkVBox" id="vbox_main">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkNotebook" id="notebook_main">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox_history">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVPaned" id="vpaned_main">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">350</property>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkHBox" id="hbox_top">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label_branches">
+ <property name="label" translatable="yes">Branch:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combo_box_branches">
+ <child>
+ <object class="GtkCellRendererPixbuf" id="branches_renderer_icon"/>
+ <attributes>
+ <attribute name="stock-id">2</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object class="GtkCellRendererText" id="branches_renderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="tree_view_rv">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
+ <property name="rules_hint">True</property>
+ <property name="search_column">1</property>
+ <property name="fixed_height_mode">True</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="rv_column_subject">
+ <property name="title" translatable="yes">Subject</property>
+ <property name="fixed-width">400</property>
+ <property name="sizing">fixed</property>
+ <property name="resizable">True</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GitgCellRendererPath" id="rv_renderer_subject"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="rv_column2">
+ <property name="title" translatable="yes">Author</property>
+ <property name="fixed-width">200</property>
+ <property name="sizing">fixed</property>
+ <property name="resizable">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="rv_renderer_author"/>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="rv_column3">
+ <property name="title" translatable="yes">Date</property>
+ <property name="fixed-width">200</property>
+ <property name="sizing">fixed</property>
+ <property name="resizable">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="rv_renderer_date"/>
+ <attributes>
+ <attribute name="text">3</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GitgRevisionView" id="revision_view">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">5</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">2</property>
+ <child>
+ <object class="GtkTable" id="table_parents">
+ <property name="visible">True</property>
+ <property name="n_rows">1</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">3</property>
+ <property name="row_spacing">2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_subject">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="use_markup">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_date">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="use_markup">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_author">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="use_markup">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_sha">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="use_markup">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_parent_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Parent:</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_subject_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Subject:</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_date_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Date:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_author_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Author:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_sha_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">SHA:</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHPaned" id="hpaned_revision_view">
+ <property name="visible">True</property>
+ <property name="position">200</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_revision_files">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="tree_view_revision_files">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="revision_files_column_icon">
+ <property name="title" translatable="no">Icon</property>
+ <property name="resizable">False</property>
+ <property name="fixed-width">20</property>
+ <property name="sizing">fixed</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="revision_files_cell_renderer_icon"/>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="revision_files_column_name">
+ <property name="title" translatable="no">Filename</property>
+ <property name="resizable">False</property>
+ <child>
+ <object class="GtkCellRendererText" id="revision_files_cell_renderer_name"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_details">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GitgDiffView" id="revision_diff">
+ <property name="tab-width">4</property>
+ <property name="editable">False</property>
+ <property name="cursor-visible">False</property>
+ <property name="diff-enabled">True</property>
+ <property name="show-line-numbers">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Details</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GitgRevisionTreeView" id="revision_tree_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">200</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="revision_tree">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers-visible">False</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="revision_tree_column">
+ <property name="title" translatable="yes">Filename</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="renderer_icon"/>
+ <attributes>
+ <attribute name="pixbuf">0</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object class="GtkCellRendererText" id="renderer_date"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_tree_contents">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkSourceView" id="revision_tree_contents">
+ <property name="editable">False</property>
+ <property name="show-line-numbers">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Tree</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label_history">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">History</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GitgCommitView" id="hpaned_commit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">200</property>
+ <child>
+ <object class="GtkVBox" id="vbox_staging">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label_unstaged">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">_Unstaged</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tree_view_unstaged</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_unstaged">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="tree_view_unstaged">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="unstaged_column_icon">
+ <property name="title" translatable="no"></property>
+ <property name="resizable">False</property>
+ <property name="fixed-width">20</property>
+ <property name="sizing">fixed</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="unstaged_cell_renderer_icon"/>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="unstaged_column_name">
+ <property name="title" translatable="yes">Unstaged</property>
+ <property name="resizable">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="unstaged_cell_renderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_staged">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Staged</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">tree_view_staged</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_staged">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="tree_view_staged">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="staged_column_icon">
+ <property name="title" translatable="no"></property>
+ <property name="resizable">False</property>
+ <property name="fixed-width">20</property>
+ <property name="sizing">fixed</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="staged_cell_renderer_icon"/>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="staged_column_name">
+ <property name="title" translatable="no"></property>
+ <property name="resizable">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="staged_cell_renderer_name"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVPaned" id="vpaned_commit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">450</property>
+ <child>
+ <object class="GtkVBox" id="vbox_changes">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkHBox" id="hbox_changes">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label_changes">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">_Changes</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">source_view_changes</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHScale" id="hscale_context">
+ <property name="value-pos">right</property>
+ <property name="digits">0</property>
+ <property name="adjustment">adjustment_context</property>
+ <property name="width-request">200</property>
+ <property name="sensitive">False</property>
+ <property name="show-fill-level">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_context">
+ <property name="label" translatable="yes">Context:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_changes">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GitgDiffView" id="source_view_changes">
+ <property name="tab-width">4</property>
+ <property name="editable">False</property>
+ <property name="cursor-visible">False</property>
+ <property name="show-line-numbers">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_comment">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label_comment">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">Co_mmit message</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">text_view_comment</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window_comment">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkSourceView" id="text_view_comment">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word-char</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_commit">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkButton" id="button_commit">
+ <property name="label" translatable="yes">Commit</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image_commit</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ <property name="pack-type">end</property>
+ <property name="expand">false</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="check_button_signed_off_by">
+ <property name="visible">true</property>
+ <property name="label" translatable="yes">Add signed-off-by</property>
+ </object>
+ <packing>
+ <property name="pack-type">start</property>
+ <property name="expand">false</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label_commit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Commit</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkStatusbar" id="statusbar">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
+
+<!-- vi:ts=2:et -->
diff --git a/gitg/gitg.c b/gitg/gitg.c
index fbb48cf..1a21907 100644
--- a/gitg/gitg.c
+++ b/gitg/gitg.c
@@ -77,7 +77,7 @@ on_window_delete_event(GtkWidget *widget, GdkEvent *event, gpointer userdata)
static GitgWindow *
build_ui()
{
- GtkBuilder *builder = gitg_utils_new_builder("gitg-ui.xml");
+ GtkBuilder *builder = gitg_utils_new_builder("gitg-window.ui");
GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
gtk_widget_show_all(window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]