diff --git a/configure.ac b/configure.ac index f22a4cc83..9df2ca83d 100644 --- a/configure.ac +++ b/configure.ac @@ -93,7 +93,6 @@ PKG_CHECK_MODULES(CAPPLET, $COMMON_MODULES) PKG_CHECK_MODULES(GNOMECC_SHELL, $COMMON_MODULES libgnome-menu gio-unix-2.0) PKG_CHECK_MODULES(DBUS, dbus-1 dbus-glib-1) PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0) -PKG_CHECK_MODULES(DEFAULT_APPLICATIONS_CAPPLET, libxml-2.0) PKG_CHECK_MODULES(GSD_DBUS, gnome-settings-daemon >= 2.91.2) PKG_CHECK_MODULES(GIO, gio-2.0 gio-unix-2.0) PKG_CHECK_MODULES(XML, libxml-2.0) @@ -327,11 +326,6 @@ panels/background/gnome-background-panel.desktop.in panels/datetime/Makefile panels/datetime/gnome-datetime-panel.desktop.in panels/datetime/po-timezones/Makefile -panels/default-applications/Makefile -panels/default-applications/gnome-at-commandline.in -panels/default-applications/gnome-at-session.desktop.in -panels/default-applications/gnome-default-applications-panel.desktop.in -panels/default-applications/gnome-default-applications.pc panels/display/Makefile panels/display/gnome-display-panel.desktop.in panels/keyboard/Makefile diff --git a/panels/Makefile.am b/panels/Makefile.am index 78d71cccb..e43e42981 100644 --- a/panels/Makefile.am +++ b/panels/Makefile.am @@ -9,7 +9,6 @@ SUBDIRS= \ network \ info \ sound \ - default-applications \ keyboard \ universal-access \ user-accounts \ diff --git a/panels/default-applications/Makefile.am b/panels/default-applications/Makefile.am deleted file mode 100644 index 9aadf48fd..000000000 --- a/panels/default-applications/Makefile.am +++ /dev/null @@ -1,84 +0,0 @@ -# This is used in GNOMECC_CAPPLETS_CFLAGS -cappletname = default-applications - -ccpanelsdir = $(PANELS_DIR) -ccpanels_LTLIBRARIES = libdefault-applications.la - -libdefault_applications_la_SOURCES = \ - default-applications-module.c \ - cc-default-applications-panel.c cc-default-applications-panel.h \ - gnome-da-capplet.c gnome-da-capplet.h \ - gnome-da-xml.c gnome-da-xml.h \ - gnome-da-item.c gnome-da-item.h - -libdefault_applications_la_LIBADD = \ - $(PANEL_LIBS) \ - $(XML_LIBS) \ - $(GNOMECC_CAPPLETS_LIBS) - -libdefault_applications_la_LDFLAGS = $(PANEL_LDFLAGS) - -bin_SCRIPTS = gnome-at-visual gnome-at-mobility - -@INTLTOOL_DESKTOP_RULE@ - -uidir = $(pkgdatadir)/ui -dist_ui_DATA = gnome-default-applications-properties.ui - -gnome-at-visual: gnome-at-commandline.in - cp $< $@ - -gnome-at-mobility: gnome-at-commandline.in - cp $< $@ - -desktopdir = $(datadir)/applications -Desktop_in_files = gnome-default-applications-panel.desktop.in -desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) - -pkgconfigdir = $(datadir)/pkgconfig -pkgconfig_DATA = gnome-default-applications.pc - -autostartdir = $(sysconfdir)/xdg/autostart -autostart_in_files = gnome-at-session.desktop.in -autostart_DATA = $(autostart_in_files:.desktop.in=.desktop) - -xmldata_in_files = gnome-default-applications.xml.in -xmldatadir = $(pkgdatadir)/default-apps -xmldata_DATA = $(xmldata_in_files:.xml.in=.xml) -@INTLTOOL_XML_RULE@ - -INCLUDES = \ - $(GNOMECC_CAPPLETS_CFLAGS) \ - $(XML_CFLAGS) \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\"\ - -DGNOMECC_UI_DIR=\""$(uidir)"\" \ - -DGNOMECC_APPS_DIR=\""$(xmldatadir)"\" - -icons16dir = $(datadir)/icons/hicolor/16x16/apps -dist_icons16_DATA = icons/16x16/gnome-settings-default-applications.png -icons22dir = $(datadir)/icons/hicolor/22x22/apps -dist_icons22_DATA = icons/22x22/gnome-settings-default-applications.png -icons24dir = $(datadir)/icons/hicolor/24x24/apps -dist_icons24_DATA = icons/24x24/gnome-settings-default-applications.png -icons32dir = $(datadir)/icons/hicolor/32x32/apps -dist_icons32_DATA = icons/32x32/gnome-settings-default-applications.png -icons48dir = $(datadir)/icons/hicolor/48x48/apps -dist_icons48_DATA = icons/48x48/gnome-settings-default-applications.png - -gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor -uninstall-hook: update-icon-cache -install-data-hook: update-icon-cache -update-icon-cache: - @-if test -z "$(DESTDIR)"; then \ - echo "Updating Gtk icon cache."; \ - $(gtk_update_icon_cache); \ - else \ - echo "*** Icon cache not updated. After install, run this:"; \ - echo "*** $(gtk_update_icon_cache)"; \ - fi - - -CLEANFILES = $(Desktop_in_files) $(desktop_DATA) $(xmldata_DATA) $(autostart_DATA) $(bin_SCRIPTS) -EXTRA_DIST = $(xmldata_in_files) gnome-default-applications.pc.in - --include $(top_srcdir)/git.mk diff --git a/panels/default-applications/cc-default-applications-panel.c b/panels/default-applications/cc-default-applications-panel.c deleted file mode 100644 index e7ac0ec15..000000000 --- a/panels/default-applications/cc-default-applications-panel.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2010 Intel, Inc - * - * 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: Thomas Wood - * - */ - -#include "cc-default-applications-panel.h" - -#include "gnome-da-capplet.h" -#include "gnome-da-xml.h" - -G_DEFINE_DYNAMIC_TYPE (CcDefaultApplicationsPanel, cc_default_applications_panel, CC_TYPE_PANEL) - -#define DEFAULT_APPLICATIONS_PANEL_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_DEFAULT_APPLICATIONS_PANEL, CcDefaultApplicationsPanelPrivate)) - -struct _CcDefaultApplicationsPanelPrivate -{ - GnomeDACapplet *capplet; -}; - - -static void -cc_default_applications_panel_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - switch (property_id) - { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } -} - -static void -cc_default_applications_panel_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (property_id) - { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } -} - -static void -cc_default_applications_panel_dispose (GObject *object) -{ - CcDefaultApplicationsPanelPrivate *priv; - - priv = CC_DEFAULT_APPLICATIONS_PANEL (object)->priv; - - if (priv->capplet) - { - g_object_unref (priv->capplet->terminal_settings); - g_object_unref (priv->capplet->at_mobility_settings); - g_object_unref (priv->capplet->at_visual_settings); - - if (priv->capplet->theme_changed_id > 0) - { - g_signal_handler_disconnect (priv->capplet->icon_theme, - priv->capplet->theme_changed_id); - priv->capplet->theme_changed_id = 0; - } - - gnome_da_xml_free (priv->capplet); - - priv->capplet = NULL; - } - - G_OBJECT_CLASS (cc_default_applications_panel_parent_class)->dispose (object); -} - -static void -cc_default_applications_panel_finalize (GObject *object) -{ - G_OBJECT_CLASS (cc_default_applications_panel_parent_class)->finalize (object); -} - -static void -cc_default_applications_panel_class_init (CcDefaultApplicationsPanelClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (CcDefaultApplicationsPanelPrivate)); - - object_class->get_property = cc_default_applications_panel_get_property; - object_class->set_property = cc_default_applications_panel_set_property; - object_class->dispose = cc_default_applications_panel_dispose; - object_class->finalize = cc_default_applications_panel_finalize; -} - -static void -cc_default_applications_panel_class_finalize (CcDefaultApplicationsPanelClass *klass) -{ -} - -static void -cc_default_applications_panel_init (CcDefaultApplicationsPanel *self) -{ - CcDefaultApplicationsPanelPrivate *priv; - GtkWidget *widget; - - priv = self->priv = DEFAULT_APPLICATIONS_PANEL_PRIVATE (self); - - priv->capplet = g_new0 (GnomeDACapplet, 1); - priv->capplet->terminal_settings = g_settings_new ("org.gnome.desktop.default-applications.terminal"); - priv->capplet->at_mobility_settings = g_settings_new ("org.gnome.desktop.default-applications.at.mobility"); - priv->capplet->at_visual_settings = g_settings_new ("org.gnome.desktop.default-applications.at.visual"); - - gnome_default_applications_panel_init (priv->capplet); - - widget = (GtkWidget *) gtk_builder_get_object (priv->capplet->builder, - "preferred_apps_notebook"); - - gtk_widget_reparent (widget, (GtkWidget *) self); -} - -void -cc_default_applications_panel_register (GIOModule *module) -{ - cc_default_applications_panel_register_type (G_TYPE_MODULE (module)); - g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT, - CC_TYPE_DEFAULT_APPLICATIONS_PANEL, - "default-applications", 0); -} - diff --git a/panels/default-applications/cc-default-applications-panel.h b/panels/default-applications/cc-default-applications-panel.h deleted file mode 100644 index f72de8398..000000000 --- a/panels/default-applications/cc-default-applications-panel.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2010 Intel, Inc - * - * 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: Thomas Wood - * - */ - - -#ifndef _CC_DEFAULT_APPLICATIONS_PANEL_H -#define _CC_DEFAULT_APPLICATIONS_PANEL_H - -#include - -G_BEGIN_DECLS - -#define CC_TYPE_DEFAULT_APPLICATIONS_PANEL cc_default_applications_panel_get_type() - -#define CC_DEFAULT_APPLICATIONS_PANEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CC_TYPE_DEFAULT_APPLICATIONS_PANEL, CcDefaultApplicationsPanel)) - -#define CC_DEFAULT_APPLICATIONS_PANEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CC_TYPE_DEFAULT_APPLICATIONS_PANEL, CcDefaultApplicationsPanelClass)) - -#define CC_IS_DEFAULT_APPLICATIONS_PANEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CC_TYPE_DEFAULT_APPLICATIONS_PANEL)) - -#define CC_IS_DEFAULT_APPLICATIONS_PANEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CC_TYPE_DEFAULT_APPLICATIONS_PANEL)) - -#define CC_DEFAULT_APPLICATIONS_PANEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CC_TYPE_DEFAULT_APPLICATIONS_PANEL, CcDefaultApplicationsPanelClass)) - -typedef struct _CcDefaultApplicationsPanel CcDefaultApplicationsPanel; -typedef struct _CcDefaultApplicationsPanelClass CcDefaultApplicationsPanelClass; -typedef struct _CcDefaultApplicationsPanelPrivate CcDefaultApplicationsPanelPrivate; - -struct _CcDefaultApplicationsPanel -{ - CcPanel parent; - - CcDefaultApplicationsPanelPrivate *priv; -}; - -struct _CcDefaultApplicationsPanelClass -{ - CcPanelClass parent_class; -}; - -GType cc_default_applications_panel_get_type (void) G_GNUC_CONST; - -void cc_default_applications_panel_register (GIOModule *module); - -G_END_DECLS - -#endif /* _CC_DEFAULT_APPLICATIONS_PANEL_H */ diff --git a/panels/default-applications/default-applications-capplet.png b/panels/default-applications/default-applications-capplet.png deleted file mode 100644 index ad7fba116..000000000 Binary files a/panels/default-applications/default-applications-capplet.png and /dev/null differ diff --git a/panels/default-applications/default-applications-module.c b/panels/default-applications/default-applications-module.c deleted file mode 100644 index 458e447c1..000000000 --- a/panels/default-applications/default-applications-module.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2010 Intel, Inc - * - * 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: Thomas Wood - * - */ - -#include - -#include "cc-default-applications-panel.h" - -#include - -void -g_io_module_load (GIOModule *module) -{ - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - - /* register the panel */ - cc_default_applications_panel_register (module); -} - -void -g_io_module_unload (GIOModule *module) -{ -} diff --git a/panels/default-applications/gnome-at-commandline.in.in b/panels/default-applications/gnome-at-commandline.in.in deleted file mode 100644 index 80816f803..000000000 --- a/panels/default-applications/gnome-at-commandline.in.in +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -# -# Copyright 2006 IBM Corp. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of version 2 of the GNU General Public License -# as published by the Free Software Foundation -# -# 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 Street #330, Boston, MA 02111-1307, USA. -# -############################################################################### -# -# NOTE: This script is intended to be run from the command line, -# GNOME menu, or from the desktop autostart. -# -# /usr/bin/gnome-at-visual -# /usr/bin/gnome-at-mobility -# -# If the "-s" flag is used then it is assumed to have been invoked -# from /usr/share/gnome/autostart/, and the first AT flagged -# to "startup" from GCONF_ALL will be executed. -# - -USAGE="$0 [-s]" -GCONF_PATH=/desktop/gnome/applications/at -GCONF_VISUAL="visual" -GCONF_MOBILITY="mobility" -GCONF_ALL="$GCONF_VISUAL $GCONF_MOBILITY" - -run_at() { - CMDLINE=`gconftool-2 --get $GCONF_PATH/$1/exec` - if [ $? -ne 0 ]; then - exit $? - fi - - if [ -z "$CMDLINE" ]; then - exit 2 - fi - - STARTUP=`gconftool-2 --get $GCONF_PATH/$1/startup` - if [ $? -ne 0 ]; then - exit $? - fi - - if [ ! -z "$AUTOSTART" ]; then - # assuming ran from /usr/share/gnome/autostart - if [ "x$STARTUP" = "xtrue" ]; then - # gconf indicated requested autostart - ($CMDLINE &) - fi - else - # run from command line or desktop menu - ($CMDLINE &) - fi -} - -case `basename $0` in - gnome-at-visual ) - AT=$GCONF_VISUAL - ;; - gnome-at-mobility ) - AT=$GCONF_MOBILITY - ;; - gnome-at-session | * ) - AUTOSTART="yes" - AT=$GCONF_ALL - ;; -esac - -while getopts "s" options; do - case $options in - s ) AUTOSTART="yes" - AT=$GCONF_ALL - shift - ;; - \? ) echo $USAGE - exit 1 - ;; - * ) echo $USAGE - exit 1 - ;; - esac -done - -if [ $# -ne 0 ]; then - echo $USAGE - exit 1 -fi - -for I in $AT ; do - run_at $I -done - -#EOF diff --git a/panels/default-applications/gnome-at-session.desktop.in.in b/panels/default-applications/gnome-at-session.desktop.in.in deleted file mode 100644 index 9c1e24b3b..000000000 --- a/panels/default-applications/gnome-at-session.desktop.in.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -_Name=Visual Assistance -_Comment=Start the preferred visual assistive technology -Exec=gnome-at-visual -s -Icon=preferences-desktop-accessibility -Terminal=false -Type=Application -StartupNotify=false -OnlyShowIn=GNOME; -AutostartCondition=GNOME /desktop/gnome/interface/accessibility -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=other capplets -X-GNOME-Bugzilla-Version=@VERSION@ -X-GNOME-Autostart-enabled=true diff --git a/panels/default-applications/gnome-da-capplet.c b/panels/default-applications/gnome-da-capplet.c deleted file mode 100644 index 78e2a87e6..000000000 --- a/panels/default-applications/gnome-da-capplet.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * Copyright 2008 Thomas Wood - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "gnome-da-capplet.h" -#include "gnome-da-xml.h" -#include "gnome-da-item.h" - -enum -{ - PIXBUF_COL, - TEXT_COL, - N_COLUMNS -}; - -/* -static void -close_cb (GtkWidget *window, gint response, gpointer user_data) -{ - if (response == GTK_RESPONSE_HELP) { - capplet_help (GTK_WINDOW (window), "prefs-preferredapps"); - } - else { - gtk_widget_destroy (window); - gtk_main_quit (); - } -} -*/ - -static void -set_icon (GtkImage *image, GtkIconTheme *theme, const char *name) -{ - GdkPixbuf *pixbuf; - - if ((pixbuf = gtk_icon_theme_load_icon (theme, name, 48, 0, NULL))) { - gtk_image_set_from_pixbuf (image, pixbuf); - g_object_unref (pixbuf); - } -} - -static void -web_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) -{ - guint current_index; - - current_index = gtk_combo_box_get_active (combo); - - if (current_index < g_list_length (capplet->web_browsers)) { - GnomeDAURLItem *item; - GError *error = NULL; - - item = (GnomeDAURLItem*) g_list_nth_data (capplet->web_browsers, current_index); - if (item == NULL) - return; - - if (!g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/http", &error) || - !g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/https", &error)) { - g_warning (_("Error setting default browser: %s"), error->message); - g_error_free (error); - } - } -} - -/* FIXME: Refactor these two functions below into one... */ -static void -mail_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) -{ - guint current_index; - - current_index = gtk_combo_box_get_active (combo); - - if (current_index < g_list_length (capplet->mail_readers)) { - GnomeDAURLItem *item; - GError *error = NULL; - - item = (GnomeDAURLItem*) g_list_nth_data (capplet->web_browsers, current_index); - if (item == NULL) - return; - - if (!g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/mailto", &error)) { - g_warning (_("Error setting default mailer: %s"), error->message); - g_error_free (error); - } - } - -} - -static void -terminal_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) -{ - guint current_index; - gboolean is_custom_active; - GnomeDATermItem *item; - - current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->terminals)); - - gtk_widget_set_sensitive (capplet->terminal_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->terminal_command_label, is_custom_active); - gtk_widget_set_sensitive (capplet->terminal_exec_flag_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->terminal_exec_flag_label, is_custom_active); - - /* Set text on the entries so that the GSettings binding works */ - item = g_list_nth_data (capplet->terminals, current_index); - if (item != NULL) { - gtk_entry_set_text (GTK_ENTRY (capplet->terminal_command_entry), ((GnomeDAItem *) item)->command); - gtk_entry_set_text (GTK_ENTRY (capplet->terminal_exec_flag_entry), item->exec_flag); - } -} - -static void -visual_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) -{ - guint current_index; - gboolean is_custom_active; - GnomeDAItem *item; - - current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->visual_ats)); - - gtk_widget_set_sensitive (capplet->visual_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->visual_command_label, is_custom_active); - - /* Set text on the entries so that the GSettings binding works */ - item = g_list_nth_data (capplet->visual_ats, current_index); - if (item != NULL) - gtk_entry_set_text (GTK_ENTRY (capplet->visual_command_entry), item->command); -} - -static void -mobility_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) -{ - guint current_index; - gboolean is_custom_active; - GnomeDAItem *item; - - current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->mobility_ats)); - - gtk_widget_set_sensitive (capplet->mobility_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->mobility_command_label, is_custom_active); - - /* Set text on the entries so that the GSettings binding works */ - item = g_list_nth_data (capplet->mobility_ats, current_index); - if (item != NULL) - gtk_entry_set_text (GTK_ENTRY (capplet->mobility_command_entry), item->command); -} - -static void -refresh_combo_box_icons (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list) -{ - GList *entry; - GnomeDAItem *item; - GtkTreeModel *model; - GtkTreeIter iter; - GdkPixbuf *pixbuf; - - for (entry = app_list; entry != NULL; entry = g_list_next (entry)) { - item = (GnomeDAItem *) entry->data; - - model = gtk_combo_box_get_model (combo_box); - - if (item->icon_path && gtk_tree_model_get_iter_from_string (model, &iter, item->icon_path)) { - pixbuf = gtk_icon_theme_load_icon (theme, item->icon_name, 22, 0, NULL); - - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - PIXBUF_COL, pixbuf, - -1); - - if (pixbuf) - g_object_unref (pixbuf); - } - } -} - -static struct { - const gchar *name; - const gchar *icon; -} icons[] = { - { "web_browser_image", "web-browser" }, - { "mail_reader_image", "emblem-mail" }, - { "visual_image", "zoom-best-fit" }, - { "mobility_image", "preferences-desktop-accessibility" }, -/* { "messenger_image", "im" }, - * { "text_image", "text-editor" }, */ - { "terminal_image", "gnome-terminal" } -}; - -static void -theme_changed_cb (GtkIconTheme *theme, GnomeDACapplet *capplet) -{ - GObject *icon; - gint i; - - for (i = 0; i < G_N_ELEMENTS (icons); i++) { - icon = gtk_builder_get_object (capplet->builder, icons[i].name); - set_icon (GTK_IMAGE (icon), theme, icons[i].icon); - } - - refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers); - refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers); - refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals); - refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats); - refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats); -} - -static void -screen_changed_cb (GtkWidget *widget, GdkScreen *screen, GnomeDACapplet *capplet) -{ - GtkIconTheme *theme; - - theme = gtk_icon_theme_get_for_screen (screen); - - if (capplet->icon_theme != NULL) { - g_signal_handlers_disconnect_by_func (capplet->icon_theme, theme_changed_cb, capplet); - } - capplet->theme_changed_id = g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet); - theme_changed_cb (theme, capplet); - - capplet->icon_theme = theme; -} - -static gboolean -is_separator (GtkTreeModel *model, GtkTreeIter *iter, gpointer sep_index) -{ - GtkTreePath *path; - gboolean result; - - path = gtk_tree_model_get_path (model, iter); - result = gtk_tree_path_get_indices (path)[0] == GPOINTER_TO_INT (sep_index); - gtk_tree_path_free (path); - - return result; -} - -static void -fill_combo_box (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list, gboolean add_custom) -{ - GList *entry; - GtkTreeModel *model; - GtkCellRenderer *renderer; - GtkTreeIter iter; - GdkPixbuf *pixbuf; - - if (theme == NULL) { - theme = gtk_icon_theme_get_default (); - } - - if (add_custom) { - gtk_combo_box_set_row_separator_func (combo_box, is_separator, - GINT_TO_POINTER (g_list_length (app_list)), NULL); - } - - model = GTK_TREE_MODEL (gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING)); - gtk_combo_box_set_model (combo_box, model); - - renderer = gtk_cell_renderer_pixbuf_new (); - - /* not all cells have a pixbuf, this prevents the combo box to shrink */ - gtk_cell_renderer_set_fixed_size (renderer, -1, 22); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, FALSE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer, - "pixbuf", PIXBUF_COL, - NULL); - - renderer = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer, - "text", TEXT_COL, - NULL); - - for (entry = app_list; entry != NULL; entry = g_list_next (entry)) { - GnomeDAItem *item; - item = (GnomeDAItem *) entry->data; - - pixbuf = gtk_icon_theme_load_icon (theme, item->icon_name, 22, 0, NULL); - - gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - PIXBUF_COL, pixbuf, - TEXT_COL, item->name, - -1); - - item->icon_path = gtk_tree_model_get_string_from_iter (model, &iter); - - if (pixbuf) - g_object_unref (pixbuf); - } - - if (add_custom) { - gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, -1); - gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - PIXBUF_COL, NULL, - TEXT_COL, _("Custom"), - -1); - } -} - -static GtkWidget* -_gtk_builder_get_widget (GtkBuilder *builder, const gchar *name) -{ - return GTK_WIDGET (gtk_builder_get_object (builder, name)); -} - - -static void -show_dialog (GnomeDACapplet *capplet, const gchar *start_page) -{ - GtkBuilder *builder; - guint builder_result; - - capplet->builder = builder = gtk_builder_new (); - - if (g_file_test (GNOMECC_UI_DIR "/gnome-default-applications-properties.ui", G_FILE_TEST_EXISTS) != FALSE) { - builder_result = gtk_builder_add_from_file (builder, GNOMECC_UI_DIR "/gnome-default-applications-properties.ui", NULL); - } - else { - builder_result = gtk_builder_add_from_file (builder, "./gnome-default-applications-properties.ui", NULL); - } - - if (builder_result == 0) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("Could not load the main interface")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - _("Please make sure that the applet " - "is properly installed")); - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - exit (EXIT_FAILURE); - } - - capplet->window = _gtk_builder_get_widget (builder,"preferred_apps_dialog"); - - capplet->terminal_command_entry = _gtk_builder_get_widget (builder, "terminal_command_entry"); - capplet->terminal_command_label = _gtk_builder_get_widget (builder, "terminal_command_label"); - capplet->terminal_exec_flag_entry = _gtk_builder_get_widget (builder, "terminal_exec_flag_entry"); - capplet->terminal_exec_flag_label = _gtk_builder_get_widget (builder, "terminal_exec_flag_label"); - - capplet->visual_command_entry = _gtk_builder_get_widget (builder, "visual_command_entry"); - capplet->visual_command_label = _gtk_builder_get_widget (builder, "visual_command_label"); - capplet->visual_startup_checkbutton = _gtk_builder_get_widget (builder, "visual_start_checkbutton"); - - capplet->mobility_command_entry = _gtk_builder_get_widget (builder, "mobility_command_entry"); - capplet->mobility_command_label = _gtk_builder_get_widget (builder, "mobility_command_label"); - capplet->mobility_startup_checkbutton = _gtk_builder_get_widget (builder, "mobility_start_checkbutton"); - - capplet->web_combo_box = _gtk_builder_get_widget (builder, "web_browser_combobox"); - capplet->mail_combo_box = _gtk_builder_get_widget (builder, "mail_reader_combobox"); - capplet->term_combo_box = _gtk_builder_get_widget (builder, "terminal_combobox"); - capplet->visual_combo_box = _gtk_builder_get_widget (builder, "visual_combobox"); - capplet->mobility_combo_box = _gtk_builder_get_widget (builder, "mobility_combobox"); - - g_signal_connect (capplet->window, "screen-changed", G_CALLBACK (screen_changed_cb), capplet); - screen_changed_cb (capplet->window, gdk_screen_get_default (), capplet); - - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, FALSE); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, FALSE); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals, TRUE); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats, TRUE); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats, TRUE); - - g_signal_connect (capplet->web_combo_box, "changed", G_CALLBACK (web_combo_changed_cb), capplet); - g_signal_connect (capplet->mail_combo_box, "changed", G_CALLBACK (mail_combo_changed_cb), capplet); - g_signal_connect (capplet->term_combo_box, "changed", G_CALLBACK (terminal_combo_changed_cb), capplet); - g_signal_connect (capplet->visual_combo_box, "changed", G_CALLBACK (visual_combo_changed_cb), capplet); - g_signal_connect (capplet->mobility_combo_box, "changed", G_CALLBACK (mobility_combo_changed_cb), capplet); - - /* Bind settings */ - - /* Terminal */ - g_settings_bind (capplet->terminal_settings, "exec", - capplet->terminal_command_entry, "text", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (capplet->terminal_settings, "exec-arg", - capplet->terminal_exec_flag_entry, "text", - G_SETTINGS_BIND_DEFAULT); - - /* Visual */ - g_settings_bind (capplet->at_visual_settings, "exec", - capplet->visual_command_entry, "text", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (capplet->at_visual_settings, "startup", - capplet->visual_startup_checkbutton, "active", - G_SETTINGS_BIND_DEFAULT); - - /* Mobility */ - g_settings_bind (capplet->at_mobility_settings, "exec", - capplet->mobility_command_entry, "text", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (capplet->at_mobility_settings, "startup", - capplet->mobility_startup_checkbutton, "active", - G_SETTINGS_BIND_DEFAULT); - - gtk_window_set_icon_name (GTK_WINDOW (capplet->window), - "gnome-settings-default-applications"); - - if (start_page != NULL) { - gchar *page_name; - GtkWidget *w; - - page_name = g_strconcat (start_page, "_vbox", NULL); - - w = _gtk_builder_get_widget (builder, page_name); - if (w != NULL) { - GtkNotebook *nb; - gint pindex; - - nb = GTK_NOTEBOOK (_gtk_builder_get_widget (builder, - "preferred_apps_notebook")); - pindex = gtk_notebook_page_num (nb, w); - if (pindex != -1) - gtk_notebook_set_current_page (nb, pindex); - } - g_free (page_name); - } -} - -void -gnome_default_applications_panel_init (GnomeDACapplet *capplet) -{ - gnome_da_xml_load_list (capplet); - - show_dialog (capplet, 0); -} diff --git a/panels/default-applications/gnome-da-capplet.h b/panels/default-applications/gnome-da-capplet.h deleted file mode 100644 index 138d36b6f..000000000 --- a/panels/default-applications/gnome-da-capplet.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_DA_CAPPLET_H_ -#define _GNOME_DA_CAPPLET_H_ - -#include -#include - -typedef struct _GnomeDACapplet GnomeDACapplet; - -struct _GnomeDACapplet { - GtkBuilder *builder; - - GtkIconTheme *icon_theme; - - GtkWidget *window; - - GtkWidget *web_combo_box; - GtkWidget *mail_combo_box; - GtkWidget *term_combo_box; - GtkWidget *visual_combo_box; - GtkWidget *mobility_combo_box; - - GtkWidget *terminal_command_entry; - GtkWidget *terminal_command_label; - GtkWidget *terminal_exec_flag_entry; - GtkWidget *terminal_exec_flag_label; - - GtkWidget *visual_command_entry; - GtkWidget *visual_command_label; - GtkWidget *visual_startup_checkbutton; - - GtkWidget *mobility_command_entry; - GtkWidget *mobility_command_label; - GtkWidget *mobility_startup_checkbutton; - - GSettings *terminal_settings; - GSettings *at_mobility_settings; - GSettings *at_visual_settings; - - GList *web_browsers; - GList *mail_readers; - GList *terminals; - GList *visual_ats; - GList *mobility_ats; - - guint theme_changed_id; -}; - -void gnome_default_applications_panel_init (GnomeDACapplet *capplet); - -#endif diff --git a/panels/default-applications/gnome-da-item.c b/panels/default-applications/gnome-da-item.c deleted file mode 100644 index 86188e24b..000000000 --- a/panels/default-applications/gnome-da-item.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include "gnome-da-capplet.h" -#include "gnome-da-item.h" - -GnomeDAURLItem* -gnome_da_url_item_new (void) -{ - GnomeDAURLItem *item = NULL; - - item = g_new0 (GnomeDAURLItem, 1); - - return item; -} - -GnomeDASimpleItem* -gnome_da_simple_item_new (void) -{ - GnomeDASimpleItem *item = NULL; - - item = g_new0 (GnomeDASimpleItem, 1); - - return item; -} - -GnomeDATermItem* -gnome_da_term_item_new (void) -{ - GnomeDATermItem *item = NULL; - - item = g_new0 (GnomeDATermItem, 1); - - return item; -} - -GnomeDAVisualItem* -gnome_da_visual_item_new (void) -{ - GnomeDAVisualItem *item = NULL; - - item = g_new0 (GnomeDAVisualItem, 1); - - return item; -} - -GnomeDAMobilityItem* -gnome_da_mobility_item_new (void) -{ - GnomeDAMobilityItem *item = NULL; - - item = g_new0 (GnomeDAMobilityItem, 1); - - return item; -} - -void -gnome_da_url_item_free (GnomeDAURLItem *item) -{ - g_return_if_fail (item != NULL); - - g_free (item->generic.name); - g_free (item->generic.executable); - g_free (item->generic.command); - g_free (item->generic.icon_name); - g_free (item->generic.icon_path); - - g_object_unref (item->app_info); - - g_free (item); -} - -void -gnome_da_simple_item_free (GnomeDASimpleItem *item) -{ - g_return_if_fail (item != NULL); - - g_free (item->generic.name); - g_free (item->generic.executable); - g_free (item->generic.command); - g_free (item->generic.icon_name); - g_free (item->generic.icon_path); - - g_free (item); -} - -void -gnome_da_term_item_free (GnomeDATermItem *item) -{ - g_return_if_fail (item != NULL); - - g_free (item->generic.name); - g_free (item->generic.executable); - g_free (item->generic.command); - g_free (item->generic.icon_name); - g_free (item->generic.icon_path); - - g_free (item->exec_flag); - - g_free (item); -} - -void -gnome_da_visual_item_free (GnomeDAVisualItem *item) -{ - g_return_if_fail (item != NULL); - - g_free (item->generic.name); - g_free (item->generic.executable); - g_free (item->generic.command); - g_free (item->generic.icon_name); - g_free (item->generic.icon_path); - - g_free (item); -} - -void -gnome_da_mobility_item_free (GnomeDAMobilityItem *item) -{ - g_return_if_fail (item != NULL); - - g_free (item->generic.name); - g_free (item->generic.executable); - g_free (item->generic.command); - g_free (item->generic.icon_name); - g_free (item->generic.icon_path); - - g_free (item); -} - diff --git a/panels/default-applications/gnome-da-item.h b/panels/default-applications/gnome-da-item.h deleted file mode 100644 index 96d7b9518..000000000 --- a/panels/default-applications/gnome-da-item.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_DA_ITEM_H_ -#define _GNOME_DA_ITEM_H_ - -#include - -typedef struct _GnomeDAItem GnomeDAItem; - -typedef struct _GnomeDAURLItem GnomeDAURLItem; -typedef struct _GnomeDATermItem GnomeDATermItem; -typedef struct _GnomeDASimpleItem GnomeDASimpleItem; -typedef struct _GnomeDAVisualItem GnomeDAVisualItem; -typedef struct _GnomeDAMobilityItem GnomeDAMobilityItem; - -struct _GnomeDAItem { - gchar *name; - gchar *executable; - gchar *command; - gchar *icon_name; - gchar *icon_path; -}; - -struct _GnomeDASimpleItem { - GnomeDAItem generic; - gboolean run_in_terminal; -}; - -struct _GnomeDAURLItem { - GnomeDAItem generic; - GAppInfo *app_info; -}; - -struct _GnomeDATermItem { - GnomeDAItem generic; - gchar *exec_flag; -}; - -struct _GnomeDAVisualItem { - GnomeDAItem generic; - gboolean run_at_startup; -}; - -struct _GnomeDAMobilityItem { - GnomeDAItem generic; - gboolean run_at_startup; -}; - -GnomeDATermItem* gnome_da_term_item_new (void); -GnomeDAURLItem* gnome_da_url_item_new (void); -GnomeDASimpleItem* gnome_da_simple_item_new (void); -GnomeDAVisualItem* gnome_da_visual_item_new (void); -GnomeDAMobilityItem* gnome_da_mobility_item_new (void); -void gnome_da_term_item_free (GnomeDATermItem *item); -void gnome_da_url_item_free (GnomeDAURLItem *item); -void gnome_da_simple_item_free (GnomeDASimpleItem *item); -void gnome_da_visual_item_free (GnomeDAVisualItem *item); -void gnome_da_mobility_item_free (GnomeDAMobilityItem *item); - -#endif diff --git a/panels/default-applications/gnome-da-xml.c b/panels/default-applications/gnome-da-xml.c deleted file mode 100644 index d4b2ee783..000000000 --- a/panels/default-applications/gnome-da-xml.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include -#include -#include -#include - -#include "gnome-da-capplet.h" -#include "gnome-da-xml.h" -#include "gnome-da-item.h" - - -static gboolean -gnome_da_xml_get_bool (const xmlNode *parent, const gchar *val_name) -{ - xmlNode *element; - gboolean ret_val = FALSE; - xmlChar *xml_val_name; - gint len; - - g_return_val_if_fail (parent != NULL, FALSE); - g_return_val_if_fail (parent->children != NULL, ret_val); - g_return_val_if_fail (val_name != NULL, FALSE); - - xml_val_name = xmlCharStrdup (val_name); - len = xmlStrlen (xml_val_name); - - for (element = parent->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, xml_val_name, len)) { - xmlChar *cont = xmlNodeGetContent (element); - - if (!xmlStrcasecmp (cont, (const xmlChar *) "true") || !xmlStrcasecmp (cont, (const xmlChar *) "1")) - ret_val = TRUE; - else - ret_val = FALSE; - - xmlFree (cont); - } - } - - xmlFree (xml_val_name); - return ret_val; -} - -static gchar* -gnome_da_xml_get_string (const xmlNode *parent, const gchar *val_name) -{ - const gchar * const *sys_langs; - xmlChar *node_lang; - xmlNode *element; - gchar *ret_val = NULL; - xmlChar *xml_val_name; - gint len; - gint i; - - g_return_val_if_fail (parent != NULL, ret_val); - g_return_val_if_fail (parent->children != NULL, ret_val); - g_return_val_if_fail (val_name != NULL, ret_val); - -#if GLIB_CHECK_VERSION (2, 6, 0) - sys_langs = g_get_language_names (); -#endif - - xml_val_name = xmlCharStrdup (val_name); - len = xmlStrlen (xml_val_name); - - for (element = parent->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, xml_val_name, len)) { - node_lang = xmlNodeGetLang (element); - - if (node_lang == NULL) { - ret_val = (gchar *) xmlNodeGetContent (element); - } - else { - for (i = 0; sys_langs[i] != NULL; i++) { - if (!strcmp ((const char *) sys_langs[i], (const char *) node_lang)) { - ret_val = (gchar *) xmlNodeGetContent (element); - /* since sys_langs is sorted from most desirable to - * least desirable, exit at first match - */ - break; - } - } - } - xmlFree (node_lang); - } - } - - xmlFree (xml_val_name); - return ret_val; -} - -static gboolean -is_executable_valid (const gchar *executable) -{ - gchar *path; - - path = g_find_program_in_path (executable); - - if (path) { - g_free (path); - return TRUE; - } - - return FALSE; -} - -static void -gnome_da_xml_load_xml (GnomeDACapplet *capplet, const gchar * filename) -{ - xmlDoc *xml_doc; - xmlNode *root, *section, *element; - gchar *executable; - GnomeDATermItem *term_item; - GnomeDAVisualItem *visual_item; - GnomeDAMobilityItem *mobility_item; - - xml_doc = xmlParseFile (filename); - - if (!xml_doc) - return; - - root = xmlDocGetRootElement (xml_doc); - - for (section = root->children; section != NULL; section = section->next) { - if (!xmlStrncmp (section->name, (const xmlChar *) "terminals", 9)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, (const xmlChar *) "terminal", 8)) { - executable = gnome_da_xml_get_string (element, "executable"); - if (is_executable_valid (executable)) { - term_item = gnome_da_term_item_new (); - - term_item->generic.name = gnome_da_xml_get_string (element, "name"); - term_item->generic.executable = executable; - term_item->generic.command = gnome_da_xml_get_string (element, "command"); - term_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); - - term_item->exec_flag = gnome_da_xml_get_string (element, "exec-flag"); - - capplet->terminals = g_list_append (capplet->terminals, term_item); - } - else - g_free (executable); - } - } - } - else if (!xmlStrncmp (section->name, (const xmlChar *) "a11y-visual", 11)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, (const xmlChar *) "visual", 6)) { - executable = gnome_da_xml_get_string (element,"executable"); - if (is_executable_valid (executable)) { - visual_item = gnome_da_visual_item_new (); - - visual_item->generic.name = gnome_da_xml_get_string (element, "name"); - visual_item->generic.executable = executable; - visual_item->generic.command = gnome_da_xml_get_string (element, "command"); - visual_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); - - visual_item->run_at_startup = gnome_da_xml_get_bool (element, "run-at-startup"); - - capplet->visual_ats = g_list_append (capplet->visual_ats, visual_item); - } - else - g_free (executable); - } - } - } - else if (!xmlStrncmp (section->name, (const xmlChar *) "a11y-mobility", 13)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, (const xmlChar *) "mobility", 8)) { - executable = gnome_da_xml_get_string (element,"executable"); - if (is_executable_valid (executable)) { - mobility_item = gnome_da_mobility_item_new (); - - mobility_item->generic.name = gnome_da_xml_get_string (element, "name"); - mobility_item->generic.executable = executable; - mobility_item->generic.command = gnome_da_xml_get_string (element, "command"); - mobility_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); - - mobility_item->run_at_startup = gnome_da_xml_get_bool (element, "run-at-startup"); - - capplet->mobility_ats = g_list_append (capplet->mobility_ats, mobility_item); - } - else - g_free (executable); - } - } - } - } - - xmlFreeDoc (xml_doc); -} - -static GList * -load_url_handlers (GnomeDACapplet *capplet, const gchar *scheme) -{ - GList *app_list, *l, *ret; - - app_list = g_app_info_get_all_for_type (scheme); - ret = NULL; - - for (l = app_list; l != NULL; l = l->next) { - const gchar *executable; - GAppInfo *app_info = l->data; - - executable = g_app_info_get_executable (app_info); - if (is_executable_valid (executable)) { - GnomeDAURLItem *url_item; - - url_item = gnome_da_url_item_new (); - url_item->generic.name = g_strdup (g_app_info_get_display_name (app_info)); - url_item->generic.executable = g_strdup (executable); - url_item->generic.command = g_strdup (g_app_info_get_commandline (app_info)); - url_item->generic.icon_name = g_strdup (g_app_info_get_name (app_info)); - /* Steal the reference */ - url_item->app_info = app_info; - - ret = g_list_prepend (ret, url_item); - } else { - g_object_unref (app_info); - } - } - g_list_free (app_list); - - return g_list_reverse (ret); -} - -void -gnome_da_xml_load_list (GnomeDACapplet *capplet) -{ - GDir *app_dir = g_dir_open (GNOMECC_APPS_DIR, 0, NULL); - - /* First load all applications from the XML files */ - if (app_dir != NULL) { - const gchar *extra_file; - gchar *filename; - - while ((extra_file = g_dir_read_name (app_dir)) != NULL) { - filename = g_build_filename (GNOMECC_APPS_DIR, extra_file, NULL); - - if (g_str_has_suffix (filename, ".xml")) - gnome_da_xml_load_xml (capplet, filename); - - g_free (filename); - } - g_dir_close (app_dir); - } - - /* Now load URL handlers */ - capplet->web_browsers = load_url_handlers (capplet, "x-scheme-handler/http"); - capplet->mail_readers = load_url_handlers (capplet, "x-scheme-handler/mailto"); -} - -void -gnome_da_xml_free (GnomeDACapplet *capplet) -{ - g_list_foreach (capplet->web_browsers, (GFunc) gnome_da_url_item_free, NULL); - g_list_foreach (capplet->mail_readers, (GFunc) gnome_da_url_item_free, NULL); - g_list_foreach (capplet->terminals, (GFunc) gnome_da_term_item_free, NULL); - g_list_foreach (capplet->visual_ats, (GFunc) gnome_da_visual_item_free, NULL); - g_list_foreach (capplet->mobility_ats, (GFunc) gnome_da_mobility_item_free, NULL); - - g_list_free (capplet->web_browsers); - g_list_free (capplet->mail_readers); - g_list_free (capplet->terminals); - g_list_free (capplet->visual_ats); - g_list_free (capplet->mobility_ats); - - g_object_unref (capplet->builder); - g_free (capplet); -} diff --git a/panels/default-applications/gnome-da-xml.h b/panels/default-applications/gnome-da-xml.h deleted file mode 100644 index f45a18923..000000000 --- a/panels/default-applications/gnome-da-xml.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Authors: Luca Cavalli - * - * Copyright 2005-2006 Luca Cavalli - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_DA_XML_H_ -#define _GNOME_DA_XML_H_ - -void gnome_da_xml_load_list (GnomeDACapplet *capplet); -void gnome_da_xml_free (GnomeDACapplet *capplet); - -#endif diff --git a/panels/default-applications/gnome-default-applications-panel.desktop.in.in b/panels/default-applications/gnome-default-applications-panel.desktop.in.in deleted file mode 100644 index 75e487088..000000000 --- a/panels/default-applications/gnome-default-applications-panel.desktop.in.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -_Name=Preferred Applications -_Comment=Select your default applications -Exec=gnome-control-center default-applications -Icon=gnome-settings-default-applications -Terminal=false -Type=Application -StartupNotify=true -Categories=GNOME;GTK;Settings;X-GNOME-PersonalSettings;X-GNOME-Settings-Panel; -OnlyShowIn=GNOME; -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=Preferred applications -X-GNOME-Bugzilla-Version=@VERSION@ -X-GNOME-Settings-Panel=default-applications diff --git a/panels/default-applications/gnome-default-applications-properties.ui b/panels/default-applications/gnome-default-applications-properties.ui deleted file mode 100644 index d71e45c0c..000000000 --- a/panels/default-applications/gnome-default-applications-properties.ui +++ /dev/null @@ -1,847 +0,0 @@ - - - - - - 5 - Preferred Applications - False - dialog - - - True - - - True - True - 10 - - - True - 12 - 18 - - - True - 6 - - - True - 0 - Web Browser - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - - - - 1 - - - - - 1 - - - - - False - 0 - - - - - True - 6 - - - True - 0 - Mail Reader - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - - - - 1 - - - - - 1 - - - - - False - 1 - - - - - 6 - - - True - 0 - Instant Messenger - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - True - 3 - 12 - 6 - - - True - False - 0 - Co_mmand: - True - messenger_command_entry - - - GTK_FILL - - - - - - True - True - All %s occurrences will be replaced with actual link - - - 1 - 2 - - - - - - Run in t_erminal - True - False - True - False - True - True - - - 2 - 3 - GTK_FILL - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - False - 2 - - - - - - - True - Internet - - - False - - - - - True - 12 - 18 - - - 6 - - - True - 0 - Text Editor - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - True - 3 - 12 - 6 - - - True - False - 0 - Co_mmand: - True - text_command_entry - - - GTK_FILL - - - - - - True - True - All %s occurrences will be replaced with actual link - - - 1 - 2 - - - - - - Run in t_erminal - True - False - True - False - True - True - - - 2 - 3 - GTK_FILL - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - False - 0 - - - - - True - 6 - - - True - 0 - Terminal Emulator - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - True - 2 - 2 - 12 - 6 - - - True - False - 0 - Co_mmand: - True - terminal_command_entry - - - GTK_FILL - - - - - - True - True - All %s occurrences will be replaced with actual link - - - 1 - 2 - - - - - - True - False - 0 - E_xecute flag: - True - terminal_exec_flag_entry - - - 1 - 2 - GTK_FILL - - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - False - 1 - - - - - 2 - - - - - True - System - - - 2 - False - - - - - True - 12 - 18 - - - True - 6 - - - True - 0 - Visual - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - _Run at start - True - True - False - True - True - - - 1 - - - - - True - 2 - 12 - 6 - - - True - False - 0 - C_ommand: - True - visual_command_entry - - - GTK_FILL - - - - - - True - True - All %s occurrences will be replaced with actual link - - - 1 - 2 - - - - - - 2 - - - - - 1 - - - - - 1 - - - - - False - 0 - - - - - True - 6 - - - True - 0 - Mobility - - - - - - False - False - 0 - - - - - True - 12 - - - True - 0 - - - False - False - 0 - - - - - True - 6 - - - True - - - False - 0 - - - - - Run at st_art - True - True - False - True - True - - - 1 - - - - - True - 2 - 12 - 6 - - - True - False - 0 - Co_mmand: - True - - - GTK_FILL - - - - - - True - True - All %s occurrences will be replaced with actual link - - - 1 - 2 - - - - - - 2 - - - - - 1 - - - - - 1 - - - - - False - 1 - - - - - 3 - - - - - True - Accessibility - - - 3 - False - - - - - False - 1 - - - - - True - end - - - gtk-help - True - True - True - False - True - - - False - False - 0 - - - - - gtk-close - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - helpbutton1 - closebutton1 - - - diff --git a/panels/default-applications/gnome-default-applications.pc.in b/panels/default-applications/gnome-default-applications.pc.in deleted file mode 100644 index 6ab6c2b9a..000000000 --- a/panels/default-applications/gnome-default-applications.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -datarootdir=@datarootdir@ -datadir=@datadir@ -pkgdatadir=${datadir}/@PACKAGE@ -defappsdir=${pkgdatadir}/default-apps - -Name: gnome-default-applications -Description: Default GNOME applications configuration -Version: @VERSION@ - diff --git a/panels/default-applications/gnome-default-applications.xml.in b/panels/default-applications/gnome-default-applications.xml.in deleted file mode 100644 index 39fe3e6ee..000000000 --- a/panels/default-applications/gnome-default-applications.xml.in +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - <_name>Debian Terminal Emulator - x-terminal-emulator - x-terminal-emulator - gnome-mime-application-x-executable - -e - - - <_name>GNOME Terminal - gnome-terminal - gnome-terminal - gnome-terminal - -x - - - <_name>Terminator - terminator - terminator - terminator - -x - - - <_name>Standard XTerminal - xterm - xterm - gnome-mime-application-x-executable - -e - - - <_name>NXterm - nxterm - nxterm - gnome-mime-application-x-executable - -e - - - <_name>RXVT - rxvt - rxvt - gnome-mime-application-x-executable - -e - - - <_name>aterm - aterm - aterm - gnome-mime-application-x-executable - -e - - - <_name>ETerm - ETerm - ETerm - gnome-mime-application-x-executable - -e - - - <_name>Konsole - konsole - konsole - konsole - -e - - - - - - <_name>Banshee Music Player - banshee - banshee - music-player-banshee - false - - - <_name>Muine Music Player - muine - muine - muine - false - - - <_name>Rhythmbox Music Player - rhythmbox - rhythmbox - rhythmbox - false - - - <_name>Totem Movie Player - totem - totem - totem - false - - - <_name>Listen - listen - listen - listen - false - - - - - - <_name>Orca - orca - orca - orca - false - - - <_name>Orca with Magnifier - orca - orca -e magnifier - orca - false - - - <_name>Linux Screen Reader - lsr - lsr - lsr - false - - - <_name>Linux Screen Reader with Magnifier - lsr - lsr -p mag - lsr - false - - - <_name>Gnopernicus - gnopernicus - gnopernicus - icon-accessibility - false - - - <_name>Gnopernicus with Magnifier - gnopernicus - gnopernicus -m - icon-accessibility - false - - - <_name>GNOME Magnifier without Screen Reader - magnifier - magnifier -m - gnome-searchtool - false - - - <_name>KDE Magnifier without Screen Reader - kmag - kmag - gnome-searchtool - false - - - - - - - <_name>GNOME OnScreen Keyboard - gok - gok - accessibility-keyboard-capplet - false - - - <_name>Dasher - dasher - dasher - gnome-searchtool - false - - - onBoard - onboard - onboard - onboard - false - - - - diff --git a/panels/default-applications/icons/16x16/gnome-settings-default-applications.png b/panels/default-applications/icons/16x16/gnome-settings-default-applications.png deleted file mode 100644 index 41a765aab..000000000 Binary files a/panels/default-applications/icons/16x16/gnome-settings-default-applications.png and /dev/null differ diff --git a/panels/default-applications/icons/22x22/gnome-settings-default-applications.png b/panels/default-applications/icons/22x22/gnome-settings-default-applications.png deleted file mode 100644 index 83b6826c9..000000000 Binary files a/panels/default-applications/icons/22x22/gnome-settings-default-applications.png and /dev/null differ diff --git a/panels/default-applications/icons/24x24/gnome-settings-default-applications.png b/panels/default-applications/icons/24x24/gnome-settings-default-applications.png deleted file mode 100644 index 630ea040c..000000000 Binary files a/panels/default-applications/icons/24x24/gnome-settings-default-applications.png and /dev/null differ diff --git a/panels/default-applications/icons/32x32/gnome-settings-default-applications.png b/panels/default-applications/icons/32x32/gnome-settings-default-applications.png deleted file mode 100644 index 23718f781..000000000 Binary files a/panels/default-applications/icons/32x32/gnome-settings-default-applications.png and /dev/null differ diff --git a/panels/default-applications/icons/48x48/gnome-settings-default-applications.png b/panels/default-applications/icons/48x48/gnome-settings-default-applications.png deleted file mode 100644 index ac25569d1..000000000 Binary files a/panels/default-applications/icons/48x48/gnome-settings-default-applications.png and /dev/null differ diff --git a/panels/default-applications/icons/svg/preferred-applications.svg b/panels/default-applications/icons/svg/preferred-applications.svg deleted file mode 100644 index 68cb55310..000000000 --- a/panels/default-applications/icons/svg/preferred-applications.svg +++ /dev/null @@ -1,12680 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Folder - - - dir - folder - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/po/POTFILES.in b/po/POTFILES.in index 1d9648649..aa797a945 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,11 +11,6 @@ panels/background/gnome-wp-info.c panels/background/gnome-wp-item.c [type: gettext/glade]panels/datetime/datetime.ui panels/datetime/gnome-datetime-panel.desktop.in.in -panels/default-applications/gnome-default-applications-panel.desktop.in.in -panels/default-applications/gnome-at-session.desktop.in.in -panels/default-applications/gnome-da-capplet.c -[type: gettext/glade]panels/default-applications/gnome-default-applications-properties.ui -panels/default-applications/gnome-default-applications.xml.in [type: gettext/glade]panels/display/display-capplet.ui panels/display/gnome-display-panel.desktop.in.in panels/display/xrandr-capplet.c diff --git a/po/POTFILES.skip b/po/POTFILES.skip index a94dc702f..8de472e32 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -3,8 +3,6 @@ capplets/appearance/data/gnome-appearance-properties.desktop.in capplets/appearance/data/gnome-theme-installer.desktop.in capplets/appearance/data/gnome-theme-package.xml panels/datetime/gnome-datetime-panel.desktop.in -panels/default-applications/gnome-default-applications-panel.desktop.in -panels/default-applications/gnome-at-session.desktop.in panels/display/gnome-display-panel.desktop.in panels/info/gnome-screen-panel.desktop.in panels/info/gnome-info-panel.desktop.in