diff options
author | Steve Zesch <[email protected]> | 2012-01-09 22:14:20 -0500 |
---|---|---|
committer | Steve Zesch <[email protected]> | 2012-01-09 22:14:20 -0500 |
commit | e554754f5681592f0f7b1d41e0943a89470f3796 (patch) | |
tree | 223db9350604b352a18d6b6f6ed330600afafeef | |
parent | 035a4e3cfa5782aaa4967cf923a1364eba3b056b (diff) | |
parent | b9c28ef703e934e8dc137686984f04c7b0d2d010 (diff) | |
download | mate-control-center-e554754f5681592f0f7b1d41e0943a89470f3796.tar.bz2 mate-control-center-e554754f5681592f0f7b1d41e0943a89470f3796.tar.xz |
Merge branch 'master' of https://github.com/mate-desktop/mate-control-center
35 files changed, 5030 insertions, 4004 deletions
@@ -1 +1,2 @@ Jonathan Blandford <[email protected]> +Perberos <[email protected]> diff --git a/capplets/Makefile.am b/capplets/Makefile.am index 004d00fd..9b3c70ea 100644 --- a/capplets/Makefile.am +++ b/capplets/Makefile.am @@ -1,26 +1,26 @@ SUBDIRS = \ - common \ - accessibility \ - appearance \ - default-applications \ - display \ - keybindings \ - keyboard \ - mouse \ - network \ + common \ + accessibility \ + appearance \ + default-applications \ + display \ + keybindings \ + keyboard \ + mouse \ + network \ windows DIST_SUBDIRS = \ - common \ - accessibility \ - appearance \ - default-applications \ - keybindings \ - keyboard \ - mouse \ - network \ - windows \ - display \ + common \ + accessibility \ + appearance \ + default-applications \ + keybindings \ + keyboard \ + mouse \ + network \ + windows \ + display \ about-me diff --git a/capplets/appearance/mate-wp-info.c b/capplets/appearance/mate-wp-info.c index 5c799eab..58145fd0 100644 --- a/capplets/appearance/mate-wp-info.c +++ b/capplets/appearance/mate-wp-info.c @@ -24,64 +24,74 @@ #include <gio/gio.h> #include "mate-wp-info.h" -MateWPInfo * mate_wp_info_new (const gchar * uri, - MateDesktopThumbnailFactory * thumbs) { - MateWPInfo *wp; - GFile *file; - GFileInfo *info; - - file = g_file_new_for_commandline_arg (uri); - - info = g_file_query_info (file, - G_FILE_ATTRIBUTE_STANDARD_NAME "," - G_FILE_ATTRIBUTE_STANDARD_SIZE "," - G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," - G_FILE_ATTRIBUTE_TIME_MODIFIED, - G_FILE_QUERY_INFO_NONE, - NULL, NULL); - g_object_unref (file); - - if (info == NULL || g_file_info_get_content_type (info) == NULL) { - if (!strcmp (uri, "(none)")) { - wp = g_new0 (MateWPInfo, 1); - - wp->mime_type = g_strdup ("image/x-no-data"); - wp->uri = g_strdup (uri); - wp->name = g_strdup (_("No Desktop Background")); - wp->size = 0; - } else { - wp = NULL; - } - } else { - wp = g_new0 (MateWPInfo, 1); - - wp->uri = g_strdup (uri); - - wp->name = g_strdup (g_file_info_get_name (info)); - if (g_file_info_get_content_type (info) != NULL) - wp->mime_type = g_strdup (g_file_info_get_content_type (info)); - wp->size = g_file_info_get_size (info); - wp->mtime = g_file_info_get_attribute_uint64 (info, - G_FILE_ATTRIBUTE_TIME_MODIFIED); - - wp->thumburi = mate_desktop_thumbnail_factory_lookup (thumbs, - uri, - wp->mtime); - } - - if (info != NULL) - g_object_unref (info); - - return wp; +MateWPInfo* mate_wp_info_new(const char* uri, MateDesktopThumbnailFactory* thumbs) +{ + MateWPInfo* wp; + + GFile* file = g_file_new_for_commandline_arg(uri); + + GFileInfo* info = g_file_query_info(file, + G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_SIZE "," + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + G_FILE_ATTRIBUTE_TIME_MODIFIED, + G_FILE_QUERY_INFO_NONE, + NULL, NULL); + + g_object_unref(file); + + if (info == NULL || g_file_info_get_content_type (info) == NULL) + { + if (!strcmp (uri, "(none)")) + { + wp = g_new0(MateWPInfo, 1); + + wp->mime_type = g_strdup("image/x-no-data"); + wp->uri = g_strdup(uri); + wp->name = g_strdup(_("No Desktop Background")); + wp->size = 0; + } + else + { + wp = NULL; + } + } + else + { + wp = g_new0 (MateWPInfo, 1); + + wp->uri = g_strdup(uri); + + wp->name = g_strdup(g_file_info_get_name(info)); + + if (g_file_info_get_content_type(info) != NULL) + { + wp->mime_type = g_strdup(g_file_info_get_content_type(info)); + } + + wp->size = g_file_info_get_size(info); + wp->mtime = g_file_info_get_attribute_uint64(info, G_FILE_ATTRIBUTE_TIME_MODIFIED); + + wp->thumburi = mate_desktop_thumbnail_factory_lookup(thumbs, uri, wp->mtime); + } + + if (info != NULL) + { + g_object_unref(info); + } + + return wp; } -void mate_wp_info_free (MateWPInfo * info) { - if (info == NULL) { - return; - } +void mate_wp_info_free(MateWPInfo* info) +{ + if (info == NULL) + { + return; + } - g_free (info->uri); - g_free (info->thumburi); - g_free (info->name); - g_free (info->mime_type); + g_free(info->uri); + g_free(info->thumburi); + g_free(info->name); + g_free(info->mime_type); } diff --git a/capplets/appearance/mate-wp-info.h b/capplets/appearance/mate-wp-info.h index 95c94f89..21462e5c 100644 --- a/capplets/appearance/mate-wp-info.h +++ b/capplets/appearance/mate-wp-info.h @@ -24,22 +24,19 @@ #include <glib.h> #include <libmateui/mate-desktop-thumbnail.h> -typedef struct _MateWPInfo MateWPInfo; +typedef struct _MateWPInfo { + char* uri; + char* thumburi; + char* name; + char* mime_type; -struct _MateWPInfo { - gchar * uri; - gchar * thumburi; - gchar * name; - gchar * mime_type; + goffset size; - goffset size; + time_t mtime; +} MateWPInfo; - time_t mtime; -}; - -MateWPInfo * mate_wp_info_new (const gchar * uri, - MateDesktopThumbnailFactory * thumbs); -void mate_wp_info_free (MateWPInfo * info); +MateWPInfo* mate_wp_info_new(const char* uri, MateDesktopThumbnailFactory* thumbs); +void mate_wp_info_free(MateWPInfo* info); #endif diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c index 2157acf7..c7d7867d 100644 --- a/capplets/appearance/mate-wp-xml.c +++ b/capplets/appearance/mate-wp-xml.c @@ -24,428 +24,531 @@ #include <string.h> #include <libxml/parser.h> -static gboolean mate_wp_xml_get_bool (const xmlNode * parent, - const gchar * prop_name) { - xmlChar * prop; - gboolean ret_val = FALSE; - - g_return_val_if_fail (parent != NULL, FALSE); - g_return_val_if_fail (prop_name != NULL, FALSE); - - prop = xmlGetProp ((xmlNode *) parent, (xmlChar*)prop_name); - if (prop != NULL) { - if (!g_ascii_strcasecmp ((gchar *)prop, "true") || !g_ascii_strcasecmp ((gchar *)prop, "1")) { - ret_val = TRUE; - } else { - ret_val = FALSE; - } - g_free (prop); - } - - return ret_val; -} +static gboolean mate_wp_xml_get_bool(const xmlNode* parent, const char* prop_name) +{ + gboolean ret_val = FALSE; + + if (parent != NULL && prop_name != NULL) + { + xmlChar* prop = xmlGetProp((xmlNode*) parent, (xmlChar*) prop_name); + + if (prop != NULL) + { + if (!g_ascii_strcasecmp((char*) prop, "true") || !g_ascii_strcasecmp((char*) prop, "1")) + { + ret_val = TRUE; + } + else + { + ret_val = FALSE; + } + + g_free(prop); + } + } -static void mate_wp_xml_set_bool (const xmlNode * parent, - const xmlChar * prop_name, gboolean value) { - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); + return ret_val; +} - if (value) { - xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"true"); - } else { - xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"false"); - } +static void mate_wp_xml_set_bool(const xmlNode* parent, const xmlChar* prop_name, gboolean value) +{ + if (parent != NULL && prop_name != NULL) + { + if (value) + { + xmlSetProp((xmlNode*) parent, prop_name, (xmlChar*) "true"); + } + else + { + xmlSetProp((xmlNode*) parent, prop_name, (xmlChar*) "false"); + } + } } -static void mate_wp_load_legacy (AppearanceData *data) { - FILE * fp; - gchar * foo, * filename; +static void mate_wp_load_legacy(AppearanceData* data) +{ + /* Legacy of GNOME2 + * ~/.gnome2/wallpapers.list */ + char* filename = g_build_filename(g_get_home_dir(), ".gnome2", "wallpapers.list", NULL); - filename = g_build_filename (g_get_home_dir (), ".mate2", - "wallpapers.list", NULL); + if (g_file_test(filename, G_FILE_TEST_EXISTS)) + { + FILE* fp; - if (g_file_test (filename, G_FILE_TEST_EXISTS)) { - if ((fp = fopen (filename, "r")) != NULL) { - foo = (gchar *) g_malloc (sizeof (gchar) * 4096); - while (fgets (foo, 4096, fp)) { - MateWPItem * item; + if ((fp = fopen(filename, "r")) != NULL) + { + char* foo = (char*) g_malloc(sizeof(char) * 4096); - if (foo[strlen (foo) - 1] == '\n') { - foo[strlen (foo) - 1] = '\0'; - } + while (fgets(foo, 4096, fp)) + { + MateWPItem * item; + + if (foo[strlen(foo) - 1] == '\n') + { + foo[strlen(foo) - 1] = '\0'; + } + + item = g_hash_table_lookup(data->wp_hash, foo); - item = g_hash_table_lookup (data->wp_hash, foo); - if (item != NULL) { - continue; + if (item != NULL) + { + continue; + } + + if (!g_file_test(foo, G_FILE_TEST_EXISTS)) + { + continue; + } + + item = mate_wp_item_new(foo, data->wp_hash, data->thumb_factory); + + if (item != NULL && item->fileinfo == NULL) + { + mate_wp_item_free(item); + } + } + + fclose(fp); + g_free(foo); + } } - if (!g_file_test (foo, G_FILE_TEST_EXISTS)) { - continue; + g_free(filename); +} + +static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename) +{ + xmlDoc* wplist; + xmlNode* root; + xmlNode* list; + xmlNode* wpa; + xmlChar* nodelang; + const char* const* syslangs; + GdkColor color1; + GdkColor color2; + gint i; + + wplist = xmlParseFile(filename); + + if (!wplist) + { + return; } - item = mate_wp_item_new (foo, data->wp_hash, data->thumb_factory); - if (item != NULL && item->fileinfo == NULL) { - mate_wp_item_free (item); + syslangs = g_get_language_names(); + + root = xmlDocGetRootElement(wplist); + + for (list = root->children; list != NULL; list = list->next) + { + if (!strcmp((char*) list->name, "wallpaper")) + { + MateWPItem * wp; + char *pcolor = NULL, *scolor = NULL; + char *s; + gboolean have_scale = FALSE, have_shade = FALSE; + + wp = g_new0(MateWPItem, 1); + + wp->deleted = mate_wp_xml_get_bool(list, "deleted"); + + for (wpa = list->children; wpa != NULL; wpa = wpa->next) + { + if (wpa->type == XML_COMMENT_NODE) + { + continue; + } + else if (!strcmp ((char*) wpa->name, "filename")) + { + if (wpa->last != NULL && wpa->last->content != NULL) + { + const char* none = "(none)"; + char* content = g_strstrip((char*) wpa->last->content); + + if (!strcmp (content, none)) + { + wp->filename = g_strdup (content); + } + else if (g_utf8_validate (content, -1, NULL) && g_file_test (content, G_FILE_TEST_EXISTS)) + { + wp->filename = g_strdup (content); + } + else + { + wp->filename = g_filename_from_utf8 (content, -1, NULL, NULL, NULL); + } + } + else + { + break; + } + } + else if (!strcmp ((char*) wpa->name, "name")) + { + if (wpa->last != NULL && wpa->last->content != NULL) + { + nodelang = xmlNodeGetLang (wpa->last); + + if (wp->name == NULL && nodelang == NULL) + { + wp->name = g_strdup (g_strstrip ((char *)wpa->last->content)); + } + else + { + for (i = 0; syslangs[i] != NULL; i++) + { + if (!strcmp (syslangs[i], (char *)nodelang)) + { + g_free (wp->name); + wp->name = g_strdup (g_strstrip ((char*) wpa->last->content)); + break; + } + } + } + + xmlFree (nodelang); + } + else + { + break; + } + } + else if (!strcmp ((char*) wpa->name, "options")) + { + if (wpa->last != NULL) + { + wp->options = wp_item_string_to_option(g_strstrip ((char *)wpa->last->content)); + have_scale = TRUE; + } + } + else if (!strcmp ((char*) wpa->name, "shade_type")) + { + if (wpa->last != NULL) + { + wp->shade_type = wp_item_string_to_shading(g_strstrip ((char *)wpa->last->content)); + have_shade = TRUE; + } + } + else if (!strcmp ((char*) wpa->name, "pcolor")) + { + if (wpa->last != NULL) + { + pcolor = g_strdup(g_strstrip ((char *)wpa->last->content)); + } + } + else if (!strcmp ((char*) wpa->name, "scolor")) + { + if (wpa->last != NULL) + { + scolor = g_strdup(g_strstrip ((char *)wpa->last->content)); + } + } + else if (!strcmp ((char*) wpa->name, "text")) + { + /* Do nothing here, libxml2 is being weird */ + } + else + { + g_warning ("Unknown Tag: %s", wpa->name); + } + } + + /* Make sure we don't already have this one and that filename exists */ + if (wp->filename == NULL || g_hash_table_lookup (data->wp_hash, wp->filename) != NULL) + { + + mate_wp_item_free (wp); + g_free (pcolor); + g_free (scolor); + continue; + } + + /* Verify the colors and alloc some GdkColors here */ + if (!have_scale) + { + s = mateconf_client_get_string(data->client, WP_OPTIONS_KEY, NULL); + wp->options = wp_item_string_to_option (s); + g_free (s); + } + + if (!have_shade) + { + s = mateconf_client_get_string(data->client, WP_SHADING_KEY, NULL); + wp->shade_type = wp_item_string_to_shading (s); + g_free (s); + } + + if (pcolor == NULL) + { + pcolor = mateconf_client_get_string(data->client, WP_PCOLOR_KEY, NULL); + } + + if (scolor == NULL) + { + scolor = mateconf_client_get_string (data->client, WP_SCOLOR_KEY, NULL); + } + + gdk_color_parse(pcolor, &color1); + gdk_color_parse(scolor, &color2); + g_free(pcolor); + g_free(scolor); + + wp->pcolor = gdk_color_copy(&color1); + wp->scolor = gdk_color_copy(&color2); + + if ((wp->filename != NULL && g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || !strcmp (wp->filename, "(none)")) + { + wp->fileinfo = mate_wp_info_new(wp->filename, data->thumb_factory); + + if (wp->name == NULL || !strcmp(wp->filename, "(none)")) + { + g_free (wp->name); + wp->name = g_strdup (wp->fileinfo->name); + } + + mate_wp_item_ensure_mate_bg (wp); + mate_wp_item_update_description (wp); + g_hash_table_insert (data->wp_hash, wp->filename, wp); + } + else + { + mate_wp_item_free(wp); + wp = NULL; + } + } } - } - fclose (fp); - g_free (foo); - } - } - g_free (filename); + xmlFreeDoc(wplist); } -static void mate_wp_xml_load_xml (AppearanceData *data, - const gchar * filename) { - xmlDoc * wplist; - xmlNode * root, * list, * wpa; - xmlChar * nodelang; - const gchar * const * syslangs; - GdkColor color1, color2; - gint i; - - wplist = xmlParseFile (filename); - - if (!wplist) - return; - - syslangs = g_get_language_names (); - - root = xmlDocGetRootElement (wplist); - - for (list = root->children; list != NULL; list = list->next) { - if (!strcmp ((gchar *)list->name, "wallpaper")) { - MateWPItem * wp; - gchar *pcolor = NULL, *scolor = NULL; - gchar *s; - gboolean have_scale = FALSE, have_shade = FALSE; - - wp = g_new0 (MateWPItem, 1); - - wp->deleted = mate_wp_xml_get_bool (list, "deleted"); - - for (wpa = list->children; wpa != NULL; wpa = wpa->next) { - if (wpa->type == XML_COMMENT_NODE) { - continue; - } else if (!strcmp ((gchar *)wpa->name, "filename")) { - if (wpa->last != NULL && wpa->last->content != NULL) { - const char * none = "(none)"; - gchar *content = g_strstrip ((gchar *)wpa->last->content); - - if (!strcmp (content, none)) - wp->filename = g_strdup (content); - else if (g_utf8_validate (content, -1, NULL) && - g_file_test (content, G_FILE_TEST_EXISTS)) - wp->filename = g_strdup (content); - else - wp->filename = g_filename_from_utf8 (content, -1, NULL, NULL, NULL); - } else { - break; - } - } else if (!strcmp ((gchar *)wpa->name, "name")) { - if (wpa->last != NULL && wpa->last->content != NULL) { - nodelang = xmlNodeGetLang (wpa->last); - - if (wp->name == NULL && nodelang == NULL) { - wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } else { - for (i = 0; syslangs[i] != NULL; i++) { - if (!strcmp (syslangs[i], (gchar *)nodelang)) { - g_free (wp->name); - wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - break; - } - } - } - - xmlFree (nodelang); - } else { - break; - } - } else if (!strcmp ((gchar *)wpa->name, "options")) { - if (wpa->last != NULL) { - wp->options = wp_item_string_to_option (g_strstrip ((gchar *)wpa->last->content)); - have_scale = TRUE; - } - } else if (!strcmp ((gchar *)wpa->name, "shade_type")) { - if (wpa->last != NULL) { - wp->shade_type = wp_item_string_to_shading (g_strstrip ((gchar *)wpa->last->content)); - have_shade = TRUE; - } - } else if (!strcmp ((gchar *)wpa->name, "pcolor")) { - if (wpa->last != NULL) { - pcolor = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "scolor")) { - if (wpa->last != NULL) { - scolor = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "text")) { - /* Do nothing here, libxml2 is being weird */ - } else { - g_warning ("Unknown Tag: %s", wpa->name); +static void mate_wp_file_changed(GFileMonitor* monitor, GFile* file, GFile* other_file, GFileMonitorEvent event_type, AppearanceData* data) +{ + char* filename; + + switch (event_type) + { + case G_FILE_MONITOR_EVENT_CHANGED: + case G_FILE_MONITOR_EVENT_CREATED: + filename = g_file_get_path(file); + mate_wp_xml_load_xml(data, filename); + g_free(filename); + break; + default: + break; } - } - - /* Make sure we don't already have this one and that filename exists */ - if (wp->filename == NULL || - g_hash_table_lookup (data->wp_hash, wp->filename) != NULL) { - - mate_wp_item_free (wp); - g_free (pcolor); - g_free (scolor); - continue; - } - - /* Verify the colors and alloc some GdkColors here */ - if (!have_scale) { - s = mateconf_client_get_string (data->client, WP_OPTIONS_KEY, NULL); - wp->options = wp_item_string_to_option (s); - g_free (s); - } - - if (!have_shade) { - s = mateconf_client_get_string (data->client, WP_SHADING_KEY, NULL); - wp->shade_type = wp_item_string_to_shading (s); - g_free (s); - } - - if (pcolor == NULL) { - pcolor = mateconf_client_get_string (data->client, - WP_PCOLOR_KEY, NULL); - } - if (scolor == NULL) { - scolor = mateconf_client_get_string (data->client, - WP_SCOLOR_KEY, NULL); - } - gdk_color_parse (pcolor, &color1); - gdk_color_parse (scolor, &color2); - g_free (pcolor); - g_free (scolor); - - wp->pcolor = gdk_color_copy (&color1); - wp->scolor = gdk_color_copy (&color2); - - if ((wp->filename != NULL && - g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || - !strcmp (wp->filename, "(none)")) { - wp->fileinfo = mate_wp_info_new (wp->filename, data->thumb_factory); - - if (wp->name == NULL || !strcmp (wp->filename, "(none)")) { - g_free (wp->name); - wp->name = g_strdup (wp->fileinfo->name); +} + +static void mate_wp_xml_add_monitor(GFile* directory, AppearanceData* data) +{ + GError* error = NULL; + + GFileMonitor* monitor = g_file_monitor_directory(directory, G_FILE_MONITOR_NONE, NULL, &error); + + if (error != NULL) + { + char* path = g_file_get_parse_name (directory); + g_warning("Unable to monitor directory %s: %s", path, error->message); + g_error_free(error); + g_free(path); + return; } - mate_wp_item_ensure_mate_bg (wp); - mate_wp_item_update_description (wp); - g_hash_table_insert (data->wp_hash, wp->filename, wp); - } else { - mate_wp_item_free (wp); - wp = NULL; - } - } - } - xmlFreeDoc (wplist); + g_signal_connect(monitor, "changed", G_CALLBACK(mate_wp_file_changed), data); } -static void mate_wp_file_changed (GFileMonitor *monitor, - GFile *file, - GFile *other_file, - GFileMonitorEvent event_type, - AppearanceData *data) { - gchar * filename; - - switch (event_type) { - case G_FILE_MONITOR_EVENT_CHANGED: - case G_FILE_MONITOR_EVENT_CREATED: - filename = g_file_get_path (file); - mate_wp_xml_load_xml (data, filename); - g_free (filename); - break; - default: - break; - } -} +static void mate_wp_xml_load_from_dir(const char* path, AppearanceData* data) +{ + GFile* directory; + GFileEnumerator* enumerator; + GError* error = NULL; + GFileInfo* info; + + if (!g_file_test(path, G_FILE_TEST_IS_DIR)) + { + return; + } + + directory = g_file_new_for_path(path); + enumerator = g_file_enumerate_children( + directory, + G_FILE_ATTRIBUTE_STANDARD_NAME, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + + if (error != NULL) + { + g_warning("Unable to check directory %s: %s", path, error->message); + g_error_free(error); + g_object_unref(directory); + return; + } + + while ((info = g_file_enumerator_next_file(enumerator, NULL, NULL))) + { + const char* filename = g_file_info_get_name(info); + char* fullpath = g_build_filename(path, filename, NULL); + + g_object_unref(info); + + mate_wp_xml_load_xml(data, fullpath); + g_free(fullpath); + } -static void mate_wp_xml_add_monitor (GFile *directory, - AppearanceData *data) { - GFileMonitor *monitor; - GError *error = NULL; - - monitor = g_file_monitor_directory (directory, - G_FILE_MONITOR_NONE, - NULL, - &error); - if (error != NULL) { - gchar *path; - - path = g_file_get_parse_name (directory); - g_warning ("Unable to monitor directory %s: %s", - path, error->message); - g_error_free (error); - g_free (path); - return; - } - - g_signal_connect (monitor, "changed", - G_CALLBACK (mate_wp_file_changed), - data); + g_file_enumerator_close(enumerator, NULL, NULL); + + mate_wp_xml_add_monitor(directory, data); + + g_object_unref(directory); } -static void mate_wp_xml_load_from_dir (const gchar *path, - AppearanceData *data) { - GFile *directory; - GFileEnumerator *enumerator; - GError *error = NULL; - GFileInfo *info; - - if (!g_file_test (path, G_FILE_TEST_IS_DIR)) { - return; - } - - directory = g_file_new_for_path (path); - enumerator = g_file_enumerate_children (directory, - G_FILE_ATTRIBUTE_STANDARD_NAME, - G_FILE_QUERY_INFO_NONE, - NULL, - &error); - if (error != NULL) { - g_warning ("Unable to check directory %s: %s", path, error->message); - g_error_free (error); - g_object_unref (directory); - return; - } - - while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL))) { - const gchar *filename; - gchar *fullpath; - - filename = g_file_info_get_name (info); - fullpath = g_build_filename (path, filename, NULL); - g_object_unref (info); - - mate_wp_xml_load_xml (data, fullpath); - g_free (fullpath); - } - g_file_enumerator_close (enumerator, NULL, NULL); - - mate_wp_xml_add_monitor (directory, data); - - g_object_unref (directory); +void mate_wp_xml_load_list(AppearanceData* data) +{ + const char* const* system_data_dirs; + char* datadir; + char* wpdbfile; + gint i; + + wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "backgrounds.xml", NULL); + + if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) + { + mate_wp_xml_load_xml(data, wpdbfile); + } + else + { + g_free (wpdbfile); + + wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "wp-list.xml", NULL); + + if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) + { + mate_wp_xml_load_xml(data, wpdbfile); + } + } + + g_free (wpdbfile); + + /* This is obsoleto. + * Do not store stuff in ~/.mate2/ */ + #ifndef MATE_DISABLE_DEPRECATED + /*wpdbfile = g_build_filename(g_get_home_dir(), ".mate2", "backgrounds.xml", NULL); + + if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) + { + mate_wp_xml_load_xml(data, wpdbfile); + } + else + { + g_free (wpdbfile); + + wpdbfile = g_build_filename(g_get_home_dir(), ".mate2", "wp-list.xml", NULL); + + if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) + { + mate_wp_xml_load_xml(data, wpdbfile); + } + } + + g_free(wpdbfile);*/ + #endif /* MATE_DISABLE_DEPRECATED */ + + datadir = g_build_filename(g_get_user_data_dir(), "mate-background-properties", NULL); + mate_wp_xml_load_from_dir(datadir, data); + g_free(datadir); + + system_data_dirs = g_get_system_data_dirs(); + + for (i = 0; system_data_dirs[i]; i++) + { + datadir = g_build_filename(system_data_dirs[i], "mate-background-properties", NULL); + mate_wp_xml_load_from_dir(datadir, data); + g_free (datadir); + } + + mate_wp_xml_load_from_dir(WALLPAPER_DATADIR, data); + + mate_wp_load_legacy(data); } -void mate_wp_xml_load_list (AppearanceData *data) { - const char * const *system_data_dirs; - gchar * datadir; - gchar * wpdbfile; - gint i; - - wpdbfile = g_build_filename (g_get_home_dir (), - ".mate2", - "backgrounds.xml", - NULL); - - if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) { - mate_wp_xml_load_xml (data, wpdbfile); - } else { - g_free (wpdbfile); - wpdbfile = g_build_filename (g_get_home_dir (), - ".mate2", - "wp-list.xml", - NULL); - if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) { - mate_wp_xml_load_xml (data, wpdbfile); - } - } - g_free (wpdbfile); - - datadir = g_build_filename (g_get_user_data_dir (), - "mate-background-properties", - NULL); - mate_wp_xml_load_from_dir (datadir, data); - g_free (datadir); - - system_data_dirs = g_get_system_data_dirs (); - for (i = 0; system_data_dirs[i]; i++) { - datadir = g_build_filename (system_data_dirs[i], - "mate-background-properties", - NULL); - mate_wp_xml_load_from_dir (datadir, data); - g_free (datadir); - } - - mate_wp_xml_load_from_dir (WALLPAPER_DATADIR, data); - - mate_wp_load_legacy (data); +static void mate_wp_list_flatten(const char* key, MateWPItem* item, GSList** list) +{ + if (key != NULL && item != NULL) + { + *list = g_slist_prepend(*list, item); + } } -static void mate_wp_list_flatten (const gchar * key, MateWPItem * item, - GSList ** list) { - g_return_if_fail (key != NULL); - g_return_if_fail (item != NULL); +void mate_wp_xml_save_list(AppearanceData* data) +{ + xmlDoc* wplist; + xmlNode* root; + xmlNode* wallpaper; + //xmlNode* item; + GSList* list = NULL; + char* wpfile; + + g_hash_table_foreach(data->wp_hash, (GHFunc) mate_wp_list_flatten, &list); + g_hash_table_destroy(data->wp_hash); + list = g_slist_reverse(list); + + wpfile = g_build_filename(g_get_home_dir (), ".config", "mate", "backgrounds.xml", NULL); + + xmlKeepBlanksDefault(0); + + wplist = xmlNewDoc((xmlChar*) "1.0"); + xmlCreateIntSubset(wplist, (xmlChar*) "wallpapers", NULL, (xmlChar*) "mate-wp-list.dtd"); + root = xmlNewNode(NULL, (xmlChar*) "wallpapers"); + xmlDocSetRootElement(wplist, root); + + while (list != NULL) + { + MateWPItem* wpitem = list->data; + const char* none = "(none)"; + char* filename; + const char* scale; + const char* shade; + char* pcolor; + char* scolor; + + if (!strcmp(wpitem->filename, none) || (g_utf8_validate(wpitem->filename, -1, NULL) && g_file_test(wpitem->filename, G_FILE_TEST_EXISTS))) + { + filename = g_strdup(wpitem->filename); + } + else + { + filename = g_filename_to_utf8(wpitem->filename, -1, NULL, NULL, NULL); + } + + pcolor = gdk_color_to_string(wpitem->pcolor); + scolor = gdk_color_to_string(wpitem->scolor); + scale = wp_item_option_to_string(wpitem->options); + shade = wp_item_shading_to_string(wpitem->shade_type); + + wallpaper = xmlNewChild(root, NULL, (xmlChar*) "wallpaper", NULL); + mate_wp_xml_set_bool(wallpaper, (xmlChar*) "deleted", wpitem->deleted); + + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "name", (xmlChar*) wpitem->name); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "filename", (xmlChar*) filename); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "options", (xmlChar*) scale); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "shade_type", (xmlChar*) shade); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "pcolor", (xmlChar*) pcolor); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "scolor", (xmlChar*) scolor); + + g_free(pcolor); + g_free(scolor); + g_free(filename); + + list = g_slist_delete_link(list, list); + mate_wp_item_free(wpitem); + } - *list = g_slist_prepend (*list, item); -} + /* Guardamos el archivo, solo si hay nodos en <wallpapers> */ + if (xmlChildElementCount(root) > 0) + { + xmlSaveFormatFile(wpfile, wplist, 1); + } -void mate_wp_xml_save_list (AppearanceData *data) { - xmlDoc * wplist; - xmlNode * root, * wallpaper, * item; - GSList * list = NULL; - gchar * wpfile; - - g_hash_table_foreach (data->wp_hash, - (GHFunc) mate_wp_list_flatten, &list); - g_hash_table_destroy (data->wp_hash); - list = g_slist_reverse (list); - - wpfile = g_build_filename (g_get_home_dir (), - "/.mate2", - "backgrounds.xml", - NULL); - - xmlKeepBlanksDefault (0); - - wplist = xmlNewDoc ((xmlChar *)"1.0"); - xmlCreateIntSubset (wplist, (xmlChar *)"wallpapers", NULL, (xmlChar *)"mate-wp-list.dtd"); - root = xmlNewNode (NULL, (xmlChar *)"wallpapers"); - xmlDocSetRootElement (wplist, root); - - while (list != NULL) { - MateWPItem * wpitem = list->data; - const char * none = "(none)"; - gchar * filename; - const gchar * scale, * shade; - gchar * pcolor, * scolor; - - if (!strcmp (wpitem->filename, none) || - (g_utf8_validate (wpitem->filename, -1, NULL) && - g_file_test (wpitem->filename, G_FILE_TEST_EXISTS))) - filename = g_strdup (wpitem->filename); - else - filename = g_filename_to_utf8 (wpitem->filename, -1, NULL, NULL, NULL); - - pcolor = gdk_color_to_string (wpitem->pcolor); - scolor = gdk_color_to_string (wpitem->scolor); - scale = wp_item_option_to_string (wpitem->options); - shade = wp_item_shading_to_string (wpitem->shade_type); - - wallpaper = xmlNewChild (root, NULL, (xmlChar *)"wallpaper", NULL); - mate_wp_xml_set_bool (wallpaper, (xmlChar *)"deleted", wpitem->deleted); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"name", (xmlChar *)wpitem->name); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"filename", (xmlChar *)filename); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"options", (xmlChar *)scale); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"shade_type", (xmlChar *)shade); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"pcolor", (xmlChar *)pcolor); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"scolor", (xmlChar *)scolor); - g_free (pcolor); - g_free (scolor); - g_free (filename); - - list = g_slist_delete_link (list, list); - mate_wp_item_free (wpitem); - } - xmlSaveFormatFile (wpfile, wplist, 1); - xmlFreeDoc (wplist); - g_free (wpfile); + xmlFreeDoc(wplist); + g_free(wpfile); } diff --git a/capplets/appearance/mate-wp-xml.h b/capplets/appearance/mate-wp-xml.h index 795487ff..18d3807b 100644 --- a/capplets/appearance/mate-wp-xml.h +++ b/capplets/appearance/mate-wp-xml.h @@ -21,8 +21,8 @@ #ifndef _MATE_WP_XML_H_ #define _MATE_WP_XML_H_ -void mate_wp_xml_load_list (AppearanceData *data); -void mate_wp_xml_save_list (AppearanceData *data); +void mate_wp_xml_load_list(AppearanceData* data); +void mate_wp_xml_save_list(AppearanceData* data); #endif diff --git a/capplets/appearance/theme-util.c b/capplets/appearance/theme-util.c index 2305b0f9..69a0423a 100644 --- a/capplets/appearance/theme-util.c +++ b/capplets/appearance/theme-util.c @@ -29,8 +29,7 @@ #include "capplet-util.h" #include "theme-util.h" -gboolean -theme_is_writable (const gpointer theme) +gboolean theme_is_writable (const gpointer theme) { MateThemeCommonInfo *info = theme; GFile *file; @@ -57,8 +56,7 @@ theme_is_writable (const gpointer theme) return writable; } -gboolean -theme_delete (const gchar *name, ThemeType type) +gboolean theme_delete (const gchar *name, ThemeType type) { gboolean rc; GtkDialog *dialog; @@ -140,8 +138,7 @@ theme_delete (const gchar *name, ThemeType type) return rc; } -gboolean -theme_model_iter_last (GtkTreeModel *model, GtkTreeIter *iter) +gboolean theme_model_iter_last (GtkTreeModel *model, GtkTreeIter *iter) { GtkTreeIter walk, prev; gboolean valid; @@ -160,8 +157,7 @@ theme_model_iter_last (GtkTreeModel *model, GtkTreeIter *iter) return FALSE; } -gboolean -theme_find_in_model (GtkTreeModel *model, const gchar *name, GtkTreeIter *iter) +gboolean theme_find_in_model (GtkTreeModel *model, const gchar *name, GtkTreeIter *iter) { GtkTreeIter walk; gboolean valid; @@ -190,8 +186,7 @@ theme_find_in_model (GtkTreeModel *model, const gchar *name, GtkTreeIter *iter) return FALSE; } -gboolean -packagekit_available (void) +gboolean packagekit_available (void) { DBusGConnection *connection; DBusGProxy *proxy; diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c index aead0b34..b15abafe 100644 --- a/capplets/common/mate-theme-info.c +++ b/capplets/common/mate-theme-info.c @@ -637,7 +637,7 @@ read_current_cursor_font (void) gchar *dir_name; struct dirent *file_dirent; - dir_name = g_build_filename (g_get_home_dir (), ".mate2/share/cursor-fonts", NULL); + dir_name = g_build_filename (g_get_home_dir (), ".config/mate/share/cursor-fonts", NULL); if (! g_file_test (dir_name, G_FILE_TEST_EXISTS)) { g_free (dir_name); return NULL; diff --git a/capplets/common/wm-common.c b/capplets/common/wm-common.c index 31cd503d..acf9e431 100644 --- a/capplets/common/wm-common.c +++ b/capplets/common/wm-common.c @@ -29,12 +29,12 @@ wm_common_get_window_manager_property (Atom atom) if (wm_window == None) return NULL; - utf8_string = XInternAtom (GDK_DISPLAY (), "UTF8_STRING", False); + utf8_string = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "UTF8_STRING", False); gdk_error_trap_push (); val = NULL; - result = XGetWindowProperty (GDK_DISPLAY (), + result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), wm_window, atom, 0, G_MAXLONG, @@ -62,7 +62,7 @@ wm_common_get_window_manager_property (Atom atom) char* wm_common_get_current_window_manager (void) { - Atom atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False); + Atom atom = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_NET_WM_NAME", False); char *result; result = wm_common_get_window_manager_property (atom); @@ -75,7 +75,7 @@ wm_common_get_current_window_manager (void) char** wm_common_get_current_keybindings (void) { - Atom keybindings_atom = XInternAtom (GDK_DISPLAY (), "_MATE_WM_KEYBINDINGS", False); + Atom keybindings_atom = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_MATE_WM_KEYBINDINGS", False); char *keybindings = wm_common_get_window_manager_property (keybindings_atom); char **results; @@ -89,7 +89,7 @@ wm_common_get_current_keybindings (void) } else { - Atom wm_atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False); + Atom wm_atom = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_NET_WM_NAME", False); char *wm_name = wm_common_get_window_manager_property (wm_atom); char *to_copy[] = { NULL, NULL }; @@ -111,8 +111,8 @@ update_wm_window (void) gulong nitems; gulong bytes_after; - XGetWindowProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (), - XInternAtom (GDK_DISPLAY (), "_NET_SUPPORTING_WM_CHECK", False), + XGetWindowProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), GDK_ROOT_WINDOW (), + XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_NET_SUPPORTING_WM_CHECK", False), 0, G_MAXLONG, False, XA_WINDOW, &type, &format, &nitems, &bytes_after, (guchar **) &xwindow); @@ -123,8 +123,8 @@ update_wm_window (void) } gdk_error_trap_push (); - XSelectInput (GDK_DISPLAY (), *xwindow, StructureNotifyMask | PropertyChangeMask); - XSync (GDK_DISPLAY (), False); + XSelectInput (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), *xwindow, StructureNotifyMask | PropertyChangeMask); + XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False); if (gdk_error_trap_pop ()) { @@ -149,10 +149,10 @@ wm_window_event_filter (GdkXEvent *xev, wm_window != None && xevent->xany.window == wm_window) || (xevent->type == PropertyNotify && xevent->xany.window == GDK_ROOT_WINDOW () && - xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY (), "_NET_SUPPORTING_WM_CHECK", False))) || + xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_NET_SUPPORTING_WM_CHECK", False))) || (xevent->type == PropertyNotify && wm_window != None && xevent->xany.window == wm_window && - xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False)))) + xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "_NET_WM_NAME", False)))) { update_wm_window (); (* ncb_data->func) ((gpointer)wm_common_get_current_window_manager(), @@ -177,8 +177,8 @@ wm_common_register_window_manager_change (GFunc func, update_wm_window (); - XSelectInput (GDK_DISPLAY (), GDK_ROOT_WINDOW (), PropertyChangeMask); - XSync (GDK_DISPLAY (), False); + XSelectInput (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), GDK_ROOT_WINDOW (), PropertyChangeMask); + XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False); } diff --git a/capplets/default-applications/Makefile.am b/capplets/default-applications/Makefile.am index b6487ec7..8ad7740d 100644 --- a/capplets/default-applications/Makefile.am +++ b/capplets/default-applications/Makefile.am @@ -45,30 +45,6 @@ INCLUDES = \ -DMATECC_UI_DIR=\""$(uidir)"\" \ -DMATECC_APPS_DIR=\""$(xmldatadir)"\" -icons16dir = $(datadir)/icons/mate/16x16/apps -dist_icons16_DATA = icons/16x16/preferences-desktop-default-applications.png -icons22dir = $(datadir)/icons/mate/22x22/apps -dist_icons22_DATA = icons/22x22/preferences-desktop-default-applications.png -icons24dir = $(datadir)/icons/mate/24x24/apps -dist_icons24_DATA = icons/24x24/preferences-desktop-default-applications.png -icons32dir = $(datadir)/icons/mate/32x32/apps -dist_icons32_DATA = icons/32x32/preferences-desktop-default-applications.png -icons48dir = $(datadir)/icons/mate/48x48/apps -dist_icons48_DATA = icons/48x48/preferences-desktop-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 = $(MATECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) $(xmldata_DATA) $(autostart_DATA) $(bin_SCRIPTS) EXTRA_DIST = $(xmldata_in_files) mate-default-applications.pc.in diff --git a/capplets/default-applications/icons/16x16/preferences-desktop-default-applications.png b/capplets/default-applications/icons/16x16/preferences-desktop-default-applications.png Binary files differdeleted file mode 100644 index 41a765aa..00000000 --- a/capplets/default-applications/icons/16x16/preferences-desktop-default-applications.png +++ /dev/null diff --git a/capplets/default-applications/icons/22x22/preferences-desktop-default-applications.png b/capplets/default-applications/icons/22x22/preferences-desktop-default-applications.png Binary files differdeleted file mode 100644 index 83b6826c..00000000 --- a/capplets/default-applications/icons/22x22/preferences-desktop-default-applications.png +++ /dev/null diff --git a/capplets/default-applications/icons/24x24/preferences-desktop-default-applications.png b/capplets/default-applications/icons/24x24/preferences-desktop-default-applications.png Binary files differdeleted file mode 100644 index 630ea040..00000000 --- a/capplets/default-applications/icons/24x24/preferences-desktop-default-applications.png +++ /dev/null diff --git a/capplets/default-applications/icons/32x32/preferences-desktop-default-applications.png b/capplets/default-applications/icons/32x32/preferences-desktop-default-applications.png Binary files differdeleted file mode 100644 index 23718f78..00000000 --- a/capplets/default-applications/icons/32x32/preferences-desktop-default-applications.png +++ /dev/null diff --git a/capplets/default-applications/icons/48x48/preferences-desktop-default-applications.png b/capplets/default-applications/icons/48x48/preferences-desktop-default-applications.png Binary files differdeleted file mode 100644 index ac25569d..00000000 --- a/capplets/default-applications/icons/48x48/preferences-desktop-default-applications.png +++ /dev/null diff --git a/capplets/default-applications/mate-da-capplet.c b/capplets/default-applications/mate-da-capplet.c index 37a01359..69061efd 100644 --- a/capplets/default-applications/mate-da-capplet.c +++ b/capplets/default-applications/mate-da-capplet.c @@ -3,6 +3,7 @@ * * Copyright 2005-2006 Luca Cavalli * Copyright 2008 Thomas Wood <[email protected]> + * Copyright 2010 Perberos <[email protected]> * * 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 @@ -20,7 +21,7 @@ */ #ifdef HAVE_CONFIG_H -#include <config.h> + #include <config.h> #endif #include <string.h> @@ -43,60 +44,91 @@ static void close_cb(GtkWidget* window, gint response, gpointer user_data) { if (response == GTK_RESPONSE_HELP) { - capplet_help (GTK_WINDOW (window), "prefs-preferredapps"); + capplet_help(GTK_WINDOW (window), "prefs-preferredapps"); } else { - gtk_widget_destroy (window); - gtk_main_quit (); + gtk_widget_destroy(window); + gtk_main_quit(); } } -static void set_icon (GtkImage* image, GtkIconTheme* theme, const char* name) +static void web_radiobutton_toggled_cb(GtkWidget* togglebutton, MateDACapplet* capplet) { - GdkPixbuf* pixbuf; + gint index; + MateDAWebItem* item; + const gchar* command; + GError* error = NULL; + + index = gtk_combo_box_get_active(GTK_COMBO_BOX(capplet->web_combo_box)); - if ((pixbuf = gtk_icon_theme_load_icon(theme, name, 48, 0, NULL))) + if (index == -1) { - gtk_image_set_from_pixbuf(image, pixbuf); - g_object_unref(pixbuf); + return; } -} -static void web_radiobutton_toggled_cb(GtkWidget* togglebutton, MateDACapplet* capplet) -{ - gint index; - MateDAWebItem *item; - const gchar *command; - GError *error = NULL; + item = (MateDAWebItem*) g_list_nth_data(capplet->web_browsers, index); - index = gtk_combo_box_get_active (GTK_COMBO_BOX (capplet->web_combo_box)); + if (item == NULL) + { + return; + } - if (index == -1) - return; + if (togglebutton == capplet->new_win_radiobutton) + { + command = item->win_command; + } + else if (togglebutton == capplet->new_tab_radiobutton) + { + command = item->tab_command; + } + else + { + command = item->generic.command; + } - item = (MateDAWebItem *) g_list_nth_data (capplet->web_browsers, index); - if (item == NULL) - return; + mateconf_client_set_string(capplet->mateconf, DEFAULT_APPS_KEY_HTTP_EXEC, command, &error); - if (togglebutton == capplet->new_win_radiobutton) { - command = item->win_command; - } - else if (togglebutton == capplet->new_tab_radiobutton) { - command = item->tab_command; - } - else { - command = item->generic.command; - } + if (error != NULL) + { + g_warning(_("Error saving configuration: %s"), error->message); + g_error_free(error); + } - mateconf_client_set_string (capplet->mateconf, DEFAULT_APPS_KEY_HTTP_EXEC, command, &error); + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("x-scheme-handler/http"); - gtk_entry_set_text (GTK_ENTRY (capplet->web_browser_command_entry), command); + if (recommended!= NULL) + { + GList* app; - if (error != NULL) { - g_warning (_("Error saving configuration: %s"), error->message); - g_error_free (error); - } + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->generic.executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* establecemos el item */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "x-scheme-handler/http", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "x-scheme-handler/https", NULL); + + /* about:config es usado por mozilla firefox y algunos otros con + * webtoolkit */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "x-scheme-handler/about", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + + gtk_entry_set_text(GTK_ENTRY(capplet->web_browser_command_entry), command); + + if (error != NULL) + { + g_warning(_("Error saving configuration: %s"), error->message); + g_error_free(error); + } } static void web_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) @@ -104,41 +136,51 @@ static void web_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) guint current_index; gboolean is_custom_active; gboolean has_net_remote; - MateDAWebItem *item; - GtkWidget *active = NULL; + MateDAWebItem* item; + GtkWidget* active = NULL; - current_index = gtk_combo_box_get_active (combo); - - if (current_index < g_list_length (capplet->web_browsers)) { - - item = (MateDAWebItem*) g_list_nth_data (capplet->web_browsers, current_index); - has_net_remote = item->netscape_remote; - is_custom_active = FALSE; + current_index = gtk_combo_box_get_active(combo); + if (current_index < g_list_length(capplet->web_browsers)) + { + item = (MateDAWebItem*) g_list_nth_data(capplet->web_browsers, current_index); + has_net_remote = item->netscape_remote; + is_custom_active = FALSE; } - else { + else + { has_net_remote = FALSE; is_custom_active = TRUE; } - gtk_widget_set_sensitive (capplet->default_radiobutton, has_net_remote); - gtk_widget_set_sensitive (capplet->new_win_radiobutton, has_net_remote); - gtk_widget_set_sensitive (capplet->new_tab_radiobutton, has_net_remote); - gtk_widget_set_sensitive (capplet->web_browser_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->web_browser_command_label, is_custom_active); - gtk_widget_set_sensitive (capplet->web_browser_terminal_checkbutton, is_custom_active); + /* Si, aun falta para poder crear personalizables... */ + has_net_remote = FALSE; + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->default_radiobutton, has_net_remote); + gtk_widget_set_sensitive(capplet->new_win_radiobutton, has_net_remote); + gtk_widget_set_sensitive(capplet->new_tab_radiobutton, has_net_remote); - if (has_net_remote) { + gtk_widget_set_sensitive(capplet->web_browser_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->web_browser_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->web_browser_terminal_checkbutton, is_custom_active); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_win_radiobutton))) + if (has_net_remote) + { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(capplet->new_win_radiobutton))) + { active = capplet->new_win_radiobutton; - else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_tab_radiobutton))) + } + else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(capplet->new_tab_radiobutton))) + { active = capplet->new_tab_radiobutton; + } else + { active = capplet->default_radiobutton; + } } - web_radiobutton_toggled_cb (active, capplet); + web_radiobutton_toggled_cb(active, capplet); } /* FIXME: Refactor these two functions below into one... */ @@ -147,12 +189,134 @@ static void mail_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) guint current_index; gboolean is_custom_active; - current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->mail_readers)); + current_index = gtk_combo_box_get_active(combo); + is_custom_active = (current_index >= g_list_length(capplet->mail_readers)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->mail_readers, current_index); - gtk_widget_set_sensitive (capplet->mail_reader_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->mail_reader_command_label, is_custom_active); - gtk_widget_set_sensitive (capplet->mail_reader_terminal_checkbutton, is_custom_active); + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("x-scheme-handler/mailto"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* por alguna extraña razon, solo se usa mailto, en vez de mail. */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "x-scheme-handler/mailto", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + /* Si, aun falta para poder crear personalizables... */ + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->mail_reader_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->mail_reader_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->mail_reader_terminal_checkbutton, is_custom_active); +} + +static void file_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) +{ + guint current_index; + gboolean is_custom_active; + + current_index = gtk_combo_box_get_active(combo); + is_custom_active = (current_index >= g_list_length(capplet->file_managers)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->file_managers, current_index); + + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("inode/directory"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* falta agregar más mime-types */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "inode/directory", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + /* Si, aun falta para poder crear personalizables... */ + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->file_manager_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->file_manager_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->file_manager_terminal_checkbutton, is_custom_active); +} + +static void text_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) +{ + guint current_index; + gboolean is_custom_active; + + current_index = gtk_combo_box_get_active(combo); + is_custom_active = (current_index >= g_list_length(capplet->text_editors)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->text_editors, current_index); + + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("text/plain"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* falta agregar más mime-types */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "text/plain", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + /* Si, aun falta para poder crear personalizables... */ + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->text_editor_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->text_editor_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->text_editor_terminal_checkbutton, is_custom_active); } static void media_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) @@ -161,25 +325,115 @@ static void media_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) gboolean is_custom_active; current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->media_players)); + is_custom_active = (current_index >= g_list_length(capplet->media_players)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->media_players, current_index); - gtk_widget_set_sensitive (capplet->media_player_command_entry, is_custom_active); - gtk_widget_set_sensitive (capplet->media_player_command_label, is_custom_active); - gtk_widget_set_sensitive (capplet->media_player_terminal_checkbutton, is_custom_active); + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("audio/x-vorbis+ogg"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* por alguna extraña razon, solo se usa mailto, en vez de mail. */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "audio/x-vorbis+ogg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "audio/x-scpls", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "audio/mpeg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "audio/x-wav", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "audio/x-mpegurl", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/webm", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + /* Si, aun falta para poder crear personalizables... */ + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->media_player_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->media_player_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->media_player_terminal_checkbutton, is_custom_active); } -static void terminal_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) +static void video_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) { guint current_index; gboolean is_custom_active; current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->terminals)); + is_custom_active = (current_index >= g_list_length(capplet->video_players)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->video_players, current_index); + + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("video/x-ogm+ogg"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* por alguna extraña razon, solo se usa mailto, en vez de mail. */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/mpeg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/x-mpeg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/msvideo", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/quicktime", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/x-avi", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/x-ogm+ogg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/x-matroska", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/webm", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/mp4", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "video/x-flv", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + /* Si, aun falta para poder crear personalizables... */ + is_custom_active = FALSE; + gtk_widget_set_sensitive(capplet->video_player_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->video_player_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->video_player_terminal_checkbutton, is_custom_active); +} +static void terminal_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) +{ + guint current_index; + gboolean is_custom_active; + + 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); + 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); } static void visual_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) @@ -187,11 +441,11 @@ static void visual_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) guint current_index; gboolean is_custom_active; - current_index = gtk_combo_box_get_active (combo); - is_custom_active = (current_index >= g_list_length (capplet->visual_ats)); + 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); + gtk_widget_set_sensitive(capplet->visual_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->visual_command_label, is_custom_active); } static void mobility_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) @@ -206,6 +460,53 @@ static void mobility_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet gtk_widget_set_sensitive (capplet->mobility_command_label, is_custom_active); } +static void image_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet) +{ + guint current_index; + gboolean is_custom_active; + + current_index = gtk_combo_box_get_active(combo); + is_custom_active = (current_index >= g_list_length(capplet->image_viewers)); + + if (current_index != -1) + { + MateDAItem* item = (MateDAItem*) g_list_nth_data(capplet->image_viewers, current_index); + + if (item != NULL) + { + /* Para obtener la lista de elementos, y si está en la lista, agregar ese + * item. + * De lo contrario, se crea un elemento especial. */ + GList* recommended = g_app_info_get_recommended_for_type("image/png"); + + if (recommended!= NULL) + { + GList* app; + + for (app = recommended; app != NULL; app = app->next) + { + /* nice hack bro */ + if (strcmp(item->executable, g_app_info_get_executable((GAppInfo*) app->data)) == 0) + { + /* por alguna extraña razon, solo se usa mailto, en vez de mail. */ + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "image/png", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "image/jpeg", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "image/gif", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "image/bmp", NULL); + g_app_info_set_as_default_for_type((GAppInfo*) app->data, "image/tiff", NULL); + } + } + + g_list_free_full(recommended, g_object_unref); + } + } + } + + gtk_widget_set_sensitive(capplet->image_viewer_command_entry, is_custom_active); + gtk_widget_set_sensitive(capplet->image_viewer_command_label, is_custom_active); + gtk_widget_set_sensitive(capplet->image_viewer_terminal_checkbutton, is_custom_active); +} + static void refresh_combo_box_icons(GtkIconTheme* theme, GtkComboBox* combo_box, GList* app_list) { GList *entry; @@ -233,41 +534,48 @@ static void refresh_combo_box_icons(GtkIconTheme* theme, GtkComboBox* combo_box, } static struct { - const gchar* name; - const gchar* icon; + const char* name; + const char* icon; } icons[] = { - {"web_browser_image", "web-browser"}, - {"mail_reader_image", "emblem-mail"}, - {"media_player_image", "applications-multimedia"}, - {"visual_image", "zoom-best-fit"}, - {"mobility_image", "preferences-desktop-accessibility"}, - /* - {"messenger_image", "im"}, - {"file_manager_image", "file-manager"}, - {"image_image", "image-viewer"}, - {"video_image", "mate-multimedia"}, - {"text_image", "text-editor"}, - */ - {"terminal_image", "mate-terminal"} + {"web_browser_image", "web-browser"}, + {"mail_reader_image", "emblem-mail"}, + {"media_player_image", "audio-x-generic"}, /* applications-multimedia */ + {"visual_image", "zoom-best-fit"}, + {"mobility_image", "preferences-desktop-accessibility"}, + {"messenger_image", "user-idle"}, + {"filemanager_image", "file-manager"}, + {"imageviewer_image", "eog"}, /* no hay otra... */ + {"video_image", "video-x-generic"}, + {"text_image", "text-editor"}, + {"terminal_image", "terminal"}, }; static void theme_changed_cb(GtkIconTheme* theme, MateDACapplet* capplet) { - GObject *icon; + GObject* icon; gint i; - for (i = 0; i < G_N_ELEMENTS (icons); 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); + icon = gtk_builder_get_object(capplet->builder, icons[i].name); + + GdkPixbuf* pixbuf = gtk_icon_theme_load_icon(theme, icons[i].icon, 48, 0, NULL); + + if (pixbuf) + { + gtk_image_set_from_pixbuf(GTK_IMAGE(icon), pixbuf); + g_object_unref(pixbuf); + } } - 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->media_combo_box), capplet->media_players); - 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); + 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->media_combo_box), capplet->media_players); + 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); + refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->file_combo_box), capplet->file_managers); + refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->text_combo_box), capplet->text_editors); } static void screen_changed_cb(GtkWidget* widget, GdkScreen* screen, MateDACapplet* capplet) @@ -287,29 +595,36 @@ static void screen_changed_cb(GtkWidget* widget, GdkScreen* screen, MateDACapple capplet->icon_theme = theme; } -static gint generic_item_comp(gconstpointer list_item, gconstpointer command) +static gint generic_item_comp(const void* list_item, const void* command) { - return (strcmp (((MateDAItem *) list_item)->command, (gchar *) command)); + return (strcmp(((MateDAItem*) list_item)->command, (char*) command)); } -static gint web_item_comp(gconstpointer item, gconstpointer command) +static int web_item_comp(const void* item, const void* command) { - MateDAWebItem *web_list_item; + MateDAWebItem* web_list_item; - web_list_item = (MateDAWebItem *) item; + web_list_item = (MateDAWebItem*) item; - if (strcmp (web_list_item->generic.command, (gchar *) command) == 0) - return 0; + if (strcmp (web_list_item->generic.command, (char*) command) == 0) + { + return 0; + } - if (web_list_item->netscape_remote) { - if (strcmp (web_list_item->tab_command, (gchar *) command) == 0) - return 0; + if (web_list_item->netscape_remote) + { + if (strcmp (web_list_item->tab_command, (char*) command) == 0) + { + return 0; + } - if (strcmp (web_list_item->win_command, (gchar *) command) == 0) - return 0; + if (strcmp (web_list_item->win_command, (char*) command) == 0) + { + return 0; + } } - return (strcmp (web_list_item->generic.command, (gchar *) command)); + return (strcmp(web_list_item->generic.command, (char*) command)); } static void web_mateconf_changed_cb(MateConfPropertyEditor* peditor, gchar* key, MateConfValue* value, MateDACapplet* capplet) @@ -322,63 +637,65 @@ static void web_mateconf_changed_cb(MateConfPropertyEditor* peditor, gchar* key, * should also use the same value as HTTP */ - if (strcmp (key, DEFAULT_APPS_KEY_HTTP_EXEC) == 0) { - gchar *short_browser, *pos; - const gchar *value_str = mateconf_value_get_string (value); + if (strcmp (key, DEFAULT_APPS_KEY_HTTP_EXEC) == 0) + { + gchar *short_browser, *pos; + const gchar *value_str = mateconf_value_get_string (value); - cs = mateconf_change_set_new (); + cs = mateconf_change_set_new (); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_EXEC, value); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_EXEC, value); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_EXEC, value); - pos = strstr (value_str, " "); - if (pos == NULL) - short_browser = g_strdup (value_str); - else - short_browser = g_strndup (value_str, pos - value_str); - mateconf_change_set_set_string (cs, DEFAULT_APPS_KEY_BROWSER_EXEC, short_browser); - g_free (short_browser); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_EXEC, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_EXEC, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_EXEC, value); + pos = strstr (value_str, " "); + if (pos == NULL) + short_browser = g_strdup (value_str); + else + short_browser = g_strndup (value_str, pos - value_str); + mateconf_change_set_set_string (cs, DEFAULT_APPS_KEY_BROWSER_EXEC, short_browser); + g_free (short_browser); - list_entry = g_list_find_custom (capplet->web_browsers, - value_str, - (GCompareFunc) web_item_comp); + list_entry = g_list_find_custom (capplet->web_browsers, + value_str, + (GCompareFunc) web_item_comp); - if (list_entry) { - MateDAWebItem *item = (MateDAWebItem *) list_entry->data; + if (list_entry) { + MateDAWebItem *item = (MateDAWebItem *) list_entry->data; - mateconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NREMOTE, item->netscape_remote); - } + mateconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NREMOTE, item->netscape_remote); + } - mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error); + mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error); - if (error != NULL) { - g_warning (_("Error saving configuration: %s"), error->message); - g_error_free (error); - error = NULL; - } + if (error != NULL) { + g_warning (_("Error saving configuration: %s"), error->message); + g_error_free (error); + error = NULL; + } - mateconf_change_set_unref (cs); + mateconf_change_set_unref (cs); } - else if (strcmp (key, DEFAULT_APPS_KEY_HTTP_NEEDS_TERM) == 0) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->web_browser_terminal_checkbutton), - mateconf_value_get_bool (value)); + else if (strcmp (key, DEFAULT_APPS_KEY_HTTP_NEEDS_TERM) == 0) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->web_browser_terminal_checkbutton), + mateconf_value_get_bool (value)); - cs = mateconf_change_set_new (); + cs = mateconf_change_set_new (); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_NEEDS_TERM, value); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_NEEDS_TERM, value); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_NEEDS_TERM, value); - mateconf_change_set_set (cs, DEFAULT_APPS_KEY_BROWSER_NEEDS_TERM, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_NEEDS_TERM, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_NEEDS_TERM, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_NEEDS_TERM, value); + mateconf_change_set_set (cs, DEFAULT_APPS_KEY_BROWSER_NEEDS_TERM, value); - mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error); + mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error); - if (error != NULL) { - g_warning (_("Error saving configuration: %s"), error->message); - g_error_free (error); - error = NULL; - } + if (error != NULL) { + g_warning (_("Error saving configuration: %s"), error->message); + g_error_free (error); + error = NULL; + } - mateconf_change_set_unref (cs); + mateconf_change_set_unref (cs); } } @@ -429,37 +746,42 @@ static void web_browser_update_radio_buttons(MateDACapplet* capplet, const gchar static MateConfValue* web_combo_conv_to_widget (MateConfPropertyEditor *peditor, const MateConfValue *value) { - MateConfValue *ret; - GList *entry, *handlers; - const gchar *command; - gint index; - MateDACapplet *capplet; + MateConfValue *ret; + GList *entry, *handlers; + const gchar *command; + gint index; + MateDACapplet *capplet; - g_object_get (G_OBJECT (peditor), "data", &capplet, NULL); + g_object_get (G_OBJECT (peditor), "data", &capplet, NULL); - command = mateconf_value_get_string (value); - handlers = capplet->web_browsers; + command = mateconf_value_get_string (value); + handlers = capplet->web_browsers; - if (handlers) - { - entry = g_list_find_custom (handlers, command, (GCompareFunc) web_item_comp); - if (entry) - index = g_list_position (handlers, entry); - else - index = g_list_length (handlers) + 1; - } - else - { - /* if the item has no handlers lsit then select the Custom item */ - index = 1; - } + if (handlers) + { + entry = g_list_find_custom (handlers, command, (GCompareFunc) web_item_comp); - web_browser_update_radio_buttons (capplet, command); + if (entry) + { + index = g_list_position (handlers, entry); + } + else + { + index = g_list_length (handlers) + 1; + } + } + else + { + /* if the item has no handlers lsit then select the Custom item */ + index = 1; + } - ret = mateconf_value_new (MATECONF_VALUE_INT); - mateconf_value_set_int (ret, index); + web_browser_update_radio_buttons (capplet, command); - return ret; + ret = mateconf_value_new (MATECONF_VALUE_INT); + mateconf_value_set_int (ret, index); + + return ret; } static MateConfValue* web_combo_conv_from_widget (MateConfPropertyEditor *peditor, const MateConfValue *value) @@ -592,346 +914,459 @@ static MateConfValue* combo_conv_from_widget_term_flag (MateConfPropertyEditor * } } -static MateConfValue* combo_conv_to_widget_term_flag (MateConfPropertyEditor *peditor, const MateConfValue *value) +static MateConfValue* combo_conv_to_widget_term_flag(MateConfPropertyEditor* peditor, const MateConfValue* value) { - MateConfValue *ret; - GtkComboBox *combo; + GtkComboBox* combo = GTK_COMBO_BOX(mateconf_property_editor_get_ui_control(peditor)); - combo = GTK_COMBO_BOX (mateconf_property_editor_get_ui_control (peditor)); + MateConfValue* ret = mateconf_value_new(MATECONF_VALUE_INT); - ret = mateconf_value_new (MATECONF_VALUE_INT); - mateconf_value_set_int (ret, gtk_combo_box_get_active (combo)); - return ret; + mateconf_value_set_int(ret, gtk_combo_box_get_active (combo)); + + return ret; } -static gboolean is_separator (GtkTreeModel *model, GtkTreeIter *iter, gpointer sep_index) +static gboolean is_separator(GtkTreeModel* model, GtkTreeIter* iter, gpointer sep_index) { - GtkTreePath *path; - gboolean result; + GtkTreePath* path = gtk_tree_model_get_path(model, iter); + + gboolean result = gtk_tree_path_get_indices(path)[0] == GPOINTER_TO_INT(sep_index); - 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); + gtk_tree_path_free(path); return result; } -static void fill_combo_box (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list) +static void fill_combo_box (GtkIconTheme* theme, GtkComboBox* combo_box, GList* app_list) { - GList *entry; - GtkTreeModel *model; - GtkCellRenderer *renderer; - GtkTreeIter iter; - GdkPixbuf *pixbuf; + GList* entry; + GtkTreeModel* model; + GtkCellRenderer* renderer; + GtkTreeIter iter; + GdkPixbuf* pixbuf; - if (theme == NULL) { - theme = gtk_icon_theme_get_default (); - } + if (theme == NULL) + { + theme = gtk_icon_theme_get_default(); + } - gtk_combo_box_set_row_separator_func (combo_box, is_separator, - GINT_TO_POINTER (g_list_length (app_list)), NULL); + 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); + 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 (); + 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); + /* 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); + renderer = gtk_cell_renderer_text_new(); - for (entry = app_list; entry != NULL; entry = g_list_next (entry)) { - MateDAItem *item; - item = (MateDAItem *) entry->data; + 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); - pixbuf = gtk_icon_theme_load_icon (theme, item->icon_name, 22, 0, NULL); + for (entry = app_list; entry != NULL; entry = g_list_next (entry)) + { + MateDAItem* item = (MateDAItem*) entry->data; - 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); + pixbuf = gtk_icon_theme_load_icon(theme, item->icon_name, 22, 0, NULL); - item->icon_path = gtk_tree_model_get_string_from_iter (model, &iter); + 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); - if (pixbuf) - g_object_unref (pixbuf); - } + item->icon_path = gtk_tree_model_get_string_from_iter(model, &iter); - 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); + if (pixbuf) + { + g_object_unref(pixbuf); + } + } + + 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) +/* not used +static GtkWidget* _gtk_builder_get_widget(GtkBuilder* builder, const gchar* name) { - return GTK_WIDGET (gtk_builder_get_object (builder, name)); -} + return GTK_WIDGET(gtk_builder_get_object(builder, name)); +}*/ -static void show_dialog (MateDACapplet* capplet, const gchar* start_page) +static void show_dialog(MateDACapplet* capplet, const gchar* start_page) { - GObject *obj; - GtkBuilder *builder; - guint builder_result; + #define get_widget(name) GTK_WIDGET(gtk_builder_get_object(builder, name)) - capplet->builder = builder = gtk_builder_new (); + GObject* obj; + GtkBuilder* builder; + guint builder_result; - if (g_file_test (MATECC_UI_DIR "/mate-default-applications-properties.ui", G_FILE_TEST_EXISTS) != FALSE) { - builder_result = gtk_builder_add_from_file (builder, MATECC_UI_DIR "/mate-default-applications-properties.ui", NULL); - } - else { - builder_result = gtk_builder_add_from_file (builder, "./mate-default-applications-properties.ui", NULL); - } + capplet->builder = builder = gtk_builder_new (); - 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); - } + if (g_file_test(MATECC_UI_DIR "/mate-default-applications-properties.ui", G_FILE_TEST_EXISTS) != FALSE) + { + builder_result = gtk_builder_add_from_file(builder, MATECC_UI_DIR "/mate-default-applications-properties.ui", NULL); + } + else + { + builder_result = gtk_builder_add_from_file(builder, "./mate-default-applications-properties.ui", NULL); + } - capplet->window = _gtk_builder_get_widget (builder,"preferred_apps_dialog"); - g_signal_connect (capplet->window, "response", G_CALLBACK (close_cb), NULL); - - capplet->web_browser_command_entry = _gtk_builder_get_widget (builder, "web_browser_command_entry"); - capplet->web_browser_command_label = _gtk_builder_get_widget (builder, "web_browser_command_label"); - capplet->web_browser_terminal_checkbutton = _gtk_builder_get_widget(builder, "web_browser_terminal_checkbutton"); - capplet->default_radiobutton = _gtk_builder_get_widget (builder, "web_browser_default_radiobutton"); - capplet->new_win_radiobutton = _gtk_builder_get_widget (builder, "web_browser_new_win_radiobutton"); - capplet->new_tab_radiobutton = _gtk_builder_get_widget (builder, "web_browser_new_tab_radiobutton"); - - capplet->mail_reader_command_entry = _gtk_builder_get_widget (builder, "mail_reader_command_entry"); - capplet->mail_reader_command_label = _gtk_builder_get_widget (builder, "mail_reader_command_label"); - capplet->mail_reader_terminal_checkbutton = _gtk_builder_get_widget (builder, "mail_reader_terminal_checkbutton"); - - 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->media_player_command_entry = _gtk_builder_get_widget (builder, "media_player_command_entry"); - capplet->media_player_command_label = _gtk_builder_get_widget (builder, "media_player_command_label"); - capplet->media_player_terminal_checkbutton = _gtk_builder_get_widget (builder, "media_player_terminal_checkbutton"); - - 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->media_combo_box = _gtk_builder_get_widget (builder, "media_player_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); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats); - fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats); - - 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->media_combo_box, "changed", G_CALLBACK (media_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); - - - g_signal_connect (capplet->default_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); - g_signal_connect (capplet->new_win_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); - g_signal_connect (capplet->new_tab_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); - - /* Setup MateConfPropertyEditors */ - - /* Web Browser */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_HTTP_EXEC, - capplet->web_combo_box, - "conv-from-widget-cb", web_combo_conv_from_widget, - "conv-to-widget-cb", web_combo_conv_to_widget, - "data", capplet, - NULL); - - obj = mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_HTTP_EXEC, - capplet->web_browser_command_entry, - NULL); - g_signal_connect (obj, "value-changed", G_CALLBACK (web_mateconf_changed_cb), capplet); - - obj = mateconf_peditor_new_boolean (NULL, - DEFAULT_APPS_KEY_HTTP_NEEDS_TERM, - capplet->web_browser_terminal_checkbutton, - NULL); - g_signal_connect (obj, "value-changed", G_CALLBACK (web_mateconf_changed_cb), capplet); - - /* Mailer */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_MAILER_EXEC, - capplet->mail_combo_box, - "conv-from-widget-cb", combo_conv_from_widget, - "conv-to-widget-cb", combo_conv_to_widget, - "data", capplet->mail_readers, - NULL); - - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_MAILER_EXEC, - capplet->mail_reader_command_entry, - NULL); - - mateconf_peditor_new_boolean (NULL, - DEFAULT_APPS_KEY_MAILER_NEEDS_TERM, - capplet->mail_reader_terminal_checkbutton, - NULL); - - /* Media player */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_MEDIA_EXEC, - capplet->media_combo_box, - "conv-from-widget-cb", combo_conv_from_widget, - "conv-to-widget-cb", combo_conv_to_widget, - "data", capplet->media_players, - NULL); - - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_MEDIA_EXEC, - capplet->media_player_command_entry, - NULL); - - mateconf_peditor_new_boolean (NULL, - DEFAULT_APPS_KEY_MEDIA_NEEDS_TERM, - capplet->media_player_terminal_checkbutton, - NULL); - - /* Terminal */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_TERMINAL_EXEC, - capplet->term_combo_box, - "conv-from-widget-cb", combo_conv_from_widget, - "conv-to-widget-cb", combo_conv_to_widget, - "data", capplet->terminals, - NULL); - - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_TERMINAL_EXEC_ARG, - capplet->term_combo_box, - "conv-from-widget-cb", combo_conv_from_widget_term_flag, - "conv-to-widget-cb", combo_conv_to_widget_term_flag, - "data", capplet->terminals, - NULL); - - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_TERMINAL_EXEC, - capplet->terminal_command_entry, - NULL); - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_TERMINAL_EXEC_ARG, - capplet->terminal_exec_flag_entry, - NULL); - - - /* Visual */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_VISUAL_EXEC, - capplet->visual_combo_box, - "conv-from-widget-cb", combo_conv_from_widget, - "conv-to-widget-cb", combo_conv_to_widget, - "data", capplet->visual_ats, - NULL); - - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_VISUAL_EXEC, - capplet->visual_command_entry, - NULL); - - mateconf_peditor_new_boolean (NULL, - DEFAULT_APPS_KEY_VISUAL_STARTUP, - capplet->visual_startup_checkbutton, - NULL); - - - /* Mobility */ - mateconf_peditor_new_combo_box (NULL, - DEFAULT_APPS_KEY_MOBILITY_EXEC, - capplet->mobility_combo_box, - "conv-from-widget-cb", combo_conv_from_widget, - "conv-to-widget-cb", combo_conv_to_widget, - "data", capplet->mobility_ats, - NULL); - - mateconf_peditor_new_string (NULL, - DEFAULT_APPS_KEY_MOBILITY_EXEC, - capplet->mobility_command_entry, - NULL); - - mateconf_peditor_new_boolean (NULL, - DEFAULT_APPS_KEY_MOBILITY_STARTUP, - capplet->mobility_startup_checkbutton, - NULL); - - gtk_window_set_icon_name (GTK_WINDOW (capplet->window), - "preferences-desktop-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); - } + if (builder_result == 0) + { + GtkWidget* 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); + } - gtk_widget_show (capplet->window); + capplet->window = get_widget("preferred_apps_dialog"); + + g_signal_connect(capplet->window, "response", G_CALLBACK(close_cb), NULL); + + capplet->web_browser_command_entry = get_widget("web_browser_command_entry"); + capplet->web_browser_command_label = get_widget("web_browser_command_label"); + capplet->web_browser_terminal_checkbutton = get_widget("web_browser_terminal_checkbutton"); + capplet->default_radiobutton = get_widget("web_browser_default_radiobutton"); + capplet->new_win_radiobutton = get_widget("web_browser_new_win_radiobutton"); + capplet->new_tab_radiobutton = get_widget("web_browser_new_tab_radiobutton"); + + capplet->mail_reader_command_entry = get_widget("mail_reader_command_entry"); + capplet->mail_reader_command_label = get_widget("mail_reader_command_label"); + capplet->mail_reader_terminal_checkbutton = get_widget("mail_reader_terminal_checkbutton"); + + capplet->terminal_command_entry = get_widget("terminal_command_entry"); + capplet->terminal_command_label = get_widget("terminal_command_label"); + capplet->terminal_exec_flag_entry = get_widget("terminal_exec_flag_entry"); + capplet->terminal_exec_flag_label = get_widget("terminal_exec_flag_label"); + + capplet->media_player_command_entry = get_widget("media_player_command_entry"); + capplet->media_player_command_label = get_widget("media_player_command_label"); + capplet->media_player_terminal_checkbutton = get_widget("media_player_terminal_checkbutton"); + + capplet->video_player_command_entry = get_widget("video_command_entry"); + capplet->video_player_command_label = get_widget("video_command_label"); + capplet->video_player_terminal_checkbutton = get_widget("video_terminal_checkbox"); + + capplet->visual_command_entry = get_widget("visual_command_entry"); + capplet->visual_command_label = get_widget("visual_command_label"); + capplet->visual_startup_checkbutton = get_widget("visual_start_checkbutton"); + + capplet->image_viewer_command_entry = get_widget("image_command_entry"); + capplet->image_viewer_command_label = get_widget("image_command_label"); + capplet->image_viewer_terminal_checkbutton = get_widget("image_terminal_checkbox"); + + capplet->text_editor_command_entry = get_widget("text_command_entry"); + capplet->text_editor_command_label = get_widget("text_command_label"); + capplet->text_editor_terminal_checkbutton = get_widget("text_terminal_checkbox"); + + capplet->file_manager_command_entry = get_widget("filemanager_command_entry"); + capplet->file_manager_command_label = get_widget("filemanager_command_label"); + capplet->file_manager_terminal_checkbutton = get_widget("filemanager_terminal_checkbox"); + + capplet->mobility_command_entry = get_widget("mobility_command_entry"); + capplet->mobility_command_label = get_widget("mobility_command_label"); + capplet->mobility_startup_checkbutton = get_widget("mobility_start_checkbutton"); + + capplet->web_combo_box = get_widget("web_browser_combobox"); + capplet->mail_combo_box = get_widget("mail_reader_combobox"); + capplet->term_combo_box = get_widget("terminal_combobox"); + capplet->media_combo_box = get_widget("media_player_combobox"); + capplet->video_combo_box = get_widget("video_combobox"); + capplet->visual_combo_box = get_widget("visual_combobox"); + capplet->mobility_combo_box = get_widget("mobility_combobox"); + capplet->text_combo_box = get_widget("text_combobox"); + capplet->file_combo_box = get_widget("filemanager_combobox"); + capplet->image_combo_box = get_widget("image_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); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->mail_combo_box), capplet->mail_readers); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->term_combo_box), capplet->terminals); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->media_combo_box), capplet->media_players); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->video_combo_box), capplet->video_players); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->visual_combo_box), capplet->visual_ats); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->mobility_combo_box), capplet->mobility_ats); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->image_combo_box), capplet->image_viewers); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->text_combo_box), capplet->text_editors); + fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->file_combo_box), capplet->file_managers); + + 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->media_combo_box, "changed", G_CALLBACK(media_combo_changed_cb), capplet); + g_signal_connect(capplet->video_combo_box, "changed", G_CALLBACK(video_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); + g_signal_connect(capplet->image_combo_box, "changed", G_CALLBACK(image_combo_changed_cb), capplet); + g_signal_connect(capplet->text_combo_box, "changed", G_CALLBACK(text_combo_changed_cb), capplet); + g_signal_connect(capplet->file_combo_box, "changed", G_CALLBACK(file_combo_changed_cb), capplet); + + + g_signal_connect(capplet->default_radiobutton, "toggled", G_CALLBACK(web_radiobutton_toggled_cb), capplet); + g_signal_connect(capplet->new_win_radiobutton, "toggled", G_CALLBACK(web_radiobutton_toggled_cb), capplet); + g_signal_connect(capplet->new_tab_radiobutton, "toggled", G_CALLBACK(web_radiobutton_toggled_cb), capplet); + + /* Setup MateConfPropertyEditors */ + + /* Web Browser */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_HTTP_EXEC, + capplet->web_combo_box, + "conv-from-widget-cb", web_combo_conv_from_widget, + "conv-to-widget-cb", web_combo_conv_to_widget, + "data", capplet, + NULL); + + obj = mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_HTTP_EXEC, + capplet->web_browser_command_entry, + NULL); + g_signal_connect (obj, "value-changed", G_CALLBACK (web_mateconf_changed_cb), capplet); + + obj = mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_HTTP_NEEDS_TERM, + capplet->web_browser_terminal_checkbutton, + NULL); + g_signal_connect (obj, "value-changed", G_CALLBACK (web_mateconf_changed_cb), capplet); + + /* Mailer */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_MAILER_EXEC, + capplet->mail_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->mail_readers, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_MAILER_EXEC, + capplet->mail_reader_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_MAILER_NEEDS_TERM, + capplet->mail_reader_terminal_checkbutton, + NULL); + + /* Media player */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_MEDIA_EXEC, + capplet->media_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->media_players, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_MEDIA_EXEC, + capplet->media_player_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_MEDIA_NEEDS_TERM, + capplet->media_player_terminal_checkbutton, + NULL); + + /* Video player */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_VIDEO_EXEC, + capplet->video_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->video_players, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_VIDEO_EXEC, + capplet->video_player_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_VIDEO_NEEDS_TERM, + capplet->video_player_terminal_checkbutton, + NULL); + + /* Image viewer */ + mateconf_peditor_new_combo_box(NULL, + DEFAULT_APPS_KEY_IMAGE_EXEC, + capplet->image_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->image_viewers, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_IMAGE_EXEC, + capplet->image_viewer_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_IMAGE_NEEDS_TERM, + capplet->image_viewer_terminal_checkbutton, + NULL); + + /* File manager */ + mateconf_peditor_new_combo_box(NULL, + DEFAULT_APPS_KEY_FILE_EXEC, + capplet->file_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->file_managers, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_FILE_EXEC, + capplet->file_manager_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_FILE_NEEDS_TERM, + capplet->file_manager_terminal_checkbutton, + NULL); + + + /* Text editors */ + mateconf_peditor_new_combo_box(NULL, + DEFAULT_APPS_KEY_TEXT_EXEC, + capplet->text_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->text_editors, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_TEXT_EXEC, + capplet->text_editor_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_TEXT_NEEDS_TERM, + capplet->text_editor_terminal_checkbutton, + NULL); + + + /* Terminal */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_TERMINAL_EXEC, + capplet->term_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->terminals, + NULL); + + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_TERMINAL_EXEC_ARG, + capplet->term_combo_box, + "conv-from-widget-cb", combo_conv_from_widget_term_flag, + "conv-to-widget-cb", combo_conv_to_widget_term_flag, + "data", capplet->terminals, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_TERMINAL_EXEC, + capplet->terminal_command_entry, + NULL); + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_TERMINAL_EXEC_ARG, + capplet->terminal_exec_flag_entry, + NULL); + + + /* Visual */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_VISUAL_EXEC, + capplet->visual_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->visual_ats, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_VISUAL_EXEC, + capplet->visual_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_VISUAL_STARTUP, + capplet->visual_startup_checkbutton, + NULL); + + + /* Mobility */ + mateconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_MOBILITY_EXEC, + capplet->mobility_combo_box, + "conv-from-widget-cb", combo_conv_from_widget, + "conv-to-widget-cb", combo_conv_to_widget, + "data", capplet->mobility_ats, + NULL); + + mateconf_peditor_new_string (NULL, + DEFAULT_APPS_KEY_MOBILITY_EXEC, + capplet->mobility_command_entry, + NULL); + + mateconf_peditor_new_boolean (NULL, + DEFAULT_APPS_KEY_MOBILITY_STARTUP, + capplet->mobility_startup_checkbutton, + NULL); + + gtk_window_set_icon_name(GTK_WINDOW (capplet->window), "preferences-desktop-default-applications"); + + if (start_page != NULL) + { + gchar* page_name; + GtkWidget* w; + + page_name = g_strconcat (start_page, "_vbox", NULL); + + w = get_widget(page_name); + + if (w != NULL) + { + GtkNotebook *nb; + gint pindex; + + nb = GTK_NOTEBOOK (get_widget("preferred_apps_notebook")); + pindex = gtk_notebook_page_num (nb, w); + if (pindex != -1) + gtk_notebook_set_current_page (nb, pindex); + } + + g_free(page_name); + } + + gtk_widget_show(capplet->window); + + #undef get_widget } -int main (int argc, char** argv) +int main(int argc, char** argv) { - MateDACapplet* capplet; - - gchar* start_page = NULL; + gchar* start_page = NULL; - GOptionContext* context; - GOptionEntry option_entries[] = { + GOptionEntry option_entries[] = { { "show-page", 'p', @@ -943,28 +1378,28 @@ int main (int argc, char** argv) N_("page") }, {NULL} - }; + }; - context = g_option_context_new(_("- MATE Default Applications")); - g_option_context_add_main_entries (context, option_entries, GETTEXT_PACKAGE); + GOptionContext* context = g_option_context_new(_("- MATE Default Applications")); + g_option_context_add_main_entries(context, option_entries, GETTEXT_PACKAGE); - capplet_init (context, &argc, &argv); + capplet_init (context, &argc, &argv); - capplet = g_new0(MateDACapplet, 1); - capplet->mateconf = mateconf_client_get_default(); - mateconf_client_add_dir(capplet->mateconf, "/desktop/mate/url-handlers", MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); - mateconf_client_add_dir(capplet->mateconf, "/desktop/mate/applications", MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); + MateDACapplet* capplet = g_new0(MateDACapplet, 1); + capplet->mateconf = mateconf_client_get_default(); + mateconf_client_add_dir(capplet->mateconf, "/desktop/mate/url-handlers", MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); + mateconf_client_add_dir(capplet->mateconf, "/desktop/mate/applications", MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); - mate_da_xml_load_list(capplet); + mate_da_xml_load_list(capplet); - show_dialog(capplet, start_page); - g_free(start_page); + show_dialog(capplet, start_page); + g_free(start_page); - gtk_main(); + gtk_main(); - g_object_unref(capplet->mateconf); + g_object_unref(capplet->mateconf); - mate_da_xml_free(capplet); + mate_da_xml_free(capplet); - return 0; + return 0; } diff --git a/capplets/default-applications/mate-da-capplet.h b/capplets/default-applications/mate-da-capplet.h index 3ce72955..2dc7487f 100644 --- a/capplets/default-applications/mate-da-capplet.h +++ b/capplets/default-applications/mate-da-capplet.h @@ -2,6 +2,7 @@ * Authors: Luca Cavalli <[email protected]> * * Copyright 2005-2006 Luca Cavalli + * Copyright 2010 Perberos <[email protected]> * * 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 @@ -61,6 +62,22 @@ #define DEFAULT_APPS_KEY_MEDIA_EXEC DEFAULT_APPS_KEY_MEDIA_PATH"/exec" #define DEFAULT_APPS_KEY_MEDIA_NEEDS_TERM DEFAULT_APPS_KEY_MEDIA_PATH"/needs_term" +#define DEFAULT_APPS_KEY_VIDEO_PATH "/desktop/mate/applications/video" +#define DEFAULT_APPS_KEY_VIDEO_EXEC DEFAULT_APPS_KEY_VIDEO_PATH"/exec" +#define DEFAULT_APPS_KEY_VIDEO_NEEDS_TERM DEFAULT_APPS_KEY_VIDEO_PATH"/needs_term" + +#define DEFAULT_APPS_KEY_IMAGE_PATH "/desktop/mate/applications/image" +#define DEFAULT_APPS_KEY_IMAGE_EXEC DEFAULT_APPS_KEY_IMAGE_PATH"/exec" +#define DEFAULT_APPS_KEY_IMAGE_NEEDS_TERM DEFAULT_APPS_KEY_IMAGE_PATH"/needs_term" + +#define DEFAULT_APPS_KEY_TEXT_PATH "/desktop/mate/applications/text" +#define DEFAULT_APPS_KEY_TEXT_EXEC DEFAULT_APPS_KEY_TEXT_PATH"/exec" +#define DEFAULT_APPS_KEY_TEXT_NEEDS_TERM DEFAULT_APPS_KEY_TEXT_PATH"/needs_term" + +#define DEFAULT_APPS_KEY_FILE_PATH "/desktop/mate/applications/file" +#define DEFAULT_APPS_KEY_FILE_EXEC DEFAULT_APPS_KEY_FILE_PATH"/exec" +#define DEFAULT_APPS_KEY_FILE_NEEDS_TERM DEFAULT_APPS_KEY_FILE_PATH"/needs_term" + #define DEFAULT_APPS_KEY_VISUAL_PATH "/desktop/mate/applications/at/visual" #define DEFAULT_APPS_KEY_VISUAL_EXEC DEFAULT_APPS_KEY_VISUAL_PATH"/exec" #define DEFAULT_APPS_KEY_VISUAL_STARTUP DEFAULT_APPS_KEY_VISUAL_PATH"/startup" @@ -69,9 +86,7 @@ #define DEFAULT_APPS_KEY_MOBILITY_EXEC DEFAULT_APPS_KEY_MOBILITY_PATH"/exec" #define DEFAULT_APPS_KEY_MOBILITY_STARTUP DEFAULT_APPS_KEY_MOBILITY_PATH"/startup" -typedef struct _MateDACapplet MateDACapplet; - -struct _MateDACapplet { +typedef struct _MateDACapplet { GtkBuilder* builder; GtkIconTheme* icon_theme; @@ -82,11 +97,16 @@ struct _MateDACapplet { GtkWidget* mail_combo_box; GtkWidget* term_combo_box; GtkWidget* media_combo_box; + GtkWidget* video_combo_box; GtkWidget* visual_combo_box; GtkWidget* mobility_combo_box; /* Para el File Manager */ - /*GtkWidget* filemanager_combo_box;*/ + GtkWidget* file_combo_box; + GtkWidget* text_combo_box; + GtkWidget* image_combo_box; + /* navegador web + * por el momento default,new_win,new_tab no se utilizan */ GtkWidget* web_browser_command_entry; GtkWidget* web_browser_command_label; GtkWidget* web_browser_terminal_checkbutton; @@ -95,45 +115,64 @@ struct _MateDACapplet { GtkWidget* new_tab_radiobutton; /* Para el File Manager */ - /*GtkWidget* file_manager_command_entry; + GtkWidget* file_manager_command_entry; GtkWidget* file_manager_command_label; GtkWidget* file_manager_terminal_checkbutton; - GtkWidget* file_manager_default_radiobutton; - GtkWidget* file_manager_new_win_radiobutton; - GtkWidget* file_manager_new_tab_radiobutton;*/ + /* editor de texto */ + GtkWidget* text_editor_command_entry; + GtkWidget* text_editor_command_label; + GtkWidget* text_editor_terminal_checkbutton; + /* cliente de correo */ GtkWidget* mail_reader_command_entry; GtkWidget* mail_reader_command_label; GtkWidget* mail_reader_terminal_checkbutton; + /* terminal */ GtkWidget* terminal_command_entry; GtkWidget* terminal_command_label; GtkWidget* terminal_exec_flag_entry; GtkWidget* terminal_exec_flag_label; + /* visor de imagenes */ + GtkWidget* image_viewer_command_entry; + GtkWidget* image_viewer_command_label; + GtkWidget* image_viewer_terminal_checkbutton; + + /* reproductor de musica */ GtkWidget* media_player_command_entry; GtkWidget* media_player_command_label; GtkWidget* media_player_terminal_checkbutton; + /* reproductor de videos */ + GtkWidget* video_player_command_entry; + GtkWidget* video_player_command_label; + GtkWidget* video_player_terminal_checkbutton; + + /* accesibilidad visual */ GtkWidget* visual_command_entry; GtkWidget* visual_command_label; GtkWidget* visual_startup_checkbutton; + /* accesibilidad motriz */ GtkWidget* mobility_command_entry; GtkWidget* mobility_command_label; GtkWidget* mobility_startup_checkbutton; + MateConfClient* mateconf; GList* web_browsers; GList* mail_readers; GList* terminals; GList* media_players; + GList* video_players; GList* visual_ats; GList* mobility_ats; - /* Para el File Manager */ - /*GList* file_managers;*/ -}; + GList* file_managers; + GList* text_editors; + GList* image_viewers; +} MateDACapplet; #endif diff --git a/capplets/default-applications/mate-da-item.c b/capplets/default-applications/mate-da-item.c index 06bda549..ab3803de 100644 --- a/capplets/default-applications/mate-da-item.c +++ b/capplets/default-applications/mate-da-item.c @@ -21,128 +21,176 @@ #include "mate-da-capplet.h" #include "mate-da-item.h" -MateDAWebItem* -mate_da_web_item_new (void) +MateDAWebItem* mate_da_web_item_new(void) { - MateDAWebItem *item = NULL; + MateDAWebItem* item = g_new0(MateDAWebItem, 1); - item = g_new0 (MateDAWebItem, 1); - - return item; + return item; } -MateDASimpleItem* -mate_da_simple_item_new (void) +MateDASimpleItem* mate_da_simple_item_new(void) { - MateDASimpleItem *item = NULL; - - item = g_new0 (MateDASimpleItem, 1); + MateDASimpleItem* item = g_new0(MateDASimpleItem, 1); - return item; + return item; } -MateDATermItem* -mate_da_term_item_new (void) +MateDATermItem* mate_da_term_item_new(void) { - MateDATermItem *item = NULL; - - item = g_new0 (MateDATermItem, 1); + MateDATermItem* item = g_new0(MateDATermItem, 1); - return item; + return item; } -MateDAVisualItem* -mate_da_visual_item_new (void) +MateDAVisualItem* mate_da_visual_item_new(void) { - MateDAVisualItem *item = NULL; + MateDAVisualItem* item = g_new0(MateDAVisualItem, 1); - item = g_new0 (MateDAVisualItem, 1); - - return item; + return item; } -MateDAMobilityItem* -mate_da_mobility_item_new (void) +MateDAImageItem* mate_da_image_item_new(void) { - MateDAMobilityItem *item = NULL; - - item = g_new0 (MateDAMobilityItem, 1); + MateDAImageItem* item = g_new0(MateDAImageItem, 1); - return item; + return item; } -void -mate_da_web_item_free (MateDAWebItem *item) +MateDATextItem* mate_da_text_item_new(void) { - g_return_if_fail (item != NULL); + MateDATextItem* item = g_new0(MateDATextItem, 1); - 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->tab_command); - g_free (item->win_command); - - g_free (item); + return item; } -void -mate_da_simple_item_free (MateDASimpleItem *item) +MateDAFileItem* mate_da_file_item_new(void) { - 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); + MateDAFileItem* item = g_new0(MateDAFileItem, 1); - g_free (item); + return item; } -void -mate_da_term_item_free (MateDATermItem *item) +MateDAMobilityItem* mate_da_mobility_item_new(void) { - g_return_if_fail (item != NULL); + MateDAMobilityItem* item = g_new0(MateDAMobilityItem, 1); - 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); + return item; +} - g_free (item->exec_flag); +void mate_da_web_item_free(MateDAWebItem* item) +{ + if (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->tab_command); + g_free(item->win_command); + + g_free(item); + } +} - g_free (item); +void mate_da_simple_item_free(MateDASimpleItem* item) +{ + if (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 -mate_da_visual_item_free (MateDAVisualItem *item) +void mate_da_image_item_free(MateDAImageItem* item) { - g_return_if_fail (item != NULL); + if (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); + } +} - 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); +void mate_da_text_item_free(MateDATextItem* item) +{ + if (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); + } +} - g_free (item); +void mate_da_file_item_free(MateDAFileItem* item) +{ + if (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 -mate_da_mobility_item_free (MateDAMobilityItem *item) +void mate_da_term_item_free(MateDATermItem* item) { - g_return_if_fail (item != NULL); + if (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); + } +} - 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); +void mate_da_visual_item_free(MateDAVisualItem* item) +{ + if (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); + } +} - g_free (item); +void mate_da_mobility_item_free (MateDAMobilityItem *item) +{ + if (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/capplets/default-applications/mate-da-item.h b/capplets/default-applications/mate-da-item.h index 81223f4e..b6a3b573 100644 --- a/capplets/default-applications/mate-da-item.h +++ b/capplets/default-applications/mate-da-item.h @@ -23,59 +23,79 @@ #include <glib.h> -typedef struct _MateDAItem MateDAItem; - -typedef struct _MateDAWebItem MateDAWebItem; -typedef struct _MateDATermItem MateDATermItem; -typedef struct _MateDASimpleItem MateDASimpleItem; -typedef struct _MateDAVisualItem MateDAVisualItem; -typedef struct _MateDAMobilityItem MateDAMobilityItem; - -struct _MateDAItem { - gchar *name; - gchar *executable; - gchar *command; - gchar *icon_name; - gchar *icon_path; -}; - -struct _MateDAWebItem { - MateDAItem generic; - gboolean run_in_terminal; - gboolean netscape_remote; - gchar *tab_command; - gchar *win_command; -}; - -struct _MateDASimpleItem { - MateDAItem generic; - gboolean run_in_terminal; -}; - -struct _MateDATermItem { - MateDAItem generic; - gchar *exec_flag; -}; - -struct _MateDAVisualItem { - MateDAItem generic; - gboolean run_at_startup; -}; - -struct _MateDAMobilityItem { - MateDAItem generic; - gboolean run_at_startup; -}; - -MateDAWebItem* mate_da_web_item_new (void); -MateDATermItem* mate_da_term_item_new (void); -MateDASimpleItem* mate_da_simple_item_new (void); -MateDAVisualItem* mate_da_visual_item_new (void); -MateDAMobilityItem* mate_da_mobility_item_new (void); -void mate_da_web_item_free (MateDAWebItem *item); -void mate_da_term_item_free (MateDATermItem *item); -void mate_da_simple_item_free (MateDASimpleItem *item); -void mate_da_visual_item_free (MateDAVisualItem *item); -void mate_da_mobility_item_free (MateDAMobilityItem *item); +typedef struct _MateDAItem { + gchar* name; + gchar* executable; + gchar* command; + gchar* icon_name; + gchar* icon_path; +} MateDAItem; + +typedef struct _MateDAWebItem { + MateDAItem generic; + gboolean run_in_terminal; + gboolean netscape_remote; + gchar* tab_command; + gchar* win_command; +} MateDAWebItem; + +typedef struct _MateDASimpleItem { + MateDAItem generic; + gboolean run_in_terminal; +} MateDASimpleItem; + +typedef struct _MateDAImageItem { + MateDAItem generic; + gboolean run_in_terminal; +} MateDAImageItem; + +typedef struct _MateDATextItem { + MateDAItem generic; + gboolean run_in_terminal; +} MateDATextItem; + +typedef struct _MateDAFileItem { + MateDAItem generic; + gboolean run_in_terminal; +} MateDAFileItem; + +typedef struct _MateDATermItem { + MateDAItem generic; + gchar* exec_flag; +} MateDATermItem; + +typedef struct _MateDAVisualItem { + MateDAItem generic; + gboolean run_at_startup; +} MateDAVisualItem; + +typedef struct _MateDAMobilityItem { + MateDAItem generic; + gboolean run_at_startup; +} MateDAMobilityItem; + +MateDAWebItem* mate_da_web_item_new(void); +void mate_da_web_item_free(MateDAWebItem* item); + +MateDATermItem* mate_da_term_item_new(void); +void mate_da_term_item_free(MateDATermItem* item); + +MateDASimpleItem* mate_da_simple_item_new(void); +void mate_da_simple_item_free(MateDASimpleItem* item); + +MateDAVisualItem* mate_da_visual_item_new(void); +void mate_da_visual_item_free(MateDAVisualItem* item); + +MateDAImageItem* mate_da_image_item_new(void); +void mate_da_image_item_free(MateDAImageItem* item); + +MateDATextItem* mate_da_text_item_new(void); +void mate_da_text_item_free(MateDATextItem* item); + +MateDAFileItem* mate_da_file_item_new(void); +void mate_da_file_item_free(MateDAFileItem* item); + +MateDAMobilityItem* mate_da_mobility_item_new(void); +void mate_da_mobility_item_free(MateDAMobilityItem* item); #endif diff --git a/capplets/default-applications/mate-da-xml.c b/capplets/default-applications/mate-da-xml.c index 288495c7..46b31789 100644 --- a/capplets/default-applications/mate-da-xml.c +++ b/capplets/default-applications/mate-da-xml.c @@ -2,6 +2,7 @@ * Authors: Luca Cavalli <[email protected]> * * Copyright 2005-2006 Luca Cavalli + * Copyright 2010 Perberos <[email protected]> * * 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 @@ -28,256 +29,427 @@ #include "mate-da-item.h" -static gboolean -mate_da_xml_get_bool (const xmlNode *parent, const gchar *val_name) +static gboolean mate_da_xml_get_bool(const xmlNode* parent, const gchar* val_name) { - xmlNode *element; + xmlNode* element; gboolean ret_val = FALSE; - xmlChar *xml_val_name; + 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 (parent != NULL && parent->children != NULL && val_name == NULL) + { + xml_val_name = xmlCharStrdup(val_name); + len = xmlStrlen(xml_val_name); - if (!xmlStrcasecmp (cont, "true") || !xmlStrcasecmp (cont, "1")) - ret_val = TRUE; - else - ret_val = FALSE; + 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 (cont); + xmlFree(xml_val_name); } - } - xmlFree (xml_val_name); return ret_val; } -static gchar* -mate_da_xml_get_string (const xmlNode *parent, const gchar *val_name) +static gchar* mate_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 (sys_langs[i], node_lang)) { - ret_val = (gchar *) xmlNodeGetContent (element); - /* since sys_langs is sorted from most desirable to - * least desirable, exit at first match - */ - break; - } + const gchar* const* sys_langs; + xmlChar* node_lang; + xmlNode* element; + gchar* ret_val = NULL; + xmlChar* xml_val_name; + gint len; + gint i; + + if (parent != NULL && parent->children != NULL && val_name != NULL) + { + #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(sys_langs[i], (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 (node_lang); + + xmlFree(xml_val_name); } - } - xmlFree (xml_val_name); - return ret_val; + return ret_val; } -static gboolean -is_executable_valid (gchar *executable) +static gboolean is_executable_valid(gchar* executable) { - gchar *path; + gchar* path = g_find_program_in_path(executable); - path = g_find_program_in_path (executable); - - if (path) { - g_free (path); - return TRUE; - } + if (path) + { + g_free (path); + return TRUE; + } - return FALSE; + return FALSE; } -static void -mate_da_xml_load_xml (MateDACapplet *capplet, const gchar * filename) +static void mate_da_xml_load_xml(MateDACapplet* capplet, const gchar* filename) { - xmlDoc *xml_doc; - xmlNode *root, *section, *element; - gchar *executable; - MateDAWebItem *web_item; - MateDASimpleItem *mail_item; - MateDASimpleItem *media_item; - MateDATermItem *term_item; - MateDAVisualItem *visual_item; - MateDAMobilityItem *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, "web-browsers", 12)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "web-browser", 11)) { - executable = mate_da_xml_get_string (element, "executable"); - if (is_executable_valid (executable)) { - web_item = mate_da_web_item_new (); - - web_item->generic.name = mate_da_xml_get_string (element, "name"); - web_item->generic.executable = executable; - web_item->generic.command = mate_da_xml_get_string (element, "command"); - web_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - web_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal"); - web_item->netscape_remote = mate_da_xml_get_bool (element, "netscape-remote"); - if (web_item->netscape_remote) { - web_item->tab_command = mate_da_xml_get_string (element, "tab-command"); - web_item->win_command = mate_da_xml_get_string (element, "win-command"); - } + xmlDoc* xml_doc; + xmlNode* root; + xmlNode* section; + xmlNode* element; + gchar* executable; + MateDAWebItem* web_item; + MateDASimpleItem* mail_item; + MateDASimpleItem* media_item; + MateDATermItem* term_item; + MateDAVisualItem* visual_item; + MateDAMobilityItem* mobility_item; + MateDAImageItem* image_item; + MateDATextItem* text_item; + MateDAFileItem* file_item; + MateDASimpleItem* video_item; + + xml_doc = xmlParseFile(filename); + + if (!xml_doc) + { + return; + } - capplet->web_browsers = g_list_append (capplet->web_browsers, web_item); - } - else - g_free (executable); + root = xmlDocGetRootElement(xml_doc); + + for (section = root->children; section != NULL; section = section->next) + { + if (!xmlStrncmp(section->name, (const xmlChar*) "web-browsers", strlen("web-browsers"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "web-browser", strlen("web-browser"))) + { + executable = mate_da_xml_get_string (element, "executable"); + + if (is_executable_valid (executable)) + { + web_item = mate_da_web_item_new(); + + web_item->generic.name = mate_da_xml_get_string(element, "name"); + web_item->generic.executable = executable; + web_item->generic.command = mate_da_xml_get_string(element, "command"); + web_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + web_item->run_in_terminal = mate_da_xml_get_bool(element, "run-in-terminal"); + web_item->netscape_remote = mate_da_xml_get_bool(element, "netscape-remote"); + if (web_item->netscape_remote) + { + web_item->tab_command = mate_da_xml_get_string(element, "tab-command"); + web_item->win_command = mate_da_xml_get_string(element, "win-command"); + } + + capplet->web_browsers = g_list_append(capplet->web_browsers, web_item); + } + else + { + g_free(executable); + } + } + } } - } - } - else if (!xmlStrncmp (section->name, "mail-readers", 12)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "mail-reader", 11)) { - executable = mate_da_xml_get_string (element, "executable"); - if (is_executable_valid (executable)) { - mail_item = mate_da_simple_item_new (); - - mail_item->generic.name = mate_da_xml_get_string (element, "name"); - mail_item->generic.executable = executable; - mail_item->generic.command = mate_da_xml_get_string (element, "command"); - mail_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - mail_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal"); - - capplet->mail_readers = g_list_append (capplet->mail_readers, mail_item); - } - else - g_free (executable); + else if (!xmlStrncmp(section->name, (const xmlChar*) "mail-readers", strlen("mail-readers"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "mail-reader", strlen("mail-reader"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + mail_item = mate_da_simple_item_new(); + + mail_item->generic.name = mate_da_xml_get_string(element, "name"); + mail_item->generic.executable = executable; + mail_item->generic.command = mate_da_xml_get_string(element, "command"); + mail_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + mail_item->run_in_terminal = mate_da_xml_get_bool(element, "run-in-terminal"); + + capplet->mail_readers = g_list_append(capplet->mail_readers, mail_item); + } + else + { + g_free (executable); + } + } + } } - } - } - else if (!xmlStrncmp (section->name, "terminals", 9)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "terminal", 8)) { - executable = mate_da_xml_get_string (element, "executable"); - if (is_executable_valid (executable)) { - term_item = mate_da_term_item_new (); - - term_item->generic.name = mate_da_xml_get_string (element, "name"); - term_item->generic.executable = executable; - term_item->generic.command = mate_da_xml_get_string (element, "command"); - term_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - term_item->exec_flag = mate_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*) "terminals", strlen("terminals"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "terminal", strlen("terminal"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + term_item = mate_da_term_item_new(); + + term_item->generic.name = mate_da_xml_get_string(element, "name"); + term_item->generic.executable = executable; + term_item->generic.command = mate_da_xml_get_string(element, "command"); + term_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + term_item->exec_flag = mate_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, "media-players", 13)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "media-player", 12)) { - executable = mate_da_xml_get_string (element, "executable"); - if (is_executable_valid (executable)) { - media_item = mate_da_simple_item_new (); - - media_item->generic.name = mate_da_xml_get_string (element, "name"); - media_item->generic.executable = executable; - media_item->generic.command = mate_da_xml_get_string (element, "command"); - media_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - media_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal"); - - capplet->media_players = g_list_append (capplet->media_players, media_item); - } - else - g_free (executable); + else if (!xmlStrncmp(section->name, (const xmlChar*) "music-players", strlen("music-players"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "music-player", strlen("music-player"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + media_item = mate_da_simple_item_new(); + + media_item->generic.name = mate_da_xml_get_string (element, "name"); + media_item->generic.executable = executable; + media_item->generic.command = mate_da_xml_get_string (element, "command"); + media_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); + + media_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal"); + + capplet->media_players = g_list_append (capplet->media_players, media_item); + } + else + { + g_free(executable); + } + } + } } - } - } - else if (!xmlStrncmp (section->name, "a11y-visual", 11)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "visual", 6)) { - executable = mate_da_xml_get_string (element,"executable"); - if (is_executable_valid (executable)) { - visual_item = mate_da_visual_item_new (); - - visual_item->generic.name = mate_da_xml_get_string (element, "name"); - visual_item->generic.executable = executable; - visual_item->generic.command = mate_da_xml_get_string (element, "command"); - visual_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - visual_item->run_at_startup = mate_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*) "video-players", strlen("video-players"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "video-player", strlen("video-player"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + video_item = mate_da_simple_item_new(); + + video_item->generic.name = mate_da_xml_get_string (element, "name"); + video_item->generic.executable = executable; + video_item->generic.command = mate_da_xml_get_string (element, "command"); + video_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); + + video_item->run_in_terminal = mate_da_xml_get_bool (element, "run-in-terminal"); + + capplet->video_players = g_list_append (capplet->video_players, video_item); + } + else + { + g_free(executable); + } + } + } } - } - } - else if (!xmlStrncmp (section->name, "a11y-mobility", 13)) { - for (element = section->children; element != NULL; element = element->next) { - if (!xmlStrncmp (element->name, "mobility", 8)) { - executable = mate_da_xml_get_string (element,"executable"); - if (is_executable_valid (executable)) { - mobility_item = mate_da_mobility_item_new (); - - mobility_item->generic.name = mate_da_xml_get_string (element, "name"); - mobility_item->generic.executable = executable; - mobility_item->generic.command = mate_da_xml_get_string (element, "command"); - mobility_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); - - mobility_item->run_at_startup = mate_da_xml_get_bool (element, "run-at-startup"); - - capplet->mobility_ats = g_list_append (capplet->mobility_ats, mobility_item); - } - else - g_free (executable); + else if (!xmlStrncmp(section->name, (const xmlChar*) "image-viewers", strlen("image-viewers"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp(element->name, (const xmlChar*) "image-viewer", strlen("image-viewer"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + image_item = mate_da_image_item_new(); + + image_item->generic.name = mate_da_xml_get_string(element, "name"); + image_item->generic.executable = executable; + image_item->generic.command = mate_da_xml_get_string(element, "command"); + image_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + image_item->run_in_terminal = mate_da_xml_get_bool(element, "run-in-terminal"); + + capplet->image_viewers = g_list_append(capplet->image_viewers, image_item); + } + else + { + g_free(executable); + } + } + } + } + else if (!xmlStrncmp(section->name, (const xmlChar*) "text-editors", strlen("text-editors"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp(element->name, (const xmlChar*) "text-editor", strlen("text-editor"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + text_item = mate_da_text_item_new(); + + text_item->generic.name = mate_da_xml_get_string(element, "name"); + text_item->generic.executable = executable; + text_item->generic.command = mate_da_xml_get_string(element, "command"); + text_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + text_item->run_in_terminal = mate_da_xml_get_bool(element, "run-in-terminal"); + + capplet->text_editors = g_list_append(capplet->text_editors, text_item); + } + else + { + g_free(executable); + } + } + } + } + else if (!xmlStrncmp(section->name, (const xmlChar*) "file-managers", strlen("file-managers"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp(element->name, (const xmlChar*) "file-manager", strlen("file-manager"))) + { + executable = mate_da_xml_get_string(element, "executable"); + + if (is_executable_valid(executable)) + { + file_item = mate_da_file_item_new(); + + file_item->generic.name = mate_da_xml_get_string(element, "name"); + file_item->generic.executable = executable; + file_item->generic.command = mate_da_xml_get_string(element, "command"); + file_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + file_item->run_in_terminal = mate_da_xml_get_bool(element, "run-in-terminal"); + + capplet->file_managers = g_list_append(capplet->file_managers, file_item); + } + else + { + g_free(executable); + } + } + } + } + else if (!xmlStrncmp(section->name, (const xmlChar*) "a11y-visual", strlen("a11y-visual"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp (element->name, (const xmlChar*) "visual", strlen("visual"))) + { + executable = mate_da_xml_get_string (element,"executable"); + + if (is_executable_valid (executable)) + { + visual_item = mate_da_visual_item_new(); + + visual_item->generic.name = mate_da_xml_get_string(element, "name"); + visual_item->generic.executable = executable; + visual_item->generic.command = mate_da_xml_get_string(element, "command"); + visual_item->generic.icon_name = mate_da_xml_get_string(element, "icon-name"); + + visual_item->run_at_startup = mate_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", strlen("a11y-mobility"))) + { + for (element = section->children; element != NULL; element = element->next) + { + if (!xmlStrncmp(element->name, (const xmlChar*) "mobility", strlen("mobility"))) + { + executable = mate_da_xml_get_string(element,"executable"); + + if (is_executable_valid (executable)) + { + mobility_item = mate_da_mobility_item_new (); + + mobility_item->generic.name = mate_da_xml_get_string (element, "name"); + mobility_item->generic.executable = executable; + mobility_item->generic.command = mate_da_xml_get_string (element, "command"); + mobility_item->generic.icon_name = mate_da_xml_get_string (element, "icon-name"); + + mobility_item->run_at_startup = mate_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); + xmlFreeDoc(xml_doc); } void mate_da_xml_load_list(MateDACapplet* capplet) @@ -305,23 +477,30 @@ void mate_da_xml_load_list(MateDACapplet* capplet) } } -void -mate_da_xml_free (MateDACapplet *capplet) +void mate_da_xml_free(MateDACapplet* capplet) { - g_list_foreach (capplet->web_browsers, (GFunc) mate_da_web_item_free, NULL); - g_list_foreach (capplet->mail_readers, (GFunc) mate_da_simple_item_free, NULL); - g_list_foreach (capplet->terminals, (GFunc) mate_da_term_item_free, NULL); - g_list_foreach (capplet->media_players, (GFunc) mate_da_simple_item_free, NULL); - g_list_foreach (capplet->visual_ats, (GFunc) mate_da_visual_item_free, NULL); - g_list_foreach (capplet->mobility_ats, (GFunc) mate_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->media_players); - g_list_free (capplet->visual_ats); - g_list_free (capplet->mobility_ats); - - g_object_unref (capplet->builder); - g_free (capplet); + g_list_foreach(capplet->web_browsers, (GFunc) mate_da_web_item_free, NULL); + g_list_foreach(capplet->mail_readers, (GFunc) mate_da_simple_item_free, NULL); + g_list_foreach(capplet->terminals, (GFunc) mate_da_term_item_free, NULL); + g_list_foreach(capplet->media_players, (GFunc) mate_da_simple_item_free, NULL); + g_list_foreach(capplet->video_players, (GFunc) mate_da_simple_item_free, NULL); + g_list_foreach(capplet->visual_ats, (GFunc) mate_da_visual_item_free, NULL); + g_list_foreach(capplet->mobility_ats, (GFunc) mate_da_mobility_item_free, NULL); + g_list_foreach(capplet->image_viewers, (GFunc) mate_da_image_item_free, NULL); + g_list_foreach(capplet->text_editors, (GFunc) mate_da_text_item_free, NULL); + g_list_foreach(capplet->file_managers, (GFunc) mate_da_file_item_free, NULL); + + g_list_free(capplet->web_browsers); + g_list_free(capplet->mail_readers); + g_list_free(capplet->terminals); + g_list_free(capplet->media_players); + g_list_free(capplet->video_players); + g_list_free(capplet->visual_ats); + g_list_free(capplet->mobility_ats); + g_list_free(capplet->image_viewers); + g_list_free(capplet->text_editors); + g_list_free(capplet->file_managers); + + g_object_unref(capplet->builder); + g_free(capplet); } diff --git a/capplets/default-applications/mate-da-xml.h b/capplets/default-applications/mate-da-xml.h index b209355c..2016b930 100644 --- a/capplets/default-applications/mate-da-xml.h +++ b/capplets/default-applications/mate-da-xml.h @@ -21,7 +21,7 @@ #ifndef _MATE_DA_XML_H_ #define _MATE_DA_XML_H_ -void mate_da_xml_load_list (MateDACapplet *capplet); -void mate_da_xml_free (MateDACapplet *capplet); +void mate_da_xml_load_list(MateDACapplet* capplet); +void mate_da_xml_free(MateDACapplet* capplet); #endif diff --git a/capplets/default-applications/mate-default-applications-properties.ui b/capplets/default-applications/mate-default-applications-properties.ui index 4edc2968..0da56bc6 100644 --- a/capplets/default-applications/mate-default-applications-properties.ui +++ b/capplets/default-applications/mate-default-applications-properties.ui @@ -1,1196 +1,1477 @@ <?xml version="1.0"?> <interface> - <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy toplevel-contextual --> - <object class="GtkDialog" id="preferred_apps_dialog"> - <property name="border_width">5</property> - <property name="title" translatable="yes">Preferred Applications</property> - <property name="resizable">False</property> - <property name="type_hint">dialog</property> - <property name="has_separator">False</property> - <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox"> - <property name="visible">True</property> - <child> - <object class="GtkNotebook" id="preferred_apps_notebook"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="border_width">5</property> - <child> - <object class="GtkVBox" id="internet_vbox"> - <property name="visible">True</property> - <property name="border_width">12</property> - <property name="spacing">18</property> - <child> - <object class="GtkVBox" id="web_browser_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="web_browser_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Web Browser</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="web_browser_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="web_browser_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="web_browser_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="web_browser_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="web_browser_options_table"> - <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkEntry" id="web_browser_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="web_browser_terminal_checkbutton"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="web_browser_default_radiobutton"> - <property name="label" translatable="yes">Open link with web browser _default</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="web_browser_new_tab_radiobutton"> - <property name="label" translatable="yes">Open link in new _tab</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <property name="group">web_browser_default_radiobutton</property> - </object> - <packing> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="web_browser_new_win_radiobutton"> - <property name="label" translatable="yes">Open link in new _window</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <property name="group">web_browser_default_radiobutton</property> - </object> - <packing> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkLabel" id="web_browser_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">C_ommand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">web_browser_command_entry</property> - </object> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="mail_reader_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="mail_reader_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Mail Reader</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="mail_reader_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="mail_reader_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="mail_reader_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="mail_reader_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="mail_reader_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="mail_reader_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">mail_reader_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="mail_reader_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="mail_reader_terminal_checkbutton"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="messenger_vbox"> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="messenger_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Instant Messenger</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="messenger_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="messenger_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="messenger_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="messenger_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="messenger_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="messenger_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">messenger_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="messenger_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="messenger_terminal_checkbutton"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">2</property> - </packing> - </child> - </object> - </child> - <child type="tab"> - <object class="GtkLabel" id="internet_apps_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Internet</property> - </object> - <packing> - <property name="tab_fill">False</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="multimedia_vbox"> - <property name="visible">True</property> - <property name="border_width">12</property> - <property name="spacing">18</property> - <child> - <object class="GtkVBox" id="image_vbox"> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="image_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Image Viewer</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="image_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="image_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="image_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="image_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="image_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="image_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">image_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="image_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="image_terminal_checkbox"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="media_player_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="media_player_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Multimedia Player</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="media_player_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="media_player_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="media_player_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="media_player_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="media_player_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="media_player_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">media_player_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="media_player_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="media_player_terminal_checkbutton"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="video_vbox"> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="video_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Video Player</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="video_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="video_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="video_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="video_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="video_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="video_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">video_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="video_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="video_terminal_checkbox"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">2</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child type="tab"> - <object class="GtkLabel" id="multimedia_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Multimedia</property> - </object> - <packing> - <property name="position">1</property> - <property name="tab_fill">False</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="system_vbox"> - <property name="visible">True</property> - <property name="border_width">12</property> - <property name="spacing">18</property> - <child> - <object class="GtkVBox" id="text_vbox"> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="text_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Text Editor</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="text_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="text_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="text_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="text_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="text_options_table"> - <property name="visible">True</property> - <property name="n_columns">3</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="text_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">text_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="text_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="text_terminal_checkbox"> - <property name="label" translatable="yes">Run in t_erminal</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="terminal_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="terminal_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Terminal Emulator</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="terminal_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="terminal_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="terminal_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="terminal_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="terminal_options_table"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="terminal_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">terminal_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="terminal_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkLabel" id="terminal_exec_flag_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">E_xecute flag:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">terminal_exec_flag_entry</property> - </object> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="terminal_exec_flag_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - - <!-- el file manager -- > + <requires lib="gtk+" version="2.16" /> + <!-- interface-naming-policy toplevel-contextual --> + <object class="GtkDialog" id="preferred_apps_dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Preferred Applications</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox"> + <property name="visible">True</property> <child> - <object class="GtkVBox" id="filemanager_vbox"> + <object class="GtkNotebook" id="preferred_apps_notebook"> <property name="visible">True</property> - <property name="spacing">6</property> + <property name="can_focus">True</property> + <property name="border_width">5</property> <child> - <object class="GtkLabel" id="filemanager_label"> + <object class="GtkVBox" id="internet_vbox"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">File Manager</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="border_width">12</property> + <property name="spacing">18</property> + <child> + <object class="GtkVBox" id="web_browser_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="web_browser_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Web Browser</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="web_browser_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="web_browser_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="web_browser_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="web_browser_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="web_browser_options_table"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkEntry" id="web_browser_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="web_browser_terminal_checkbutton"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="web_browser_default_radiobutton"> + <property name="label" translatable="yes">Open link with web browser _default</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="web_browser_new_tab_radiobutton"> + <property name="label" translatable="yes">Open link in new _tab</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">web_browser_default_radiobutton</property> + </object> + <packing> + <property name="right_attach">3</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="web_browser_new_win_radiobutton"> + <property name="label" translatable="yes">Open link in new _window</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">web_browser_default_radiobutton</property> + </object> + <packing> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="web_browser_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">C_ommand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">web_browser_command_entry</property> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="mail_reader_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="mail_reader_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Mail Reader</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="mail_reader_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="mail_reader_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="mail_reader_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="mail_reader_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="mail_reader_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="mail_reader_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">mail_reader_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="mail_reader_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="mail_reader_terminal_checkbutton"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="messenger_vbox"> + <!-- <property name="visible">True</property> --> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="messenger_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Instant Messenger</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="messenger_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="messenger_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="messenger_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="messenger_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="messenger_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="messenger_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">messenger_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="messenger_command_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="messenger_terminal_checkbutton"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="internet_apps_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">Internet</property> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="multimedia_vbox"> + <property name="visible">True</property> + <property name="border_width">12</property> + <property name="spacing">18</property> + + + <!-- visor de imagenes --> + <child> + <object class="GtkVBox" id="image_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="image_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Image Viewer</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="image_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="imageviewer_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="image_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="image_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="image_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="image_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">image_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="image_command_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="image_terminal_checkbox"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <!-- / visor de imagenes --> + + <!-- / reproductor de musica --> + <child> + <object class="GtkVBox" id="media_player_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="media_player_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Multimedia Player</property> <!-- should be Music Player --> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="media_player_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="media_player_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="media_player_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="media_player_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="media_player_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="media_player_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">media_player_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="media_player_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="media_player_terminal_checkbutton"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <!-- / reproductor de musica --> + + <!-- / reproductor de videos --> + <child> + <object class="GtkVBox" id="video_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="video_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Video Player</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="video_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="video_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="video_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="video_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="video_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="video_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">video_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="video_command_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="video_terminal_checkbox"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <!-- / reproductor de videos --> + + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="multimedia_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">Multimedia</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> </packing> </child> <child> - <object class="GtkHBox" id="filemanager_hbox"> + <object class="GtkVBox" id="system_vbox"> <property name="visible">True</property> - <property name="spacing">12</property> + <property name="border_width">12</property> + <property name="spacing">18</property> + + <!-- editor de texto --> <child> - <object class="GtkImage" id="filemanager_image"> + <object class="GtkVBox" id="text_vbox"> <property name="visible">True</property> - <property name="yalign">0</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="text_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Text Editor</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="text_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="text_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="text_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="text_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="text_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="text_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">text_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="text_command_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="text_terminal_checkbox"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> <property name="position">0</property> </packing> </child> + <!-- / editor de texto --> + + <!-- terminal --> <child> - <object class="GtkVBox" id="filemanager_options_vbox"> + <object class="GtkVBox" id="terminal_vbox"> <property name="visible">True</property> <property name="spacing">6</property> <child> - <object class="GtkComboBox" id="filemanager_combobox"> + <object class="GtkLabel" id="terminal_label"> <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Terminal Emulator</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> </object> <packing> <property name="expand">False</property> + <property name="fill">False</property> <property name="position">0</property> </packing> </child> <child> - <object class="GtkTable" id="filemanager_options_table"> + <object class="GtkHBox" id="terminal_hbox"> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> + <property name="spacing">12</property> <child> - <object class="GtkLabel" id="filemanager_command_label"> + <object class="GtkImage" id="terminal_image"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">filemanager_command_entry</property> + <property name="yalign">0</property> </object> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkEntry" id="filemanager_command_entry"> + <object class="GtkVBox" id="terminal_options_vbox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="terminal_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="terminal_options_table"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="terminal_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">terminal_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="terminal_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="terminal_exec_flag_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">E_xecute flag:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">terminal_exec_flag_entry</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="terminal_exec_flag_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> + <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <!-- / terminal --> + + + <!-- el file manager --> + <child> + <object class="GtkVBox" id="filemanager_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="filemanager_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">File Manager</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="filemanager_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> <child> - <object class="GtkLabel" id="filemanager_exec_flag_label"> + <object class="GtkImage" id="filemanager_image"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">E_xecute flag:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">filemanager_exec_flag_entry</property> + <property name="yalign">0</property> </object> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkEntry" id="filemanager_exec_flag_entry"> + <object class="GtkVBox" id="filemanager_options_vbox"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="filemanager_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTable" id="filemanager_options_table"> + <property name="visible">True</property> + <property name="n_columns">3</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="filemanager_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">filemanager_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="filemanager_command_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="filemanager_terminal_checkbox"> + <property name="label" translatable="yes">Run in t_erminal</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> + <property name="position">1</property> </packing> </child> </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <!-- / el file manager --> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="system_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">System</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="a11y_vbox"> + <property name="visible">True</property> + <property name="border_width">12</property> + <property name="spacing">18</property> + <child> + <object class="GtkVBox" id="visual_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="visual_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Visual</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="visual_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="visual_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="visual_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="visual_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="visual_start_checkbutton"> + <property name="label" translatable="yes">_Run at start</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkTable" id="visual_options_table"> + <property name="visible">True</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="visual_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">C_ommand:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">image_command_entry</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="visual_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="mobility_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="mobility_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Mobility</property> + <attributes> + <attribute name="weight" value="bold" /> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="mobility_hbox"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkImage" id="mobility_image"> + <property name="visible">True</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="mobility_options_vbox"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkComboBox" id="mobility_combobox"> + <property name="visible">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="mobility_start_checkbutton"> + <property name="label" translatable="yes">Run at st_art</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkTable" id="mobility_options_table"> + <property name="visible">True</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="mobility_command_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Co_mmand:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="mobility_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="a11y_apps_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accessibility</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> </child> </object> <packing> @@ -1198,321 +1479,52 @@ <property name="position">1</property> </packing> </child> - - < ! -- / el file manager --> - - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - <child type="tab"> - <object class="GtkLabel" id="system_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">System</property> - </object> - <packing> - <property name="position">2</property> - <property name="tab_fill">False</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="a11y_vbox"> - <property name="visible">True</property> - <property name="border_width">12</property> - <property name="spacing">18</property> - <child> - <object class="GtkVBox" id="visual_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="visual_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Visual</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="visual_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="visual_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="visual_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="visual_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="visual_start_checkbutton"> - <property name="label" translatable="yes">_Run at start</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkTable" id="visual_options_table"> - <property name="visible">True</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="visual_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">C_ommand:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">image_command_entry</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="visual_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="mobility_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="mobility_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Mobility</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="mobility_hbox"> - <property name="visible">True</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage" id="mobility_image"> - <property name="visible">True</property> - <property name="yalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="mobility_options_vbox"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkComboBox" id="mobility_combobox"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="mobility_start_checkbutton"> - <property name="label" translatable="yes">Run at st_art</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkTable" id="mobility_options_table"> - <property name="visible">True</property> - <property name="n_columns">2</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> - <child> - <object class="GtkLabel" id="mobility_command_label"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Co_mmand:</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="mobility_command_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">3</property> - </packing> - </child> - <child type="tab"> - <object class="GtkLabel" id="a11y_apps_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Accessibility</property> - </object> - <packing> - <property name="position">3</property> - <property name="tab_fill">False</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area"> - <property name="visible">True</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="helpbutton1"> - <property name="label">gtk-help</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="closebutton1"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="-11">helpbutton1</action-widget> - <action-widget response="-7">closebutton1</action-widget> - </action-widgets> - </object> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area"> + <property name="visible">True</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="helpbutton1"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="closebutton1"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-11">helpbutton1</action-widget> + <action-widget response="-7">closebutton1</action-widget> + </action-widgets> + </object> </interface> diff --git a/capplets/default-applications/mate-default-applications.xml.in b/capplets/default-applications/mate-default-applications.xml.in index 4bd2f8b9..43438ae2 100644 --- a/capplets/default-applications/mate-default-applications.xml.in +++ b/capplets/default-applications/mate-default-applications.xml.in @@ -4,249 +4,289 @@ <!-- Remember to never use the same string for <command>, <tab-command> and <win-command> entries --> - <web-browsers> - <web-browser> - <_name>Opera</_name> - <executable>opera</executable> - <command>opera %s</command> - <icon-name>opera</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>opera -newpage %s</tab-command> - <win-command>opera -newwindow %s</win-command> - </web-browser> - <web-browser> - <_name>Debian Sensible Browser</_name> - <executable>sensible-browser</executable> - <command>sensible-browser %s</command> - <icon-name></icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>false</netscape-remote> - </web-browser> - <web-browser> - <_name>Epiphany Web Browser</_name> - <executable>epiphany</executable> - <command>epiphany %s</command> - <icon-name>web-browser</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>epiphany --new-tab %s</tab-command> - <win-command>epiphany --new-window %s</win-command> - </web-browser> - <web-browser> - <_name>Galeon</_name> - <executable>galeon</executable> - <command>galeon %s</command> - <icon-name>galeon</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>galeon -n %s</tab-command> - <win-command>galeon -w %s</win-command> - </web-browser> - <web-browser> - <_name>Encompass</_name> - <executable>encompass</executable> - <command>encompass %s</command> - <icon-name>encompass</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>false</netscape-remote> - </web-browser> - <web-browser> - <_name>Firebird</_name> - <executable>mozilla-firebird</executable> - <command>mozilla-firebird %s</command> - <icon-name></icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>mozilla-firebird -remote "openurl(%s,new-tab)"</tab-command> - <win-command>mozilla-firebird -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>Firefox</_name> - <executable>firefox</executable> - <command>firefox %s</command> - <icon-name>firefox</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>firefox -new-tab "%s"</tab-command> - <win-command>firefox -new-window "%s"</win-command> - </web-browser> - <web-browser> - <_name>Iceweasel</_name> - <executable>iceweasel</executable> - <command>iceweasel %s</command> - <icon-name>iceweasel</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>iceweasel -new-tab "%s"</tab-command> - <win-command>iceweasel -new-window "%s"</win-command> - </web-browser> - <web-browser> - <_name>Mozilla 1.6</_name> - <executable>mozilla-1.6</executable> - <command>mozilla-1.6 %s</command> - <icon-name>mozilla-icon</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>mozilla-1.6 -remote "openurl(%s,new-tab)"</tab-command> - <win-command>mozilla-1.6 -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>Mozilla</_name> - <executable>mozilla</executable> - <command>mozilla %s</command> - <icon-name>mozilla-icon</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>mozilla -remote "openurl(%s,new-tab)"</tab-command> - <win-command>mozilla -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>SeaMonkey</_name> - <executable>seamonkey</executable> - <command>seamonkey %s</command> - <icon-name>seamonkey</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>seamonkey -remote "openurl(%s,new-tab)"</tab-command> - <win-command>seamonkey -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>Iceape</_name> - <executable>iceape</executable> - <command>iceape %s</command> - <icon-name>iceape</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>iceape -remote "openurl(%s,new-tab)"</tab-command> - <win-command>iceape -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>Netscape Communicator</_name> - <executable>netscape</executable> - <command>netscape %s</command> - <icon-name>netscape</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>true</netscape-remote> - <tab-command>netscape -remote "openurl(%s,new-tab)"</tab-command> - <win-command>netscape -remote "openurl(%s,new-window)"</win-command> - </web-browser> - <web-browser> - <_name>Konqueror</_name> - <executable>konqueror</executable> - <command>konqueror %s</command> - <icon-name>konqueror</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>false</netscape-remote> - </web-browser> - <web-browser> - <_name>Midori</_name> - <executable>midori</executable> - <command>midori %s</command> - <icon-name>web-browser</icon-name> - <run-in-terminal>false</run-in-terminal> - <netscape-remote>false</netscape-remote> - </web-browser> - </web-browsers> - - <mail-readers> - <mail-reader> - <_name>Evolution Mail Reader</_name> - <executable>evolution</executable> - <command>evolution %s</command> - <icon-name>evolution</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Balsa</_name> - <executable>balsa</executable> - <command>balsa -m %s</command> - <icon-name>mate-balsa2</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>KMail</_name> - <executable>kmail</executable> - <command>kmail %s</command> - <icon-name>kmail</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Icedove</_name> - <executable>icedove</executable> - <command>icedove %s</command> - <icon-name>icedove</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Thunderbird</_name> - <executable>thunderbird</executable> - <command>thunderbird %s</command> - <icon-name>thunderbird</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Mozilla Thunderbird</_name> - <executable>mozilla-thunderbird</executable> - <command>mozilla-thunderbird %s</command> - <icon-name>thunderbird</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Mozilla Mail</_name> - <executable>mozilla</executable> - <command>mozilla -mail %s</command> - <icon-name>mozilla-mail-icon</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>SeaMonkey Mail</_name> - <executable>seamonkey</executable> - <command>seamonkey -mail %s</command> - <icon-name>seamonkey</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Iceape Mail</_name> - <executable>iceape</executable> - <command>iceape -mail %s</command> - <icon-name>iceape</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Mutt</_name> - <executable>mutt</executable> - <command>mutt %s</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <run-in-terminal>true</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Claws Mail</_name> - <executable>claws-mail</executable> - <command>claws-mail --compose %s</command> - <icon-name>claws-mail</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Sylpheed-Claws</_name> - <executable>sylpheed-claws</executable> - <command>sylpheed-claws --compose %s</command> - <icon-name>sylpheed</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - <mail-reader> - <_name>Sylpheed</_name> - <executable>sylpheed</executable> - <command>sylpheed --compose %s</command> - <icon-name>sylpheed</icon-name> - <run-in-terminal>false</run-in-terminal> - </mail-reader> - </mail-readers> + <web-browsers> + + <web-browser> + <_name>Opera</_name> + <executable>opera</executable> + <command>opera %s</command> + <icon-name>opera</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>opera -newpage %s</tab-command> + <win-command>opera -newwindow %s</win-command> + </web-browser> + + <web-browser> + <_name>Debian Sensible Browser</_name> + <executable>sensible-browser</executable> + <command>sensible-browser %s</command> + <icon-name></icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + <web-browser> + <_name>Epiphany Web Browser</_name> + <executable>epiphany</executable> + <command>epiphany %s</command> + <icon-name>web-browser</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>epiphany --new-tab %s</tab-command> + <win-command>epiphany --new-window %s</win-command> + </web-browser> + + <web-browser> + <_name>Galeon</_name> + <executable>galeon</executable> + <command>galeon %s</command> + <icon-name>galeon</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>galeon -n %s</tab-command> + <win-command>galeon -w %s</win-command> + </web-browser> + + <web-browser> + <_name>Encompass</_name> + <executable>encompass</executable> + <command>encompass %s</command> + <icon-name>encompass</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + <web-browser> + <_name>Firebird</_name> + <executable>mozilla-firebird</executable> + <command>mozilla-firebird %s</command> + <icon-name></icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>mozilla-firebird -remote "openurl(%s,new-tab)"</tab-command> + <win-command>mozilla-firebird -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>Firefox</_name> + <executable>firefox</executable> + <command>firefox %s</command> + <icon-name>firefox</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>firefox -new-tab "%s"</tab-command> + <win-command>firefox -new-window "%s"</win-command> + </web-browser> + + <web-browser> + <_name>Iceweasel</_name> + <executable>iceweasel</executable> + <command>iceweasel %s</command> + <icon-name>iceweasel</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>iceweasel -new-tab "%s"</tab-command> + <win-command>iceweasel -new-window "%s"</win-command> + </web-browser> + + <web-browser> + <_name>Mozilla 1.6</_name> + <executable>mozilla-1.6</executable> + <command>mozilla-1.6 %s</command> + <icon-name>mozilla-icon</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>mozilla-1.6 -remote "openurl(%s,new-tab)"</tab-command> + <win-command>mozilla-1.6 -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>Mozilla</_name> + <executable>mozilla</executable> + <command>mozilla %s</command> + <icon-name>mozilla-icon</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>mozilla -remote "openurl(%s,new-tab)"</tab-command> + <win-command>mozilla -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>SeaMonkey</_name> + <executable>seamonkey</executable> + <command>seamonkey %s</command> + <icon-name>seamonkey</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>seamonkey -remote "openurl(%s,new-tab)"</tab-command> + <win-command>seamonkey -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>Iceape</_name> + <executable>iceape</executable> + <command>iceape %s</command> + <icon-name>iceape</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>iceape -remote "openurl(%s,new-tab)"</tab-command> + <win-command>iceape -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>Netscape Communicator</_name> + <executable>netscape</executable> + <command>netscape %s</command> + <icon-name>netscape</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>true</netscape-remote> + <tab-command>netscape -remote "openurl(%s,new-tab)"</tab-command> + <win-command>netscape -remote "openurl(%s,new-window)"</win-command> + </web-browser> + + <web-browser> + <_name>Konqueror</_name> + <executable>konqueror</executable> + <command>konqueror %s</command> + <icon-name>konqueror</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + <web-browser> + <_name>Midori</_name> + <executable>midori</executable> + <command>midori %s</command> + <icon-name>midori</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + <web-browser> + <_name>Chromium</_name> + <executable>chromium</executable> + <command>chromium %s</command> + <icon-name>chromium</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + <web-browser> + <_name>Google Chrome</_name> + <executable>google-chrome</executable> + <command>google-chrome %s</command> + <icon-name>google-chrome</icon-name> + <run-in-terminal>false</run-in-terminal> + <netscape-remote>false</netscape-remote> + </web-browser> + + </web-browsers> + + <mail-readers> + + <mail-reader> + <_name>Thunderbird</_name> + <executable>thunderbird</executable> + <command>thunderbird %s</command> + <icon-name>thunderbird</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Evolution Mail Reader</_name> + <executable>evolution</executable> + <command>evolution %s</command> + <icon-name>evolution</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Balsa</_name> + <executable>balsa</executable> + <command>balsa -m %s</command> + <icon-name>mate-balsa2</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>KMail</_name> + <executable>kmail</executable> + <command>kmail %s</command> + <icon-name>kmail</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Icedove</_name> + <executable>icedove</executable> + <command>icedove %s</command> + <icon-name>icedove</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Mozilla Thunderbird</_name> + <executable>mozilla-thunderbird</executable> + <command>mozilla-thunderbird %s</command> + <icon-name>thunderbird</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Mozilla Mail</_name> + <executable>mozilla</executable> + <command>mozilla -mail %s</command> + <icon-name>mozilla-mail-icon</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>SeaMonkey Mail</_name> + <executable>seamonkey</executable> + <command>seamonkey -mail %s</command> + <icon-name>seamonkey</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Iceape Mail</_name> + <executable>iceape</executable> + <command>iceape -mail %s</command> + <icon-name>iceape</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Mutt</_name> + <executable>mutt</executable> + <command>mutt %s</command> + <icon-name>application-x-executable</icon-name> + <run-in-terminal>true</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Claws Mail</_name> + <executable>claws-mail</executable> + <command>claws-mail --compose %s</command> + <icon-name>claws-mail</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + <mail-reader> + <_name>Sylpheed</_name> + <executable>sylpheed</executable> + <command>sylpheed --compose %s</command> + <icon-name>sylpheed</icon-name> + <run-in-terminal>false</run-in-terminal> + </mail-reader> + + </mail-readers> <!-- agregando para los ... --> <file-managers> <file-manager> - <_name>Mate File Manager</_name> + <_name>MATE file manager</_name> <executable>caja</executable> <run-in-terminal>false</run-in-terminal> <command>caja %s</command> @@ -263,85 +303,95 @@ <file-manager> <_name>Thunar</_name> - <executable>thunar</executable> + <executable>Thunar</executable> <run-in-terminal>false</run-in-terminal> <command>thunar %s</command> - <icon-name>thunar</icon-name> + <icon-name>Thunar</icon-name> </file-manager> </file-managers> - <terminals> - <terminal> - <_name>Debian Terminal Emulator</_name> - <executable>x-terminal-emulator</executable> - <command>x-terminal-emulator</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>MATE Terminal</_name> - <executable>mate-terminal</executable> - <command>mate-terminal</command> - <icon-name>utilities-terminal</icon-name> - <exec-flag>-x</exec-flag> - </terminal> - <terminal> - <_name>GNOME Terminal</_name> - <executable>gnome-terminal</executable> - <command>gnome-terminal</command> - <icon-name>gnome-terminal</icon-name> - <exec-flag>-x</exec-flag> - </terminal> - <terminal> - <_name>Terminator</_name> - <executable>terminator</executable> - <command>terminator</command> - <icon-name>terminator</icon-name> - <exec-flag>-x</exec-flag> - </terminal> - <terminal> - <_name>Standard XTerminal</_name> - <executable>xterm</executable> - <command>xterm</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>NXterm</_name> - <executable>nxterm</executable> - <command>nxterm</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>RXVT</_name> - <executable>rxvt</executable> - <command>rxvt</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>aterm</_name> - <executable>aterm</executable> - <command>aterm</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>ETerm</_name> - <executable>ETerm</executable> - <command>ETerm</command> - <icon-name>mate-mime-application-x-executable</icon-name> - <exec-flag>-e</exec-flag> - </terminal> - <terminal> - <_name>Konsole</_name> - <executable>konsole</executable> - <command>konsole</command> - <icon-name>konsole</icon-name> - <exec-flag>-e</exec-flag> - </terminal> + <terminals> + <terminal> + <_name>Debian Terminal Emulator</_name> + <executable>x-terminal-emulator</executable> + <command>x-terminal-emulator</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>MATE Terminal</_name> + <executable>mate-terminal</executable> + <command>mate-terminal</command> + <icon-name>utilities-terminal</icon-name> + <exec-flag>-x</exec-flag> + </terminal> + + <terminal> + <_name>GNOME Terminal</_name> + <executable>gnome-terminal</executable> + <command>gnome-terminal</command> + <icon-name>gnome-terminal</icon-name> + <exec-flag>-x</exec-flag> + </terminal> + + <terminal> + <_name>Terminator</_name> + <executable>terminator</executable> + <command>terminator</command> + <icon-name>terminator</icon-name> + <exec-flag>-x</exec-flag> + </terminal> + + <terminal> + <_name>Standard XTerminal</_name> + <executable>xterm</executable> + <command>xterm</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>NXterm</_name> + <executable>nxterm</executable> + <command>nxterm</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>RXVT</_name> + <executable>rxvt</executable> + <command>rxvt</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>aterm</_name> + <executable>aterm</executable> + <command>aterm</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>ETerm</_name> + <executable>ETerm</executable> + <command>ETerm</command> + <icon-name>application-x-executable</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + + <terminal> + <_name>Konsole</_name> + <executable>konsole</executable> + <command>konsole</command> + <icon-name>konsole</icon-name> + <exec-flag>-e</exec-flag> + </terminal> + <terminal> <_name>Terminal</_name> <executable>terminal</executable> @@ -349,6 +399,7 @@ <icon-name>utilities-terminal</icon-name> <exec-flag>-e</exec-flag> </terminal> + <terminal> <_name>Sakura</_name> <executable>sakura</executable> @@ -356,45 +407,202 @@ <icon-name>terminal-tango</icon-name> <exec-flag>-e</exec-flag> </terminal> - </terminals> - - <media-players> - <media-player> - <_name>Banshee Music Player</_name> - <executable>banshee</executable> - <command>banshee</command> - <icon-name>music-player-banshee</icon-name> - <run-in-terminal>false</run-in-terminal> - </media-player> - <media-player> - <_name>Muine Music Player</_name> - <executable>muine</executable> - <command>muine</command> - <icon-name>muine</icon-name> - <run-in-terminal>false</run-in-terminal> - </media-player> - <media-player> - <_name>Rhythmbox Music Player</_name> - <executable>rhythmbox</executable> - <command>rhythmbox</command> - <icon-name>rhythmbox</icon-name> - <run-in-terminal>false</run-in-terminal> - </media-player> - <media-player> - <_name>Totem Movie Player</_name> - <executable>totem</executable> - <command>totem</command> - <icon-name>totem</icon-name> - <run-in-terminal>false</run-in-terminal> - </media-player> - <media-player> - <_name>Listen</_name> - <executable>listen</executable> - <command>listen</command> - <icon-name>listen</icon-name> - <run-in-terminal>false</run-in-terminal> - </media-player> - </media-players> + </terminals> + + <image-viewers> + + <image-viewer> + <_name>MATE image viewer</_name> + <executable>eom</executable> + <command>eog %s</command> + <icon-name>eom</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>Eye of GNOME</_name> + <executable>eog</executable> + <command>eog %s</command> + <icon-name>eog</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>Shotwell</_name> + <executable>shotwell</executable> + <command>shotwell %s</command> + <icon-name>shotwell</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>MComix</_name> + <executable>mcomix</executable> + <command>mcomix %s</command> + <icon-name>mcomix</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>gThumb</_name> + <executable>gthumb</executable> + <command>gthumb %s</command> + <icon-name>gthumb</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>Gwenview</_name> + <executable>gwenview</executable> + <command>gwenview %s</command> + <icon-name>gwenview</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <image-viewer> + <_name>Ristretto</_name> + <executable>ristretto</executable> + <command>ristretto %s</command> + <icon-name>ristretto</icon-name> + <run-in-terminal>false</run-in-terminal> + </image-viewer> + + <!-- se necesita agregar los otros visores --> + </image-viewers> + + <music-players> + + <music-player> + <_name>DeaDBeeF</_name> + <executable>deadbeef</executable> + <command>deadbeef %s</command> + <icon-name>deadbeef</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <music-player> + <_name>VLC</_name> + <executable>vlc</executable> + <command>vlc %s</command> + <icon-name>vlc</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <music-player> + <_name>Rhythmbox Music Player</_name> + <executable>rhythmbox</executable> + <command>rhythmbox</command> + <icon-name>rhythmbox</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <music-player> + <_name>Totem Movie Player</_name> + <executable>totem</executable> + <command>totem</command> + <icon-name>totem</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <music-player> + <_name>Banshee Music Player</_name> + <executable>banshee</executable> + <command>banshee</command> + <icon-name>music-player-banshee</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <music-player> + <_name>Muine Music Player</_name> + <executable>muine</executable> + <command>muine</command> + <icon-name>muine</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + + <music-player> + <_name>Listen</_name> + <executable>listen</executable> + <command>listen</command> + <icon-name>listen</icon-name> + <run-in-terminal>false</run-in-terminal> + </music-player> + + <!-- se necesita agregar los otros reproductores de musica --> + </music-players> + + <video-players> + + <video-player> + <_name>VLC</_name> + <executable>vlc</executable> + <command>vlc %s</command> + <icon-name>vlc</icon-name> + <run-in-terminal>false</run-in-terminal> + </video-player> + + <video-player> + <_name>Totem Movie Player</_name> + <executable>totem</executable> + <command>totem</command> + <icon-name>totem</icon-name> + <run-in-terminal>false</run-in-terminal> + </video-player> + + </video-players> + + <text-editors> + + <text-editor> + <_name>Gedit</_name> + <executable>gedit</executable> + <command>gedit %s</command> + <icon-name>accessories-text-editor</icon-name> + <run-in-terminal>false</run-in-terminal> + </text-editor> + + <text-editor> + <_name>MATE text editor</_name> + <executable>pluma</executable> + <command>pluma %s</command> + <icon-name>accessories-text-editor</icon-name> + <run-in-terminal>false</run-in-terminal> + </text-editor> + + <!-- <text-editor> + <_name>Geany</_name> + <executable>geany</executable> + <command>geany %s</command> + <icon-name>geany</icon-name> + <run-in-terminal>false</run-in-terminal> + </text-editor> --> + + <text-editor> + <_name>leafpad</_name> + <executable>leafpad</executable> + <command>leafpad %s</command> + <icon-name>leafpad</icon-name> + <run-in-terminal>false</run-in-terminal> + </text-editor> + + <!-- <text-editor> + <_name>mousepad</_name> + <executable>mousepad</executable> + <command>mousepad %s</command> + <icon-name>mousepad</icon-name> + <run-in-terminal>false</run-in-terminal> + </text-editor> --> + + <!-- <text-editor> + <_name>GNU nano</_name> + <executable>nano</executable> + <command>nano %s</command> + <icon-name>application-x-executable</icon-name> + <run-in-terminal>true</run-in-terminal> + </text-editor> --> + + </text-editors> <a11y-visual> <visual> diff --git a/capplets/keybindings/Makefile.am b/capplets/keybindings/Makefile.am index ed97253f..e15c07f0 100644 --- a/capplets/keybindings/Makefile.am +++ b/capplets/keybindings/Makefile.am @@ -4,16 +4,16 @@ cappletname = keybinding bin_PROGRAMS = mate-keybinding-properties mate_keybinding_properties_LDADD = $(MATECC_CAPPLETS_LIBS) -mate_keybinding_properties_SOURCES = \ - mate-keybinding-properties.c \ - eggcellrendererkeys.c \ - eggcellrendererkeys.h \ - eggaccelerators.c \ +mate_keybinding_properties_SOURCES = \ + mate-keybinding-properties.c \ + eggcellrendererkeys.c \ + eggcellrendererkeys.h \ + eggaccelerators.c \ eggaccelerators.h @INTLTOOL_DESKTOP_RULE@ -uidir = $(pkgdatadir)/ui +uidir = $(pkgdatadir)/ui ui_DATA = mate-keybinding-properties.ui desktopdir = $(datadir)/applications @@ -22,9 +22,9 @@ desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) @INTLTOOL_XML_NOMERGE_RULE@ -xmldir = $(pkgdatadir)/keybindings +xmldir = $(pkgdatadir)/keybindings xml_in_files = 00-multimedia-key.xml.in 01-desktop-key.xml.in -xml_DATA = $(xml_in_files:.xml.in=.xml) +xml_DATA = $(xml_in_files:.xml.in=.xml) pkgconfigdir = $(datadir)/pkgconfig pkgconfig_DATA = mate-keybindings.pc diff --git a/capplets/keybindings/eggaccelerators.c b/capplets/keybindings/eggaccelerators.c index 0728229d..643808bf 100644 --- a/capplets/keybindings/eggaccelerators.c +++ b/capplets/keybindings/eggaccelerators.c @@ -26,162 +26,160 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> -enum -{ - EGG_MODMAP_ENTRY_SHIFT = 0, - EGG_MODMAP_ENTRY_LOCK = 1, - EGG_MODMAP_ENTRY_CONTROL = 2, - EGG_MODMAP_ENTRY_MOD1 = 3, - EGG_MODMAP_ENTRY_MOD2 = 4, - EGG_MODMAP_ENTRY_MOD3 = 5, - EGG_MODMAP_ENTRY_MOD4 = 6, - EGG_MODMAP_ENTRY_MOD5 = 7, - EGG_MODMAP_ENTRY_LAST = 8 +enum { + EGG_MODMAP_ENTRY_SHIFT = 0, + EGG_MODMAP_ENTRY_LOCK = 1, + EGG_MODMAP_ENTRY_CONTROL = 2, + EGG_MODMAP_ENTRY_MOD1 = 3, + EGG_MODMAP_ENTRY_MOD2 = 4, + EGG_MODMAP_ENTRY_MOD3 = 5, + EGG_MODMAP_ENTRY_MOD4 = 6, + EGG_MODMAP_ENTRY_MOD5 = 7, + EGG_MODMAP_ENTRY_LAST = 8 }; #define MODMAP_ENTRY_TO_MODIFIER(x) (1 << (x)) -typedef struct -{ - EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST]; - +typedef struct { + EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST]; } EggModmap; -const EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap); +const EggModmap* egg_keymap_get_modmap(GdkKeymap* keymap); -static inline gboolean -is_alt (const gchar *string) +static inline gboolean is_alt(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'a' || string[1] == 'A') && - (string[2] == 'l' || string[2] == 'L') && - (string[3] == 't' || string[3] == 'T') && - (string[4] == '>')); + return ((string[0] == '<') && + (string[1] == 'a' || string[1] == 'A') && + (string[2] == 'l' || string[2] == 'L') && + (string[3] == 't' || string[3] == 'T') && + (string[4] == '>')); } -static inline gboolean -is_ctl (const gchar *string) +static inline gboolean is_ctl (const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'c' || string[1] == 'C') && - (string[2] == 't' || string[2] == 'T') && - (string[3] == 'l' || string[3] == 'L') && - (string[4] == '>')); + return ((string[0] == '<') && + (string[1] == 'c' || string[1] == 'C') && + (string[2] == 't' || string[2] == 'T') && + (string[3] == 'l' || string[3] == 'L') && + (string[4] == '>')); } -static inline gboolean -is_modx (const gchar *string) +static inline gboolean is_modx(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'm' || string[1] == 'M') && - (string[2] == 'o' || string[2] == 'O') && - (string[3] == 'd' || string[3] == 'D') && - (string[4] >= '1' && string[4] <= '5') && - (string[5] == '>')); + return ((string[0] == '<') && + (string[1] == 'm' || string[1] == 'M') && + (string[2] == 'o' || string[2] == 'O') && + (string[3] == 'd' || string[3] == 'D') && + (string[4] >= '1' && string[4] <= '5') && + (string[5] == '>')); } -static inline gboolean -is_ctrl (const gchar *string) +static inline gboolean is_ctrl(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'c' || string[1] == 'C') && - (string[2] == 't' || string[2] == 'T') && - (string[3] == 'r' || string[3] == 'R') && - (string[4] == 'l' || string[4] == 'L') && - (string[5] == '>')); + return ((string[0] == '<') && + (string[1] == 'c' || string[1] == 'C') && + (string[2] == 't' || string[2] == 'T') && + (string[3] == 'r' || string[3] == 'R') && + (string[4] == 'l' || string[4] == 'L') && + (string[5] == '>')); } -static inline gboolean -is_shft (const gchar *string) +static inline gboolean is_shft (const gchar* string) { - return ((string[0] == '<') && - (string[1] == 's' || string[1] == 'S') && - (string[2] == 'h' || string[2] == 'H') && - (string[3] == 'f' || string[3] == 'F') && - (string[4] == 't' || string[4] == 'T') && - (string[5] == '>')); + return ((string[0] == '<') && + (string[1] == 's' || string[1] == 'S') && + (string[2] == 'h' || string[2] == 'H') && + (string[3] == 'f' || string[3] == 'F') && + (string[4] == 't' || string[4] == 'T') && + (string[5] == '>')); } -static inline gboolean -is_shift (const gchar *string) +static inline gboolean is_shift(const gchar* string) { return ((string[0] == '<') && - (string[1] == 's' || string[1] == 'S') && - (string[2] == 'h' || string[2] == 'H') && - (string[3] == 'i' || string[3] == 'I') && - (string[4] == 'f' || string[4] == 'F') && - (string[5] == 't' || string[5] == 'T') && - (string[6] == '>')); + (string[1] == 's' || string[1] == 'S') && + (string[2] == 'h' || string[2] == 'H') && + (string[3] == 'i' || string[3] == 'I') && + (string[4] == 'f' || string[4] == 'F') && + (string[5] == 't' || string[5] == 'T') && + (string[6] == '>')); } -static inline gboolean -is_control (const gchar *string) +static inline gboolean is_control(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'c' || string[1] == 'C') && - (string[2] == 'o' || string[2] == 'O') && - (string[3] == 'n' || string[3] == 'N') && - (string[4] == 't' || string[4] == 'T') && - (string[5] == 'r' || string[5] == 'R') && - (string[6] == 'o' || string[6] == 'O') && - (string[7] == 'l' || string[7] == 'L') && - (string[8] == '>')); + return ((string[0] == '<') && + (string[1] == 'c' || string[1] == 'C') && + (string[2] == 'o' || string[2] == 'O') && + (string[3] == 'n' || string[3] == 'N') && + (string[4] == 't' || string[4] == 'T') && + (string[5] == 'r' || string[5] == 'R') && + (string[6] == 'o' || string[6] == 'O') && + (string[7] == 'l' || string[7] == 'L') && + (string[8] == '>')); } -static inline gboolean -is_release (const gchar *string) +static inline gboolean is_release(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'r' || string[1] == 'R') && - (string[2] == 'e' || string[2] == 'E') && - (string[3] == 'l' || string[3] == 'L') && - (string[4] == 'e' || string[4] == 'E') && - (string[5] == 'a' || string[5] == 'A') && - (string[6] == 's' || string[6] == 'S') && - (string[7] == 'e' || string[7] == 'E') && - (string[8] == '>')); + return ((string[0] == '<') && + (string[1] == 'r' || string[1] == 'R') && + (string[2] == 'e' || string[2] == 'E') && + (string[3] == 'l' || string[3] == 'L') && + (string[4] == 'e' || string[4] == 'E') && + (string[5] == 'a' || string[5] == 'A') && + (string[6] == 's' || string[6] == 'S') && + (string[7] == 'e' || string[7] == 'E') && + (string[8] == '>')); } -static inline gboolean -is_meta (const gchar *string) +static inline gboolean is_meta(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 'm' || string[1] == 'M') && - (string[2] == 'e' || string[2] == 'E') && - (string[3] == 't' || string[3] == 'T') && - (string[4] == 'a' || string[4] == 'A') && - (string[5] == '>')); + return ((string[0] == '<') && + (string[1] == 'm' || string[1] == 'M') && + (string[2] == 'e' || string[2] == 'E') && + (string[3] == 't' || string[3] == 'T') && + (string[4] == 'a' || string[4] == 'A') && + (string[5] == '>')); } -static inline gboolean -is_super (const gchar *string) +static inline gboolean is_super(const gchar* string) { - return ((string[0] == '<') && - (string[1] == 's' || string[1] == 'S') && - (string[2] == 'u' || string[2] == 'U') && - (string[3] == 'p' || string[3] == 'P') && - (string[4] == 'e' || string[4] == 'E') && - (string[5] == 'r' || string[5] == 'R') && - (string[6] == '>')); + return ((string[0] == '<') && + (string[1] == 's' || string[1] == 'S') && + (string[2] == 'u' || string[2] == 'U') && + (string[3] == 'p' || string[3] == 'P') && + (string[4] == 'e' || string[4] == 'E') && + (string[5] == 'r' || string[5] == 'R') && + (string[6] == '>')); } -static inline gboolean -is_hyper (const gchar *string) +static inline gboolean is_hyper(const gchar *string) { - return ((string[0] == '<') && - (string[1] == 'h' || string[1] == 'H') && - (string[2] == 'y' || string[2] == 'Y') && - (string[3] == 'p' || string[3] == 'P') && - (string[4] == 'e' || string[4] == 'E') && - (string[5] == 'r' || string[5] == 'R') && - (string[6] == '>')); + return ((string[0] == '<') && + (string[1] == 'h' || string[1] == 'H') && + (string[2] == 'y' || string[2] == 'Y') && + (string[3] == 'p' || string[3] == 'P') && + (string[4] == 'e' || string[4] == 'E') && + (string[5] == 'r' || string[5] == 'R') && + (string[6] == '>')); +} + +static inline gboolean is_primary(const gchar* string) +{ + return ((string[0] == '<') && + (string[1] == 'p' || string[1] == 'P') && + (string[2] == 'r' || string[2] == 'R') && + (string[3] == 'i' || string[3] == 'I') && + (string[4] == 'm' || string[4] == 'M') && + (string[5] == 'a' || string[5] == 'A') && + (string[6] == 'r' || string[6] == 'R') && + (string[7] == 'y' || string[7] == 'Y') && + (string[8] == '>')); } -static inline gboolean -is_keycode (const gchar *string) +static inline gboolean is_keycode(const gchar *string) { - return ((string[0] == '0') && - (string[1] == 'x')); + return ((string[0] == '0') && + (string[1] == 'x')); } /** @@ -250,6 +248,12 @@ egg_accelerator_parse_virtual (const gchar *accelerator, len -= 9; mods |= EGG_VIRTUAL_CONTROL_MASK; } + else if (len >= 9 && is_primary (accelerator)) + { + accelerator += 9; + len -= 9; + mods |= EGG_VIRTUAL_CONTROL_MASK; + } else if (len >= 7 && is_shift (accelerator)) { accelerator += 7; @@ -356,7 +360,7 @@ egg_accelerator_parse_virtual (const gchar *accelerator, } else if (keycode != NULL) { - *keycode = XKeysymToKeycode (GDK_DISPLAY(), keyval); + *keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), keyval); if (*keycode == 0) bad_keyval = TRUE; } @@ -387,26 +391,28 @@ egg_accelerator_parse_virtual (const gchar *accelerator, * * The caller of this function must free the returned string. */ -gchar* -egg_virtual_accelerator_name (guint accelerator_key, - guint keycode, - EggVirtualModifierType accelerator_mods) +gchar* egg_virtual_accelerator_name (guint accelerator_key, guint keycode, EggVirtualModifierType accelerator_mods) { - gchar *gtk_name; - GdkModifierType gdkmods = 0; + /* Acá esta el problema... + * */ + gchar* gtk_name; + GdkModifierType gdkmods = 0; - egg_keymap_resolve_virtual_modifiers (NULL, accelerator_mods, &gdkmods); - gtk_name = gtk_accelerator_name (accelerator_key, gdkmods); + egg_keymap_resolve_virtual_modifiers(NULL, accelerator_mods, &gdkmods); - if (!accelerator_key) - { - gchar *name; - name = g_strdup_printf ("%s0x%02x", gtk_name, keycode); - g_free (gtk_name); - return name; - } + /* en la funcion gtk_accelerator_name, desde la modificacion del 16 de sep + * del 2011 en GTK+, la tecla <Control> es tomada como <Primary> (?) */ + gtk_name = gtk_accelerator_name(accelerator_key, gdkmods); + + if (!accelerator_key) + { + gchar *name; + name = g_strdup_printf ("%s0x%02x", gtk_name, keycode); + g_free (gtk_name); + return name; + } - return gtk_name; + return gtk_name; } /** @@ -428,47 +434,46 @@ egg_virtual_accelerator_label (guint accelerator_key, guint keycode, EggVirtualModifierType accelerator_mods) { - gchar *gtk_label; - GdkModifierType gdkmods = 0; + gchar *gtk_label; + GdkModifierType gdkmods = 0; - egg_keymap_resolve_virtual_modifiers (NULL, accelerator_mods, &gdkmods); - gtk_label = gtk_accelerator_get_label (accelerator_key, gdkmods); + egg_keymap_resolve_virtual_modifiers (NULL, accelerator_mods, &gdkmods); + gtk_label = gtk_accelerator_get_label (accelerator_key, gdkmods); - if (!accelerator_key) - { - gchar *label; - label = g_strdup_printf ("%s0x%02x", gtk_label, keycode); - g_free (gtk_label); - return label; - } + if (!accelerator_key) + { + gchar *label; + label = g_strdup_printf ("%s0x%02x", gtk_label, keycode); + g_free (gtk_label); + return label; + } - return gtk_label; + return gtk_label; } -void -egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap, - EggVirtualModifierType virtual_mods, - GdkModifierType *concrete_mods) +void egg_keymap_resolve_virtual_modifiers (GdkKeymap* keymap, EggVirtualModifierType virtual_mods, GdkModifierType* concrete_mods) { - GdkModifierType concrete; - int i; - const EggModmap *modmap; + GdkModifierType concrete; + int i; + const EggModmap* modmap; - g_return_if_fail (concrete_mods != NULL); - g_return_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap)); + g_return_if_fail (concrete_mods != NULL); + g_return_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap)); - modmap = egg_keymap_get_modmap (keymap); + modmap = egg_keymap_get_modmap(keymap); - /* Not so sure about this algorithm. */ + /* Not so sure about this algorithm. */ + concrete = 0; - concrete = 0; - for (i = 0; i < EGG_MODMAP_ENTRY_LAST; ++i) - { - if (modmap->mapping[i] & virtual_mods) - concrete |= MODMAP_ENTRY_TO_MODIFIER (i); - } + for (i = 0; i < EGG_MODMAP_ENTRY_LAST; ++i) + { + if (modmap->mapping[i] & virtual_mods) + { + concrete |= MODMAP_ENTRY_TO_MODIFIER (i); + } + } - *concrete_mods = concrete; + *concrete_mods = concrete; } void diff --git a/capplets/keybindings/eggcellrendererkeys.c b/capplets/keybindings/eggcellrendererkeys.c index 776a5391..5d84c2de 100644 --- a/capplets/keybindings/eggcellrendererkeys.c +++ b/capplets/keybindings/eggcellrendererkeys.c @@ -7,13 +7,13 @@ #include "eggaccelerators.h" #ifndef EGG_COMPILATION -#ifndef _ -#define _(x) dgettext (GETTEXT_PACKAGE, x) -#define N_(x) x -#endif + #ifndef _ + #define _(x) dgettext (GETTEXT_PACKAGE, x) + #define N_(x) x + #endif #else -#define _(x) x -#define N_(x) x + #define _(x) x + #define N_(x) x #endif #define EGG_CELL_RENDERER_TEXT_PATH "egg-cell-renderer-text" @@ -58,81 +58,75 @@ enum { PROP_ACCEL_MODE }; -static GtkCellRendererTextClass *parent_class = NULL; +static GtkCellRendererTextClass* parent_class = NULL; -GType -egg_cell_renderer_keys_get_type (void) +GType egg_cell_renderer_keys_get_type(void) { - static GType cell_keys_type = 0; - - if (!cell_keys_type) - { - static const GTypeInfo cell_keys_info = - { - sizeof (EggCellRendererKeysClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)egg_cell_renderer_keys_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EggCellRendererKeys), - 0, /* n_preallocs */ - (GInstanceInitFunc) egg_cell_renderer_keys_init - }; + static GType cell_keys_type = 0; - cell_keys_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "EggCellRendererKeys", &cell_keys_info, 0); - } + if (!cell_keys_type) + { + static const GTypeInfo cell_keys_info = { + sizeof (EggCellRendererKeysClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)egg_cell_renderer_keys_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EggCellRendererKeys), + 0, /* n_preallocs */ + (GInstanceInitFunc) egg_cell_renderer_keys_init + }; + + cell_keys_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "EggCellRendererKeys", &cell_keys_info, 0); + } - return cell_keys_type; + return cell_keys_type; } -static void -egg_cell_renderer_keys_init (EggCellRendererKeys *cell_keys) +static void egg_cell_renderer_keys_init(EggCellRendererKeys* cell_keys) { - cell_keys->accel_mode = EGG_CELL_RENDERER_KEYS_MODE_GTK; + cell_keys->accel_mode = EGG_CELL_RENDERER_KEYS_MODE_GTK; } /* FIXME setup stuff to generate this */ /* VOID:STRING,UINT,FLAGS,UINT */ -static void -marshal_VOID__STRING_UINT_FLAGS_UINT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) +static void marshal_VOID__STRING_UINT_FLAGS_UINT(GClosure* closure, GValue* return_value, guint n_param_values, const GValue* param_values, gpointer invocation_hint, gpointer marshal_data) { - typedef void (*GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (gpointer data1, - const char *arg_1, - guint arg_2, - int arg_3, - guint arg_4, - gpointer data2); - register GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 5); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } + /* typedef inside a function? wow */ + typedef void (*GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) ( + gpointer data1, + const char* arg_1, + guint arg_2, + int arg_3, + guint arg_4, + gpointer data2); + + register GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT callback; + register GCClosure* cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 5); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } - callback = (GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (marshal_data ? marshal_data : cc->callback); + callback = (GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (marshal_data ? marshal_data : cc->callback); - callback (data1, - g_value_get_string (param_values + 1), - g_value_get_uint (param_values + 2), - g_value_get_flags (param_values + 3), - g_value_get_uint (param_values + 4), - data2); + callback(data1, + g_value_get_string(param_values + 1), + g_value_get_uint(param_values + 2), + g_value_get_flags(param_values + 3), + g_value_get_uint(param_values + 4), + data2); } static void @@ -220,28 +214,26 @@ egg_cell_renderer_keys_class_init (EggCellRendererKeysClass *cell_keys_class) } -GtkCellRenderer * -egg_cell_renderer_keys_new (void) +GtkCellRenderer* egg_cell_renderer_keys_new(void) { - return GTK_CELL_RENDERER (g_object_new (EGG_TYPE_CELL_RENDERER_KEYS, NULL)); + return GTK_CELL_RENDERER(g_object_new(EGG_TYPE_CELL_RENDERER_KEYS, NULL)); } -static void -egg_cell_renderer_keys_finalize (GObject *object) +static void egg_cell_renderer_keys_finalize(GObject* object) { - - (* G_OBJECT_CLASS (parent_class)->finalize) (object); + (*G_OBJECT_CLASS(parent_class)->finalize)(object); } -static gchar * -convert_keysym_state_to_string (guint keysym, - guint keycode, - EggVirtualModifierType mask) +static gchar* convert_keysym_state_to_string(guint keysym, guint keycode, EggVirtualModifierType mask) { - if (keysym == 0 && keycode == 0) - return g_strdup (_("Disabled")); - else - return egg_virtual_accelerator_label (keysym, keycode, mask); + if (keysym == 0 && keycode == 0) + { + return g_strdup (_("Disabled")); + } + else + { + return egg_virtual_accelerator_label(keysym, keycode, mask); + } } static void @@ -318,31 +310,32 @@ egg_cell_renderer_keys_set_property (GObject *object, } } -static gboolean -is_modifier (guint keycode) +static gboolean is_modifier(guint keycode) { - gint i; - gint map_size; - XModifierKeymap *mod_keymap; - gboolean retval = FALSE; + gint i; + gint map_size; + XModifierKeymap* mod_keymap; + gboolean retval = FALSE; - mod_keymap = XGetModifierMapping (gdk_display); + mod_keymap = XGetModifierMapping(gdk_display); - map_size = 8 * mod_keymap->max_keypermod; - i = 0; - while (i < map_size) - { - if (keycode == mod_keymap->modifiermap[i]) - { - retval = TRUE; - break; - } - ++i; - } + map_size = 8 * mod_keymap->max_keypermod; + i = 0; + + while (i < map_size) + { + if (keycode == mod_keymap->modifiermap[i]) + { + retval = TRUE; + break; + } - XFreeModifiermap (mod_keymap); + ++i; + } + + XFreeModifiermap(mod_keymap); - return retval; + return retval; } static void @@ -374,142 +367,143 @@ egg_cell_renderer_keys_get_size (GtkCellRenderer *cell, * GTK mode) and a removed key. */ -static gboolean -grab_key_callback (GtkWidget *widget, - GdkEventKey *event, - void *data) +static gboolean grab_key_callback(GtkWidget* widget, GdkEventKey* event, void* data) { - GdkModifierType accel_mods = 0; - guint accel_keyval; - EggCellRendererKeys *keys; - char *path; - gboolean edited; - gboolean cleared; - GdkModifierType consumed_modifiers; - guint upper; - GdkModifierType ignored_modifiers; - - keys = EGG_CELL_RENDERER_KEYS (data); + GdkModifierType accel_mods = 0; + guint accel_keyval; + EggCellRendererKeys *keys; + char *path; + gboolean edited; + gboolean cleared; + GdkModifierType consumed_modifiers; + guint upper; + GdkModifierType ignored_modifiers; + + keys = EGG_CELL_RENDERER_KEYS(data); + + if (is_modifier(event->hardware_keycode)) + { + return TRUE; + } - if (is_modifier (event->hardware_keycode)) - return TRUE; + edited = FALSE; + cleared = FALSE; - edited = FALSE; - cleared = FALSE; + consumed_modifiers = 0; + gdk_keymap_translate_keyboard_state(gdk_keymap_get_default(), + event->hardware_keycode, + event->state, + event->group, + NULL, NULL, NULL, &consumed_modifiers); - consumed_modifiers = 0; - gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (), - event->hardware_keycode, - event->state, - event->group, - NULL, NULL, NULL, &consumed_modifiers); + upper = event->keyval; + accel_keyval = gdk_keyval_to_lower(upper); - upper = event->keyval; - accel_keyval = gdk_keyval_to_lower (upper); - if (accel_keyval == GDK_ISO_Left_Tab) - accel_keyval = GDK_Tab; + if (accel_keyval == GDK_ISO_Left_Tab) + { + accel_keyval = GDK_Tab; + } + /* Put shift back if it changed the case of the key, not otherwise. */ + if (upper != accel_keyval && (consumed_modifiers & GDK_SHIFT_MASK)) + { + consumed_modifiers &= ~(GDK_SHIFT_MASK); + } + egg_keymap_resolve_virtual_modifiers(gdk_keymap_get_default(), + EGG_VIRTUAL_NUM_LOCK_MASK | + EGG_VIRTUAL_SCROLL_LOCK_MASK | + EGG_VIRTUAL_LOCK_MASK, + &ignored_modifiers); + + /* http://bugzilla.gnome.org/show_bug.cgi?id=139605 + * mouse keys should effect keybindings */ + ignored_modifiers |= GDK_BUTTON1_MASK | + GDK_BUTTON2_MASK | + GDK_BUTTON3_MASK | + GDK_BUTTON4_MASK | + GDK_BUTTON5_MASK; + + /* filter consumed/ignored modifiers */ + if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK) + { + accel_mods = event->state & GDK_MODIFIER_MASK & ~(consumed_modifiers | ignored_modifiers); + } + else if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_X) + { + accel_mods = event->state & GDK_MODIFIER_MASK & ~(ignored_modifiers); + } + else + { + g_assert_not_reached(); + } - /* Put shift back if it changed the case of the key, not otherwise. - */ - if (upper != accel_keyval && - (consumed_modifiers & GDK_SHIFT_MASK)) - { - consumed_modifiers &= ~(GDK_SHIFT_MASK); - } + if (accel_mods == 0 && accel_keyval == GDK_Escape) + { + goto out; /* cancel */ + } - egg_keymap_resolve_virtual_modifiers (gdk_keymap_get_default (), - EGG_VIRTUAL_NUM_LOCK_MASK | - EGG_VIRTUAL_SCROLL_LOCK_MASK | - EGG_VIRTUAL_LOCK_MASK, - &ignored_modifiers); - - /* http://bugzilla.gnome.org/show_bug.cgi?id=139605 - * mouse keys should effect keybindings */ - ignored_modifiers |= GDK_BUTTON1_MASK | - GDK_BUTTON2_MASK | - GDK_BUTTON3_MASK | - GDK_BUTTON4_MASK | - GDK_BUTTON5_MASK; - - /* filter consumed/ignored modifiers */ - - if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK) - accel_mods = event->state & GDK_MODIFIER_MASK & ~(consumed_modifiers | ignored_modifiers); - else if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_X) - accel_mods = event->state & GDK_MODIFIER_MASK & ~(ignored_modifiers); - else - g_assert_not_reached (); - - if (accel_mods == 0 && accel_keyval == GDK_Escape) - goto out; /* cancel */ - - /* clear the accelerator on Backspace */ - if (accel_mods == 0 && accel_keyval == GDK_BackSpace) - { - cleared = TRUE; - goto out; - } + /* clear the accelerator on Backspace */ + if (accel_mods == 0 && accel_keyval == GDK_BackSpace) + { + cleared = TRUE; + goto out; + } - if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK) - { - if (!gtk_accelerator_valid (accel_keyval, accel_mods)) + if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK) { - accel_keyval = 0; - accel_mods = 0; + if (!gtk_accelerator_valid (accel_keyval, accel_mods)) + { + accel_keyval = 0; + accel_mods = 0; + } } - } - edited = TRUE; - out: - gdk_keyboard_ungrab (event->time); - gdk_pointer_ungrab (event->time); + edited = TRUE; - path = g_strdup (g_object_get_data (G_OBJECT (keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH)); + out: - gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (keys->edit_widget)); - gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (keys->edit_widget)); - keys->edit_widget = NULL; - keys->grab_widget = NULL; + gdk_keyboard_ungrab(event->time); + gdk_pointer_ungrab(event->time); - if (edited) - { - g_signal_emit_by_name (G_OBJECT (keys), "accel_edited", path, - accel_keyval, accel_mods, event->hardware_keycode); - } - else if (cleared) - { - g_signal_emit_by_name (G_OBJECT (keys), "accel_cleared", path); - } + path = g_strdup(g_object_get_data(G_OBJECT(keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH)); + + gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(keys->edit_widget)); + gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(keys->edit_widget)); + keys->edit_widget = NULL; + keys->grab_widget = NULL; - g_free (path); - return TRUE; + if (edited) + { + g_signal_emit_by_name(G_OBJECT(keys), "accel_edited", path, accel_keyval, accel_mods, event->hardware_keycode); + } + else if (cleared) + { + g_signal_emit_by_name(G_OBJECT(keys), "accel_cleared", path); + } + + g_free (path); + return TRUE; } -static void -ungrab_stuff (GtkWidget *widget, gpointer data) +static void ungrab_stuff(GtkWidget* widget, gpointer data) { - EggCellRendererKeys *keys = EGG_CELL_RENDERER_KEYS (data); + EggCellRendererKeys* keys = EGG_CELL_RENDERER_KEYS(data); - gdk_keyboard_ungrab (GDK_CURRENT_TIME); - gdk_pointer_ungrab (GDK_CURRENT_TIME); + gdk_keyboard_ungrab(GDK_CURRENT_TIME); + gdk_pointer_ungrab(GDK_CURRENT_TIME); - g_signal_handlers_disconnect_by_func (G_OBJECT (keys->grab_widget), - G_CALLBACK (grab_key_callback), data); + g_signal_handlers_disconnect_by_func(G_OBJECT(keys->grab_widget), G_CALLBACK(grab_key_callback), data); } -static void -pointless_eventbox_start_editing (GtkCellEditable *cell_editable, - GdkEvent *event) +static void pointless_eventbox_start_editing(GtkCellEditable* cell_editable, GdkEvent* event) { - /* do nothing, because we are pointless */ + /* do nothing, because we are pointless */ } -static void -pointless_eventbox_cell_editable_init (GtkCellEditableIface *iface) +static void pointless_eventbox_cell_editable_init(GtkCellEditableIface* iface) { - iface->start_editing = pointless_eventbox_start_editing; + iface->start_editing = pointless_eventbox_start_editing; } static GType @@ -623,73 +617,69 @@ egg_cell_renderer_keys_start_editing (GtkCellRenderer *cell, return GTK_CELL_EDITABLE (keys->edit_widget); } -void -egg_cell_renderer_keys_set_accelerator (EggCellRendererKeys *keys, - guint keyval, - guint keycode, - EggVirtualModifierType mask) +void egg_cell_renderer_keys_set_accelerator(EggCellRendererKeys* keys, guint keyval, guint keycode, EggVirtualModifierType mask) { - char *text; - gboolean changed; + char *text; + gboolean changed; - g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys)); + g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys)); - g_object_freeze_notify (G_OBJECT (keys)); + g_object_freeze_notify (G_OBJECT (keys)); - changed = FALSE; + changed = FALSE; - if (keyval != keys->accel_key) - { - keys->accel_key = keyval; - g_object_notify (G_OBJECT (keys), "accel_key"); - changed = TRUE; - } + if (keyval != keys->accel_key) + { + keys->accel_key = keyval; + g_object_notify (G_OBJECT (keys), "accel_key"); + changed = TRUE; + } - if (mask != keys->accel_mask) - { - keys->accel_mask = mask; + if (mask != keys->accel_mask) + { + keys->accel_mask = mask; - g_object_notify (G_OBJECT (keys), "accel_mask"); - changed = TRUE; - } + g_object_notify (G_OBJECT (keys), "accel_mask"); + changed = TRUE; + } - if (keycode != keys->keycode) - { - keys->keycode = keycode; + if (keycode != keys->keycode) + { + keys->keycode = keycode; - g_object_notify (G_OBJECT (keys), "keycode"); - changed = TRUE; - } - g_object_thaw_notify (G_OBJECT (keys)); + g_object_notify (G_OBJECT (keys), "keycode"); + changed = TRUE; + } - if (changed) - { - /* sync string to the key values */ - text = convert_keysym_state_to_string (keys->accel_key, keys->keycode, keys->accel_mask); - g_object_set (keys, "text", text, NULL); - g_free (text); - } + g_object_thaw_notify (G_OBJECT (keys)); + + if (changed) + { + /* sync string to the key values */ + text = convert_keysym_state_to_string (keys->accel_key, keys->keycode, keys->accel_mask); + g_object_set (keys, "text", text, NULL); + g_free (text); + } } -void -egg_cell_renderer_keys_get_accelerator (EggCellRendererKeys *keys, - guint *keyval, - EggVirtualModifierType *mask) +void egg_cell_renderer_keys_get_accelerator(EggCellRendererKeys* keys, guint* keyval, EggVirtualModifierType* mask) { - g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys)); + g_return_if_fail(EGG_IS_CELL_RENDERER_KEYS(keys)); - if (keyval) - *keyval = keys->accel_key; + if (keyval) + { + *keyval = keys->accel_key; + } - if (mask) - *mask = keys->accel_mask; + if (mask) + { + *mask = keys->accel_mask; + } } -void -egg_cell_renderer_keys_set_accel_mode (EggCellRendererKeys *keys, - EggCellRendererKeysMode accel_mode) +void egg_cell_renderer_keys_set_accel_mode (EggCellRendererKeys* keys, EggCellRendererKeysMode accel_mode) { - g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys)); - keys->accel_mode = accel_mode; - g_object_notify (G_OBJECT (keys), "accel_mode"); + g_return_if_fail(EGG_IS_CELL_RENDERER_KEYS(keys)); + keys->accel_mode = accel_mode; + g_object_notify(G_OBJECT(keys), "accel_mode"); } diff --git a/capplets/keybindings/mate-keybinding-properties.c b/capplets/keybindings/mate-keybinding-properties.c index fb6c8785..b0ac2f7f 100644 --- a/capplets/keybindings/mate-keybinding-properties.c +++ b/capplets/keybindings/mate-keybinding-properties.c @@ -82,10 +82,9 @@ static GtkWidget *custom_shortcut_dialog = NULL; static GtkWidget *custom_shortcut_name_entry = NULL; static GtkWidget *custom_shortcut_command_entry = NULL; -static GtkWidget* -_gtk_builder_get_widget (GtkBuilder *builder, const gchar *name) +static GtkWidget* _gtk_builder_get_widget(GtkBuilder* builder, const gchar* name) { - return GTK_WIDGET (gtk_builder_get_object (builder, name)); + return GTK_WIDGET (gtk_builder_get_object (builder, name)); } static GtkBuilder * @@ -105,18 +104,23 @@ create_builder (void) return builder; } -static char* -binding_name (guint keyval, - guint keycode, - EggVirtualModifierType mask, - gboolean translate) +static char* binding_name(guint keyval, guint keycode, EggVirtualModifierType mask, gboolean translate) { - if (keyval != 0 || keycode != 0) - return translate ? - egg_virtual_accelerator_label (keyval, keycode, mask) : - egg_virtual_accelerator_name (keyval, keycode, mask); - else - return g_strdup (translate ? _("Disabled") : ""); + if (keyval != 0 || keycode != 0) + { + if (translate) + { + return egg_virtual_accelerator_label (keyval, keycode, mask); + } + else + { + return egg_virtual_accelerator_name (keyval, keycode, mask); + } + } + else + { + return g_strdup (translate ? _("Disabled") : ""); + } } static gboolean @@ -421,72 +425,78 @@ typedef struct { gboolean found; } KeyMatchData; -static gboolean -key_match (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +static gboolean key_match(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer data) { - KeyMatchData *match_data = data; - KeyEntry *element; + KeyMatchData* match_data = data; + KeyEntry* element; - gtk_tree_model_get (model, iter, - KEYENTRY_COLUMN, &element, - -1); + gtk_tree_model_get(model, iter, + KEYENTRY_COLUMN, &element, + -1); - if (element && g_strcmp0 (element->mateconf_key, match_data->key) == 0) - { - match_data->found = TRUE; - return TRUE; - } + if (element && g_strcmp0(element->mateconf_key, match_data->key) == 0) + { + match_data->found = TRUE; + return TRUE; + } - return FALSE; + return FALSE; } -static gboolean -key_is_already_shown (GtkTreeModel *model, const KeyListEntry *entry) +static gboolean key_is_already_shown(GtkTreeModel* model, const KeyListEntry* entry) { - KeyMatchData data; + KeyMatchData data; - data.key = entry->name; - data.found = FALSE; - gtk_tree_model_foreach (model, key_match, &data); + data.key = entry->name; + data.found = FALSE; + gtk_tree_model_foreach(model, key_match, &data); - return data.found; + return data.found; } -static gboolean -should_show_key (const KeyListEntry *entry) +static gboolean should_show_key(const KeyListEntry* entry) { - int value; - MateConfClient *client; + int value; + MateConfClient *client; - if (entry->comparison == COMPARISON_NONE) - return TRUE; + if (entry->comparison == COMPARISON_NONE) + { + return TRUE; + } - g_return_val_if_fail (entry->key != NULL, FALSE); + g_return_val_if_fail(entry->key != NULL, FALSE); - client = mateconf_client_get_default(); - value = mateconf_client_get_int (client, entry->key, NULL); - g_object_unref (client); + client = mateconf_client_get_default(); + value = mateconf_client_get_int (client, entry->key, NULL); + g_object_unref (client); - switch (entry->comparison) { - case COMPARISON_NONE: - /* For compiler warnings */ - g_assert_not_reached (); - return FALSE; - case COMPARISON_GT: - if (value > entry->value) - return TRUE; - break; - case COMPARISON_LT: - if (value < entry->value) - return TRUE; - break; - case COMPARISON_EQ: - if (value == entry->value) - return TRUE; - break; - } + switch (entry->comparison) + { + case COMPARISON_NONE: + /* For compiler warnings */ + g_assert_not_reached (); + return FALSE; + case COMPARISON_GT: + if (value > entry->value) + { + return TRUE; + } + break; + case COMPARISON_LT: + if (value < entry->value) + { + return TRUE; + } + break; + case COMPARISON_EQ: + if (value == entry->value) + { + return TRUE; + } + break; + } - return FALSE; + return FALSE; } static gboolean @@ -1015,73 +1025,78 @@ key_entry_controlling_key_changed (MateConfClient *client, reload_key_entries (user_data); } -static gboolean -cb_check_for_uniqueness (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - KeyEntry *new_key) +static gboolean cb_check_for_uniqueness(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, KeyEntry* new_key) { - KeyEntry *element; + KeyEntry* element; - gtk_tree_model_get (new_key->model, iter, - KEYENTRY_COLUMN, &element, - -1); + gtk_tree_model_get (new_key->model, iter, + KEYENTRY_COLUMN, &element, + -1); - /* no conflict for : blanks, different modifiers, or ourselves */ - if (element == NULL || new_key->mask != element->mask || - !strcmp (new_key->mateconf_key, element->mateconf_key)) - return FALSE; + /* no conflict for : blanks, different modifiers, or ourselves */ + if (element == NULL || new_key->mask != element->mask || + !strcmp (new_key->mateconf_key, element->mateconf_key)) + { + return FALSE; + } - if (new_key->keyval != 0) { - if (new_key->keyval != element->keyval) - return FALSE; - } else if (element->keyval != 0 || new_key->keycode != element->keycode) - return FALSE; + if (new_key->keyval != 0) + { + if (new_key->keyval != element->keyval) + { + return FALSE; + } + } + else if (element->keyval != 0 || new_key->keycode != element->keycode) + { + return FALSE; + } - new_key->editable = FALSE; - new_key->mateconf_key = element->mateconf_key; - new_key->description = element->description; - new_key->desc_mateconf_key = element->desc_mateconf_key; - new_key->desc_editable = element->desc_editable; - return TRUE; + new_key->editable = FALSE; + new_key->mateconf_key = element->mateconf_key; + new_key->description = element->description; + new_key->desc_mateconf_key = element->desc_mateconf_key; + new_key->desc_editable = element->desc_editable; + + return TRUE; } static const guint forbidden_keyvals[] = { - /* Navigation keys */ - GDK_Home, - GDK_Left, - GDK_Up, - GDK_Right, - GDK_Down, - GDK_Page_Up, - GDK_Page_Down, - GDK_End, - GDK_Tab, - - /* Return */ - GDK_KP_Enter, - GDK_Return, - - GDK_space, - GDK_Mode_switch + /* Navigation keys */ + GDK_Home, + GDK_Left, + GDK_Up, + GDK_Right, + GDK_Down, + GDK_Page_Up, + GDK_Page_Down, + GDK_End, + GDK_Tab, + + /* Return */ + GDK_KP_Enter, + GDK_Return, + + GDK_space, + GDK_Mode_switch }; -static gboolean -keyval_is_forbidden (guint keyval) +static gboolean keyval_is_forbidden(guint keyval) { - guint i; + guint i; - for (i = 0; i < G_N_ELEMENTS(forbidden_keyvals); i++) { - if (keyval == forbidden_keyvals[i]) - return TRUE; - } + for (i = 0; i < G_N_ELEMENTS(forbidden_keyvals); i++) + { + if (keyval == forbidden_keyvals[i]) + { + return TRUE; + } + } - return FALSE; + return FALSE; } -static void -show_error (GtkWindow *parent, - GError *err) +static void show_error(GtkWindow* parent, GError* err) { GtkWidget *dialog; @@ -1097,24 +1112,18 @@ show_error (GtkWindow *parent, gtk_widget_destroy (dialog); } -static void -accel_edited_callback (GtkCellRendererText *cell, - const char *path_string, - guint keyval, - EggVirtualModifierType mask, - guint keycode, - gpointer data) +static void accel_edited_callback(GtkCellRendererText* cell, const char* path_string, guint keyval, EggVirtualModifierType mask, guint keycode, gpointer data) { - MateConfClient *client; - GtkTreeView *view = (GtkTreeView *)data; - GtkTreeModel *model; - GtkTreePath *path = gtk_tree_path_new_from_string (path_string); - GtkTreeIter iter; - KeyEntry *key_entry, tmp_key; - GError *err = NULL; - char *str; + MateConfClient* client; + GtkTreeView* view = (GtkTreeView*) data; + GtkTreeModel* model; + GtkTreePath* path = gtk_tree_path_new_from_string (path_string); + GtkTreeIter iter; + KeyEntry* key_entry, tmp_key; + GError* err = NULL; + char* str; - block_accels = FALSE; + block_accels = FALSE; model = gtk_tree_view_get_model (view); gtk_tree_model_get_iter (model, &iter, path); @@ -1123,171 +1132,172 @@ accel_edited_callback (GtkCellRendererText *cell, KEYENTRY_COLUMN, &key_entry, -1); - /* sanity check */ - if (key_entry == NULL) - return; - - /* CapsLock isn't supported as a keybinding modifier, so keep it from confusing us */ - mask &= ~EGG_VIRTUAL_LOCK_MASK; + /* sanity check */ + if (key_entry == NULL) + { + return; + } - tmp_key.model = model; - tmp_key.keyval = keyval; - tmp_key.keycode = keycode; - tmp_key.mask = mask; - tmp_key.mateconf_key = key_entry->mateconf_key; - tmp_key.description = NULL; - tmp_key.editable = TRUE; /* kludge to stuff in a return flag */ + /* CapsLock isn't supported as a keybinding modifier, so keep it from confusing us */ + mask &= ~EGG_VIRTUAL_LOCK_MASK; - if (keyval != 0 || keycode != 0) /* any number of keys can be disabled */ - gtk_tree_model_foreach (model, - (GtkTreeModelForeachFunc) cb_check_for_uniqueness, - &tmp_key); + tmp_key.model = model; + tmp_key.keyval = keyval; + tmp_key.keycode = keycode; + tmp_key.mask = mask; + tmp_key.mateconf_key = key_entry->mateconf_key; + tmp_key.description = NULL; + tmp_key.editable = TRUE; /* kludge to stuff in a return flag */ - /* Check for unmodified keys */ - if (tmp_key.mask == 0 && tmp_key.keycode != 0) - { - if ((tmp_key.keyval >= GDK_a && tmp_key.keyval <= GDK_z) - || (tmp_key.keyval >= GDK_A && tmp_key.keyval <= GDK_Z) - || (tmp_key.keyval >= GDK_0 && tmp_key.keyval <= GDK_9) - || (tmp_key.keyval >= GDK_kana_fullstop && tmp_key.keyval <= GDK_semivoicedsound) - || (tmp_key.keyval >= GDK_Arabic_comma && tmp_key.keyval <= GDK_Arabic_sukun) - || (tmp_key.keyval >= GDK_Serbian_dje && tmp_key.keyval <= GDK_Cyrillic_HARDSIGN) - || (tmp_key.keyval >= GDK_Greek_ALPHAaccent && tmp_key.keyval <= GDK_Greek_omega) - || (tmp_key.keyval >= GDK_hebrew_doublelowline && tmp_key.keyval <= GDK_hebrew_taf) - || (tmp_key.keyval >= GDK_Thai_kokai && tmp_key.keyval <= GDK_Thai_lekkao) - || (tmp_key.keyval >= GDK_Hangul && tmp_key.keyval <= GDK_Hangul_Special) - || (tmp_key.keyval >= GDK_Hangul_Kiyeog && tmp_key.keyval <= GDK_Hangul_J_YeorinHieuh) - || keyval_is_forbidden (tmp_key.keyval)) { - GtkWidget *dialog; - char *name; - - name = binding_name (keyval, keycode, mask, TRUE); - - dialog = - gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CANCEL, - _("The shortcut \"%s\" cannot be used because it will become impossible to type using this key.\n" - "Please try with a key such as Control, Alt or Shift at the same time."), - name); - - g_free (name); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - /* set it back to its previous value. */ - egg_cell_renderer_keys_set_accelerator - (EGG_CELL_RENDERER_KEYS (cell), - key_entry->keyval, key_entry->keycode, key_entry->mask); - return; - } - } + if (keyval != 0 || keycode != 0) /* any number of keys can be disabled */ + { + gtk_tree_model_foreach(model, (GtkTreeModelForeachFunc) cb_check_for_uniqueness, &tmp_key); + } - /* flag to see if the new accelerator was in use by something */ - if (!tmp_key.editable) + /* Check for unmodified keys */ + if (tmp_key.mask == 0 && tmp_key.keycode != 0) { - GtkWidget *dialog; - char *name; - int response; - - name = binding_name (keyval, keycode, mask, TRUE); - - dialog = - gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), + if ((tmp_key.keyval >= GDK_a && tmp_key.keyval <= GDK_z) + || (tmp_key.keyval >= GDK_A && tmp_key.keyval <= GDK_Z) + || (tmp_key.keyval >= GDK_0 && tmp_key.keyval <= GDK_9) + || (tmp_key.keyval >= GDK_kana_fullstop && tmp_key.keyval <= GDK_semivoicedsound) + || (tmp_key.keyval >= GDK_Arabic_comma && tmp_key.keyval <= GDK_Arabic_sukun) + || (tmp_key.keyval >= GDK_Serbian_dje && tmp_key.keyval <= GDK_Cyrillic_HARDSIGN) + || (tmp_key.keyval >= GDK_Greek_ALPHAaccent && tmp_key.keyval <= GDK_Greek_omega) + || (tmp_key.keyval >= GDK_hebrew_doublelowline && tmp_key.keyval <= GDK_hebrew_taf) + || (tmp_key.keyval >= GDK_Thai_kokai && tmp_key.keyval <= GDK_Thai_lekkao) + || (tmp_key.keyval >= GDK_Hangul && tmp_key.keyval <= GDK_Hangul_Special) + || (tmp_key.keyval >= GDK_Hangul_Kiyeog && tmp_key.keyval <= GDK_Hangul_J_YeorinHieuh) + || keyval_is_forbidden (tmp_key.keyval)) + { + + GtkWidget *dialog; + char *name; + + name = binding_name (keyval, keycode, mask, TRUE); + + dialog = gtk_message_dialog_new ( + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CANCEL, - _("The shortcut \"%s\" is already used for\n\"%s\""), - name, tmp_key.description ? - tmp_key.description : tmp_key.mateconf_key); - g_free (name); - - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - _("If you reassign the shortcut to \"%s\", the \"%s\" shortcut " - "will be disabled."), - key_entry->description ? - key_entry->description : key_entry->mateconf_key, - tmp_key.description ? - tmp_key.description : tmp_key.mateconf_key); - - gtk_dialog_add_button (GTK_DIALOG (dialog), - _("_Reassign"), - GTK_RESPONSE_ACCEPT); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), - GTK_RESPONSE_ACCEPT); - - response = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); + _("The shortcut \"%s\" cannot be used because it will become impossible to type using this key.\n" + "Please try with a key such as Control, Alt or Shift at the same time."), + name); + + g_free (name); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + /* set it back to its previous value. */ + egg_cell_renderer_keys_set_accelerator( + EGG_CELL_RENDERER_KEYS(cell), + key_entry->keyval, + key_entry->keycode, + key_entry->mask); + return; + } + } - if (response == GTK_RESPONSE_ACCEPT) + /* flag to see if the new accelerator was in use by something */ + if (!tmp_key.editable) { - MateConfClient *client; - - client = mateconf_client_get_default (); + GtkWidget* dialog; + char* name; + int response; + + name = binding_name(keyval, keycode, mask, TRUE); + + dialog = gtk_message_dialog_new( + GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))), + GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CANCEL, + _("The shortcut \"%s\" is already used for\n\"%s\""), + name, + tmp_key.description ? tmp_key.description : tmp_key.mateconf_key); + g_free (name); + + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("If you reassign the shortcut to \"%s\", the \"%s\" shortcut " + "will be disabled."), + key_entry->description ? key_entry->description : key_entry->mateconf_key, + tmp_key.description ? tmp_key.description : tmp_key.mateconf_key); + + gtk_dialog_add_button(GTK_DIALOG (dialog), _("_Reassign"), GTK_RESPONSE_ACCEPT); + + gtk_dialog_set_default_response(GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + if (response == GTK_RESPONSE_ACCEPT) + { + MateConfClient* client; + + client = mateconf_client_get_default (); + + mateconf_client_set_string( + client, + tmp_key.mateconf_key, + "", + &err); + + if (err != NULL) + { + show_error(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), err); + g_error_free (err); + g_object_unref (client); + return; + } + + str = binding_name (keyval, keycode, mask, FALSE); + mateconf_client_set_string (client, key_entry->mateconf_key, str, &err); + + if (err != NULL) + { + show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), err); + g_error_free (err); + + /* reset the previous shortcut */ + mateconf_client_set_string (client, tmp_key.mateconf_key, str, NULL); + } + + g_free (str); + g_object_unref (client); + } + else + { + /* set it back to its previous value. */ + egg_cell_renderer_keys_set_accelerator( + EGG_CELL_RENDERER_KEYS(cell), + key_entry->keyval, + key_entry->keycode, + key_entry->mask); + } + + return; + } - mateconf_client_set_string (client, - tmp_key.mateconf_key, - "", &err); + str = binding_name (keyval, keycode, mask, FALSE); - if (err != NULL) - { - show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), - err); - g_error_free (err); - g_object_unref (client); - return; - } + client = mateconf_client_get_default (); + mateconf_client_set_string( + client, + key_entry->mateconf_key, + str, + &err); - str = binding_name (keyval, keycode, mask, FALSE); - mateconf_client_set_string (client, - key_entry->mateconf_key, - str, &err); + g_free (str); + g_object_unref (client); - if (err != NULL) - { - show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), - err); - g_error_free (err); - - /* reset the previous shortcut */ - mateconf_client_set_string (client, - tmp_key.mateconf_key, - str, NULL); - } - - g_free (str); - g_object_unref (client); - } - else + if (err != NULL) { - /* set it back to its previous value. */ - egg_cell_renderer_keys_set_accelerator (EGG_CELL_RENDERER_KEYS (cell), - key_entry->keyval, - key_entry->keycode, - key_entry->mask); + show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), err); + g_error_free (err); + key_entry->editable = FALSE; } - - return; - } - - str = binding_name (keyval, keycode, mask, FALSE); - - client = mateconf_client_get_default (); - mateconf_client_set_string (client, - key_entry->mateconf_key, - str, - &err); - g_free (str); - g_object_unref (client); - - if (err != NULL) - { - show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))), err); - g_error_free (err); - key_entry->editable = FALSE; - } } static void @@ -1733,16 +1743,14 @@ start_editing_cb (GtkTreeView *tree_view, /* this handler is used to keep accels from activating while the user * is assigning a new shortcut so that he won't accidentally trigger one * of the widgets */ -static gboolean -maybe_block_accels (GtkWidget *widget, - GdkEventKey *event, - gpointer user_data) +static gboolean maybe_block_accels(GtkWidget* widget, GdkEventKey* event, gpointer user_data) { - if (block_accels) - { - return gtk_window_propagate_key_event (GTK_WINDOW (widget), event); - } - return FALSE; + if (block_accels) + { + return gtk_window_propagate_key_event(GTK_WINDOW(widget), event); + } + + return FALSE; } static void diff --git a/capplets/keyboard/mate-keyboard-properties-xkb.c b/capplets/keyboard/mate-keyboard-properties-xkb.c index 3316b4d4..6df6b16a 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkb.c +++ b/capplets/keyboard/mate-keyboard-properties-xkb.c @@ -170,7 +170,7 @@ setup_xkb_tabs (GtkBuilder * dialog, MateConfChangeSet * changeset) xkb_mateconf_client = mateconf_client_get_default (); - engine = xkl_engine_get_instance (GDK_DISPLAY ()); + engine = xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY(gdk_display_get_default())); config_registry = xkl_config_registry_get_instance (engine); matekbd_desktop_config_init (&desktop_config, xkb_mateconf_client, diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index 8e9824b9..35e6e0f8 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -88,11 +88,11 @@ get_default_mouse_info (int *default_numerator, int *default_denominator, int *d int tmp_num, tmp_den, tmp_threshold; /* Query X for the default value */ - XGetPointerControl (GDK_DISPLAY (), &numerator, &denominator, + XGetPointerControl (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &numerator, &denominator, &threshold); - XChangePointerControl (GDK_DISPLAY (), True, True, -1, -1, -1); - XGetPointerControl (GDK_DISPLAY (), &tmp_num, &tmp_den, &tmp_threshold); - XChangePointerControl (GDK_DISPLAY (), True, True, numerator, denominator, threshold); + XChangePointerControl (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), True, True, -1, -1, -1); + XGetPointerControl (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &tmp_num, &tmp_den, &tmp_threshold); + XChangePointerControl (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), True, True, numerator, denominator, threshold); if (default_numerator) *default_numerator = tmp_num; @@ -338,23 +338,23 @@ synaptics_check_capabilities (GtkBuilder *dialog) unsigned long nitems, bytes_after; unsigned char *data; - prop = XInternAtom (GDK_DISPLAY (), "Synaptics Capabilities", True); + prop = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "Synaptics Capabilities", True); if (!prop) return; - devicelist = XListInputDevices (GDK_DISPLAY (), &numdevices); + devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &numdevices); for (i = 0; i < numdevices; i++) { if (devicelist[i].use != IsXExtensionPointer) continue; gdk_error_trap_push (); - XDevice *device = XOpenDevice (GDK_DISPLAY (), + XDevice *device = XOpenDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), devicelist[i].id); if (gdk_error_trap_pop ()) continue; gdk_error_trap_push (); - if ((XGetDeviceProperty (GDK_DISPLAY (), device, prop, 0, 2, False, + if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device, prop, 0, 2, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { /* Property data is booleans for has_left, has_middle, @@ -371,7 +371,7 @@ synaptics_check_capabilities (GtkBuilder *dialog) } gdk_error_trap_pop (); - XCloseDevice (GDK_DISPLAY (), device); + XCloseDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device); } XFreeDeviceList (devicelist); #endif @@ -391,30 +391,30 @@ find_synaptics (void) XExtensionVersion *version; /* Input device properties require version 1.5 or higher */ - version = XGetExtensionVersion (GDK_DISPLAY (), "XInputExtension"); + version = XGetExtensionVersion (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "XInputExtension"); if (!version->present || (version->major_version * 1000 + version->minor_version) < 1005) { XFree (version); return False; } - prop = XInternAtom (GDK_DISPLAY (), "Synaptics Off", True); + prop = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "Synaptics Off", True); if (!prop) return False; - devicelist = XListInputDevices (GDK_DISPLAY (), &numdevices); + devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &numdevices); for (i = 0; i < numdevices; i++) { if (devicelist[i].use != IsXExtensionPointer) continue; gdk_error_trap_push(); - XDevice *device = XOpenDevice (GDK_DISPLAY (), + XDevice *device = XOpenDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), devicelist[i].id); if (gdk_error_trap_pop ()) continue; gdk_error_trap_push (); - if ((XGetDeviceProperty (GDK_DISPLAY (), device, prop, 0, 1, False, + if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device, prop, 0, 1, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { XFree (data); @@ -422,7 +422,7 @@ find_synaptics (void) } gdk_error_trap_pop (); - XCloseDevice (GDK_DISPLAY (), device); + XCloseDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device); if (ret) break; diff --git a/configure.ac b/configure.ac index a54138b6..16729b5d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mate-control-center], [2011.12.01], [https://github.com/perberos/mate-desktop-environment]) +AC_INIT([mate-control-center], [1.1.0], [htts://www.mate-desktop.org/]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([shell]) @@ -120,14 +120,14 @@ COMMON_MODULES="gtk+-2.0 >= 2.20.0 dnl gio-2.0 dnl mateconf-2.0 dnl libxml-2.0 dnl - mate-desktop-2.0 >= 2.29.4" + mate-desktop-2.0" PKG_CHECK_MODULES(CAPPLET, $COMMON_MODULES) -PKG_CHECK_MODULES(MATECC, $COMMON_MODULES libmate-menu >= 2.10.1) +PKG_CHECK_MODULES(MATECC, $COMMON_MODULES libmate-menu >= 1.1.0) PKG_CHECK_MODULES(MATECC_SHELL, $COMMON_MODULES libmate-menu unique-1.0) PKG_CHECK_MODULES(DBUS, dbus-1 dbus-glib-1) PKG_CHECK_MODULES(MATE_DESKTOP, mate-desktop-2.0) PKG_CHECK_MODULES(DEFAULT_APPLICATIONS_CAPPLET, libxml-2.0) -PKG_CHECK_MODULES(MARCO, libmarco-private >= 2.23.1) +PKG_CHECK_MODULES(MARCO, libmarco-private >= 1.1.0) PKG_CHECK_MODULES(TYPING, glib-2.0 > 2.11 mateconf-2.0 gtk+-2.0) PKG_CHECK_MODULES(GSD_DBUS, mate-settings-daemon) PKG_CHECK_MODULES(GIO, gio-2.0) @@ -231,11 +231,11 @@ CAPPLET_LIBS="$CAPPLET_LIBS $XINPUT_LIBS" dnl ============== dnl gswitchit dnl ============== -PKG_CHECK_MODULES(LIBMATEKBD, [libmatekbd >= 2.31.1 libxklavier >= 4.0]) +PKG_CHECK_MODULES(LIBMATEKBD, [libmatekbd >= 1.1.0 libxklavier >= 4.0]) AC_SUBST(LIBMATEKBD_CFLAGS) AC_SUBST(LIBMATEKBD_LIBS) -PKG_CHECK_MODULES(LIBMATEKBDUI, [libmatekbdui >= 2.31.2]) +PKG_CHECK_MODULES(LIBMATEKBDUI, [libmatekbdui >= 1.1.0]) AC_SUBST(LIBMATEKBDUI_CFLAGS) AC_SUBST(LIBMATEKBDUI_LIBS) diff --git a/distro/archlinux/PKGBUILD b/distro/archlinux/PKGBUILD index e4b1cf00..5cc35e2c 100644 --- a/distro/archlinux/PKGBUILD +++ b/distro/archlinux/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mate-control-center -pkgver=2011.12.01 +pkgver=1.1.0 pkgrel=1 pkgdesc="The Control Center for MATE" arch=('i686' 'x86_64') diff --git a/distro/ubuntu/build b/distro/ubuntu/build index 2ac9e5bf..cf538273 100755 --- a/distro/ubuntu/build +++ b/distro/ubuntu/build @@ -2,7 +2,7 @@ # fill it pkgname=mate-control-center -pkgver=2011.12.01 +pkgver=1.1.0 pkgrel=1 pkgdesc="The Control Center for MATE" #depends="mate-window-manager, libxss, desktop-file-utils, mate-settings-daemon, libmatekbd, libcanberra, sound-theme-freedesktop, libunique, mate-menus, librsvg" diff --git a/libwindow-settings/mate-wm-manager.c b/libwindow-settings/mate-wm-manager.c index 04097146..3c0d5776 100644 --- a/libwindow-settings/mate-wm-manager.c +++ b/libwindow-settings/mate-wm-manager.c @@ -64,7 +64,7 @@ wm_free (AvailableWindowManager *wm) g_free (wm->config_tryexec); g_free (wm->module); g_free (wm->identify_name); - + g_free (wm); } @@ -87,15 +87,15 @@ list_desktop_files_in_dir (gchar *directory) suffix = child->d_name + strlen (child->d_name) - 8; /* strlen(".desktop") == 8 */ - if (suffix <= child->d_name || + if (suffix <= child->d_name || strcmp (suffix, ".desktop") != 0) continue; - - result = g_list_prepend (result, + + result = g_list_prepend (result, g_build_filename (directory, child->d_name, NULL)); } closedir (dir); - + return result; } @@ -106,7 +106,7 @@ wm_compare (gconstpointer a, gconstpointer b) const AvailableWindowManager *wm_b = (const AvailableWindowManager *)b; /* mmm, sloooow */ - + return g_utf8_collate (mate_desktop_item_get_string (wm_a->ditem, MATE_DESKTOP_ITEM_NAME), mate_desktop_item_get_string (wm_b->ditem, MATE_DESKTOP_ITEM_NAME)); } @@ -117,9 +117,9 @@ wm_load (const char *desktop_file, { gchar *path; AvailableWindowManager *wm; - + wm = g_new0 (AvailableWindowManager, 1); - + wm->ditem = mate_desktop_item_new_from_file (desktop_file, 0, NULL); if (wm->ditem == NULL) { @@ -131,10 +131,10 @@ wm_load (const char *desktop_file, wm->exec = g_strdup (mate_desktop_item_get_string (wm->ditem, MATE_DESKTOP_ITEM_EXEC)); - + wm->name = g_strdup (mate_desktop_item_get_string (wm->ditem, MATE_DESKTOP_ITEM_NAME)); - + wm->config_exec = g_strdup (mate_desktop_item_get_string (wm->ditem, "ConfigExec")); wm->config_tryexec = g_strdup (mate_desktop_item_get_string (wm->ditem, @@ -147,14 +147,14 @@ wm_load (const char *desktop_file, wm->identify_name = g_strdup (mate_desktop_item_get_string (wm->ditem, "X-MATE-WMName")); - + wm->is_user = is_user; - + if (mate_desktop_item_get_string (wm->ditem, MATE_DESKTOP_ITEM_EXEC)) { const char *tryexec; tryexec = mate_desktop_item_get_string (wm->ditem, MATE_DESKTOP_ITEM_TRY_EXEC); - + if (tryexec) { path = g_find_program_in_path (tryexec); wm->is_present = (path != NULL); @@ -164,7 +164,7 @@ wm_load (const char *desktop_file, wm->is_present = TRUE; } else wm->is_present = FALSE; - + if (wm->config_exec) { if (wm->config_tryexec) { path = g_find_program_in_path (wm->config_tryexec); @@ -202,10 +202,10 @@ scan_wm_directory (gchar *directory, gboolean is_user) AvailableWindowManager *wm; wm = wm_load (tmp_list->data, is_user); - + if (wm != NULL) available_wms = g_list_prepend (available_wms, wm); - + tmp_list = tmp_list->next; } @@ -213,26 +213,26 @@ scan_wm_directory (gchar *directory, gboolean is_user) g_list_free (files); } -void -mate_wm_manager_init (void) +void mate_wm_manager_init(void) { - char *tempdir; + char* tempdir; - if (done_scan) - return; + if (done_scan) + { + return; + } - done_scan = TRUE; - - tempdir = g_build_filename (MATE_WM_PROPERTY_PATH, NULL); - scan_wm_directory (tempdir, FALSE); - g_free (tempdir); + done_scan = TRUE; - tempdir = g_build_filename (g_get_home_dir(), ".mate2", "wm-properties", NULL); - scan_wm_directory (tempdir, TRUE); - g_free (tempdir); + tempdir = g_build_filename(MATE_WM_PROPERTY_PATH, NULL); + scan_wm_directory(tempdir, FALSE); + g_free(tempdir); - available_wms = g_list_sort (available_wms, - wm_compare); + tempdir = g_build_filename(g_get_home_dir(), ".config", "mate", "wm-properties", NULL); + scan_wm_directory(tempdir, TRUE); + g_free(tempdir); + + available_wms = g_list_sort(available_wms, wm_compare); } static AvailableWindowManager* @@ -241,13 +241,13 @@ get_current_wm (GdkScreen *screen) AvailableWindowManager *current_wm; const char *name; GList *tmp_list; - + g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); - + name = gdk_x11_screen_get_window_manager_name (screen); current_wm = NULL; - + tmp_list = available_wms; while (tmp_list != NULL) { AvailableWindowManager *wm = tmp_list->data; @@ -264,11 +264,11 @@ get_current_wm (GdkScreen *screen) /* Try with localized name, sort of crackrock * back compat hack */ - + tmp_list = available_wms; while (tmp_list != NULL) { AvailableWindowManager *wm = tmp_list->data; - + if (strcmp (wm->name, name) == 0) { current_wm = wm; break; @@ -301,16 +301,16 @@ mate_wm_manager_spawn_config_tool_for_current (GdkScreen *screen, AvailableWindowManager *wm; wm = get_current_wm (screen); - + if (wm != NULL && wm->config_exec != NULL) { return g_spawn_command_line_async (wm->config_exec, error); } else { const char *name; - + name = gdk_x11_screen_get_window_manager_name (screen); - g_set_error (error, + g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, _("Window manager \"%s\" has not registered a configuration tool\n"), diff --git a/typing-break/drw-monitor.c b/typing-break/drw-monitor.c index 5f0270c0..c4dd348a 100644 --- a/typing-break/drw-monitor.c +++ b/typing-break/drw-monitor.c @@ -146,7 +146,7 @@ drw_monitor_timeout (DrwMonitor *monitor) priv = monitor->priv; - if (XScreenSaverQueryInfo (GDK_DISPLAY (), DefaultRootWindow (GDK_DISPLAY ()), priv->ss_info) != 0) { + if (XScreenSaverQueryInfo (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), DefaultRootWindow (GDK_DISPLAY_XDISPLAY(gdk_display_get_default())), priv->ss_info) != 0) { if (priv->ss_info->idle < priv->last_idle) { now = time (NULL); @@ -172,7 +172,7 @@ drw_monitor_setup (DrwMonitor *monitor) priv = monitor->priv; - if (!XScreenSaverQueryExtension (GDK_DISPLAY (), &event_base, &error_base)) { + if (!XScreenSaverQueryExtension (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &event_base, &error_base)) { return FALSE; } diff --git a/typing-break/drw-selection.c b/typing-break/drw-selection.c index 99b0980e..28a96533 100644 --- a/typing-break/drw-selection.c +++ b/typing-break/drw-selection.c @@ -70,7 +70,7 @@ drw_selection_clear (GtkWidget *widget, static gboolean drw_selection_find_existing (DrwSelection *drw_selection) { - Display *xdisplay = GDK_DISPLAY (); + Display *xdisplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); Window old; gdk_error_trap_push (); @@ -120,7 +120,7 @@ drw_selection_claim (DrwSelection *drw_selection) static void drw_selection_negotiate (DrwSelection *drw_selection) { - Display *xdisplay = GDK_DISPLAY (); + Display *xdisplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); gboolean found = FALSE; /* We don't need both the XGrabServer() and the loop here; |