diff options
author | Ted Gould <ted@gould.cx> | 2010-03-04 15:57:10 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-04 15:57:10 -0600 |
commit | ed955778a5b80d009a2575858914ef40d9a32e0b (patch) | |
tree | 4a0974ac812556add397a6f42bd980c945b7242a /src | |
parent | 1cc1da9e68b7899074c90b3a17ead21281b3f4f5 (diff) | |
parent | ace1ea5b32a539c2afe0feacd47033c3a7d1098b (diff) | |
download | ayatana-indicator-messages-ed955778a5b80d009a2575858914ef40d9a32e0b.tar.gz ayatana-indicator-messages-ed955778a5b80d009a2575858914ef40d9a32e0b.tar.bz2 ayatana-indicator-messages-ed955778a5b80d009a2575858914ef40d9a32e0b.zip |
Putting in default icons for the default apps that are panel themed
Diffstat (limited to 'src')
-rw-r--r-- | src/app-menu-item.c | 13 | ||||
-rw-r--r-- | src/default-applications.c | 17 | ||||
-rw-r--r-- | src/default-applications.h | 1 | ||||
-rw-r--r-- | src/launcher-menu-item.c | 7 |
4 files changed, 30 insertions, 8 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c index f792128..7db72bf 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -314,10 +314,15 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar update_label(self); - GIcon * icon = g_app_info_get_icon(priv->appinfo); - gchar * iconstr = g_icon_to_string(icon); - dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); - g_free(iconstr); + const gchar * def_icon = get_default_icon(priv->desktop); + if (def_icon == NULL) { + GIcon * icon = g_app_info_get_icon(priv->appinfo); + gchar * iconstr = g_icon_to_string(icon); + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); + g_free(iconstr); + } else { + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, def_icon); + } g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE); diff --git a/src/default-applications.c b/src/default-applications.c index 5fd6612..e45ae38 100644 --- a/src/default-applications.c +++ b/src/default-applications.c @@ -27,12 +27,13 @@ struct default_db_t { const gchar * desktop_file; const gchar * name; const gchar * setupname; + const gchar * icon; }; struct default_db_t default_db[] = { - {"evolution.desktop", N_("Mail"), N_("Set Up Mail...")}, - {"empathy.desktop", N_("Chat"), N_("Set Up Chat...")}, - {"gwibber.desktop", N_("Microblogging"), N_("Set Up Microblogging...")}, + {"evolution.desktop", N_("Mail"), N_("Set Up Mail..."), "applications-email-panel"}, + {"empathy.desktop", N_("Chat"), N_("Set Up Chat..."), "applications-chat-panel"}, + {"gwibber.desktop", N_("Microblogging"), N_("Set Up Microblogging..."), "applications-microblogging-panel"}, {NULL, NULL} }; @@ -78,3 +79,13 @@ get_default_setup (const gchar * desktop_path) return NULL; return db->setupname; } + +const gchar * +get_default_icon (const gchar * desktop_path) +{ + struct default_db_t * db = get_default_helper(desktop_path); + + if (db == NULL) + return NULL; + return db->icon; +} diff --git a/src/default-applications.h b/src/default-applications.h index 13cc904..0a32e7c 100644 --- a/src/default-applications.h +++ b/src/default-applications.h @@ -24,6 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. const gchar * get_default_name (const gchar * desktop_path); const gchar * get_default_setup (const gchar * desktop_path); +const gchar * get_default_icon (const gchar * desktop_path); #endif /* DEFAULT_APPLICATIONS_H__ */ diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index 5cc7cfe..f70f28b 100644 --- a/src/launcher-menu-item.c +++ b/src/launcher-menu-item.c @@ -170,7 +170,12 @@ launcher_menu_item_new (const gchar * desktop_file) dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, default_name); } - gchar * iconstr = launcher_menu_item_get_icon(self); + gchar * iconstr; + if (default_name == NULL) { + iconstr = launcher_menu_item_get_icon(self); + } else { + iconstr = g_strdup(get_default_icon(desktop_file)); + } dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); g_free(iconstr); dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); |