anjuta r4598 - in trunk: . plugins/subversion
- From: jrliggett svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4598 - in trunk: . plugins/subversion
- Date: Sat, 17 Jan 2009 00:25:56 +0000 (UTC)
Author: jrliggett
Date: Sat Jan 17 00:25:56 2009
New Revision: 4598
URL: http://svn.gnome.org/viewvc/anjuta?rev=4598&view=rev
Log:
* plugins/subversion/subversion-diff-dialog.c
(subversion_show_diff), (on_subversion_diff_response),
(on_fm_subversion_diff):
When invoked from the file manager's context menu, the Subversion plugin's
Diff command now works immediately, bypassing the dialog.
Partially fixes Bug 565353 â View Log and Diff context menu commands should
act immediately
Modified:
trunk/ChangeLog
trunk/plugins/subversion/subversion-diff-dialog.c
Modified: trunk/plugins/subversion/subversion-diff-dialog.c
==============================================================================
--- trunk/plugins/subversion/subversion-diff-dialog.c (original)
+++ trunk/plugins/subversion/subversion-diff-dialog.c Sat Jan 17 00:25:56 2009
@@ -28,6 +28,62 @@
#include "subversion-diff-dialog.h"
static void
+subversion_show_diff (const gchar *path, gboolean recursive,
+ gboolean save_files, Subversion *plugin)
+{
+ IAnjutaDocumentManager *docman;
+ gchar *filename;
+ gchar *editor_name;
+ IAnjutaEditor *editor;
+ SvnDiffCommand *diff_command;
+ guint pulse_timer_id;
+
+ docman = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
+ IAnjutaDocumentManager, NULL);
+ filename = get_filename_from_full_path ((gchar *) path);
+ editor_name = g_strdup_printf ("%s %s.diff", _("[Head/Working Copy]"),
+ filename);
+ editor = ianjuta_document_manager_add_buffer(docman, editor_name,
+ "", NULL);
+
+ g_free (filename);
+ g_free (editor_name);
+
+ diff_command = svn_diff_command_new ((gchar *) path,
+ SVN_DIFF_REVISION_NONE,
+ SVN_DIFF_REVISION_NONE,
+ plugin->project_root_dir,
+ recursive);
+
+ pulse_timer_id = status_bar_progress_pulse (plugin,
+ _("Subversion: "
+ "Retrieving "
+ "diff..."));
+
+ g_signal_connect (G_OBJECT (diff_command), "command-finished",
+ G_CALLBACK (stop_status_bar_progress_pulse),
+ GUINT_TO_POINTER (pulse_timer_id));
+
+
+ g_signal_connect (G_OBJECT (diff_command), "command-finished",
+ G_CALLBACK (on_diff_command_finished),
+ plugin);
+
+ g_signal_connect (G_OBJECT (diff_command), "data-arrived",
+ G_CALLBACK (send_diff_command_output_to_editor),
+ editor);
+
+ g_object_weak_ref (G_OBJECT (editor),
+ (GWeakNotify) disconnect_data_arrived_signals,
+ diff_command);
+
+ if (save_files)
+ ianjuta_file_savable_save (IANJUTA_FILE_SAVABLE (docman), NULL);
+
+ anjuta_command_start (ANJUTA_COMMAND (diff_command));
+}
+
+static void
on_subversion_diff_response(GtkDialog* dialog, gint response, SubversionData* data)
{
GtkWidget *diff_path_entry;
@@ -37,19 +93,11 @@
const gchar *path;
const gchar *revision_text;
glong revision;
- IAnjutaDocumentManager *docman;
- gchar *filename;
- gchar *editor_name;
- IAnjutaEditor *editor;
- SvnDiffCommand *diff_command;
- guint pulse_timer_id;
switch (response)
{
case GTK_RESPONSE_OK:
{
- gchar *aux;
-
diff_path_entry = glade_xml_get_widget (data->gxml,
"diff_path_entry");
diff_no_recursive_check = glade_xml_get_widget (data->gxml,
@@ -67,52 +115,11 @@
{
break;
}
-
- docman = anjuta_shell_get_interface (ANJUTA_PLUGIN (data->plugin)->shell,
- IAnjutaDocumentManager, NULL);
- filename = get_filename_from_full_path ((gchar *) path);
-
- aux = g_strdup (_("[Head/Working Copy]"));
- editor_name = g_strdup_printf ("%s %s.diff", aux, filename);
- g_free (aux);
- editor = ianjuta_document_manager_add_buffer(docman, editor_name,
- "", NULL);
-
- g_free (filename);
- g_free (editor_name);
-
- diff_command = svn_diff_command_new ((gchar *) path,
- SVN_DIFF_REVISION_NONE,
- SVN_DIFF_REVISION_NONE,
- data->plugin->project_root_dir,
- !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (diff_no_recursive_check)));
-
- pulse_timer_id = status_bar_progress_pulse (data->plugin,
- _("Subversion: "
- "Retrieving "
- "diff..."));
-
- g_signal_connect (G_OBJECT (diff_command), "command-finished",
- G_CALLBACK (stop_status_bar_progress_pulse),
- GUINT_TO_POINTER (pulse_timer_id));
-
-
- g_signal_connect (G_OBJECT (diff_command), "command-finished",
- G_CALLBACK (on_diff_command_finished),
- data->plugin);
-
- g_signal_connect (G_OBJECT (diff_command), "data-arrived",
- G_CALLBACK (send_diff_command_output_to_editor),
- editor);
-
- g_object_weak_ref (G_OBJECT (editor),
- (GWeakNotify) disconnect_data_arrived_signals,
- diff_command);
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (diff_save_open_files_check)))
- ianjuta_file_savable_save (IANJUTA_FILE_SAVABLE (docman), NULL);
-
- anjuta_command_start (ANJUTA_COMMAND (diff_command));
+
+ subversion_show_diff (path,
+ !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (diff_no_recursive_check)),
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (diff_save_open_files_check)),
+ data->plugin);
subversion_data_free(data);
gtk_widget_destroy(GTK_WIDGET(dialog));
@@ -172,5 +179,5 @@
void
on_fm_subversion_diff (GtkAction *action, Subversion *plugin)
{
- subversion_diff_dialog (action, plugin, plugin->fm_current_filename);
+ subversion_show_diff (plugin->fm_current_filename, TRUE, FALSE, plugin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]