From f4012ecd2751f3bb280604087de71f6a4009a9a9 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Mon, 27 Jan 2014 11:52:36 +0100 Subject: appearance: Add support for 'artist' tag in xml backgrounds files This feature was already implemented in Linux Mint and Cinnamon, so we are going to implement it in MATE too. --- capplets/appearance/mate-wp-item.c | 21 +++++++++++++++++---- capplets/appearance/mate-wp-item.h | 3 +++ capplets/appearance/mate-wp-xml.c | 16 +++++++++++++++- 3 files changed, 35 insertions(+), 5 deletions(-) (limited to 'capplets') diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c index d11fa896..96e7d67a 100644 --- a/capplets/appearance/mate-wp-item.c +++ b/capplets/appearance/mate-wp-item.c @@ -279,10 +279,16 @@ void mate_wp_item_update_description (MateWPItem * item) { const gchar *description; gchar *size; gchar *dirname = g_path_get_dirname (item->filename); + gchar *artist; description = NULL; size = NULL; + if (!item->artist || item->artist[0] == 0 || !g_strcmp0(item->artist, "(none)")) + artist = g_strdup (_("unknown")); + else + artist = g_strdup (item->artist); + if (strcmp (item->fileinfo->mime_type, "application/xml") == 0) { if (mate_bg_changes_with_time (item->bg)) @@ -308,28 +314,35 @@ void mate_wp_item_update_description (MateWPItem * item) { /* translators: wallpaper name * mime type, size * Folder: /path/to/file + * Artist: wallpaper author */ item->description = g_markup_printf_escaped (_("%s\n" "%s, %s\n" - "Folder: %s"), + "Folder: %s\n" + "Artist: %s"), item->name, description, size, - dirname); + dirname, + artist); } else { /* translators: wallpaper name * Image missing * Folder: /path/to/file + * Artist: wallpaper author */ item->description = g_markup_printf_escaped (_("%s\n" "%s\n" - "Folder: %s"), + "Folder: %s\n" + "Artist: %s"), item->name, _("Image missing"), - dirname); + dirname, + artist); } g_free (size); g_free (dirname); + g_free (artist); } } diff --git a/capplets/appearance/mate-wp-item.h b/capplets/appearance/mate-wp-item.h index a6e13f24..5e336d53 100644 --- a/capplets/appearance/mate-wp-item.h +++ b/capplets/appearance/mate-wp-item.h @@ -53,6 +53,9 @@ struct _MateWPItem { /* Did the user remove us? */ gboolean deleted; + /* Wallpaper author, if present */ + gchar *artist; + /* Width and Height of the original image */ gint width; gint height; diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c index d6b0c71d..11e19235 100644 --- a/capplets/appearance/mate-wp-xml.c +++ b/capplets/appearance/mate-wp-xml.c @@ -145,7 +145,7 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename) { MateWPItem * wp; char *pcolor = NULL, *scolor = NULL; - gboolean have_scale = FALSE, have_shade = FALSE; + gboolean have_scale = FALSE, have_shade = FALSE, have_artist = FALSE; wp = g_new0(MateWPItem, 1); @@ -242,6 +242,14 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename) scolor = g_strdup(g_strstrip ((char *)wpa->last->content)); } } + else if (!strcmp ((char*) wpa->name, "artist")) + { + if (wpa->last != NULL) + { + wp->artist = g_strdup (g_strstrip ((char *)wpa->last->content)); + have_artist = TRUE; + } + } else if (!strcmp ((char*) wpa->name, "text")) { /* Do nothing here, libxml2 is being weird */ @@ -283,6 +291,11 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename) scolor = g_settings_get_string (data->wp_settings, WP_SCOLOR_KEY); } + if (!have_artist) + { + wp->artist = g_strdup ("(none)"); + } + gdk_color_parse(pcolor, &color1); gdk_color_parse(scolor, &color2); g_free(pcolor); @@ -541,6 +554,7 @@ void mate_wp_xml_save_list(AppearanceData* data) xmlNewTextChild(wallpaper, NULL, (xmlChar*) "shade_type", (xmlChar*) shade); xmlNewTextChild(wallpaper, NULL, (xmlChar*) "pcolor", (xmlChar*) pcolor); xmlNewTextChild(wallpaper, NULL, (xmlChar*) "scolor", (xmlChar*) scolor); + xmlNewTextChild(wallpaper, NULL, (xmlChar*) "artist", (xmlChar*) wpitem->artist); g_free(pcolor); g_free(scolor); -- cgit v1.2.1 From 2df56b620bc0b98adad27688985be31d5c830242 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 28 Jan 2014 16:56:42 +0100 Subject: windows: Fix ui file after GtkComboBoxText migration --- capplets/windows/mate-window-properties.ui | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'capplets') diff --git a/capplets/windows/mate-window-properties.ui b/capplets/windows/mate-window-properties.ui index 6a40b744..1029fed9 100644 --- a/capplets/windows/mate-window-properties.ui +++ b/capplets/windows/mate-window-properties.ui @@ -295,15 +295,8 @@ - + True - liststore1 - - - - 0 - - False -- cgit v1.2.1 From 44c15cac8d362deb7a4febd16d9dc2288f4f54e7 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 28 Jan 2014 17:07:40 +0100 Subject: Fix some gcc warnings --- capplets/about-me/fingerprint-strings.h | 26 -------------------------- capplets/appearance/appearance-style.c | 4 ++-- capplets/mouse/mate-mouse-properties.c | 6 +++--- 3 files changed, 5 insertions(+), 31 deletions(-) (limited to 'capplets') diff --git a/capplets/about-me/fingerprint-strings.h b/capplets/about-me/fingerprint-strings.h index d1b919e9..20446a0b 100644 --- a/capplets/about-me/fingerprint-strings.h +++ b/capplets/about-me/fingerprint-strings.h @@ -57,32 +57,6 @@ static const char *finger_str_to_msg(const char *finger_name, gboolean is_swipe) return NULL; } -/* Cases not handled: - * verify-no-match - * verify-match - * verify-unknown-error - */ -static const char *verify_result_str_to_msg(const char *result, gboolean is_swipe) -{ - if (result == NULL) - return NULL; - - if (strcmp (result, "verify-retry-scan") == 0) { - if (is_swipe == FALSE) - return N_("Place your finger on the reader again"); - else - return N_("Swipe your finger again"); - } - if (strcmp (result, "verify-swipe-too-short") == 0) - return N_("Swipe was too short, try again"); - if (strcmp (result, "verify-finger-not-centered") == 0) - return N_("Your finger was not centered, try swiping your finger again"); - if (strcmp (result, "verify-remove-and-retry") == 0) - return N_("Remove your finger, and try swiping your finger again"); - - return NULL; -} - /* Cases not handled: * enroll-completed * enroll-failed diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c index 5ebd9523..ec9f916a 100644 --- a/capplets/appearance/appearance-style.c +++ b/capplets/appearance/appearance-style.c @@ -982,7 +982,7 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c /* select in treeview the theme set in gsettings */ GtkTreeModel *treemodel; - treemodel = gtk_tree_view_get_model (list); + treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (list)); gchar *theme = g_settings_get_string (settings, key); gchar *path = find_string_in_model (treemodel, theme, COL_NAME); if (path) @@ -990,7 +990,7 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); gtk_tree_selection_select_path (selection, treepath); - gtk_tree_view_scroll_to_cell (list, treepath, NULL, FALSE, 0, 0); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (list), treepath, NULL, FALSE, 0, 0); gtk_tree_path_free (treepath); g_free (path); } diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index cf5c9deb..38e17530 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -208,11 +208,11 @@ scrollmethod_gsettings_changed_event (GSettings *settings, GtkBuilder *dialog) { int scroll_method = g_settings_get_int (touchpad_settings, "scroll-method"); - gtk_toggle_button_set_active (WID ("scroll_disabled_radio"), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_disabled_radio")), scroll_method == 0); - gtk_toggle_button_set_active (WID ("scroll_edge_radio"), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_edge_radio")), scroll_method == 1); - gtk_toggle_button_set_active (WID ("scroll_twofinger_radio"), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_twofinger_radio")), scroll_method == 2); gtk_widget_set_sensitive (WID ("horiz_scroll_toggle"), scroll_method != 0); -- cgit v1.2.1 From 38f7a4c66ec15897c05eb0f3577aaca4cb1b884d Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 28 Jan 2014 17:44:42 +0100 Subject: about-me: Remove unused constant --- capplets/about-me/mate-about-me.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'capplets') diff --git a/capplets/about-me/mate-about-me.c b/capplets/about-me/mate-about-me.c index 6e125d3c..164408d5 100644 --- a/capplets/about-me/mate-about-me.c +++ b/capplets/about-me/mate-about-me.c @@ -41,8 +41,6 @@ #define MAX_HEIGHT 100 #define MAX_WIDTH 100 -#define EMAIL_SLOTS 4 - typedef struct { GtkBuilder *dialog; -- cgit v1.2.1