summaryrefslogtreecommitdiff
path: root/src/caja-file-management-properties.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-10-27 15:21:59 +0100
committerStefano Karapetsas <[email protected]>2014-10-27 15:21:59 +0100
commitf4c1ed23ddb3bf5d8ba6d1faf46c26b91346d926 (patch)
tree16e70e9d6b0ea866b0981aa70ad92208bb95b0cb /src/caja-file-management-properties.c
parent451eef9b275ce006b270a3569d96e531e24dd15a (diff)
downloadcaja-f4c1ed23ddb3bf5d8ba6d1faf46c26b91346d926.tar.bz2
caja-f4c1ed23ddb3bf5d8ba6d1faf46c26b91346d926.tar.xz
Allow extensions to define an ini file with name, icon and description
Diffstat (limited to 'src/caja-file-management-properties.c')
-rw-r--r--src/caja-file-management-properties.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index a0902ed2..9df0695b 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -785,26 +785,47 @@ caja_file_management_properties_dialog_setup_extension_page (GtkBuilder *builder
G_CALLBACK (extension_state_toggled), view);
icon_theme = gtk_icon_theme_get_default();
- ext_pixbuf_icon = gtk_icon_theme_load_icon (icon_theme, "gtk-open",
- GTK_ICON_SIZE_SMALL_TOOLBAR,
- GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
for (i = 0; i < g_list_length (extensions); i++)
{
Extension* ext = EXTENSION (g_list_nth_data (extensions, i));
-
- ext_text_info = g_markup_printf_escaped ("<b>%s</b>\n%s",
- ext->filename,
- "This is a placeholder.");
-
+
+ if (ext->icon != NULL)
+ {
+ ext_pixbuf_icon = gtk_icon_theme_load_icon (icon_theme, ext->icon,
+ 24,
+ GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+ }
+ else
+ {
+ ext_pixbuf_icon = gtk_icon_theme_load_icon (icon_theme, "system-run",
+ 24,
+ GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+ }
+
+ if (ext->description != NULL)
+ {
+ ext_text_info = g_markup_printf_escaped ("<b>%s</b>\n%s",
+ ext->name ? ext->name : ext->filename,
+ ext->description);
+ }
+ else
+ {
+ ext_text_info = g_markup_printf_escaped ("<b>%s</b>",
+ ext->name ? ext->name : ext->filename);
+ }
+
gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
+ gtk_list_store_set (store, &iter,
EXT_STATE_COLUMN, ext->state,
EXT_ICON_COLUMN, ext_pixbuf_icon,
EXT_INFO_COLUMN, ext_text_info,
EXT_STRUCT_COLUMN, ext, -1);
+
+ g_free (ext_text_info);
+ if (ext_pixbuf_icon)
+ g_object_unref (ext_pixbuf_icon);
}
- g_free (ext_text_info);
}
static void