From 58af3e6c124b5c17b4d72d94b7d7fc9f1401377c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 17 Jul 2011 23:02:37 +0000 Subject: [PATCH] Allow plug-ins to change the current browser location --- Makefile | 1 + include/Browser.h | 1 + po/de.po | 68 ++++++++++++++--------------- po/es.po | 68 ++++++++++++++--------------- po/fr.po | 68 ++++++++++++++--------------- po/it.po | 68 ++++++++++++++--------------- src/browser.c | 2 + src/plugins/Makefile | 17 +++++++- src/plugins/devices.c | 94 ++++++++++++++++++++++++++++++++++++++++ src/plugins/project.conf | 10 ++++- src/plugins/properties.c | 2 +- 11 files changed, 259 insertions(+), 140 deletions(-) create mode 100644 src/plugins/devices.c diff --git a/Makefile b/Makefile index 9c7692e..caa0e18 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ dist: $(PACKAGE)-$(VERSION)/src/desktop.h \ $(PACKAGE)-$(VERSION)/src/desktopicon.h \ $(PACKAGE)-$(VERSION)/src/project.conf \ + $(PACKAGE)-$(VERSION)/src/plugins/devices.c \ $(PACKAGE)-$(VERSION)/src/plugins/properties.c \ $(PACKAGE)-$(VERSION)/src/plugins/Makefile \ $(PACKAGE)-$(VERSION)/src/plugins/project.conf \ diff --git a/include/Browser.h b/include/Browser.h index c08121a..046c444 100644 --- a/include/Browser.h +++ b/include/Browser.h @@ -31,6 +31,7 @@ typedef struct _BrowserPlugin BrowserPlugin; typedef struct _BrowserPluginHelper { Browser * browser; + void (*set_location)(Browser * browser, char const * path); } BrowserPluginHelper; struct _BrowserPlugin diff --git a/po/de.po b/po/de.po index f09b35a..119e81f 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-18 00:47+0200\n" +"POT-Creation-Date: 2011-07-18 01:01+0200\n" "PO-Revision-Date: 2010-03-29 23:28+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: English\n" @@ -28,7 +28,7 @@ msgstr "Neu _Ordner" msgid "New _symbolic link..." msgstr "" -#: ../src/browser.c:106 ../src/browser.c:877 +#: ../src/browser.c:106 ../src/browser.c:879 msgid "Open file..." msgstr "Offnen..." @@ -157,35 +157,35 @@ msgstr "" msgid "Error while loading configuration" msgstr "" -#: ../src/browser.c:305 +#: ../src/browser.c:306 msgid "File browser" msgstr "" -#: ../src/browser.c:324 +#: ../src/browser.c:325 msgid "View as..." msgstr "" -#: ../src/browser.c:328 ../src/browser.c:1963 ../src/browser.c:1971 +#: ../src/browser.c:329 ../src/browser.c:1965 ../src/browser.c:1973 msgid "Details" msgstr "" -#: ../src/browser.c:335 ../src/browser.c:1964 ../src/browser.c:1972 +#: ../src/browser.c:336 ../src/browser.c:1966 ../src/browser.c:1974 msgid "Icons" msgstr "" -#: ../src/browser.c:342 ../src/browser.c:1965 ../src/browser.c:1973 +#: ../src/browser.c:343 ../src/browser.c:1967 ../src/browser.c:1975 msgid "List" msgstr "" -#: ../src/browser.c:349 ../src/browser.c:1967 ../src/browser.c:1974 +#: ../src/browser.c:350 ../src/browser.c:1969 ../src/browser.c:1976 msgid "Thumbnails" msgstr "" -#: ../src/browser.c:370 +#: ../src/browser.c:371 msgid " Location: " msgstr "" -#: ../src/browser.c:698 ../src/browser.c:703 ../src/copy.c:674 +#: ../src/browser.c:699 ../src/browser.c:704 ../src/copy.c:674 #: ../src/copy.c:678 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1647 ../src/desktop.c:1652 ../src/move.c:452 #: ../src/move.c:456 ../src/properties.c:118 ../src/properties.c:122 @@ -193,101 +193,101 @@ msgstr "" msgid "Error" msgstr "Fehler" -#: ../src/browser.c:899 ../src/desktopicon.c:861 ../src/view.c:145 +#: ../src/browser.c:901 ../src/desktopicon.c:861 ../src/view.c:145 #: ../src/view.c:420 msgid "Open with..." msgstr "Offnen mit..." -#: ../src/browser.c:991 ../src/browser.c:1365 +#: ../src/browser.c:993 ../src/browser.c:1367 msgid "Refreshing folder: " msgstr "" -#: ../src/browser.c:1012 +#: ../src/browser.c:1014 #, c-format msgid "%s%u file%c (%u hidden)" msgstr "" -#: ../src/browser.c:1667 +#: ../src/browser.c:1669 msgid "Filename" msgstr "" -#: ../src/browser.c:1669 +#: ../src/browser.c:1671 msgid "Size" msgstr "Größe" -#: ../src/browser.c:1671 +#: ../src/browser.c:1673 msgid "Owner" msgstr "" -#: ../src/browser.c:1673 +#: ../src/browser.c:1675 msgid "Group" msgstr "Gruppe" -#: ../src/browser.c:1675 +#: ../src/browser.c:1677 msgid "Date" msgstr "Datum" -#: ../src/browser.c:1677 +#: ../src/browser.c:1679 msgid "MIME type" msgstr "" -#: ../src/browser.c:1941 +#: ../src/browser.c:1943 msgid "File browser preferences" msgstr "File browser Einstellungen" -#: ../src/browser.c:1957 +#: ../src/browser.c:1959 msgid "Default view:" msgstr "" -#: ../src/browser.c:1981 +#: ../src/browser.c:1983 msgid "_Alternate row colors in detailed view" msgstr "" -#: ../src/browser.c:1985 +#: ../src/browser.c:1987 msgid "_Confirm before deletion" msgstr "_Bestätigen vor löschung" -#: ../src/browser.c:1988 +#: ../src/browser.c:1990 msgid "Sort _folders first" msgstr "List _Ordner zuerst" -#: ../src/browser.c:1991 +#: ../src/browser.c:1993 msgid "Show _hidden files" msgstr "" -#: ../src/browser.c:1994 +#: ../src/browser.c:1996 msgid "_Appearance" msgstr "" -#: ../src/browser.c:2003 ../src/browser.c:2008 +#: ../src/browser.c:2005 ../src/browser.c:2010 msgid "Type" msgstr "" -#: ../src/browser.c:2029 +#: ../src/browser.c:2031 msgid "_File associations" msgstr "" -#: ../src/browser.c:2079 +#: ../src/browser.c:2081 msgid "Edit file association" msgstr "" -#: ../src/browser.c:2092 +#: ../src/browser.c:2094 msgid "Type:" msgstr "" -#: ../src/browser.c:2101 +#: ../src/browser.c:2103 msgid "Open with:" msgstr "Offnen mit:" -#: ../src/browser.c:2112 +#: ../src/browser.c:2114 msgid "View with:" msgstr "" -#: ../src/browser.c:2123 +#: ../src/browser.c:2125 msgid "Edit with:" msgstr "" -#: ../src/browser.c:2267 +#: ../src/browser.c:2269 msgid "Refreshing folder..." msgstr "Aktualisierung..." diff --git a/po/es.po b/po/es.po index 84f8527..fb68730 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-18 00:47+0200\n" +"POT-Creation-Date: 2011-07-18 01:01+0200\n" "PO-Revision-Date: 2010-03-30 01:04+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Spanish\n" @@ -28,7 +28,7 @@ msgstr "" msgid "New _symbolic link..." msgstr "" -#: ../src/browser.c:106 ../src/browser.c:877 +#: ../src/browser.c:106 ../src/browser.c:879 msgid "Open file..." msgstr "" @@ -157,35 +157,35 @@ msgstr "" msgid "Error while loading configuration" msgstr "" -#: ../src/browser.c:305 +#: ../src/browser.c:306 msgid "File browser" msgstr "" -#: ../src/browser.c:324 +#: ../src/browser.c:325 msgid "View as..." msgstr "" -#: ../src/browser.c:328 ../src/browser.c:1963 ../src/browser.c:1971 +#: ../src/browser.c:329 ../src/browser.c:1965 ../src/browser.c:1973 msgid "Details" msgstr "" -#: ../src/browser.c:335 ../src/browser.c:1964 ../src/browser.c:1972 +#: ../src/browser.c:336 ../src/browser.c:1966 ../src/browser.c:1974 msgid "Icons" msgstr "" -#: ../src/browser.c:342 ../src/browser.c:1965 ../src/browser.c:1973 +#: ../src/browser.c:343 ../src/browser.c:1967 ../src/browser.c:1975 msgid "List" msgstr "" -#: ../src/browser.c:349 ../src/browser.c:1967 ../src/browser.c:1974 +#: ../src/browser.c:350 ../src/browser.c:1969 ../src/browser.c:1976 msgid "Thumbnails" msgstr "" -#: ../src/browser.c:370 +#: ../src/browser.c:371 msgid " Location: " msgstr "" -#: ../src/browser.c:698 ../src/browser.c:703 ../src/copy.c:674 +#: ../src/browser.c:699 ../src/browser.c:704 ../src/copy.c:674 #: ../src/copy.c:678 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1647 ../src/desktop.c:1652 ../src/move.c:452 #: ../src/move.c:456 ../src/properties.c:118 ../src/properties.c:122 @@ -193,101 +193,101 @@ msgstr "" msgid "Error" msgstr "" -#: ../src/browser.c:899 ../src/desktopicon.c:861 ../src/view.c:145 +#: ../src/browser.c:901 ../src/desktopicon.c:861 ../src/view.c:145 #: ../src/view.c:420 msgid "Open with..." msgstr "" -#: ../src/browser.c:991 ../src/browser.c:1365 +#: ../src/browser.c:993 ../src/browser.c:1367 msgid "Refreshing folder: " msgstr "" -#: ../src/browser.c:1012 +#: ../src/browser.c:1014 #, c-format msgid "%s%u file%c (%u hidden)" msgstr "" -#: ../src/browser.c:1667 +#: ../src/browser.c:1669 msgid "Filename" msgstr "" -#: ../src/browser.c:1669 +#: ../src/browser.c:1671 msgid "Size" msgstr "" -#: ../src/browser.c:1671 +#: ../src/browser.c:1673 msgid "Owner" msgstr "" -#: ../src/browser.c:1673 +#: ../src/browser.c:1675 msgid "Group" msgstr "" -#: ../src/browser.c:1675 +#: ../src/browser.c:1677 msgid "Date" msgstr "" -#: ../src/browser.c:1677 +#: ../src/browser.c:1679 msgid "MIME type" msgstr "" -#: ../src/browser.c:1941 +#: ../src/browser.c:1943 msgid "File browser preferences" msgstr "File browser preferencias" -#: ../src/browser.c:1957 +#: ../src/browser.c:1959 msgid "Default view:" msgstr "" -#: ../src/browser.c:1981 +#: ../src/browser.c:1983 msgid "_Alternate row colors in detailed view" msgstr "" -#: ../src/browser.c:1985 +#: ../src/browser.c:1987 msgid "_Confirm before deletion" msgstr "" -#: ../src/browser.c:1988 +#: ../src/browser.c:1990 msgid "Sort _folders first" msgstr "" -#: ../src/browser.c:1991 +#: ../src/browser.c:1993 msgid "Show _hidden files" msgstr "" -#: ../src/browser.c:1994 +#: ../src/browser.c:1996 msgid "_Appearance" msgstr "" -#: ../src/browser.c:2003 ../src/browser.c:2008 +#: ../src/browser.c:2005 ../src/browser.c:2010 msgid "Type" msgstr "" -#: ../src/browser.c:2029 +#: ../src/browser.c:2031 msgid "_File associations" msgstr "" -#: ../src/browser.c:2079 +#: ../src/browser.c:2081 msgid "Edit file association" msgstr "" -#: ../src/browser.c:2092 +#: ../src/browser.c:2094 msgid "Type:" msgstr "" -#: ../src/browser.c:2101 +#: ../src/browser.c:2103 msgid "Open with:" msgstr "" -#: ../src/browser.c:2112 +#: ../src/browser.c:2114 msgid "View with:" msgstr "" -#: ../src/browser.c:2123 +#: ../src/browser.c:2125 msgid "Edit with:" msgstr "" -#: ../src/browser.c:2267 +#: ../src/browser.c:2269 msgid "Refreshing folder..." msgstr "" diff --git a/po/fr.po b/po/fr.po index 4d743b9..f8cbe1c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-18 00:47+0200\n" +"POT-Creation-Date: 2011-07-18 01:01+0200\n" "PO-Revision-Date: 2010-03-29 23:28+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: French\n" @@ -28,7 +28,7 @@ msgstr "Nouveau _dossier" msgid "New _symbolic link..." msgstr "Nouveau _lien symbolique..." -#: ../src/browser.c:106 ../src/browser.c:877 +#: ../src/browser.c:106 ../src/browser.c:879 msgid "Open file..." msgstr "Ouvrir..." @@ -157,35 +157,35 @@ msgstr "Erreur lors du chargement des icônes" msgid "Error while loading configuration" msgstr "Erreur lors du chargement de la configuration" -#: ../src/browser.c:305 +#: ../src/browser.c:306 msgid "File browser" msgstr "Gestionnaire de fichiers" -#: ../src/browser.c:324 +#: ../src/browser.c:325 msgid "View as..." msgstr "Vue..." -#: ../src/browser.c:328 ../src/browser.c:1963 ../src/browser.c:1971 +#: ../src/browser.c:329 ../src/browser.c:1965 ../src/browser.c:1973 msgid "Details" msgstr "Détails" -#: ../src/browser.c:335 ../src/browser.c:1964 ../src/browser.c:1972 +#: ../src/browser.c:336 ../src/browser.c:1966 ../src/browser.c:1974 msgid "Icons" msgstr "Icônes" -#: ../src/browser.c:342 ../src/browser.c:1965 ../src/browser.c:1973 +#: ../src/browser.c:343 ../src/browser.c:1967 ../src/browser.c:1975 msgid "List" msgstr "Liste" -#: ../src/browser.c:349 ../src/browser.c:1967 ../src/browser.c:1974 +#: ../src/browser.c:350 ../src/browser.c:1969 ../src/browser.c:1976 msgid "Thumbnails" msgstr "Vignettes" -#: ../src/browser.c:370 +#: ../src/browser.c:371 msgid " Location: " msgstr " Chemin : " -#: ../src/browser.c:698 ../src/browser.c:703 ../src/copy.c:674 +#: ../src/browser.c:699 ../src/browser.c:704 ../src/copy.c:674 #: ../src/copy.c:678 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1647 ../src/desktop.c:1652 ../src/move.c:452 #: ../src/move.c:456 ../src/properties.c:118 ../src/properties.c:122 @@ -193,101 +193,101 @@ msgstr " Chemin : " msgid "Error" msgstr "Erreur" -#: ../src/browser.c:899 ../src/desktopicon.c:861 ../src/view.c:145 +#: ../src/browser.c:901 ../src/desktopicon.c:861 ../src/view.c:145 #: ../src/view.c:420 msgid "Open with..." msgstr "Ouvrir avec..." -#: ../src/browser.c:991 ../src/browser.c:1365 +#: ../src/browser.c:993 ../src/browser.c:1367 msgid "Refreshing folder: " msgstr "Actualisation du dossier : " -#: ../src/browser.c:1012 +#: ../src/browser.c:1014 #, c-format msgid "%s%u file%c (%u hidden)" msgstr "%s%u fichier%c (%u cachés)" -#: ../src/browser.c:1667 +#: ../src/browser.c:1669 msgid "Filename" msgstr "Nom de fichier" -#: ../src/browser.c:1669 +#: ../src/browser.c:1671 msgid "Size" msgstr "Taille" -#: ../src/browser.c:1671 +#: ../src/browser.c:1673 msgid "Owner" msgstr "Propriétaire" -#: ../src/browser.c:1673 +#: ../src/browser.c:1675 msgid "Group" msgstr "Groupe" -#: ../src/browser.c:1675 +#: ../src/browser.c:1677 msgid "Date" msgstr "Date" -#: ../src/browser.c:1677 +#: ../src/browser.c:1679 msgid "MIME type" msgstr "Type MIME" -#: ../src/browser.c:1941 +#: ../src/browser.c:1943 msgid "File browser preferences" msgstr "Gestionnaire de fichiers - Préférences" -#: ../src/browser.c:1957 +#: ../src/browser.c:1959 msgid "Default view:" msgstr "Vue par défaut:" -#: ../src/browser.c:1981 +#: ../src/browser.c:1983 msgid "_Alternate row colors in detailed view" msgstr "_Alterner les couleurs dans la vue détaillée" -#: ../src/browser.c:1985 +#: ../src/browser.c:1987 msgid "_Confirm before deletion" msgstr "_Confirmer l'effacement" -#: ../src/browser.c:1988 +#: ../src/browser.c:1990 msgid "Sort _folders first" msgstr "_Dossiers affichés en premier" -#: ../src/browser.c:1991 +#: ../src/browser.c:1993 msgid "Show _hidden files" msgstr "Afficher les fichiers cac_hés" -#: ../src/browser.c:1994 +#: ../src/browser.c:1996 msgid "_Appearance" msgstr "_Apparence" -#: ../src/browser.c:2003 ../src/browser.c:2008 +#: ../src/browser.c:2005 ../src/browser.c:2010 msgid "Type" msgstr "Type" -#: ../src/browser.c:2029 +#: ../src/browser.c:2031 msgid "_File associations" msgstr "_Types de fichiers" -#: ../src/browser.c:2079 +#: ../src/browser.c:2081 msgid "Edit file association" msgstr "Modifier les associations de type" -#: ../src/browser.c:2092 +#: ../src/browser.c:2094 msgid "Type:" msgstr "Type :" -#: ../src/browser.c:2101 +#: ../src/browser.c:2103 msgid "Open with:" msgstr "Ouvrir avec :" -#: ../src/browser.c:2112 +#: ../src/browser.c:2114 msgid "View with:" msgstr "Visualiser avec :" -#: ../src/browser.c:2123 +#: ../src/browser.c:2125 msgid "Edit with:" msgstr "Modifier avec :" -#: ../src/browser.c:2267 +#: ../src/browser.c:2269 msgid "Refreshing folder..." msgstr "Actualisation du dossier..." diff --git a/po/it.po b/po/it.po index 7f583fb..64fec4b 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-18 00:47+0200\n" +"POT-Creation-Date: 2011-07-18 01:01+0200\n" "PO-Revision-Date: 2010-04-07 23:18+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Italian\n" @@ -28,7 +28,7 @@ msgstr "" msgid "New _symbolic link..." msgstr "" -#: ../src/browser.c:106 ../src/browser.c:877 +#: ../src/browser.c:106 ../src/browser.c:879 msgid "Open file..." msgstr "" @@ -157,35 +157,35 @@ msgstr "" msgid "Error while loading configuration" msgstr "" -#: ../src/browser.c:305 +#: ../src/browser.c:306 msgid "File browser" msgstr "" -#: ../src/browser.c:324 +#: ../src/browser.c:325 msgid "View as..." msgstr "" -#: ../src/browser.c:328 ../src/browser.c:1963 ../src/browser.c:1971 +#: ../src/browser.c:329 ../src/browser.c:1965 ../src/browser.c:1973 msgid "Details" msgstr "" -#: ../src/browser.c:335 ../src/browser.c:1964 ../src/browser.c:1972 +#: ../src/browser.c:336 ../src/browser.c:1966 ../src/browser.c:1974 msgid "Icons" msgstr "" -#: ../src/browser.c:342 ../src/browser.c:1965 ../src/browser.c:1973 +#: ../src/browser.c:343 ../src/browser.c:1967 ../src/browser.c:1975 msgid "List" msgstr "" -#: ../src/browser.c:349 ../src/browser.c:1967 ../src/browser.c:1974 +#: ../src/browser.c:350 ../src/browser.c:1969 ../src/browser.c:1976 msgid "Thumbnails" msgstr "" -#: ../src/browser.c:370 +#: ../src/browser.c:371 msgid " Location: " msgstr "" -#: ../src/browser.c:698 ../src/browser.c:703 ../src/copy.c:674 +#: ../src/browser.c:699 ../src/browser.c:704 ../src/copy.c:674 #: ../src/copy.c:678 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1647 ../src/desktop.c:1652 ../src/move.c:452 #: ../src/move.c:456 ../src/properties.c:118 ../src/properties.c:122 @@ -193,101 +193,101 @@ msgstr "" msgid "Error" msgstr "" -#: ../src/browser.c:899 ../src/desktopicon.c:861 ../src/view.c:145 +#: ../src/browser.c:901 ../src/desktopicon.c:861 ../src/view.c:145 #: ../src/view.c:420 msgid "Open with..." msgstr "" -#: ../src/browser.c:991 ../src/browser.c:1365 +#: ../src/browser.c:993 ../src/browser.c:1367 msgid "Refreshing folder: " msgstr "" -#: ../src/browser.c:1012 +#: ../src/browser.c:1014 #, c-format msgid "%s%u file%c (%u hidden)" msgstr "" -#: ../src/browser.c:1667 +#: ../src/browser.c:1669 msgid "Filename" msgstr "" -#: ../src/browser.c:1669 +#: ../src/browser.c:1671 msgid "Size" msgstr "" -#: ../src/browser.c:1671 +#: ../src/browser.c:1673 msgid "Owner" msgstr "" -#: ../src/browser.c:1673 +#: ../src/browser.c:1675 msgid "Group" msgstr "" -#: ../src/browser.c:1675 +#: ../src/browser.c:1677 msgid "Date" msgstr "" -#: ../src/browser.c:1677 +#: ../src/browser.c:1679 msgid "MIME type" msgstr "" -#: ../src/browser.c:1941 +#: ../src/browser.c:1943 msgid "File browser preferences" msgstr "" -#: ../src/browser.c:1957 +#: ../src/browser.c:1959 msgid "Default view:" msgstr "" -#: ../src/browser.c:1981 +#: ../src/browser.c:1983 msgid "_Alternate row colors in detailed view" msgstr "" -#: ../src/browser.c:1985 +#: ../src/browser.c:1987 msgid "_Confirm before deletion" msgstr "" -#: ../src/browser.c:1988 +#: ../src/browser.c:1990 msgid "Sort _folders first" msgstr "" -#: ../src/browser.c:1991 +#: ../src/browser.c:1993 msgid "Show _hidden files" msgstr "" -#: ../src/browser.c:1994 +#: ../src/browser.c:1996 msgid "_Appearance" msgstr "" -#: ../src/browser.c:2003 ../src/browser.c:2008 +#: ../src/browser.c:2005 ../src/browser.c:2010 msgid "Type" msgstr "" -#: ../src/browser.c:2029 +#: ../src/browser.c:2031 msgid "_File associations" msgstr "" -#: ../src/browser.c:2079 +#: ../src/browser.c:2081 msgid "Edit file association" msgstr "" -#: ../src/browser.c:2092 +#: ../src/browser.c:2094 msgid "Type:" msgstr "" -#: ../src/browser.c:2101 +#: ../src/browser.c:2103 msgid "Open with:" msgstr "" -#: ../src/browser.c:2112 +#: ../src/browser.c:2114 msgid "View with:" msgstr "" -#: ../src/browser.c:2123 +#: ../src/browser.c:2125 msgid "Edit with:" msgstr "" -#: ../src/browser.c:2267 +#: ../src/browser.c:2269 msgid "Refreshing folder..." msgstr "" diff --git a/src/browser.c b/src/browser.c index 66dcc28..23913ee 100644 --- a/src/browser.c +++ b/src/browser.c @@ -293,6 +293,7 @@ Browser * browser_new(char const * directory) /* plugins */ browser->pl_helper.browser = browser; + browser->pl_helper.set_location = browser_set_location; /* widgets */ group = gtk_accel_group_new(); @@ -852,6 +853,7 @@ int browser_load(Browser * browser, char const * plugin) plugin_delete(p); return -browser_error(NULL, error_get(), 1); } + gtk_widget_hide(widget); gtk_list_store_append(browser->pl_store, &iter); gtk_list_store_set(browser->pl_store, &iter, BPC_NAME, bp->name, BPC_PLUGIN, p, BPC_BROWSERPLUGIN, bp, diff --git a/src/plugins/Makefile b/src/plugins/Makefile index 722957b..53d560c 100644 --- a/src/plugins/Makefile +++ b/src/plugins/Makefile @@ -1,4 +1,4 @@ -TARGETS = properties.so +TARGETS = devices.so properties.so PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib @@ -18,6 +18,13 @@ INSTALL = install all: $(TARGETS) +devices_OBJS = devices.o +devices_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +devices_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) + +devices.so: $(devices_OBJS) + $(LD) -o devices.so $(devices_OBJS) $(devices_LDFLAGS) + properties_OBJS = properties.o properties_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) properties_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) @@ -25,20 +32,26 @@ properties_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) properties.so: $(properties_OBJS) $(LD) -o properties.so $(properties_OBJS) $(properties_LDFLAGS) +devices.o: devices.c ../../include/Browser.h + $(CC) $(devices_CFLAGS) -c devices.c + properties.o: properties.c ../../include/Browser.h $(CC) $(properties_CFLAGS) -c properties.c clean: - $(RM) -- $(properties_OBJS) + $(RM) -- $(devices_OBJS) $(properties_OBJS) distclean: clean $(RM) -- $(TARGETS) install: $(TARGETS) + $(MKDIR) $(DESTDIR)$(LIBDIR)/Browser/plugins + $(INSTALL) -m 0644 -- devices.so $(DESTDIR)$(LIBDIR)/Browser/plugins/devices.so $(MKDIR) $(DESTDIR)$(LIBDIR)/Browser/plugins $(INSTALL) -m 0644 -- properties.so $(DESTDIR)$(LIBDIR)/Browser/plugins/properties.so uninstall: + $(RM) -- $(DESTDIR)$(LIBDIR)/Browser/plugins/devices.so $(RM) -- $(DESTDIR)$(LIBDIR)/Browser/plugins/properties.so .PHONY: all clean distclean install uninstall diff --git a/src/plugins/devices.c b/src/plugins/devices.c new file mode 100644 index 0000000..ff18d84 --- /dev/null +++ b/src/plugins/devices.c @@ -0,0 +1,94 @@ +/* $Id$ */ +/* Copyright (c) 2011 Pierre Pronchery */ +/* This file is part of DeforaOS Desktop Browser */ +/* This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + + + +#include +#include "Browser.h" + + +/* Devices */ +/* private */ +/* types */ +typedef struct _Devices +{ + GtkWidget * window; + GtkWidget * view; +} Devices; + + +/* prototypes */ +static GtkWidget * _devices_init(BrowserPlugin * plugin); +static void _devices_destroy(BrowserPlugin * plugin); + +/* callbacks */ +static void _devices_on_selection_changed(gpointer data); + + +/* public */ +/* variables */ +BrowserPlugin plugin = +{ + NULL, + "Devices", + _devices_init, + _devices_destroy, + NULL +}; + + +/* private */ +/* functions */ +/* devices_init */ +static GtkWidget * _devices_init(BrowserPlugin * plugin) +{ + Devices * devices; + GtkTreeSelection * treesel; + + if((devices = object_new(sizeof(*devices))) == NULL) + return NULL; + plugin->priv = devices; + devices->window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(devices->window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + devices->view = gtk_tree_view_new(); + treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(devices->view)); + g_signal_connect_swapped(G_OBJECT(treesel), "changed", G_CALLBACK( + _devices_on_selection_changed), plugin); + gtk_container_add(GTK_CONTAINER(devices->window), devices->view); + gtk_widget_show_all(devices->window); + return devices->window; +} + + +/* devices_destroy */ +static void _devices_destroy(BrowserPlugin * plugin) +{ + Devices * devices = plugin->priv; + + gtk_widget_destroy(devices->view); + object_delete(devices); +} + + +/* callbacks */ +/* devices_on_selection_changed */ +static void _devices_on_selection_changed(gpointer data) +{ + BrowserPlugin * plugin = data; + + /* FIXME really implement */ + plugin->helper->set_location(plugin->helper->browser, "/mnt"); +} diff --git a/src/plugins/project.conf b/src/plugins/project.conf index a07c66b..4178c06 100644 --- a/src/plugins/project.conf +++ b/src/plugins/project.conf @@ -1,10 +1,18 @@ -targets=properties +targets=devices,properties cppflags_force=-I ../../include cppflags= cflags_force=-W `pkg-config --cflags libSystem gtk+-2.0` cflags=-Wall -g -O2 -pedantic -fPIC dist=Makefile +[devices] +type=plugin +sources=devices.c +install=$(LIBDIR)/Browser/plugins + +[devices.c] +depends=../../include/Browser.h + [properties] type=plugin sources=properties.c diff --git a/src/plugins/properties.c b/src/plugins/properties.c index fb83e32..15a2a08 100644 --- a/src/plugins/properties.c +++ b/src/plugins/properties.c @@ -60,7 +60,7 @@ static GtkWidget * _properties_init(BrowserPlugin * plugin) /* FIXME really implement */ widget = gtk_label_new("Folder"); gtk_box_pack_start(GTK_BOX(properties->view), widget, FALSE, TRUE, 0); - gtk_widget_show(widget); + gtk_widget_show_all(properties->view); return properties->view; }