[anjuta/git-shell: 117/117] git: Stub the Log pane



commit a9f8686256afc88d0593dd0f1411cf287a52dbc6
Author: James Liggett <jrliggett cox net>
Date:   Wed Aug 18 20:58:35 2010 -0700

    git: Stub the Log pane
    
    This one is so complicated, it's probably better to take it in steps.

 plugins/git/Makefile.am    |    4 +-
 plugins/git/anjuta-git.ui  |  496 +++++++++++++-------------------------------
 plugins/git/git-log-pane.c |  202 ++++++++++++++++++
 plugins/git/git-log-pane.h |   60 ++++++
 plugins/git/plugin.c       |    6 +
 plugins/git/plugin.h       |    1 +
 6 files changed, 421 insertions(+), 348 deletions(-)
---
diff --git a/plugins/git/Makefile.am b/plugins/git/Makefile.am
index faab9de..34fefdc 100644
--- a/plugins/git/Makefile.am
+++ b/plugins/git/Makefile.am
@@ -215,7 +215,9 @@ libanjuta_git_la_SOURCES = \
 	git-clear-stash-pane.c \
 	git-clear-stash-pane.h \
 	git-rebase-pane.c \
-	git-rebase-pane.h
+	git-rebase-pane.h \
+	git-log-pane.c \
+	git-log-pane.h
 
 libanjuta_git_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
 
diff --git a/plugins/git/anjuta-git.ui b/plugins/git/anjuta-git.ui
index 74f1e86..8df60e6 100644
--- a/plugins/git/anjuta-git.ui
+++ b/plugins/git/anjuta-git.ui
@@ -429,6 +429,20 @@
       <column type="gchararray"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="log_loading_model">
+    <columns>
+      <!-- column-name spin -->
+      <column type="guint"/>
+      <!-- column-name loading_indicator -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">0</col>
+        <col id="1" translatable="yes">Loading...</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkVBox" id="status_pane">
     <property name="visible">True</property>
     <child>
@@ -1028,12 +1042,9 @@
       </packing>
     </child>
   </object>
-  <object class="GtkImage" id="find_button_image">
-    <property name="visible">True</property>
-    <property name="stock">gtk-find</property>
-  </object>
   <object class="GtkVBox" id="log_pane">
     <property name="visible">True</property>
+    <property name="orientation">vertical</property>
     <child>
       <object class="GtkFrame" id="frame10">
         <property name="visible">True</property>
@@ -1044,76 +1055,30 @@
             <property name="visible">True</property>
             <property name="left_padding">12</property>
             <child>
-              <object class="GtkVBox" id="vbox11">
+              <object class="GtkHBox" id="hbox1">
                 <property name="visible">True</property>
+                <property name="spacing">2</property>
                 <child>
-                  <object class="GtkHBox" id="hbox1">
+                  <object class="AnjutaFileDropEntry" id="path_entry">
                     <property name="visible">True</property>
-                    <property name="spacing">2</property>
-                    <child>
-                      <object class="GtkHBox" id="log_path_entry_hbox">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <child>
-                          <object class="GtkEntry" id="log_path_entry">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">&#x25CF;</property>
-                          </object>
-                          <packing>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="log_browse_button">
-                            <property name="label" translatable="yes">Browse&#x2026;</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">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="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="log_view_button">
-                        <property name="label" translatable="yes">View Log</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="image">find_button_image</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">&#x25CF;</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="log_whole_project_check">
-                    <property name="label" translatable="yes">Whole project</property>
+                  <object class="GtkButton" id="log_view_button">
+                    <property name="label" translatable="yes">View Log</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="active">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="image">find_button_image</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">False</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -1146,7 +1111,7 @@
             <property name="visible">True</property>
             <property name="left_padding">12</property>
             <child>
-              <object class="GtkComboBox" id="log_branch_combo">
+              <object class="GtkComboBox" id="branch_combo">
                 <property name="visible">True</property>
                 <property name="model">log_branch_combo_model</property>
                 <child>
@@ -1181,293 +1146,15 @@
       </packing>
     </child>
     <child>
-      <object class="GtkExpander" id="expander1">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <child>
-          <object class="GtkVBox" id="vbox16">
-            <property name="visible">True</property>
-            <child>
-              <object class="GtkNotebook" id="notebook1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <child>
-                  <object class="GtkTable" id="table2">
-                    <property name="visible">True</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="row_spacing">2</property>
-                    <child>
-                      <object class="GtkLabel" id="label33">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">Author:</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                        <property name="x_padding">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label34">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">Grep:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options"></property>
-                        <property name="y_options">GTK_SHRINK</property>
-                        <property name="x_padding">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="log_filter_author_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="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="log_filter_grep_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_options"></property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label30">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes" comments="&quot;Author&quot; means search for commits whose author matches the given grep expression. &quot;Grep&quot; searches through commit logs and patches.">Author/Grep</property>
-                  </object>
-                  <packing>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkTable" id="table4">
-                    <property name="visible">True</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">5</property>
-                    <child>
-                      <object class="GtkCalendar" id="log_filter_to_calendar">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="year">2009</property>
-                        <property name="month">10</property>
-                        <property name="day">21</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="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCalendar" id="log_filter_from_calendar">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="year">2009</property>
-                        <property name="month">10</property>
-                        <property name="day">21</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="log_filter_from_check">
-                        <property name="label" translatable="yes">From</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="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="log_filter_to_check">
-                        <property name="label" translatable="yes">To</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="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label31">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Date</property>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkTable" id="table3">
-                    <property name="visible">True</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="row_spacing">2</property>
-                    <child>
-                      <object class="GtkLabel" id="label38">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">From:</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_SHRINK</property>
-                        <property name="y_options">GTK_SHRINK</property>
-                        <property name="x_padding">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label37">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">To:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options"></property>
-                        <property name="y_options">GTK_SHRINK</property>
-                        <property name="x_padding">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="log_filter_from_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="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="log_filter_to_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_options"></property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label32">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Tag/Commit</property>
-                  </object>
-                  <packing>
-                    <property name="position">2</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkHButtonBox" id="hbuttonbox5">
-                <property name="visible">True</property>
-                <property name="layout_style">end</property>
-                <child>
-                  <object class="GtkButton" id="log_filter_clear_button">
-                    <property name="label">gtk-clear</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="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-        </child>
-        <child type="label">
-          <object class="GtkLabel" id="label29">
-            <property name="visible">True</property>
-            <property name="label" translatable="yes">Filters</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-            </attributes>
-          </object>
-        </child>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">2</property>
-      </packing>
-    </child>
-    <child>
       <object class="GtkVBox" id="vbox15">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <property name="homogeneous">True</property>
         <child>
           <object class="GtkVPaned" id="vpaned1">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkFrame" id="frame18">
                 <property name="visible">True</property>
@@ -1478,17 +1165,128 @@
                     <property name="visible">True</property>
                     <property name="left_padding">12</property>
                     <child>
-                      <object class="GtkScrolledWindow" id="scrolledwindow5">
+                      <object class="GtkNotebook" id="loading_notebook">
                         <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>
+                        <property name="show_tabs">False</property>
+                        <property name="show_border">False</property>
                         <child>
-                          <object class="GtkTreeView" id="log_changes_view">
+                          <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="log_view">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="icon_column">
+                                    <property name="resizable">True</property>
+                                    <child>
+                                      <object class="GtkCellRendererPixbuf" id="icon_renderer"/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="graph_column">
+                                    <property name="resizable">True</property>
+                                    <property name="title">Graph</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="shortlog_column">
+                                    <property name="resizable">True</property>
+                                    <property name="title">Short Log</property>
+                                    <property name="expand">True</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="shortlog_renderer"/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="author_column">
+                                    <property name="resizable">True</property>
+                                    <property name="title">Author</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="author_renderer"/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="date_column">
+                                    <property name="resizable">True</property>
+                                    <property name="title">Date</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="date_renderer"/>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">page 1</property>
                           </object>
+                          <packing>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <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="loading_view">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn1"/>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                    <property name="title">Graph</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="loading_spinner_column">
+                                    <property name="title">Short Log</property>
+                                    <property name="expand">True</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+                                    <property name="title">Author</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+                                    <property name="title">Date</property>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="label4">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">page 2</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
                         </child>
                       </object>
                     </child>
@@ -1558,7 +1356,7 @@
         </child>
       </object>
       <packing>
-        <property name="position">3</property>
+        <property name="position">2</property>
       </packing>
     </child>
   </object>
@@ -2938,4 +2736,8 @@
       </packing>
     </child>
   </object>
+  <object class="GtkImage" id="find_button_image">
+    <property name="visible">True</property>
+    <property name="stock">gtk-find</property>
+  </object>
 </interface>
diff --git a/plugins/git/git-log-pane.c b/plugins/git/git-log-pane.c
new file mode 100644
index 0000000..3884739
--- /dev/null
+++ b/plugins/git/git-log-pane.c
@@ -0,0 +1,202 @@
+/* -*- 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-log-pane.h"
+
+struct _GitLogPanePriv
+{
+	GtkBuilder *builder;
+	GtkListStore *log_model;
+};
+
+G_DEFINE_TYPE (GitLogPane, git_log_pane, GIT_TYPE_PANE);
+
+static void
+on_local_branch_list_command_started (AnjutaCommand *command, 
+                                      GitLogPane *self)
+{
+	GtkComboBox *branch_combo;
+	GtkListStore *log_branch_combo_model;
+
+	branch_combo = GTK_COMBO_BOX (gtk_builder_get_object (self->priv->builder,
+	                                                          "branch_combo"));
+	log_branch_combo_model = GTK_LIST_STORE (gtk_builder_get_object (self->priv->builder,
+	                                                                 "log_branch_combo_model"));
+
+	gtk_combo_box_set_model (branch_combo, NULL);
+	gtk_list_store_clear (log_branch_combo_model);
+}
+
+static void
+on_remote_branch_list_command_finished (AnjutaCommand *command,
+                                        guint return_code,
+                                        GitLogPane *self)
+{
+	GtkComboBox *branch_combo;
+	GtkTreeModel *log_branch_combo_model;
+
+	branch_combo = GTK_COMBO_BOX (gtk_builder_get_object (self->priv->builder,
+	                                                          "branch_combo"));
+	log_branch_combo_model = GTK_TREE_MODEL (gtk_builder_get_object (self->priv->builder,
+	                                                                 "log_branch_combo_model"));
+
+	gtk_combo_box_set_model (branch_combo, log_branch_combo_model);
+}
+
+static void
+on_branch_list_command_data_arrived (AnjutaCommand *command,
+                                     GitLogPane *self)
+{
+	GtkListStore *log_branch_combo_model;
+	AnjutaPlugin *plugin;
+	GList *current_branch;
+	GitBranch *branch;
+	gchar *name;
+	GtkTreeIter iter;
+
+	log_branch_combo_model = GTK_LIST_STORE (gtk_builder_get_object (self->priv->builder,
+	                                                                 "log_branch_combo_model"));
+	plugin = anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self));
+	current_branch = git_branch_list_command_get_output (GIT_BRANCH_LIST_COMMAND (command));
+
+	while (current_branch)
+	{
+		branch = current_branch->data;
+		name = git_branch_get_name (branch);
+
+		gtk_list_store_append (log_branch_combo_model, &iter);
+
+		if (git_branch_is_active (branch))
+		{
+			gtk_list_store_set (log_branch_combo_model, &iter, 0, 
+			                    GTK_STOCK_APPLY, -1);
+		}
+
+		gtk_list_store_set (log_branch_combo_model, &iter, 1, name, -1);
+
+		g_free (name);
+		
+		current_branch = g_list_next (current_branch);
+	}
+	
+}
+
+static void
+git_log_pane_init (GitLogPane *self)
+{
+	gchar *objects[] = {"log_pane",
+						"log_branch_combo_model",
+						"log_loading_model",
+						"find_button_image",
+						NULL};
+	GError *error = NULL;
+	GtkTreeView *log_view;
+
+	self->priv = g_new0 (GitLogPanePriv, 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);
+	}
+
+	/* Set up the log model */
+	log_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder,
+	                                                  "log_view"));
+	self->priv->log_model = gtk_list_store_new (1, GIT_TYPE_REVISION);
+
+	gtk_tree_view_set_model (log_view, GTK_TREE_MODEL (self->priv->log_model));
+	
+}
+
+static void
+git_log_pane_finalize (GObject *object)
+{
+	GitLogPane *self;
+
+	self = GIT_LOG_PANE (object);
+
+	g_object_unref (self->priv->builder);
+	g_free (self->priv);
+
+	G_OBJECT_CLASS (git_log_pane_parent_class)->finalize (object);
+}
+
+static GtkWidget *
+git_log_pane_get_widget (AnjutaDockPane *pane)
+{
+	GitLogPane *self;
+
+	self = GIT_LOG_PANE (pane);
+
+	return GTK_WIDGET (gtk_builder_get_object (self->priv->builder, 
+	                                           "log_pane"));
+}
+
+static void
+git_log_pane_class_init (GitLogPaneClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	AnjutaDockPaneClass *pane_class = ANJUTA_DOCK_PANE_CLASS (klass);
+
+	object_class->finalize = git_log_pane_finalize;
+	pane_class->get_widget = git_log_pane_get_widget;
+	pane_class->refresh = NULL;
+}
+
+
+AnjutaDockPane *
+git_log_pane_new (Git *plugin)
+{
+	GitLogPane *self;
+
+	self = g_object_new (GIT_TYPE_LOG_PANE, "plugin", plugin, NULL);
+
+	g_signal_connect (G_OBJECT (plugin->local_branch_list_command),
+	                  "command-started",
+	                  G_CALLBACK (on_local_branch_list_command_started),
+	                  self);
+
+	g_signal_connect (G_OBJECT (plugin->remote_branch_list_command), 
+	                  "command-finished",
+	                  G_CALLBACK (on_remote_branch_list_command_finished),
+	                  self);
+
+	g_signal_connect (G_OBJECT (plugin->local_branch_list_command), 
+	                  "data-arrived",
+	                  G_CALLBACK (on_branch_list_command_data_arrived),
+	                  self);
+
+	g_signal_connect (G_OBJECT (plugin->remote_branch_list_command),
+	                  "data-arrived",
+	                  G_CALLBACK (on_branch_list_command_data_arrived),
+	                  self);
+
+	return ANJUTA_DOCK_PANE (self);
+}
+
+void
+git_log_pane_set_working_directory (GitLogPane *self, 
+                                    const gchar *working_directory)
+{
+	/* TODO: Add public function implementation here */
+}
diff --git a/plugins/git/git-log-pane.h b/plugins/git/git-log-pane.h
new file mode 100644
index 0000000..85e5e43
--- /dev/null
+++ b/plugins/git/git-log-pane.h
@@ -0,0 +1,60 @@
+/* -*- 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_LOG_PANE_H_
+#define _GIT_LOG_PANE_H_
+
+#include <glib-object.h>
+#include "git-pane.h"
+#include "git-log-command.h"
+#include "git-ref-command.h"
+
+G_BEGIN_DECLS
+
+#define GIT_TYPE_LOG_PANE             (git_log_pane_get_type ())
+#define GIT_LOG_PANE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIT_TYPE_LOG_PANE, GitLogPane))
+#define GIT_LOG_PANE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GIT_TYPE_LOG_PANE, GitLogPaneClass))
+#define GIT_IS_LOG_PANE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIT_TYPE_LOG_PANE))
+#define GIT_IS_LOG_PANE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GIT_TYPE_LOG_PANE))
+#define GIT_LOG_PANE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIT_TYPE_LOG_PANE, GitLogPaneClass))
+
+typedef struct _GitLogPaneClass GitLogPaneClass;
+typedef struct _GitLogPane GitLogPane;
+typedef struct _GitLogPanePriv GitLogPanePriv;
+
+struct _GitLogPaneClass
+{
+	GitPaneClass parent_class;
+};
+
+struct _GitLogPane
+{
+	GitPane parent_instance;
+
+	GitLogPanePriv *priv;
+};
+
+GType git_log_pane_get_type (void) G_GNUC_CONST;
+AnjutaDockPane *git_log_pane_new (Git *plugin);
+void git_log_pane_set_working_directory (GitLogPane *self, 
+                                         const gchar *working_directory);
+
+G_END_DECLS
+
+#endif /* _GIT_LOG_PANE_H_ */
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 188fdcd..6c60606 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -50,6 +50,7 @@
 #include "git-drop-stash-pane.h"
 #include "git-clear-stash-pane.h"
 #include "git-rebase-pane.h"
+#include "git-log-pane.h"
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -614,6 +615,11 @@ git_activate_plugin (AnjutaPlugin *plugin)
 	                      _("Status"), NULL, git_plugin->status_pane,
 	                      GDL_DOCK_CENTER, status_entries, 
 	                      G_N_ELEMENTS (status_entries), git_plugin);
+
+	git_plugin->log_pane = git_log_pane_new (git_plugin);
+	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Log",
+	                      _("Log"), NULL, git_plugin->log_pane,
+	                      GDL_DOCK_CENTER, NULL, 0, NULL);
 	
 	git_plugin->branches_pane = git_branches_pane_new (git_plugin);
 	anjuta_dock_add_pane (ANJUTA_DOCK (git_plugin->dock), "Branches", 
diff --git a/plugins/git/plugin.h b/plugins/git/plugin.h
index 85b7c64..0ca3ba9 100644
--- a/plugins/git/plugin.h
+++ b/plugins/git/plugin.h
@@ -69,6 +69,7 @@ struct _Git
 
 	/* Dock panes */
 	AnjutaDockPane *status_pane;
+	AnjutaDockPane *log_pane;
 	AnjutaDockPane *branches_pane;
 	AnjutaDockPane *tags_pane;
 	AnjutaDockPane *remotes_pane;



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