[Goodies-commits] r2873 - in thunar-svn-plugin/trunk: po tsp-svn-helper

Peter de Ridder peter at xfce.org
Thu Jun 28 00:53:23 CEST 2007


Author: peter
Date: 2007-06-27 22:53:23 +0000 (Wed, 27 Jun 2007)
New Revision: 2873

Added:
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.c
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.h
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.c
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.h
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.c
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.h
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.c
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.h
Removed:
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.c
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.h
Modified:
   thunar-svn-plugin/trunk/po/POTFILES.in
   thunar-svn-plugin/trunk/po/thunar-svn-plugin.pot
   thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update.c
Log:
added and moved some files


Modified: thunar-svn-plugin/trunk/po/POTFILES.in
===================================================================
--- thunar-svn-plugin/trunk/po/POTFILES.in	2007-06-27 22:27:21 UTC (rev 2872)
+++ thunar-svn-plugin/trunk/po/POTFILES.in	2007-06-27 22:53:23 UTC (rev 2873)
@@ -3,8 +3,9 @@
 thunar-svn-plugin/tsp-svn-action.c
 thunar-svn-plugin/tsp-svn-backend.c
 tsp-svn-helper/main.c
+tsp-svn-helper/tsh-checkout.c
 tsp-svn-helper/tsh-common.c
 tsp-svn-helper/tsh-dialog-common.c
 tsp-svn-helper/tsh-login-dialog.c
+tsp-svn-helper/tsh-notify-dialog.c
 tsp-svn-helper/tsh-update.c
-tsp-svn-helper/tsh-update-dialog.c

Modified: thunar-svn-plugin/trunk/po/thunar-svn-plugin.pot
===================================================================
--- thunar-svn-plugin/trunk/po/thunar-svn-plugin.pot	2007-06-27 22:27:21 UTC (rev 2872)
+++ thunar-svn-plugin/trunk/po/thunar-svn-plugin.pot	2007-06-27 22:53:23 UTC (rev 2873)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-06-03 23:13+0200\n"
+"POT-Creation-Date: 2007-06-28 00:37+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -22,10 +22,11 @@
 
 #. append the svn submenu action
 #: thunar-svn-plugin/tsp-provider.c:409 thunar-svn-plugin/tsp-provider.c:444
+#: thunar-svn-plugin/tsp-provider.c:452
 msgid "SVN"
 msgstr ""
 
-#: thunar-svn-plugin/tsp-provider.c:455
+#: thunar-svn-plugin/tsp-provider.c:457
 msgid "SVN _Checkout"
 msgstr ""
 
@@ -93,72 +94,79 @@
 msgid "Unlock"
 msgstr ""
 
-#: thunar-svn-plugin/tsp-svn-action.c:377
-#: tsp-svn-helper/tsh-update-dialog.c:102
+#: thunar-svn-plugin/tsp-svn-action.c:377 tsp-svn-helper/tsh-update.c:105
 msgid "Update"
 msgstr ""
 
-#: tsp-svn-helper/main.c:55
+#: tsp-svn-helper/main.c:56
 msgid "Print version information"
 msgstr ""
 
-#: tsp-svn-helper/main.c:62
+#: tsp-svn-helper/main.c:63
 msgid "Execute checkout action"
 msgstr ""
 
-#: tsp-svn-helper/main.c:68
+#: tsp-svn-helper/main.c:69
 msgid "Execute update action"
 msgstr ""
 
-#: tsp-svn-helper/tsh-login-dialog.c:65
-msgid "_Username:"
+#: tsp-svn-helper/tsh-checkout.c:87
+msgid "Checkout"
 msgstr ""
 
-#: tsp-svn-helper/tsh-login-dialog.c:81
-msgid "_Password:"
-msgstr ""
-
-#: tsp-svn-helper/tsh-login-dialog.c:98
-msgid "Remember"
-msgstr ""
-
-#: tsp-svn-helper/tsh-login-dialog.c:106
-msgid "Login"
-msgstr ""
-
-#: tsp-svn-helper/tsh-update.c:52
+#: tsp-svn-helper/tsh-common.c:448
 msgid "Deleted"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update.c:55
+#: tsp-svn-helper/tsh-common.c:453
 msgid "Added"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update.c:58
+#: tsp-svn-helper/tsh-common.c:458
 msgid "Updated"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update.c:61
+#: tsp-svn-helper/tsh-common.c:462
 #, c-format
 msgid "At revision: %li"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update.c:62
+#: tsp-svn-helper/tsh-common.c:464
 msgid "Completed"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update.c:65
+#: tsp-svn-helper/tsh-common.c:469
 msgid "External"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update-dialog.c:75
+#: tsp-svn-helper/tsh-login-dialog.c:65
+msgid "_Username:"
+msgstr ""
+
+#: tsp-svn-helper/tsh-login-dialog.c:81
+msgid "_Password:"
+msgstr ""
+
+#: tsp-svn-helper/tsh-login-dialog.c:98
+msgid "Remember"
+msgstr ""
+
+#: tsp-svn-helper/tsh-login-dialog.c:106
+msgid "Login"
+msgstr ""
+
+#: tsp-svn-helper/tsh-notify-dialog.c:75
 msgid "Action"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update-dialog.c:81
+#: tsp-svn-helper/tsh-notify-dialog.c:81
 msgid "Path"
 msgstr ""
 
-#: tsp-svn-helper/tsh-update-dialog.c:87
+#: tsp-svn-helper/tsh-notify-dialog.c:87
 msgid "Mime type"
 msgstr ""
+
+#: tsp-svn-helper/tsh-notify-dialog.c:102
+msgid "Notification"
+msgstr ""

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.c	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.c	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,102 @@
+/*-
+ * This program 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 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program 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, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <glib.h>
+#include <gtk/gtk.h>
+
+#include <thunar-vfs/thunar-vfs.h>
+
+#include <subversion-1/svn_cmdline.h>
+#include <subversion-1/svn_client.h>
+#include <subversion-1/svn_pools.h>
+#include <subversion-1/svn_config.h>
+#include <subversion-1/svn_fs.h>
+
+#include "tsh-common.h"
+#include "tsh-dialog-common.h"
+#include "tsh-notify-dialog.h"
+
+#include "tsh-checkout.h"
+
+struct thread_args {
+	svn_client_ctx_t *ctx;
+	apr_pool_t *pool;
+	TshNotifyDialog *dialog;
+	gchar *path;
+	gchar *url;
+};
+
+gpointer checkout_thread (gpointer user_data)
+{
+	struct thread_args *args = user_data;
+  svn_opt_revision_t revision;
+	svn_error_t *err;
+	svn_client_ctx_t *ctx = args->ctx;
+	apr_pool_t *pool = args->pool;
+	TshNotifyDialog *dialog = args->dialog;
+	gchar *path = args->path;
+	gchar *url = args->url;
+
+	g_free (args);
+
+  revision.kind = svn_opt_revision_head;
+	if ((err = svn_client_checkout2(NULL, url, path, &revision, &revision, TRUE, FALSE, ctx, pool)))
+	{
+		gdk_threads_enter();
+		tsh_notify_dialog_done (dialog);
+		gdk_threads_leave();
+
+		svn_handle_error2(err, stderr, FALSE, G_LOG_DOMAIN ": ");
+		svn_error_clear(err);
+		return GINT_TO_POINTER (FALSE);
+	}
+
+	gdk_threads_enter();
+	tsh_notify_dialog_done (dialog);
+	gdk_threads_leave();
+	
+	return GINT_TO_POINTER (TRUE);
+}
+
+GThread *tsh_checkout (gchar **files, svn_client_ctx_t *ctx, apr_pool_t *pool)
+{
+	GtkWidget *dialog;
+	struct thread_args *args;
+
+	dialog = tsh_notify_dialog_new (_("Checkout"), NULL, 0);
+	tsh_dialog_start (GTK_DIALOG (dialog), TRUE);
+
+	ctx->notify_func2 = tsh_notify_func2;
+	ctx->notify_baton2 = dialog;
+
+	args = g_malloc (sizeof (struct thread_args));
+	args->ctx = ctx;
+	args->pool = pool;
+	args->dialog = TSH_NOTIFY_DIALOG (dialog);
+	args->path = files[0];
+	args->url =	"http://svn.xfce.org/svn/goodies/thunar-svn-plugin/trunk/tsp-svn-helper";
+
+	return g_thread_create (checkout_thread, args, TRUE, NULL);
+}
+

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.h
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.h	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-checkout.h	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,27 @@
+/*-
+ * This program 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 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program 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, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __TSH_CHECKOUT_H__
+#define __TSH_CHECKOUT_H__
+
+G_BEGIN_DECLS
+
+GThread *tsh_checkout (gchar**, svn_client_ctx_t*, apr_pool_t*);
+
+G_END_DECLS
+
+#endif /*__TSH_CHECKOUT_H__*/
+

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.c	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.c	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,135 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <thunar-vfs/thunar-vfs.h>
+#include <gtk/gtk.h>
+
+#include "tsh-file-dialog.h"
+
+struct _TshFileDialog
+{
+	GtkDialog dialog;
+
+	GtkWidget *file_lbl;
+	GtkWidget *filename;
+	GtkWidget *may_save;
+};
+
+struct _TshFileDialogClass
+{
+	GtkDialogClass dialog_class;
+};
+
+G_DEFINE_TYPE (TshFileDialog, tsh_file_dialog, GTK_TYPE_DIALOG)
+
+static void
+tsh_file_dialog_class_init (TshFileDialogClass *klass)
+{
+}
+
+static void
+tsh_file_dialog_init (TshFileDialog *dialog)
+{
+	GtkWidget *table;
+
+	table = gtk_table_new (2, 2, FALSE);
+
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, FALSE, TRUE, 0);
+	gtk_widget_show (table);
+
+	dialog->file_lbl = gtk_label_new_with_mnemonic (_("_Certificate:"));
+	gtk_table_attach (GTK_TABLE (table), dialog->file_lbl,
+	                  0, 1, 0, 1,
+	                  GTK_SHRINK | GTK_FILL,
+	                  GTK_SHRINK | GTK_FILL,
+	                  0, 0);
+
+	dialog->filename = gtk_file_chooser_button_new (_("Select a file"), GTK_FILE_CHOOSER_ACTION_OPEN);
+	gtk_table_attach (GTK_TABLE (table), dialog->filename,
+	                  1, 2, 0, 1,
+	                  GTK_EXPAND | GTK_FILL,
+	                  GTK_SHRINK | GTK_FILL,
+	                  0, 0);
+
+	gtk_label_set_mnemonic_widget (GTK_LABEL (dialog->file_lbl), dialog->filename);
+	gtk_widget_show(dialog->file_lbl);
+	gtk_widget_show(dialog->filename);
+
+	dialog->may_save = gtk_check_button_new_with_label(_("Remember"));
+	gtk_table_attach (GTK_TABLE (table), dialog->may_save,
+	                  0, 2, 1, 2,
+	                  GTK_EXPAND | GTK_FILL,
+	                  GTK_SHRINK | GTK_FILL,
+	                  0, 0);
+	gtk_widget_show(dialog->may_save);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Certificate"));
+
+	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+	                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+	                        GTK_STOCK_OK, GTK_RESPONSE_OK,
+	                        NULL);
+	gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1);
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+
+	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+}
+
+GtkWidget*
+tsh_file_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, gboolean may_save)
+{
+	TshFileDialog *dialog = g_object_new (TSH_TYPE_FILE_DIALOG, NULL);
+
+	if(title)
+		gtk_window_set_title (GTK_WINDOW(dialog), title);
+
+	if(parent)
+		gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
+
+	if(flags & GTK_DIALOG_MODAL)
+		gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_DESTROY_WITH_PARENT)
+		gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_NO_SEPARATOR)
+		gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+
+	if(!may_save)
+		gtk_widget_set_sensitive(dialog->may_save, FALSE);
+
+	return GTK_WIDGET(dialog);
+}
+
+const gchar*
+tsh_file_dialog_get_filename (TshFileDialog *dialog)
+{
+	return gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->filename));
+}
+
+gboolean
+tsh_file_dialog_get_may_save (TshFileDialog *dialog)
+{
+	return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->may_save));
+}
+

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.h
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.h	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-file-dialog.h	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TSH_FILE_DIALOG_H__
+#define __TSH_FILE_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _TshFileDialogClass TshFileDialogClass;
+typedef struct _TshFileDialog      TshFileDialog;
+
+#define TSH_TYPE_FILE_DIALOG             (tsh_file_dialog_get_type ())
+#define TSH_FILE_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TSH_TYPE_FILE_DIALOG, TshFileDialog))
+#define TSH_FILE_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TSH_TYPE_FILE_DIALOG, TshFileDialogClass))
+#define TSH_IS_FILE_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TSH_TYPE_FILE_DIALOG))
+#define TSH_IS_FILE_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TSH_TYPE_FILE_DIALOG))
+#define TSH_FILE_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TSH_TYPE_FILE_DIALOG, TshFileDialogClass))
+
+GType      tsh_file_dialog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
+
+GtkWidget* tsh_file_dialog_new      (const gchar *title,
+                                      GtkWindow *parent,
+                                      GtkDialogFlags flags,
+                                      gboolean may_save) G_GNUC_MALLOC G_GNUC_INTERNAL;
+
+const gchar* tsh_file_dialog_get_filename (TshFileDialog*);
+gboolean     tsh_file_dialog_get_may_save (TshFileDialog*);
+
+G_END_DECLS;
+
+#endif /* !__TSH_FILE_DIALOG_H__ */

Copied: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.c (from rev 2871, thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.c)
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.c	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.c	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,174 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <thunar-vfs/thunar-vfs.h>
+#include <gtk/gtk.h>
+
+#include "tsh-update-dialog.h"
+
+static void cancel_clicked (GtkButton*, gpointer);
+
+struct _TshUpdateDialog
+{
+	GtkDialog dialog;
+
+	GtkWidget *tree_view;
+	GtkWidget *close;
+	GtkWidget *cancel;
+};
+
+struct _TshUpdateDialogClass
+{
+	GtkDialogClass dialog_class;
+};
+
+G_DEFINE_TYPE (TshUpdateDialog, tsh_update_dialog, GTK_TYPE_DIALOG)
+
+static void
+tsh_update_dialog_class_init (TshUpdateDialogClass *klass)
+{
+}
+
+enum {
+	COLUMN_ACTION = 0,
+	COLUMN_PATH,
+	COLUMN_MIME,
+	COLUMN_COUNT
+};
+
+static void
+tsh_update_dialog_init (TshUpdateDialog *dialog)
+{
+	GtkWidget *button;
+	GtkWidget *tree_view;
+	GtkWidget *scroll_window;
+	GtkCellRenderer *renderer;
+	GtkTreeModel *model;
+
+	scroll_window = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+	dialog->tree_view = tree_view = gtk_tree_view_new ();
+	
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
+	                                             -1, _("Action"),
+	                                             renderer, "text",
+	                                             COLUMN_ACTION, NULL);
+
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
+	                                             -1, _("Path"),
+	                                             renderer, "text",
+	                                             COLUMN_PATH, NULL);
+
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
+	                                             -1, _("Mime type"),
+	                                             renderer, "text",
+	                                             COLUMN_MIME, NULL);
+
+	model = GTK_TREE_MODEL (gtk_list_store_new (COLUMN_COUNT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING));
+
+	gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model);
+
+	g_object_unref (model);
+
+	gtk_container_add (GTK_CONTAINER (scroll_window), tree_view);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scroll_window, TRUE, TRUE, 0);
+	gtk_widget_show (tree_view);
+	gtk_widget_show (scroll_window);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Update"));
+
+	dialog->close = button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+	gtk_widget_hide (button);
+
+	dialog->cancel = button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
+	gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, FALSE, TRUE, 0);
+	g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel_clicked), dialog);
+	gtk_widget_show (button);
+
+	gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
+}
+
+GtkWidget*
+tsh_update_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogFlags flags)
+{
+	TshUpdateDialog *dialog = g_object_new (TSH_TYPE_UPDATE_DIALOG, NULL);
+
+	if(title)
+		gtk_window_set_title (GTK_WINDOW(dialog), title);
+
+	if(parent)
+		gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
+
+	if(flags & GTK_DIALOG_MODAL)
+		gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_DESTROY_WITH_PARENT)
+		gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_NO_SEPARATOR)
+		gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+
+	return GTK_WIDGET(dialog);
+}
+
+void       
+tsh_update_dialog_add (TshUpdateDialog *dialog, const char *action, const char *file, const char *mime_type)
+{
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	GtkTreePath *path;
+
+	model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->tree_view));
+
+	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+	gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+	                    COLUMN_ACTION, action,
+	                    COLUMN_PATH, file,
+	                    COLUMN_MIME, mime_type, 
+	                    -1);
+
+	path = gtk_tree_model_get_path (model, &iter);
+	gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dialog->tree_view), path, NULL, FALSE, 0, 0);
+	gtk_tree_path_free (path);
+}
+
+void
+tsh_update_dialog_done (TshUpdateDialog *dialog)
+{
+	gtk_widget_hide (dialog->cancel);
+	gtk_widget_show (dialog->close);
+}
+
+static void
+cancel_clicked (GtkButton *button, gpointer user_data)
+{
+	TshUpdateDialog *dialog = TSH_UPDATE_DIALOG (user_data);
+	
+	gtk_widget_hide (dialog->cancel);
+	gtk_widget_show (dialog->close);
+}
+

Copied: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.h (from rev 2871, thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.h)
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.h	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-notify-dialog.h	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TSH_UPDATE_DIALOG_H__
+#define __TSH_UPDATE_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _TshUpdateDialogClass TshUpdateDialogClass;
+typedef struct _TshUpdateDialog      TshUpdateDialog;
+
+#define TSH_TYPE_UPDATE_DIALOG             (tsh_update_dialog_get_type ())
+#define TSH_UPDATE_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TSH_TYPE_UPDATE_DIALOG, TshUpdateDialog))
+#define TSH_UPDATE_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TSH_TYPE_UPDATE_DIALOG, TshUpdateDialogClass))
+#define TSH_IS_UPDATE_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TSH_TYPE_UPDATE_DIALOG))
+#define TSH_IS_UPDATE_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TSH_TYPE_UPDATE_DIALOG))
+#define TSH_UPDATE_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TSH_TYPE_UPDATE_DIALOG, TshUpdateDialogClass))
+
+GType      tsh_update_dialog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
+
+GtkWidget* tsh_update_dialog_new      (const gchar *title,
+                                       GtkWindow *parent,
+                                       GtkDialogFlags flags) G_GNUC_MALLOC G_GNUC_INTERNAL;
+
+void       tsh_update_dialog_add      (TshUpdateDialog *dialog,
+                                       const char *action,
+                                       const char *path,
+                                       const char *mime_type);
+void       tsh_update_dialog_done     (TshUpdateDialog *dialog);
+
+G_END_DECLS;
+
+#endif /* !__TSH_UPDATE_DIALOG_H__ */

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.c	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.c	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,152 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <thunar-vfs/thunar-vfs.h>
+#include <gtk/gtk.h>
+
+#include <subversion-1/svn_auth.h>
+
+#include "tsh-trust-dialog.h"
+
+struct _TshTrustDialog
+{
+	GtkDialog dialog;
+
+	GtkWidget *notyetvalid;
+	GtkWidget *expired;
+	GtkWidget *cnmismatch;
+	GtkWidget *unknownca;
+	GtkWidget *other;
+	GtkWidget *may_save;
+};
+
+struct _TshTrustDialogClass
+{
+	GtkDialogClass dialog_class;
+};
+
+G_DEFINE_TYPE (TshTrustDialog, tsh_trust_dialog, GTK_TYPE_DIALOG)
+
+static void
+tsh_trust_dialog_class_init (TshTrustDialogClass *klass)
+{
+}
+
+static void
+tsh_trust_dialog_init (TshTrustDialog *dialog)
+{
+	dialog->notyetvalid = gtk_check_button_new_with_label (_("Certificate is not yet valid."));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->notyetvalid, FALSE, TRUE, 0);
+
+	dialog->expired = gtk_check_button_new_with_label (_("Certificate has expired."));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->expired, FALSE, TRUE, 0);
+
+	dialog->cnmismatch = gtk_check_button_new_with_label (_("Certificate does not match the remote hostname."));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->cnmismatch, FALSE, TRUE, 0);
+
+	dialog->unknownca = gtk_check_button_new_with_label (_("Certificate authority is unknown."));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->unknownca, FALSE, TRUE, 0);
+
+	dialog->other = gtk_check_button_new_with_label (_("Other failure."));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->other, FALSE, TRUE, 0);
+
+	dialog->may_save = gtk_check_button_new_with_label(_("Remember"));
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->may_save, FALSE, TRUE, 0);
+	gtk_widget_show(dialog->may_save);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Trust"));
+
+	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+	                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+	                        GTK_STOCK_OK, GTK_RESPONSE_OK,
+	                        NULL);
+	gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1);
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+
+	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+}
+
+GtkWidget*
+tsh_trust_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, guint32 failures, gboolean may_save)
+{
+	TshTrustDialog *dialog = g_object_new (TSH_TYPE_TRUST_DIALOG, NULL);
+
+	if(title)
+		gtk_window_set_title (GTK_WINDOW(dialog), title);
+
+	if(parent)
+		gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
+
+	if(flags & GTK_DIALOG_MODAL)
+		gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_DESTROY_WITH_PARENT)
+		gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
+
+	if(flags & GTK_DIALOG_NO_SEPARATOR)
+		gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+
+	if(failures & SVN_AUTH_SSL_NOTYETVALID)
+		gtk_widget_show(dialog->notyetvalid);
+
+	if(failures & SVN_AUTH_SSL_EXPIRED)
+		gtk_widget_show(dialog->expired);
+
+	if(failures & SVN_AUTH_SSL_CNMISMATCH)
+		gtk_widget_show(dialog->cnmismatch);
+
+	if(failures & SVN_AUTH_SSL_UNKNOWNCA)
+		gtk_widget_show(dialog->unknownca);
+
+	if(failures & SVN_AUTH_SSL_OTHER)
+		gtk_widget_show(dialog->other);
+
+	if(!may_save)
+		gtk_widget_set_sensitive(dialog->may_save, FALSE);
+
+	return GTK_WIDGET(dialog);
+}
+
+guint32
+tsh_trust_dialog_get_accepted (TshTrustDialog *dialog)
+{
+	guint32 failures = 0;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->notyetvalid)))
+		failures |= SVN_AUTH_SSL_NOTYETVALID;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->expired)))
+		failures |= SVN_AUTH_SSL_EXPIRED;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->cnmismatch)))
+		failures |= SVN_AUTH_SSL_CNMISMATCH;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->unknownca)))
+		failures |= SVN_AUTH_SSL_UNKNOWNCA;
+	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->other)))
+		failures |= SVN_AUTH_SSL_OTHER;
+	return failures;
+}
+
+gboolean
+tsh_trust_dialog_get_may_save (TshTrustDialog *dialog)
+{
+	return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->may_save));
+}
+

Added: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.h
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.h	                        (rev 0)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-trust-dialog.h	2007-06-27 22:53:23 UTC (rev 2873)
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TSH_TRUST_DIALOG_H__
+#define __TSH_TRUST_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _TshTrustDialogClass TshTrustDialogClass;
+typedef struct _TshTrustDialog      TshTrustDialog;
+
+#define TSH_TYPE_TRUST_DIALOG             (tsh_trust_dialog_get_type ())
+#define TSH_TRUST_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TSH_TYPE_TRUST_DIALOG, TshTrustDialog))
+#define TSH_TRUST_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TSH_TYPE_TRUST_DIALOG, TshTrustDialogClass))
+#define TSH_IS_TRUST_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TSH_TYPE_TRUST_DIALOG))
+#define TSH_IS_TRUST_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TSH_TYPE_TRUST_DIALOG))
+#define TSH_TRUST_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TSH_TYPE_TRUST_DIALOG, TshTrustDialogClass))
+
+GType      tsh_trust_dialog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
+
+GtkWidget* tsh_trust_dialog_new      (const gchar *title,
+                                      GtkWindow *parent,
+                                      GtkDialogFlags flags,
+                                      guint32 failures,
+                                      gboolean may_save) G_GNUC_MALLOC G_GNUC_INTERNAL;
+
+guint32      tsh_trust_dialog_get_accepted (TshTrustDialog *dialog);
+
+gboolean     tsh_trust_dialog_get_may_save (TshTrustDialog*);
+
+G_END_DECLS;
+
+#endif /* !__TSH_TRUST_DIALOG_H__ */

Deleted: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.c

Deleted: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update-dialog.h

Modified: thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update.c	2007-06-27 22:27:21 UTC (rev 2872)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/tsh-update.c	2007-06-27 22:53:23 UTC (rev 2873)
@@ -102,7 +102,7 @@
 	GtkWidget *dialog;
 	struct thread_args *args;
 
-	dialog = tsh_notify_dialog_new (NULL, NULL, 0);
+	dialog = tsh_notify_dialog_new (_("Update"), NULL, 0);
 	tsh_dialog_start (GTK_DIALOG (dialog), TRUE);
 
 	ctx->notify_func2 = tsh_notify_func2;




More information about the Goodies-commits mailing list