From 147ec6386ec6bb66e5e7e53cb878db66aea6f66d Mon Sep 17 00:00:00 2001 From: Andrew Sobala Date: Mon, 21 Jul 2003 21:35:24 +0000 Subject: [PATCH] As per comments on Usability@gnome.org: Removed "Apply theme" context menu 2003-07-21 Andrew Sobala As per comments on Usability@gnome.org: * Removed "Apply theme" context menu item * Made themes apply when you click on them instead --- vfs-methods/themus/ChangeLog | 6 ++ vfs-methods/themus/Makefile.am | 27 ++++---- .../themus/Themus_Component.server.in.in | 19 ------ vfs-methods/themus/themus-component-main.c | 54 --------------- vfs-methods/themus/themus-component.h | 47 ------------- ...mus-component.c => themus-theme-applier.c} | 66 +++++++------------ vfs-methods/themus/themus.applications | 8 +++ vfs-methods/themus/themus.keys | 6 ++ vfs-methods/themus/themus.mime | 2 - 9 files changed, 56 insertions(+), 179 deletions(-) delete mode 100644 vfs-methods/themus/Themus_Component.server.in.in delete mode 100644 vfs-methods/themus/themus-component-main.c delete mode 100644 vfs-methods/themus/themus-component.h rename vfs-methods/themus/{themus-component.c => themus-theme-applier.c} (58%) create mode 100644 vfs-methods/themus/themus.applications create mode 100644 vfs-methods/themus/themus.keys delete mode 100644 vfs-methods/themus/themus.mime diff --git a/vfs-methods/themus/ChangeLog b/vfs-methods/themus/ChangeLog index 57edccbcb..769137276 100644 --- a/vfs-methods/themus/ChangeLog +++ b/vfs-methods/themus/ChangeLog @@ -1,3 +1,9 @@ +2003-07-21 Andrew Sobala + + As per comments on Usability@gnome.org: + * Removed "Apply theme" context menu item + * Made themes apply when you click on them instead + 2003-07-20 Andrew Sobala * themus-component.c: (impl_Bonobo_Listener_event): apply diff --git a/vfs-methods/themus/Makefile.am b/vfs-methods/themus/Makefile.am index fdff3fcb3..90a58cdc1 100644 --- a/vfs-methods/themus/Makefile.am +++ b/vfs-methods/themus/Makefile.am @@ -6,13 +6,13 @@ INCLUDES = $(THEME_METHOD_CFLAGS) \ AM_CFLAGS = -g -bin_PROGRAMS = gnome-theme-thumbnailer +bin_PROGRAMS = gnome-theme-thumbnailer themus-theme-applier vfsmoduledir = $(libdir)/gnome-vfs-2.0/modules vfsmodule_LTLIBRARIES = libtheme-method.la bonobodir = $(libdir)/bonobo -bonobo_LTLIBRARIES = libthemus-theme-properties-view.la libthemus-component.la +bonobo_LTLIBRARIES = libthemus-theme-properties-view.la libtheme_method_la_LDFLAGS = -module -avoid-version \ -export-symbols-regex 'vfs_module_.*' @@ -25,13 +25,10 @@ gnome_theme_thumbnailer_LDADD = $(THEMUS_THUMBNAILER_LIBS) \ gnome_theme_thumbnailer_SOURCES = \ theme-thumbnailer.c -libthemus_component_la_LIBADD = $(THEMUS_COMPONENT_LIBS) \ +themus_theme_applier_LDADD = $(THEMUS_COMPONENT_LIBS) \ $(top_builddir)/capplets/common/libcommon.la -libthemus_component_la_LDFLAGS = -module -avoid-version -libthemus_component_la_SOURCES = \ - themus-component.c \ - themus-component.h \ - themus-component-main.c +themus_theme_applier_SOURCES = \ + themus-theme-applier.c libthemus_theme_properties_view_la_LIBADD = $(THEMUS_COMPONENT_LIBS) \ $(top_builddir)/capplets/common/libcommon.la @@ -53,17 +50,20 @@ schemasdir = $(sysconfdir)/gconf/schemas schemas_in_files = themus.schemas.in schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) -server_in_files = Themus_Component.server.in.in Themus_Properties_View.server.in.in +mimeinfodir = $(datadir)/mime-info +mimeinfo_DATA = themus.keys + +appregdir = $(datadir)/application-registry +appreg_DATA = themus.applications + +server_in_files = Themus_Properties_View.server.in.in serverdir = $(libdir)/bonobo/servers server_DATA = $(server_in_files:.server.in.in=.server) -Themus_Component.server.in: Themus_Component.server.in.in - sed -e "s|\@BONOBODIR\@|$(bonobodir)|" $< > $@ - Themus_Properties_View.server.in: Themus_Properties_View.server.in.in sed -e "s|\@BONOBODIR\@|$(bonobodir)|" $< > $@ -CLEANFILES = Themus_Component.server Themus_Component.server.in Themus_Properties_View.server Themus_Properties_View.server.in +CLEANFILES = Themus_Properties_View.server Themus_Properties_View.server.in install-data-local: if test -z "$(DESTDIR)"; then \ @@ -78,7 +78,6 @@ EXTRA_DIST = \ theme-method.directory.in \ theme-method.conf \ themus.schemas.in \ - Themus_Component.server.in.in \ Themus_Properties_View.server.in.in \ ChangeLog diff --git a/vfs-methods/themus/Themus_Component.server.in.in b/vfs-methods/themus/Themus_Component.server.in.in deleted file mode 100644 index bdb6476ab..000000000 --- a/vfs-methods/themus/Themus_Component.server.in.in +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/vfs-methods/themus/themus-component-main.c b/vfs-methods/themus/themus-component-main.c deleted file mode 100644 index 6ae32f799..000000000 --- a/vfs-methods/themus/themus-component-main.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- mode: C; c-basic-offset: 4 -*- - * themus - utilities for GNOME themes - * Copyright (C) 2000, 2001 Eazel Inc. - * Copyright (C) 2003 Andrew Sobala - * - * This library 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.1 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 - * General Public License for more details. - * - * You should have received a copy of the GNU 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 -*/ - -/* libmain.c - object activation infrastructure for shared library - version of tree view. */ - -#include -#include "themus-component.h" -#include -#include - -#define VIEW_IID_APPLY "OAFIID:Themus_Component_Apply" - -static CORBA_Object -image_shlib_make_object (PortableServer_POA poa, - const char *iid, - gpointer impl_ptr, - CORBA_Environment *ev) -{ - ThemusComponent *component; - - component = g_object_new (TYPE_THEMUS_COMPONENT, NULL); - - bonobo_activation_plugin_use (poa, impl_ptr); - - return CORBA_Object_duplicate (BONOBO_OBJREF (component), ev); -} - -static const BonoboActivationPluginObject plugin_list[] = { - { VIEW_IID_APPLY, image_shlib_make_object }, - { NULL } -}; - -const BonoboActivationPlugin Bonobo_Plugin_info = { - plugin_list, - "Themus Component" -}; diff --git a/vfs-methods/themus/themus-component.h b/vfs-methods/themus/themus-component.h deleted file mode 100644 index cac3c6904..000000000 --- a/vfs-methods/themus/themus-component.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* - * Copyright (C) 2002 James Willcox - * - * 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. - * - * Author: James Willcox - */ - -#ifndef THEMUS_COMPONENT_H -#define THEMUS_COMPONENT_H - -#include - -GType themus_component_get_type (void); - -#define TYPE_THEMUS_COMPONENT (themus_component_get_type ()) -#define THEMUS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEMUS_COMPONENT, ThemusComponent)) -#define THEMUS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEMUS_COMPONENT, ThemusComponentClass)) -#define IS_THEMUS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEMUS_COMPONENT)) -#define IS_THEMUS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEMUS_COMPONENT)) - -typedef struct { - BonoboObject parent; -} ThemusComponent; - -typedef struct { - BonoboObjectClass parent; - - POA_Bonobo_Listener__epv epv; -} ThemusComponentClass; - -#endif /* THEMUS_COMPONENT_H */ diff --git a/vfs-methods/themus/themus-component.c b/vfs-methods/themus/themus-theme-applier.c similarity index 58% rename from vfs-methods/themus/themus-component.c rename to vfs-methods/themus/themus-theme-applier.c index b4a5fd056..d56f4d1c1 100644 --- a/vfs-methods/themus/themus-component.c +++ b/vfs-methods/themus/themus-theme-applier.c @@ -17,9 +17,10 @@ * Boston, MA 02111-1307, USA. */ +#include +#include #include #include -#include "themus-component.h" #include #include #include @@ -28,35 +29,33 @@ #define FONT_KEY "/desktop/gnome/interface/font_name" -static void -impl_Bonobo_Listener_event (PortableServer_Servant servant, - const CORBA_char *event_name, - const CORBA_any *args, - CORBA_Environment *ev) +int main (int argc, char* argv[]) { - ThemusComponent *component; - const CORBA_sequence_CORBA_string *list; - + GValue value = { 0, }; GnomeVFSURI *uri; GnomeThemeMetaInfo *theme; GConfClient *client; + GnomeProgram *program; + poptContext ctx; + gchar **args; - component = THEMUS_COMPONENT (bonobo_object_from_servant (servant)); - - if (!CORBA_TypeCode_equivalent (args->_type, TC_CORBA_sequence_CORBA_string, ev)) { - return; - } - - list = (CORBA_sequence_CORBA_string *)args->_value; - - g_return_if_fail (component != NULL); - g_return_if_fail (list != NULL); + program = gnome_program_init ("ThemeApplier", "0.3.0", LIBGNOMEUI_MODULE, argc, + argv, GNOME_PARAM_NONE); - if (strcmp (event_name, "ApplyTheme") == 0) { - uri = gnome_vfs_uri_new (list->_buffer[0]); + g_value_init (&value, G_TYPE_POINTER); + g_object_get_property (G_OBJECT (program), GNOME_PARAM_POPT_CONTEXT, &value); + ctx = g_value_get_pointer (&value); + g_value_unset (&value); + args = (char**) poptGetArgs(ctx); + + if (args) + { + gnome_vfs_init (); + gnome_theme_init (FALSE); + + uri = gnome_vfs_uri_new (args[0]); g_assert (uri != NULL); - theme = gnome_theme_read_meta_theme (uri); gnome_vfs_uri_unref (uri); @@ -68,26 +67,7 @@ impl_Bonobo_Listener_event (PortableServer_Servant servant, client = gconf_client_get_default (); gconf_client_set_string (client, FONT_KEY, theme->application_font, NULL); } + return 0; } + else return 1; } - - -/* initialize the class */ -static void -themus_component_class_init (ThemusComponentClass *class) -{ - POA_Bonobo_Listener__epv *epv = &class->epv; - epv->event = impl_Bonobo_Listener_event; -} - - -static void -themus_component_init (ThemusComponent *component) -{ - gnome_theme_init (FALSE); -} - -BONOBO_TYPE_FUNC_FULL (ThemusComponent, - Bonobo_Listener, - BONOBO_TYPE_OBJECT, - themus_component); diff --git a/vfs-methods/themus/themus.applications b/vfs-methods/themus/themus.applications new file mode 100644 index 000000000..123bb95f4 --- /dev/null +++ b/vfs-methods/themus/themus.applications @@ -0,0 +1,8 @@ +themus-theme-applier + command=themus-theme-applier + name=Apply theme + can_open_multiple_files=false + expects_uris=true + requires_terminal=false + supported_uri_schemes=themes + mime_types=application/x-gnome-theme-installed diff --git a/vfs-methods/themus/themus.keys b/vfs-methods/themus/themus.keys new file mode 100644 index 000000000..211004614 --- /dev/null +++ b/vfs-methods/themus/themus.keys @@ -0,0 +1,6 @@ +application/x-gnome-theme-installed + default_action_type=application + default_application_id=themus-theme-applier + short_list_application_ids_for_novice_user_level=themus-theme-applier + short_list_application_ids_for_intermediate_user_level=themus-theme-applier + short_list_application_ids_for_advanced_user_level=themus-theme-applier diff --git a/vfs-methods/themus/themus.mime b/vfs-methods/themus/themus.mime deleted file mode 100644 index 331f01b3f..000000000 --- a/vfs-methods/themus/themus.mime +++ /dev/null @@ -1,2 +0,0 @@ -application/x-theme: - ext: theme