As per comments on Usability@gnome.org: Removed "Apply theme" context menu

2003-07-21  Andrew Sobala  <aes@gnome.org>

        As per comments on Usability@gnome.org:
        * Removed "Apply theme" context menu item
        * Made themes apply when you click on them instead
This commit is contained in:
Andrew Sobala 2003-07-21 21:35:24 +00:00 committed by Andrew Sobala
parent 07d57fc02a
commit 147ec6386e
9 changed files with 56 additions and 179 deletions

View file

@ -1,3 +1,9 @@
2003-07-21 Andrew Sobala <aes@gnome.org>
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 <aes@gnome.org> 2003-07-20 Andrew Sobala <aes@gnome.org>
* themus-component.c: (impl_Bonobo_Listener_event): apply * themus-component.c: (impl_Bonobo_Listener_event): apply

View file

@ -6,13 +6,13 @@ INCLUDES = $(THEME_METHOD_CFLAGS) \
AM_CFLAGS = -g AM_CFLAGS = -g
bin_PROGRAMS = gnome-theme-thumbnailer bin_PROGRAMS = gnome-theme-thumbnailer themus-theme-applier
vfsmoduledir = $(libdir)/gnome-vfs-2.0/modules vfsmoduledir = $(libdir)/gnome-vfs-2.0/modules
vfsmodule_LTLIBRARIES = libtheme-method.la vfsmodule_LTLIBRARIES = libtheme-method.la
bonobodir = $(libdir)/bonobo 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 \ libtheme_method_la_LDFLAGS = -module -avoid-version \
-export-symbols-regex 'vfs_module_.*' -export-symbols-regex 'vfs_module_.*'
@ -25,13 +25,10 @@ gnome_theme_thumbnailer_LDADD = $(THEMUS_THUMBNAILER_LIBS) \
gnome_theme_thumbnailer_SOURCES = \ gnome_theme_thumbnailer_SOURCES = \
theme-thumbnailer.c theme-thumbnailer.c
libthemus_component_la_LIBADD = $(THEMUS_COMPONENT_LIBS) \ themus_theme_applier_LDADD = $(THEMUS_COMPONENT_LIBS) \
$(top_builddir)/capplets/common/libcommon.la $(top_builddir)/capplets/common/libcommon.la
libthemus_component_la_LDFLAGS = -module -avoid-version themus_theme_applier_SOURCES = \
libthemus_component_la_SOURCES = \ themus-theme-applier.c
themus-component.c \
themus-component.h \
themus-component-main.c
libthemus_theme_properties_view_la_LIBADD = $(THEMUS_COMPONENT_LIBS) \ libthemus_theme_properties_view_la_LIBADD = $(THEMUS_COMPONENT_LIBS) \
$(top_builddir)/capplets/common/libcommon.la $(top_builddir)/capplets/common/libcommon.la
@ -53,17 +50,20 @@ schemasdir = $(sysconfdir)/gconf/schemas
schemas_in_files = themus.schemas.in schemas_in_files = themus.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) 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 serverdir = $(libdir)/bonobo/servers
server_DATA = $(server_in_files:.server.in.in=.server) 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 Themus_Properties_View.server.in: Themus_Properties_View.server.in.in
sed -e "s|\@BONOBODIR\@|$(bonobodir)|" $< > $@ 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: install-data-local:
if test -z "$(DESTDIR)"; then \ if test -z "$(DESTDIR)"; then \
@ -78,7 +78,6 @@ EXTRA_DIST = \
theme-method.directory.in \ theme-method.directory.in \
theme-method.conf \ theme-method.conf \
themus.schemas.in \ themus.schemas.in \
Themus_Component.server.in.in \
Themus_Properties_View.server.in.in \ Themus_Properties_View.server.in.in \
ChangeLog ChangeLog

View file

@ -1,19 +0,0 @@
<oaf_info>
<oaf_server iid="OAFIID:Themus_Component_Apply"
type="shlib" location="@BONOBODIR@/libthemus-component.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Listener:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" _value="Themus component apply theme operations"/>
<oaf_attribute name="description" type="string" _value="Themus component"/>
<oaf_attribute name="bonobo:supported_mime_types" type="stringv">
<item value="application/x-gnome-theme-installed"/>
</oaf_attribute>
<oaf_attribute name="nautilus:context_menu_handler" type="boolean" value="true"/>
<oaf_attribute name="nautilus:can_handle_multiple_files" type="boolean" value="false"/>
<oaf_attribute name="nautilusverb:ApplyTheme" type="string" _value="Apply theme..."/>
</oaf_server>
</oaf_info>

View file

@ -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 <aes@gnome.org>
*
* 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 <string.h>
#include "themus-component.h"
#include <bonobo.h>
#include <bonobo-activation/bonobo-activation.h>
#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"
};

View file

@ -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 <jwillcox@gnome.org>
*/
#ifndef THEMUS_COMPONENT_H
#define THEMUS_COMPONENT_H
#include <bonobo/bonobo-object.h>
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 */

View file

@ -17,9 +17,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include <libgnome/libgnome.h>
#include <libgnomeui/libgnomeui.h>
#include <libbonobo.h> #include <libbonobo.h>
#include <libgnomevfs/gnome-vfs.h> #include <libgnomevfs/gnome-vfs.h>
#include "themus-component.h"
#include <gnome-theme-info.h> #include <gnome-theme-info.h>
#include <gnome-theme-apply.h> #include <gnome-theme-apply.h>
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
@ -28,35 +29,33 @@
#define FONT_KEY "/desktop/gnome/interface/font_name" #define FONT_KEY "/desktop/gnome/interface/font_name"
static void int main (int argc, char* argv[])
impl_Bonobo_Listener_event (PortableServer_Servant servant,
const CORBA_char *event_name,
const CORBA_any *args,
CORBA_Environment *ev)
{ {
ThemusComponent *component; GValue value = { 0, };
const CORBA_sequence_CORBA_string *list;
GnomeVFSURI *uri; GnomeVFSURI *uri;
GnomeThemeMetaInfo *theme; GnomeThemeMetaInfo *theme;
GConfClient *client; GConfClient *client;
GnomeProgram *program;
poptContext ctx;
gchar **args;
component = THEMUS_COMPONENT (bonobo_object_from_servant (servant)); program = gnome_program_init ("ThemeApplier", "0.3.0", LIBGNOMEUI_MODULE, argc,
argv, GNOME_PARAM_NONE);
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);
if (strcmp (event_name, "ApplyTheme") == 0) { g_value_init (&value, G_TYPE_POINTER);
uri = gnome_vfs_uri_new (list->_buffer[0]); 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); g_assert (uri != NULL);
theme = gnome_theme_read_meta_theme (uri); theme = gnome_theme_read_meta_theme (uri);
gnome_vfs_uri_unref (uri); gnome_vfs_uri_unref (uri);
@ -68,26 +67,7 @@ impl_Bonobo_Listener_event (PortableServer_Servant servant,
client = gconf_client_get_default (); client = gconf_client_get_default ();
gconf_client_set_string (client, FONT_KEY, theme->application_font, NULL); 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);

View file

@ -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

View file

@ -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

View file

@ -1,2 +0,0 @@
application/x-theme:
ext: theme