[anjuta/git-shell] git: Implement the Push pane



commit dd39c5515acbb5ea0fc61c239cb2425b1aa40a97
Author: James Liggett <jrliggett cox net>
Date:   Sun Jul 4 20:26:14 2010 -0700

    git: Implement the Push pane

 plugins/git/Makefile.am               |   18 +--
 plugins/git/anjuta-git.ui             |  295 +++++++++++++++++++++++++++++++++
 plugins/git/git-repository-selector.c |  201 ++++++++++++++++++++++
 plugins/git/git-repository-selector.h |   68 ++++++++
 plugins/git/plugin.c                  |   28 +++-
 5 files changed, 596 insertions(+), 14 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index d890baf..96b0368 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -14,17 +14,7 @@ plugin_in_files = git.plugin.in
 %.plugin: %.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
 
 git_plugindir = $(anjuta_plugin_dir)
-git_plugin_DATA = $(plugin_in_files:.plugin.in=.plugin) \
-	git-branches-pane.c\
-	git-branches-pane.h\
-	git-pane.c        \
-	git-pane.h        \
-	git-merge-pane.c        \
-	git-merge-pane.h        \
-	git-add-files-pane.h        \
-	git-add-files-pane.c        \
-	git-remotes-pane.h        \
-	git-remotes-pane.c
+git_plugin_DATA = $(plugin_in_files:.plugin.in=.plugin) 
 
 # NOTE :
 # The naming convention is very intentional
@@ -185,7 +175,11 @@ libanjuta_git_la_SOURCES = \
 	git-remove-files-pane.c \
 	git-remove-files-pane.h \
 	git-remotes-pane.c \
-	git-remotes-pane.h
+	git-remotes-pane.h \
+	git-push-pane.c \
+	git-push-pane.h \
+	git-repository-selector.h \
+	git-repository-selector.c
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/anjuta-git.ui b/plugins/git/anjuta-git.ui
index 4b58752..81c8ba6 100644
--- a/plugins/git/anjuta-git.ui
+++ b/plugins/git/anjuta-git.ui
@@ -395,6 +395,22 @@
       <column type="gchararray"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="push_branch_model">
+    <columns>
+      <!-- column-name selected -->
+      <column type="gboolean"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="push_tag_model">
+    <columns>
+      <!-- column-name selected -->
+      <column type="gboolean"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkVBox" id="status_pane">
     <property name="visible">True</property>
     <child>
@@ -1692,4 +1708,283 @@
       </packing>
     </child>
   </object>
+  <object class="GtkVBox" id="push_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="repository_frame">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="repository_alignment">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Repository to push to:&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">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="branch_tag_hbox">
+            <property name="visible">True</property>
+            <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="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="GtkTreeView" id="branches_view">
+                            <property name="height_request">150</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">push_branch_model</property>
+                            <property name="headers_visible">False</property>
+                            <property name="headers_clickable">False</property>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                                <property name="title">column</property>
+                                <child>
+                                  <object class="GtkCellRendererToggle" id="branches_selected_renderer"/>
+                                  <attributes>
+                                    <attribute name="active">0</attribute>
+                                  </attributes>
+                                </child>
+                                <child>
+                                  <object class="GtkCellRendererText" id="branches_name_renderer"/>
+                                  <attributes>
+                                    <attribute name="text">1</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label5">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Branches:&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="frame3">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment3">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</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">in</property>
+                        <child>
+                          <object class="GtkTreeView" id="tags_view">
+                            <property name="height_request">150</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">push_tag_model</property>
+                            <property name="headers_visible">False</property>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                <property name="title">column</property>
+                                <child>
+                                  <object class="GtkCellRendererToggle" id="tags_selected_renderer"/>
+                                  <attributes>
+                                    <attribute name="active">0</attribute>
+                                  </attributes>
+                                </child>
+                                <child>
+                                  <object class="GtkCellRendererText" id="tags_name_renderer"/>
+                                  <attributes>
+                                    <attribute name="text">1</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label6">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Tags:&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="frame4">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment4">
+                <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="push_all_tags_check">
+                        <property name="label" translatable="yes">Push all tags</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="push_all_check">
+                        <property name="label" translatable="yes">Push all branches and tags</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="force_check">
+                        <property name="label" translatable="yes">Force</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>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label7">
+                <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">2</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-repository-selector.c b/plugins/git/git-repository-selector.c
new file mode 100644
index 0000000..d7240bc
--- /dev/null
+++ b/plugins/git/git-repository-selector.c
@@ -0,0 +1,201 @@
+/* -*- 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-repository-selector.h"
+
+struct _GitRepositorySelectorPriv
+{
+	GtkWidget *remote_toggle;
+	GtkWidget *url_toggle;
+	GtkWidget *notebook;
+	GtkWidget *selected_remote_label;
+	GtkWidget *url_entry;
+	GitRepositorySelectorMode mode;
+	gchar *remote;
+};
+
+G_DEFINE_TYPE (GitRepositorySelector, git_repository_selector, GTK_TYPE_VBOX);
+
+static void
+on_mode_button_toggled (GtkToggleButton *button, GitRepositorySelector *self)
+{
+	GitRepositorySelectorMode mode;
+
+	if (gtk_toggle_button_get_active (button))
+	{
+		/* Each mode corresponds to a page in the notebook */
+		mode = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "mode"));
+		self->priv->mode = mode;
+
+		gtk_notebook_set_current_page (GTK_NOTEBOOK (self->priv->notebook), 
+		                               mode);
+	}
+}
+
+static void
+git_repository_selector_init (GitRepositorySelector *self)
+{
+	GtkWidget *button_hbox;
+	GtkWidget *remote_hbox;
+	GtkWidget *label;
+
+	self->priv = g_new0 (GitRepositorySelectorPriv, 1);
+
+	/* Mode selector buttons. Allows the user to use a selected remote or 
+	 * enter a URL. */
+	button_hbox = gtk_hbox_new (TRUE, 0);
+
+	/* Remote toggle button */
+	self->priv->remote_toggle = gtk_radio_button_new_with_label (NULL, 
+	                                                             _("Remote"));
+	g_object_set (G_OBJECT (self->priv->remote_toggle), "draw-indicator", FALSE,
+	              NULL);
+	gtk_box_pack_start (GTK_BOX (button_hbox), self->priv->remote_toggle, TRUE,
+	                    TRUE, 0);
+
+	g_object_set_data (G_OBJECT (self->priv->remote_toggle), "mode", 
+	                   GINT_TO_POINTER (GIT_REPOSITORY_SELECTOR_REMOTE));
+
+	g_signal_connect (G_OBJECT (self->priv->remote_toggle), "toggled",
+	                  G_CALLBACK (on_mode_button_toggled),
+	                  self);
+
+	/* URL toggle button */
+	self->priv->url_toggle = gtk_radio_button_new_with_label (gtk_radio_button_get_group (GTK_RADIO_BUTTON (self->priv->remote_toggle)),
+	                                                          _("URL"));
+	g_object_set (G_OBJECT (self->priv->url_toggle), "draw-indicator", FALSE,
+	              NULL);
+	gtk_box_pack_start (GTK_BOX (button_hbox), self->priv->url_toggle, TRUE, 
+	                    TRUE, 0);
+
+	g_object_set_data (G_OBJECT (self->priv->url_toggle), "mode", 
+	                   GINT_TO_POINTER (GIT_REPOSITORY_SELECTOR_URL));
+
+	g_signal_connect (G_OBJECT (self->priv->url_toggle), "toggled",
+	                  G_CALLBACK (on_mode_button_toggled),
+	                  self);
+
+	gtk_box_pack_start (GTK_BOX (self), button_hbox, FALSE, FALSE, 0);
+
+	/* Selected remote label */
+	remote_hbox = gtk_hbox_new (FALSE, 2);
+
+	label = gtk_label_new (NULL);
+	gtk_label_set_markup (GTK_LABEL (label), _("<b>Selected Remote:</b>"));
+	gtk_box_pack_start (GTK_BOX (remote_hbox), label, FALSE, FALSE, 0);
+
+	self->priv->selected_remote_label = gtk_label_new (NULL);
+	g_object_set (G_OBJECT (self->priv->selected_remote_label), "xalign", 
+	              0.0f, NULL);
+	gtk_box_pack_start (GTK_BOX (remote_hbox), 
+	                    self->priv->selected_remote_label, TRUE, TRUE, 0);
+
+	/* URL entry */
+	self->priv->url_entry = gtk_entry_new ();
+
+	/* Notebook */
+	self->priv->notebook = gtk_notebook_new ();
+	gtk_notebook_set_show_border (GTK_NOTEBOOK (self->priv->notebook), FALSE);
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (self->priv->notebook), FALSE);
+	gtk_notebook_append_page (GTK_NOTEBOOK (self->priv->notebook), remote_hbox,
+	                          NULL);
+	gtk_notebook_append_page (GTK_NOTEBOOK (self->priv->notebook), 
+	                          self->priv->url_entry, NULL);
+
+	gtk_box_pack_start (GTK_BOX (self), self->priv->notebook, TRUE, TRUE, 0);
+
+	/* Set the selected repository label to a resonable default. */
+	git_repository_selector_set_remote (self, NULL);
+
+	gtk_widget_show_all (GTK_WIDGET (self));
+}
+
+static void
+git_repository_selector_finalize (GObject *object)
+{
+	GitRepositorySelector *self;
+
+	self = GIT_REPOSITORY_SELECTOR (object);
+
+	g_free (self->priv->remote);
+	g_free (self->priv);
+
+	G_OBJECT_CLASS (git_repository_selector_parent_class)->finalize (object);
+}
+
+static void
+git_repository_selector_class_init (GitRepositorySelectorClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);;
+
+	object_class->finalize = git_repository_selector_finalize;
+}
+
+
+GtkWidget *
+git_repository_selector_new (void)
+{
+	return g_object_new (GIT_TYPE_REPOSITORY_SELECTOR, NULL);
+}
+
+GitRepositorySelectorMode
+git_repository_selector_get_mode (GitRepositorySelector *self)
+{
+	return self->priv->mode;
+}
+
+void
+git_repository_selector_set_remote (GitRepositorySelector *self,
+                                    const gchar *remote)
+{
+	g_free (self->priv->remote);
+	self->priv->remote = NULL;
+
+	if (remote)
+	{
+		self->priv->remote = g_strdup (remote);
+		gtk_label_set_text (GTK_LABEL (self->priv->selected_remote_label),
+		                    remote);
+	}
+	else
+	{
+		gtk_label_set_text (GTK_LABEL (self->priv->selected_remote_label),
+		                    _("No remote selected; using origin by default.\n"
+		                      "To push to a different remote, select one from "
+		                      "the Remotes list above."));
+	}
+}
+
+gchar *
+git_repository_selector_get_repository (GitRepositorySelector *self)
+{
+	if (self->priv->mode == GIT_REPOSITORY_SELECTOR_REMOTE)
+	{
+		if (self->priv->remote)
+			return g_strdup (self->priv->remote);
+		else
+			return g_strdup ("origin");
+	}
+	else
+	{
+		return gtk_editable_get_chars (GTK_EDITABLE (self->priv->url_entry), 0, 
+		                               -1);
+	}
+		
+}
diff --git a/plugins/git/git-repository-selector.h b/plugins/git/git-repository-selector.h
new file mode 100644
index 0000000..1df362f
--- /dev/null
+++ b/plugins/git/git-repository-selector.h
@@ -0,0 +1,68 @@
+/* -*- 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_REPOSITORY_SELECTOR_H_
+#define _GIT_REPOSITORY_SELECTOR_H_
+
+#include <glib-object.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GIT_TYPE_REPOSITORY_SELECTOR             (git_repository_selector_get_type ())
+#define GIT_REPOSITORY_SELECTOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_REPOSITORY_SELECTOR, GitRepositorySelector))
+#define GIT_REPOSITORY_SELECTOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_REPOSITORY_SELECTOR, GitRepositorySelectorClass))
+#define GIT_IS_REPOSITORY_SELECTOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_REPOSITORY_SELECTOR))
+#define GIT_IS_REPOSITORY_SELECTOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_REPOSITORY_SELECTOR))
+#define GIT_REPOSITORY_SELECTOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_REPOSITORY_SELECTOR, GitRepositorySelectorClass))
+
+typedef struct _GitRepositorySelectorClass GitRepositorySelectorClass;
+typedef struct _GitRepositorySelector GitRepositorySelector;
+typedef struct _GitRepositorySelectorPriv GitRepositorySelectorPriv;
+
+struct _GitRepositorySelectorClass
+{
+	GtkVBoxClass parent_class;
+};
+
+struct _GitRepositorySelector
+{
+	GtkVBox parent_instance;
+
+	GitRepositorySelectorPriv *priv;
+};
+
+typedef enum
+{
+	GIT_REPOSITORY_SELECTOR_REMOTE,
+	GIT_REPOSITORY_SELECTOR_URL
+} GitRepositorySelectorMode;
+
+
+GType git_repository_selector_get_type (void) G_GNUC_CONST;
+GtkWidget *git_repository_selector_new (void);
+GitRepositorySelectorMode git_repository_selector_get_mode (GitRepositorySelector *self);
+void git_repository_selector_set_remote (GitRepositorySelector *self, 
+                                         const gchar *remote);
+gchar *git_repository_selector_get_repository (GitRepositorySelector *self);
+
+G_END_DECLS
+
+#endif /* _GIT_REMOTE_SELECTOR_H_ */
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 5c04780..ee0702d 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -31,6 +31,7 @@
 #include "git-add-files-pane.h"
 #include "git-remove-files-pane.h"
 #include "git-remotes-pane.h"
+#include "git-push-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -76,7 +77,8 @@ AnjutaCommandBarEntry branch_entries[] =
 	}
 };
 
-AnjutaCommandBarEntry status_entries[] = {
+AnjutaCommandBarEntry status_entries[] = 
+{
 	{
 		ANJUTA_COMMAND_BAR_ENTRY_FRAME,
 		"NULL",
@@ -119,6 +121,27 @@ AnjutaCommandBarEntry status_entries[] = {
 	}
 };
 
+AnjutaCommandBarEntry remotes_entries[] =
+{
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_FRAME,
+		"NULL",
+		N_("Remote repository tools"),
+		NULL,
+		NULL,
+		NULL
+	},
+	{
+		ANJUTA_COMMAND_BAR_ENTRY_BUTTON,
+		"Push",
+		N_("Push"),
+		N_("Push changes to a remote repository"),
+		GTK_STOCK_GO_FORWARD,
+		G_CALLBACK (on_push_button_clicked)
+	}
+	
+};
+
 static gpointer parent_class;
 
 static void
@@ -375,7 +398,8 @@ git_activate_plugin (AnjutaPlugin *plugin)
 	git_plugin->remotes_pane = git_remotes_pane_new (git_plugin);
 	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Remotes", 
 	                      _("Remotes"), NULL, git_plugin->remotes_pane,
-	                      GDL_DOCK_CENTER, NULL, 0, NULL);
+	                      GDL_DOCK_CENTER, remotes_entries, 
+	                      G_N_ELEMENTS (remotes_entries), git_plugin);
 	
 	/* Add watches */
 	git_plugin->project_root_watch_id = anjuta_plugin_add_watch (plugin,



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