[Xfce4-commits] <thunar-vcs-plugin:master> Expose --no-diff-deleted option in svn diff dialog.
Stefan Sperling
noreply at xfce.org
Thu Sep 6 23:48:03 CEST 2012
Updating branch refs/heads/master
to 2b5cc2bc0c0db2a3f8c23361235ac5c0c3b26274 (commit)
from cc6576a67296eb3a5063af7ca5d17257ef9eb17f (commit)
commit 2b5cc2bc0c0db2a3f8c23361235ac5c0c3b26274
Author: Stefan Sperling <stsp at stsp.name>
Date: Wed Sep 5 21:52:16 2012 +0200
Expose --no-diff-deleted option in svn diff dialog.
tvp-svn-helper/tsh-diff-dialog.c | 18 ++++++++++++++++--
tvp-svn-helper/tsh-diff-dialog.h | 1 +
tvp-svn-helper/tsh-diff.c | 5 +++--
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/tvp-svn-helper/tsh-diff-dialog.c b/tvp-svn-helper/tsh-diff-dialog.c
index 4f7def7..e079d7f 100644
--- a/tvp-svn-helper/tsh-diff-dialog.c
+++ b/tvp-svn-helper/tsh-diff-dialog.c
@@ -47,6 +47,7 @@ struct _TshDiffDialog
GtkWidget *refresh;
gint current_line;
GtkWidget *depth;
+ GtkWidget *no_diff_deleted;
#if CHECK_SVN_VERSION_S(1,7)
GtkWidget *show_copies_as_adds;
#endif
@@ -95,6 +96,7 @@ tsh_diff_dialog_init (TshDiffDialog *dialog)
GtkWidget *table;
GtkTreeModel *model;
GtkWidget *depth;
+ GtkWidget *no_diff_deleted;
#if CHECK_SVN_VERSION_S(1,7)
GtkWidget *show_copies_as_adds;
#endif
@@ -145,7 +147,7 @@ tsh_diff_dialog_init (TshDiffDialog *dialog)
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (refresh_clicked), dialog);
gtk_widget_hide (button);
- table = gtk_table_new (2, 1, FALSE);
+ table = gtk_table_new (2, 2, FALSE);
model = GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT));
dialog->depth = depth = gtk_combo_box_new_with_model (model);
@@ -196,9 +198,13 @@ tsh_diff_dialog_init (TshDiffDialog *dialog)
gtk_table_attach (GTK_TABLE (table), depth, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (depth);
+ dialog->no_diff_deleted = no_diff_deleted = gtk_check_button_new_with_label (_("Do not show differences for deleted files"));
+ gtk_table_attach (GTK_TABLE (table), no_diff_deleted, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_widget_show (no_diff_deleted);
+
#if CHECK_SVN_VERSION_S(1,7)
dialog->show_copies_as_adds = show_copies_as_adds = gtk_check_button_new_with_label (_("Show copies as additions"));
- gtk_table_attach (GTK_TABLE (table), show_copies_as_adds, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), show_copies_as_adds, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (show_copies_as_adds);
#endif
@@ -335,3 +341,11 @@ tsh_diff_dialog_get_show_copies_as_adds (TshDiffDialog *dialog)
return FALSE;
#endif
}
+
+gboolean
+tsh_diff_dialog_get_no_diff_deleted (TshDiffDialog *dialog)
+{
+ g_return_val_if_fail (TSH_IS_DIFF_DIALOG (dialog), FALSE);
+
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->no_diff_deleted));
+}
diff --git a/tvp-svn-helper/tsh-diff-dialog.h b/tvp-svn-helper/tsh-diff-dialog.h
index 63d06b7..cab61b4 100644
--- a/tvp-svn-helper/tsh-diff-dialog.h
+++ b/tvp-svn-helper/tsh-diff-dialog.h
@@ -47,6 +47,7 @@ void tsh_diff_dialog_done (TshDiffDialog *dialog);
svn_depth_t tsh_diff_dialog_get_depth (TshDiffDialog *dialog);
gboolean tsh_diff_dialog_get_show_copies_as_adds (TshDiffDialog *dialog);
+gboolean tsh_diff_dialog_get_no_diff_deleted (TshDiffDialog *dialog);
G_END_DECLS;
diff --git a/tvp-svn-helper/tsh-diff.c b/tvp-svn-helper/tsh-diff.c
index 8304af4..8e1e7ce 100644
--- a/tvp-svn-helper/tsh-diff.c
+++ b/tvp-svn-helper/tsh-diff.c
@@ -61,6 +61,7 @@ static gpointer diff_thread (gpointer user_data)
TshDiffDialog *dialog = args->dialog;
svn_depth_t depth = tsh_diff_dialog_get_depth(dialog);
svn_boolean_t show_copies_as_adds = tsh_diff_dialog_get_show_copies_as_adds(dialog);
+ svn_boolean_t no_diff_deleted = tsh_diff_dialog_get_no_diff_deleted(dialog);
gchar **files = args->files;
gint size, i;
GtkWidget *error;
@@ -117,11 +118,11 @@ static gpointer diff_thread (gpointer user_data)
#if CHECK_SVN_VERSION_S(1,6)
if ((err = svn_client_diff4(NULL, path, &revision1, path, &revision2,
NULL, depth, FALSE,
- FALSE, FALSE, APR_LOCALE_CHARSET,
+ no_diff_deleted, FALSE, APR_LOCALE_CHARSET,
outfile, errfile, NULL, ctx, subpool)))
#else /* CHECK_SVN_VERSION(1,7) */
if ((err = svn_client_diff5(NULL, path, &revision1, path, &revision2,
- NULL, depth, FALSE, FALSE,
+ NULL, depth, FALSE, no_diff_deleted,
show_copies_as_adds, FALSE, FALSE, APR_LOCALE_CHARSET,
outfile, errfile, NULL, ctx, subpool)))
#endif
More information about the Xfce4-commits
mailing list