[anjuta/git-shell: 33/34] git: Impelement the commit pane



commit 7e7eed015bd5bf07f0bc70f0d4f8b75e297d6e9e
Author: James Liggett <jrliggett cox net>
Date:   Wed Jun 9 23:36:35 2010 -0700

    git: Impelement the commit pane

 plugins/git/Makefile.am       |    4 +-
 plugins/git/anjuta-git.ui     |  250 ++++++++++++++++++++++++++++++++++++
 plugins/git/git-commit-pane.c |  281 +++++++++++++++++++++++++++++++++++++++++
 plugins/git/git-commit-pane.h |   59 +++++++++
 plugins/git/plugin.c          |   23 ++++-
 5 files changed, 615 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index 4adaa52..e7f111a 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -173,7 +173,9 @@ libanjuta_git_la_SOURCES = \
 	git-merge-pane.c \
 	git-merge-pane.h \
 	git-status-pane.h \
-	git-status-pane.c
+	git-status-pane.c \
+	git-commit-pane.h \
+	git-commit-pane.c
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/anjuta-git.ui b/plugins/git/anjuta-git.ui
index 12dede2..71bb6a6 100644
--- a/plugins/git/anjuta-git.ui
+++ b/plugins/git/anjuta-git.ui
@@ -1182,4 +1182,254 @@
       </packing>
     </child>
   </object>
+  <object class="GtkVBox" id="commit_pane">
+    <property name="visible">True</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkVBox" id="vbox5">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <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">in</property>
+                        <child>
+                          <object class="GtkTextView" id="log_view">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="column_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">1</property>
+                        <property name="label" translatable="yes">Column 1</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Log Message:&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="frame2">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment2">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkCheckButton" id="amend_check">
+                        <property name="label" translatable="yes">Amernd the previous commit</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="failed_merge_check">
+                        <property name="label" translatable="yes">This commit concludes a failed merged (use -i)</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="use_custom_author_info_check">
+                        <property name="label" translatable="yes">Use custom author information:</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkAlignment" id="author_info_alignment">
+                        <property name="visible">True</property>
+                        <property name="sensitive">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkTable" id="table1">
+                            <property name="visible">True</property>
+                            <property name="n_rows">2</property>
+                            <property name="n_columns">2</property>
+                            <child>
+                              <object class="GtkLabel" id="label5">
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes">Name:</property>
+                              </object>
+                              <packing>
+                                <property name="x_options"></property>
+                                <property name="x_padding">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label6">
+                                <property name="visible">True</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"></property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkEntry" id="name_entry">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">&#x25CF;</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkEntry" id="email_entry">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">&#x25CF;</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>
+                                <property name="y_padding">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Options:&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkHButtonBox" id="hbuttonbox1">
+        <property name="visible">True</property>
+        <property name="spacing">5</property>
+        <property name="layout_style">end</property>
+        <child>
+          <object class="GtkButton" id="cancel_button">
+            <property name="label">gtk-cancel</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>
+        <child>
+          <object class="GtkButton" id="ok_button">
+            <property name="label">gtk-ok</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">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
 </interface>
diff --git a/plugins/git/git-commit-pane.c b/plugins/git/git-commit-pane.c
new file mode 100644
index 0000000..b9b1648
--- /dev/null
+++ b/plugins/git/git-commit-pane.c
@@ -0,0 +1,281 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * anjuta is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * anjuta is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "git-commit-pane.h"
+
+struct _GitCommitPanePriv
+{
+	GtkBuilder *builder;
+};
+
+G_DEFINE_TYPE (GitCommitPane, git_commit_pane, GIT_TYPE_PANE);
+
+static void
+on_amend_check_toggled (GtkToggleButton *button, GitCommitPane *self)
+{
+	Git *plugin;
+	GtkTextView *log_view;
+	GtkTextBuffer *log_text_buffer;
+	gchar *commit_message_path;
+	GIOChannel *io_channel;
+	gchar *line;
+	GtkTextIter end_iter;
+
+	plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
+	log_view = GTK_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
+	                                                  "log_view"));
+	log_text_buffer = gtk_text_view_get_buffer (log_view);
+
+	if (gtk_toggle_button_get_active (button))
+	{
+		commit_message_path = g_strjoin (G_DIR_SEPARATOR_S,
+		                                 plugin->project_root_directory,
+		                                 ".git",
+		                                 "COMMIT_EDITMSG",
+		                                 NULL);
+		io_channel = g_io_channel_new_file (commit_message_path, "r", NULL);
+
+		while (g_io_channel_read_line (io_channel, &line, NULL, NULL, 
+		                               NULL) == G_IO_STATUS_NORMAL)
+		{
+			/* Filter out comment lines */
+			if (line[0] != '#')
+			{
+				gtk_text_buffer_get_end_iter (log_text_buffer, &end_iter);
+				gtk_text_buffer_insert (log_text_buffer, &end_iter, line, -1);
+
+				g_free (line);
+			}
+			else
+			{
+				g_free (line);
+				break;
+			}
+		}
+
+		g_free (commit_message_path);
+		g_io_channel_unref (io_channel);
+	}
+	else
+		gtk_text_buffer_set_text (log_text_buffer, "", 0);
+}
+
+static void
+on_use_custom_author_info_check_toggled (GtkToggleButton *button, 
+                                         GitCommitPane *self)
+{
+	GtkWidget *author_info_alignment;
+
+	author_info_alignment = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                                            "author_info_alignment"));
+
+	gtk_widget_set_sensitive (author_info_alignment, 
+	                          gtk_toggle_button_get_active (button));
+}
+
+static void
+on_ok_button_clicked (GtkButton *button, GitCommitPane *self)
+{
+	Git *plugin;
+	GtkTextView *log_view;
+	GtkToggleButton *amend_check;
+	GtkToggleButton *failed_merge_check;
+	GtkToggleButton *use_custom_author_info_check;
+	gchar *log;
+	gchar *author_name;
+	gchar *author_email;
+	GtkEditable *name_entry;
+	GtkEditable *email_entry;
+	GList *selected_paths;
+	GitCommitCommand *commit_command;
+	
+	plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE(self)));
+	log_view = GTK_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
+	                                                  "log_view"));
+	amend_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
+	                                                         "amend_check"));
+	failed_merge_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
+	                                                                "failed_merge_check"));
+	use_custom_author_info_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
+	                                                                          "use_custom_author_info_check"));
+	log = git_pane_get_log_from_text_view (log_view);
+	author_name = NULL;
+	author_email = NULL;
+
+	if (gtk_toggle_button_get_active (use_custom_author_info_check))
+	{
+		name_entry = GTK_EDITABLE (gtk_builder_get_object (self->priv->builder,
+		                                                   "name_entry"));
+		email_entry = GTK_EDITABLE (gtk_builder_get_object (self->priv->builder,
+		                                                    "email_entry"));
+
+		author_name = gtk_editable_get_chars (name_entry, 0, -1);
+		author_email = gtk_editable_get_chars (email_entry, 0, -1);
+	}
+
+	selected_paths = git_status_pane_get_all_selected_items (GIT_STATUS_PANE (plugin->status_pane));
+
+	commit_command = git_commit_command_new (plugin->project_root_directory,
+	                                         gtk_toggle_button_get_active (amend_check),
+	                                         gtk_toggle_button_get_active (failed_merge_check),
+	                                         log,
+	                                         author_name,
+	                                         author_email,
+	                                         selected_paths);
+
+	git_pane_create_message_view (plugin);
+
+	g_signal_connect (G_OBJECT (commit_command), "data-arrived",
+	                  G_CALLBACK (git_pane_on_command_info_arrived),
+	                  plugin);
+
+	g_signal_connect (G_OBJECT (commit_command), "command-finished",
+	                  G_CALLBACK (g_object_unref),
+	                  NULL);
+
+	anjuta_command_start (ANJUTA_COMMAND (commit_command));
+
+	anjuta_dock_remove_pane (ANJUTA_DOCK (plugin->dock), 
+	                         ANJUTA_DOCK_PANE (self));
+}
+
+static void
+on_cancel_button_clicked (GtkButton *button, GitCommitPane *self)
+{
+	Git *plugin;
+
+	plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE(self)));
+
+	anjuta_dock_remove_pane (ANJUTA_DOCK (plugin->dock), 
+	                         ANJUTA_DOCK_PANE (self));
+}
+
+static void
+git_commit_pane_init (GitCommitPane *self)
+{
+	gchar *objects[] = {"commit_pane",
+						NULL};
+	GError *error = NULL;
+	GtkTextView *log_view;
+	GtkTextBuffer *log_text_buffer;
+	GtkLabel *column_label;
+	GtkWidget *amend_check;
+	GtkWidget *use_custom_author_info_check;
+	GtkWidget *ok_button;
+	GtkWidget *cancel_button;
+
+	self->priv = g_new0 (GitCommitPanePriv, 1);
+	self->priv->builder = gtk_builder_new ();
+
+	if (!gtk_builder_add_objects_from_file (self->priv->builder, BUILDER_FILE, 
+	                                        objects, 
+	                                        &error))
+	{
+		g_warning ("Couldn't load builder file: %s", error->message);
+		g_error_free (error);
+	}
+
+	log_view = GTK_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
+	                                                  "log_view"));
+	log_text_buffer = gtk_text_view_get_buffer (log_view);
+	column_label = GTK_LABEL (gtk_builder_get_object (self->priv->builder,
+	                                                  "column_label"));
+	amend_check = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                                  "amend_check"));
+	use_custom_author_info_check = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                                                   "use_custom_author_info_check"));
+	ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                                "ok_button"));
+	cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                                    "cancel_button"));
+
+	g_signal_connect (G_OBJECT (amend_check), "toggled",
+	                  G_CALLBACK (on_amend_check_toggled),
+	                  self);
+
+	g_signal_connect (G_OBJECT (log_text_buffer), "mark-set",
+	                  G_CALLBACK (git_pane_set_log_view_column_label),
+	                  column_label);
+
+	g_signal_connect (G_OBJECT (use_custom_author_info_check), "toggled",
+	                  G_CALLBACK (on_use_custom_author_info_check_toggled),
+	                  self);
+
+	g_signal_connect (G_OBJECT (ok_button), "clicked",
+	                  G_CALLBACK (on_ok_button_clicked),
+	                  self);
+
+	g_signal_connect (G_OBJECT (cancel_button), "clicked",
+	                  G_CALLBACK (on_cancel_button_clicked),
+	                  self);
+	
+}
+
+static void
+git_commit_pane_finalize (GObject *object)
+{
+	GitCommitPane *self;
+
+	self = GIT_COMMIT_PANE (object);
+
+	g_object_unref (self->priv->builder);
+	g_free (self->priv);
+
+	G_OBJECT_CLASS (git_commit_pane_parent_class)->finalize (object);
+}
+
+static GtkWidget *
+git_commit_pane_get_widget (AnjutaDockPane *pane)
+{
+	GitCommitPane *self;
+
+	self = GIT_COMMIT_PANE (pane);
+
+	return GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
+	                                           "commit_pane"));
+}
+
+static void
+git_commit_pane_class_init (GitCommitPaneClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+	AnjutaDockPaneClass* pane_class = ANJUTA_DOCK_PANE_CLASS (klass);
+
+	object_class->finalize = git_commit_pane_finalize;
+	pane_class->get_widget = git_commit_pane_get_widget;
+	pane_class->refresh = NULL;
+}
+
+
+AnjutaDockPane *
+git_commit_pane_new (Git *plugin)
+{
+	return g_object_new (GIT_TYPE_COMMIT_PANE, "plugin", plugin, NULL);
+}
+
+void
+on_commit_button_clicked (GtkAction *action, Git *plugin)
+{
+	AnjutaDockPane *pane;
+
+	pane = git_commit_pane_new (plugin);
+
+	anjuta_dock_add_pane (ANJUTA_DOCK (plugin->dock), "Commit", _("Commit"),
+	                      NULL, pane, GDL_DOCK_BOTTOM, NULL, 0, NULL);
+}
diff --git a/plugins/git/git-commit-pane.h b/plugins/git/git-commit-pane.h
new file mode 100644
index 0000000..efa6833
--- /dev/null
+++ b/plugins/git/git-commit-pane.h
@@ -0,0 +1,59 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) James Liggett 2010 <jrliggett cox net>
+ * 
+ * anjuta is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * anjuta is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GIT_COMMIT_PANE_H_
+#define _GIT_COMMIT_PANE_H_
+
+#include <glib-object.h>
+#include "git-pane.h"
+#include "git-status-pane.h"
+#include "git-commit-command.h"
+
+G_BEGIN_DECLS
+
+#define GIT_TYPE_COMMIT_PANE             (git_commit_pane_get_type ())
+#define GIT_COMMIT_PANE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_COMMIT_PANE, GitCommitPane))
+#define GIT_COMMIT_PANE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_COMMIT_PANE, GitCommitPaneClass))
+#define GIT_IS_COMMIT_PANE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_COMMIT_PANE))
+#define GIT_IS_COMMIT_PANE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_COMMIT_PANE))
+#define GIT_COMMIT_PANE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_COMMIT_PANE, GitCommitPaneClass))
+
+typedef struct _GitCommitPaneClass GitCommitPaneClass;
+typedef struct _GitCommitPane GitCommitPane;
+typedef struct _GitCommitPanePriv GitCommitPanePriv;
+
+struct _GitCommitPaneClass
+{
+	GitPaneClass parent_class;
+};
+
+struct _GitCommitPane
+{
+	GitPane parent_instance;
+
+	GitCommitPanePriv *priv;
+};
+
+GType git_commit_pane_get_type (void) G_GNUC_CONST;
+AnjutaDockPane *git_commit_pane_new (Git *plugin);
+void on_commit_button_clicked (GtkAction *action, Git *plugin);
+
+G_END_DECLS
+
+#endif /* _GIT_COMMIT_PANE_H_ */
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 46d410c..929990f 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -27,6 +27,7 @@
 #include "git-switch-branch-pane.h"
 #include "git-merge-pane.h"
 #include "git-status-pane.h"
+#include "git-commit-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -72,6 +73,25 @@ AnjutaCommandBarEntry branch_entries[] =
 	}
 };
 
+AnjutaCommandBarEntry status_entries[] = {
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_FRAME,
+		"NULL",
+		N_("Changes"),
+		NULL,
+		NULL,
+		NULL
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"Commit",
+		N_("Commit"),
+		N_("Commit changes"),
+		GTK_STOCK_APPLY,
+		G_CALLBACK (on_commit_button_clicked)
+	}
+};
+
 static gpointer parent_class;
 
 static void
@@ -285,7 +305,8 @@ git_activate_plugin (AnjutaPlugin *plugin)
 	git_plugin->status_pane = git_status_pane_new (git_plugin);
 	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Status",
 	                      _("Status"), NULL, git_plugin->status_pane,
-	                      GDL_DOCK_CENTER, NULL, 0, NULL);
+	                      GDL_DOCK_CENTER, status_entries, 
+	                      G_N_ELEMENTS (status_entries), git_plugin);
 	
 	git_plugin->branches_pane = git_branches_pane_new (git_plugin);
 	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Branches", 



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