[Goodies-commits] r5220 - in thunar-shares-plugin/trunk: . thunar-plugin

Daniel Morales danielm at xfce.org
Tue Aug 12 16:57:00 CEST 2008


Author: danielm
Date: 2008-08-12 14:57:00 +0000 (Tue, 12 Aug 2008)
New Revision: 5220

Added:
   thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c
   thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.h
Removed:
   thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.c
   thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.h
   thunar-shares-plugin/trunk/thunar-plugin/tsp-prefs-provider.c
   thunar-shares-plugin/trunk/thunar-plugin/tsp-prefs-provider.h
Modified:
   thunar-shares-plugin/trunk/ChangeLog
   thunar-shares-plugin/trunk/thunar-plugin/Makefile.am
   thunar-shares-plugin/trunk/thunar-plugin/thunar-shares-plugin.c
Log:
	* thunar-plugin/tsp-provider.[ch]: New files
	* thunar-plugin/tsp-prefs-provider.[ch]:
	* thunar-plugin/tsp-page-provider.[ch]: Removed files
	* thunar-plugin/Makefile.am: Let's just use only one Provider that
	implements PageProviderIface and PreferencesProviderIface. (both are
	now on tsp-provider) $
 

Modified: thunar-shares-plugin/trunk/ChangeLog
===================================================================
--- thunar-shares-plugin/trunk/ChangeLog	2008-08-12 09:28:18 UTC (rev 5219)
+++ thunar-shares-plugin/trunk/ChangeLog	2008-08-12 14:57:00 UTC (rev 5220)
@@ -1,3 +1,12 @@
+2008-08-12	Daniel Morales <daniel at daniel.com.uy>
+
+	* thunar-plugin/tsp-provider.[ch]: New files
+	* thunar-plugin/tsp-prefs-provider.[ch]:
+	* thunar-plugin/tsp-page-provider.[ch]: Removed files
+	* thunar-plugin/Makefile.am: Let's just use only one Provider that
+	implements PageProviderIface and PreferencesProviderIface. (both are
+	now on tsp-provider)
+
 2008-08-07	Daniel Morales <daniel at daniel.com.uy>
 
 	* thunar-plugin/tsp-page.c: Keep the share-page sync if we have 2

Modified: thunar-shares-plugin/trunk/thunar-plugin/Makefile.am
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/Makefile.am	2008-08-12 09:28:18 UTC (rev 5219)
+++ thunar-shares-plugin/trunk/thunar-plugin/Makefile.am	2008-08-12 14:57:00 UTC (rev 5220)
@@ -14,9 +14,8 @@
 	thunar-shares-plugin.c					\
 	tsp-page.c		tsp-page.h			\
 	tsp-admin.c		tsp-admin.h			\
-	tsp-admin-editor.c	tsp-admin-editor.h		\
-	tsp-page-provider.c	tsp-page-provider.h		\
-	tsp-prefs-provider.c	tsp-prefs-provider.h
+	tsp-provider.c		tsp-provider.h			\
+	tsp-admin-editor.c	tsp-admin-editor.h
 
 thunar_shares_plugin_la_CFLAGS =				\
 	$(PLATFORM_CFLAGS)					\

Modified: thunar-shares-plugin/trunk/thunar-plugin/thunar-shares-plugin.c
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/thunar-shares-plugin.c	2008-08-12 09:28:18 UTC (rev 5219)
+++ thunar-shares-plugin/trunk/thunar-plugin/thunar-shares-plugin.c	2008-08-12 14:57:00 UTC (rev 5220)
@@ -25,11 +25,10 @@
 #include <glib/gi18n.h>
 #include <libshares/shares.h>
 
-#include "tsp-page-provider.h"
-#include "tsp-prefs-provider.h"
+#include "tsp-provider.h"
 #include "tsp-page.h"
 
-static GType type_list[2];
+static GType type_list[1];
 
 G_MODULE_EXPORT void
 thunar_extension_initialize (ThunarxProviderPlugin *plugin)
@@ -57,11 +56,9 @@
 	/* register the types provided by this plugin */
 	tsp_page_register_type (plugin);
 	tsp_provider_register_type (plugin);
-	tsp_preferences_register_type (plugin);
 
 	/* setup the plugin provider type list */
 	type_list[0] = TSP_TYPE_PROVIDER;
-	type_list[1] = TSP_TYPE_PREFERENCES;
 }
 
 G_MODULE_EXPORT void

Deleted: thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.c

Deleted: thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.h

Deleted: thunar-shares-plugin/trunk/thunar-plugin/tsp-prefs-provider.c

Deleted: thunar-shares-plugin/trunk/thunar-plugin/tsp-prefs-provider.h

Copied: thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c (from rev 5208, thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.c)
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c	                        (rev 0)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c	2008-08-12 14:57:00 UTC (rev 5220)
@@ -0,0 +1,141 @@
+/* vim: set ts=4 sw=8 noet ai nocindent syntax=c: */
+/*
+ * Copyright (C) 2008 Daniel Morales <daniel at daniel.com.uy>
+ *
+ * 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
+
+#include <thunarx/thunarx.h>
+#include <thunar-vfs/thunar-vfs.h>
+
+#include "tsp-provider.h"
+#include "tsp-page.h"
+#include "tsp-admin.h"
+
+static void   tsp_provider_class_init          (TspProviderClass                 *klass);
+static void   tsp_provider_init                (TspProvider                      *tsp_provider);
+static void   tsp_provider_finalize            (GObject                          *object);
+
+static void   tsp_provider_page_provider_init  (ThunarxPropertyPageProviderIface *iface);
+static void   tsp_provider_prefs_provider_init (ThunarxPreferencesProviderIface  *iface);
+
+static GList *tsp_provider_get_pages           (ThunarxPropertyPageProvider      *provider,
+                                                GList                            *files);
+
+static GList *tsp_provider_get_actions         (ThunarxPreferencesProvider       *provider,
+                                                GtkWidget                        *window);
+
+static void   tsp_provider_prefs_activated     (GtkWindow                        *window);
+
+struct _TspProviderClass
+{
+	GObjectClass  __parent__;
+};
+
+struct _TspProvider
+{
+	GObject       __parent__;
+};
+
+THUNARX_DEFINE_TYPE_WITH_CODE (TspProvider,
+                               tsp_provider,
+                               G_TYPE_OBJECT,
+                               THUNARX_IMPLEMENT_INTERFACE (THUNARX_TYPE_PROPERTY_PAGE_PROVIDER,
+                                                            tsp_provider_page_provider_init)
+                               THUNARX_IMPLEMENT_INTERFACE (THUNARX_TYPE_PREFERENCES_PROVIDER,
+                                                            tsp_provider_prefs_provider_init));
+
+static void
+tsp_provider_class_init (TspProviderClass *klass)
+{
+	GObjectClass *gobject_class;
+
+	gobject_class = G_OBJECT_CLASS (klass);
+	gobject_class->finalize = tsp_provider_finalize;
+}
+
+static void
+tsp_provider_init (TspProvider *tsp_provider)
+{
+	/* Bleh..! */
+}
+
+static void
+tsp_provider_finalize (GObject *object)
+{
+	/*TspProvider *tsp_provider = TSP_PROVIDER (object);*/
+ 
+	(*G_OBJECT_CLASS (tsp_provider_parent_class)->finalize) (object);
+}
+
+static void
+tsp_provider_page_provider_init (ThunarxPropertyPageProviderIface *iface)
+{
+	iface->get_pages = tsp_provider_get_pages;
+}
+
+static void
+tsp_provider_prefs_provider_init (ThunarxPreferencesProviderIface *iface)
+{
+	 iface->get_actions = tsp_provider_get_actions;
+}
+
+static GList*
+tsp_provider_get_pages (ThunarxPropertyPageProvider *property_page_provider,
+                        GList                       *files)
+{
+	if (g_list_length (files) != 1){
+		return NULL;
+	} else if (!thunarx_file_info_is_directory (THUNARX_FILE_INFO (files->data))){
+		return NULL;
+	}
+
+	return g_list_append (NULL, (gpointer)tsp_page_new (files->data));
+}
+
+static GList*
+tsp_provider_get_actions (ThunarxPreferencesProvider *provider,
+                          GtkWidget               *window)
+{
+	GtkAction *action;
+	GClosure  *closure;
+
+	action = gtk_action_new ("Tsp::thunar-shares-admin",
+                            _("Manage shared folders..."),
+                            _("Add, edit and remove shared folders"),
+                            NULL);
+
+	g_object_set (G_OBJECT (action),
+                  "icon-name", "gnome-fs-share",
+                  NULL);
+
+	closure = g_cclosure_new_object_swap (
+                G_CALLBACK (tsp_provider_prefs_activated), G_OBJECT (window));
+
+	g_signal_connect_closure (G_OBJECT (action), "activate", closure, TRUE);
+
+	return g_list_prepend (NULL, action);
+}
+
+static void
+tsp_provider_prefs_activated (GtkWindow *window)
+{
+	tsp_admin_dialog_show (window);
+}

Copied: thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.h (from rev 5208, thunar-shares-plugin/trunk/thunar-plugin/tsp-page-provider.h)
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.h	                        (rev 0)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.h	2008-08-12 14:57:00 UTC (rev 5220)
@@ -0,0 +1,43 @@
+/* vim: set ts=4 sw=8 noet ai nocindent syntax=c: */
+/*
+ * Copyright (C) 2008 Daniel Morales <daniel at daniel.com.uy>
+ *
+ * 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 __TSP_PROVIDER_H__
+#define __TSP_PROVIDER_H__
+
+#include <thunarx/thunarx.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _TspProviderClass      TspProviderClass;
+typedef struct _TspProvider           TspProvider;
+
+#define TSP_TYPE_PROVIDER             (tsp_provider_get_type ())
+#define TSP_PROVIDER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TSP_TYPE_PROVIDER, TspProvider))
+#define TSP_PROVIDER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TSP_TYPE_PROVIDER, TspProviderClass))
+#define TSP_IS_PROVIDER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TSP_TYPE_PROVIDER))
+#define TSP_IS_PROVIDER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TSP_TYPE_PROVIDER))
+#define TSP_PROVIDER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TSP_TYPE_PROVIDER, TspProviderClass))
+
+GType tsp_provider_get_type           (void) G_GNUC_CONST G_GNUC_INTERNAL;
+void  tsp_provider_register_type      (ThunarxProviderPlugin *plugin) G_GNUC_INTERNAL;
+
+G_END_DECLS;
+
+#endif /* __TSP_PROVIDER_H__ */




More information about the Goodies-commits mailing list