[anjuta/git-shell] git: Add a function for sending raw command output to an editor to GitPane



commit b812d23fc435b49845e5d8ab57c34b3936737831
Author: James Liggett <jrliggett cox net>
Date:   Sun Jul 11 00:03:30 2010 -0700

    git: Add a function for sending raw command output to an editor to GitPane

 plugins/git/git-pane.c |   17 +++++++++++++++++
 plugins/git/git-pane.h |    5 ++++-
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/git-pane.c b/plugins/git/git-pane.c
index 4c195a4..9086f89 100644
--- a/plugins/git/git-pane.c
+++ b/plugins/git/git-pane.c
@@ -277,3 +277,20 @@ git_pane_report_errors (AnjutaCommand *command, guint return_code, Git *plugin)
 	}
 }
 
+void
+git_pane_send_raw_output_to_editor (AnjutaCommand *command, 
+                                    IAnjutaEditor *editor)
+{
+	GQueue *output;
+	gchar *line;
+
+	output = git_raw_output_command_get_output (GIT_RAW_OUTPUT_COMMAND (command));
+
+	while (g_queue_peek_head (output))
+	{
+		line = g_queue_pop_head (output);
+		ianjuta_editor_append (editor, line, strlen (line), NULL);
+		g_free (line);
+	}
+}
+
diff --git a/plugins/git/git-pane.h b/plugins/git/git-pane.h
index 3436cb2..1be0f16 100644
--- a/plugins/git/git-pane.h
+++ b/plugins/git/git-pane.h
@@ -23,6 +23,7 @@
 #include <glib-object.h>
 #include <libanjuta/anjuta-dock-pane.h>
 #include <libanjuta/interfaces/ianjuta-message-manager.h>
+#include <libanjuta/interfaces/ianjuta-editor.h>
 #include "plugin.h"
 
 G_BEGIN_DECLS
@@ -61,7 +62,9 @@ gchar *git_pane_get_log_from_text_view (GtkTextView *text_view);
 gboolean git_pane_check_input (GtkWidget *parent, GtkWidget *widget, 
                                const gchar *input, const gchar *error_message);
 void git_pane_report_errors (AnjutaCommand *command, guint return_code, 
-                             Git *plugin);                      
+                             Git *plugin);
+void git_pane_send_raw_output_to_editor (AnjutaCommand *command, 
+                                         IAnjutaEditor *editor);
 
 G_END_DECLS
 



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