Plug-ins can have icons now

This commit is contained in:
Pierre Pronchery 2011-07-19 00:04:02 +00:00
parent c587ec6556
commit 4143271837
8 changed files with 43 additions and 31 deletions

View File

@ -38,6 +38,7 @@ struct _BrowserPlugin
{
BrowserPluginHelper * helper;
char const * name;
char const * icon;
GtkWidget * (*init)(BrowserPlugin * plugin);
void (*destroy)(BrowserPlugin * plugin);
void (*refresh)(BrowserPlugin * plugin, char const * path);

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-19 01:53+0200\n"
"POT-Creation-Date: 2011-07-19 02:03+0200\n"
"PO-Revision-Date: 2010-03-29 23:28+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: English\n"
@ -291,27 +291,27 @@ msgstr ""
msgid "_Plug-ins"
msgstr ""
#: ../src/browser.c:2151
#: ../src/browser.c:2160
msgid "Edit file association"
msgstr ""
#: ../src/browser.c:2164
#: ../src/browser.c:2173
msgid "Type:"
msgstr ""
#: ../src/browser.c:2173
#: ../src/browser.c:2182
msgid "Open with:"
msgstr "Offnen mit:"
#: ../src/browser.c:2184
#: ../src/browser.c:2193
msgid "View with:"
msgstr ""
#: ../src/browser.c:2195
#: ../src/browser.c:2204
msgid "Edit with:"
msgstr ""
#: ../src/browser.c:2356
#: ../src/browser.c:2365
msgid "Refreshing folder..."
msgstr "Aktualisierung..."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-19 01:53+0200\n"
"POT-Creation-Date: 2011-07-19 02:03+0200\n"
"PO-Revision-Date: 2010-03-30 01:04+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Spanish\n"
@ -291,27 +291,27 @@ msgstr ""
msgid "_Plug-ins"
msgstr ""
#: ../src/browser.c:2151
#: ../src/browser.c:2160
msgid "Edit file association"
msgstr ""
#: ../src/browser.c:2164
#: ../src/browser.c:2173
msgid "Type:"
msgstr ""
#: ../src/browser.c:2173
#: ../src/browser.c:2182
msgid "Open with:"
msgstr ""
#: ../src/browser.c:2184
#: ../src/browser.c:2193
msgid "View with:"
msgstr ""
#: ../src/browser.c:2195
#: ../src/browser.c:2204
msgid "Edit with:"
msgstr ""
#: ../src/browser.c:2356
#: ../src/browser.c:2365
msgid "Refreshing folder..."
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-19 01:53+0200\n"
"POT-Creation-Date: 2011-07-19 02:03+0200\n"
"PO-Revision-Date: 2010-03-29 23:28+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
@ -291,27 +291,27 @@ msgstr "Nom"
msgid "_Plug-ins"
msgstr "_Greffons"
#: ../src/browser.c:2151
#: ../src/browser.c:2160
msgid "Edit file association"
msgstr "Modifier les associations de type"
#: ../src/browser.c:2164
#: ../src/browser.c:2173
msgid "Type:"
msgstr "Type :"
#: ../src/browser.c:2173
#: ../src/browser.c:2182
msgid "Open with:"
msgstr "Ouvrir avec :"
#: ../src/browser.c:2184
#: ../src/browser.c:2193
msgid "View with:"
msgstr "Visualiser avec :"
#: ../src/browser.c:2195
#: ../src/browser.c:2204
msgid "Edit with:"
msgstr "Modifier avec :"
#: ../src/browser.c:2356
#: ../src/browser.c:2365
msgid "Refreshing folder..."
msgstr "Actualisation du dossier..."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-19 01:53+0200\n"
"POT-Creation-Date: 2011-07-19 02:03+0200\n"
"PO-Revision-Date: 2010-04-07 23:18+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Italian\n"
@ -291,27 +291,27 @@ msgstr ""
msgid "_Plug-ins"
msgstr ""
#: ../src/browser.c:2151
#: ../src/browser.c:2160
msgid "Edit file association"
msgstr ""
#: ../src/browser.c:2164
#: ../src/browser.c:2173
msgid "Type:"
msgstr ""
#: ../src/browser.c:2173
#: ../src/browser.c:2182
msgid "Open with:"
msgstr ""
#: ../src/browser.c:2184
#: ../src/browser.c:2193
msgid "View with:"
msgstr ""
#: ../src/browser.c:2195
#: ../src/browser.c:2204
msgid "Edit with:"
msgstr ""
#: ../src/browser.c:2356
#: ../src/browser.c:2365
msgid "Refreshing folder..."
msgstr ""

View File

@ -2089,15 +2089,18 @@ static void _preferences_set_plugins(Browser * browser)
{
DIR * dir;
struct dirent * de;
GtkIconTheme * theme;
char const ext[] = ".so";
size_t len;
GtkTreeIter iter;
Plugin * p;
BrowserPlugin * bp;
GdkPixbuf * pixbuf;
gtk_list_store_clear(browser->pr_plugin_store);
if((dir = opendir(LIBDIR "/" PACKAGE "/plugins")) == NULL)
return;
theme = gtk_icon_theme_get_default();
while((de = readdir(dir)) != NULL)
{
if((len = strlen(de->d_name)) < sizeof(ext))
@ -2116,10 +2119,16 @@ static void _preferences_set_plugins(Browser * browser)
plugin_delete(p);
continue;
}
gtk_list_store_append(browser->pr_plugin_store, &iter);
gtk_list_store_set(browser->pr_plugin_store, &iter, 2, bp->name,
-1);
/* FIXME determine if the plug-in is enabled already */
if(bp->icon == NULL)
pixbuf = gtk_icon_theme_load_icon(theme,
"gnome-settings", 24, 0, NULL);
else
pixbuf = gtk_icon_theme_load_icon(theme, bp->icon, 24,
0, NULL);
gtk_list_store_append(browser->pr_plugin_store, &iter);
gtk_list_store_set(browser->pr_plugin_store, &iter, 1, pixbuf,
2, bp->name, -1);
plugin_delete(p);
}
closedir(dir);

View File

@ -71,6 +71,7 @@ BrowserPlugin plugin =
{
NULL,
"Devices",
"drive-harddisk",
_devices_init,
_devices_destroy,
_devices_refresh,

View File

@ -39,6 +39,7 @@ BrowserPlugin plugin =
{
NULL,
"Properties",
GTK_STOCK_PROPERTIES,
_properties_init,
_properties_destroy,
NULL,