From 60560a030fda3c539ff9dc1563b9926414a193da Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sat, 21 Jan 2012 19:07:09 +0100 Subject: Imported Upstream version 0.4.0 --- .gitignore | 3 +- .valencia | 3 + AUTHORS | 3 + CMakeLists.txt | 78 +- INSTALL | 21 +- Makefile | 2 + README | 85 -- README.md | 83 ++ TRANSLATING | 2 +- resources/gnome-pie-indicator.svg | 770 ----------------- resources/locale/compile-po.sh | 1 + resources/locale/de/LC_MESSAGES/de.po | 584 +++++++------ resources/locale/de/LC_MESSAGES/gnomepie.mo | Bin 7817 -> 8399 bytes resources/locale/es/LC_MESSAGES/es.po | 661 ++++++++++++++ resources/locale/es/LC_MESSAGES/gnomepie.mo | Bin 0 -> 7223 bytes resources/locale/fr/LC_MESSAGES/fr.po | 635 ++++++++++++++ resources/locale/fr/LC_MESSAGES/gnomepie.mo | Bin 0 -> 3119 bytes resources/locale/gen-pot.sh | 18 +- resources/locale/gnomepie.pot | 425 --------- resources/locale/it/LC_MESSAGES/gnomepie.mo | Bin 8001 -> 3185 bytes resources/locale/it/LC_MESSAGES/it.po | 766 ++++++++++------ resources/locale/ko/LC_MESSAGES/gnomepie.mo | Bin 8135 -> 3153 bytes resources/locale/ko/LC_MESSAGES/ko.po | 736 ++++++++++------ resources/locale/pt-br/LC_MESSAGES/gnomepie.mo | Bin 7946 -> 3063 bytes resources/locale/pt-br/LC_MESSAGES/pt-br.mo | Bin 7946 -> 0 bytes resources/locale/pt-br/LC_MESSAGES/pt-br.po | 754 ++++++++++------ resources/locale/ru/LC_MESSAGES/gnomepie.mo | Bin 0 -> 9727 bytes resources/locale/ru/LC_MESSAGES/ru.po | 656 ++++++++++++++ resources/themes/adwaita/preview.png | Bin 0 -> 1412 bytes resources/themes/bright/preview.png | Bin 0 -> 2543 bytes resources/themes/elementary/preview.png | Bin 0 -> 1410 bytes resources/themes/funky/preview.png | Bin 0 -> 956 bytes resources/themes/gloss/preview.png | Bin 0 -> 1965 bytes resources/themes/o-pie/preview.png | Bin 0 -> 2248 bytes resources/themes/slim/preview.png | Bin 0 -> 502 bytes resources/themes/unity/preview.png | Bin 0 -> 2933 bytes resources/ui/icon_select.ui | 187 ++++ resources/ui/preferences.ui | 348 ++++++++ resources/ui/rename_pie.ui | 95 ++ resources/ui/settings.ui | 199 +++++ resources/ui/slice_select.ui | 415 +++++++++ resources/ui/trigger_select.ui | 208 +++++ src/CMakeLists.txt | 15 +- src/actionGroups/actionGroup.vala | 21 + src/actionGroups/bookmarkGroup.vala | 11 +- src/actionGroups/clipboardGroup.vala | 11 +- src/actionGroups/devicesGroup.vala | 11 +- src/actionGroups/groupRegistry.vala | 86 +- src/actionGroups/menuGroup.vala | 11 +- src/actionGroups/sessionGroup.vala | 11 +- src/actionGroups/windowListGroup.vala | 11 +- src/actions/action.vala | 10 +- src/actions/actionRegistry.vala | 102 ++- src/actions/appAction.vala | 16 +- src/actions/keyAction.vala | 18 +- src/actions/pieAction.vala | 16 +- src/actions/sigAction.vala | 4 +- src/actions/uriAction.vala | 18 +- src/deamon.vala | 28 +- src/gui/about.vala | 69 -- src/gui/aboutWindow.vala | 76 ++ src/gui/cellRendererIcon.vala | 132 --- src/gui/cellRendererTrigger.vala | 84 -- src/gui/iconSelectWindow.vala | 428 +++++---- src/gui/indicator.vala | 14 +- src/gui/newSliceWindow.vala | 394 +++++++++ src/gui/pieComboList.vala | 155 ++++ src/gui/pieList.vala | 1105 ++++-------------------- src/gui/piePreview.vala | 369 ++++++++ src/gui/piePreviewAddSign.vala | 220 +++++ src/gui/piePreviewCenter.vala | 108 +++ src/gui/piePreviewDeleteSign.vala | 195 +++++ src/gui/piePreviewRenderer.vala | 436 ++++++++++ src/gui/piePreviewSliceRenderer.vala | 276 ++++++ src/gui/preferences.vala | 325 ------- src/gui/preferencesWindow.vala | 311 +++++++ src/gui/renameWindow.vala | 109 +++ src/gui/settingsWindow.vala | 174 ++++ src/gui/sliceTypeList.vala | 172 ++++ src/gui/themeList.vala | 74 +- src/gui/tipViewer.vala | 172 ---- src/gui/triggerSelectButton.vala | 161 ++++ src/gui/triggerSelectWindow.vala | 257 ++---- src/images/icon.vala | 12 +- src/images/image.vala | 67 +- src/images/renderedText.vala | 75 +- src/images/themedIcon.vala | 2 +- src/pies/load.vala | 31 +- src/pies/pie.vala | 38 +- src/pies/pieManager.vala | 54 +- src/pies/save.vala | 8 +- src/renderers/pieRenderer.vala | 74 +- src/renderers/pieWindow.vala | 69 +- src/renderers/sliceRenderer.vala | 23 +- src/themes/theme.vala | 3 + src/utilities/animatedValue.vala | 13 +- src/utilities/bindingManager.vala | 34 +- src/utilities/config.vala | 5 - src/utilities/focusGrabber.vala | 99 ++- src/utilities/key.vala | 26 +- src/utilities/paths.vala | 68 +- src/utilities/trigger.vala | 36 +- vapi/libbamf3.vapi | 166 ++++ vapi/libwnck-3.0.deps | 2 + vapi/libwnck-3.0.vapi | 369 ++++++++ vapi/unique-3.0.deps | 8 + vapi/unique-3.0.vapi | 94 ++ 107 files changed, 10434 insertions(+), 4896 deletions(-) create mode 100644 .valencia create mode 100644 Makefile delete mode 100644 README create mode 100644 README.md delete mode 100644 resources/gnome-pie-indicator.svg create mode 100644 resources/locale/es/LC_MESSAGES/es.po create mode 100644 resources/locale/es/LC_MESSAGES/gnomepie.mo create mode 100644 resources/locale/fr/LC_MESSAGES/fr.po create mode 100644 resources/locale/fr/LC_MESSAGES/gnomepie.mo delete mode 100644 resources/locale/gnomepie.pot delete mode 100644 resources/locale/pt-br/LC_MESSAGES/pt-br.mo create mode 100644 resources/locale/ru/LC_MESSAGES/gnomepie.mo create mode 100644 resources/locale/ru/LC_MESSAGES/ru.po create mode 100644 resources/themes/adwaita/preview.png create mode 100644 resources/themes/bright/preview.png create mode 100644 resources/themes/elementary/preview.png create mode 100644 resources/themes/funky/preview.png create mode 100644 resources/themes/gloss/preview.png create mode 100644 resources/themes/o-pie/preview.png create mode 100644 resources/themes/slim/preview.png create mode 100644 resources/themes/unity/preview.png create mode 100644 resources/ui/icon_select.ui create mode 100644 resources/ui/preferences.ui create mode 100644 resources/ui/rename_pie.ui create mode 100644 resources/ui/settings.ui create mode 100644 resources/ui/slice_select.ui create mode 100644 resources/ui/trigger_select.ui delete mode 100644 src/gui/about.vala create mode 100644 src/gui/aboutWindow.vala delete mode 100644 src/gui/cellRendererIcon.vala delete mode 100644 src/gui/cellRendererTrigger.vala create mode 100644 src/gui/newSliceWindow.vala create mode 100644 src/gui/pieComboList.vala create mode 100644 src/gui/piePreview.vala create mode 100644 src/gui/piePreviewAddSign.vala create mode 100644 src/gui/piePreviewCenter.vala create mode 100644 src/gui/piePreviewDeleteSign.vala create mode 100644 src/gui/piePreviewRenderer.vala create mode 100644 src/gui/piePreviewSliceRenderer.vala delete mode 100644 src/gui/preferences.vala create mode 100644 src/gui/preferencesWindow.vala create mode 100644 src/gui/renameWindow.vala create mode 100644 src/gui/settingsWindow.vala create mode 100644 src/gui/sliceTypeList.vala delete mode 100644 src/gui/tipViewer.vala create mode 100644 src/gui/triggerSelectButton.vala create mode 100644 vapi/libbamf3.vapi create mode 100644 vapi/libwnck-3.0.deps create mode 100644 vapi/libwnck-3.0.vapi create mode 100644 vapi/unique-3.0.deps create mode 100644 vapi/unique-3.0.vapi diff --git a/.gitignore b/.gitignore index e654230..b64af18 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.h build/* gnome-pie -gnome-pie.deb +Makefile +.valencia diff --git a/.valencia b/.valencia new file mode 100644 index 0000000..a9287ae --- /dev/null +++ b/.valencia @@ -0,0 +1,3 @@ +version = 1 +build_command = ./make.sh +clean_command = rm -rf build/ diff --git a/AUTHORS b/AUTHORS index 72aa626..fcb98b2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,3 +8,6 @@ Translations: Riccardo Traverso Magnun Leno Kim Boram +Eduardo Anabalon +Grégoire Bellon-Gervais +Eugene Roskin diff --git a/CMakeLists.txt b/CMakeLists.txt index 41e2c68..c1327bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,51 +24,78 @@ ensure_vala_version("0.11.0" MINIMUM) ################################################################ find_package(PkgConfig) + +# check whether GTK3 is supported +pkg_check_modules(GTK3 gtk+-3.0) + +if (${GTK3_FOUND}) + pkg_check_modules(INDICATOR3 appindicator3-0.1) + pkg_check_modules(UNIQUE REQUIRED unique-3.0) + pkg_check_modules(WNCK REQUIRED libwnck-3.0) + pkg_check_modules(BAMF REQUIRED libbamf3) +else (${GTK3_FOUND}) + pkg_check_modules(GTK2 REQUIRED gtk+-2.0) + pkg_check_modules(INDICATOR appindicator-0.1) + pkg_check_modules(UNIQUE REQUIRED unique-1.0) + pkg_check_modules(WNCK REQUIRED libwnck-1.0) + pkg_check_modules(BAMF REQUIRED libbamf) +endif (${GTK3_FOUND}) + pkg_check_modules(GIO REQUIRED gio-unix-2.0) -pkg_check_modules(GTK REQUIRED gtk+-2.0) pkg_check_modules(CAIRO REQUIRED cairo) pkg_check_modules(GEE REQUIRED gee-1.0) pkg_check_modules(X11 REQUIRED x11) -pkg_check_modules(INDICATOR appindicator-0.1) pkg_check_modules(XML REQUIRED libxml-2.0) pkg_check_modules(XTST REQUIRED xtst) -pkg_check_modules(UNIQUE REQUIRED unique-1.0) -pkg_check_modules(BAMF REQUIRED libbamf) -pkg_check_modules(WNCK REQUIRED libwnck-1.0) pkg_check_modules(GMENU3 libgnome-menu-3.0) find_library(M_LIB m) set(CFLAGS ${GIO_CFLAGS} - ${GTK_CFLAGS} ${GTK_CFLAGS_OTHER} + ${GTK2_CFLAGS} ${GTK2_CFLAGS_OTHER} + ${GTK3_CFLAGS} ${GTK3_CFLAGS_OTHER} ${CAIRO_CFLAGS} ${CAIRO_CFLAGS_OTHER} ${GEE_CFLAGS} ${CAIRO_CFLAGS_OTHER} ${X11_CFLAGS} ${X11_CFLAGS_OTHER} -DGMENU_I_KNOW_THIS_IS_UNSTABLE -DWNCK_I_KNOW_THIS_IS_UNSTABLE -DGETTEXT_PACKAGE="gnomepie" - -s -O3 + -s -O3 -w +# -g ) +# fallback to gtk2 if gtk3 wasn't found +if (${GTK3_FOUND}) + LIST(APPEND CFLAGS -DHAVE_GTK_3) +endif (${GTK3_FOUND}) + +# fallback to gnome-menus2 if gnome-menus3 wasn't found if (${GMENU3_FOUND}) LIST(APPEND CFLAGS -DHAVE_GMENU_3) else (${GMENU3_FOUND}) pkg_check_modules(GMENU REQUIRED libgnome-menu) endif (${GMENU3_FOUND}) +# notify application of presence of libappindicator if (${INDICATOR_FOUND}) LIST(APPEND CFLAGS -DHAVE_APPINDICATOR) endif (${INDICATOR_FOUND}) +if (${INDICATOR3_FOUND}) + LIST(APPEND CFLAGS -DHAVE_APPINDICATOR3) +endif (${INDICATOR3_FOUND}) + add_definitions(${CFLAGS}) set(LIBS ${GIO_LIBRARIES} - ${GTK_LIBRARIES} + ${GTK2_LIBRARIES} + ${GTK3_LIBRARIES} ${CAIRO_LIBRARIES} ${GEE_LIBRARIES} ${INDICATOR_LIBRARIES} + ${INDICATOR3_LIBRARIES} ${XML_LIBRARIES} ${XTST_LIBRARIES} ${GMENU_LIBRARIES} @@ -83,10 +110,12 @@ link_libraries(${LIBS}) set(LIB_PATHS ${GIO_LIBRARY_DIRS} - ${GTK_LIBRARY_DIRS} + ${GTK2_LIBRARY_DIRS} + ${GTK3_LIBRARY_DIRS} ${CAIRO_LIBRARY_DIRS} ${GEE_LIBRARY_DIRS} ${INDICATOR_LIBRARY_DIRS} + ${INDICATOR3_LIBRARY_DIRS} ${XML_LIBRARY_DIRS} ${XTST_LIBRARY_DIRS} ${GMENU_LIBRARY_DIRS} @@ -100,10 +129,12 @@ link_directories(${LIB_PATHS}) set(INCLUDE_PATHS ${GIO_INCLUDE_DIRS} - ${GTK_INCLUDE_DIRS} + ${GTK2_INCLUDE_DIRS} + ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${GEE_INCLUDE_DIRS} ${INDICATOR_INCLUDE_DIRS} + ${INDICATOR3_INCLUDE_DIRS} ${XML_INCLUDE_DIRS} ${XTST_INCLUDE_DIRS} ${GMENU_INCLUDE_DIRS} @@ -122,8 +153,6 @@ include_directories(${INCLUDE_PATHS}) set(EXECUTABLE_OUTPUT_PATH ${gnomepie_SOURCE_DIR}) set(VALA_PKGS - gtk+-2.0 - gdk-x11-2.0 cairo gee-1.0 x11 @@ -131,21 +160,36 @@ set(VALA_PKGS posix libxml-2.0 xtst - unique-1.0 - bamf - libwnck-1.0 ) if (${INDICATOR_FOUND}) LIST(APPEND VALA_PKGS appindicator-0.1) endif (${INDICATOR_FOUND}) +if (${INDICATOR3_FOUND}) + LIST(APPEND VALA_PKGS appindicator3-0.1) +endif (${INDICATOR3_FOUND}) + if (${GMENU3_FOUND}) LIST(APPEND VALA_PKGS libgnome-menu-3.0) else (${GMENU3_FOUND}) LIST(APPEND VALA_PKGS libgnome-menu) endif (${GMENU3_FOUND}) +if (${GTK3_FOUND}) + LIST(APPEND VALA_PKGS gtk+-3.0) + LIST(APPEND VALA_PKGS gdk-x11-3.0) + LIST(APPEND VALA_PKGS libbamf3) + LIST(APPEND VALA_PKGS libwnck-3.0) + LIST(APPEND VALA_PKGS unique-3.0) +else (${GTK3_FOUND}) + LIST(APPEND VALA_PKGS gtk+-2.0) + LIST(APPEND VALA_PKGS gdk-x11-2.0) + LIST(APPEND VALA_PKGS bamf) + LIST(APPEND VALA_PKGS libwnck-1.0) + LIST(APPEND VALA_PKGS unique-1.0) +endif (${GTK3_FOUND}) + add_subdirectory(src) ################################################################ @@ -169,10 +213,12 @@ message( "Summary:" ) message( " EXECUTABLE_OUTPUT_PATH = ${EXECUTABLE_OUTPUT_PATH}" ) message( " VALA_EXECUTABLE = ${VALA_EXECUTABLE}" ) message( "Libs:" ) -message( " GTK_LIBRARIES = ${GTK_LIBRARIES}" ) +message( " GTK2_LIBRARIES = ${GTK2_LIBRARIES}" ) +message( " GTK3_LIBRARIES = ${GTK3_LIBRARIES}" ) message( " CAIRO_LIBRARIES = ${CAIRO_LIBRARIES}" ) message( " GEE_LIBRARIES = ${GEE_LIBRARIES}" ) message( " INDICATOR_LIBRARIES = ${INDICATOR_LIBRARIES}" ) +message( " INDICATOR3_LIBRARIES = ${INDICATOR3_LIBRARIES}" ) message( " XML_LIBRARIES = ${XML_LIBRARIES}" ) message( " XTST_LIBRARIES = ${XTST_LIBRARIES}" ) message( " GMENU_LIBRARIES = ${GMENU_LIBRARIES}" ) diff --git a/INSTALL b/INSTALL index 16788e5..e15f36b 100644 --- a/INSTALL +++ b/INSTALL @@ -2,17 +2,26 @@ # Compiling and installing Gnome-Pie # #################################################################### -First of all, install all dependancies: +First of all, install all dependancies. +For compilation and linking against GTK3: -sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev - libgee-dev libxml2-dev libxtst-dev - libgnome-menu-dev valac cmake libunique-dev + sudo apt-get install libgtk-3-dev libcairo2-dev libappindicator3-dev + libgee-dev libxml2-dev libxtst-dev + libgnome-menu-3-dev valac cmake libunique-3.0-dev + libbamf3-dev libwnck-3-dev + +For compilation and linking against GTK2: + + sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev + libgee-dev libxml2-dev libxtst-dev + libgnome-menu-dev valac cmake libunique-dev + libbamf-dev libwnck-dev Then build Gnome-Pie by typing: -./make.sh + ./make.sh Launch it with -./gnome-pie + ./gnome-pie If you want to install it system wide use cd build && sudo make install diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c96c817 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +BUILD_ROOT = 1 +PROGRAM=gnome-pie diff --git a/README b/README deleted file mode 100644 index 1d71775..0000000 --- a/README +++ /dev/null @@ -1,85 +0,0 @@ -#################################################################### -# Gnome-Pie # -#################################################################### - -This is an experimantal attempt to create a visual application -launcher for the Gnome Desktop. - -Homepage: http://gnome-pie.simonschneegans.de - -It is inspired by the an addon written for the game World of Warcraft. -(http://go-hero.net/opie/) - -#################################################################### -# About this Branch # -#################################################################### - -This is the master branch of Gnome-Pie. - -#################################################################### -# PPA # -#################################################################### - -There is a PPA with a recent version of Gnome-Pie. If you simply -want to test it, it's very easy to install: - -sudo add-apt-repository ppa:simonschneegans/testing -sudo apt-get update -sudo apt-get install gnome-pie - -#################################################################### -# Compiling # -#################################################################### - -First of all, install all dependancies: - -sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev - libgee-dev libxml2-dev libxtst-dev - libgnome-menu-dev valac cmake libunique-dev - libbamf-dev libwnck-dev - -Then build Gnome-Pie by typing: -./make.sh - -Launch it with -./gnome-pie - -If you want to install it system wide use -cd build && sudo make install - -#################################################################### -# Usage # -#################################################################### - -Now you may launch it by Pressing A to open up a default -Pie with your default applications. There are some other Pies -defined --- just open up the configuration dialog by activating the -appropriate entry in the appindicator menu or by launching gnome-pie -for a second time. There you may configure the Pies to suit your -needs. - -You can open Pies not only by presing their key stroke. -Alternatively you may open any Pie by invoking gnome-pie --open 123 -where 123 is the ID of the desired Pie (which is displayed in the -configuration dialog). - -#################################################################### -# License # -#################################################################### - -Copyright (C) 2011 Simon Schneegans - -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, either version 3 of the License, or -(at your option) any later version. - -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 . - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9d6698 --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +Gnome-Pie +====== + +**Gnome-Pie** is a circular application launcher for Linux. It is made of several pies, each consisting of multiple slices. The user presses a key stroke which opens the desired pie. By activating one of its slices, applications may be launched, key presses may be simulated or files can be opened. + +Feel free to visit its **homepage** at http://gnome-pie.simonschneegans.de + +It is inspired by an addon written for the game World of Warcraft. +(http://go-hero.net/opie/) + +## Installing from a PPA! + +There is a PPA with a recent version of Gnome-Pie. If you simply want to test it, it's very easy to install: + +~~~~ +sudo add-apt-repository ppa:simonschneegans/testing +sudo apt-get update +sudo apt-get install gnome-pie +~~~~ + +## Compiling and installing from source! + +First of all, install all dependancies. For compilation and linking against GTK3: + +~~~~ +sudo apt-get install libgtk-3-dev libcairo2-dev libappindicator3-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-3-dev valac cmake libunique-3.0-dev libbamf3-dev libwnck-3-dev bamfdaemon +~~~~ + +For compilation and linking against GTK2: + +~~~~ +sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-dev valac cmake libunique-dev libbamf-dev libwnck-dev bamfdaemon +~~~~ + +Then build Gnome-Pie by typing: + +~~~~ +./make.sh +~~~~ + +Launch it with + +~~~~ +./gnome-pie +~~~~ + +If you want to install it system wide use + +~~~~ +cd build && sudo make install +~~~~ + +## Usage! + +Now you may launch it by Pressing A to open up a default Pie with your default applications. There are some other Pies defined --- just open up the configuration dialog by activating the appropriate entry in the appindicator menu or by launching gnome-pie for a second time. There you may configure the Pies to suit your needs. + +You can open Pies not only by presing their key stroke. Alternatively you may open any Pie by invoking gnome-pie --open 123 where 123 is the ID of the desired Pie (which is displayed in the configuration dialog). + +## Support my work! + +I really like working on Gnome-Pie — and you can help improving it! There are multiple ways: + +### Translate Gnome-Pie! + +This is really easy: [There is an easy-to-follow step-by-step-guide available](http://www.simonschneegans.de/?p=439)! + +### Create Themes for Gnome-Pie! + +If you have some ideas on how Gnome-Pie should look: It’s easy to create new themes! I would love to include some true art in this software! [There is an comprehensive guide as well](http://www.simonschneegans.de/?p=246). + +### Donate! + +If you can’t afford the time to do the stuff mentioned above, but still want to help — you can help improving this software by buying some drinks for a poor student ;) ! You can [do this with the Flattr](http://flattr.com/thing/468485/Gnome-Pie) or by [donating via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X65SUVC4ZTQSC). If you happen to dislike PayPal, send a mail to code@simonschneegans.de and we can chat about this! + +## License + +Copyright (C) 2011-2012 Simon Schneegans + +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, either version 3 of the License, or (at your option) any later version. + +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 . diff --git a/TRANSLATING b/TRANSLATING index 5112af7..cf2cce0 100644 --- a/TRANSLATING +++ b/TRANSLATING @@ -29,7 +29,7 @@ UPDATING AN EXISTENT TRANSLATION 1. Update the gnomepie.pot file * navigate with a terminal to the directory "resources/locale" * enter the command "./gen-pot.sh" -2. Updste your translation file +2. Update your translation file * enter the command "./update-po.sh" * follow instructions 3. Translate to your language diff --git a/resources/gnome-pie-indicator.svg b/resources/gnome-pie-indicator.svg deleted file mode 100644 index bfeb5bd..0000000 --- a/resources/gnome-pie-indicator.svg +++ /dev/null @@ -1,770 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/locale/compile-po.sh b/resources/locale/compile-po.sh index 6b201de..f0944a3 100755 --- a/resources/locale/compile-po.sh +++ b/resources/locale/compile-po.sh @@ -2,5 +2,6 @@ for d in `ls -d */` do + echo -n "$d " msgfmt -c -v $d/LC_MESSAGES/*.po -o $d/LC_MESSAGES/gnomepie.mo done diff --git a/resources/locale/de/LC_MESSAGES/de.po b/resources/locale/de/LC_MESSAGES/de.po index 9057020..9a43a67 100644 --- a/resources/locale/de/LC_MESSAGES/de.po +++ b/resources/locale/de/LC_MESSAGES/de.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: gnomepie 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-08 18:03+0100\n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" "PO-Revision-Date: 2011-08-25 21:04+0200\n" -"Last-Translator: Simon Schneegans \n" +"Last-Translator: Simon Schneegans \n" "Language-Team: German\n" "Language: de\n" "MIME-Version: 1.0\n" @@ -17,369 +17,252 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../../src/actions/keyAction.vala:33 +#: ../../src/actions/keyAction.vala:34 msgid "Press hotkey" msgstr "Tastenkombination" -#: ../../src/actions/appAction.vala:33 +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "Simuliert einen Tastendruck." + +#: ../../src/actions/appAction.vala:34 msgid "Launch application" msgstr "Programm ausführen" -#: ../../src/actions/uriAction.vala:33 +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "Führt einen gegebenen Befehl aus." + +#: ../../src/actions/uriAction.vala:34 msgid "Open URI" msgstr "URI öffnen" -#: ../../src/actions/actionRegistry.vala:107 +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "Öffnet URLs oder Dateipfade." + +#: ../../src/actions/actionRegistry.vala:111 msgid "Trash" msgstr "Müll" -#: ../../src/actions/pieAction.vala:33 +#: ../../src/actions/pieAction.vala:34 msgid "Open Pie" msgstr "Pie öffnen" -#: ../../src/gui/triggerSelectWindow.vala:69 -msgid "Define an open-command" -msgstr "Einen Hotkey festlegen" - -#: ../../src/gui/triggerSelectWindow.vala:87 -msgid "Click here if you want to bind a mouse button!" -msgstr "Klicke hier um eine Maustaste zu binden" - -#: ../../src/gui/triggerSelectWindow.vala:102 -msgid "Turbo mode" -msgstr "Turbo-Mode" - -#: ../../src/gui/triggerSelectWindow.vala:103 -msgid "If checked, the Pie will close when you release the chosen hot key." -msgstr "Falls aktiviert schließt sich der Pie wieder automatisch, wenn der Hotkey losgelassen wird." - -#: ../../src/gui/triggerSelectWindow.vala:117 -msgid "Long press for activation" -msgstr "Verzögerte Aktivierung" - -#: ../../src/gui/triggerSelectWindow.vala:118 -msgid "" -"If checked, the Pie will only open if you press this hot key a bit longer." -msgstr "Falls aktiviert wird sich der Pie erst öffnen, wenn der Hotkey länger gedrückt gehalten wird." +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "" +"Öffnet einen anderen Pie. Auf diese Art können Submenüs erstellt werden." -#: ../../src/gui/triggerSelectWindow.vala:158 +#: ../../src/gui/triggerSelectWindow.vala:144 msgid "" "This hotkey is already assigned to the pie \"%s\"! \n" "\n" "Please select another one or cancel your selection." -msgstr "Dieser Hotkey ist schon dem Pie \"%s\" zugeordnet!\n Bitte wähle einen anderen!" - -#: ../../src/gui/triggerSelectWindow.vala:199 -msgid "" -"It possible to make your system unusable if you bind a Pie to your left " -"mouse button. Do you really want to do this?" -msgstr "Wahrscheinlich machst du dein System unbenutzbar, wenn du die linke Maustaste bindest. Willst du das wirklich?" - -#: ../../src/gui/preferences.vala:32 -msgid "Gnome-Pie - Settings" -msgstr "Gnome-Pie - Einstellungen" - -#: ../../src/gui/preferences.vala:55 -msgid "Behavior" -msgstr "Verhalten" - -#: ../../src/gui/preferences.vala:65 -msgid "Startup on Login" -msgstr "Beim Anmelden automatisch ausführen" - -#: ../../src/gui/preferences.vala:66 -msgid "If checked, Gnome-Pie will start when you log in." -msgstr "Durch Aktivierung dieser Option wird Gnome-Pie automatisch starten, wenn du dich anmeldest." - -#: ../../src/gui/preferences.vala:72 -msgid "Show Indicator" -msgstr "Benachrichtigungssymbol anzeigen" - -#: ../../src/gui/preferences.vala:73 -msgid "" -"If checked, an indicator for easy access of the settings menu is shown in " -"your panel." -msgstr "Durch Aktivierung wird ein Indikator in deinem Panel angezeigt." - -#: ../../src/gui/preferences.vala:79 -msgid "Open Pies at Mouse" -msgstr "Pies an der Maus öffnen" - -#: ../../src/gui/preferences.vala:80 -msgid "" -"If checked, pies will open at your pointer. Otherwise they'll pop up in the " -"middle of the screen." -msgstr "Wenn aktiviert öffnen sich die Pies direkt an der Maus. Sonst öffnen sie sich in der Mitte des Bildschirms." - -#: ../../src/gui/preferences.vala:89 -msgid "Global Scale" -msgstr "Skalierungsfaktor" - -#: ../../src/gui/preferences.vala:126 -msgid "Themes" -msgstr "Themen" - -#: ../../src/gui/preferences.vala:144 -msgid "General" -msgstr "Allgemein" - -#: ../../src/gui/preferences.vala:149 -msgid "Pies" -msgstr "Pies" - -#: ../../src/gui/preferences.vala:173 -msgid "You can right-click in the list for adding or removing entries." msgstr "" -"Zum Löschen und Hinzufügen von Einträgen kannst \n" -"du mit der rechten Maustaste in die Liste klicken." - -#: ../../src/gui/preferences.vala:174 -msgid "" -"You can reset Gnome-Pie to its default options with the terminal command " -"\"gnome-pie --reset\"." -msgstr "Du kannst Gnome-Pie mit dem Terminalbefehl \"gnome-pie --reset\" auf die Standardeinstellungen zurücksetzen." - -#: ../../src/gui/preferences.vala:175 -msgid "" -"The radiobutton at the beginning of each slice-line indicates the " -"QuickAction of the pie." -msgstr "Der Auswahlknopf vor jeder Slice zeigt die QuickAction jeder Pie an." - -#: ../../src/gui/preferences.vala:176 -msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "Pies können mit dem Befehl \"gnome-pie --open=ID\" geöffnet werden." +"Dieser Hotkey ist schon dem Pie \"%s\" zugeordnet!\n" +" Bitte wähle einen anderen!" -#: ../../src/gui/preferences.vala:177 -msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "Besuche Gnome-Pies Homepage auf %s!" +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "Kein Pie gewählt." -#: ../../src/gui/preferences.vala:178 -msgid "You can drag'n'drop applications from your main menu to the list above." -msgstr "Du kannst Anwendungen von deinem Hauptmenü in die obige Liste ziehen." - -#: ../../src/gui/preferences.vala:179 -msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "Wenn du Feedback geben willst, schick eine E-Mail an %s!" - -#: ../../src/gui/preferences.vala:180 -msgid "" -"You may drag'n'drop URLs and bookmarks from your internet browser to the " -"list above." -msgstr "Du kannst URLs und Links aus deinem Internet-Browser in die Liste ziehen." - -#: ../../src/gui/preferences.vala:181 -msgid "Bugs can be reported at %s!" -msgstr "Bugs können auf %s gemeldet werden!" - -#: ../../src/gui/preferences.vala:182 -msgid "" -"It's possible to drag'n'drop files and folders from your file browser to the " -"list above." -msgstr "Es ist möglich Dateien und Verzeichnisse aus deinem Datei-Browser in die Liste zu ziehen!" - -#: ../../src/gui/preferences.vala:183 -msgid "" -"It's recommended to keep your Pies small (at most 6-8 Slices). Else they " -"will become hard to navigate." -msgstr "Es ist empfehlenswert, nur maximal acht Slices pro Pie zu verwenden. Sonst wird die Navigation schwierig." +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Neuer Pie" -#: ../../src/gui/preferences.vala:184 +#: ../../src/gui/preferencesWindow.vala:190 msgid "" -"In order to create a launcher for a Pie, drag the Pie from the list to your " -"desktop!" -msgstr "Du kannst Launcher für Pies erstellen. Ziehe sie dazu von obiger Liste auf deinen Desktop!" - -#: ../../src/gui/preferences.vala:193 -msgid "Moves the selected Slice down" -msgstr "" -"Verschiebt die gewählte Slice nach unten." - -#: ../../src/gui/preferences.vala:205 -msgid "Moves the selected Slice up" -msgstr "" -"Verschiebt die gewählte Slice nach oben." - -#: ../../src/gui/themeList.vala:88 -msgid "by" -msgstr "von" - -#: ../../src/gui/pieList.vala:88 ../../src/gui/pieList.vala:850 -msgid "Slice group" -msgstr "Slice-Gruppe" - -#: ../../src/gui/pieList.vala:135 -msgid "Icon" -msgstr "Symbol" - -#: ../../src/gui/pieList.vala:200 -msgid "Command" -msgstr "Kommando" - -#: ../../src/gui/pieList.vala:301 ../../src/gui/pieList.vala:706 -#: ../../src/gui/pieList.vala:866 ../../src/utilities/bindingManager.vala:156 -#: ../../src/utilities/trigger.vala:197 ../../src/utilities/trigger.vala:198 -msgid "Not bound" -msgstr "Nicht zugewiesen" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "Soll dieser Pie wirklich mit allen Slices gelöscht werden?" -#: ../../src/gui/pieList.vala:366 -msgid "Pie-ID / Action type" -msgstr "Pie-ID / Slicetyp" +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "Benenne mich!" -#: ../../src/gui/pieList.vala:427 -msgid "Name" -msgstr "Name" +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "Editieren durch klicken" -#: ../../src/gui/pieList.vala:470 -msgid "Add new Pie" -msgstr "Pie hinzufügen" +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "Verschieben durch ziehen" -#: ../../src/gui/pieList.vala:475 -msgid "Add new Slice" -msgstr "Slice hinzufügen" +#: ../../src/gui/piePreviewRenderer.vala:295 +msgid "Click to add a new Slice" +msgstr "Neue Slice durch Klicken hinzufügen" -#: ../../src/gui/pieList.vala:483 -msgid "Delete" -msgstr "Eintrag löschen" +#: ../../src/gui/piePreviewRenderer.vala:299 +msgid "Drop to add as new Slice" +msgstr "Als neue Slice hinzuzufügen" -#: ../../src/gui/pieList.vala:618 -msgid "New Pie" -msgstr "Neuer Pie" +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "Slice verschieben" -#: ../../src/gui/pieList.vala:665 -msgid "New Action" -msgstr "Neue Slice" +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "Löschen durch klicken" -#: ../../src/gui/pieList.vala:679 -msgid "You have to select a Pie to add a Slice to!" -msgstr "" -"Es muss ein Pie ausgewählt sein, zu dem eine Slice hinzugefügt werden soll!" +#: ../../src/gui/triggerSelectButton.vala:59 +msgid "Press a hotkey ..." +msgstr "Wählen..." -#: ../../src/gui/pieList.vala:729 -msgid "You have to select a Pie or a Slice to delete!" -msgstr "Es muss etwas ausgewählt sein, das gelöscht werden soll!" +#: ../../src/gui/piePreview.vala:120 +msgid "Do you really want to delete this Slice?" +msgstr "Soll die ausgewählte Slice wirklich gelöscht werden?" -#: ../../src/gui/pieList.vala:740 -msgid "" -"Do you really want to delete the selected Pie with all contained Slices?" -msgstr "Soll dieser Pie wirklich mit allen Slices gelöscht werden?" +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Themen" -#: ../../src/gui/pieList.vala:774 -msgid "Do you really want to delete the selected Slice?" -msgstr "Soll die ausgewählte Slice wirklich gelöscht werden?" +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "Von" -#: ../../src/gui/iconSelectWindow.vala:160 -msgid "Choose an Icon" -msgstr "Wähle ein Symbol" +#: ../../src/gui/sliceTypeList.vala:56 +msgid "Slice types" +msgstr "Slice-Typen" -#: ../../src/gui/iconSelectWindow.vala:196 +#: ../../src/gui/iconSelectWindow.vala:178 msgid "All icons" msgstr "Alle Symbole" -#: ../../src/gui/iconSelectWindow.vala:197 +#: ../../src/gui/iconSelectWindow.vala:179 #: ../../src/pies/defaultConfig.vala:36 msgid "Applications" msgstr "Anwendungen" -#: ../../src/gui/iconSelectWindow.vala:198 +#: ../../src/gui/iconSelectWindow.vala:180 msgid "Actions" msgstr "Aktionen" -#: ../../src/gui/iconSelectWindow.vala:199 +#: ../../src/gui/iconSelectWindow.vala:181 msgid "Places" msgstr "Orte" -#: ../../src/gui/iconSelectWindow.vala:200 +#: ../../src/gui/iconSelectWindow.vala:182 msgid "File types" msgstr "Dateitypen" -#: ../../src/gui/iconSelectWindow.vala:201 +#: ../../src/gui/iconSelectWindow.vala:183 msgid "Emotes" msgstr "Smilies" -#: ../../src/gui/iconSelectWindow.vala:202 +#: ../../src/gui/iconSelectWindow.vala:184 msgid "Miscellaneous" msgstr "Sonstige" -#: ../../src/gui/iconSelectWindow.vala:279 -msgid "Icon Theme" -msgstr "Symbolthema" - -#: ../../src/gui/iconSelectWindow.vala:289 +#: ../../src/gui/iconSelectWindow.vala:257 msgid "All supported image formats" msgstr "Alle unterstützten Bildformate" -#: ../../src/gui/iconSelectWindow.vala:311 -msgid "Custom Icon" -msgstr "Benutzerdefiniertes Symbol" +#: ../../src/actionGroups/windowListGroup.vala:34 +msgid "Group: Window List" +msgstr "Gruppe: Fensterliste" -#: ../../src/actionGroups/windowListGroup.vala:33 -msgid "Window List" -msgstr "Fensterliste" +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "Zeigt eine Slice für jedes geöffnete Fenster an." -#: ../../src/actionGroups/menuGroup.vala:34 -msgid "Main menu" -msgstr "Hauptmenü" +#: ../../src/actionGroups/menuGroup.vala:35 +msgid "Group: Main menu" +msgstr "Gruppe: Hauptmenü" -#: ../../src/actionGroups/clipboardGroup.vala:63 -msgid "Clipboard" -msgstr "Zwischenablage" +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "Zeigt das Hauptmenü an." -#: ../../src/actionGroups/sessionGroup.vala:34 -msgid "Session Control" -msgstr "Sitzung" +#: ../../src/actionGroups/clipboardGroup.vala:64 +msgid "Group: Clipboard" +msgstr "Gruppe: Zwischenablage" -#: ../../src/actionGroups/sessionGroup.vala:52 +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "Verwaltet die Zwischenablage." + +#: ../../src/actionGroups/sessionGroup.vala:35 +msgid "Group: Session Control" +msgstr "Gruppe: Sitzung" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "" +"Zeigt eine Slice für Herunterfahren, Neustarten und den Ruhezustand an." + +#: ../../src/actionGroups/sessionGroup.vala:60 msgid "Shutdown" msgstr "Herunterfahren" -#: ../../src/actionGroups/sessionGroup.vala:55 +#: ../../src/actionGroups/sessionGroup.vala:63 msgid "Logout" msgstr "Ausloggen" -#: ../../src/actionGroups/sessionGroup.vala:58 +#: ../../src/actionGroups/sessionGroup.vala:66 msgid "Reboot" msgstr "Neustarten" -#: ../../src/actionGroups/bookmarkGroup.vala:35 -#: ../../src/pies/defaultConfig.vala:45 -msgid "Bookmarks" -msgstr "Lesezeichen" +#: ../../src/actionGroups/bookmarkGroup.vala:36 +msgid "Group: Bookmarks" +msgstr "Gruppe: Lesezeichen" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "Zeigt eine Slice für jedes Ordner-Lesezeichen an." -#: ../../src/actionGroups/devicesGroup.vala:34 -msgid "Devices" -msgstr "Laufwerke" +#: ../../src/actionGroups/devicesGroup.vala:35 +msgid "Group: Devices" +msgstr "Gruppe: Laufwerke" -#: ../../src/actionGroups/devicesGroup.vala:82 +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "" +"Zeigt eine Slice für jedes angeschlossene Gerät, wie z. B. USB Sticks, an. " + +#: ../../src/actionGroups/devicesGroup.vala:85 msgid "Root" msgstr "Dateisystem" -#: ../../src/utilities/trigger.vala:152 +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "Nicht zugewiesen" + +#: ../../src/utilities/trigger.vala:163 msgid "Button %i" msgstr "Taste %i" -#: ../../src/utilities/trigger.vala:155 +#: ../../src/utilities/trigger.vala:166 msgid "LeftButton" msgstr "MausLinks" -#: ../../src/utilities/trigger.vala:157 +#: ../../src/utilities/trigger.vala:168 msgid "RightButton" msgstr "MausRechts" -#: ../../src/utilities/trigger.vala:159 +#: ../../src/utilities/trigger.vala:170 msgid "MiddleButton" msgstr "Mausrad" -#: ../../src/utilities/trigger.vala:181 ../../src/utilities/trigger.vala:183 +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 msgid "Turbo" msgstr "Turbo" -#: ../../src/utilities/trigger.vala:181 ../../src/utilities/trigger.vala:185 +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 msgid "Delayed" msgstr "Verzögert" +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "Zentriert" + #: ../../src/pies/defaultConfig.vala:29 msgid "Multimedia" -msgstr "" +msgstr "Multimedia" #: ../../src/pies/defaultConfig.vala:30 msgid "Next Track" @@ -397,6 +280,10 @@ msgstr "Vorheriger Titel" msgid "Play/Pause" msgstr "Play/Pause" +#: ../../src/pies/defaultConfig.vala:45 +msgid "Bookmarks" +msgstr "Lesezeichen" + #: ../../src/pies/defaultConfig.vala:50 msgid "Session" msgstr "Sitzung" @@ -429,5 +316,172 @@ msgstr "Maximieren" msgid "Restore" msgstr "Wiederherstellen" -#~ msgid "Click to activate a Slice" -#~ msgstr "Klicken um Slices zu aktivieren" +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "Wähle ein Symbol" + +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Symbolthema" + +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Benutzerdefiniertes Symbol" + +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "Aktivierungsoptionen" + +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "Es ist auch möglich, Maustasten zu binden!" + +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Turbo-Mode" + +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "" +"Falls aktiviert schließt sich der Pie wieder automatisch, wenn der Hotkey " +"losgelassen wird." + +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Verzögerte Aktivierung" + +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"Falls aktiviert, wird sich der Pie erst öffnen, wenn der Hotkey länger " +"gedrückt gehalten wird." + +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "Zentriert auf dem Bildschirm öffnen" + +#: ../ui/trigger_select.ui:114 +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"Falls aktiviert, wird sich der Pie nicht an der Maus, sondern in der Mitte " +"des Bildschirms öffnen." + +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "Aktivierungsoptionen" + +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +msgid "General Settings" +msgstr "Allgemeine Einstellungen" + +#: ../ui/settings.ui:47 +msgid "Start Gnome-Pie on login" +msgstr "Beim Anmelden automatisch ausführen" + +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "Wenn aktiviert, startet Gnome-Pie im Hintergrund beim Anmelden." + +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "Zeige ein Symbol im Panel" + +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" +"Falls nicht aktiviert, kann dieses Menü durch ein nochmaliges starten von " +"Gnome-Pie geöffnet werden." + +#: ../ui/settings.ui:92 +msgid "Global scale" +msgstr "Skalierungsfaktor" + +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "Erscheinungsbild and Verhalten" + +#: ../ui/slice_select.ui:8 +msgid "Slice Options" +msgstr "Slice-Optionen" + +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "Es gibt keine Otionen für diesen Slice-Typ." + +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "Name" + +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "URI" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "Befehl" + +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "Tastenkomination" + +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "Pie" + +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "Ist Quick Action" + +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "Diese Slice wird aktiviert, falls du in die Mitte des Pies klickst." + +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "Slice-Optionen" + +#: ../ui/preferences.ui:8 +msgid "Gnome-Pie Settings" +msgstr "Gnome-Pie - Einstellungen" + +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" +"Der Pie ist leer!\n" +"\n" +"Füge Slices hinzu! Du kannst viele verschieden Dinge zu dem Pluszeichen " +"ziehen! Zum Beispiel Anwendungsstarter aus deinem Menü, Dateien oder sogar " +"URLs aus dem Browser... \n" +"\n" +"Zur manuellen und fortgeschrittenen Konfiguration klicke auf das Symbol." + +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" +"Du hast keine Pies!\n" +"\n" +"Erstelle einen neuen! Klicke dazu einfach auf das kleine Pluszeichen " +"unter der leeren Liste auf der linken Seite." + +#: ../ui/rename_pie.ui:6 +msgid "Rename a Pie" +msgstr "Pie umbenennen" + +#~ msgid "Appearance Options" +#~ msgstr "Erscheinungsbild" diff --git a/resources/locale/de/LC_MESSAGES/gnomepie.mo b/resources/locale/de/LC_MESSAGES/gnomepie.mo index a5b5efb..f2c36f1 100644 Binary files a/resources/locale/de/LC_MESSAGES/gnomepie.mo and b/resources/locale/de/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/es/LC_MESSAGES/es.po b/resources/locale/es/LC_MESSAGES/es.po new file mode 100644 index 0000000..f549d5c --- /dev/null +++ b/resources/locale/es/LC_MESSAGES/es.po @@ -0,0 +1,661 @@ +# Spanish translations for gnomepie package. +# Copyright (C) 2011 Simon Schneegans +# This file is distributed under the same license as the gnomepie package. +# Eduardo Anabalon , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: gnomepie 0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-01-19 19:42-0300\n" +"PO-Revision-Date: 2011-11-20 19:11-0300\n" +"Last-Translator: Eduardo Anabalon \n" +"Language-Team: Spanish\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../../src/pies/defaultConfig.vala:29 +msgid "Multimedia" +msgstr "Multimedia" + +#: ../../src/pies/defaultConfig.vala:30 +msgid "Next Track" +msgstr "Pista Siguiente" + +#: ../../src/pies/defaultConfig.vala:31 +msgid "Stop" +msgstr "Parar" + +#: ../../src/pies/defaultConfig.vala:32 +msgid "Previous Track" +msgstr "Pista Anterior" + +#: ../../src/pies/defaultConfig.vala:33 +msgid "Play/Pause" +msgstr "Reproducir/Pausa" + +#: ../../src/pies/defaultConfig.vala:36 +#: ../../src/gui/iconSelectWindow.vala:179 +msgid "Applications" +msgstr "Aplicaciones" + +#: ../../src/pies/defaultConfig.vala:45 +msgid "Bookmarks" +msgstr "Marcadores" + +#: ../../src/pies/defaultConfig.vala:50 +msgid "Session" +msgstr "Sesión" + +#: ../../src/pies/defaultConfig.vala:54 +msgid "Main Menu" +msgstr "Menú Principal" + +#: ../../src/pies/defaultConfig.vala:58 +msgid "Window" +msgstr "Ventana" + +#: ../../src/pies/defaultConfig.vala:59 +msgid "Scale" +msgstr "Escala" + +#: ../../src/pies/defaultConfig.vala:60 +msgid "Minimize" +msgstr "Minimizar" + +#: ../../src/pies/defaultConfig.vala:61 +msgid "Close" +msgstr "Cerrar" + +#: ../../src/pies/defaultConfig.vala:62 +msgid "Maximize" +msgstr "Maximizar" + +#: ../../src/pies/defaultConfig.vala:63 +msgid "Restore" +msgstr "Restaurar" + +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "Basura" + +#: ../../src/actions/uriAction.vala:34 +msgid "Open URI" +msgstr "Abrir URI" + +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "Abre un lugar determinado. Puedes usar URL's o rutas a archivos." + +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "Abrir Pastel" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "Abre otro Pastel de Gnome-Pie. De esta manera puedes crear submenús." + +#: ../../src/actions/keyAction.vala:34 +msgid "Press hotkey" +msgstr "Presiona un atajo de teclado" + +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "Simula la activación de un atajo de teclado." + +#: ../../src/actions/appAction.vala:34 +msgid "Launch application" +msgstr "Lanzar una aplicación" + +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "Ejecutar el comando dado." + +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "Renombrame!" + +#: ../../src/gui/triggerSelectButton.vala:59 +#: ../../src/gui/hotkeySelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "Presiona un atajo de teclado" + +#: ../../src/gui/triggerSelectWindow.vala:144 +msgid "" +"This hotkey is already assigned to the pie \"%s\"! \n" +"\n" +"Please select another one or cancel your selection." +msgstr "" +"Este atajo de teclado ya está asignado al pastel \"%s\"! \n" +"\n" +"Por favor seleciona otro o cancela la selección." + +#: ../../src/gui/iconSelectWindow.vala:178 +msgid "All icons" +msgstr "Todos los iconos" + +#: ../../src/gui/iconSelectWindow.vala:180 +msgid "Actions" +msgstr "Acciones" + +#: ../../src/gui/iconSelectWindow.vala:181 +msgid "Places" +msgstr "Lugares" + +#: ../../src/gui/iconSelectWindow.vala:182 +msgid "File types" +msgstr "Tipos de archivo" + +#: ../../src/gui/iconSelectWindow.vala:183 +msgid "Emotes" +msgstr "Emotes" + +#: ../../src/gui/iconSelectWindow.vala:184 +msgid "Miscellaneous" +msgstr "Misceláneos" + +#: ../../src/gui/iconSelectWindow.vala:257 +msgid "All supported image formats" +msgstr "Todos los formatos de imágenes soportados" + +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "¿Realmente quieres borrar la Rebanada seleccionada?" + +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "Tipos de Rebanadas" + +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "Pastel no seleccionado." + +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Nuevo Pastel" + +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "" +"¿Realmente quieres borrar el Pastel seleccionado junto a todas sus Rebanadas?" + +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "Click para editar" + +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "Arrastra para mover" + +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" +msgstr "Añadir una nueva Rebanada" + +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "Añadir una nueva Rebanada" + +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "Suelta para mover la Rebanada" + +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "Click para borrar" + +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Temas" + +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "Por" + +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" +msgstr "Control de Sesión" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "Muestra una Rebanada para Apagar, Reiniciar, e Hibernar." + +#: ../../src/actionGroups/sessionGroup.vala:60 +msgid "Shutdown" +msgstr "Apagar" + +#: ../../src/actionGroups/sessionGroup.vala:63 +msgid "Logout" +msgstr "Cerrar Sesión" + +#: ../../src/actionGroups/sessionGroup.vala:66 +msgid "Reboot" +msgstr "Reiniciar" + +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "Grupo: Dispositivos" + +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "Muestra una Rebanada por cada dispositivo conectado, como USB-Sticks." + +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "Root" + +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" +msgstr "Grupo: Marcadores" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "Muestra una Rebanada por cada uno de tus Marcadores." + +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "Grupo: Portapapeles" + +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "Administra tu Portapapeles." + +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" +msgstr "Grupo: Menú principal" + +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "Muestra la estructura del menu principal." + +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "Grupo: Lista de ventana" + +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "Muestra una Rebanada por cada Ventana abierta. Casi como Alt-Tab." + +#: ../../src/utilities/bindingManager.vala:155 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +#: ../../src/utilities/key.vala:65 +msgid "Not bound" +msgstr "No encontrado" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "Botón %i" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "Botón Izquierdo" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "Botón Derecho" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "Botón Central" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "Turbo" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "Retrasado" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "Centrado" + +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "Gnome-Pie - Configuraciones" + +#: ../ui/settings.ui:47 ../ui/appearance.ui:46 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "Arrancar al iniciar" + +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "Si está activada, Gnome-Pie arrancará silenciosamente cada vez que inicies sesión." + +#: ../ui/settings.ui:66 ../ui/appearance.ui:62 +msgid "Display panel icon " +msgstr "Mostrar panel de iconos " + +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" +"Si no está activada, puedes entrar a este menu arrancando Gnome-Pie por " +"segunda vez." + +#: ../ui/settings.ui:92 ../ui/appearance.ui:123 +#, fuzzy +msgid "Global scale" +msgstr "Escala Global" + +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "Apariencia y comportamiento" + +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "Selecciona un icono" + +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Tema de iconos" + +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Icono personalizado" + +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "Configuración de activación" + +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "Es posible enlazar los botones del ratón también!" + +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Modo turbo" + +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "Si está activada, el Pastel se cerrará cuando sueltes el atajo de teclado selecionado." + +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Pulsación larga para activar" + +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"Si está activada, el Pastel solo se abrirá si mantienes presionado el atajo de teclado un poco " +"más." + +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "Abre el Pastel en el centro de la pantalla" + +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"Si está activada, el Pastel abrirá en el medio de la pantalla. De lo contrario aparecerá " +"en el puntero del ratón." + +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "Opciones de activación" + +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "Renombrar Pastel" + +#: ../ui/appearance.ui:8 +#, fuzzy +msgid "Appearance Options" +msgstr "Opciones de apariencia" + +#: ../ui/appearance.ui:84 +#, fuzzy +msgid "Behavior" +msgstr "Comportamiento" + +#: ../ui/appearance.ui:176 +msgid "Appearance" +msgstr "Apariencia" + +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "Gnome-Pie - Configuraciones" + +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" +"Este Pastel esta vacío!\n" +"\n" +"Empieza a añadirle Rebanadas! Esto se puede hacer arrastrando cosas al " +"signo más un poco más abajo. Puedes probar un montón! Por ejemplo lanzadores de aplicaciones o " +"directorios. Incluso son posibles URLs desde tu navegador...\n" +"\n" +"Para configuración manual y avanzada, click en el signo más." + +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" +"No tienes Pasteles!\n" +"\n" +"Empieza por crear uno! Esto se puede hacer apretando sobre el pequeño signo " +"más en la esquina inferior izquierda." + +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "Opciones de Rebanadas" + +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "No hay opciones para este tipo de Rebanada." + +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "Nombre de la Rebanada " + +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "URI a abrir" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "Comando a ejecutar" + +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "Atajo de teclado a presionar" + +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "Pastel a abrir" + +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "Es una Acción Rápida" + +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "Esta Rebanada se ejecutará cuando hagas click en el medio del Pastel." + +#: ../ui/slice_select.ui:339 +#, fuzzy +msgid "Slice options" +msgstr "Opciones de Rebanada" + +#~ msgid "Define an open-command" +#~ msgstr "Define un comando para abrir" + +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "Click aquí si quieres enlazar un botón del ratón!" + +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "Es posible que su sistema sea inutilizable si se enlaza un Pastel al " +#~ "botón izquierdo del ratón. ¿Realmente quieres hacer esto?" + +#~ msgid "Show Indicator" +#~ msgstr "Mostrar Indicador" + +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "Si está activada, un indicador de acceso fácil al menú de configuraciones se mostrará en el " +#~ "panel." + +#~ msgid "Open Pies at Mouse" +#~ msgstr "Abre los Pasteles sobre el Ratón" + +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "Si está activada, los pasteles abrirán sobre el puntero. De otra manera abrirán en el medio " +#~ "de la pantalla." + +#~ msgid "General" +#~ msgstr "General" + +#~ msgid "Pies" +#~ msgstr "Pasteles" + +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "Puedes hacer click derecho en la lista para añadir o remover entradas." + +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "Puedes resetear Gnome-Pie a las opciones por defecto con el comando " +#~ "\"gnome-pie --reset\"." + +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "El radiobutton en el comienzo de cada linea de una rebanada indica el " +#~ "QuickAction del pastel." + +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "Los Pasteles pueden abrirse con el commando \"gnome-pie --open=ID\"." + +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "Siéntase libre de visitar la página principal de Gnome-Pie en %s!" + +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "" +#~ "Puedes arrastrar y soltar aplicaciones desde el menú principal a la lista." + +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "Si quieres enviar un comentario, por favor escribe un e-mail a %s!" + +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "Puedes arrastrar y soltar URLs y marcadores desde tu navegador a la lista." + +#~ msgid "Bugs can be reported at %s!" +#~ msgstr "Los errores pueden ser reportados en %s!" + +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "" +#~ "Es posible arrastrar y soltar archivos y directorios desde tu explorador " +#~ "de archivos a la lista." + +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "Es recomendado mantener los Pasteles pequeños (a lo más 6-8 Rebanadas). " +#~ "De otra forma será difícil navegar entre ellos." + +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "" +#~ "Con el fin de crear un lanzador para un Pastel, arrastra el Pastel desde " +#~ "la lista a tu escritorio!" + +#~ msgid "Moves the selected Slice down" +#~ msgstr "Mueve la Rebanada seleccionada hacia abajo" + +#~ msgid "Moves the selected Slice up" +#~ msgstr "Mueve la Rebanada seleccionada hacia arriba" + +#~ msgid "by" +#~ msgstr "por" + +#~ msgid "Slice group" +#~ msgstr "Grupo de Rebanadas" + +#~ msgid "Icon" +#~ msgstr "Icono" + +#~ msgid "Command" +#~ msgstr "Comando" + +#~ msgid "Pie-ID / Action type" +#~ msgstr "Pastel-ID / Tipo de acción" + +#~ msgid "Name" +#~ msgstr "Nombre" + +#~ msgid "Add new Pie" +#~ msgstr "Añadir un nuevo Pastel" + +#~ msgid "Delete" +#~ msgstr "Borrar" + +#~ msgid "New Action" +#~ msgstr "Nueva Acción" + +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "Debes seleccionar un Pastel para añadir una Rebanada!" + +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "Debes seleccionar un Pastel o una Rebanada para borrar!" + +#~ msgid "Choose an Icon" +#~ msgstr "Selecciona un icono" diff --git a/resources/locale/es/LC_MESSAGES/gnomepie.mo b/resources/locale/es/LC_MESSAGES/gnomepie.mo new file mode 100644 index 0000000..02b1246 Binary files /dev/null and b/resources/locale/es/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/fr/LC_MESSAGES/fr.po b/resources/locale/fr/LC_MESSAGES/fr.po new file mode 100644 index 0000000..37e13a7 --- /dev/null +++ b/resources/locale/fr/LC_MESSAGES/fr.po @@ -0,0 +1,635 @@ +# French translations for gnomepie package. +# Copyright (C) 2011 Simon Schneegans +# This file is distributed under the same license as the gnomepie package. +# Grégoire BELLON-GERVAIS , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: gnomepie 0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" +"PO-Revision-Date: 2011-12-06 14:29+0100\n" +"Last-Translator: Grégoire BELLON-GERVAIS \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: ../../src/actions/keyAction.vala:34 +msgid "Press hotkey" +msgstr "Exécuter le raccourcis" + +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "" + +#: ../../src/actions/appAction.vala:34 +msgid "Launch application" +msgstr "Lancer une application" + +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "" + +#: ../../src/actions/uriAction.vala:34 +msgid "Open URI" +msgstr "Ouvrir une URI" + +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "" + +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "Poubelle" + +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "Ouvrir la Tarte" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "" + +#: ../../src/gui/triggerSelectWindow.vala:144 +msgid "" +"This hotkey is already assigned to the pie \"%s\"! \n" +"\n" +"Please select another one or cancel your selection." +msgstr "" +"Ce raccourcis est déjà assigné à la Tarte \"%s\" ! \n" +"\n" +"Merci d'en choisir un autre ou d'annuler votre choix." + +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "" + +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Nouvelle Tarte" + +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "" +"Voulez-vous supprimer la Tarte sélectionnée ainsi que toutes les Parts " +"contenues ?" + +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" +msgstr "Ajouter une Part" + +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "Ajouter une Part" + +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "" + +#: ../../src/gui/triggerSelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "Exécuter le raccourcis" + +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "Voulez-vous supprimer la Part sélectionnée ?" + +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Thèmes" + +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "" + +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "Types de fichier" + +#: ../../src/gui/iconSelectWindow.vala:178 +msgid "All icons" +msgstr "Tous les icones" + +#: ../../src/gui/iconSelectWindow.vala:179 +#: ../../src/pies/defaultConfig.vala:36 +msgid "Applications" +msgstr "Applications" + +#: ../../src/gui/iconSelectWindow.vala:180 +msgid "Actions" +msgstr "Actions" + +#: ../../src/gui/iconSelectWindow.vala:181 +msgid "Places" +msgstr "Dossiers" + +#: ../../src/gui/iconSelectWindow.vala:182 +msgid "File types" +msgstr "Types de fichier" + +#: ../../src/gui/iconSelectWindow.vala:183 +msgid "Emotes" +msgstr "Emoticones" + +#: ../../src/gui/iconSelectWindow.vala:184 +msgid "Miscellaneous" +msgstr "Divers" + +#: ../../src/gui/iconSelectWindow.vala:257 +msgid "All supported image formats" +msgstr "Tous formats d'images supportés" + +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "Liste de Fenêtre" + +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "" + +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" +msgstr "Menu principal" + +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "" + +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "Presse-papier" + +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" +msgstr "Gestion de la Session" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:60 +msgid "Shutdown" +msgstr "Arrêter" + +#: ../../src/actionGroups/sessionGroup.vala:63 +msgid "Logout" +msgstr "Déconnecter" + +#: ../../src/actionGroups/sessionGroup.vala:66 +msgid "Reboot" +msgstr "Redémarrer" + +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" +msgstr "Favoris" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "Périphériques" + +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "Racine" + +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "Non assigné" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "Bouton %i" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "BoutonGauche" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "BoutonDroit" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "BoutonMilieu" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "Turbo" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "Différé" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "" + +#: ../../src/pies/defaultConfig.vala:29 +msgid "Multimedia" +msgstr "Multimédia" + +#: ../../src/pies/defaultConfig.vala:30 +msgid "Next Track" +msgstr "Piste Suivante" + +#: ../../src/pies/defaultConfig.vala:31 +msgid "Stop" +msgstr "Stop" + +#: ../../src/pies/defaultConfig.vala:32 +msgid "Previous Track" +msgstr "Piste Précédente" + +#: ../../src/pies/defaultConfig.vala:33 +msgid "Play/Pause" +msgstr "Lecture/Pause" + +#: ../../src/pies/defaultConfig.vala:45 +msgid "Bookmarks" +msgstr "Favoris" + +#: ../../src/pies/defaultConfig.vala:50 +msgid "Session" +msgstr "Session" + +#: ../../src/pies/defaultConfig.vala:54 +msgid "Main Menu" +msgstr "Menu Principal" + +#: ../../src/pies/defaultConfig.vala:58 +msgid "Window" +msgstr "Fenêtre" + +#: ../../src/pies/defaultConfig.vala:59 +msgid "Scale" +msgstr "Echelle" + +#: ../../src/pies/defaultConfig.vala:60 +msgid "Minimize" +msgstr "Réduire" + +#: ../../src/pies/defaultConfig.vala:61 +msgid "Close" +msgstr "Fermer" + +#: ../../src/pies/defaultConfig.vala:62 +msgid "Maximize" +msgstr "Agrandir" + +#: ../../src/pies/defaultConfig.vala:63 +msgid "Restore" +msgstr "Restaurer" + +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "" + +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Thème d'icone" + +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Icone Personnalisé" + +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "" + +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "" + +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Mode turbo" + +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "La Tarte se fermera quand vous relachez le raccourcis clavier " + +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Appuyer longuement pour activer" + +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"La Tarte s'ouvrira uniquement si vous appuyez sur le raccourcis longtemps" + +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "" + +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"La Tarte s'ouvrira uniquement si vous appuyez sur le raccourcis longtemps" + +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "" + +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "Gnome-Pie - Réglages" + +#: ../ui/settings.ui:47 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "Démarrer à la Connexion" + +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "Si coché, Gnome-Pie démarrera quand vous vous connectez" + +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "" + +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" + +#: ../ui/settings.ui:92 +#, fuzzy +msgid "Global scale" +msgstr "Echelle Globale" + +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "" + +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "Applications" + +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "" + +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "" + +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "" + +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "" + +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "" + +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "" + +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "" + +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "" + +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "Gnome-Pie - Réglages" + +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" + +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" + +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "Ouvrir la Tarte" + +#~ msgid "Define an open-command" +#~ msgstr "Définir une commande d'ouverture" + +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "Cliquer ici pour assigner un bouton de la souris" + +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "Vous pouvez rendre votre système inutilisable en assignant le clic gauche " +#~ "de la souris. Voulez-vous vraiment continuer ?" + +#~ msgid "Choose an Icon" +#~ msgstr "Choisir un Icone" + +#~ msgid "Slice group" +#~ msgstr "Groupe de Parts" + +#~ msgid "Icon" +#~ msgstr "Icone" + +#~ msgid "Command" +#~ msgstr "Commande" + +#~ msgid "Pie-ID / Action type" +#~ msgstr "Tarte-ID / Type d'action" + +#~ msgid "Name" +#~ msgstr "Nom" + +#~ msgid "Add new Pie" +#~ msgstr "AJouter une Tarte" + +#~ msgid "Delete" +#~ msgstr "Effacer" + +#~ msgid "New Action" +#~ msgstr "Nouvelle Action" + +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "Sélectionner d'abord une Tarte pour ajouter une Part" + +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "Sélectionner une Tarte ou une Part pour la supprimer" + +#~ msgid "Behavior" +#~ msgstr "Comportement" + +#~ msgid "Show Indicator" +#~ msgstr "Afficher l'Indicateur" + +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "Si coché, un indicateur apparaitra dans la zone de notification afin " +#~ "d'accéder rapidement aux réglages de Gnome-Pie" + +#~ msgid "Open Pies at Mouse" +#~ msgstr "Ouvrir les Tartes sous la Souris" + +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "Si coché, les Tartes apparaîtront sous le pointeur. Sinon, elles " +#~ "s'ouvriront au centre de l'écran." + +#~ msgid "General" +#~ msgstr "Général" + +#~ msgid "Pies" +#~ msgstr "Tartes" + +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "Le clic-droit permet d'ajouter ou de supprimer des entrées." + +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "Vous pouvez restaurer les paramètres par défaut avec la commande \"gnome-" +#~ "pie --reset\"." + +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "Le bouton radio au début de chaque ligne de Part indique l'Action Rapide " +#~ "de la Tarte." + +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "Les Tartes peuvent être lancées avec la commande \"gnome-pie --open=ID\"." + +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "N'hésiter pas à visiter la page web de Gnome-Pie at %s !" + +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "" +#~ "Vous pouvez glisser-déposer des applications depuis le menu principal " +#~ "dans la liste ci-dessus." + +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "Pour envoyer vos remarques, vous pouvez écrire à l'adresse %s !" + +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "Vous pouvez glisser-déposer des URLs et des favoris depuis votre " +#~ "navigateur dans la liste ci-dessus." + +#~ msgid "Bugs can be reported at %s!" +#~ msgstr "Les Bugs peuvent être envoyés à %s !" + +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "" +#~ "Vous pouvez glisser-déposer des fichiers et des dossiers depuis " +#~ "l'explorateur dans la liste ci-dessus." + +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "Il est recommandé de garder les Tartes petites (pas plus de 6-8 Parts) " +#~ "afin de leur conserver leur facilité de navigation." + +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "" +#~ "Afin de créer un lanceur pour une Tarte, vous pouvez déposer la Tarte " +#~ "directement sur votre bureau !" + +#~ msgid "Moves the selected Slice down" +#~ msgstr "Déplace la Part sélectionnée vers le bas" + +#~ msgid "Moves the selected Slice up" +#~ msgstr "Déplace la Part sélectionnée vers le haut" + +#~ msgid "by" +#~ msgstr "par" diff --git a/resources/locale/fr/LC_MESSAGES/gnomepie.mo b/resources/locale/fr/LC_MESSAGES/gnomepie.mo new file mode 100644 index 0000000..bd81507 Binary files /dev/null and b/resources/locale/fr/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/gen-pot.sh b/resources/locale/gen-pot.sh index 356e12e..7b7f156 100755 --- a/resources/locale/gen-pot.sh +++ b/resources/locale/gen-pot.sh @@ -3,12 +3,21 @@ # Searches trough all vala files of Gnome-Pie and generates # a gnomepie.pot for strings which need to be translated. -filelist=$( find ../../src/ -name '*.vala' -printf "%h/%f " ) - domain="gnomepie" -version="0.2" +version="0.4" copyright="Simon Schneegans " +filelist=$( find ../ui/ -name '*.ui' -printf "%h/%f " ) +xgettext --package-name $domain \ + --package-version $version \ + --default-domain $domain \ + --output $domain.pot.tmp \ + --copyright-holder="$copyright" \ + -k_ \ + -L Glade \ + $filelist + +filelist=$( find ../../src/ -name '*.vala' -printf "%h/%f " ) xgettext --package-name $domain \ --package-version $version \ --default-domain $domain \ @@ -17,6 +26,9 @@ xgettext --package-name $domain \ -k_ \ -L C# \ $filelist + +awk 'NR>18' $domain.pot.tmp >> $domain.pot sed --in-place $domain.pot --expression='s/CHARSET/UTF-8/' +rm $domain.pot.tmp diff --git a/resources/locale/gnomepie.pot b/resources/locale/gnomepie.pot deleted file mode 100644 index b2af1aa..0000000 --- a/resources/locale/gnomepie.pot +++ /dev/null @@ -1,425 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Simon Schneegans -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: gnomepie 0.2\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-10 08:00+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../../src/actions/keyAction.vala:33 -msgid "Press hotkey" -msgstr "" - -#: ../../src/actions/appAction.vala:33 -msgid "Launch application" -msgstr "" - -#: ../../src/actions/uriAction.vala:33 -msgid "Open URI" -msgstr "" - -#: ../../src/actions/actionRegistry.vala:107 -msgid "Trash" -msgstr "" - -#: ../../src/actions/pieAction.vala:33 -msgid "Open Pie" -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:69 -msgid "Define an open-command" -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:87 -msgid "Click here if you want to bind a mouse button!" -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:102 -msgid "Turbo mode" -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:103 -msgid "If checked, the Pie will close when you release the chosen hot key." -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:117 -msgid "Long press for activation" -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:118 -msgid "" -"If checked, the Pie will only open if you press this hot key a bit longer." -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:156 -msgid "" -"This hotkey is already assigned to the pie \"%s\"! \n" -"\n" -"Please select another one or cancel your selection." -msgstr "" - -#: ../../src/gui/triggerSelectWindow.vala:197 -msgid "" -"It possible to make your system unusable if you bind a Pie to your left " -"mouse button. Do you really want to do this?" -msgstr "" - -#: ../../src/gui/preferences.vala:32 -msgid "Gnome-Pie - Settings" -msgstr "" - -#: ../../src/gui/preferences.vala:55 -msgid "Behavior" -msgstr "" - -#: ../../src/gui/preferences.vala:65 -msgid "Startup on Login" -msgstr "" - -#: ../../src/gui/preferences.vala:66 -msgid "If checked, Gnome-Pie will start when you log in." -msgstr "" - -#: ../../src/gui/preferences.vala:72 -msgid "Show Indicator" -msgstr "" - -#: ../../src/gui/preferences.vala:73 -msgid "" -"If checked, an indicator for easy access of the settings menu is shown in " -"your panel." -msgstr "" - -#: ../../src/gui/preferences.vala:79 -msgid "Open Pies at Mouse" -msgstr "" - -#: ../../src/gui/preferences.vala:80 -msgid "" -"If checked, pies will open at your pointer. Otherwise they'll pop up in the " -"middle of the screen." -msgstr "" - -#: ../../src/gui/preferences.vala:89 -msgid "Global Scale" -msgstr "" - -#: ../../src/gui/preferences.vala:126 -msgid "Themes" -msgstr "" - -#: ../../src/gui/preferences.vala:144 -msgid "General" -msgstr "" - -#: ../../src/gui/preferences.vala:149 -msgid "Pies" -msgstr "" - -#: ../../src/gui/preferences.vala:173 -msgid "You can right-click in the list for adding or removing entries." -msgstr "" - -#: ../../src/gui/preferences.vala:174 -msgid "" -"You can reset Gnome-Pie to its default options with the terminal command " -"\"gnome-pie --reset\"." -msgstr "" - -#: ../../src/gui/preferences.vala:175 -msgid "" -"The radiobutton at the beginning of each slice-line indicates the " -"QuickAction of the pie." -msgstr "" - -#: ../../src/gui/preferences.vala:176 -msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "" - -#: ../../src/gui/preferences.vala:177 -msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "" - -#: ../../src/gui/preferences.vala:178 -msgid "You can drag'n'drop applications from your main menu to the list above." -msgstr "" - -#: ../../src/gui/preferences.vala:179 -msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "" - -#: ../../src/gui/preferences.vala:180 -msgid "" -"You may drag'n'drop URLs and bookmarks from your internet browser to the " -"list above." -msgstr "" - -#: ../../src/gui/preferences.vala:181 -msgid "Bugs can be reported at %s!" -msgstr "" - -#: ../../src/gui/preferences.vala:182 -msgid "" -"It's possible to drag'n'drop files and folders from your file browser to the " -"list above." -msgstr "" - -#: ../../src/gui/preferences.vala:183 -msgid "" -"It's recommended to keep your Pies small (at most 6-8 Slices). Else they " -"will become hard to navigate." -msgstr "" - -#: ../../src/gui/preferences.vala:184 -msgid "" -"In order to create a launcher for a Pie, drag the Pie from the list to your " -"desktop!" -msgstr "" - -#: ../../src/gui/preferences.vala:193 -msgid "Moves the selected Slice down" -msgstr "" - -#: ../../src/gui/preferences.vala:205 -msgid "Moves the selected Slice up" -msgstr "" - -#: ../../src/gui/themeList.vala:88 -msgid "by" -msgstr "" - -#: ../../src/gui/pieList.vala:88 ../../src/gui/pieList.vala:851 -msgid "Slice group" -msgstr "" - -#: ../../src/gui/pieList.vala:135 -msgid "Icon" -msgstr "" - -#: ../../src/gui/pieList.vala:200 -msgid "Command" -msgstr "" - -#: ../../src/gui/pieList.vala:301 ../../src/gui/pieList.vala:707 -#: ../../src/gui/pieList.vala:867 ../../src/utilities/bindingManager.vala:156 -#: ../../src/utilities/trigger.vala:197 ../../src/utilities/trigger.vala:198 -msgid "Not bound" -msgstr "" - -#: ../../src/gui/pieList.vala:366 -msgid "Pie-ID / Action type" -msgstr "" - -#: ../../src/gui/pieList.vala:427 -msgid "Name" -msgstr "" - -#: ../../src/gui/pieList.vala:470 -msgid "Add new Pie" -msgstr "" - -#: ../../src/gui/pieList.vala:475 -msgid "Add new Slice" -msgstr "" - -#: ../../src/gui/pieList.vala:483 -msgid "Delete" -msgstr "" - -#: ../../src/gui/pieList.vala:619 -msgid "New Pie" -msgstr "" - -#: ../../src/gui/pieList.vala:666 -msgid "New Action" -msgstr "" - -#: ../../src/gui/pieList.vala:680 -msgid "You have to select a Pie to add a Slice to!" -msgstr "" - -#: ../../src/gui/pieList.vala:730 -msgid "You have to select a Pie or a Slice to delete!" -msgstr "" - -#: ../../src/gui/pieList.vala:741 -msgid "" -"Do you really want to delete the selected Pie with all contained Slices?" -msgstr "" - -#: ../../src/gui/pieList.vala:775 -msgid "Do you really want to delete the selected Slice?" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:160 -msgid "Choose an Icon" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:196 -msgid "All icons" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:197 -#: ../../src/pies/defaultConfig.vala:36 -msgid "Applications" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:198 -msgid "Actions" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:199 -msgid "Places" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:200 -msgid "File types" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:201 -msgid "Emotes" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:202 -msgid "Miscellaneous" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:279 -msgid "Icon Theme" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:289 -msgid "All supported image formats" -msgstr "" - -#: ../../src/gui/iconSelectWindow.vala:311 -msgid "Custom Icon" -msgstr "" - -#: ../../src/actionGroups/windowListGroup.vala:33 -msgid "Window List" -msgstr "" - -#: ../../src/actionGroups/menuGroup.vala:34 -msgid "Main menu" -msgstr "" - -#: ../../src/actionGroups/clipboardGroup.vala:63 -msgid "Clipboard" -msgstr "" - -#: ../../src/actionGroups/sessionGroup.vala:34 -msgid "Session Control" -msgstr "" - -#: ../../src/actionGroups/sessionGroup.vala:52 -msgid "Shutdown" -msgstr "" - -#: ../../src/actionGroups/sessionGroup.vala:55 -msgid "Logout" -msgstr "" - -#: ../../src/actionGroups/sessionGroup.vala:58 -msgid "Reboot" -msgstr "" - -#: ../../src/actionGroups/bookmarkGroup.vala:35 -#: ../../src/pies/defaultConfig.vala:45 -msgid "Bookmarks" -msgstr "" - -#: ../../src/actionGroups/devicesGroup.vala:34 -msgid "Devices" -msgstr "" - -#: ../../src/actionGroups/devicesGroup.vala:82 -msgid "Root" -msgstr "" - -#: ../../src/utilities/trigger.vala:152 -msgid "Button %i" -msgstr "" - -#: ../../src/utilities/trigger.vala:155 -msgid "LeftButton" -msgstr "" - -#: ../../src/utilities/trigger.vala:157 -msgid "RightButton" -msgstr "" - -#: ../../src/utilities/trigger.vala:159 -msgid "MiddleButton" -msgstr "" - -#: ../../src/utilities/trigger.vala:181 ../../src/utilities/trigger.vala:183 -msgid "Turbo" -msgstr "" - -#: ../../src/utilities/trigger.vala:181 ../../src/utilities/trigger.vala:185 -msgid "Delayed" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:29 -msgid "Multimedia" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:30 -msgid "Next Track" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:31 -msgid "Stop" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:32 -msgid "Previous Track" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:33 -msgid "Play/Pause" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:50 -msgid "Session" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:54 -msgid "Main Menu" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:58 -msgid "Window" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:59 -msgid "Scale" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:60 -msgid "Minimize" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:61 -msgid "Close" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:62 -msgid "Maximize" -msgstr "" - -#: ../../src/pies/defaultConfig.vala:63 -msgid "Restore" -msgstr "" diff --git a/resources/locale/it/LC_MESSAGES/gnomepie.mo b/resources/locale/it/LC_MESSAGES/gnomepie.mo index d540e35..f7b33cc 100644 Binary files a/resources/locale/it/LC_MESSAGES/gnomepie.mo and b/resources/locale/it/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/it/LC_MESSAGES/it.po b/resources/locale/it/LC_MESSAGES/it.po index ab808e8..ab67977 100644 --- a/resources/locale/it/LC_MESSAGES/it.po +++ b/resources/locale/it/LC_MESSAGES/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnomepie 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-09 11:01+0100\n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" "PO-Revision-Date: 2011-11-09 12:52+0100\n" "Last-Translator: Riccardo Traverso \n" "Language-Team: Italian\n" @@ -18,6 +18,259 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-Language: Italian\n" +#: ../../src/actions/keyAction.vala:34 +msgid "Press hotkey" +msgstr "Pressione di tasti" + +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "" + +#: ../../src/actions/appAction.vala:34 +msgid "Launch application" +msgstr "Lancia applicazione" + +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "" + +#: ../../src/actions/uriAction.vala:34 +msgid "Open URI" +msgstr "Apri URI" + +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "" + +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "Cestino" + +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "Apri una Torta" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "" + +#: ../../src/gui/triggerSelectWindow.vala:144 +msgid "" +"This hotkey is already assigned to the pie \"%s\"! \n" +"\n" +"Please select another one or cancel your selection." +msgstr "" +"Questa combinazione di tasti è stata già assegnata alla Torta \"%s\"! \n" +"\n" +"Selezionane un'altra oppure annulla la tua selezione per favore." + +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "" + +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Nuova Torta" + +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "" +"Vuoi davvero eliminare la Torta selezionata e tutte le Fette che contiene?" + +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" +msgstr "Aggiungi nuova Fetta" + +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "Aggiungi nuova Fetta" + +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "" + +#: ../../src/gui/triggerSelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "Pressione di tasti" + +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "Vuoi davvero eliminare la Fetta selezionata?" + +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Temi" + +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "" + +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "Tipi di file" + +#: ../../src/gui/iconSelectWindow.vala:178 +msgid "All icons" +msgstr "Tutte le icone" + +#: ../../src/gui/iconSelectWindow.vala:179 +#: ../../src/pies/defaultConfig.vala:36 +msgid "Applications" +msgstr "Applicazioni" + +#: ../../src/gui/iconSelectWindow.vala:180 +msgid "Actions" +msgstr "Azioni" + +#: ../../src/gui/iconSelectWindow.vala:181 +msgid "Places" +msgstr "Luoghi" + +#: ../../src/gui/iconSelectWindow.vala:182 +msgid "File types" +msgstr "Tipi di file" + +#: ../../src/gui/iconSelectWindow.vala:183 +msgid "Emotes" +msgstr "" + +#: ../../src/gui/iconSelectWindow.vala:184 +msgid "Miscellaneous" +msgstr "Varie" + +#: ../../src/gui/iconSelectWindow.vala:257 +msgid "All supported image formats" +msgstr "Tutti i formati immagine supportati" + +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "Elenco delle finestre" + +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "" + +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" +msgstr "Menu principale" + +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "" + +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "Appunti" + +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" +msgstr "Controllo della sessione" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:60 +msgid "Shutdown" +msgstr "Spegnimento" + +#: ../../src/actionGroups/sessionGroup.vala:63 +msgid "Logout" +msgstr "Chiudi sessione" + +#: ../../src/actionGroups/sessionGroup.vala:66 +msgid "Reboot" +msgstr "Riavvio" + +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" +msgstr "Segnalibri" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "Dispositivi" + +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "Root" + +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "Non assegnato" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "Tasto %i" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "Tasto sinistro" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "Tasto destro" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "Tasto centrale" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "Turbo" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "Ritardato" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "" + #: ../../src/pies/defaultConfig.vala:29 msgid "Multimedia" msgstr "Multimedia" @@ -38,13 +291,7 @@ msgstr "Traccia Precedente" msgid "Play/Pause" msgstr "Riproduci/Pausa" -#: ../../src/pies/defaultConfig.vala:36 -#: ../../src/gui/iconSelectWindow.vala:197 -msgid "Applications" -msgstr "Applicazioni" - #: ../../src/pies/defaultConfig.vala:45 -#: ../../src/actionGroups/bookmarkGroup.vala:35 msgid "Bookmarks" msgstr "Segnalibri" @@ -80,339 +327,320 @@ msgstr "Massimizza" msgid "Restore" msgstr "Ripristina" -#: ../../src/actions/keyAction.vala:33 -msgid "Press hotkey" -msgstr "Pressione di tasti" - -#: ../../src/actions/pieAction.vala:33 -msgid "Open Pie" -msgstr "Apri una Torta" +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "" -#: ../../src/actions/appAction.vala:33 -msgid "Launch application" -msgstr "Lancia applicazione" +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Tema di icone" -#: ../../src/actions/actionRegistry.vala:107 -msgid "Trash" -msgstr "Cestino" +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Icona personalizzata" -#: ../../src/actions/uriAction.vala:33 -msgid "Open URI" -msgstr "Apri URI" +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "" -#: ../../src/actionGroups/clipboardGroup.vala:63 -msgid "Clipboard" -msgstr "Appunti" +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "" -#: ../../src/actionGroups/devicesGroup.vala:34 -msgid "Devices" -msgstr "Dispositivi" +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Modalità turbo" -#: ../../src/actionGroups/devicesGroup.vala:82 -msgid "Root" -msgstr "Root" +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "" +"Se selezionato, la Torta si chiuderà al rilascio della combinazione di tasti " +"assegnata." -#: ../../src/actionGroups/windowListGroup.vala:33 -msgid "Window List" -msgstr "Elenco delle finestre" +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Pressione prolungata per l'attivazione" -#: ../../src/actionGroups/menuGroup.vala:34 -msgid "Main menu" -msgstr "Menu principale" +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"Se selezionato, la Torta si aprirà soltanto se si preme la combinazione di " +"tasti un po' più a lungo." -#: ../../src/actionGroups/sessionGroup.vala:34 -msgid "Session Control" -msgstr "Controllo della sessione" +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "" -#: ../../src/actionGroups/sessionGroup.vala:52 -msgid "Shutdown" -msgstr "Spegnimento" +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"Se selezionato, la Torta si aprirà soltanto se si preme la combinazione di " +"tasti un po' più a lungo." -#: ../../src/actionGroups/sessionGroup.vala:55 -msgid "Logout" -msgstr "Chiudi sessione" +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "" -#: ../../src/actionGroups/sessionGroup.vala:58 -msgid "Reboot" -msgstr "Riavvio" +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "Gnome-Pie - Impostazioni" -#: ../../src/gui/iconSelectWindow.vala:160 -msgid "Choose an Icon" -msgstr "Scegli un'icona" +#: ../ui/settings.ui:47 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "Avvia al Login" -#: ../../src/gui/iconSelectWindow.vala:196 -msgid "All icons" -msgstr "Tutte le icone" +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "Se selezionato, Gnome-Pie si avvierà all'accesso." -#: ../../src/gui/iconSelectWindow.vala:198 -msgid "Actions" -msgstr "Azioni" +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:199 -msgid "Places" -msgstr "Luoghi" +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:200 -msgid "File types" -msgstr "Tipi di file" +#: ../ui/settings.ui:92 +#, fuzzy +msgid "Global scale" +msgstr "Scala globale" -#: ../../src/gui/iconSelectWindow.vala:201 -msgid "Emotes" +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" msgstr "" -#: ../../src/gui/iconSelectWindow.vala:202 -msgid "Miscellaneous" -msgstr "Varie" +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "Applicazioni" -#: ../../src/gui/iconSelectWindow.vala:279 -msgid "Icon Theme" -msgstr "Tema di icone" +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:289 -msgid "All supported image formats" -msgstr "Tutti i formati immagine supportati" +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:311 -msgid "Custom Icon" -msgstr "Icona personalizzata" +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:69 -msgid "Define an open-command" -msgstr "Definisci un comando di apertura" +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:87 -msgid "Click here if you want to bind a mouse button!" -msgstr "Per assegnare un tasto del mouse clicca qui!" +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:102 -msgid "Turbo mode" -msgstr "Modalità turbo" +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:103 -msgid "If checked, the Pie will close when you release the chosen hot key." -msgstr "Se selezionato, la Torta si chiuderà al rilascio della combinazione di tasti assegnata." +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:117 -msgid "Long press for activation" -msgstr "Pressione prolungata per l'attivazione" +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:118 -msgid "If checked, the Pie will only open if you press this hot key a bit longer." -msgstr "Se selezionato, la Torta si aprirà soltanto se si preme la combinazione di tasti un po' più a lungo." +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "Gnome-Pie - Impostazioni" -#: ../../src/gui/triggerSelectWindow.vala:158 +#: ../ui/preferences.ui:261 msgid "" -"This hotkey is already assigned to the pie \"%s\"! \n" +"This Pie is empty!\n" "\n" -"Please select another one or cancel your selection." -msgstr "" -"Questa combinazione di tasti è stata già assegnata alla Torta \"%s\"! \n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" "\n" -"Selezionane un'altra oppure annulla la tua selezione per favore." - -#: ../../src/gui/triggerSelectWindow.vala:199 -msgid "It possible to make your system unusable if you bind a Pie to your left mouse button. Do you really want to do this?" -msgstr "E' possibile rendere il tuo sistema inutilizzabile se assegni alla Torta il tasto sinistro del mouse. Vuoi davvero procedere?" - -#: ../../src/gui/themeList.vala:88 -msgid "by" -msgstr "di" - -#: ../../src/gui/pieList.vala:88 -#: ../../src/gui/pieList.vala:851 -msgid "Slice group" -msgstr "Gruppo di Fette" - -#: ../../src/gui/pieList.vala:135 -msgid "Icon" -msgstr "Icona" - -#: ../../src/gui/pieList.vala:200 -msgid "Command" -msgstr "Comando" - -#: ../../src/gui/pieList.vala:301 -#: ../../src/gui/pieList.vala:707 -#: ../../src/gui/pieList.vala:867 -#: ../../src/utilities/bindingManager.vala:156 -#: ../../src/utilities/trigger.vala:197 -#: ../../src/utilities/trigger.vala:198 -msgid "Not bound" -msgstr "Non assegnato" - -#: ../../src/gui/pieList.vala:366 -msgid "Pie-ID / Action type" -msgstr "ID Torta / Tipo di azione" - -#: ../../src/gui/pieList.vala:427 -msgid "Name" -msgstr "Nome" +"For manual and advanced configuration click on the plus sign." +msgstr "" -#: ../../src/gui/pieList.vala:470 -msgid "Add new Pie" -msgstr "Aggiungi nuova Torta" +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" -#: ../../src/gui/pieList.vala:475 -msgid "Add new Slice" -msgstr "Aggiungi nuova Fetta" +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "Apri una Torta" -#: ../../src/gui/pieList.vala:483 -msgid "Delete" -msgstr "Elimina" +#~ msgid "Choose an Icon" +#~ msgstr "Scegli un'icona" -#: ../../src/gui/pieList.vala:619 -msgid "New Pie" -msgstr "Nuova Torta" +#~ msgid "Define an open-command" +#~ msgstr "Definisci un comando di apertura" -#: ../../src/gui/pieList.vala:666 -msgid "New Action" -msgstr "Nuova Azione" +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "Per assegnare un tasto del mouse clicca qui!" -#: ../../src/gui/pieList.vala:680 -msgid "You have to select a Pie to add a Slice to!" -msgstr "Devi selezionare una Torta alla quale aggiungere una Fetta!" +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "E' possibile rendere il tuo sistema inutilizzabile se assegni alla Torta " +#~ "il tasto sinistro del mouse. Vuoi davvero procedere?" -#: ../../src/gui/pieList.vala:730 -msgid "You have to select a Pie or a Slice to delete!" -msgstr "Devi selezionare una Torta o una Fetta da eliminare!" +#~ msgid "by" +#~ msgstr "di" -#: ../../src/gui/pieList.vala:741 -msgid "Do you really want to delete the selected Pie with all contained Slices?" -msgstr "Vuoi davvero eliminare la Torta selezionata e tutte le Fette che contiene?" +#~ msgid "Slice group" +#~ msgstr "Gruppo di Fette" -#: ../../src/gui/pieList.vala:775 -msgid "Do you really want to delete the selected Slice?" -msgstr "Vuoi davvero eliminare la Fetta selezionata?" +#~ msgid "Icon" +#~ msgstr "Icona" -#: ../../src/gui/preferences.vala:32 -msgid "Gnome-Pie - Settings" -msgstr "Gnome-Pie - Impostazioni" +#~ msgid "Command" +#~ msgstr "Comando" -#: ../../src/gui/preferences.vala:55 -msgid "Behavior" -msgstr "Comportamento" +#~ msgid "Pie-ID / Action type" +#~ msgstr "ID Torta / Tipo di azione" -#: ../../src/gui/preferences.vala:65 -msgid "Startup on Login" -msgstr "Avvia al Login" +#~ msgid "Name" +#~ msgstr "Nome" -#: ../../src/gui/preferences.vala:66 -msgid "If checked, Gnome-Pie will start when you log in." -msgstr "Se selezionato, Gnome-Pie si avvierà all'accesso." +#~ msgid "Add new Pie" +#~ msgstr "Aggiungi nuova Torta" -#: ../../src/gui/preferences.vala:72 -msgid "Show Indicator" -msgstr "Mostra indicatore" +#~ msgid "Delete" +#~ msgstr "Elimina" -#: ../../src/gui/preferences.vala:73 -msgid "If checked, an indicator for easy access of the settings menu is shown in your panel." -msgstr "Se selezionato, il pannello di sistema mostrerà un indicatore per l'accesso rapido al menu di configurazione." +#~ msgid "New Action" +#~ msgstr "Nuova Azione" -#: ../../src/gui/preferences.vala:79 -msgid "Open Pies at Mouse" -msgstr "Apri Torte dal cursore" +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "Devi selezionare una Torta alla quale aggiungere una Fetta!" -#: ../../src/gui/preferences.vala:80 -msgid "If checked, pies will open at your pointer. Otherwise they'll pop up in the middle of the screen." -msgstr "Se selezionato le Torte si apriranno dal cursore, altrimenti compariranno al centro dello schermo." +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "Devi selezionare una Torta o una Fetta da eliminare!" -#: ../../src/gui/preferences.vala:89 -msgid "Global Scale" -msgstr "Scala globale" +#~ msgid "Behavior" +#~ msgstr "Comportamento" -#: ../../src/gui/preferences.vala:126 -msgid "Themes" -msgstr "Temi" +#~ msgid "Show Indicator" +#~ msgstr "Mostra indicatore" -#: ../../src/gui/preferences.vala:144 -msgid "General" -msgstr "Generale" - -#: ../../src/gui/preferences.vala:149 -msgid "Pies" -msgstr "Torte" - -#: ../../src/gui/preferences.vala:173 -msgid "You can right-click in the list for adding or removing entries." -msgstr "Puoi cliccare col tasto destro sulla lista per aggiungere o rimuovere voci." +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "Se selezionato, il pannello di sistema mostrerà un indicatore per " +#~ "l'accesso rapido al menu di configurazione." -#: ../../src/gui/preferences.vala:174 -msgid "You can reset Gnome-Pie to its default options with the terminal command \"gnome-pie --reset\"." -msgstr "Puoi resettare Gnome-Pie alla configurazione predefinita con il comando da terminale \"gnome-pie --reset\"." +#~ msgid "Open Pies at Mouse" +#~ msgstr "Apri Torte dal cursore" -#: ../../src/gui/preferences.vala:175 -msgid "The radiobutton at the beginning of each slice-line indicates the QuickAction of the pie." -msgstr "Il pulsante di selezione all'inizio di ciascuna riga-fetta indica l'azione veloce (QuickAction) della Torta." +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "Se selezionato le Torte si apriranno dal cursore, altrimenti compariranno " +#~ "al centro dello schermo." -#: ../../src/gui/preferences.vala:176 -msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "Le Torte possono essere aperte col comando da terminale \"gnome-pie --open=ID\"." +#~ msgid "General" +#~ msgstr "Generale" -#: ../../src/gui/preferences.vala:177 -msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "Sentiti libero di visitare la homepage di Gnome-Pie all'indirizzo %s!" +#~ msgid "Pies" +#~ msgstr "Torte" -#: ../../src/gui/preferences.vala:178 -msgid "You can drag'n'drop applications from your main menu to the list above." -msgstr "Puoi trascinare applicazioni nella lista sovrastante dal tuo menu principale." +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "" +#~ "Puoi cliccare col tasto destro sulla lista per aggiungere o rimuovere " +#~ "voci." -#: ../../src/gui/preferences.vala:179 -msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "Se vuoi inviarci dei feedback, per favore scrivi una e-mail a %s!" +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "Puoi resettare Gnome-Pie alla configurazione predefinita con il comando " +#~ "da terminale \"gnome-pie --reset\"." -#: ../../src/gui/preferences.vala:180 -msgid "You may drag'n'drop URLs and bookmarks from your internet browser to the list above." -msgstr "Puoi trascinare URLs e segnalibri nella lista sovrastante dal tuo internet browser." +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "Il pulsante di selezione all'inizio di ciascuna riga-fetta indica " +#~ "l'azione veloce (QuickAction) della Torta." -#: ../../src/gui/preferences.vala:181 -msgid "Bugs can be reported at %s!" -msgstr "I bug possono essere segnalati su %s!" +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "Le Torte possono essere aperte col comando da terminale \"gnome-pie --" +#~ "open=ID\"." -#: ../../src/gui/preferences.vala:182 -msgid "It's possible to drag'n'drop files and folders from your file browser to the list above." -msgstr "E' possibile trascinare file e cartelle nella lista sovrastante dal tuo file browser." +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "" +#~ "Sentiti libero di visitare la homepage di Gnome-Pie all'indirizzo %s!" -#: ../../src/gui/preferences.vala:183 -msgid "It's recommended to keep your Pies small (at most 6-8 Slices). Else they will become hard to navigate." -msgstr "E' consigliabile mantenere le tue Torte piccole (al più 6-8 Fette), altrimenti diventeranno difficili da navigare." +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "" +#~ "Puoi trascinare applicazioni nella lista sovrastante dal tuo menu " +#~ "principale." -#: ../../src/gui/preferences.vala:184 -msgid "In order to create a launcher for a Pie, drag the Pie from the list to your desktop!" -msgstr "Per creare un avviatore per una Torta, trascina la torta dalla lista al tuo dekstop!" +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "Se vuoi inviarci dei feedback, per favore scrivi una e-mail a %s!" -#: ../../src/gui/preferences.vala:193 -msgid "Moves the selected Slice down" -msgstr "Sposta in basso la Fetta selezionata" +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "Puoi trascinare URLs e segnalibri nella lista sovrastante dal tuo " +#~ "internet browser." -#: ../../src/gui/preferences.vala:205 -msgid "Moves the selected Slice up" -msgstr "Sposta in alto la Fetta selezionata" +#~ msgid "Bugs can be reported at %s!" +#~ msgstr "I bug possono essere segnalati su %s!" -#: ../../src/utilities/trigger.vala:152 -msgid "Button %i" -msgstr "Tasto %i" - -#: ../../src/utilities/trigger.vala:155 -msgid "LeftButton" -msgstr "Tasto sinistro" +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "" +#~ "E' possibile trascinare file e cartelle nella lista sovrastante dal tuo " +#~ "file browser." -#: ../../src/utilities/trigger.vala:157 -msgid "RightButton" -msgstr "Tasto destro" +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "E' consigliabile mantenere le tue Torte piccole (al più 6-8 Fette), " +#~ "altrimenti diventeranno difficili da navigare." -#: ../../src/utilities/trigger.vala:159 -msgid "MiddleButton" -msgstr "Tasto centrale" +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "" +#~ "Per creare un avviatore per una Torta, trascina la torta dalla lista al " +#~ "tuo dekstop!" -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:183 -msgid "Turbo" -msgstr "Turbo" +#~ msgid "Moves the selected Slice down" +#~ msgstr "Sposta in basso la Fetta selezionata" -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:185 -msgid "Delayed" -msgstr "Ritardato" +#~ msgid "Moves the selected Slice up" +#~ msgstr "Sposta in alto la Fetta selezionata" #~ msgid "" #~ "If checked, the pie closes when its keystroke is released. The currently " diff --git a/resources/locale/ko/LC_MESSAGES/gnomepie.mo b/resources/locale/ko/LC_MESSAGES/gnomepie.mo index bd300bf..69e64b8 100644 Binary files a/resources/locale/ko/LC_MESSAGES/gnomepie.mo and b/resources/locale/ko/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/ko/LC_MESSAGES/ko.po b/resources/locale/ko/LC_MESSAGES/ko.po index 54c27e3..7339372 100644 --- a/resources/locale/ko/LC_MESSAGES/ko.po +++ b/resources/locale/ko/LC_MESSAGES/ko.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnomepie 0.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-15 02:49+0900\n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" "PO-Revision-Date: 2011-11-15 03:15+0900\n" "Last-Translator: Kim Boram \n" "Language-Team: Korean\n" @@ -17,26 +17,258 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../src/actions/actionRegistry.vala:107 -msgid "Trash" -msgstr "휴지통" - -#: ../../src/actions/keyAction.vala:33 +#: ../../src/actions/keyAction.vala:34 msgid "Press hotkey" msgstr "단축키를 누르세요" -#: ../../src/actions/appAction.vala:33 +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "" + +#: ../../src/actions/appAction.vala:34 msgid "Launch application" msgstr "프로그램 실행" -#: ../../src/actions/pieAction.vala:33 -msgid "Open Pie" -msgstr "파이 열기" +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "" -#: ../../src/actions/uriAction.vala:33 +#: ../../src/actions/uriAction.vala:34 msgid "Open URI" msgstr "주소 열기" +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "" + +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "휴지통" + +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "파이 열기" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "" + +#: ../../src/gui/triggerSelectWindow.vala:144 +msgid "" +"This hotkey is already assigned to the pie \"%s\"! \n" +"\n" +"Please select another one or cancel your selection." +msgstr "" +"이 단축키는 이미 \"%s\" 파이에 할당했습니다!\n" +"\n" +"다른 것을 선택하거나 선택을 취소하십시오." + +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "" + +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "새 파이" + +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "선택한 파이와 파이 안의 모든 조각을 삭제하시겠습니까?" + +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" +msgstr "새 조각 추가" + +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "새 조각 추가" + +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "" + +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "" + +#: ../../src/gui/triggerSelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "단축키를 누르세요" + +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "정말 선택한 조각을 삭제하시겠습니까?" + +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "테마" + +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "" + +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "파일 형식" + +#: ../../src/gui/iconSelectWindow.vala:178 +msgid "All icons" +msgstr "모든 아이콘" + +#: ../../src/gui/iconSelectWindow.vala:179 +#: ../../src/pies/defaultConfig.vala:36 +msgid "Applications" +msgstr "프로그램" + +#: ../../src/gui/iconSelectWindow.vala:180 +msgid "Actions" +msgstr "동작" + +#: ../../src/gui/iconSelectWindow.vala:181 +msgid "Places" +msgstr "위치" + +#: ../../src/gui/iconSelectWindow.vala:182 +msgid "File types" +msgstr "파일 형식" + +#: ../../src/gui/iconSelectWindow.vala:183 +msgid "Emotes" +msgstr "감정" + +#: ../../src/gui/iconSelectWindow.vala:184 +msgid "Miscellaneous" +msgstr "기타" + +#: ../../src/gui/iconSelectWindow.vala:257 +msgid "All supported image formats" +msgstr "지원하는 모든 이미지 형식" + +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "창 목록" + +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "" + +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" +msgstr "주 메뉴" + +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "" + +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "클립보드" + +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" +msgstr "세션 컨트롤" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:60 +msgid "Shutdown" +msgstr "시스템 끄기" + +#: ../../src/actionGroups/sessionGroup.vala:63 +msgid "Logout" +msgstr "로그아웃" + +#: ../../src/actionGroups/sessionGroup.vala:66 +msgid "Reboot" +msgstr "다시 시작" + +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" +msgstr "책갈피" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "장치" + +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "" + +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "루트" + +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "연결하지 않음" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "%i 단추" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "왼쪽 단추" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "오른쪽 단추" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "가운데 단추" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "터보" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "시간 지연" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "" + #: ../../src/pies/defaultConfig.vala:29 msgid "Multimedia" msgstr "멀티미디어" @@ -57,13 +289,7 @@ msgstr "이전 트랙" msgid "Play/Pause" msgstr "재생/일시 정지" -#: ../../src/pies/defaultConfig.vala:36 -#: ../../src/gui/iconSelectWindow.vala:197 -msgid "Applications" -msgstr "프로그램" - #: ../../src/pies/defaultConfig.vala:45 -#: ../../src/actionGroups/bookmarkGroup.vala:35 msgid "Bookmarks" msgstr "책갈피" @@ -99,317 +325,299 @@ msgstr "최대화" msgid "Restore" msgstr "복구" -#: ../../src/gui/iconSelectWindow.vala:160 -msgid "Choose an Icon" -msgstr "아이콘 선택" - -#: ../../src/gui/iconSelectWindow.vala:196 -msgid "All icons" -msgstr "모든 아이콘" - -#: ../../src/gui/iconSelectWindow.vala:198 -msgid "Actions" -msgstr "동작" - -#: ../../src/gui/iconSelectWindow.vala:199 -msgid "Places" -msgstr "위치" - -#: ../../src/gui/iconSelectWindow.vala:200 -msgid "File types" -msgstr "파일 형식" - -#: ../../src/gui/iconSelectWindow.vala:201 -msgid "Emotes" -msgstr "감정" - -#: ../../src/gui/iconSelectWindow.vala:202 -msgid "Miscellaneous" -msgstr "기타" +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:279 +#: ../ui/icon_select.ui:84 msgid "Icon Theme" msgstr "아이콘 테마" -#: ../../src/gui/iconSelectWindow.vala:289 -msgid "All supported image formats" -msgstr "지원하는 모든 이미지 형식" - -#: ../../src/gui/iconSelectWindow.vala:311 +#: ../ui/icon_select.ui:105 msgid "Custom Icon" msgstr "사용자 설정 아이콘" -#: ../../src/gui/preferences.vala:32 -msgid "Gnome-Pie - Settings" -msgstr "그놈 파이 설정" +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "" -#: ../../src/gui/preferences.vala:55 -msgid "Behavior" -msgstr "행동" +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "" -#: ../../src/gui/preferences.vala:65 -msgid "Startup on Login" -msgstr "로그인할 때 시작" +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "터보 모드" -#: ../../src/gui/preferences.vala:66 -msgid "If checked, Gnome-Pie will start when you log in." -msgstr "선택하면 그놈 파이가 로그인할 때 자동으로 시작합니다." +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "선택하면 누른 키보드 바로가기를 떼면 파이를 닫습니다." -#: ../../src/gui/preferences.vala:72 -msgid "Show Indicator" -msgstr "알리미 보이기" +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "활성화 하려면 길게 누르세요" -#: ../../src/gui/preferences.vala:73 -msgid "If checked, an indicator for easy access of the settings menu is shown in your panel." -msgstr "선택하면 설정 메뉴에 쉽게 접근할 수 있도록 패널에 알리미를 표시합니다." +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "선택하면 파이를 단축키를 길게 누를 때만 엽니다." -#: ../../src/gui/preferences.vala:79 -msgid "Open Pies at Mouse" -msgstr "마우스로 파이 열기" +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "" -#: ../../src/gui/preferences.vala:80 -msgid "If checked, pies will open at your pointer. Otherwise they'll pop up in the middle of the screen." -msgstr "선택하면 포인터가 있는 곳에 파이가 열립니다. 그렇지 않으면 화면의 가운데에 나타납니다." +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "선택하면 파이를 단축키를 길게 누를 때만 엽니다." -#: ../../src/gui/preferences.vala:89 -msgid "Global Scale" -msgstr "전체 크기 조정" +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "" -#: ../../src/gui/preferences.vala:126 -msgid "Themes" -msgstr "테마" +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "그놈 파이 설정" + +#: ../ui/settings.ui:47 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "로그인할 때 시작" -#: ../../src/gui/preferences.vala:144 -msgid "General" -msgstr "일반" +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "선택하면 그놈 파이가 로그인할 때 자동으로 시작합니다." -#: ../../src/gui/preferences.vala:149 -msgid "Pies" -msgstr "파이" +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "" -#: ../../src/gui/preferences.vala:173 -msgid "You can right-click in the list for adding or removing entries." -msgstr "항목을 추가 또는 제거하려면 목록에서 오른쪽 단추를 누르세요." +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" -#: ../../src/gui/preferences.vala:174 -msgid "You can reset Gnome-Pie to its default options with the terminal command \"gnome-pie --reset\"." -msgstr "터미널에서 \"gnome-pie --reset\" 명령을 입혁하면 그놈 파이를 기본 설정으로 되돌릴 수 있습니다." +#: ../ui/settings.ui:92 +#, fuzzy +msgid "Global scale" +msgstr "전체 크기 조정" -#: ../../src/gui/preferences.vala:175 -msgid "The radiobutton at the beginning of each slice-line indicates the QuickAction of the pie." -msgstr "각 조각 선의 시작 지점에 있는 선택 단추는 파이의 빠른 동작을 의미합니다." +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "" -#: ../../src/gui/preferences.vala:176 -msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "터미널에서 \"gnome-pie --open=ID\" 명령을 입력하면 파이를 열 수 있습니다." +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "프로그램" -#: ../../src/gui/preferences.vala:177 -msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "편하게 그놈 파이 홈페이지 %s에 방문하십시오!" +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "" -#: ../../src/gui/preferences.vala:178 -msgid "You can drag'n'drop applications from your main menu to the list above." -msgstr "주 메뉴에서 위 목록으로 프로그램을 끌어 놓을 수 있습니다." +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "" -#: ../../src/gui/preferences.vala:179 -msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "파드백을 주시려면 주소 %s(으)로 전자 메일을 써주십시오." +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "" -#: ../../src/gui/preferences.vala:180 -msgid "You may drag'n'drop URLs and bookmarks from your internet browser to the list above." -msgstr "인터넷 브라우저에서 위 목록으로 인터넷 주소와 책갈피를 끌어 놓을 수 있습니다." +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "" -#: ../../src/gui/preferences.vala:181 -msgid "Bugs can be reported at %s!" -msgstr "버그는 %s에서 보고할 수 있습니다!" +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "" -#: ../../src/gui/preferences.vala:182 -msgid "It's possible to drag'n'drop files and folders from your file browser to the list above." -msgstr "파일 관리자에서 위 목록으로 파일과 폴더를 끌어 놓을 수 있습니다." +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "" -#: ../../src/gui/preferences.vala:183 -msgid "It's recommended to keep your Pies small (at most 6-8 Slices). Else they will become hard to navigate." -msgstr "파이를 작게 (최대 6-8 조각) 유지하십시오. 그렇지 않으면 찾기 힘들 수 있습니다." +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "" -#: ../../src/gui/preferences.vala:184 -msgid "In order to create a launcher for a Pie, drag the Pie from the list to your desktop!" -msgstr "파이 실행 아이콘을 만드려면 데스크톱 목록에서 파이로 끌어 놓으세요!" +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "" -#: ../../src/gui/preferences.vala:193 -msgid "Moves the selected Slice down" -msgstr "선택한 조각을 아래로 옮기기" +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "" -#: ../../src/gui/preferences.vala:205 -msgid "Moves the selected Slice up" -msgstr "선택한 조각을 위로 옮기기" +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "그놈 파이 설정" -#: ../../src/gui/triggerSelectWindow.vala:69 -msgid "Define an open-command" -msgstr "열기 명령 정의" +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:87 -msgid "Click here if you want to bind a mouse button!" -msgstr "마우스 단추를 묶으려면 클릭하십시오!" +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:102 -msgid "Turbo mode" -msgstr "터보 모드" +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "파이 열기" -#: ../../src/gui/triggerSelectWindow.vala:103 -msgid "If checked, the Pie will close when you release the chosen hot key." -msgstr "선택하면 누른 키보드 바로가기를 떼면 파이를 닫습니다." +#~ msgid "Choose an Icon" +#~ msgstr "아이콘 선택" + +#~ msgid "Behavior" +#~ msgstr "행동" + +#~ msgid "Show Indicator" +#~ msgstr "알리미 보이기" + +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "선택하면 설정 메뉴에 쉽게 접근할 수 있도록 패널에 알리미를 표시합니다." + +#~ msgid "Open Pies at Mouse" +#~ msgstr "마우스로 파이 열기" -#: ../../src/gui/triggerSelectWindow.vala:117 -msgid "Long press for activation" -msgstr "활성화 하려면 길게 누르세요" +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "선택하면 포인터가 있는 곳에 파이가 열립니다. 그렇지 않으면 화면의 가운데" +#~ "에 나타납니다." -#: ../../src/gui/triggerSelectWindow.vala:118 -msgid "If checked, the Pie will only open if you press this hot key a bit longer." -msgstr "선택하면 파이를 단축키를 길게 누를 때만 엽니다." +#~ msgid "General" +#~ msgstr "일반" -#: ../../src/gui/triggerSelectWindow.vala:156 -msgid "" -"This hotkey is already assigned to the pie \"%s\"! \n" -"\n" -"Please select another one or cancel your selection." -msgstr "" -"이 단축키는 이미 \"%s\" 파이에 할당했습니다!\n" -"\n" -"다른 것을 선택하거나 선택을 취소하십시오." +#~ msgid "Pies" +#~ msgstr "파이" -#: ../../src/gui/triggerSelectWindow.vala:197 -msgid "It possible to make your system unusable if you bind a Pie to your left mouse button. Do you really want to do this?" -msgstr "파이를 마우스 왼쪽 단추에 연결하면 시스템을 사용하지 못하게 될 수 있습니다. 정말 계속하시겠습니까?" - -#: ../../src/gui/themeList.vala:88 -msgid "by" -msgstr "작성자" - -#: ../../src/gui/pieList.vala:88 -#: ../../src/gui/pieList.vala:851 -msgid "Slice group" -msgstr "조각 그룹" - -#: ../../src/gui/pieList.vala:135 -msgid "Icon" -msgstr "아이콘" - -#: ../../src/gui/pieList.vala:200 -msgid "Command" -msgstr "명령" - -#: ../../src/gui/pieList.vala:301 -#: ../../src/gui/pieList.vala:707 -#: ../../src/gui/pieList.vala:867 -#: ../../src/utilities/trigger.vala:197 -#: ../../src/utilities/trigger.vala:198 -#: ../../src/utilities/bindingManager.vala:156 -msgid "Not bound" -msgstr "연결하지 않음" +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "항목을 추가 또는 제거하려면 목록에서 오른쪽 단추를 누르세요." -#: ../../src/gui/pieList.vala:366 -msgid "Pie-ID / Action type" -msgstr "파이 ID / 동작 형식" +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "터미널에서 \"gnome-pie --reset\" 명령을 입혁하면 그놈 파이를 기본 설정으" +#~ "로 되돌릴 수 있습니다." -#: ../../src/gui/pieList.vala:427 -msgid "Name" -msgstr "이름" +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "각 조각 선의 시작 지점에 있는 선택 단추는 파이의 빠른 동작을 의미합니다." -#: ../../src/gui/pieList.vala:470 -msgid "Add new Pie" -msgstr "새 파이 추가" +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "터미널에서 \"gnome-pie --open=ID\" 명령을 입력하면 파이를 열 수 있습니다." -#: ../../src/gui/pieList.vala:475 -msgid "Add new Slice" -msgstr "새 조각 추가" +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "편하게 그놈 파이 홈페이지 %s에 방문하십시오!" -#: ../../src/gui/pieList.vala:483 -msgid "Delete" -msgstr "삭제" +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "주 메뉴에서 위 목록으로 프로그램을 끌어 놓을 수 있습니다." -#: ../../src/gui/pieList.vala:619 -msgid "New Pie" -msgstr "새 파이" +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "파드백을 주시려면 주소 %s(으)로 전자 메일을 써주십시오." -#: ../../src/gui/pieList.vala:666 -msgid "New Action" -msgstr "새 동작" +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "인터넷 브라우저에서 위 목록으로 인터넷 주소와 책갈피를 끌어 놓을 수 있습니" +#~ "다." -#: ../../src/gui/pieList.vala:680 -msgid "You have to select a Pie to add a Slice to!" -msgstr "조각을 추가할 파이를 선택해야 합니다!" +#~ msgid "Bugs can be reported at %s!" +#~ msgstr "버그는 %s에서 보고할 수 있습니다!" -#: ../../src/gui/pieList.vala:730 -msgid "You have to select a Pie or a Slice to delete!" -msgstr "삭제하고 싶은 파이와 조각을 선택해야 합니다!" +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "파일 관리자에서 위 목록으로 파일과 폴더를 끌어 놓을 수 있습니다." -#: ../../src/gui/pieList.vala:741 -msgid "Do you really want to delete the selected Pie with all contained Slices?" -msgstr "선택한 파이와 파이 안의 모든 조각을 삭제하시겠습니까?" +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "파이를 작게 (최대 6-8 조각) 유지하십시오. 그렇지 않으면 찾기 힘들 수 있습" +#~ "니다." -#: ../../src/gui/pieList.vala:775 -msgid "Do you really want to delete the selected Slice?" -msgstr "정말 선택한 조각을 삭제하시겠습니까?" +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "파이 실행 아이콘을 만드려면 데스크톱 목록에서 파이로 끌어 놓으세요!" -#: ../../src/utilities/trigger.vala:152 -msgid "Button %i" -msgstr "%i 단추" +#~ msgid "Moves the selected Slice down" +#~ msgstr "선택한 조각을 아래로 옮기기" -#: ../../src/utilities/trigger.vala:155 -msgid "LeftButton" -msgstr "왼쪽 단추" +#~ msgid "Moves the selected Slice up" +#~ msgstr "선택한 조각을 위로 옮기기" -#: ../../src/utilities/trigger.vala:157 -msgid "RightButton" -msgstr "오른쪽 단추" +#~ msgid "Define an open-command" +#~ msgstr "열기 명령 정의" -#: ../../src/utilities/trigger.vala:159 -msgid "MiddleButton" -msgstr "가운데 단추" +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "마우스 단추를 묶으려면 클릭하십시오!" -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:183 -msgid "Turbo" -msgstr "터보" +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "파이를 마우스 왼쪽 단추에 연결하면 시스템을 사용하지 못하게 될 수 있습니" +#~ "다. 정말 계속하시겠습니까?" -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:185 -msgid "Delayed" -msgstr "시간 지연" +#~ msgid "by" +#~ msgstr "작성자" -#: ../../src/actionGroups/clipboardGroup.vala:63 -msgid "Clipboard" -msgstr "클립보드" +#~ msgid "Slice group" +#~ msgstr "조각 그룹" -#: ../../src/actionGroups/sessionGroup.vala:34 -msgid "Session Control" -msgstr "세션 컨트롤" +#~ msgid "Icon" +#~ msgstr "아이콘" -#: ../../src/actionGroups/sessionGroup.vala:57 -msgid "Shutdown" -msgstr "시스템 끄기" +#~ msgid "Command" +#~ msgstr "명령" -#: ../../src/actionGroups/sessionGroup.vala:60 -msgid "Logout" -msgstr "로그아웃" +#~ msgid "Pie-ID / Action type" +#~ msgstr "파이 ID / 동작 형식" -#: ../../src/actionGroups/sessionGroup.vala:63 -msgid "Reboot" -msgstr "다시 시작" +#~ msgid "Name" +#~ msgstr "이름" -#: ../../src/actionGroups/devicesGroup.vala:34 -msgid "Devices" -msgstr "장치" +#~ msgid "Add new Pie" +#~ msgstr "새 파이 추가" -#: ../../src/actionGroups/devicesGroup.vala:82 -msgid "Root" -msgstr "루트" +#~ msgid "Delete" +#~ msgstr "삭제" -#: ../../src/actionGroups/windowListGroup.vala:33 -msgid "Window List" -msgstr "창 목록" +#~ msgid "New Action" +#~ msgstr "새 동작" -#: ../../src/actionGroups/menuGroup.vala:34 -msgid "Main menu" -msgstr "주 메뉴" +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "조각을 추가할 파이를 선택해야 합니다!" +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "삭제하고 싶은 파이와 조각을 선택해야 합니다!" diff --git a/resources/locale/pt-br/LC_MESSAGES/gnomepie.mo b/resources/locale/pt-br/LC_MESSAGES/gnomepie.mo index 6c1ad52..7a60d1e 100644 Binary files a/resources/locale/pt-br/LC_MESSAGES/gnomepie.mo and b/resources/locale/pt-br/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/pt-br/LC_MESSAGES/pt-br.mo b/resources/locale/pt-br/LC_MESSAGES/pt-br.mo deleted file mode 100644 index 6c1ad52..0000000 Binary files a/resources/locale/pt-br/LC_MESSAGES/pt-br.mo and /dev/null differ diff --git a/resources/locale/pt-br/LC_MESSAGES/pt-br.po b/resources/locale/pt-br/LC_MESSAGES/pt-br.po index 500c02a..82faec4 100644 --- a/resources/locale/pt-br/LC_MESSAGES/pt-br.po +++ b/resources/locale/pt-br/LC_MESSAGES/pt-br.po @@ -7,44 +7,52 @@ msgid "" msgstr "" "Project-Id-Version: gnomepie 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-08 21:10-0200\n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" "PO-Revision-Date: 2011-11-08 21:49-0300\n" "Last-Translator: Magnun Leno da Silva \n" "Language-Team: Language pt-br\n" +"Language: pt-br\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt-br\n" -#: ../../src/gui/themeList.vala:88 -msgid "by" -msgstr "por" +#: ../../src/actions/keyAction.vala:34 +msgid "Press hotkey" +msgstr "Pressione a tecla de atalho" -#: ../../src/gui/triggerSelectWindow.vala:69 -msgid "Define an open-command" -msgstr "Definir um comando de abertura" +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:87 -msgid "Click here if you want to bind a mouse button!" -msgstr "Clique aqui para vincular um botão do mouse!" +#: ../../src/actions/appAction.vala:34 +msgid "Launch application" +msgstr "Lançar aplicação" -#: ../../src/gui/triggerSelectWindow.vala:102 -msgid "Turbo mode" -msgstr "Modo Turbo" +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:103 -msgid "If checked, the Pie will close when you release the chosen hot key." -msgstr "Se marcado, o Menu irá fechar quando o atalho for liberado." +#: ../../src/actions/uriAction.vala:34 +msgid "Open URI" +msgstr "Abrir URL" -#: ../../src/gui/triggerSelectWindow.vala:117 -msgid "Long press for activation" -msgstr "Clique longo para ativação" +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "" -#: ../../src/gui/triggerSelectWindow.vala:118 -msgid "If checked, the Pie will only open if you press this hot key a bit longer." -msgstr "Se marcador, o Menu irá abrir somente se você pressionar este atalho por mais um tempo." +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "Remover" -#: ../../src/gui/triggerSelectWindow.vala:158 +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "Abrir menu" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "" + +#: ../../src/gui/triggerSelectWindow.vala:144 msgid "" "This hotkey is already assigned to the pie \"%s\"! \n" "\n" @@ -54,311 +62,212 @@ msgstr "" "\n" "Por favor escolha outro ou cancele sua seleção." -#: ../../src/gui/triggerSelectWindow.vala:199 -msgid "It possible to make your system unusable if you bind a Pie to your left mouse button. Do you really want to do this?" -msgstr "É possível tornar seu sistema inútil caso você vincule um Menu ao botão esquerdo do mouse. Você realmente quer fazer isso?" - -#: ../../src/gui/preferences.vala:32 -msgid "Gnome-Pie - Settings" -msgstr "Gnome-Pie - Configurações" - -#: ../../src/gui/preferences.vala:55 -msgid "Behavior" -msgstr "Comportamento" - -#: ../../src/gui/preferences.vala:65 -msgid "Startup on Login" -msgstr "Iniciar durante o Login" - -#: ../../src/gui/preferences.vala:66 -msgid "If checked, Gnome-Pie will start when you log in." -msgstr "Se marcado, o Gnome-Pie irá iniciar durante o login." - -#: ../../src/gui/preferences.vala:72 -msgid "Show Indicator" -msgstr "Mostrar Indicador" - -#: ../../src/gui/preferences.vala:73 -msgid "If checked, an indicator for easy access of the settings menu is shown in your panel." -msgstr "Se marcado, um indicador para facilitar o acesso às configurações estará disponível em seu painel." - -#: ../../src/gui/preferences.vala:79 -msgid "Open Pies at Mouse" -msgstr "Abrir Menus sobre o Mouse" - -#: ../../src/gui/preferences.vala:80 -msgid "If checked, pies will open at your pointer. Otherwise they'll pop up in the middle of the screen." -msgstr "Se marcado, os menus não irão abrir sob o ponteiro. Ao invés disso eles abrirão no meio da sua tela." - -#: ../../src/gui/preferences.vala:89 -msgid "Global Scale" -msgstr "Escalonamento Global" +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "" -#: ../../src/gui/preferences.vala:126 -msgid "Themes" -msgstr "Temas" +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Novo Menu" -#: ../../src/gui/preferences.vala:144 -msgid "General" -msgstr "Geral" - -#: ../../src/gui/preferences.vala:149 -msgid "Pies" -msgstr "Menus" - -#: ../../src/gui/preferences.vala:173 -msgid "You can right-click in the list for adding or removing entries." -msgstr "Você pode clicar com o botão direito sobre a lista para adicioná-las ou removê-las." - -#: ../../src/gui/preferences.vala:174 -msgid "You can reset Gnome-Pie to its default options with the terminal command \"gnome-pie --reset\"." -msgstr "Você pode voltar o Gnome-Pie para suas configurações padrão usando o comando de terminal \"gnome-pie --reset\"." - -#: ../../src/gui/preferences.vala:175 -msgid "The radiobutton at the beginning of each slice-line indicates the QuickAction of the pie." -msgstr "O botão de seleção no início de cada Opção indica a Ação Rápida vinculada ao Menu." - -#: ../../src/gui/preferences.vala:176 -msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "Menus podem ser abertos através do terminal com o comando \"gnome-pie --open=ID\"." - -#: ../../src/gui/preferences.vala:177 -msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "Sinta-se a vontade para visitar o site do Gnome-Pie em %s" - -#: ../../src/gui/preferences.vala:178 -msgid "You can drag'n'drop applications from your main menu to the list above." -msgstr "Você pode arrastar aplicações do seu menu principal para a lista acima." - -#: ../../src/gui/preferences.vala:179 -msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "Se você quiser enviar algum feedback, por favor escreva um e-mail para %s!" - -#: ../../src/gui/preferences.vala:180 -msgid "You may drag'n'drop URLs and bookmarks from your internet browser to the list above." -msgstr "Você pode arrastar URLs e Favoritos do seu navegador predileto para a lista acima." - -#: ../../src/gui/preferences.vala:181 -msgid "Bugs can be reported at %s!" -msgstr "Defeitos podem ser informados em %s!" - -#: ../../src/gui/preferences.vala:182 -msgid "It's possible to drag'n'drop files and folders from your file browser to the list above." -msgstr "É possível arrastar arquivos e pastas do seu navegador para dentro da lista acima." - -#: ../../src/gui/preferences.vala:183 -msgid "It's recommended to keep your Pies small (at most 6-8 Slices). Else they will become hard to navigate." -msgstr "É recomendado que você mantenha seus Menus pequenos (no máximo 6-8 Opções). Ou ele se tornará difícil de navegar." - -#: ../../src/gui/preferences.vala:184 -msgid "In order to create a launcher for a Pie, drag the Pie from the list to your desktop!" -msgstr "Se deseja criar o lançador de um Menu, arraste o Menu da lista para o seu desktop!" - -#: ../../src/gui/preferences.vala:193 -msgid "Moves the selected Slice down" -msgstr "Move a Opção selecionada para baixo" - -#: ../../src/gui/preferences.vala:205 -msgid "Moves the selected Slice up" -msgstr "Move a Opção selecionada para cima" - -#: ../../src/gui/pieList.vala:88 -#: ../../src/gui/pieList.vala:851 -msgid "Slice group" -msgstr "Grupo de Opções" - -#: ../../src/gui/pieList.vala:135 -msgid "Icon" -msgstr "Ícone" - -#: ../../src/gui/pieList.vala:200 -msgid "Command" -msgstr "Comando" - -#: ../../src/gui/pieList.vala:301 -#: ../../src/gui/pieList.vala:707 -#: ../../src/gui/pieList.vala:867 -#: ../../src/utilities/trigger.vala:197 -#: ../../src/utilities/trigger.vala:198 -#: ../../src/utilities/bindingManager.vala:156 -msgid "Not bound" -msgstr "Sem vinculações" +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "" +"Você realmente deseja excluir o Menu selecionado e todas as suas Opções?" -#: ../../src/gui/pieList.vala:366 -msgid "Pie-ID / Action type" -msgstr "ID-Opção / Tipo de Ação" +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "" -#: ../../src/gui/pieList.vala:427 -msgid "Name" -msgstr "Nome" +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "" -#: ../../src/gui/pieList.vala:470 -msgid "Add new Pie" -msgstr "Adicionar novo Menu" +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "" -#: ../../src/gui/pieList.vala:475 -msgid "Add new Slice" +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" msgstr "Adicionar nova Opção" -#: ../../src/gui/pieList.vala:483 -msgid "Delete" -msgstr "Deletar" +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "Adicionar nova Opção" -#: ../../src/gui/pieList.vala:619 -msgid "New Pie" -msgstr "Novo Menu" +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "" -#: ../../src/gui/pieList.vala:666 -msgid "New Action" -msgstr "Nova Ação" +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "" -#: ../../src/gui/pieList.vala:680 -msgid "You have to select a Pie to add a Slice to!" -msgstr "Você tem que selecionar um Menu para poder adicionar uma Opção" +#: ../../src/gui/triggerSelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "Pressione a tecla de atalho" -#: ../../src/gui/pieList.vala:730 -msgid "You have to select a Pie or a Slice to delete!" -msgstr "Para remover você precisa selecionar um Menu ou uma Opção" +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "Você realmente deseja excluir a Opção selecionada?" -#: ../../src/gui/pieList.vala:741 -msgid "Do you really want to delete the selected Pie with all contained Slices?" -msgstr "Você realmente deseja excluir o Menu selecionado e todas as suas Opções?" +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Temas" -#: ../../src/gui/pieList.vala:775 -msgid "Do you really want to delete the selected Slice?" -msgstr "Você realmente deseja excluir a Opção selecionada?" +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "" -#: ../../src/gui/iconSelectWindow.vala:160 -msgid "Choose an Icon" -msgstr "Escolha um Ícone" +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "Tipos de arquivos" -#: ../../src/gui/iconSelectWindow.vala:196 +#: ../../src/gui/iconSelectWindow.vala:178 msgid "All icons" msgstr "Todos os ícones" -#: ../../src/gui/iconSelectWindow.vala:197 +#: ../../src/gui/iconSelectWindow.vala:179 #: ../../src/pies/defaultConfig.vala:36 msgid "Applications" msgstr "Aplicações" -#: ../../src/gui/iconSelectWindow.vala:198 +#: ../../src/gui/iconSelectWindow.vala:180 msgid "Actions" msgstr "Ações" -#: ../../src/gui/iconSelectWindow.vala:199 +#: ../../src/gui/iconSelectWindow.vala:181 msgid "Places" msgstr "Lugares" -#: ../../src/gui/iconSelectWindow.vala:200 +#: ../../src/gui/iconSelectWindow.vala:182 msgid "File types" msgstr "Tipos de arquivos" -#: ../../src/gui/iconSelectWindow.vala:201 +#: ../../src/gui/iconSelectWindow.vala:183 msgid "Emotes" msgstr "Emotes" -#: ../../src/gui/iconSelectWindow.vala:202 +#: ../../src/gui/iconSelectWindow.vala:184 msgid "Miscellaneous" msgstr "Diversos" -#: ../../src/gui/iconSelectWindow.vala:279 -msgid "Icon Theme" -msgstr "Tema de Ícones" - -#: ../../src/gui/iconSelectWindow.vala:289 +#: ../../src/gui/iconSelectWindow.vala:257 msgid "All supported image formats" msgstr "Todos os tipos de imagem suportados" -#: ../../src/gui/iconSelectWindow.vala:311 -msgid "Custom Icon" -msgstr "Outros Ícones" - -#: ../../src/utilities/trigger.vala:152 -msgid "Button %i" -msgstr "Botão %i" - -#: ../../src/utilities/trigger.vala:155 -msgid "LeftButton" -msgstr "Botão Esquerdo" - -#: ../../src/utilities/trigger.vala:157 -msgid "RightButton" -msgstr "Botão Direito" - -#: ../../src/utilities/trigger.vala:159 -msgid "MiddleButton" -msgstr "Botão do Meio" - -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:183 -msgid "Turbo" -msgstr "Turbo" - -#: ../../src/utilities/trigger.vala:181 -#: ../../src/utilities/trigger.vala:185 -msgid "Delayed" -msgstr "Atrasado" +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "Lista de Janelas" -#: ../../src/actionGroups/clipboardGroup.vala:63 -msgid "Clipboard" -msgstr "Clipboard" +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "" -#: ../../src/actionGroups/menuGroup.vala:34 -msgid "Main menu" +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" msgstr "Menu Principal" -#: ../../src/actionGroups/windowListGroup.vala:33 -msgid "Window List" -msgstr "Lista de Janelas" +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "" -#: ../../src/actionGroups/devicesGroup.vala:34 -msgid "Devices" -msgstr "Dispositivos" +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "Clipboard" -#: ../../src/actionGroups/devicesGroup.vala:82 -msgid "Root" -msgstr "Raiz" +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "" -#: ../../src/actionGroups/sessionGroup.vala:34 -msgid "Session Control" +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" msgstr "Controle de Sessão" -#: ../../src/actionGroups/sessionGroup.vala:52 +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "" + +#: ../../src/actionGroups/sessionGroup.vala:60 msgid "Shutdown" msgstr "Desligar" -#: ../../src/actionGroups/sessionGroup.vala:55 +#: ../../src/actionGroups/sessionGroup.vala:63 msgid "Logout" msgstr "Logout" -#: ../../src/actionGroups/sessionGroup.vala:58 +#: ../../src/actionGroups/sessionGroup.vala:66 msgid "Reboot" msgstr "Reboot" -#: ../../src/actionGroups/bookmarkGroup.vala:35 -#: ../../src/pies/defaultConfig.vala:45 -msgid "Bookmarks" +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" msgstr "Favoritos" -#: ../../src/actions/pieAction.vala:33 -msgid "Open Pie" -msgstr "Abrir menu" +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "" -#: ../../src/actions/keyAction.vala:33 -msgid "Press hotkey" -msgstr "Pressione a tecla de atalho" +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "Dispositivos" -#: ../../src/actions/uriAction.vala:33 -msgid "Open URI" -msgstr "Abrir URL" +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "" -#: ../../src/actions/actionRegistry.vala:107 -msgid "Trash" -msgstr "Remover" +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "Raiz" -#: ../../src/actions/appAction.vala:33 -msgid "Launch application" -msgstr "Lançar aplicação" +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "Sem vinculações" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "Botão %i" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "Botão Esquerdo" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "Botão Direito" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "Botão do Meio" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "Turbo" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "Atrasado" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "" #: ../../src/pies/defaultConfig.vala:29 msgid "Multimedia" @@ -380,6 +289,10 @@ msgstr "Faixa Anterior" msgid "Play/Pause" msgstr "Play/Pausa" +#: ../../src/pies/defaultConfig.vala:45 +msgid "Bookmarks" +msgstr "Favoritos" + #: ../../src/pies/defaultConfig.vala:50 msgid "Session" msgstr "Sessão" @@ -412,6 +325,318 @@ msgstr "Maximizar" msgid "Restore" msgstr "Restaurar" +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "" + +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Tema de Ícones" + +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Outros Ícones" + +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "" + +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "" + +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Modo Turbo" + +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "Se marcado, o Menu irá fechar quando o atalho for liberado." + +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Clique longo para ativação" + +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"Se marcador, o Menu irá abrir somente se você pressionar este atalho por " +"mais um tempo." + +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "" + +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"Se marcador, o Menu irá abrir somente se você pressionar este atalho por " +"mais um tempo." + +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "" + +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "Gnome-Pie - Configurações" + +#: ../ui/settings.ui:47 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "Iniciar durante o Login" + +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "Se marcado, o Gnome-Pie irá iniciar durante o login." + +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "" + +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" + +#: ../ui/settings.ui:92 +#, fuzzy +msgid "Global scale" +msgstr "Escalonamento Global" + +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "" + +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "Aplicações" + +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "" + +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "" + +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "" + +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "" + +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "" + +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "" + +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "" + +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "" + +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "Gnome-Pie - Configurações" + +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" + +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" + +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "Abrir menu" + +#~ msgid "by" +#~ msgstr "por" + +#~ msgid "Define an open-command" +#~ msgstr "Definir um comando de abertura" + +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "Clique aqui para vincular um botão do mouse!" + +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "É possível tornar seu sistema inútil caso você vincule um Menu ao botão " +#~ "esquerdo do mouse. Você realmente quer fazer isso?" + +#~ msgid "Behavior" +#~ msgstr "Comportamento" + +#~ msgid "Show Indicator" +#~ msgstr "Mostrar Indicador" + +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "Se marcado, um indicador para facilitar o acesso às configurações estará " +#~ "disponível em seu painel." + +#~ msgid "Open Pies at Mouse" +#~ msgstr "Abrir Menus sobre o Mouse" + +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "Se marcado, os menus não irão abrir sob o ponteiro. Ao invés disso eles " +#~ "abrirão no meio da sua tela." + +#~ msgid "General" +#~ msgstr "Geral" + +#~ msgid "Pies" +#~ msgstr "Menus" + +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "" +#~ "Você pode clicar com o botão direito sobre a lista para adicioná-las ou " +#~ "removê-las." + +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "Você pode voltar o Gnome-Pie para suas configurações padrão usando o " +#~ "comando de terminal \"gnome-pie --reset\"." + +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "O botão de seleção no início de cada Opção indica a Ação Rápida vinculada " +#~ "ao Menu." + +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "Menus podem ser abertos através do terminal com o comando \"gnome-pie --" +#~ "open=ID\"." + +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "Sinta-se a vontade para visitar o site do Gnome-Pie em %s" + +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "" +#~ "Você pode arrastar aplicações do seu menu principal para a lista acima." + +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "" +#~ "Se você quiser enviar algum feedback, por favor escreva um e-mail para %s!" + +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "Você pode arrastar URLs e Favoritos do seu navegador predileto para a " +#~ "lista acima." + +#~ msgid "Bugs can be reported at %s!" +#~ msgstr "Defeitos podem ser informados em %s!" + +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "" +#~ "É possível arrastar arquivos e pastas do seu navegador para dentro da " +#~ "lista acima." + +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "É recomendado que você mantenha seus Menus pequenos (no máximo 6-8 " +#~ "Opções). Ou ele se tornará difícil de navegar." + +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "" +#~ "Se deseja criar o lançador de um Menu, arraste o Menu da lista para o seu " +#~ "desktop!" + +#~ msgid "Moves the selected Slice down" +#~ msgstr "Move a Opção selecionada para baixo" + +#~ msgid "Moves the selected Slice up" +#~ msgstr "Move a Opção selecionada para cima" + +#~ msgid "Slice group" +#~ msgstr "Grupo de Opções" + +#~ msgid "Icon" +#~ msgstr "Ícone" + +#~ msgid "Command" +#~ msgstr "Comando" + +#~ msgid "Pie-ID / Action type" +#~ msgstr "ID-Opção / Tipo de Ação" + +#~ msgid "Name" +#~ msgstr "Nome" + +#~ msgid "Add new Pie" +#~ msgstr "Adicionar novo Menu" + +#~ msgid "Delete" +#~ msgstr "Deletar" + +#~ msgid "New Action" +#~ msgstr "Nova Ação" + +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "Você tem que selecionar um Menu para poder adicionar uma Opção" + +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "Para remover você precisa selecionar um Menu ou uma Opção" + +#~ msgid "Choose an Icon" +#~ msgstr "Escolha um Ícone" + #~ msgid "" #~ "If checked, the pie closes when its keystroke is released. The currently " #~ "hovered slice gets executed. This allows very fast selection but disables " @@ -420,4 +645,3 @@ msgstr "Restaurar" #~ "Se marcado, o menu se fechará quando a combinação de teclas for liberada. " #~ "A opção que estiver sobre o cursor será executada. Essa opção possibilita " #~ "uma uma seleção rápida mas desativa a navegação pelo teclado." - diff --git a/resources/locale/ru/LC_MESSAGES/gnomepie.mo b/resources/locale/ru/LC_MESSAGES/gnomepie.mo new file mode 100644 index 0000000..9a51f6c Binary files /dev/null and b/resources/locale/ru/LC_MESSAGES/gnomepie.mo differ diff --git a/resources/locale/ru/LC_MESSAGES/ru.po b/resources/locale/ru/LC_MESSAGES/ru.po new file mode 100644 index 0000000..3020341 --- /dev/null +++ b/resources/locale/ru/LC_MESSAGES/ru.po @@ -0,0 +1,656 @@ +# Russian translations for gnomepie package +# Русские переводы для пакета gnomepie. +# Copyright (C) 2012 Simon Schneegans +# This file is distributed under the same license as the gnomepie package. +# Roskin , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: gnomepie 0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-01-19 20:25+0100\n" +"PO-Revision-Date: 2012-01-14 17:15+0400\n" +"Last-Translator: Eugene Roskin \n" +"Language-Team: Russian\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: ../../src/actions/keyAction.vala:34 +msgid "Press hotkey" +msgstr "Нажмите сочетание клавиш быстрого доступа" + +#: ../../src/actions/keyAction.vala:36 +msgid "Simulates the activation of a hotkey." +msgstr "Имитирует активацию сочетания клавиш быстрого доступа." + +#: ../../src/actions/appAction.vala:34 +msgid "Launch application" +msgstr "Запустить приложение" + +#: ../../src/actions/appAction.vala:36 +msgid "Executes the given command." +msgstr "Выполняет заданную команду." + +#: ../../src/actions/uriAction.vala:34 +msgid "Open URI" +msgstr "Открытие URI" + +#: ../../src/actions/uriAction.vala:36 +msgid "Opens a given location. You may use URL's or files paths." +msgstr "Открывает заданный адрес. Вы можете использовать адресные ссылки или адреса файлов." + +#: ../../src/actions/actionRegistry.vala:111 +msgid "Trash" +msgstr "Корзина" + +#: ../../src/actions/pieAction.vala:34 +msgid "Open Pie" +msgstr "Открытие пая" + +#: ../../src/actions/pieAction.vala:36 +msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." +msgstr "Oткрывает ещё один пай Gnome-Pie. Таким образом вы можете создавать подменю." + +#: ../../src/gui/triggerSelectWindow.vala:144 +msgid "" +"This hotkey is already assigned to the pie \"%s\"! \n" +"\n" +"Please select another one or cancel your selection." +msgstr "" +"Эта клавиша быстрого доступа уже назначена паю \"%s\"! \n" +"\n" +"Пожалуйста, выберите другую или выполните отмену выбора." + +#: ../../src/gui/preferencesWindow.vala:145 +msgid "No Pie selected." +msgstr "Пай не выбран" + +#: ../../src/gui/preferencesWindow.vala:181 +msgid "New Pie" +msgstr "Новый пай" + +#: ../../src/gui/preferencesWindow.vala:190 +msgid "" +"Do you really want to delete the selected Pie with all contained Slices?" +msgstr "" +"Вы действительно хотите удалить выделенный пай, со всеми содержащимися в нём " +"порциями?" + +#: ../../src/gui/newSliceWindow.vala:229 +msgid "Rename me!" +msgstr "Переименуйте меня!" + +#: ../../src/gui/piePreviewRenderer.vala:292 +msgid "Click to edit" +msgstr "Щёлкните для выполнения изменений" + +#: ../../src/gui/piePreviewRenderer.vala:292 +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Drag to move" +msgstr "Перетаскивайте для выполнения перемещения" + +#: ../../src/gui/piePreviewRenderer.vala:295 +#, fuzzy +msgid "Click to add a new Slice" +msgstr "Щёлкните для добавления новой порции" + +#: ../../src/gui/piePreviewRenderer.vala:299 +#, fuzzy +msgid "Drop to add as new Slice" +msgstr "Перетаскивайте для выполнения добавления в качастве новой порции" + +#: ../../src/gui/piePreviewRenderer.vala:302 +msgid "Drop to move Slice" +msgstr "Перетаскивайте для выполнения перемещения порции" + +#: ../../src/gui/piePreviewRenderer.vala:307 +msgid "Click to delete" +msgstr "Щёлкните для выполнения удаления" + +#: ../../src/gui/triggerSelectButton.vala:59 +#, fuzzy +msgid "Press a hotkey ..." +msgstr "Нажмите сочетание клавиш быстрого доступа" + +#: ../../src/gui/piePreview.vala:120 +#, fuzzy +msgid "Do you really want to delete this Slice?" +msgstr "Вы действительно хотите удалить эту порцию?" + +#: ../../src/gui/themeList.vala:48 +msgid "Themes" +msgstr "Темы" + +#: ../../src/gui/themeList.vala:80 +msgid "By" +msgstr "-" + +#: ../../src/gui/sliceTypeList.vala:56 +#, fuzzy +msgid "Slice types" +msgstr "Типы порций" + +#: ../../src/gui/iconSelectWindow.vala:178 +msgid "All icons" +msgstr "Все значки" + +#: ../../src/gui/iconSelectWindow.vala:179 +#: ../../src/pies/defaultConfig.vala:36 +msgid "Applications" +msgstr "Приложения" + +#: ../../src/gui/iconSelectWindow.vala:180 +msgid "Actions" +msgstr "Действия" + +#: ../../src/gui/iconSelectWindow.vala:181 +msgid "Places" +msgstr "Переходы" + +#: ../../src/gui/iconSelectWindow.vala:182 +msgid "File types" +msgstr "Типы файлов" + +#: ../../src/gui/iconSelectWindow.vala:183 +msgid "Emotes" +msgstr "Эмоции" + +#: ../../src/gui/iconSelectWindow.vala:184 +msgid "Miscellaneous" +msgstr "Дополнительно" + +#: ../../src/gui/iconSelectWindow.vala:257 +msgid "All supported image formats" +msgstr "Все поддерживаемые форматы изображений" + +#: ../../src/actionGroups/windowListGroup.vala:34 +#, fuzzy +msgid "Group: Window List" +msgstr "Группа: Список окон" + +#: ../../src/actionGroups/windowListGroup.vala:36 +msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." +msgstr "Показывает порцию для каждого из открытых окон. Как это делает Alt-Tab." + +#: ../../src/actionGroups/menuGroup.vala:35 +#, fuzzy +msgid "Group: Main menu" +msgstr "Группа: Основное меню" + +#: ../../src/actionGroups/menuGroup.vala:37 +msgid "Displays your main menu structure." +msgstr "Отображает структуру вашего основного меню." + +#: ../../src/actionGroups/clipboardGroup.vala:64 +#, fuzzy +msgid "Group: Clipboard" +msgstr "Группа: Буфер обмена" + +#: ../../src/actionGroups/clipboardGroup.vala:66 +msgid "Manages your Clipboard." +msgstr "Управляет вашим буфером обмена." + +#: ../../src/actionGroups/sessionGroup.vala:35 +#, fuzzy +msgid "Group: Session Control" +msgstr "Группа: Управление сеансом" + +#: ../../src/actionGroups/sessionGroup.vala:37 +msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." +msgstr "Показывает порцию для операций выключения, перезагрузки и спящего режима." + +#: ../../src/actionGroups/sessionGroup.vala:60 +msgid "Shutdown" +msgstr "Выключить" + +#: ../../src/actionGroups/sessionGroup.vala:63 +msgid "Logout" +msgstr "Завершить сеанс" + +#: ../../src/actionGroups/sessionGroup.vala:66 +msgid "Reboot" +msgstr "Перезагрузить" + +#: ../../src/actionGroups/bookmarkGroup.vala:36 +#, fuzzy +msgid "Group: Bookmarks" +msgstr "Группа: Закладки" + +#: ../../src/actionGroups/bookmarkGroup.vala:38 +msgid "Shows a Slice for each of your directory Bookmarks." +msgstr "Показывает порцию содержащую закладки папок." + +#: ../../src/actionGroups/devicesGroup.vala:35 +#, fuzzy +msgid "Group: Devices" +msgstr "Группа: Устройства" + +#: ../../src/actionGroups/devicesGroup.vala:37 +msgid "Shows a Slice for each plugged in devices, like USB-Sticks." +msgstr "Показывает порцию подключённых устройств, например USB-накопителя." + +#: ../../src/actionGroups/devicesGroup.vala:85 +msgid "Root" +msgstr "Файловая система" + +#: ../../src/utilities/bindingManager.vala:155 ../../src/utilities/key.vala:65 +#: ../../src/utilities/trigger.vala:216 ../../src/utilities/trigger.vala:217 +msgid "Not bound" +msgstr "Нет привязки" + +#: ../../src/utilities/trigger.vala:163 +msgid "Button %i" +msgstr "Кнопка %i" + +#: ../../src/utilities/trigger.vala:166 +msgid "LeftButton" +msgstr "ЛеваяКнопка" + +#: ../../src/utilities/trigger.vala:168 +msgid "RightButton" +msgstr "ПраваяКнопка" + +#: ../../src/utilities/trigger.vala:170 +msgid "MiddleButton" +msgstr "СредняяКнопка" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:196 ../../src/utilities/trigger.vala:200 +msgid "Turbo" +msgstr "Турбо" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:196 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:202 +msgid "Delayed" +msgstr "Задержка" + +#: ../../src/utilities/trigger.vala:192 ../../src/utilities/trigger.vala:194 +#: ../../src/utilities/trigger.vala:198 ../../src/utilities/trigger.vala:204 +msgid "Centered" +msgstr "По центру" + +#: ../../src/pies/defaultConfig.vala:29 +msgid "Multimedia" +msgstr "Мультимедиа" + +#: ../../src/pies/defaultConfig.vala:30 +msgid "Next Track" +msgstr "Следующая композиция" + +#: ../../src/pies/defaultConfig.vala:31 +msgid "Stop" +msgstr "Остановить" + +#: ../../src/pies/defaultConfig.vala:32 +msgid "Previous Track" +msgstr "Предыдущая композиция" + +#: ../../src/pies/defaultConfig.vala:33 +msgid "Play/Pause" +msgstr "Воспроизвести или приостановить" + +#: ../../src/pies/defaultConfig.vala:45 +msgid "Bookmarks" +msgstr "Закладки" + +#: ../../src/pies/defaultConfig.vala:50 +msgid "Session" +msgstr "Сеанс" + +#: ../../src/pies/defaultConfig.vala:54 +msgid "Main Menu" +msgstr "Основное меню" + +#: ../../src/pies/defaultConfig.vala:58 +msgid "Window" +msgstr "Окно" + +#: ../../src/pies/defaultConfig.vala:59 +msgid "Scale" +msgstr "Масштаб" + +#: ../../src/pies/defaultConfig.vala:60 +msgid "Minimize" +msgstr "Свернуть" + +#: ../../src/pies/defaultConfig.vala:61 +msgid "Close" +msgstr "Закрыть" + +#: ../../src/pies/defaultConfig.vala:62 +msgid "Maximize" +msgstr "Развернуть" + +#: ../../src/pies/defaultConfig.vala:63 +msgid "Restore" +msgstr "Восстановить" + +#: ../ui/icon_select.ui:8 +msgid "Select an icon" +msgstr "Выберите значок" + +#: ../ui/icon_select.ui:84 +msgid "Icon Theme" +msgstr "Тема значков" + +#: ../ui/icon_select.ui:105 +msgid "Custom Icon" +msgstr "Настроить значок" + +#: ../ui/trigger_select.ui:8 +msgid "Activation Settings" +msgstr "Настройки активации" + +#: ../ui/trigger_select.ui:44 +msgid "It's possible to bind mouse buttons as well!" +msgstr "Также возможно назначать кнопки мыши!" + +#: ../ui/trigger_select.ui:76 +msgid "Turbo mode" +msgstr "Турбо-режим" + +#: ../ui/trigger_select.ui:80 +msgid "If checked, the Pie will close when you release the chosen hot key." +msgstr "" +"Если выбрана эта возможность, пай закроется после того, как вы отпустите " +" клавиши быстрого доступа" + +#: ../ui/trigger_select.ui:93 +msgid "Long press for activation" +msgstr "Продолжительное нажатие для активации" + +#: ../ui/trigger_select.ui:97 +msgid "" +"If checked, the Pie will only open if you press this hot key a bit longer." +msgstr "" +"Если выбрана эта возможность, пай откроется только, если вы " +"продолжительно зажмёте эту клавишу быстрого доступа." + +#: ../ui/trigger_select.ui:110 +msgid "Open Pie centered on the screen" +msgstr "Открыть пай по центру экрана" + +#: ../ui/trigger_select.ui:114 +#, fuzzy +msgid "" +"If checked, the Pie will open in the middle of your screen. Else it will pop " +"up at your pointer." +msgstr "" +"Если выбрана эта возможность, пай откроется в центре вашего экрана." +"А также может открываться чуть выше вашего курсора." + +#: ../ui/trigger_select.ui:133 +msgid "Activation options" +msgstr "Параметры активации" + +#: ../ui/settings.ui:8 ../ui/preferences.ui:27 +#, fuzzy +msgid "General Settings" +msgstr "Основные настройки" + +#: ../ui/settings.ui:47 +#, fuzzy +msgid "Start Gnome-Pie on login" +msgstr "Запускать Gnome-Pie при загрузке системы" + +#: ../ui/settings.ui:52 ../ui/settings.ui:53 +#, fuzzy +msgid "If checked, Gnome-Pie will start silently everytime you log in." +msgstr "" +"Если выбрана эта возможность, Gnome-Pie будет фоново запускаться после входа в систему." + +#: ../ui/settings.ui:66 +msgid "Display panel icon " +msgstr "Показывать значок на панели " + +#: ../ui/settings.ui:71 ../ui/settings.ui:72 +msgid "" +"If not checked, you can access this menu by launching Gnome-Pie a second " +"time." +msgstr "" +"Если эта возможность не выбрана, вы можете получить доступ к этому меню запустив " +"Gnome-Pie второй раз." + +#: ../ui/settings.ui:92 +#, fuzzy +msgid "Global scale" +msgstr "Общий масштаб" + +#: ../ui/settings.ui:130 +msgid "Appearance and behavior" +msgstr "Оформление и поведение" + +#: ../ui/slice_select.ui:8 +#, fuzzy +msgid "Slice Options" +msgstr "Параметры порции" + +#: ../ui/slice_select.ui:95 +msgid "There are no options for this Slice type." +msgstr "Отсутствуют параметры для этого типа порции" + +#: ../ui/slice_select.ui:121 +msgid "Name of the Slice " +msgstr "Название порции" + +#: ../ui/slice_select.ui:159 +msgid "URI to open" +msgstr "URI для открытия" + +#: ../ui/slice_select.ui:197 +msgid "Command to execute" +msgstr "Командая для выполнения" + +#: ../ui/slice_select.ui:235 +msgid "Hotkey to press" +msgstr "Клавиша быстрого доступа для нажатия" + +#: ../ui/slice_select.ui:264 +msgid "Pie to open" +msgstr "Пай для открытия" + +#: ../ui/slice_select.ui:293 +msgid "Is Quick Action" +msgstr "Это быстрое действие" + +#: ../ui/slice_select.ui:306 +msgid "This Slice will be executed when you click in the middle of the Pie." +msgstr "Эта порция будет выполнена, после нажатия в центре пая" + +#: ../ui/slice_select.ui:339 +msgid "Slice options" +msgstr "Параметры порции" + +#: ../ui/preferences.ui:8 +#, fuzzy +msgid "Gnome-Pie Settings" +msgstr "Настройки Gnome-Pie" + +#: ../ui/preferences.ui:261 +msgid "" +"This Pie is empty!\n" +"\n" +"Start adding Slices to it! This can be done by dragging stuff to the " +"plus sign below. You can try a lot! For example application launchers or " +"folders. Even URLs from your browser are possible... \n" +"\n" +"For manual and advanced configuration click on the plus sign." +msgstr "" +"Этот пай пуст!\n" +"\n" +"Начните добавлять в него порции! Выполните это перетаскивая элементы в значок " +"плюса ниже. Делайте многое! Например ярлыки запуска программ или папки." +"А также адресные ссылки из вашего обозревателя... \n" +"\n" +"Для выполнения самостоятельной и подробной настройки, щёлкните на знаке плюса." + +#: ../ui/preferences.ui:282 +msgid "" +"You have no Pies!\n" +"\n" +"Start by creating one! This can be done by clicking on the tiny little " +"plus sign in the lower left corner." +msgstr "" +"Отсутствуют паи!\n" +"\n" +"Начните с создания пая! Выполните это щёлкнув на небольшом значке плюса" +"в нижнем левом углу." + +#: ../ui/rename_pie.ui:6 +#, fuzzy +msgid "Rename a Pie" +msgstr "Переименовать пай" + +#~ msgid "Behavior" +#~ msgstr "Поведение" + +#~ msgid "Show Indicator" +#~ msgstr "Показать индикатор" + +#~ msgid "" +#~ "If checked, an indicator for easy access of the settings menu is shown in " +#~ "your panel." +#~ msgstr "" +#~ "Если выбрана эта возможность, индикатор быстрого доступа меню настроек, " +#~ "будет отображаться на вашей панели" + +#~ msgid "Open Pies at Mouse" +#~ msgstr "Открывать паи при действии мышью" + +#~ msgid "" +#~ "If checked, pies will open at your pointer. Otherwise they'll pop up in " +#~ "the middle of the screen." +#~ msgstr "" +#~ "Если выбрана эта возможность, паи будут открываться рядом с курсором. В " +#~ "противном случае, они буду всплывать в середине экрана." + +#~ msgid "General" +#~ msgstr "Основные" + +#~ msgid "Pies" +#~ msgstr "Паи" + +#~ msgid "You can right-click in the list for adding or removing entries." +#~ msgstr "" +#~ "Вы можете щёлкнуть правой кнопкой в списке для добавления или удаления " +#~ "элементов." + +#~ msgid "" +#~ "You can reset Gnome-Pie to its default options with the terminal command " +#~ "\"gnome-pie --reset\"." +#~ msgstr "" +#~ "Вы можете восстановить первоначальные значения Gnome-Pie с помощью " +#~ "команды вводимой в терминале \"gnome-pie --reset\"." + +#~ msgid "" +#~ "The radiobutton at the beginning of each slice-line indicates the " +#~ "QuickAction of the pie." +#~ msgstr "" +#~ "Переключатели в начале каждой строки, отражают быстрое действие порции пая" + +#~ msgid "" +#~ "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." +#~ msgstr "" +#~ "Паи могут открываться с помощью команды вводимой в терминале\"gnome-pie --" +#~ "open=ID\"." + +#~ msgid "Feel free to visit Gnome-Pie's homepage at %s!" +#~ msgstr "Посетите веб-сайт Gnome-Pie по адресу %s!" + +#~ msgid "" +#~ "You can drag'n'drop applications from your main menu to the list above." +#~ msgstr "" +#~ "Вы можете переместить приложения из вашего основного меню в список выше" + +#~ msgid "If you want to give some feedback, please write an e-mail to %s!" +#~ msgstr "Если вы хотите оставить отзыв, пожалуйста, напишити по адресу %s!" + +#~ msgid "" +#~ "You may drag'n'drop URLs and bookmarks from your internet browser to the " +#~ "list above." +#~ msgstr "" +#~ "Вы можете переносите адресные ссылки и закладки из вашего интернет-" +#~ "обозревателя в список выше." + +#~ msgid "Bugs can be reported at " +#~ msgstr "Сообщения о неполадках могут быть отправлены по адресу %s!" + +#~ msgid "" +#~ "It's possible to drag'n'drop files and folders from your file browser to " +#~ "the list above." +#~ msgstr "" +#~ "Возможно переносите файлы и папки из вашего обозревателя файлов в список " +#~ "выше." + +#~ msgid "" +#~ "It's recommended to keep your Pies small (at most 6-8 Slices). Else they " +#~ "will become hard to navigate." +#~ msgstr "" +#~ "Рекомендуется сохранять ваши паи небольшими (по 6-8 порций). Иначе они " +#~ "станут неудобными для навигации." + +#~ msgid "" +#~ "In order to create a launcher for a Pie, drag the Pie from the list to " +#~ "your desktop!" +#~ msgstr "" +#~ "Для создания ярлыка запуска пая, перенесите пай из списка на ваш рабочий " +#~ "стол!" + +#~ msgid "Moves the selected Slice down" +#~ msgstr "Перемещает выделенную порцию вниз" + +#~ msgid "Moves the selected Slice up" +#~ msgstr "Перемещает выделенную порцию вверх" + +#~ msgid "Slice group" +#~ msgstr "Группа порции" + +#~ msgid "Icon" +#~ msgstr "Значок" + +#~ msgid "Command" +#~ msgstr "Команда" + +#~ msgid "Pie-ID / Action type" +#~ msgstr "ID-пая / Тип действия" + +#~ msgid "Name" +#~ msgstr "Название" + +#~ msgid "Add new Pie" +#~ msgstr "Добавить новый пай" + +#~ msgid "Delete" +#~ msgstr "Удалить" + +#~ msgid "New Action" +#~ msgstr "Новое действие" + +#~ msgid "You have to select a Pie to add a Slice to!" +#~ msgstr "Вам необходимо выбрать пай для добавления порции" + +#~ msgid "You have to select a Pie or a Slice to delete!" +#~ msgstr "Вам необходимо выбрать пай или порцию для удаления!" + +#~ msgid "Define an open-command" +#~ msgstr "Определите команду открытия" + +#~ msgid "Click here if you want to bind a mouse button!" +#~ msgstr "Щёлкните здесь, если вы хотите назначить кнопку мыши" + +#~ msgid "" +#~ "It possible to make your system unusable if you bind a Pie to your left " +#~ "mouse button. Do you really want to do this?" +#~ msgstr "" +#~ "Вы можете снизить функциональность системы, если назначите пай - левой " +#~ "кнопке мыши. Вы действительно хотите сделать это?" + +#~ msgid "Choose an Icon" +#~ msgstr "Выберите значок" + +#~ msgid "by" +#~ msgstr "-" diff --git a/resources/themes/adwaita/preview.png b/resources/themes/adwaita/preview.png new file mode 100644 index 0000000..d8dd27a Binary files /dev/null and b/resources/themes/adwaita/preview.png differ diff --git a/resources/themes/bright/preview.png b/resources/themes/bright/preview.png new file mode 100644 index 0000000..babbafa Binary files /dev/null and b/resources/themes/bright/preview.png differ diff --git a/resources/themes/elementary/preview.png b/resources/themes/elementary/preview.png new file mode 100644 index 0000000..4825ba1 Binary files /dev/null and b/resources/themes/elementary/preview.png differ diff --git a/resources/themes/funky/preview.png b/resources/themes/funky/preview.png new file mode 100644 index 0000000..f8b11a8 Binary files /dev/null and b/resources/themes/funky/preview.png differ diff --git a/resources/themes/gloss/preview.png b/resources/themes/gloss/preview.png new file mode 100644 index 0000000..945fe2a Binary files /dev/null and b/resources/themes/gloss/preview.png differ diff --git a/resources/themes/o-pie/preview.png b/resources/themes/o-pie/preview.png new file mode 100644 index 0000000..24476cd Binary files /dev/null and b/resources/themes/o-pie/preview.png differ diff --git a/resources/themes/slim/preview.png b/resources/themes/slim/preview.png new file mode 100644 index 0000000..c26a04a Binary files /dev/null and b/resources/themes/slim/preview.png differ diff --git a/resources/themes/unity/preview.png b/resources/themes/unity/preview.png new file mode 100644 index 0000000..058f558 Binary files /dev/null and b/resources/themes/unity/preview.png differ diff --git a/resources/ui/icon_select.ui b/resources/ui/icon_select.ui new file mode 100644 index 0000000..d740091 --- /dev/null +++ b/resources/ui/icon_select.ui @@ -0,0 +1,187 @@ + + + + + 525 + 425 + False + Select an icon + False + True + True + dialog + + + 300 + 200 + True + False + 12 + + + True + False + 6 + + + True + True + + + True + False + 6 + 6 + + + True + False + + + + + + False + True + 0 + + + + + True + True + gtk-find + gtk-clear + False + + + False + True + 1 + + + + + True + True + never + in + + + + + + True + True + 2 + + + + + + + True + False + Icon Theme + + + False + + + + + True + False + 6 + + + 1 + + + + + True + False + Custom Icon + + + 1 + False + + + + + True + True + 0 + + + + + True + False + 6 + end + + + 16 + 16 + True + False + + + False + False + 0 + True + + + + + gtk-cancel + True + True + True + False + True + + + False + False + 1 + + + + + gtk-ok + True + True + True + False + True + + + False + False + 2 + + + + + False + True + end + 4 + + + + + True + True + 0 + + + + + + diff --git a/resources/ui/preferences.ui b/resources/ui/preferences.ui new file mode 100644 index 0000000..e814acf --- /dev/null +++ b/resources/ui/preferences.ui @@ -0,0 +1,348 @@ + + + + + 600 + 475 + False + Gnome-Pie Settings + False + center + False + + + True + False + + + True + False + both-horiz + + + True + False + False + True + General Settings + True + gtk-preferences + + + False + True + + + + + False + True + 0 + + + + + False + 10 + 10 + + + True + False + 6 + + + True + False + + + 170 + True + True + never + in + + + + + + True + True + 0 + + + + + True + False + icons + 1 + + + True + False + False + True + list-add-symbolic + + + False + True + + + + + True + False + False + True + list-remove-symbolic + + + False + True + + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + 6 + + + True + False + 6 + + + True + True + True + False + none + False + + + True + False + 48 + preferences-desktop-wallpaper + + + + + False + True + 0 + + + + + True + False + + + True + True + True + False + none + True + False + + + True + False + 0 + 2 + end + + + + + + + + + True + True + 0 + + + + + True + True + True + False + none + True + False + + + True + False + 0 + 2 + end + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + False + False + 0 + 0.11999999731779099 + + + False + False + 2 + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + 2 + + + False + 6 + 6 + <b><big>This Pie is empty!</big> + +Start adding Slices to it!</b> This can be done by dragging stuff to the plus sign below. You can try a lot! For example application launchers or folders. Even URLs from your browser are possible... + +For manual and advanced configuration click on the plus sign. + True + fill + True + 0 + + + False + True + 0 + + + + + False + 6 + 6 + <b><big>You have no Pies!</big> + +Start by creating one! </b> This can be done by clicking on the tiny little plus sign in the lower left corner. + True + fill + True + 0 + + + False + True + 1 + + + + + True + False + + + + + + True + True + 2 + + + + + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + + diff --git a/resources/ui/rename_pie.ui b/resources/ui/rename_pie.ui new file mode 100644 index 0000000..b8bcc9e --- /dev/null +++ b/resources/ui/rename_pie.ui @@ -0,0 +1,95 @@ + + + + + 350 + False + 5 + Rename a Pie + False + True + center-on-parent + True + dialog + False + + + False + vertical + + + False + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + False + True + + + False + False + 1 + + + + + False + True + end + 0 + + + + + True + False + 6 + 6 + + + True + True + + False + False + + + True + True + 0 + + + + + True + True + 1 + + + + + + cancel-button + ok-button + + + diff --git a/resources/ui/settings.ui b/resources/ui/settings.ui new file mode 100644 index 0000000..8c3f13a --- /dev/null +++ b/resources/ui/settings.ui @@ -0,0 +1,199 @@ + + + + + 550 + 450 + False + 5 + General Settings + False + True + center-on-parent + True + dialog + False + + + False + vertical + + + False + end + + + gtk-close + True + True + True + False + True + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + 6 + 6 + + + True + False + 0 + in + + + True + False + 6 + 6 + 6 + 6 + + + True + False + 6 + + + Start Gnome-Pie on login + True + True + False + True + If checked, Gnome-Pie will start silently everytime you log in. + If checked, Gnome-Pie will start silently everytime you log in. + False + 0 + True + + + False + True + 0 + + + + + Display panel icon + True + True + False + True + If not checked, you can access this menu by launching Gnome-Pie a second time. + If not checked, you can access this menu by launching Gnome-Pie a second time. + False + 0 + True + + + False + True + 1 + + + + + True + False + 6 + + + True + False + Global scale + + + False + False + 0 + + + + + True + True + 2 + 2 + 2 + right + + + True + True + 1 + + + + + False + True + 3 + + + + + + + + + True + False + Appearance and behavior + + + + + + + + False + True + 0 + + + + + True + True + never + in + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + + close-button + + + diff --git a/resources/ui/slice_select.ui b/resources/ui/slice_select.ui new file mode 100644 index 0000000..639447c --- /dev/null +++ b/resources/ui/slice_select.ui @@ -0,0 +1,415 @@ + + + + + 550 + 450 + False + 5 + Slice Options + False + True + center-on-parent + True + dialog + False + + + False + vertical + + + False + end + + + gtk-close + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + False + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + 6 + 6 + + + True + True + never + in + + + + + + True + True + 0 + + + + + True + False + 0 + in + + + True + False + 6 + 6 + 6 + 6 + + + True + False + 6 + + + True + True + True + False + none + + + True + False + 72 + application-default-icon + + + + + False + True + 0 + + + + + True + False + True + + + True + False + + + True + False + 0 + There are no options for this Slice type. + + + True + True + 0 + + + + + False + True + 0 + + + + + True + False + 6 + True + + + True + False + 0 + Name of the Slice + + + True + True + 0 + + + + + True + True + + True + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 6 + True + + + True + False + 0 + URI to open + + + True + True + 0 + + + + + True + True + + True + + + False + True + 1 + + + + + False + False + 2 + + + + + True + False + 6 + True + + + True + False + 0 + Command to execute + + + True + True + 0 + + + + + True + True + + True + + + False + True + 1 + + + + + False + False + 3 + + + + + True + False + 6 + True + + + True + False + 0 + Hotkey to press + + + True + True + 0 + + + + + + + + False + True + 4 + + + + + True + False + 6 + True + + + True + False + 0 + Pie to open + + + True + True + 0 + + + + + + + + False + True + 5 + + + + + True + False + 6 + True + + + True + False + 0 + Is Quick Action + + + True + True + 0 + + + + + True + True + False + True + This Slice will be executed when you click in the middle of the Pie. + This Slice will be executed when you click in the middle of the Pie. + False + 0 + True + + + True + True + 1 + + + + + False + True + 6 + + + + + True + True + 1 + + + + + + + + + True + False + Slice options + + + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + + cancel-button + ok-button + + + diff --git a/resources/ui/trigger_select.ui b/resources/ui/trigger_select.ui new file mode 100644 index 0000000..5a0deec --- /dev/null +++ b/resources/ui/trigger_select.ui @@ -0,0 +1,208 @@ + + + + + 350 + False + 5 + Activation Settings + False + True + center-on-parent + True + dialog + False + + + False + vertical + + + False + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + False + True + + + False + False + 1 + + + + + False + True + end + 0 + + + + + True + False + 6 + 6 + + + True + False + + + + + + True + True + 0 + + + + + True + False + 1 + It's possible to bind mouse buttons as well! + + + + + + + False + False + 1 + + + + + True + False + 0 + in + + + True + False + 6 + 6 + 6 + 6 + + + True + False + + + Turbo mode + True + True + False + True + If checked, the Pie will close when you release the chosen hot key. + If checked, the Pie will close when you release the chosen hot key. + False + 0 + True + + + False + True + 0 + + + + + Long press for activation + True + True + False + True + If checked, the Pie will only open if you press this hot key a bit longer. + If checked, the Pie will only open if you press this hot key a bit longer. + False + 0 + True + + + False + True + 1 + + + + + Open Pie centered on the screen + True + True + False + True + If checked, the Pie will open in the middle of your screen. Else it will pop up at your pointer. + If checked, the Pie will open in the middle of your screen. Else it will pop up at your pointer. + False + 0 + True + + + False + True + 2 + + + + + + + + + True + False + Activation options + + + + + + + + False + True + 2 + + + + + True + True + 1 + + + + + + cancel-button + ok-button + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23b9474..b809c48 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,10 @@ if (${INDICATOR_FOUND}) SET(DEFINES --define HAVE_APPINDICATOR) endif(${INDICATOR_FOUND}) +if (${GTK3_FOUND}) + SET(DEFINES --define HAVE_GTK_3) +endif(${GTK3_FOUND}) + if (${GMENU3_FOUND}) LIST(APPEND DEFINES --define HAVE_GMENU_3) endif (${GMENU3_FOUND}) @@ -39,7 +43,7 @@ install( # install credits install( FILES - ${CMAKE_SOURCE_DIR}/README + ${CMAKE_SOURCE_DIR}/README.md DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/gnome-pie ) @@ -63,11 +67,18 @@ install( ${CMAKE_INSTALL_PREFIX}/share/gnome-pie ) +# install UI files +install( + DIRECTORY + ${CMAKE_SOURCE_DIR}/resources/ui + DESTINATION + ${CMAKE_INSTALL_PREFIX}/share/gnome-pie +) + # install icons install( FILES ${CMAKE_SOURCE_DIR}/resources/gnome-pie.svg - ${CMAKE_SOURCE_DIR}/resources/gnome-pie-indicator.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps ) diff --git a/src/actionGroups/actionGroup.vala b/src/actionGroups/actionGroup.vala index a6b52ff..c54be2f 100644 --- a/src/actionGroups/actionGroup.vala +++ b/src/actionGroups/actionGroup.vala @@ -70,6 +70,27 @@ public class ActionGroup : GLib.Object { public void delete_all() { actions.clear(); } + + ///////////////////////////////////////////////////////////////////// + /// Makes all contained Slices no Quick Actions. + ///////////////////////////////////////////////////////////////////// + + public void disable_quickactions() { + foreach (var action in actions) + action.is_quickaction = false; + } + + ///////////////////////////////////////////////////////////////////// + /// Returns true, if one o the contained Slices is a Quick Action + ///////////////////////////////////////////////////////////////////// + + public bool has_quickaction() { + foreach (var action in actions) + if (action.is_quickaction) + return true; + + return false; + } } } diff --git a/src/actionGroups/bookmarkGroup.vala b/src/actionGroups/bookmarkGroup.vala index 389b14a..0a560c5 100644 --- a/src/actionGroups/bookmarkGroup.vala +++ b/src/actionGroups/bookmarkGroup.vala @@ -31,10 +31,13 @@ public class BookmarkGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Bookmarks"); - icon = "user-bookmarks"; - settings_name = "bookmarks"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Bookmarks"); + description.icon = "user-bookmarks"; + description.description = _("Shows a Slice for each of your directory Bookmarks."); + description.id = "bookmarks"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actionGroups/clipboardGroup.vala b/src/actionGroups/clipboardGroup.vala index cd1da36..836c927 100644 --- a/src/actionGroups/clipboardGroup.vala +++ b/src/actionGroups/clipboardGroup.vala @@ -59,10 +59,13 @@ public class ClipboardGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Clipboard"); - icon = "edit-paste"; - settings_name = "clipboard"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Clipboard"); + description.icon = "edit-paste"; + description.description = _("Manages your Clipboard."); + description.id = "clipboard"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actionGroups/devicesGroup.vala b/src/actionGroups/devicesGroup.vala index 3d2ced0..dee6a6e 100644 --- a/src/actionGroups/devicesGroup.vala +++ b/src/actionGroups/devicesGroup.vala @@ -30,10 +30,13 @@ public class DevicesGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Devices"); - icon = "harddrive"; - settings_name = "devices"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Devices"); + description.icon = "harddrive"; + description.description = _("Shows a Slice for each plugged in devices, like USB-Sticks."); + description.id = "devices"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actionGroups/groupRegistry.vala b/src/actionGroups/groupRegistry.vala index a9f8d06..7510a03 100644 --- a/src/actionGroups/groupRegistry.vala +++ b/src/actionGroups/groupRegistry.vala @@ -27,67 +27,67 @@ public class GroupRegistry : GLib.Object { /// A list containing all available ActionGroup types. ///////////////////////////////////////////////////////////////////// - public static Gee.ArrayList types { get; private set; } + public static Gee.ArrayList types { get; private set; } ///////////////////////////////////////////////////////////////////// - /// Three maps associating a displayable name for each ActionGroup, + /// A map associating a displayable name for each ActionGroup, /// an icon name and a name for the pies.conf file with it's type. ///////////////////////////////////////////////////////////////////// - public static Gee.HashMap names { get; private set; } - public static Gee.HashMap icons { get; private set; } - public static Gee.HashMap settings_names { get; private set; } + public static Gee.HashMap descriptions { get; private set; } + + public class TypeDescription { + public string name { get; set; default=""; } + public string icon { get; set; default=""; } + public string description { get; set; default=""; } + public string id { get; set; default=""; } + } ///////////////////////////////////////////////////////////////////// /// Registers all ActionGroup types. ///////////////////////////////////////////////////////////////////// public static void init() { - types = new Gee.ArrayList(); + types = new Gee.ArrayList(); + descriptions = new Gee.HashMap(); - names = new Gee.HashMap(); - icons = new Gee.HashMap(); - settings_names = new Gee.HashMap(); - - string name = ""; - string icon = ""; - string settings_name = ""; + TypeDescription type_description; - BookmarkGroup.register(out name, out icon, out settings_name); - types.add(typeof(BookmarkGroup)); - names.set(typeof(BookmarkGroup), name); - icons.set(typeof(BookmarkGroup), icon); - settings_names.set(typeof(BookmarkGroup), settings_name); + type_description = BookmarkGroup.register(); + types.add(typeof(BookmarkGroup).name()); + descriptions.set(typeof(BookmarkGroup).name(), type_description); - DevicesGroup.register(out name, out icon, out settings_name); - types.add(typeof(DevicesGroup)); - names.set(typeof(DevicesGroup), name); - icons.set(typeof(DevicesGroup), icon); - settings_names.set(typeof(DevicesGroup), settings_name); + type_description = DevicesGroup.register(); + types.add(typeof(DevicesGroup).name()); + descriptions.set(typeof(DevicesGroup).name(), type_description); - MenuGroup.register(out name, out icon, out settings_name); - types.add(typeof(MenuGroup)); - names.set(typeof(MenuGroup), name); - icons.set(typeof(MenuGroup), icon); - settings_names.set(typeof(MenuGroup), settings_name); + type_description = MenuGroup.register(); + types.add(typeof(MenuGroup).name()); + descriptions.set(typeof(MenuGroup).name(), type_description); - SessionGroup.register(out name, out icon, out settings_name); - types.add(typeof(SessionGroup)); - names.set(typeof(SessionGroup), name); - icons.set(typeof(SessionGroup), icon); - settings_names.set(typeof(SessionGroup), settings_name); + type_description = SessionGroup.register(); + types.add(typeof(SessionGroup).name()); + descriptions.set(typeof(SessionGroup).name(), type_description); - WindowListGroup.register(out name, out icon, out settings_name); - types.add(typeof(WindowListGroup)); - names.set(typeof(WindowListGroup), name); - icons.set(typeof(WindowListGroup), icon); - settings_names.set(typeof(WindowListGroup), settings_name); + type_description = WindowListGroup.register(); + types.add(typeof(WindowListGroup).name()); + descriptions.set(typeof(WindowListGroup).name(), type_description); + } + + ///////////////////////////////////////////////////////////////////// + /// Creates a Group for a given type name. + ///////////////////////////////////////////////////////////////////// + + public static ActionGroup? create_group(string type_id, string parent_id) { + switch (type_id) { + case "bookmarks": return new BookmarkGroup(parent_id); + case "devices": return new DevicesGroup(parent_id); + case "menu": return new MenuGroup(parent_id); + case "session": return new SessionGroup(parent_id); + case "window_list": return new WindowListGroup(parent_id); + } -// ClipboardGroup.register(out name, out icon, out settings_name); -// types.add(typeof(ClipboardGroup)); -// names.set(typeof(ClipboardGroup), name); -// icons.set(typeof(ClipboardGroup), icon); -// settings_names.set(typeof(ClipboardGroup), settings_name); + return null; } } diff --git a/src/actionGroups/menuGroup.vala b/src/actionGroups/menuGroup.vala index 07a4bd1..247376d 100644 --- a/src/actionGroups/menuGroup.vala +++ b/src/actionGroups/menuGroup.vala @@ -30,10 +30,13 @@ public class MenuGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Main menu"); - icon = "gnome-main-menu"; - settings_name = "menu"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Main menu"); + description.icon = "gnome-main-menu"; + description.description = _("Displays your main menu structure."); + description.id = "menu"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actionGroups/sessionGroup.vala b/src/actionGroups/sessionGroup.vala index 0b3f249..26f8ebc 100644 --- a/src/actionGroups/sessionGroup.vala +++ b/src/actionGroups/sessionGroup.vala @@ -30,10 +30,13 @@ public class SessionGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Session Control"); - icon = "gnome-logout"; - settings_name = "session"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Session Control"); + description.icon = "gnome-logout"; + description.description = _("Shows a Slice for Shutdown, Reboot, and Hibernate."); + description.id = "session"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actionGroups/windowListGroup.vala b/src/actionGroups/windowListGroup.vala index b12f188..18bf55b 100644 --- a/src/actionGroups/windowListGroup.vala +++ b/src/actionGroups/windowListGroup.vala @@ -29,10 +29,13 @@ public class WindowListGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out string icon, out string settings_name) { - name = _("Window List"); - icon = "window-manager"; - settings_name = "window_list"; + public static GroupRegistry.TypeDescription register() { + var description = new GroupRegistry.TypeDescription(); + description.name = _("Group: Window List"); + description.icon = "window-manager"; + description.description = _("Shows a Slice for each of your opened Windows. Almost like Alt-Tab."); + description.id = "window_list"; + return description; } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/action.vala b/src/actions/action.vala index ceed357..ff0e9cd 100644 --- a/src/actions/action.vala +++ b/src/actions/action.vala @@ -42,14 +42,14 @@ public abstract class Action : GLib.Object { /// The name of the Action. ///////////////////////////////////////////////////////////////////// - public virtual string name { get; protected set; } + public virtual string name { get; set; } ///////////////////////////////////////////////////////////////////// /// The name of the icon of this Action. It should be in the users /// current icon theme. ///////////////////////////////////////////////////////////////////// - public virtual string icon { get; protected set; } + public virtual string icon { get; set; } ///////////////////////////////////////////////////////////////////// /// True, if this Action is the quickAction of the associated Pie. @@ -57,14 +57,14 @@ public abstract class Action : GLib.Object { /// the center of a Pie. ///////////////////////////////////////////////////////////////////// - public virtual bool is_quick_action { get; protected set; } + public virtual bool is_quickaction { get; set; } ///////////////////////////////////////////////////////////////////// /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public Action(string name, string icon, bool is_quick_action) { - GLib.Object(name : name, icon : icon, is_quick_action : is_quick_action); + public Action(string name, string icon, bool is_quickaction) { + GLib.Object(name : name, icon : icon, is_quickaction : is_quickaction); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/actionRegistry.vala b/src/actions/actionRegistry.vala index 091865f..135e90c 100644 --- a/src/actions/actionRegistry.vala +++ b/src/actions/actionRegistry.vala @@ -27,56 +27,68 @@ public class ActionRegistry : GLib.Object { /// A list containing all available Action types. ///////////////////////////////////////////////////////////////////// - public static Gee.ArrayList types { get; private set; } + public static Gee.ArrayList types { get; private set; } ///////////////////////////////////////////////////////////////////// - /// Three maps associating a displayable name for each Action, + /// A map associating a displayable name for each Action, /// whether it has a custom icon and a name for the pies.conf /// file with it's type. ///////////////////////////////////////////////////////////////////// - public static Gee.HashMap names { get; private set; } - public static Gee.HashMap icon_name_editables { get; private set; } - public static Gee.HashMap settings_names { get; private set; } + public static Gee.HashMap descriptions { get; private set; } + + ///////////////////////////////////////////////////////////////////// + /// A helper class storing information on a Action type. + ///////////////////////////////////////////////////////////////////// + + public class TypeDescription { + public string name { get; set; default=""; } + public string icon { get; set; default=""; } + public string description { get; set; default=""; } + public string id { get; set; default=""; } + public bool icon_name_editable { get; set; default=false; } + } ///////////////////////////////////////////////////////////////////// /// Registers all Action types. ///////////////////////////////////////////////////////////////////// public static void init() { - types = new Gee.ArrayList(); - - names = new Gee.HashMap(); - icon_name_editables = new Gee.HashMap(); - settings_names = new Gee.HashMap(); + types = new Gee.ArrayList(); + descriptions = new Gee.HashMap(); - string name = ""; - bool icon_name_editable = true; - string settings_name = ""; + TypeDescription type_description; - AppAction.register(out name, out icon_name_editable, out settings_name); - types.add(typeof(AppAction)); - names.set(typeof(AppAction), name); - icon_name_editables.set(typeof(AppAction), icon_name_editable); - settings_names.set(typeof(AppAction), settings_name); + types.add(typeof(AppAction).name()); + type_description = AppAction.register(); + descriptions.set(typeof(AppAction).name(), type_description); - KeyAction.register(out name, out icon_name_editable, out settings_name); - types.add(typeof(KeyAction)); - names.set(typeof(KeyAction), name); - icon_name_editables.set(typeof(KeyAction), icon_name_editable); - settings_names.set(typeof(KeyAction), settings_name); + types.add(typeof(KeyAction).name()); + type_description = KeyAction.register(); + descriptions.set(typeof(KeyAction).name(), type_description); - PieAction.register(out name, out icon_name_editable, out settings_name); - types.add(typeof(PieAction)); - names.set(typeof(PieAction), name); - icon_name_editables.set(typeof(PieAction), icon_name_editable); - settings_names.set(typeof(PieAction), settings_name); + types.add(typeof(PieAction).name()); + type_description = PieAction.register(); + descriptions.set(typeof(PieAction).name(), type_description); + + types.add(typeof(UriAction).name()); + type_description = UriAction.register(); + descriptions.set(typeof(UriAction).name(), type_description); + } + + ///////////////////////////////////////////////////////////////////// + /// Creates a new Action from the given type name. + ///////////////////////////////////////////////////////////////////// + + public static Action? create_action(string type_id, string name, string icon, string command, bool quickaction) { + switch (type_id) { + case "app": return new AppAction(name, icon, command, quickaction); + case "key": return new KeyAction(name, icon, command, quickaction); + case "uri": return new UriAction(name, icon, command, quickaction); + case "pie": return new PieAction(command, quickaction); + } - UriAction.register(out name, out icon_name_editable, out settings_name); - types.add(typeof(UriAction)); - names.set(typeof(UriAction), name); - icon_name_editables.set(typeof(UriAction), icon_name_editable); - settings_names.set(typeof(UriAction), settings_name); + return null; } ///////////////////////////////////////////////////////////////////// @@ -109,10 +121,12 @@ public class ActionRegistry : GLib.Object { case "http": case "https": final_icon = "www"; + final_name = get_domain_name(uri); break; case "ftp": case "sftp": final_icon = "folder-remote"; + final_name = get_domain_name(uri); break; default: @@ -174,6 +188,12 @@ public class ActionRegistry : GLib.Object { ///////////////////////////////////////////////////////////////////// public static Action? new_for_desktop_file(string file_name) { + // check whether its a desktop file to open one of Gnome-Pie's pies + if (file_name.has_prefix(Paths.launchers)) { + string id = file_name.substring((long)file_name.length - 11, 3); + return new PieAction(id); + } + var info = new DesktopAppInfo.from_filename(file_name); return new_for_app_info(info); } @@ -192,9 +212,23 @@ public class ActionRegistry : GLib.Object { ///////////////////////////////////////////////////////////////////// public static Action? default_for_uri(string uri) { - var info = AppInfo. get_default_for_uri_scheme(uri); + var info = AppInfo.get_default_for_uri_scheme(uri); return new_for_app_info(info); } + + ///////////////////////////////////////////////////////////////////// + /// Returns for example www.google.com when http://www.google.de/?q=h + /// is given. + ///////////////////////////////////////////////////////////////////// + + private static string get_domain_name(string url) { + int domain_end = url.index_of_char('/', 7); + int domain_begin = url.index_of_char('/', 0) + 2; + + if (domain_begin < domain_end) return url.substring(domain_begin, domain_end-domain_begin); + + return url; + } } } diff --git a/src/actions/appAction.vala b/src/actions/appAction.vala index d8363e4..2371f7c 100644 --- a/src/actions/appAction.vala +++ b/src/actions/appAction.vala @@ -29,10 +29,14 @@ public class AppAction : Action { /// used in the pies.conf file for this kind of Actions. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out bool icon_name_editable, out string settings_name) { - name = _("Launch application"); - icon_name_editable = true; - settings_name = "app"; + public static ActionRegistry.TypeDescription register() { + var description = new ActionRegistry.TypeDescription(); + description.name = _("Launch application"); + description.icon = "application-x-executable"; + description.description = _("Executes the given command."); + description.icon_name_editable = true; + description.id = "app"; + return description; } ///////////////////////////////////////////////////////////////////// @@ -51,8 +55,8 @@ public class AppAction : Action { /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public AppAction(string name, string icon, string command, bool is_quick_action = false) { - GLib.Object(name : name, icon : icon, real_command : command, is_quick_action : is_quick_action); + public AppAction(string name, string icon, string command, bool is_quickaction = false) { + GLib.Object(name : name, icon : icon, real_command : command, is_quickaction : is_quickaction); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/keyAction.vala b/src/actions/keyAction.vala index ddeebb5..3816686 100644 --- a/src/actions/keyAction.vala +++ b/src/actions/keyAction.vala @@ -29,10 +29,14 @@ public class KeyAction : Action { /// used in the pies.conf file for this kind of Actions. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out bool icon_name_editable, out string settings_name) { - name = _("Press hotkey"); - icon_name_editable = true; - settings_name = "key"; + public static ActionRegistry.TypeDescription register() { + var description = new ActionRegistry.TypeDescription(); + description.name = _("Press hotkey"); + description.icon = "preferences-desktop-keyboard-shortcuts"; + description.description = _("Simulates the activation of a hotkey."); + description.icon_name_editable = true; + description.id = "key"; + return description; } ///////////////////////////////////////////////////////////////////// @@ -57,12 +61,12 @@ public class KeyAction : Action { /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public KeyAction(string name, string icon, string command, bool is_quick_action = false) { - GLib.Object(name : name, icon : icon, real_command : command, is_quick_action : is_quick_action); + public KeyAction(string name, string icon, string command, bool is_quickaction = false) { + GLib.Object(name : name, icon : icon, real_command : command, is_quickaction : is_quickaction); } construct { - this.key = new Key(real_command); + this.key = new Key.from_string(real_command); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/pieAction.vala b/src/actions/pieAction.vala index 53ea919..5b2c81d 100644 --- a/src/actions/pieAction.vala +++ b/src/actions/pieAction.vala @@ -29,10 +29,14 @@ public class PieAction : Action { /// used in the pies.conf file for this kind of Actions. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out bool icon_name_editable, out string settings_name) { - name = _("Open Pie"); - icon_name_editable = false; - settings_name = "pie"; + public static ActionRegistry.TypeDescription register() { + var description = new ActionRegistry.TypeDescription(); + description.name = _("Open Pie"); + description.icon = "gnome-pie"; + description.description = _("Opens another Pie of Gnome-Pie. You may create sub menus this way."); + description.icon_name_editable = false; + description.id = "pie"; + return description; } ///////////////////////////////////////////////////////////////////// @@ -79,8 +83,8 @@ public class PieAction : Action { /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public PieAction(string id, bool is_quick_action = false) { - GLib.Object(name : "", icon : "", real_command : id, is_quick_action : is_quick_action); + public PieAction(string id, bool is_quickaction = false) { + GLib.Object(name : "", icon : "", real_command : id, is_quickaction : is_quickaction); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/sigAction.vala b/src/actions/sigAction.vala index cec9836..1edbc08 100644 --- a/src/actions/sigAction.vala +++ b/src/actions/sigAction.vala @@ -47,8 +47,8 @@ public class SigAction : Action { /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public SigAction(string name, string icon, string command, bool is_quick_action = false) { - GLib.Object(name : name, icon : icon, real_command : command, is_quick_action : is_quick_action); + public SigAction(string name, string icon, string command, bool is_quickaction = false) { + GLib.Object(name : name, icon : icon, real_command : command, is_quickaction : is_quickaction); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/uriAction.vala b/src/actions/uriAction.vala index 25d5c75..f407f6c 100644 --- a/src/actions/uriAction.vala +++ b/src/actions/uriAction.vala @@ -29,10 +29,14 @@ public class UriAction : Action { /// used in the pies.conf file for this kind of Actions. ///////////////////////////////////////////////////////////////////// - public static void register(out string name, out bool icon_name_editable, out string settings_name) { - name = _("Open URI"); - icon_name_editable = true; - settings_name = "uri"; + public static ActionRegistry.TypeDescription register() { + var description = new ActionRegistry.TypeDescription(); + description.name = _("Open URI"); + description.icon = "web-browser"; + description.description = _("Opens a given location. You may use URL's or files paths."); + description.icon_name_editable = true; + description.id = "uri"; + return description; } ///////////////////////////////////////////////////////////////////// @@ -51,8 +55,10 @@ public class UriAction : Action { /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public UriAction(string name, string icon, string command, bool is_quick_action = false) { - GLib.Object(name : name, icon : icon, real_command : command, is_quick_action : is_quick_action); + public UriAction(string name, string icon, string command, bool is_quickaction = false) { + GLib.Object(name : name, icon : icon, + real_command : command.has_prefix("www") ? "http://" + command : command, + is_quickaction : is_quickaction); } ///////////////////////////////////////////////////////////////////// diff --git a/src/deamon.vala b/src/deamon.vala index 0cdb4c2..cec9539 100644 --- a/src/deamon.vala +++ b/src/deamon.vala @@ -15,11 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -///////////////////////////////////////////////////////////////////// -/// TODO-List (need comments): -/// PieList -///////////////////////////////////////////////////////////////////// - namespace GnomePie { ///////////////////////////////////////////////////////////////////////// @@ -36,6 +31,7 @@ public class Deamon : GLib.Object { public static int main(string[] args) { Logger.init(); + Gdk.threads_init(); Gtk.init(ref args); Paths.init(); @@ -100,7 +96,11 @@ public class Deamon : GLib.Object { // create unique application var app = new Unique.App("org.gnome.gnomepie", null); - if (app.is_running) { + #if HAVE_GTK_3 + if (app.is_running()) { + #else + if (app.is_running) { + #endif // inform the running instance of the pie to be opened if (open_pie != null) { message("Gnome-Pie is already running. Sending request to open pie " + open_pie + "."); @@ -120,27 +120,27 @@ public class Deamon : GLib.Object { if (cmd == Unique.Command.ACTIVATE) { var pie = data.get_text(); - if (pie != "") PieManager.open_pie(pie); - else this.indicator.show_preferences(); + if (pie != null && pie != "") PieManager.open_pie(pie); + else this.indicator.show_preferences(); return Unique.Response.OK; } return Unique.Response.PASSTHROUGH; }); - + + // init locale support + Intl.bindtextdomain ("gnomepie", Paths.locales); + Intl.textdomain ("gnomepie"); + // init toolkits and static stuff - Gdk.threads_init(); ActionRegistry.init(); GroupRegistry.init(); + PieManager.init(); Icon.init(); ThemedIcon.init(); RenderedText.init(); - - // init locale support - Intl.bindtextdomain ("gnomepie", Paths.locales); - Intl.textdomain ("gnomepie"); // launch the indicator this.indicator = new Indicator(); diff --git a/src/gui/about.vala b/src/gui/about.vala deleted file mode 100644 index ce4256e..0000000 --- a/src/gui/about.vala +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -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, either version 3 of the License, or (at your option) -any later version. - -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 . -*/ - -namespace GnomePie { - -///////////////////////////////////////////////////////////////////////// -/// A simple about Dialog. -///////////////////////////////////////////////////////////////////////// - -public class GnomePieAboutDialog: Gtk.AboutDialog { - - public GnomePieAboutDialog () { - string[] devs = { - "Simon Schneegans ", - "Francesco Piccinno " - }; - string[] artists = { - "Simon Schneegans " - }; - string[] translators = { - "DE\t\t Simon Schneegans ", - "IT\t\t Riccardo Traverso ", - "PT-BR\t Magnun Leno ", - "EN\t\t Simon Schneegans ", - "KO\t\t Kim Boram " - }; - - // sort translators - GLib.List translator_list = new GLib.List(); - foreach (var translator in translators) - translator_list.append(translator); - - translator_list.sort((a, b) => { - return a.ascii_casecmp(b); - }); - - string translator_string = ""; - foreach (var translator in translator_list) - translator_string += translator + "\n"; - - GLib.Object ( - artists : artists, - authors : devs, - translator_credits : translator_string, - copyright : "Copyright (C) 2011 Simon Schneegans ", - program_name: "Gnome-Pie", - logo_icon_name: "gnome-pie", - website: "http://www.simonschneegans.de/?page_id=12", - website_label: "www.gnome-pie.simonschneegans.de", - version: "0.3.1" - ); - } -} - -} diff --git a/src/gui/aboutWindow.vala b/src/gui/aboutWindow.vala new file mode 100644 index 0000000..ccd956a --- /dev/null +++ b/src/gui/aboutWindow.vala @@ -0,0 +1,76 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A simple about dialog. +///////////////////////////////////////////////////////////////////////// + +public class AboutWindow: Gtk.AboutDialog { + + ///////////////////////////////////////////////////////////////////// + /// C'tor, creates a new about dialog. The entries are sorted alpha- + /// betically. + ///////////////////////////////////////////////////////////////////// + + public AboutWindow () { + string[] devs = { + "Simon Schneegans ", + "Francesco Piccinno " + }; + string[] artists = { + "Simon Schneegans " + }; + string[] translators = { + "Simon Schneegans (DE, EN)", + "Riccardo Traverso (IT)", + "Magnun Leno (PT-BR)", + "Kim Boram (KO)", + "Eduardo Anabalon (ES)", + "Gregoire Bellon-Gervais (FR)", + "Eugene Roskin (RU)" + }; + + // sort translators + GLib.List translator_list = new GLib.List(); + foreach (var translator in translators) + translator_list.append(translator); + + translator_list.sort((a, b) => { + return a.ascii_casecmp(b); + }); + + string translator_string = ""; + foreach (var translator in translator_list) + translator_string += translator + "\n"; + + GLib.Object ( + artists : artists, + authors : devs, + translator_credits : translator_string, + copyright : "Copyright (C) 2011-2012 Simon Schneegans ", + program_name: "Gnome-Pie", + logo_icon_name: "gnome-pie", + website: "http://www.simonschneegans.de/?page_id=12", + website_label: "www.gnome-pie.simonschneegans.de", + version: "0.4.0" + ); + } +} + +} diff --git a/src/gui/cellRendererIcon.vala b/src/gui/cellRendererIcon.vala deleted file mode 100644 index 959a0b7..0000000 --- a/src/gui/cellRendererIcon.vala +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -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, either version 3 of the License, or (at your option) -any later version. - -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 . -*/ - -namespace GnomePie { - -///////////////////////////////////////////////////////////////////////// -/// A cellrenderer which displays an Icon. When clicked onto, a window -/// opens for selecting another icon. This needs to be a subclass of -/// Gtk.CellRendererText because Gtk.CellRendererPixbuf can't receive -/// click events. Internally it stores a Gtk.CellRendererPixbuf -/// which renders and stuff. -///////////////////////////////////////////////////////////////////////// - -public class CellRendererIcon : Gtk.CellRendererText { - - ///////////////////////////////////////////////////////////////////// - /// This signal is emitted when the user selects another icon. - ///////////////////////////////////////////////////////////////////// - - public signal void on_select(string path, string icon); - - ///////////////////////////////////////////////////////////////////// - /// The IconSelectWindow which is shown on click. - ///////////////////////////////////////////////////////////////////// - - private IconSelectWindow select_window = null; - - ///////////////////////////////////////////////////////////////////// - /// The internal Renderer used for drawing. - ///////////////////////////////////////////////////////////////////// - - private Gtk.CellRendererPixbuf renderer = null; - - ///////////////////////////////////////////////////////////////////// - /// A helper variable, needed to emit the current path. - ///////////////////////////////////////////////////////////////////// - - private string current_path = ""; - - public string icon_name { get; set; } - - ///////////////////////////////////////////////////////////////////// - /// Forward some parts of the CellRendererPixbuf's interface. - ///////////////////////////////////////////////////////////////////// - - public bool follow_state { - get { return renderer.follow_state; } - set { renderer.follow_state = value; } - } - - public bool icon_sensitive { - get { return renderer.sensitive; } - set { renderer.sensitive = value; } - } - - public Gdk.Pixbuf pixbuf { - owned get { return renderer.pixbuf; } - set { renderer.pixbuf = value; } - } - - ///////////////////////////////////////////////////////////////////// - /// C'tor, creates a new CellRendererIcon. - ///////////////////////////////////////////////////////////////////// - - public CellRendererIcon() { - this.select_window = new IconSelectWindow(); - this.renderer = new Gtk.CellRendererPixbuf(); - - this.select_window.on_select.connect((icon) => { - this.on_select(current_path, icon); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Forward some parts of the CellRendererPixbuf's interface. - ///////////////////////////////////////////////////////////////////// - - public override void get_size (Gtk.Widget widget, Gdk.Rectangle? cell_area, - out int x_offset, out int y_offset, - out int width, out int height) { - - this.renderer.get_size(widget, cell_area, out x_offset, out y_offset, out width, out height); - } - - ///////////////////////////////////////////////////////////////////// - /// Forward some parts of the CellRendererPixbuf's interface. - ///////////////////////////////////////////////////////////////////// - - public override void render (Gdk.Window window, Gtk.Widget widget, - Gdk.Rectangle bg_area, - Gdk.Rectangle cell_area, - Gdk.Rectangle expose_area, - Gtk.CellRendererState flags) { - - this.renderer.render(window, widget, bg_area, cell_area, expose_area, flags); - } - - ///////////////////////////////////////////////////////////////////// - /// Open the IconSelectWindow on click. - ///////////////////////////////////////////////////////////////////// - - public override unowned Gtk.CellEditable start_editing( - Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle bg_area, - Gdk.Rectangle cell_area, Gtk.CellRendererState flags) { - - this.select_window.set_transient_for((Gtk.Window)widget.get_toplevel()); - this.select_window.set_modal(true); - - this.current_path = path; - this.select_window.show(); - this.select_window.active_icon = this.icon_name; - - return this.renderer.start_editing(event, widget, path, bg_area, cell_area, flags); - } -} - -} - diff --git a/src/gui/cellRendererTrigger.vala b/src/gui/cellRendererTrigger.vala deleted file mode 100644 index a825c32..0000000 --- a/src/gui/cellRendererTrigger.vala +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -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, either version 3 of the License, or (at your option) -any later version. - -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 . -*/ - -namespace GnomePie { - -///////////////////////////////////////////////////////////////////////// -/// A CellRenderer which opens a TriggerSelectWindow. -///////////////////////////////////////////////////////////////////////// - -public class CellRendererTrigger : Gtk.CellRendererText { - - ///////////////////////////////////////////////////////////////////// - /// This signal is emitted when the user selects another trigger. - ///////////////////////////////////////////////////////////////////// - - public signal void on_select(string path, Trigger trigger); - - ///////////////////////////////////////////////////////////////////// - /// The trigger which can be set with this window. - ///////////////////////////////////////////////////////////////////// - - public string trigger { get; set; } - - ///////////////////////////////////////////////////////////////////// - /// The IconSelectWindow which is shown on click. - ///////////////////////////////////////////////////////////////////// - - private TriggerSelectWindow select_window = null; - - ///////////////////////////////////////////////////////////////////// - /// A helper variable, needed to emit the current path. - ///////////////////////////////////////////////////////////////////// - - private string current_path = ""; - - ///////////////////////////////////////////////////////////////////// - /// C'tor, creates a new CellRendererIcon. - ///////////////////////////////////////////////////////////////////// - - public CellRendererTrigger() { - this.select_window = new TriggerSelectWindow(); - - this.select_window.on_select.connect((trigger) => { - this.trigger = trigger.name; - this.on_select(current_path, trigger); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Open the TriggerSelectWindow on click. - ///////////////////////////////////////////////////////////////////// - - public override unowned Gtk.CellEditable start_editing( - Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle bg_area, - Gdk.Rectangle cell_area, Gtk.CellRendererState flags) { - - this.current_path = path; - - this.select_window.set_transient_for((Gtk.Window)widget.get_toplevel()); - this.select_window.set_modal(true); - this.select_window.set_trigger(new Trigger.from_string(this.trigger)); - - this.select_window.show(); - - return base.start_editing(event, widget, path, bg_area, cell_area, flags); - } -} - -} - diff --git a/src/gui/iconSelectWindow.vala b/src/gui/iconSelectWindow.vala index 01a4a40..d66c654 100644 --- a/src/gui/iconSelectWindow.vala +++ b/src/gui/iconSelectWindow.vala @@ -23,45 +23,19 @@ namespace GnomePie { /// happens in an extra thread and a spinner is displayed while loading. ///////////////////////////////////////////////////////////////////////// -public class IconSelectWindow : Gtk.Dialog { - +public class IconSelectWindow : GLib.Object { + ///////////////////////////////////////////////////////////////////// - /// The currently selected icon. If set, this icon gets focused. + /// This signal gets emitted when the user selects a new icon. ///////////////////////////////////////////////////////////////////// - private string _active_icon = "application-default-icon"; - - public string active_icon { - get { - return _active_icon; - } - set { - if (value.contains("/")) { - this.file_chooser.set_filename(value); - this.tabs.set_current_page(1); - } else { - this.icon_list_filtered.foreach((model, path, iter) => { - string name = ""; - model.get(iter, 0, out name); - - if (name == value) { - this.icon_view.select_path(path); - this.icon_view.scroll_to_path(path, true, 0.5f, 0.0f); - this.icon_view.set_cursor(path, null, false); - } - return (name == value); - }); - - this.tabs.set_current_page(0); - } - } - } + public signal void on_ok(string icon_name); ///////////////////////////////////////////////////////////////////// - /// This signal gets emitted when the user selects a new icon. + /// Stores the currently selected icon. ///////////////////////////////////////////////////////////////////// - public signal void on_select(string icon_name); + private string active_icon = ""; ///////////////////////////////////////////////////////////////////// /// The ListStore storing all theme-icons. @@ -120,6 +94,12 @@ public class IconSelectWindow : Gtk.Dialog { private Gtk.Notebook tabs = null; + ///////////////////////////////////////////////////////////////////// + /// The main window. + ///////////////////////////////////////////////////////////////////// + + private Gtk.Window window = null; + ///////////////////////////////////////////////////////////////////// /// A little structure containing data for one icon in the icon_view. ///////////////////////////////////////////////////////////////////// @@ -156,217 +136,221 @@ public class IconSelectWindow : Gtk.Dialog { /// C'tor, creates a new IconSelectWindow. ///////////////////////////////////////////////////////////////////// - public IconSelectWindow() { - this.title = _("Choose an Icon"); - this.set_size_request(520, 520); - this.delete_event.connect(hide_on_delete); - this.load_queue = new GLib.AsyncQueue(); + public IconSelectWindow(Gtk.Window parent) { + try { + this.load_queue = new GLib.AsyncQueue(); - if (this.icon_list == null) { - this.icon_list = new Gtk.ListStore(3, typeof(string), // icon name - typeof(IconContext), // icon type - typeof(Gdk.Pixbuf)); // the icon itself - - // disable sorting until all icons are loaded - // else loading becomes horribly slow - this.icon_list.set_default_sort_func(() => {return 0;}); + if (this.icon_list == null) { + this.icon_list = new Gtk.ListStore(3, typeof(string), // icon name + typeof(IconContext), // icon type + typeof(Gdk.Pixbuf)); // the icon itself + + // disable sorting until all icons are loaded + // else loading becomes horribly slow + this.icon_list.set_default_sort_func(() => {return 0;}); - // reload if icon theme changes - Gtk.IconTheme.get_default().changed.connect(() => { - if (this.visible) load_icons(); - else need_reload = true; - }); - } - - // make the icon_view filterable - this.icon_list_filtered = new Gtk.TreeModelFilter(this.icon_list, null); - - var container = new Gtk.VBox(false, 12); - container.set_border_width(12); + // reload if icon theme changes + Gtk.IconTheme.get_default().changed.connect(() => { + if (this.window.visible) load_icons(); + else need_reload = true; + }); + } + + // make the icon_view filterable + this.icon_list_filtered = new Gtk.TreeModelFilter(this.icon_list, null); + + Gtk.Builder builder = new Gtk.Builder(); - // tab container - this.tabs = new Gtk.Notebook(); + builder.add_from_file (Paths.ui_files + "/icon_select.ui"); - // icon theme tab - var theme_tab = new Gtk.VBox(false, 12); - theme_tab.set_border_width(12); + this.window = builder.get_object("window") as Gtk.Window; + this.window.set_transient_for(parent); + this.window.set_modal(true); + + this.tabs = builder.get_object("tabs") as Gtk.Notebook; + + this.spinner = builder.get_object("spinner") as Gtk.Spinner; + this.spinner.start(); - // type chooser combo-box - var context_combo = new Gtk.ComboBox.text(); - context_combo.append_text(_("All icons")); - context_combo.append_text(_("Applications")); - context_combo.append_text(_("Actions")); - context_combo.append_text(_("Places")); - context_combo.append_text(_("File types")); - context_combo.append_text(_("Emotes")); - context_combo.append_text(_("Miscellaneous")); + (builder.get_object("ok-button") as Gtk.Button).clicked.connect(on_ok_button_clicked); + (builder.get_object("cancel-button") as Gtk.Button).clicked.connect(on_cancel_button_clicked); + + var combo_box = builder.get_object("combo-box") as Gtk.VBox; + + // context combo + #if HAVE_GTK_3 + var context_combo = new Gtk.ComboBoxText(); + #else + var context_combo = new Gtk.ComboBox.text(); + #endif + context_combo.append_text(_("All icons")); + context_combo.append_text(_("Applications")); + context_combo.append_text(_("Actions")); + context_combo.append_text(_("Places")); + context_combo.append_text(_("File types")); + context_combo.append_text(_("Emotes")); + context_combo.append_text(_("Miscellaneous")); - context_combo.set_active(0); - - context_combo.changed.connect(() => { - this.icon_list_filtered.refilter(); - }); - - theme_tab.pack_start(context_combo, false, false); + context_combo.set_active(0); + + context_combo.changed.connect(() => { + this.icon_list_filtered.refilter(); + }); + + combo_box.pack_start(context_combo, false, false); + + // string filter entry + var filter = builder.get_object("filter-entry") as Gtk.Entry; + + // only display items which have the selected type + // and whose name contains the text entered in the entry + this.icon_list_filtered.set_visible_func((model, iter) => { + string name = ""; + IconContext context = IconContext.ALL; + model.get(iter, 0, out name); + model.get(iter, 1, out context); - // string filter entry - var filter = new Gtk.Entry(); - filter.primary_icon_stock = Gtk.Stock.FIND; - filter.primary_icon_activatable = false; - filter.secondary_icon_stock = Gtk.Stock.CLEAR; - theme_tab.pack_start(filter, false, false); - - // only display items which have the selected type - // and whose name contains the text entered in the entry - this.icon_list_filtered.set_visible_func((model, iter) => { - string name = ""; - IconContext context = IconContext.ALL; - model.get(iter, 0, out name); - model.get(iter, 1, out context); - - if (name == null) return false; - - return (context_combo.get_active() == context || - context_combo.get_active() == IconContext.ALL) && - name.down().contains(filter.text.down()); - }); - - // clear when the users clicks on the "clear" icon - filter.icon_release.connect((pos, event) => { - if (pos == Gtk.EntryIconPosition.SECONDARY) - filter.text = ""; - }); - - // refilter on input - filter.notify["text"].connect(() => { - this.icon_list_filtered.refilter(); - }); + if (name == null) return false; - // container for the icon_view - var scroll = new Gtk.ScrolledWindow (null, null); - scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); - scroll.set_shadow_type (Gtk.ShadowType.IN); + return (context_combo.get_active() == context || + context_combo.get_active() == IconContext.ALL) && + name.down().contains(filter.text.down()); + }); + + // clear when the users clicks on the "clear" icon + filter.icon_release.connect((pos, event) => { + if (pos == Gtk.EntryIconPosition.SECONDARY) + filter.text = ""; + }); + + // refilter on input + filter.notify["text"].connect(() => { + this.icon_list_filtered.refilter(); + }); + + // container for the icon_view + var scroll = builder.get_object("icon-scrolledwindow") as Gtk.ScrolledWindow; - // displays the filtered icons - this.icon_view = new Gtk.IconView.with_model(this.icon_list_filtered); - this.icon_view.item_width = 32; - this.icon_view.item_padding = 3; - this.icon_view.pixbuf_column = 2; - this.icon_view.tooltip_column = 0; - - // set _active_icon if selection changes - this.icon_view.selection_changed.connect(() => { - foreach (var path in this.icon_view.get_selected_items()) { - Gtk.TreeIter iter; - this.icon_list_filtered.get_iter(out iter, path); - this.icon_list_filtered.get(iter, 0, out this._active_icon); - } - }); - - // hide this window when the user activates an icon - this.icon_view.item_activated.connect((path) => { - Gtk.TreeIter iter; - this.icon_list_filtered.get_iter(out iter, path); - this.icon_list_filtered.get(iter, 0, out this._active_icon); - this.on_select(this._active_icon); - this.hide(); - }); + // displays the filtered icons + this.icon_view = new Gtk.IconView.with_model(this.icon_list_filtered); + this.icon_view.item_width = 32; + this.icon_view.item_padding = 3; + this.icon_view.pixbuf_column = 2; + this.icon_view.tooltip_column = 0; - scroll.add(this.icon_view); + // set active_icon if selection changes + this.icon_view.selection_changed.connect(() => { + foreach (var path in this.icon_view.get_selected_items()) { + Gtk.TreeIter iter; + this.icon_list_filtered.get_iter(out iter, path); + this.icon_list_filtered.get(iter, 0, out this.active_icon); + } + }); - theme_tab.pack_start(scroll, true, true); - - tabs.append_page(theme_tab, new Gtk.Label(_("Icon Theme"))); + // hide this window when the user activates an icon + this.icon_view.item_activated.connect((path) => { + Gtk.TreeIter iter; + this.icon_list_filtered.get_iter(out iter, path); + this.icon_list_filtered.get(iter, 0, out this.active_icon); + this.on_ok(this.active_icon); + this.window.hide(); + }); + + scroll.add(this.icon_view); - // tab containing the possibility to choose a custom icon - var custom_tab = new Gtk.VBox(false, 6); - custom_tab.border_width = 12; + // file chooser widget + this.file_chooser = builder.get_object("filechooser") as Gtk.FileChooserWidget; + var file_filter = new Gtk.FileFilter(); + file_filter.add_pixbuf_formats(); - // file chooser widget - this.file_chooser = new Gtk.FileChooserWidget(Gtk.FileChooserAction.OPEN); - var file_filter = new Gtk.FileFilter(); - file_filter.add_pixbuf_formats(); + #if HAVE_GTK_3 + file_filter.set_filter_name(_("All supported image formats")); + #else file_filter.set_name(_("All supported image formats")); - file_chooser.add_filter(file_filter); - - // set _active_icon if the user selected a file - file_chooser.selection_changed.connect(() => { - if (file_chooser.get_filename() != null && - GLib.FileUtils.test(file_chooser.get_filename(), - GLib.FileTest.IS_REGULAR)) - - this._active_icon = file_chooser.get_filename(); - }); - - // hide this window when the user activates a file - file_chooser.file_activated.connect(() => { - this._active_icon = file_chooser.get_filename(); - this.on_select(this._active_icon); - this.hide(); - }); - - - custom_tab.pack_start(file_chooser, true, true); - - tabs.append_page(custom_tab, new Gtk.Label(_("Custom Icon"))); - - container.pack_start(tabs, true, true); - - // button box --- this dialog has a custom button box at the bottom because it - // should have a spinner there. Sadly that's impossible with the "normal" - // action_area of Gtk.Dialog's - var bottom_box = new Gtk.HBox(false, 0); - - var bbox = new Gtk.HButtonBox(); - bbox.set_spacing(6); - bbox.set_layout(Gtk.ButtonBoxStyle.END); - - var cancel_button = new Gtk.Button.from_stock(Gtk.Stock.CANCEL); - cancel_button.clicked.connect(() => { - this.hide(); - }); - bbox.pack_start(cancel_button); - - var ok_button = new Gtk.Button.from_stock(Gtk.Stock.OK); - ok_button.clicked.connect(() => { - this.on_select(this._active_icon); - this.hide(); - }); - bbox.pack_start(ok_button); - - bottom_box.pack_end(bbox, false); + #endif - this.spinner = new Gtk.Spinner(); - this.spinner.set_size_request(16, 16); - this.spinner.start(); + file_chooser.add_filter(file_filter); + + // set active_icon if the user selected a file + file_chooser.selection_changed.connect(() => { + if (file_chooser.get_filename() != null && + GLib.FileUtils.test(file_chooser.get_filename(), + GLib.FileTest.IS_REGULAR)) - bottom_box.pack_start(this.spinner, false, false); + this.active_icon = file_chooser.get_filename(); + }); + + // hide this window when the user activates a file + file_chooser.file_activated.connect(() => { + this.active_icon = file_chooser.get_filename(); + this.on_ok(this.active_icon); + this.window.hide(); + }); - container.pack_start(bottom_box, false, false); - - this.vbox.pack_start(container, true, true); - - this.vbox.show_all(); - - this.set_focus(this.icon_view); + this.window.set_focus(this.icon_view); + this.window.delete_event.connect(this.window.hide_on_delete); + + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } } ///////////////////////////////////////////////////////////////////// - /// Hide the "normal" action_area when this window is shown. Reload - /// all icons if necessary. + /// Displays the window. The icons are reloaded if neccessary. ///////////////////////////////////////////////////////////////////// - - public override void show() { - base.show(); - - // hide the "normal" action_area --- this Dialog has a custom set of - // buttons containg the spinner - this.action_area.hide(); + + public void show() { + this.window.show_all(); + this.spinner.hide(); if (this.need_reload) { this.need_reload = false; this.load_icons(); } + } + + ///////////////////////////////////////////////////////////////////// + /// Makes the window select the icon of the given Pie. + ///////////////////////////////////////////////////////////////////// + + public void set_pie(string id) { + string icon = PieManager.all_pies[id].icon; + + if (icon.contains("/")) { + this.file_chooser.set_filename(icon); + this.tabs.set_current_page(1); + } else { + this.icon_list_filtered.foreach((model, path, iter) => { + string name = ""; + model.get(iter, 0, out name); + + if (name == icon) { + this.icon_view.select_path(path); + this.icon_view.scroll_to_path(path, true, 0.5f, 0.0f); + this.icon_view.set_cursor(path, null, false); + } + return (name == icon); + }); + + this.tabs.set_current_page(0); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user clicks the ok button. + ///////////////////////////////////////////////////////////////////// + + private void on_ok_button_clicked() { + this.on_ok(this.active_icon); + this.window.hide(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user clicks the cancel button. + ///////////////////////////////////////////////////////////////////// + + private void on_cancel_button_clicked() { + this.window.hide(); } ///////////////////////////////////////////////////////////////////// @@ -400,13 +384,13 @@ public class IconSelectWindow : Gtk.Dialog { var new_entry = this.load_queue.pop(); Gtk.TreeIter current; this.icon_list.append(out current); - this.icon_list.set(current, 0, new_entry.name, + this.icon_list.set(current, 0, new_entry.name, 1, new_entry.context, 2, new_entry.pixbuf); } // enable sorting of the icon_view if loading finished - if (!this.loading) this.icon_list.set_sort_column_id(0, Gtk.SortType.ASCENDING); + if (!this.loading) this.icon_list.set_sort_column_id(0, Gtk.SortType.ASCENDING); return loading; }); @@ -439,12 +423,12 @@ public class IconSelectWindow : Gtk.Dialog { default: break; } - try { + try { // create a new entry for the queue var new_entry = new ListEntry(); new_entry.name = icon; new_entry.context = icon_context; - new_entry.pixbuf = icon_theme.load_icon(icon, 32, 0); + new_entry.pixbuf = icon_theme.load_icon(icon, 32, 0); // some icons have only weird sizes... do not include them if (new_entry.pixbuf.width == 32) @@ -462,7 +446,7 @@ public class IconSelectWindow : Gtk.Dialog { // hide the spinner if (spinner != null) - spinner.visible = this.loading; + spinner.visible = false; return null; } diff --git a/src/gui/indicator.vala b/src/gui/indicator.vala index 8033cb7..dea4d3c 100644 --- a/src/gui/indicator.vala +++ b/src/gui/indicator.vala @@ -38,7 +38,7 @@ public class Indicator : GLib.Object { /// The Preferences Menu of Gnome-Pie. ///////////////////////////////////////////////////////////////////// - private Preferences prefs { private get; private set; } + private PreferencesWindow prefs { private get; private set; } ///////////////////////////////////////////////////////////////////// /// Returns true, when the indicator is currently visible. @@ -73,7 +73,7 @@ public class Indicator : GLib.Object { string icon = "indicator-applet"; try { path = GLib.Path.get_dirname(GLib.FileUtils.read_link("/proc/self/exe"))+"/resources"; - icon = "gnome-pie-indicator"; + icon = "gnome-pie"; } catch (GLib.FileError e) { warning("Failed to get path of executable!"); } @@ -86,23 +86,23 @@ public class Indicator : GLib.Object { try { var file = GLib.File.new_for_path(GLib.Path.build_filename( GLib.Path.get_dirname(GLib.FileUtils.read_link("/proc/self/exe"))+"/resources", - "gnome-pie-indicator.svg" + "gnome-pie.svg" )); if (!file.query_exists()) - this.indicator.set_from_icon_name("gnome-pie-indicator"); + this.indicator.set_from_icon_name("gnome-pie"); else this.indicator.set_from_file(file.get_path()); } catch (GLib.FileError e) { warning("Failed to get path of executable!"); - this.indicator.set_from_icon_name("gnome-pie-indicator"); + this.indicator.set_from_icon_name("gnome-pie"); } this.menu = new Gtk.Menu(); var menu = this.menu; #endif - this.prefs = new Preferences(); + this.prefs = new PreferencesWindow(); // preferences item var item = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.PREFERENCES, null); @@ -117,7 +117,7 @@ public class Indicator : GLib.Object { item = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.ABOUT, null); item.show(); item.activate.connect(() => { - var about = new GnomePieAboutDialog(); + var about = new AboutWindow(); about.run(); about.destroy(); }); diff --git a/src/gui/newSliceWindow.vala b/src/gui/newSliceWindow.vala new file mode 100644 index 0000000..4e38376 --- /dev/null +++ b/src/gui/newSliceWindow.vala @@ -0,0 +1,394 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A window which allows selection of a new Slice which is about to be +/// added to a Pie. It can be also used to edit an existing Slice +///////////////////////////////////////////////////////////////////////// + +public class NewSliceWindow : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// This signal gets emitted when the user confirms his selection. + ///////////////////////////////////////////////////////////////////// + + public signal void on_select(ActionGroup action, bool as_new_slice, int at_position); + + ///////////////////////////////////////////////////////////////////// + /// The contained list of slice types. It contains both: Groups and + /// single actions. + ///////////////////////////////////////////////////////////////////// + + private SliceTypeList slice_type_list = null; + + ///////////////////////////////////////////////////////////////////// + /// The IconSelectWindow used for icon selection for a Slice. + ///////////////////////////////////////////////////////////////////// + + private IconSelectWindow? icon_window = null; + + ///////////////////////////////////////////////////////////////////// + /// Some widgets of this window. Loaded by a ui-builder and stored + /// for later access. + ///////////////////////////////////////////////////////////////////// + + private Gtk.Dialog window = null; + private Gtk.HBox name_box = null; + private Gtk.HBox command_box = null; + private Gtk.Button icon_button = null; + private Gtk.VBox no_options_box = null; + private Gtk.HBox pie_box = null; + private Gtk.HBox hotkey_box = null; + private Gtk.HBox uri_box = null; + private Gtk.HBox quickaction_box = null; + private Gtk.Image icon = null; + private Gtk.Entry name_entry = null; + private Gtk.Entry command_entry = null; + private Gtk.Entry uri_entry = null; + private Gtk.CheckButton quickaction_checkbutton = null; + + ///////////////////////////////////////////////////////////////////// + /// Two custom widgets. For Pie and hotkey selection respectively. + ///////////////////////////////////////////////////////////////////// + + private PieComboList pie_select = null; + private TriggerSelectButton key_select = null; + + ///////////////////////////////////////////////////////////////////// + /// These members store information on the currently selected Slice. + ///////////////////////////////////////////////////////////////////// + + private string current_type = ""; + private string current_icon = ""; + private string current_id = ""; + private string current_custom_icon = ""; + private string current_hotkey = ""; + private string current_pie_to_open = ""; + + ///////////////////////////////////////////////////////////////////// + /// The position of the edited Slice in its parent Pie. + ///////////////////////////////////////////////////////////////////// + + private int slice_position = 0; + + ///////////////////////////////////////////////////////////////////// + /// True, if the Slice i going to be added as a new Slice. Else it + /// will edit the Slice at slice_position in its parent Pie. + ///////////////////////////////////////////////////////////////////// + + private bool add_as_new_slice = true; + + ///////////////////////////////////////////////////////////////////// + /// C'tor creates a new window. + ///////////////////////////////////////////////////////////////////// + + public NewSliceWindow() { + try { + + Gtk.Builder builder = new Gtk.Builder(); + + builder.add_from_file (Paths.ui_files + "/slice_select.ui"); + + this.slice_type_list = new SliceTypeList(); + this.slice_type_list.on_select.connect((type, icon) => { + + this.name_box.hide(); + this.command_box.hide(); + this.icon_button.sensitive = false; + this.no_options_box.hide(); + this.pie_box.hide(); + this.hotkey_box.hide(); + this.uri_box.hide(); + this.quickaction_box.hide(); + + this.current_type = type; + + switch (type) { + case "bookmarks": case "clipboard": case "devices": + case "menu": case "session": case "window_list": + this.no_options_box.show(); + this.set_icon(icon); + break; + case "app": + this.name_box.show(); + this.command_box.show(); + this.quickaction_box.show(); + this.icon_button.sensitive = true; + if (this.current_custom_icon == "") this.set_icon(icon); + else this.set_icon(this.current_custom_icon); + break; + case "key": + this.name_box.show(); + this.hotkey_box.show(); + this.quickaction_box.show(); + this.icon_button.sensitive = true; + if (this.current_custom_icon == "") this.set_icon(icon); + else this.set_icon(this.current_custom_icon); + break; + case "pie": + this.pie_box.show(); + this.quickaction_box.show(); + this.set_icon(PieManager.all_pies[this.pie_select.current_id].icon); + break; + case "uri": + this.name_box.show(); + this.uri_box.show(); + this.quickaction_box.show(); + this.icon_button.sensitive = true; + if (this.current_custom_icon == "") this.set_icon(icon); + else this.set_icon(this.current_custom_icon); + break; + } + }); + + this.name_box = builder.get_object("name-box") as Gtk.HBox; + this.command_box = builder.get_object("command-box") as Gtk.HBox; + this.icon_button = builder.get_object("icon-button") as Gtk.Button; + this.no_options_box = builder.get_object("no-options-box") as Gtk.VBox; + this.pie_box = builder.get_object("pie-box") as Gtk.HBox; + this.pie_select = new PieComboList(); + this.pie_select.on_select.connect((id) => { + this.current_pie_to_open = id; + this.set_icon(PieManager.all_pies[id].icon); + }); + + this.pie_box.pack_start(this.pie_select, true, true); + + this.hotkey_box = builder.get_object("hotkey-box") as Gtk.HBox; + this.key_select = new TriggerSelectButton(false); + this.hotkey_box.pack_start(this.key_select, false, true); + this.key_select.on_select.connect((trigger) => { + this.current_hotkey = trigger.name; + }); + + this.uri_box = builder.get_object("uri-box") as Gtk.HBox; + + this.name_entry = builder.get_object("name-entry") as Gtk.Entry; + this.uri_entry = builder.get_object("uri-entry") as Gtk.Entry; + this.command_entry = builder.get_object("command-entry") as Gtk.Entry; + this.quickaction_checkbutton = builder.get_object("quick-action-checkbutton") as Gtk.CheckButton; + + this.quickaction_box = builder.get_object("quickaction-box") as Gtk.HBox; + this.icon = builder.get_object("icon") as Gtk.Image; + + this.icon_button.clicked.connect(on_icon_button_clicked); + + var scroll_area = builder.get_object("slice-scrolledwindow") as Gtk.ScrolledWindow; + scroll_area.add(this.slice_type_list); + + this.window = builder.get_object("window") as Gtk.Dialog; + + (builder.get_object("ok-button") as Gtk.Button).clicked.connect(on_ok_button_clicked); + (builder.get_object("cancel-button") as Gtk.Button).clicked.connect(on_cancel_button_clicked); + + this.window.delete_event.connect(this.window.hide_on_delete); + + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Sets the parent window, in order to make this window stay in + /// front. + ///////////////////////////////////////////////////////////////////// + + public void set_parent(Gtk.Window parent) { + this.window.set_transient_for(parent); + } + + ///////////////////////////////////////////////////////////////////// + /// Sows the window on the screen. + ///////////////////////////////////////////////////////////////////// + + public void show() { + this.slice_type_list.select_first(); + this.pie_select.select_first(); + this.key_select.set_trigger(new Trigger()); + this.window.show_all(); + } + + ///////////////////////////////////////////////////////////////////// + /// Reloads the window. + ///////////////////////////////////////////////////////////////////// + + public void reload() { + this.pie_select.reload(); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes all widgets display stuff according to the given action. + ///////////////////////////////////////////////////////////////////// + + public void set_action(ActionGroup group, int position) { + this.set_default(group.parent_id, position); + + this.add_as_new_slice = false; + string type = ""; + + if (group.get_type().depth() == 2) { + var action = group.actions[0]; + type = ActionRegistry.descriptions[action.get_type().name()].id; + this.select_type(type); + + this.set_icon(action.icon); + this.quickaction_checkbutton.active = action.is_quickaction; + this.name_entry.text = action.name; + + switch (type) { + case "app": + this.current_custom_icon = action.icon; + this.command_entry.text = action.real_command; + break; + case "key": + this.current_custom_icon = action.icon; + this.key_select.set_trigger(new Trigger.from_string(action.real_command)); + break; + case "pie": + this.pie_select.select(action.real_command); + break; + case "uri": + this.current_custom_icon = action.icon; + this.uri_entry.text = action.real_command; + break; + } + + } else { + type = GroupRegistry.descriptions[group.get_type().name()].id; + this.select_type(type); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Selects a default action. + ///////////////////////////////////////////////////////////////////// + + public void set_default(string pie_id, int position) { + this.slice_position = position; + this.add_as_new_slice = true; + this.current_custom_icon = ""; + this.select_type("app"); + this.current_id = pie_id; + this.key_select.set_trigger(new Trigger()); + this.pie_select.select_first(); + this.name_entry.text = _("Rename me!"); + this.command_entry.text = ""; + this.uri_entry.text = ""; + } + + ///////////////////////////////////////////////////////////////////// + /// Selects a specific action type. + ///////////////////////////////////////////////////////////////////// + + private void select_type(string type) { + this.current_type = type; + this.slice_type_list.select(type); + } + + ///////////////////////////////////////////////////////////////////// + /// Called, when the user presses the ok button. + ///////////////////////////////////////////////////////////////////// + + private void on_ok_button_clicked() { + this.window.hide(); + + ActionGroup group = null; + + switch (this.current_type) { + case "bookmarks": group = new BookmarkGroup(this.current_id); break; + case "clipboard": group = new ClipboardGroup(this.current_id); break; + case "devices": group = new DevicesGroup(this.current_id); break; + case "menu": group = new MenuGroup(this.current_id); break; + case "session": group = new SessionGroup(this.current_id); break; + case "window_list": group = new WindowListGroup(this.current_id); break; + + case "app": + group = new ActionGroup(this.current_id); + group.add_action(new AppAction(this.name_entry.text, this.current_icon, + this.command_entry.text, + this.quickaction_checkbutton.active)); + break; + case "key": + group = new ActionGroup(this.current_id); + group.add_action(new KeyAction(this.name_entry.text, this.current_icon, + this.current_hotkey, + this.quickaction_checkbutton.active)); + break; + case "pie": + group = new ActionGroup(this.current_id); + group.add_action(new PieAction(this.current_pie_to_open, + this.quickaction_checkbutton.active)); + break; + case "uri": + group = new ActionGroup(this.current_id); + group.add_action(new UriAction(this.name_entry.text, this.current_icon, + this.uri_entry.text, + this.quickaction_checkbutton.active)); + break; + } + + this.on_select(group, this.add_as_new_slice, this.slice_position); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user presses the cancel button. + ///////////////////////////////////////////////////////////////////// + + private void on_cancel_button_clicked() { + this.window.hide(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user presses the icon select button. + ///////////////////////////////////////////////////////////////////// + + private void on_icon_button_clicked(Gtk.Button button) { + if (icon_window == null) { + icon_window = new IconSelectWindow(this.window); + icon_window.on_ok.connect((icon) => { + this.current_custom_icon = icon; + this.set_icon(icon); + }); + } + + icon_window.show(); + } + + ///////////////////////////////////////////////////////////////////// + /// Helper method which sets the icon of the icon select button. + /// It assures that both can be displayed: A customly chosen image + /// from or an icon from the current theme. + ///////////////////////////////////////////////////////////////////// + + private void set_icon(string icon) { + if (icon.contains("/")) + try { + this.icon.pixbuf = new Gdk.Pixbuf.from_file_at_scale(icon, this.icon.get_pixel_size(), + this.icon.get_pixel_size(), true); + } catch (GLib.Error error) { + warning(error.message); + } + else + this.icon.icon_name = icon; + + this.current_icon = icon; + } +} + +} diff --git a/src/gui/pieComboList.vala b/src/gui/pieComboList.vala new file mode 100644 index 0000000..3b54944 --- /dev/null +++ b/src/gui/pieComboList.vala @@ -0,0 +1,155 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A drop-down list, containing one entry for each existing Pie. +///////////////////////////////////////////////////////////////////////// + +class PieComboList : Gtk.ComboBox { + + ///////////////////////////////////////////////////////////////////// + /// This signal gets emitted when the user selects a new Pie. + ///////////////////////////////////////////////////////////////////// + + public signal void on_select(string id); + + ///////////////////////////////////////////////////////////////////// + /// The currently selected row. + ///////////////////////////////////////////////////////////////////// + + public string current_id { get; private set; default=""; } + + ///////////////////////////////////////////////////////////////////// + /// Stores the data internally. + ///////////////////////////////////////////////////////////////////// + + private Gtk.ListStore data; + private enum DataPos {ICON, NAME, ID} + + ///////////////////////////////////////////////////////////////////// + /// C'tor, constructs the Widget. + ///////////////////////////////////////////////////////////////////// + + public PieComboList() { + GLib.Object(); + + this.data = new Gtk.ListStore(3, typeof(Gdk.Pixbuf), + typeof(string), + typeof(string)); + + this.data.set_sort_column_id(1, Gtk.SortType.ASCENDING); + + base.set_model(this.data); + + var icon_render = new Gtk.CellRendererPixbuf(); + icon_render.xpad = 4; + this.pack_start(icon_render, false); + + var name_render = new Gtk.CellRendererText(); + this.pack_start(name_render, true); + + this.add_attribute(icon_render, "pixbuf", DataPos.ICON); + this.add_attribute(name_render, "markup", DataPos.NAME); + + this.changed.connect(() => { + Gtk.TreeIter active; + if (this.get_active_iter(out active)) { + string id = ""; + this.data.get(active, DataPos.ID, out id); + this.on_select(id); + this.current_id = id; + } + }); + + reload(); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads all existing Pies to the list. + ///////////////////////////////////////////////////////////////////// + + public void reload() { + Gtk.TreeIter active; + string id = ""; + if (this.get_active_iter(out active)) + this.data.get(active, DataPos.ID, out id); + + data.clear(); + foreach (var pie in PieManager.all_pies.entries) { + this.load_pie(pie.value); + } + + select_first(); + select(id); + } + + ///////////////////////////////////////////////////////////////////// + /// Selects the first Pie. + ///////////////////////////////////////////////////////////////////// + + public void select_first() { + Gtk.TreeIter active; + + if(this.data.get_iter_first(out active) ) { + this.set_active_iter(active); + string id = ""; + this.data.get(active, DataPos.ID, out id); + this.on_select(id); + this.current_id = id; + } else { + this.on_select(""); + this.current_id = ""; + } + } + + ///////////////////////////////////////////////////////////////////// + /// Selects the Pie with the given ID. + ///////////////////////////////////////////////////////////////////// + + public void select(string id) { + this.data.foreach((model, path, iter) => { + string pie_id; + this.data.get(iter, DataPos.ID, out pie_id); + + if (id == pie_id) { + this.set_active_iter(iter); + return true; + } + + return false; + }); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads one given pie to the list. + ///////////////////////////////////////////////////////////////////// + + private void load_pie(Pie pie) { + if (pie.id.length == 3) { + Gtk.TreeIter last; + this.data.append(out last); + var icon = new Icon(pie.icon, 24); + this.data.set(last, DataPos.ICON, icon.to_pixbuf(), + DataPos.NAME, pie.name, + DataPos.ID, pie.id); + } + } +} + +} diff --git a/src/gui/pieList.vala b/src/gui/pieList.vala index 46970d5..bfcb832 100644 --- a/src/gui/pieList.vala +++ b/src/gui/pieList.vala @@ -17,1029 +17,226 @@ this program. If not, see . namespace GnomePie { -// A very complex Widget. This is by far the most ugly file of this project -// but well, this list *is* complex... sorry ;) +///////////////////////////////////////////////////////////////////////// +/// A list, containing one entry for each existing Pie. +///////////////////////////////////////////////////////////////////////// class PieList : Gtk.TreeView { - private Gtk.ListStore groups; - private Gtk.ListStore pies; - private Gtk.ListStore actions; - private Gtk.TreeStore data; + ///////////////////////////////////////////////////////////////////// + /// This signal gets emitted when the user selects a new Pie. + ///////////////////////////////////////////////////////////////////// - private const int small_icon = 24; - private const int large_icon = 36; + public signal void on_select(string id); - // data positions in the data ListStore - private enum DataPos {IS_QUICKACTION, ICON, NAME, TYPE_ID, ACTION_TYPE, - ICON_PIXBUF, FONT_WEIGHT, ICON_NAME_EDITABLE, QUICKACTION_VISIBLE, QUICKACTION_ACTIVATABLE, - TYPE_VISIBLE, GROUP_VISIBLE, APP_VISIBLE, KEY_VISIBLE, PIE_VISIBLE, - URI_VISIBLE, TRIGGER_VISIBLE, DISPLAY_COMMAND_GROUP, DISPLAY_COMMAND_APP, - DISPLAY_COMMAND_KEY, DISPLAY_COMMAND_PIE, DISPLAY_COMMAND_URI, - REAL_COMMAND_GROUP, REAL_COMMAND_PIE, REAL_COMMAND_KEY} + ///////////////////////////////////////////////////////////////////// + /// Stores the data internally. + ///////////////////////////////////////////////////////////////////// - // data positions in the actions ListStore - private enum ActionPos {NAME, TYPE, CAN_QUICKACTION, ICON_NAME_EDITABLE} + private Gtk.ListStore data; + private enum DataPos {ICON, ICON_NAME, NAME, ID} - // data positions in the pies ListStore - private enum PiePos {NAME, ID} + ///////////////////////////////////////////////////////////////////// + /// Stores where a drag startet. + ///////////////////////////////////////////////////////////////////// - // data positions in the groups ListStore - private enum GroupPos {NAME, TYPE, ICON} + private Gtk.TreeIter? drag_start = null; + + ///////////////////////////////////////////////////////////////////// + /// Rembers the time when a last drag move event was reported. Used + /// to avoid frequent changes of selected Pie when a Pie is dragged + /// over this widget. + ///////////////////////////////////////////////////////////////////// + + private uint last_hover = 0; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, constructs the Widget. + ///////////////////////////////////////////////////////////////////// public PieList() { GLib.Object(); - Gtk.TreeIter last; - - // group choices - this.groups = new Gtk.ListStore(3, typeof(string), // group name - typeof(string), // group type - typeof(string)); // group icon - - // add all registered group types - foreach (var type in GroupRegistry.types) { - this.groups.append(out last); - this.groups.set(last, GroupPos.NAME, GroupRegistry.names[type], - GroupPos.TYPE, type.name(), - GroupPos.ICON, GroupRegistry.icons[type]); - } - - // pie choices - this.pies = new Gtk.ListStore(2, typeof(string), // pie name - typeof(string)); // pie id - - // action type choices - this.actions = new Gtk.ListStore(4, typeof(string), // type name - typeof(string), // action type - typeof(bool), // can be quickaction - typeof(bool)); // icon/name editable - - // add all registered action types - foreach (var type in ActionRegistry.types) { - this.actions.append(out last); - this.actions.set(last, ActionPos.NAME, ActionRegistry.names[type], - ActionPos.TYPE, type.name(), - ActionPos.CAN_QUICKACTION, true, - ActionPos.ICON_NAME_EDITABLE, ActionRegistry.icon_name_editables[type]); - } - // and one type for groups - this.actions.append(out last); - this.actions.set(last, ActionPos.NAME, _("Slice group"), - ActionPos.TYPE, typeof(ActionGroup).name(), - ActionPos.CAN_QUICKACTION, false, - ActionPos.ICON_NAME_EDITABLE, false); + this.data = new Gtk.ListStore(4, typeof(Gdk.Pixbuf), + typeof(string), + typeof(string), + typeof(string)); + + this.data.set_sort_column_id(DataPos.NAME, Gtk.SortType.ASCENDING); - // main data model - this.data = new Gtk.TreeStore(25, typeof(bool), // is quickaction - typeof(string), // icon - typeof(string), // name - typeof(string), // slice: type label, pie: "ID: %id" - typeof(string), // typeof(action), typeof(ActionGroup).name() if group action, pie_id if Pie - - typeof(Gdk.Pixbuf), // icon pixbuf - typeof(int), // font weight - - typeof(bool), // icon/name editable - - typeof(bool), // quickaction visible - typeof(bool), // quickaction activatable - typeof(bool), // type visible - typeof(bool), // group renderer visible - typeof(bool), // app renderer visible - typeof(bool), // key renderer visible - typeof(bool), // pie renderer visible - typeof(bool), // uri renderer visible - typeof(bool), // trigger renderer visible - - typeof(string), // display command group - typeof(string), // display command app - typeof(string), // display command key - typeof(string), // display command pie - typeof(string), // display command uri - - typeof(string), // real command group - typeof(string), // real command pie - typeof(string)); // real command key - - this.set_model(this.data); + this.set_headers_visible(false); this.set_grid_lines(Gtk.TreeViewGridLines.NONE); - this.set_enable_tree_lines(false); - this.set_reorderable(false); - this.set_level_indentation(-10); + this.width_request = 170; + this.set_enable_search(false); - // create the gui - // icon column - var icon_column = new Gtk.TreeViewColumn(); - icon_column.title = _("Icon"); - icon_column.expand = false; - - // quickaction checkbox - var check_render = new Gtk.CellRendererToggle(); - check_render.activatable = true; - check_render.radio = true; - check_render.width = 15; - - check_render.toggled.connect((path) => { - Gtk.TreeIter toggled; - this.data.get_iter_from_string(out toggled, path); - - bool current = false; - this.data.get(toggled, DataPos.IS_QUICKACTION, out current); - - // set all others off - Gtk.TreeIter parent; - this.data.iter_parent(out parent, toggled); - string parent_pos = this.data.get_string_from_iter(parent); - int child_count = this.data.iter_n_children(parent); - - for (int i=0; i { - Gtk.TreeIter iter; - this.data.get_iter_from_string(out iter, path); - int icon_size = this.data.iter_depth(iter) == 0 ? this.large_icon : this.small_icon; - - this.data.set(iter, DataPos.ICON, icon_name); - this.data.set(iter, DataPos.ICON_PIXBUF, this.load_icon(icon_name, icon_size)); - - this.update_pie(iter); - this.update_linked(); - }); - - icon_column.pack_start(icon_render, false); - icon_column.add_attribute(icon_render, "icon_name", DataPos.ICON); - icon_column.add_attribute(icon_render, "pixbuf", DataPos.ICON_PIXBUF); - icon_column.add_attribute(icon_render, "editable", DataPos.ICON_NAME_EDITABLE); - icon_column.add_attribute(icon_render, "icon_sensitive", DataPos.ICON_NAME_EDITABLE); - - // command column - var command_column = new Gtk.TreeViewColumn(); - command_column.title = _("Command"); - command_column.resizable = true; - command_column.expand = true; - - // trigger - var command_renderer_trigger = new CellRendererTrigger(); - command_renderer_trigger.editable = true; - command_renderer_trigger.ellipsize = Pango.EllipsizeMode.END; - - command_renderer_trigger.on_select.connect((path, trigger) => { - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_KEY, trigger.label_with_specials); - this.data.set(data_iter, DataPos.REAL_COMMAND_KEY, trigger.name); - - this.update_pie(data_iter); - }); - - command_column.pack_end(command_renderer_trigger, true); - command_column.add_attribute(command_renderer_trigger, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_trigger, "markup", DataPos.DISPLAY_COMMAND_KEY); - command_column.add_attribute(command_renderer_trigger, "visible", DataPos.TRIGGER_VISIBLE); - command_column.add_attribute(command_renderer_trigger, "trigger", DataPos.REAL_COMMAND_KEY); - - // slice group - var command_renderer_group = new Gtk.CellRendererCombo(); - command_renderer_group.editable = true; - command_renderer_group.has_entry = false; - command_renderer_group.text_column = 0; - command_renderer_group.ellipsize = Pango.EllipsizeMode.END; - command_renderer_group.model = this.groups; - - command_renderer_group.changed.connect((path, iter) => { - string display_name; - string type; - string icon; - - this.groups.get(iter, GroupPos.NAME, out display_name); - this.groups.get(iter, GroupPos.TYPE, out type); - this.groups.get(iter, GroupPos.ICON, out icon); - - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_GROUP, display_name); - this.data.set(data_iter, DataPos.REAL_COMMAND_GROUP, type); - this.data.set(data_iter, DataPos.NAME, display_name); - this.data.set(data_iter, DataPos.ICON, icon); - - this.update_pie(data_iter); - }); - - command_column.pack_end(command_renderer_group, true); - command_column.add_attribute(command_renderer_group, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_group, "text", DataPos.DISPLAY_COMMAND_GROUP); - command_column.add_attribute(command_renderer_group, "visible", DataPos.GROUP_VISIBLE); - - - // app action - var command_renderer_app = new Gtk.CellRendererText(); - command_renderer_app.editable = true; - command_renderer_app.ellipsize = Pango.EllipsizeMode.END; - - command_renderer_app.edited.connect((path, command) => { - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_APP, command); - - this.update_pie(data_iter); - }); - - command_column.pack_end(command_renderer_app, true); - command_column.add_attribute(command_renderer_app, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_app, "text", DataPos.DISPLAY_COMMAND_APP); - command_column.add_attribute(command_renderer_app, "visible", DataPos.APP_VISIBLE); - - - // key action - var command_renderer_key = new Gtk.CellRendererAccel(); - command_renderer_key.editable = true; - command_renderer_key.ellipsize = Pango.EllipsizeMode.END; - - command_renderer_key.accel_edited.connect((path, key, mods) => { - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - string label = Gtk.accelerator_get_label(key, mods); - string accelerator = Gtk.accelerator_name(key, mods); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_KEY, label); - this.data.set(data_iter, DataPos.REAL_COMMAND_KEY, accelerator); - - this.update_pie(data_iter); - }); - - command_renderer_key.accel_cleared.connect((path) => { - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_KEY, _("Not bound")); - this.data.set(data_iter, DataPos.REAL_COMMAND_KEY, ""); - - this.update_pie(data_iter); - }); - - command_column.pack_end(command_renderer_key, true); - command_column.add_attribute(command_renderer_key, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_key, "text", DataPos.DISPLAY_COMMAND_KEY); - command_column.add_attribute(command_renderer_key, "visible", DataPos.KEY_VISIBLE); - - - // pie action - var command_renderer_pie = new Gtk.CellRendererCombo(); - command_renderer_pie.editable = true; - command_renderer_pie.has_entry = false; - command_renderer_pie.text_column = 0; - command_renderer_pie.ellipsize = Pango.EllipsizeMode.END; - command_renderer_pie.model = this.pies; - - command_renderer_pie.changed.connect((path, iter) => { - string name; - string id; - - this.pies.get(iter, PiePos.NAME, out name); - this.pies.get(iter, PiePos.ID, out id); - - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_PIE, name); - this.data.set(data_iter, DataPos.REAL_COMMAND_PIE, id); - - this.update_pie(data_iter); - this.update_linked(); - }); - - command_column.pack_end(command_renderer_pie, true); - command_column.add_attribute(command_renderer_pie, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_pie, "text", DataPos.DISPLAY_COMMAND_PIE); - command_column.add_attribute(command_renderer_pie, "visible", DataPos.PIE_VISIBLE); - - - // uri action - var command_renderer_uri = new Gtk.CellRendererText(); - command_renderer_uri.editable = true; - command_renderer_uri.ellipsize = Pango.EllipsizeMode.END; - - command_renderer_uri.edited.connect((path, uri) => { - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.DISPLAY_COMMAND_URI, uri); - - this.update_pie(data_iter); - }); - - command_column.pack_end(command_renderer_uri, true); - command_column.add_attribute(command_renderer_uri, "weight", DataPos.FONT_WEIGHT); - command_column.add_attribute(command_renderer_uri, "text", DataPos.DISPLAY_COMMAND_URI); - command_column.add_attribute(command_renderer_uri, "visible", DataPos.URI_VISIBLE); - - - // type column - var type_column = new Gtk.TreeViewColumn(); - type_column.title = _("Pie-ID / Action type"); - type_column.resizable = true; - type_column.expand = false; - - var type_render = new Gtk.CellRendererCombo(); - type_render.editable = true; - type_render.has_entry = false; - type_render.model = actions; - type_render.text_column = 0; - type_render.ellipsize = Pango.EllipsizeMode.END; - - // change command_render's visibility accordingly - type_render.changed.connect((path, iter) => { - string text = ""; - string type; - bool can_quickaction; - bool icon_name_editable; - - this.actions.get(iter, ActionPos.NAME, out text); - this.actions.get(iter, ActionPos.TYPE, out type); - this.actions.get(iter, ActionPos.CAN_QUICKACTION, out can_quickaction); - this.actions.get(iter, ActionPos.ICON_NAME_EDITABLE, out icon_name_editable); - - Gtk.TreeIter data_iter; - this.data.get_iter_from_string(out data_iter, path); - - this.data.set(data_iter, DataPos.TYPE_ID, text); - this.data.set(data_iter, DataPos.ACTION_TYPE, type); - this.data.set(data_iter, DataPos.QUICKACTION_ACTIVATABLE, can_quickaction); - this.data.set(data_iter, DataPos.ICON_NAME_EDITABLE, icon_name_editable); - - // set all command renderes invisible - this.data.set(data_iter, DataPos.GROUP_VISIBLE, false); - this.data.set(data_iter, DataPos.APP_VISIBLE, false); - this.data.set(data_iter, DataPos.KEY_VISIBLE, false); - this.data.set(data_iter, DataPos.PIE_VISIBLE, false); - this.data.set(data_iter, DataPos.URI_VISIBLE, false); - - // set one visible - int type_id = 0; - if(type == typeof(AppAction).name()) type_id = 1; - else if(type == typeof(KeyAction).name()) type_id = 2; - else if(type == typeof(PieAction).name()) type_id = 3; - else if(type == typeof(UriAction).name()) type_id = 4; - else type_id = 0; - - this.data.set(data_iter, DataPos.GROUP_VISIBLE + type_id, true); - - this.update_linked(); - this.update_pie(data_iter); - - //this.set_cursor(new Gtk.TreePath.from_string(path), command_column, true); - }); - - type_column.pack_start(type_render, true); - type_column.add_attribute(type_render, "sensitive", DataPos.TYPE_VISIBLE); - type_column.add_attribute(type_render, "editable", DataPos.TYPE_VISIBLE); - type_column.add_attribute(type_render, "text", DataPos.TYPE_ID); - - // name column - var name_column = new Gtk.TreeViewColumn(); - name_column.title = _("Name"); - name_column.expand = true; - name_column.resizable = true; + var main_column = new Gtk.TreeViewColumn(); + var icon_render = new Gtk.CellRendererPixbuf(); + icon_render.xpad = 4; + icon_render.ypad = 4; + main_column.pack_start(icon_render, false); var name_render = new Gtk.CellRendererText(); - name_render.editable = true; name_render.ellipsize = Pango.EllipsizeMode.END; - - name_render.edited.connect((path, text) => { - Gtk.TreeIter iter; - this.data.get_iter_from_string(out iter, path); - - this.data.set(iter, DataPos.NAME, text); - - // try to change icon to a fitting one - string icon; - this.data.get(iter, DataPos.ICON, out icon); - if (icon == "application-default-icon" && Gtk.IconTheme.get_default().has_icon(text.down())) { - this.data.set(iter, DataPos.ICON, text.down()); - } - - this.update_pie(iter); - this.update_linked(); - - //this.set_cursor(new Gtk.TreePath.from_string(path), type_column, true); - }); - - name_column.pack_start(name_render, true); - name_column.add_attribute(name_render, "weight", DataPos.FONT_WEIGHT); - name_column.add_attribute(name_render, "text", DataPos.NAME); - name_column.add_attribute(name_render, "sensitive", DataPos.ICON_NAME_EDITABLE); - name_column.add_attribute(name_render, "editable", DataPos.ICON_NAME_EDITABLE); - - this.append_column(icon_column); - this.append_column(name_column); - this.append_column(type_column); - this.append_column(command_column); + name_render.ellipsize_set = true; + main_column.pack_start(name_render, true); - this.realize.connect(this.load); - - // context menu - var menu = new Gtk.Menu(); - - var item = new Gtk.ImageMenuItem.with_label(_("Add new Pie")); - item.set_image(new Gtk.Image.from_stock(Gtk.Stock.ADD, Gtk.IconSize.MENU)); - item.activate.connect(this.add_empty_pie); - menu.append(item); - - item = new Gtk.ImageMenuItem.with_label(_("Add new Slice")); - item.set_image(new Gtk.Image.from_stock(Gtk.Stock.ADD, Gtk.IconSize.MENU)); - item.activate.connect(this.add_empty_slice); - menu.append(item); - - var sepa = new Gtk.SeparatorMenuItem(); - menu.append(sepa); - - item = new Gtk.ImageMenuItem.with_label(_("Delete")); - item.set_image(new Gtk.Image.from_stock(Gtk.Stock.DELETE, Gtk.IconSize.MENU)); - item.activate.connect(this.delete_selection); - menu.append(item); + base.append_column(main_column); - menu.show_all(); - - this.button_press_event.connect((event) => { - if (event.type == Gdk.EventType.BUTTON_PRESS && event.button == 3) { - menu.popup(null, null, null, event.button, event.time); - } - return false; - }); + main_column.add_attribute(icon_render, "pixbuf", DataPos.ICON); + main_column.add_attribute(name_render, "markup", DataPos.NAME); // setup drag'n'drop Gtk.TargetEntry uri_source = {"text/uri-list", 0, 0}; Gtk.TargetEntry[] entries = { uri_source }; - - this.drag_data_received.connect(this.on_dnd_received); - this.drag_data_get.connect(this.on_dnd_source); + this.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, entries, Gdk.DragAction.LINK); this.enable_model_drag_dest(entries, Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK); + this.drag_data_get.connect(this.on_dnd_source); + this.drag_begin.connect_after(this.on_start_drag); + this.drag_motion.connect(this.on_drag_move); + this.drag_leave.connect(() => { + this.last_hover = 0; + }); this.get_selection().changed.connect(() => { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - if (this.data.iter_depth(selected) == 0) { - this.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, entries, Gdk.DragAction.LINK); - } else { - this.unset_rows_drag_source(); - } + Gtk.TreeIter active; + if (this.get_selection().get_selected(null, out active)) { + string id = ""; + this.data.get(active, DataPos.ID, out id); + this.on_select(id); } }); - this.drag_begin.connect(() => { - this.unset_rows_drag_dest(); - }); - - this.drag_end.connect(() => { - this.enable_model_drag_dest(entries, Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK); - }); + reload_all(); } - // moves the selected slice up - public void selection_up() { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - Gtk.TreePath path = this.data.get_path(selected); - Gtk.TreeIter? before = null;; - if (path.prev() && this.data.get_iter(out before, path)) { - this.data.swap(selected, before); - this.get_selection().changed(); - this.update_pie(selected); - } - } - } + ///////////////////////////////////////////////////////////////////// + /// Loads all existing Pies to the list. + ///////////////////////////////////////////////////////////////////// - // moves the selected slice down - public void selection_down() { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - Gtk.TreePath path = this.data.get_path(selected); - Gtk.TreeIter? after = null; - path.next(); - if (this.data.get_iter(out after, path)) { - this.data.swap(selected, after); - this.get_selection().changed(); - this.update_pie(selected); - } - } - } + public void reload_all() { + Gtk.TreeIter active; + string id = ""; + if (this.get_selection().get_selected(null, out active)) + this.data.get(active, DataPos.ID, out id); - // updates the entire list, checking for changed cross-references via PieActions - // updates their names and icons if needed - private void update_linked() { - this.data.foreach((model, path, iter) => { - string action_type; - this.data.get(iter, DataPos.ACTION_TYPE, out action_type); - - if (action_type == typeof(PieAction).name()) { - string command; - this.data.get(iter, DataPos.REAL_COMMAND_PIE, out command); - - var referee = PieManager.all_pies[command]; - - if (referee != null) { - this.data.set(iter, DataPos.ICON, referee.icon); - this.data.set(iter, DataPos.NAME, referee.name); - this.data.set(iter, DataPos.ICON_PIXBUF, this.load_icon(referee.icon, this.small_icon)); - this.data.set(iter, DataPos.DISPLAY_COMMAND_PIE, referee.name); - } else { - // referenced Pie does not exist anymore or no is selected; - // select the first one... - Gtk.TreeIter first_pie; - this.pies.get_iter_first(out first_pie); - - string name; - string id; - - this.pies.get(first_pie, PiePos.NAME, out name); - this.pies.get(first_pie, PiePos.ID, out id); - - this.data.set(iter, DataPos.DISPLAY_COMMAND_PIE, name); - this.data.set(iter, DataPos.REAL_COMMAND_PIE, id); - - update_linked(); - } - } else if (action_type == typeof(ActionGroup).name()) { - string command; - this.data.get(iter, DataPos.REAL_COMMAND_GROUP, out command); - - if (command == "") { - // no group is selected, select the first one... - Gtk.TreeIter first_group; - this.groups.get_iter_first(out first_group); - - string name; - string type; - string icon; - - this.groups.get(first_group, GroupPos.NAME, out name); - this.groups.get(first_group, GroupPos.TYPE, out type); - this.groups.get(first_group, GroupPos.ICON, out icon); - - this.data.set(iter, DataPos.DISPLAY_COMMAND_GROUP, name); - this.data.set(iter, DataPos.NAME, name); - this.data.set(iter, DataPos.REAL_COMMAND_GROUP, type); - this.data.set(iter, DataPos.ICON, icon); - } - } - - return false; - }); + data.clear(); + foreach (var pie in PieManager.all_pies.entries) { + this.load_pie(pie.value); + } + + select(id); } - // adds a new, empty pie to the list - private void add_empty_pie() { - var new_one = PieManager.create_persistent_pie(_("New Pie"), "application-default-icon", null); - - Gtk.TreeIter last; - this.pies.append(out last); this.pies.set(last, 0, new_one.name, 1, new_one.id); + ///////////////////////////////////////////////////////////////////// + /// Selects the first Pie. + ///////////////////////////////////////////////////////////////////// - Gtk.TreeIter parent; - this.data.append(out parent, null); - this.data.set(parent, DataPos.IS_QUICKACTION, false, - DataPos.ICON, new_one.icon, - DataPos.NAME, new_one.name, - DataPos.TYPE_ID, "ID: " + new_one.id, - DataPos.ACTION_TYPE, new_one.id, - DataPos.ICON_PIXBUF, this.load_icon(new_one.icon, this.large_icon), - DataPos.FONT_WEIGHT, 800, - DataPos.ICON_NAME_EDITABLE, true, - DataPos.QUICKACTION_VISIBLE, false, - DataPos.QUICKACTION_ACTIVATABLE, false, - DataPos.TYPE_VISIBLE, false, - DataPos.GROUP_VISIBLE, false, - DataPos.APP_VISIBLE, false, - DataPos.KEY_VISIBLE, false, - DataPos.PIE_VISIBLE, false, - DataPos.URI_VISIBLE, false, - DataPos.TRIGGER_VISIBLE, true, - DataPos.DISPLAY_COMMAND_GROUP, "", - DataPos.DISPLAY_COMMAND_APP, "", - DataPos.DISPLAY_COMMAND_KEY, PieManager.get_accelerator_label_of(new_one.id), - DataPos.DISPLAY_COMMAND_PIE, "", - DataPos.DISPLAY_COMMAND_URI, "", - DataPos.REAL_COMMAND_GROUP, "", - DataPos.REAL_COMMAND_PIE, "", - DataPos.REAL_COMMAND_KEY, PieManager.get_accelerator_of(new_one.id)); - + public void select_first() { + Gtk.TreeIter active; - this.get_selection().select_iter(parent); - this.scroll_to_cell(this.data.get_path(parent), null, true, 0.5f, 0.0f); - } - - // adds a new empty slice to the list - private void add_empty_slice() { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - var path = this.data.get_path(selected); - if (path != null) { - if (path.get_depth() == 2) - this.data.iter_parent(out selected, selected); - - this.load_action(selected, new AppAction(_("New Action"), "application-default-icon", "")); - - Gtk.TreeIter new_one; - this.data.iter_nth_child(out new_one, selected, this.data.iter_n_children(selected)-1); - this.expand_to_path(this.data.get_path(new_one)); - this.get_selection().select_iter(new_one); - this.scroll_to_cell(this.data.get_path(new_one), null, true, 0.5f, 0.0f); - - this.update_pie(selected); - } + if(this.data.get_iter_first(out active) ) { + this.get_selection().select_iter(active); + string id = ""; + this.data.get(active, DataPos.ID, out id); + this.on_select(id); } else { - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), Gtk.DialogFlags.MODAL, - Gtk.MessageType.INFO, - Gtk.ButtonsType.CLOSE, - _("You have to select a Pie to add a Slice to!")); - dialog.run(); - dialog.destroy(); + this.on_select(""); } } - // writes the contents of action to the position pointed by slice - private void write_action(Action action, Gtk.TreeIter slice) { - this.data.set(slice, DataPos.IS_QUICKACTION, action.is_quick_action, - DataPos.ICON, action.icon, - DataPos.NAME, action.name, - DataPos.TYPE_ID, ActionRegistry.names[action.get_type()], - DataPos.ACTION_TYPE, action.get_type().name(), - DataPos.ICON_PIXBUF, this.load_icon(action.icon, this.small_icon), - DataPos.FONT_WEIGHT, 400, - DataPos.ICON_NAME_EDITABLE, !(action is PieAction), - DataPos.QUICKACTION_VISIBLE, true, - DataPos.QUICKACTION_ACTIVATABLE, true, - DataPos.TYPE_VISIBLE, true, - DataPos.GROUP_VISIBLE, false, - DataPos.TRIGGER_VISIBLE, false, - DataPos.APP_VISIBLE, action is AppAction, - DataPos.KEY_VISIBLE, action is KeyAction, - DataPos.PIE_VISIBLE, action is PieAction, - DataPos.URI_VISIBLE, action is UriAction, - DataPos.DISPLAY_COMMAND_GROUP, "", - DataPos.DISPLAY_COMMAND_APP, (action is AppAction) ? action.display_command : "", - DataPos.DISPLAY_COMMAND_KEY, (action is KeyAction) ? action.display_command : _("Not bound"), - DataPos.DISPLAY_COMMAND_PIE, (action is PieAction) ? action.display_command : "", - DataPos.DISPLAY_COMMAND_URI, (action is UriAction) ? action.display_command : "", - DataPos.REAL_COMMAND_GROUP, "", - DataPos.REAL_COMMAND_PIE, (action is PieAction) ? action.real_command : "", - DataPos.REAL_COMMAND_KEY, (action is KeyAction) ? action.real_command : ""); - } + ///////////////////////////////////////////////////////////////////// + /// Selects the Pie with the given ID. + ///////////////////////////////////////////////////////////////////// - // deletes the currently selected pie or slice - private void delete_selection() { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - var path = this.data.get_path(selected); - if (path != null) { - if (path.get_depth() == 1) - this.delete_pie(selected); - else - this.delete_slice(selected); - } - } else { - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), Gtk.DialogFlags.MODAL, - Gtk.MessageType.INFO, - Gtk.ButtonsType.CLOSE, - _("You have to select a Pie or a Slice to delete!")); - dialog.run(); - dialog.destroy(); - } - } - - // deletes the given pie - private void delete_pie(Gtk.TreeIter pie) { - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), Gtk.DialogFlags.MODAL, - Gtk.MessageType.QUESTION, - Gtk.ButtonsType.YES_NO, - _("Do you really want to delete the selected Pie with all contained Slices?")); - - dialog.response.connect((response) => { - if (response == Gtk.ResponseType.YES) { - string id; - this.data.get(pie, DataPos.ACTION_TYPE, out id); - this.data.remove(pie); - PieManager.remove_pie(id); - - this.pies.foreach((model, path, iter) => { - string pies_id; - this.pies.get(iter, PiePos.ID, out pies_id); - - if (id == pies_id) { - this.pies.remove(iter); - return true; - } - - return false; - }); - - this.update_linked(); - } - }); - - dialog.run(); - dialog.destroy(); - } - - // deletes the given slice - private void delete_slice(Gtk.TreeIter slice) { - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), Gtk.DialogFlags.MODAL, - Gtk.MessageType.QUESTION, - Gtk.ButtonsType.YES_NO, - _("Do you really want to delete the selected Slice?")); - - dialog.response.connect((response) => { - if (response == Gtk.ResponseType.YES) { - Gtk.TreeIter parent; - this.data.iter_parent(out parent, slice); - this.data.remove(slice); - this.update_pie(parent); + public void select(string id) { + this.data.foreach((model, path, iter) => { + string pie_id; + this.data.get(iter, DataPos.ID, out pie_id); + + if (id == pie_id) { + this.get_selection().select_iter(iter); + return true; } + + return false; }); - - dialog.run(); - dialog.destroy(); } - // loads all pies to the list - private void load() { - foreach (var pie in PieManager.all_pies.entries) { - this.load_pie(pie.value); - } - } + ///////////////////////////////////////////////////////////////////// + /// Loads one given pie to the list. + ///////////////////////////////////////////////////////////////////// - // loads one given pie to the list private void load_pie(Pie pie) { if (pie.id.length == 3) { - Gtk.TreeIter last; - this.pies.append(out last); this.pies.set(last, PiePos.NAME, pie.name, - PiePos.ID, pie.id); - - Gtk.TreeIter parent; - this.data.append(out parent, null); - this.data.set(parent, DataPos.IS_QUICKACTION, false, - DataPos.ICON, pie.icon, - DataPos.NAME, pie.name, - DataPos.TYPE_ID, "ID: " + pie.id, - DataPos.ACTION_TYPE, pie.id, - DataPos.ICON_PIXBUF, this.load_icon(pie.icon, this.large_icon), - DataPos.FONT_WEIGHT, 800, - DataPos.ICON_NAME_EDITABLE, true, - DataPos.QUICKACTION_VISIBLE, false, - DataPos.QUICKACTION_ACTIVATABLE, false, - DataPos.TYPE_VISIBLE, false, - DataPos.GROUP_VISIBLE, false, - DataPos.APP_VISIBLE, false, - DataPos.KEY_VISIBLE, false, - DataPos.PIE_VISIBLE, false, - DataPos.URI_VISIBLE, false, - DataPos.TRIGGER_VISIBLE, true, - DataPos.DISPLAY_COMMAND_GROUP, "", - DataPos.DISPLAY_COMMAND_APP, "", - DataPos.DISPLAY_COMMAND_KEY, PieManager.get_accelerator_label_of(pie.id), - DataPos.DISPLAY_COMMAND_PIE, "", - DataPos.DISPLAY_COMMAND_URI, "", - DataPos.REAL_COMMAND_GROUP, "", - DataPos.REAL_COMMAND_PIE, "", - DataPos.REAL_COMMAND_KEY, PieManager.get_accelerator_of(pie.id)); - - foreach (var group in pie.action_groups) { - this.load_group(parent, group); - } + this.data.append(out last); + var icon = new Icon(pie.icon, 24); + this.data.set(last, DataPos.ICON, icon.to_pixbuf(), + DataPos.ICON_NAME, pie.icon, + DataPos.NAME, pie.name, + DataPos.ID, pie.id); } } - // loads a given group - private void load_group(Gtk.TreeIter parent, ActionGroup group) { - if (group.get_type() == typeof(ActionGroup)) { - foreach (var action in group.actions) { - this.load_action(parent, action); - } - } else { - Gtk.TreeIter child; - this.data.append(out child, parent); - this.data.set(child, DataPos.IS_QUICKACTION, false, - DataPos.ICON, GroupRegistry.icons[group.get_type()], - DataPos.NAME, GroupRegistry.names[group.get_type()], - DataPos.TYPE_ID, _("Slice group"), - DataPos.ACTION_TYPE, typeof(ActionGroup).name(), - DataPos.ICON_PIXBUF, this.load_icon(GroupRegistry.icons[group.get_type()], this.small_icon), - DataPos.FONT_WEIGHT, 400, - DataPos.ICON_NAME_EDITABLE, false, - DataPos.QUICKACTION_VISIBLE, true, - DataPos.QUICKACTION_ACTIVATABLE, false, - DataPos.TYPE_VISIBLE, true, - DataPos.GROUP_VISIBLE, true, - DataPos.APP_VISIBLE, false, - DataPos.KEY_VISIBLE, false, - DataPos.PIE_VISIBLE, false, - DataPos.URI_VISIBLE, false, - DataPos.TRIGGER_VISIBLE, false, - DataPos.DISPLAY_COMMAND_GROUP, GroupRegistry.names[group.get_type()], - DataPos.DISPLAY_COMMAND_APP, "", - DataPos.DISPLAY_COMMAND_KEY, _("Not bound"), - DataPos.DISPLAY_COMMAND_PIE, "", - DataPos.DISPLAY_COMMAND_URI, "", - DataPos.REAL_COMMAND_GROUP, group.get_type().name(), - DataPos.REAL_COMMAND_PIE, "", - DataPos.REAL_COMMAND_KEY, ""); + ///////////////////////////////////////////////////////////////////// + /// Called when a drag which started on this Widget was successfull. + ///////////////////////////////////////////////////////////////////// + + private void on_dnd_source(Gdk.DragContext context, Gtk.SelectionData selection_data, uint info, uint time_) { + if (this.drag_start != null) { + string id = ""; + this.data.get(this.drag_start, DataPos.ID, out id); + selection_data.set_uris({"file://" + Paths.launchers + "/" + id + ".desktop"}); } } - // loads a given slice - private void load_action(Gtk.TreeIter parent, Action action) { - Gtk.TreeIter child; - this.data.append(out child, parent); - this.write_action(action, child); - } + ///////////////////////////////////////////////////////////////////// + /// Called when a drag operation is started on this Widget. + ///////////////////////////////////////////////////////////////////// - // applies all changes done to the given pie - private void update_pie(Gtk.TreeIter slice_or_pie) { - // get pie iter - var path = this.data.get_path(slice_or_pie); - if (path != null) { - var pie = slice_or_pie; - if (path.get_depth() == 2) - this.data.iter_parent(out pie, slice_or_pie); + private void on_start_drag(Gdk.DragContext ctx) { + if (this.get_selection().get_selected(null, out this.drag_start)) { + string icon_name = ""; + this.data.get(this.drag_start, DataPos.ICON_NAME, out icon_name); - // get information on pie - string id; - string icon; - string name; - string hotkey; - - this.data.get(pie, DataPos.ICON, out icon); - this.data.get(pie, DataPos.NAME, out name); - this.data.get(pie, DataPos.ACTION_TYPE, out id); - this.data.get(pie, DataPos.REAL_COMMAND_KEY, out hotkey); - - // remove pie - PieManager.remove_pie(id); - - this.pies.foreach((model, path, iter) => { - string pies_id; - this.pies.get(iter, PiePos.ID, out pies_id); - - if (id == pies_id) { - this.pies.set(iter, PiePos.NAME, name); - return true; - } - - return false; - }); - - // create new pie - var new_pie = PieManager.create_persistent_pie(name, icon, new Trigger.from_string(hotkey), id); - - // add actions accordingly - if (this.data.iter_has_child(pie)) { - Gtk.TreeIter child; - this.data.iter_children(out child, pie); - - do { - // get slice information - string slice_type; - string slice_icon; - string slice_name; - bool is_quick_action; - - this.data.get(child, DataPos.ICON, out slice_icon); - this.data.get(child, DataPos.NAME, out slice_name); - this.data.get(child, DataPos.ACTION_TYPE, out slice_type); - this.data.get(child, DataPos.IS_QUICKACTION, out is_quick_action); - - if (slice_type == typeof(AppAction).name()) { - string slice_command; - this.data.get(child, DataPos.DISPLAY_COMMAND_APP, out slice_command); - var group = new ActionGroup(new_pie.id); - group.add_action(new AppAction(slice_name, slice_icon, slice_command, is_quick_action)); - new_pie.add_group(group); - } else if (slice_type == typeof(KeyAction).name()) { - string slice_command; - this.data.get(child, DataPos.REAL_COMMAND_KEY, out slice_command); - var group = new ActionGroup(new_pie.id); - group.add_action(new KeyAction(slice_name, slice_icon, slice_command, is_quick_action)); - new_pie.add_group(group); - } else if (slice_type == typeof(PieAction).name()) { - string slice_command; - this.data.get(child, DataPos.REAL_COMMAND_PIE, out slice_command); - var group = new ActionGroup(new_pie.id); - group.add_action(new PieAction(slice_command, is_quick_action)); - new_pie.add_group(group); - } else if (slice_type == typeof(UriAction).name()) { - string slice_command; - this.data.get(child, DataPos.DISPLAY_COMMAND_URI, out slice_command); - var group = new ActionGroup(new_pie.id); - group.add_action(new UriAction(slice_name, slice_icon, slice_command, is_quick_action)); - new_pie.add_group(group); - } else if (slice_type == typeof(ActionGroup).name()) { - string slice_command; - this.data.get(child, DataPos.REAL_COMMAND_GROUP, out slice_command); - - var group = GLib.Object.new(GLib.Type.from_name(slice_command), "parent_id", new_pie.id); - new_pie.add_group(group as ActionGroup); - } - - } while (this.data.iter_next(ref child)); - } - } + var icon = new Icon(icon_name, 48); + var pixbuf = icon.to_pixbuf(); + Gtk.drag_set_icon_pixbuf(ctx, pixbuf, icon.size()/2, icon.size()/2); + } } - // creates new action when the list receives a drag'n'drop event - private void on_dnd_received(Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time_) { - string[] uris = selection_data.get_uris(); - + ///////////////////////////////////////////////////////////////////// + /// Called when something is dragged over this Widget. + ///////////////////////////////////////////////////////////////////// + + private bool on_drag_move(Gdk.DragContext context, int x, int y, uint time) { + + Gtk.TreeViewDropPosition position; Gtk.TreePath path; - Gtk.TreeViewDropPosition pos; - // check for valid position - if (!this.get_dest_row_at_pos(x, y, out path, out pos) - || (path.to_string() == "0" && pos == Gtk.TreeViewDropPosition.BEFORE)) { - - warning("Failed to insert Slice: Invalid location!"); - return; - } - - // get position to insert (when child: after, when parent: as first child) - Gtk.TreeIter parent; - int insert_pos = 0; - if (path.get_depth() == 1) { - if (pos == Gtk.TreeViewDropPosition.BEFORE) { - path.prev(); - this.data.get_iter(out parent, path); - insert_pos = this.data.iter_n_children(parent); - } else { - this.data.get_iter(out parent, path); - } - } else { - if (pos == Gtk.TreeViewDropPosition.BEFORE) { - insert_pos = path.get_indices()[1]; - } else { - insert_pos = path.get_indices()[1]+1; - } - - path.up(); - this.data.get_iter(out parent, path); - } + if (!this.get_dest_row_at_pos(x, y, out path, out position)) + return false; - foreach (var uri in uris) { - Gtk.TreeIter new_child; - this.data.insert(out new_child, parent, insert_pos); - this.write_action(ActionRegistry.new_for_uri(uri), new_child); - } + if (position == Gtk.TreeViewDropPosition.BEFORE) + this.set_drag_dest_row(path, Gtk.TreeViewDropPosition.INTO_OR_BEFORE); + else if (position == Gtk.TreeViewDropPosition.AFTER) + this.set_drag_dest_row(path, Gtk.TreeViewDropPosition.INTO_OR_AFTER); + + Gdk.drag_status(context, context.get_suggested_action(), time); - this.update_pie(parent); - } - - private void on_dnd_source(Gdk.DragContext context, Gtk.SelectionData selection_data, uint info, uint time_) { - Gtk.TreeIter selected; - if (this.get_selection().get_selected(null, out selected)) { - string id = ""; - this.data.get(selected, DataPos.ACTION_TYPE, out id); - selection_data.set_uris({"file://" + Paths.launchers + "/" + id + ".desktop"}); - } - } - - private Gdk.Pixbuf load_icon(string name, int size) { - Gdk.Pixbuf pixbuf = null; + // avoid too frequent selection... + this.last_hover = time; - try { - if (name.contains("/")) - pixbuf = new Gdk.Pixbuf.from_file_at_size(name, size, size); - else - pixbuf = new Gdk.Pixbuf.from_file_at_size(Icon.get_icon_file(name, size), size, size); - } catch (GLib.Error e) { - warning(e.message); - } + GLib.Timeout.add(150, () => { + if (this.last_hover == time) + this.get_selection().select_path(path); + return false; + }); - return pixbuf; + return true; } } diff --git a/src/gui/piePreview.vala b/src/gui/piePreview.vala new file mode 100644 index 0000000..5745fcb --- /dev/null +++ b/src/gui/piePreview.vala @@ -0,0 +1,369 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A custom widget displaying the preview of a Pie. It can be used to +/// configure the displayed Pie in various aspects. +///////////////////////////////////////////////////////////////////////// + +class PiePreview : Gtk.DrawingArea { + + ///////////////////////////////////////////////////////////////////// + /// These get called when the last Slice is removed and when the + /// first Slice is added respectively. + ///////////////////////////////////////////////////////////////////// + + public signal void on_last_slice_removed(); + public signal void on_first_slice_added(); + + ///////////////////////////////////////////////////////////////////// + /// The internally used renderer to draw the Pie. + ///////////////////////////////////////////////////////////////////// + + private PiePreviewRenderer renderer = null; + + ///////////////////////////////////////////////////////////////////// + /// The window which pops up, when a Slice is added or edited. + ///////////////////////////////////////////////////////////////////// + + private NewSliceWindow? new_slice_window = null; + + ///////////////////////////////////////////////////////////////////// + /// A timer used for calculating the frame time. + ///////////////////////////////////////////////////////////////////// + + private GLib.Timer timer; + + ///////////////////////////////////////////////////////////////////// + /// True, when it is possible to drag a slice from this widget. + /// False, when the user currently hovers over the add sign. + ///////////////////////////////////////////////////////////////////// + + private bool drag_enabled = false; + + ///////////////////////////////////////////////////////////////////// + /// The ID of the currently displayed Pie. + ///////////////////////////////////////////////////////////////////// + + private string current_id = ""; + + ///////////////////////////////////////////////////////////////////// + /// The position from where a Slice-drag started. + ///////////////////////////////////////////////////////////////////// + + private int drag_start_index = -1; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, creates the widget. + ///////////////////////////////////////////////////////////////////// + + public PiePreview() { + this.renderer = new PiePreviewRenderer(); + + #if HAVE_GTK_3 + this.draw.connect(this.on_draw); + #else + this.expose_event.connect(this.on_draw); + #endif + + this.timer = new GLib.Timer(); + this.set_events(Gdk.EventMask.POINTER_MOTION_MASK + | Gdk.EventMask.LEAVE_NOTIFY_MASK + | Gdk.EventMask.ENTER_NOTIFY_MASK); + + // setup drag and drop + this.enable_drag_source(); + + Gtk.TargetEntry uri_dest = {"text/uri-list", 0, 0}; + Gtk.TargetEntry slice_dest = {"text/plain", Gtk.TargetFlags.SAME_WIDGET, 0}; + Gtk.TargetEntry[] destinations = { uri_dest, slice_dest }; + Gtk.drag_dest_set(this, Gtk.DestDefaults.ALL, destinations, Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK); + + this.drag_begin.connect(this.on_start_drag); + this.drag_end.connect(this.on_end_drag); + this.drag_data_received.connect(this.on_dnd_received); + + // connect mouse events + this.drag_motion.connect(this.on_drag_move); + this.leave_notify_event.connect(this.on_mouse_leave); + this.enter_notify_event.connect(this.on_mouse_enter); + this.motion_notify_event.connect_after(this.on_mouse_move); + this.button_release_event.connect_after(this.on_button_release); + this.button_press_event.connect_after(this.on_button_press); + + this.new_slice_window = new NewSliceWindow(); + this.new_slice_window.on_select.connect((new_action, as_new_slice, at_position) => { + var pie = PieManager.all_pies[this.current_id]; + + if (new_action.has_quickaction()) + renderer.disable_quickactions(); + + if (as_new_slice) { + pie.add_group(new_action, at_position+1); + this.renderer.add_group(new_action, at_position+1); + + if (this.renderer.slice_count() == 1) + this.on_first_slice_added(); + } else { + pie.update_group(new_action, at_position); + this.renderer.update_group(new_action, at_position); + } + }); + + this.renderer.on_edit_slice.connect((pos) => { + this.new_slice_window.reload(); + + this.new_slice_window.set_parent(this.get_toplevel() as Gtk.Window); + this.new_slice_window.show(); + + var pie = PieManager.all_pies[this.current_id]; + this.new_slice_window.set_action(pie.action_groups[pos], pos); + }); + + this.renderer.on_add_slice.connect((pos) => { + this.new_slice_window.reload(); + + this.new_slice_window.set_parent(this.get_toplevel() as Gtk.Window); + this.new_slice_window.show(); + + this.new_slice_window.set_default(this.current_id, pos); + }); + + this.renderer.on_remove_slice.connect((pos) => { + + var dialog = new Gtk.MessageDialog(this.get_toplevel() as Gtk.Window, Gtk.DialogFlags.MODAL, + Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, + _("Do you really want to delete this Slice?")); + + dialog.response.connect((response) => { + if (response == Gtk.ResponseType.YES) { + var pie = PieManager.all_pies[this.current_id]; + + pie.remove_group(pos); + this.renderer.remove_group(pos); + + if (this.renderer.slice_count() == 0) + this.on_last_slice_removed(); + } + }); + + dialog.run(); + dialog.destroy(); + }); + } + + ///////////////////////////////////////////////////////////////////// + /// Sets the currently displayed Pie to the Pie with the given ID. + ///////////////////////////////////////////////////////////////////// + + public void set_pie(string id) { + this.current_id = id; + this.modify_bg(Gtk.StateType.NORMAL, Gtk.rc_get_style(this).light[0]); + this.renderer.load_pie(PieManager.all_pies[id]); + } + + ///////////////////////////////////////////////////////////////////// + /// Begins the draw loop. It automatically ends, when the containing + /// window becomes invisible. + ///////////////////////////////////////////////////////////////////// + + public void draw_loop() { + this.timer.start(); + this.queue_draw(); + + GLib.Timeout.add((uint)(1000.0/Config.global.refresh_rate), () => { + this.queue_draw(); + return this.get_toplevel().visible; + }); + } + + ///////////////////////////////////////////////////////////////////// + /// Called every frame. + ///////////////////////////////////////////////////////////////////// + + #if HAVE_GTK_3 + private bool on_draw(Cairo.Context ctx) { + #else + private bool on_draw(Gtk.Widget da, Gdk.EventExpose event) { + var ctx = Gdk.cairo_create(this.get_window()); + #endif + // store the frame time + double frame_time = this.timer.elapsed(); + this.timer.reset(); + + Gtk.Allocation allocation; + this.get_allocation(out allocation); + ctx.translate((int)(allocation.width*0.5), (int)(allocation.height*0.5)); + + this.renderer.draw(frame_time, ctx); + + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse leaves the area of this widget. + ///////////////////////////////////////////////////////////////////// + + public bool on_mouse_leave(Gdk.EventCrossing event) { + this.renderer.on_mouse_leave(); + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse enters the area of this widget. + ///////////////////////////////////////////////////////////////////// + + public bool on_mouse_enter(Gdk.EventCrossing event) { + this.renderer.on_mouse_enter(); + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse moves in the area of this widget. + ///////////////////////////////////////////////////////////////////// + + private bool on_mouse_move(Gdk.EventMotion event) { + this.renderer.set_dnd_mode(false); + Gtk.Allocation allocation; + this.get_allocation(out allocation); + this.renderer.on_mouse_move(event.x-allocation.width*0.5, event.y-allocation.height*0.5); + + if (this.renderer.get_active_slice() < 0) this.disable_drag_source(); + else this.enable_drag_source(); + + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a mouse button is pressed. + ///////////////////////////////////////////////////////////////////// + + private bool on_button_press() { + this.renderer.on_button_press(); + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a mouse button is released. + ///////////////////////////////////////////////////////////////////// + + private bool on_button_release() { + if (!this.renderer.drag_n_drop_mode) + this.renderer.on_button_release(); + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse is moved over this widget. + ///////////////////////////////////////////////////////////////////// + + private bool on_drag_move(Gdk.DragContext ctx, int x, int y, uint time) { + this.renderer.set_dnd_mode(true); + Gtk.Allocation allocation; + this.get_allocation(out allocation); + this.renderer.on_mouse_move(x-allocation.width*0.5, y-allocation.height*0.5); + return true; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user tries to drag something from this widget. + ///////////////////////////////////////////////////////////////////// + + private void on_start_drag(Gdk.DragContext ctx) { + this.drag_start_index = this.renderer.get_active_slice(); + var icon = this.renderer.get_active_icon(); + var pixbuf = icon.to_pixbuf(); + + this.renderer.hide_group(this.drag_start_index); + Gtk.drag_set_icon_pixbuf(ctx, pixbuf, icon.size()/2, icon.size()/2); + + this.renderer.set_dnd_mode(true); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user finishes a drag operation on this widget. + /// Only used for Slice-movement. + ///////////////////////////////////////////////////////////////////// + + private void on_end_drag(Gdk.DragContext context) { + + if (context.list_targets() != null) { + + int target_index = this.renderer.get_active_slice(); + this.renderer.set_dnd_mode(false); + + context.list_targets().foreach((target) => { + Gdk.Atom target_type = (Gdk.Atom)target; + if (target_type.name() == "text/plain") { + var pie = PieManager.all_pies[this.current_id]; + pie.move_group(this.drag_start_index, target_index); + this.renderer.show_hidden_group_at(target_index); + } + }); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user finishes a drag operation on this widget. + /// Only used for external drags. + ///////////////////////////////////////////////////////////////////// + + private void on_dnd_received(Gdk.DragContext context, int x, int y, + Gtk.SelectionData selection_data, uint info, uint time_) { + + var pie = PieManager.all_pies[this.current_id]; + int position = this.renderer.get_active_slice(); + this.renderer.set_dnd_mode(false); + + foreach (var uri in selection_data.get_uris()) { + pie.add_action(ActionRegistry.new_for_uri(uri), position); + this.renderer.add_group(pie.action_groups[position], position); + + if (this.renderer.slices.size == 1) + this.on_first_slice_added(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Enables this widget to be a source for drag operations. + ///////////////////////////////////////////////////////////////////// + + private void enable_drag_source() { + if (!this.drag_enabled) { + this.drag_enabled = true; + Gtk.TargetEntry slice_source = {"text/plain", Gtk.TargetFlags.SAME_WIDGET | Gtk.TargetFlags.SAME_APP, 0}; + Gtk.TargetEntry[] sources = { slice_source }; + Gtk.drag_source_set(this, Gdk.ModifierType.BUTTON1_MASK, sources, Gdk.DragAction.MOVE); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Disables this widget to be a source for drag operations. + ///////////////////////////////////////////////////////////////////// + + private void disable_drag_source() { + if (this.drag_enabled) { + this.drag_enabled = false; + Gtk.drag_source_unset(this); + } + } + +} + +} diff --git a/src/gui/piePreviewAddSign.vala b/src/gui/piePreviewAddSign.vala new file mode 100644 index 0000000..ee8c14b --- /dev/null +++ b/src/gui/piePreviewAddSign.vala @@ -0,0 +1,220 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +using GLib.Math; + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A liitle plus-sign displayed on the preview widget to indicate where +/// the user may add a new Slice. +///////////////////////////////////////////////////////////////////////// + +public class PiePreviewAddSign : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// Gets emitted, when the users clicks on this object. + ///////////////////////////////////////////////////////////////////// + + public signal void on_clicked(int position); + + ///////////////////////////////////////////////////////////////////// + /// The image used to display this oject. + ///////////////////////////////////////////////////////////////////// + + public Image icon { get; private set; } + + ///////////////////////////////////////////////////////////////////// + /// True, when the add sign is currently visible. + ///////////////////////////////////////////////////////////////////// + + public bool visible { get; private set; default=false; } + + ///////////////////////////////////////////////////////////////////// + /// The position of the sign in its parent Pie. May be 2.5 for + /// example. + ///////////////////////////////////////////////////////////////////// + + private double position = 0; + + ///////////////////////////////////////////////////////////////////// + /// The parent renderer. + ///////////////////////////////////////////////////////////////////// + + private unowned PiePreviewRenderer parent; + + ///////////////////////////////////////////////////////////////////// + /// Some values used for displaying this sign. + ///////////////////////////////////////////////////////////////////// + + private double time = 0; + private double max_size = 0; + private double angle = 0; + private AnimatedValue size; + private AnimatedValue alpha; + private AnimatedValue activity; + private AnimatedValue clicked; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, sets everything up. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewAddSign(PiePreviewRenderer parent) { + this.parent = parent; + + this.size = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 2.0); + this.alpha = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 0.0); + this.activity = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, -3, -3, 0, 0.0); + this.clicked = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 1, 1, 0, 0.0); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads the desired icon for this sign. + ///////////////////////////////////////////////////////////////////// + + public void load() { + this.icon = new Icon("add", 36); + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the position where this object should be displayed. + ///////////////////////////////////////////////////////////////////// + + public void set_position(int position) { + double new_position = position; + + if (!this.parent.drag_n_drop_mode) + new_position += 0.5; + + this.position = new_position; + this.angle = 2.0 * PI * new_position/parent.slice_count(); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes this object visible. + ///////////////////////////////////////////////////////////////////// + + public void show() { + this.visible = true; + this.size.reset_target(this.max_size, 0.3); + this.alpha.reset_target(1.0, 0.3); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes this object invisible. + ///////////////////////////////////////////////////////////////////// + + public void hide() { + this.visible = false; + this.size.reset_target(0.0, 0.3); + this.alpha.reset_target(0.0, 0.3); + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the size of this object. All transitions will be smooth. + ///////////////////////////////////////////////////////////////////// + + public void set_size(double size) { + this.max_size = size; + this.size.reset_target(size, 0.5); + } + + ///////////////////////////////////////////////////////////////////// + /// Draws the sign to the given context. + ///////////////////////////////////////////////////////////////////// + + public void draw(double frame_time, Cairo.Context ctx) { + + this.time += frame_time; + + this.size.update(frame_time); + this.alpha.update(frame_time); + this.activity.update(frame_time); + this.clicked.update(frame_time); + + if (this.parent.slice_count() == 0) { + ctx.save(); + + double scale = this.clicked.val + + GLib.Math.sin(this.time*10)*0.02*this.alpha.val + + this.alpha.val*0.08 - 0.1; + ctx.scale(scale, scale); + + // paint the image + icon.paint_on(ctx); + + ctx.restore(); + + } else if (this.alpha.val*this.activity.val > 0) { + ctx.save(); + + // distance from the center + double radius = 120; + + // transform the context + ctx.translate(cos(this.angle)*radius, sin(this.angle)*radius); + double scale = this.size.val*this.clicked.val + + this.activity.val*0.07 + + GLib.Math.sin(this.time*10)*0.03*this.activity.val + - 0.1; + ctx.scale(scale, scale); + + // paint the image + icon.paint_on(ctx, this.alpha.val*this.activity.val); + + ctx.restore(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse moves to another position. + ///////////////////////////////////////////////////////////////////// + + public void on_mouse_move(double angle) { + double direction = 2.0 * PI * position/parent.slice_count(); + double diff = fabs(angle-direction); + + if (diff > PI) + diff = 2 * PI - diff; + + if (diff < 0.5*PI/parent.slice_count()) this.activity.reset_target(1.0, 1.0); + else this.activity.reset_target(-3.0, 1.5); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is pressed. + ///////////////////////////////////////////////////////////////////// + + public void on_button_press(double x, double y) { + if (this.activity.end == 1.0) { + this.clicked.reset_target(0.9, 0.1); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is released. + ///////////////////////////////////////////////////////////////////// + + public void on_button_release(double x, double y) { + if (this.clicked.end == 0.9) { + this.clicked.reset_target(1.0, 0.1); + this.on_clicked((int)this.position); + } + } +} + +} diff --git a/src/gui/piePreviewCenter.vala b/src/gui/piePreviewCenter.vala new file mode 100644 index 0000000..21bbd78 --- /dev/null +++ b/src/gui/piePreviewCenter.vala @@ -0,0 +1,108 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +using GLib.Math; + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// +///////////////////////////////////////////////////////////////////////// + +public class PiePreviewCenter : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// THe Images displayed. When the displayed text changes the + /// currently displayed text becomes the old_text. So it's possible + /// to create a smooth transitions. + ///////////////////////////////////////////////////////////////////// + + private RenderedText text = null; + private RenderedText old_text = null; + + ///////////////////////////////////////////////////////////////////// + /// Stores the currently displayed text in order to avoid frequent + /// and useless updates. + ///////////////////////////////////////////////////////////////////// + + private string current_text = null; + + ///////////////////////////////////////////////////////////////////// + /// An AnimatedValue for smooth transitions. + ///////////////////////////////////////////////////////////////////// + + private AnimatedValue blend; + + ///////////////////////////////////////////////////////////////////// + /// The parent renderer. + ///////////////////////////////////////////////////////////////////// + + private unowned PiePreviewRenderer parent; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, sets everything up. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewCenter(PiePreviewRenderer parent) { + this.parent = parent; + this.blend = new AnimatedValue.linear(0, 0, 0); + + this.text = new RenderedText("", 1, 1, "", new Color(), 1.0); + this.old_text = text; + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the currently displayed text. It will be smoothly + /// blended and may contain pango markup. + ///////////////////////////////////////////////////////////////////// + + public void set_text(string text) { + if (text != this.current_text) { + + var style = new Gtk.Style(); + + this.old_text = this.text; + this.text = new RenderedText.with_markup(text, 180, 180, style.font_desc.get_family()+" 10", + new Color.from_gdk(style.fg[0]), 1.0); + this.current_text = text; + + this.blend.reset_target(0.0, 0.0); + this.blend.reset_target(1.0, 0.1); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Draws the center to the given context. + ///////////////////////////////////////////////////////////////////// + + public void draw(double frame_time, Cairo.Context ctx) { + + this.blend.update(frame_time); + + ctx.save(); + + if (this.parent.slice_count() == 0) + ctx.translate(0, 40); + + this.old_text.paint_on(ctx, 1-this.blend.val); + this.text.paint_on(ctx, this.blend.val); + + ctx.restore(); + } +} + +} diff --git a/src/gui/piePreviewDeleteSign.vala b/src/gui/piePreviewDeleteSign.vala new file mode 100644 index 0000000..2ff3321 --- /dev/null +++ b/src/gui/piePreviewDeleteSign.vala @@ -0,0 +1,195 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +using GLib.Math; + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// The delete sign, displayed in the upper right corner of each +/// Slice. +///////////////////////////////////////////////////////////////////////// + +public class PiePreviewDeleteSign : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// Called when the user clicked on this sign. + ///////////////////////////////////////////////////////////////////// + + public signal void on_clicked(); + + ///////////////////////////////////////////////////////////////////// + /// The image used to display this oject. + ///////////////////////////////////////////////////////////////////// + + public Image icon { get; private set; } + + ///////////////////////////////////////////////////////////////////// + /// Some constants determining the look and behaviour of this Slice. + ///////////////////////////////////////////////////////////////////// + + private const int radius = 18; + private const double globale_scale = 0.8; + private const double click_cancel_treshold = 5; + + ///////////////////////////////////////////////////////////////////// + /// True, when the add sign is currently visible. + ///////////////////////////////////////////////////////////////////// + + private bool visible = false; + + ///////////////////////////////////////////////////////////////////// + /// Some AnimatedValues for smooth transitions. + ///////////////////////////////////////////////////////////////////// + + private AnimatedValue size; + private AnimatedValue alpha; + private AnimatedValue activity; + private AnimatedValue clicked; + + ///////////////////////////////////////////////////////////////////// + /// Storing the position where a mouse click was executed. Useful for + /// canceling the click when the mouse moves some pixels. + ///////////////////////////////////////////////////////////////////// + + private double clicked_x = 0.0; + private double clicked_y = 0.0; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, sets everything up. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewDeleteSign() { + this.size = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 2.0); + this.alpha = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 0.0); + this.activity = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, -3, -3, 0, 0.0); + this.clicked = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 1, 1, 0, 0.0); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads an Action. All members are initialized accordingly. + ///////////////////////////////////////////////////////////////////// + + public void load() { + this.icon = new Icon("stock_delete", radius*2); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes this object visible. + ///////////////////////////////////////////////////////////////////// + + public void show() { + if (!this.visible) { + this.visible = true; + this.alpha.reset_target(1.0, 0.3); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Makes this object invisible. + ///////////////////////////////////////////////////////////////////// + + public void hide() { + if (this.visible) { + this.visible = false; + this.alpha.reset_target(0.0, 0.3); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the size of this object. All transitions will be smooth. + ///////////////////////////////////////////////////////////////////// + + public void set_size(double size) { + this.size.reset_target(size, 0.2); + } + + ///////////////////////////////////////////////////////////////////// + /// Draws the sign to the given context. + ///////////////////////////////////////////////////////////////////// + + public void draw(double frame_time, Cairo.Context ctx) { + this.size.update(frame_time); + this.alpha.update(frame_time); + this.activity.update(frame_time); + this.clicked.update(frame_time); + + if (this.alpha.val > 0) { + ctx.save(); + + // transform the context + double scale = (this.size.val*this.clicked.val + + this.activity.val*0.2 - 0.2)*globale_scale; + ctx.scale(scale, scale); + + // paint the image + icon.paint_on(ctx, this.alpha.val); + + ctx.restore(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse moves to another position. + ///////////////////////////////////////////////////////////////////// + + public bool on_mouse_move(double x, double y) { + if (this.clicked.end == 0.9) { + double dist = GLib.Math.pow(x-this.clicked_x, 2) + GLib.Math.pow(y-this.clicked_y, 2); + if (dist > this.click_cancel_treshold*this.click_cancel_treshold) + this.clicked.reset_target(1.0, 0.1); + } + + if (GLib.Math.fabs(x) <= radius*globale_scale && GLib.Math.fabs(y) <= radius*globale_scale) { + this.activity.reset_target(1.0, 0.2); + return true; + } + + this.activity.reset_target(0.0, 0.2); + return false; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is pressed. + ///////////////////////////////////////////////////////////////////// + + public bool on_button_press(double x, double y) { + if (this.activity.end == 1.0) { + this.clicked.reset_target(0.9, 0.1); + this.clicked_x = x; + this.clicked_y = y; + return true; + } + return false; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is released. + ///////////////////////////////////////////////////////////////////// + + public bool on_button_release(double x, double y) { + if (this.clicked.end == 0.9) { + this.clicked.reset_target(1.0, 0.1); + this.on_clicked(); + + return true; + } + return false; + } +} + +} diff --git a/src/gui/piePreviewRenderer.vala b/src/gui/piePreviewRenderer.vala new file mode 100644 index 0000000..1cf83ff --- /dev/null +++ b/src/gui/piePreviewRenderer.vala @@ -0,0 +1,436 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +using GLib.Math; + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A complex class which is able to draw the preview of a Pie. It can +/// manipulate the displayed Pie as well. +///////////////////////////////////////////////////////////////////////// + +public class PiePreviewRenderer : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// These signals get emitted when a slice is added, removed or + /// manipulated. + ///////////////////////////////////////////////////////////////////// + + public signal void on_add_slice(int position); + public signal void on_remove_slice(int position); + public signal void on_edit_slice(int position); + + ///////////////////////////////////////////////////////////////////// + /// True, when there is currently a drag going on. + ///////////////////////////////////////////////////////////////////// + + public bool drag_n_drop_mode { get; private set; default=false; } + + ///////////////////////////////////////////////////////////////////// + /// A list containing all SliceRenderers of this Pie. + ///////////////////////////////////////////////////////////////////// + + public Gee.ArrayList slices; + + ///////////////////////////////////////////////////////////////////// + /// When a Slice is moved within a Pie it is temporarily removed. + /// If so, it is stored in this member. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewSliceRenderer hidden_group { get; private set; default=null; } + + ///////////////////////////////////////////////////////////////////// + /// The add sign which indicates that a new Slice could be added. + ///////////////////////////////////////////////////////////////////// + + private PiePreviewAddSign add_sign = null; + + ///////////////////////////////////////////////////////////////////// + /// The object which renders the name of the currently selected Slice + /// in the middle. + ///////////////////////////////////////////////////////////////////// + + private PiePreviewCenter center_renderer = null; + private enum CenterDisplay { NONE, ACTIVE_SLICE, DROP, ADD, DELETE } + + ///////////////////////////////////////////////////////////////////// + /// Some members storing some inter-frame-information. + ///////////////////////////////////////////////////////////////////// + + private int active_slice = -1; + private double angle = 0.0; + private double mouse_x = 0.0; + private double mouse_y = 0.0; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, initializes members. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewRenderer() { + this.slices = new Gee.ArrayList(); + this.center_renderer = new PiePreviewCenter(this); + this.add_sign = new PiePreviewAddSign(this); + this.add_sign.load(); + + this.add_sign.on_clicked.connect((pos) => { + this.on_add_slice(pos); + }); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads an Pie. All members are initialized accordingly. + ///////////////////////////////////////////////////////////////////// + + public void load_pie(Pie pie) { + this.slices.clear(); + + foreach (var group in pie.action_groups) { + var renderer = new PiePreviewSliceRenderer(this); + renderer.load(group); + + this.add_slice_renderer(renderer); + this.connect_siganls(renderer); + } + + this.active_slice = -1; + this.update_sizes(); + this.update_positions(false); + } + + ///////////////////////////////////////////////////////////////////// + /// Enables or disables the drag n dropn mode. + ///////////////////////////////////////////////////////////////////// + + public void set_dnd_mode(bool dnd) { + if (this.drag_n_drop_mode != dnd) { + this.drag_n_drop_mode = dnd; + this.update_positions(); + this.update_sizes(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Returns the number of Slices. + ///////////////////////////////////////////////////////////////////// + + public int slice_count() { + if (this.drag_n_drop_mode && !(this.slices.size == 0)) + return slices.size+1; + + return slices.size; + } + + ///////////////////////////////////////////////////////////////////// + /// Returns the index of the currently hovered Slice. + ///////////////////////////////////////////////////////////////////// + + public int get_active_slice() { + if (this.slices.size == 0) + return 0; + + if (this.drag_n_drop_mode) + return (int)(this.angle/(2*PI)*this.slice_count() + 0.5) % this.slice_count(); + + return this.active_slice; + } + + ///////////////////////////////////////////////////////////////////// + /// Returns the Icon of the currently hovered Slice. + ///////////////////////////////////////////////////////////////////// + + public Icon get_active_icon() { + if (this.active_slice >= 0 && this.active_slice < this.slices.size) + return this.slices[this.active_slice].icon; + else + return new Icon("", 24); + } + + ///////////////////////////////////////////////////////////////////// + /// Draws the entire Pie to the given context. + ///////////////////////////////////////////////////////////////////// + + public void draw(double frame_time, Cairo.Context ctx) { + this.add_sign.draw(frame_time, ctx); + this.center_renderer.draw(frame_time, ctx); + + foreach (var slice in this.slices) + slice.draw(frame_time, ctx); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse leaves the drawing area of this renderer. + ///////////////////////////////////////////////////////////////////// + + public void on_mouse_leave() { + this.add_sign.hide(); + this.update_positions(); + this.update_center(CenterDisplay.NONE); + + foreach (var slice in this.slices) + slice.on_mouse_leave(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse enters the drawing area of this renderer. + ///////////////////////////////////////////////////////////////////// + + public void on_mouse_enter() { + this.add_sign.show(); + this.update_positions(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse moves in the drawing area of this renderer. + ///////////////////////////////////////////////////////////////////// + + public void on_mouse_move(double x, double y) { + this.mouse_x = x; + this.mouse_y = y; + + this.angle = acos(x/sqrt(x*x + y*y)); + if (y < 0) this.angle = 2*PI - this.angle; + + if (!this.drag_n_drop_mode) + this.active_slice = -1; + + bool delete_hovered = false; + + for (int i=0; i index) { + this.slices.remove_at(index); + this.update_positions(); + this.update_sizes(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Hides the Slice at the given position temporarily. + ///////////////////////////////////////////////////////////////////// + + public void hide_group(int index) { + if (this.slices.size > index) { + this.hidden_group = this.slices[index]; + this.remove_group(index); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Re-shows a Slice which has been hidden before. + ///////////////////////////////////////////////////////////////////// + + public void show_hidden_group_at(int index) { + if (this.slices.size >= index && this.hidden_group != null) { + this.hidden_group.set_position(index, false); + this.add_slice_renderer(this.hidden_group, index); + this.hidden_group = null; + } + } + + ///////////////////////////////////////////////////////////////////// + /// Updates a Slice at the given position. + ///////////////////////////////////////////////////////////////////// + + public void update_group(ActionGroup group, int index) { + if (this.slices.size > index) { + var renderer = new PiePreviewSliceRenderer(this); + this.slices.set(index, renderer); + renderer.load(group); + + this.connect_siganls(renderer); + + this.update_positions(false); + this.update_sizes(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Disables all quickactions of this pie preview. + ///////////////////////////////////////////////////////////////////// + + public void disable_quickactions() { + foreach (var slice in this.slices) + slice.disable_quickactions(); + } + + ///////////////////////////////////////////////////////////////////// + /// Helper method which adds a new Slice to the given position. + ///////////////////////////////////////////////////////////////////// + + private void add_slice_renderer(PiePreviewSliceRenderer renderer, int at_position = -1) { + if (at_position < 0 || at_position >= this.slices.size) + this.slices.add(renderer); + else + this.slices.insert(at_position, renderer); + + this.update_positions(false); + this.update_sizes(); + } + + ///////////////////////////////////////////////////////////////////// + /// Helper method which connects all neccessary signals of a newly + /// added Slice. + ///////////////////////////////////////////////////////////////////// + + private void connect_siganls(PiePreviewSliceRenderer renderer) { + renderer.on_clicked.connect((pos) => { + this.on_edit_slice(pos); + }); + + renderer.on_remove.connect((pos) => { + this.on_remove_slice(pos); + }); + } + + ///////////////////////////////////////////////////////////////////// + /// Moves all slices to their positions. This may happen smoothly if + /// desired. + ///////////////////////////////////////////////////////////////////// + + private void update_positions(bool smoothly = true) { + if (this.slices.size > 0) { + if (this.add_sign.visible) { + int add_position = 0; + add_position = (int)(this.angle/(2*PI)*this.slice_count()) % this.slice_count(); + this.add_sign.set_position(add_position); + + for (int i=0; i= add_position ? i+1 : i, smoothly); + } + + this.update_center(CenterDisplay.DROP); + + } else { + for (int i=0; i 20) size = 0.5; + else if (this.slice_count() > 8) size = 1.0 - (double)(this.slice_count() - 8)/24.0; + + this.add_sign.set_size(size); + + for (int i=0; i= 0 && this.active_slice < this.slices.size) + this.center_renderer.set_text("" + slices[this.active_slice].name + "\n" + + _("Click to edit") + "\n" + _("Drag to move") + ""); + break; + case CenterDisplay.ADD: + this.center_renderer.set_text("" + _("Click to add a new Slice") + ""); + break; + case CenterDisplay.DROP: + if (hidden_group == null) + this.center_renderer.set_text("" + _("Drop to add as new Slice") + ""); + else + this.center_renderer.set_text("" + this.hidden_group.name + "\n" + + _("Drop to move Slice") + ""); + break; + case CenterDisplay.DELETE: + if (this.active_slice >= 0 && this.active_slice < this.slices.size) + this.center_renderer.set_text("" + slices[this.active_slice].name + "\n" + + _("Click to delete") + "\n" + _("Drag to move") + ""); + break; + default: + this.center_renderer.set_text(""); + break; + } + } +} + +} diff --git a/src/gui/piePreviewSliceRenderer.vala b/src/gui/piePreviewSliceRenderer.vala new file mode 100644 index 0000000..af39c1f --- /dev/null +++ b/src/gui/piePreviewSliceRenderer.vala @@ -0,0 +1,276 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +using GLib.Math; + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// Displays the preview of a Slice. +///////////////////////////////////////////////////////////////////////// + +public class PiePreviewSliceRenderer : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// Called when the user clicked on this Slice. + ///////////////////////////////////////////////////////////////////// + + public signal void on_clicked(int position); + + ///////////////////////////////////////////////////////////////////// + /// Called when the user clicked on the delete sign. + ///////////////////////////////////////////////////////////////////// + + public signal void on_remove(int position); + + ///////////////////////////////////////////////////////////////////// + /// The image used to display this oject. + ///////////////////////////////////////////////////////////////////// + + public Icon icon { get; private set; } + public ActionGroup action_group { get; private set; } + public string name { get; private set; default=""; } + public bool delete_hovered { get; private set; default=false; } + + ///////////////////////////////////////////////////////////////////// + /// The parent renderer. + ///////////////////////////////////////////////////////////////////// + + private unowned PiePreviewRenderer parent; + + ///////////////////////////////////////////////////////////////////// + /// The delete sign, displayed in the upper right corner of each + /// Slice. + ///////////////////////////////////////////////////////////////////// + + private PiePreviewDeleteSign delete_sign = null; + + ///////////////////////////////////////////////////////////////////// + /// Some AnimatedValues for smooth transitions. + ///////////////////////////////////////////////////////////////////// + + private AnimatedValue angle; + private AnimatedValue size; + private AnimatedValue activity; + private AnimatedValue clicked; + + ///////////////////////////////////////////////////////////////////// + /// Some constants determining the look and behaviour of this Slice. + ///////////////////////////////////////////////////////////////////// + + private const double pie_radius = 126; + private const double radius = 24; + private const double delete_x = 13; + private const double delete_y = -13; + private const double click_cancel_treshold = 5; + + ///////////////////////////////////////////////////////////////////// + /// Storing the position where a mouse click was executed. Useful for + /// canceling the click when the mouse moves some pixels. + ///////////////////////////////////////////////////////////////////// + + private double clicked_x = 0.0; + private double clicked_y = 0.0; + + ///////////////////////////////////////////////////////////////////// + /// The index of this slice in a pie. Clockwise assigned, starting + /// from the right-most slice. + ///////////////////////////////////////////////////////////////////// + + private int position; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, sets everything up. + ///////////////////////////////////////////////////////////////////// + + public PiePreviewSliceRenderer(PiePreviewRenderer parent) { + this.delete_sign = new PiePreviewDeleteSign(); + this.delete_sign.load(); + this.delete_sign.on_clicked.connect(() => { + this.on_remove(this.position); + }); + + this.parent = parent; + this.angle = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 0.5); + this.size = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 1.0); + this.activity = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 0, 0, 0, 0.0); + this.clicked = new AnimatedValue.cubic(AnimatedValue.Direction.OUT, 1, 1, 0, 1.0); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads an Action. All members are initialized accordingly. + ///////////////////////////////////////////////////////////////////// + + public void load(ActionGroup group) { + this.action_group = group; + + // if it's a custom ActionGroup + if (group.get_type().depth() == 2 && group.actions.size > 0) { + this.icon = new Icon(group.actions[0].icon, (int)(radius*2)); + this.name = group.actions[0].name; + } else { + this.icon = new Icon(GroupRegistry.descriptions[group.get_type().name()].icon, (int)(radius*2)); + this.name = GroupRegistry.descriptions[group.get_type().name()].name; + } + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the position where this object should be displayed. + ///////////////////////////////////////////////////////////////////// + + public void set_position(int position, bool smoothly = true) { + double direction = 2.0 * PI * position/parent.slice_count(); + + if (direction != this.angle.end) { + this.position = position; + this.angle.reset_target(direction, smoothly ? 0.5 : 0.0); + + if (!smoothly) + this.angle.update(1.0); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Updates the size of this object. All transitions will be smooth. + ///////////////////////////////////////////////////////////////////// + + public void set_size(double size) { + this.size.reset_target(size, 0.5); + this.delete_sign.set_size(size); + } + + ///////////////////////////////////////////////////////////////////// + /// Notifies that all quick actions should be disabled. + ///////////////////////////////////////////////////////////////////// + + public void disable_quickactions() { + this.action_group.disable_quickactions(); + } + + ///////////////////////////////////////////////////////////////////// + /// Draws the slice to the given context. + ///////////////////////////////////////////////////////////////////// + + public void draw(double frame_time, Cairo.Context ctx) { + this.size.update(frame_time); + this.angle.update(frame_time); + this.activity.update(frame_time); + this.clicked.update(frame_time); + + ctx.save(); + + // transform the context + ctx.translate(cos(this.angle.val)*pie_radius, sin(this.angle.val)*pie_radius); + + double scale = this.size.val*this.clicked.val + + this.activity.val*0.1 - 0.1; + ctx.save(); + + ctx.scale(scale, scale); + + // paint the image + icon.paint_on(ctx); + + ctx.restore(); + + ctx.translate(delete_x*this.size.val, delete_y*this.size.val); + this.delete_sign.draw(frame_time, ctx); + + ctx.restore(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse moves to another position. + ///////////////////////////////////////////////////////////////////// + + public bool on_mouse_move(double angle, double x, double y) { + double direction = 2.0 * PI * position/parent.slice_count(); + double diff = fabs(angle-direction); + + if (diff > PI) + diff = 2 * PI - diff; + + bool active = diff < 0.5*PI/parent.slice_count(); + + if (active) { + this.activity.reset_target(1.0, 0.3); + this.delete_sign.show(); + } else { + this.activity.reset_target(0.0, 0.3); + this.delete_sign.hide(); + } + + if (this.clicked.end == 0.9) { + double dist = GLib.Math.pow(x-this.clicked_x, 2) + GLib.Math.pow(y-this.clicked_y, 2); + if (dist > this.click_cancel_treshold*this.click_cancel_treshold) + this.clicked.reset_target(1.0, 0.1); + } + + double own_x = cos(this.angle.val)*pie_radius; + double own_y = sin(this.angle.val)*pie_radius; + this.delete_hovered = this.delete_sign.on_mouse_move(x - own_x - delete_x*this.size.val, + y - own_y - delete_y*this.size.val); + + return active; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the mouse leaves the area of this widget. + ///////////////////////////////////////////////////////////////////// + + public void on_mouse_leave() { + this.activity.reset_target(0.0, 0.3); + this.delete_sign.hide(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is pressed. + ///////////////////////////////////////////////////////////////////// + + public void on_button_press(double x, double y) { + bool delete_pressed = false; + if (this.activity.end == 1.0) { + double own_x = cos(this.angle.val)*pie_radius; + double own_y = sin(this.angle.val)*pie_radius; + delete_pressed = this.delete_sign.on_button_press(x - own_x - delete_x*this.size.val, + y - own_y - delete_y*this.size.val); + } + + if (!delete_pressed && this.activity.end == 1.0) { + this.clicked.reset_target(0.9, 0.1); + this.clicked_x = x; + this.clicked_y = y; + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a button of the mouse is released. + ///////////////////////////////////////////////////////////////////// + + public void on_button_release(double x, double y) { + bool deleted = false; + if (this.activity.end == 1.0) + deleted = this.delete_sign.on_button_release(x, y); + + if (!deleted && this.clicked.end == 0.9) { + this.clicked.reset_target(1.0, 0.1); + this.on_clicked(this.position); + } + } +} + +} diff --git a/src/gui/preferences.vala b/src/gui/preferences.vala deleted file mode 100644 index 9444fac..0000000 --- a/src/gui/preferences.vala +++ /dev/null @@ -1,325 +0,0 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -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, either version 3 of the License, or (at your option) -any later version. - -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 . -*/ - -namespace GnomePie { - -///////////////////////////////////////////////////////////////////////// -/// The Gtk settings menu of Gnome-Pie. -///////////////////////////////////////////////////////////////////////// - -public class Preferences : Gtk.Window { - - ///////////////////////////////////////////////////////////////////// - /// C'tor, constructs the whole dialog. Many thanks to the - /// synapse-project, since some of this code is taken from there! - ///////////////////////////////////////////////////////////////////// - - public Preferences() { - this.title = _("Gnome-Pie - Settings"); - this.set_position(Gtk.WindowPosition.CENTER); - this.set_size_request(550, 550); - this.resizable = false; - this.icon_name = "gnome-pie"; - this.delete_event.connect(hide_on_delete); - - // main container - var main_vbox = new Gtk.VBox(false, 12); - main_vbox.border_width = 12; - add(main_vbox); - - // tab container - var tabs = new Gtk.Notebook(); - - // general tab - var general_tab = new Gtk.VBox(false, 6); - general_tab.border_width = 12; - - // behavior frame - var behavior_frame = new Gtk.Frame(null); - behavior_frame.set_shadow_type(Gtk.ShadowType.NONE); - var behavior_frame_label = new Gtk.Label(null); - behavior_frame_label.set_markup(Markup.printf_escaped ("%s", _("Behavior"))); - behavior_frame.set_label_widget(behavior_frame_label); - - var behavior_vbox = new Gtk.VBox (false, 6); - var align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f); - align.set_padding (6, 12, 12, 12); - align.add (behavior_vbox); - behavior_frame.add (align); - - // Autostart checkbox - var autostart = new Gtk.CheckButton.with_label (_("Startup on Login")); - autostart.tooltip_text = _("If checked, Gnome-Pie will start when you log in."); - autostart.active = Config.global.auto_start; - autostart.toggled.connect(autostart_toggled); - behavior_vbox.pack_start(autostart, false); - - // Indicator icon - var indicator = new Gtk.CheckButton.with_label (_("Show Indicator")); - indicator.tooltip_text = _("If checked, an indicator for easy access of the settings menu is shown in your panel."); - indicator.active = Config.global.show_indicator; - indicator.toggled.connect(indicator_toggled); - behavior_vbox.pack_start(indicator, false); - - // Open Pies at Mouse - var open_at_mouse = new Gtk.CheckButton.with_label (_("Open Pies at Mouse")); - open_at_mouse.tooltip_text = _("If checked, pies will open at your pointer. Otherwise they'll pop up in the middle of the screen."); - open_at_mouse.active = Config.global.open_at_mouse; - open_at_mouse.toggled.connect(open_at_mouse_toggled); - behavior_vbox.pack_start(open_at_mouse, false); - - // Slider - var slider_hbox = new Gtk.HBox (false, 6); - behavior_vbox.pack_start(slider_hbox); - - var scale_label = new Gtk.Label(_("Global Scale")); - slider_hbox.pack_start(scale_label, false, false); - - var scale_slider = new Gtk.HScale.with_range(0.5, 2.0, 0.05); - scale_slider.set_value(Config.global.global_scale); - scale_slider.value_pos = Gtk.PositionType.RIGHT; - - bool changing = false; - bool changed_again = false; - - scale_slider.value_changed.connect(() => { - if (!changing) { - changing = true; - Timeout.add(300, () => { - if (changed_again) { - changed_again = false; - return true; - } - - Config.global.global_scale = scale_slider.get_value(); - Config.global.load_themes(Config.global.theme.name); - changing = false; - return false; - }); - } else { - changed_again = true; - } - }); - - slider_hbox.pack_end(scale_slider, true, true); - - general_tab.pack_start (behavior_frame, false); - - // theme frame - var theme_frame = new Gtk.Frame(null); - theme_frame.set_shadow_type(Gtk.ShadowType.NONE); - var theme_frame_label = new Gtk.Label(null); - theme_frame_label.set_markup(Markup.printf_escaped("%s", _("Themes"))); - theme_frame.set_label_widget(theme_frame_label); - - // scrollable frame - var scroll = new Gtk.ScrolledWindow (null, null); - align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f); - align.set_padding(6, 12, 12, 12); - align.add(scroll); - theme_frame.add(align); - - scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); - scroll.set_shadow_type (Gtk.ShadowType.IN); - - // themes list - var theme_list = new ThemeList(); - scroll.add(theme_list); - - general_tab.pack_start (theme_frame, true, true); - tabs.append_page(general_tab, new Gtk.Label(_("General"))); - - // pies tab - var pies_tab = new Gtk.VBox(false, 6); - pies_tab.border_width = 12; - tabs.append_page(pies_tab, new Gtk.Label(_("Pies"))); - - // scrollable frame - scroll = new Gtk.ScrolledWindow (null, null); - align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f); - align.add(scroll); - pies_tab.add(align); - - scroll.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC); - scroll.set_shadow_type (Gtk.ShadowType.IN); - - // pies list - var pie_list = new PieList(); - scroll.add(pie_list); - - // bottom box - var info_box = new Gtk.HBox (false, 6); - - // info image - var info_image = new Gtk.Image.from_stock (Gtk.Stock.INFO, Gtk.IconSize.MENU); - info_box.pack_start (info_image, false); - - // info label - var info_label = new TipViewer({ - _("You can right-click in the list for adding or removing entries."), - _("You can reset Gnome-Pie to its default options with the terminal command \"gnome-pie --reset\"."), - _("The radiobutton at the beginning of each slice-line indicates the QuickAction of the pie."), - _("Pies can be opened with the terminal command \"gnome-pie --open=ID\"."), - _("Feel free to visit Gnome-Pie's homepage at %s!").printf("gnome-pie.simonschneegans.de"), - _("You can drag'n'drop applications from your main menu to the list above."), - _("If you want to give some feedback, please write an e-mail to %s!").printf("code@simonschneegans.de"), - _("You may drag'n'drop URLs and bookmarks from your internet browser to the list above."), - _("Bugs can be reported at %s!").printf("Github"), - _("It's possible to drag'n'drop files and folders from your file browser to the list above."), - _("It's recommended to keep your Pies small (at most 6-8 Slices). Else they will become hard to navigate."), - _("In order to create a launcher for a Pie, drag the Pie from the list to your desktop!") - }); - this.show.connect(info_label.start_slide_show); - this.hide.connect(info_label.stop_slide_show); - - info_box.pack_start (info_label); - - // down Button - var down_button = new Gtk.Button(); - down_button.tooltip_text = _("Moves the selected Slice down"); - down_button.sensitive = false; - var down_image = new Gtk.Image.from_stock (Gtk.Stock.GO_DOWN, Gtk.IconSize.LARGE_TOOLBAR); - down_button.add(down_image); - down_button.clicked.connect (() => { - pie_list.selection_down(); - }); - - info_box.pack_end(down_button, false, false); - - // up Button - var up_button = new Gtk.Button(); - up_button.tooltip_text = _("Moves the selected Slice up"); - up_button.sensitive = false; - var up_image = new Gtk.Image.from_stock (Gtk.Stock.GO_UP, Gtk.IconSize.LARGE_TOOLBAR); - up_button.add(up_image); - up_button.clicked.connect (() => { - pie_list.selection_up(); - }); - - info_box.pack_end(up_button, false, false); - - pie_list.get_selection().changed.connect(() => { - Gtk.TreeIter selected; - if (pie_list.get_selection().get_selected(null, out selected)) { - Gtk.TreePath path = pie_list.model.get_path(selected); - if (path.get_depth() == 1) { - up_button.sensitive = false; - down_button.sensitive = false; - } else { - up_button.sensitive = true; - down_button.sensitive = true; - - int child_pos = path.get_indices()[1]; - - if (child_pos == 0) - up_button.sensitive = false; - - path.up(); - Gtk.TreeIter parent_iter; - pie_list.model.get_iter(out parent_iter, path); - if (child_pos == pie_list.model.iter_n_children(parent_iter)-1) - down_button.sensitive = false; - - } - } - }); - - pies_tab.pack_start (info_box, false); - - main_vbox.pack_start(tabs); - - // close button - var bbox = new Gtk.HButtonBox (); - bbox.set_layout (Gtk.ButtonBoxStyle.END); - var close_button = new Gtk.Button.from_stock(Gtk.Stock.CLOSE); - close_button.clicked.connect (() => { - hide(); - }); - bbox.pack_start (close_button); - - main_vbox.pack_start(bbox, false); - - main_vbox.show_all(); - - this.hide.connect(() => { - // save settings on close - Config.global.save(); - Pies.save(); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Creates or deletes the autostart file. This code is inspired - /// by project synapse as well. - ///////////////////////////////////////////////////////////////////// - - private void autostart_toggled(Gtk.ToggleButton check_box) { - bool active = check_box.active; - if (!active && FileUtils.test(Paths.autostart, FileTest.EXISTS)) { - // delete the autostart file - FileUtils.remove (Paths.autostart); - } - else if (active && !FileUtils.test(Paths.autostart, FileTest.EXISTS)) { - string autostart_entry = - "#!/usr/bin/env xdg-open\n" + - "[Desktop Entry]\n" + - "Name=Gnome-Pie\n" + - "Exec=gnome-pie\n" + - "Encoding=UTF-8\n" + - "Type=Application\n" + - "X-GNOME-Autostart-enabled=true\n" + - "Icon=gnome-pie\n"; - - // create the autostart file - string autostart_dir = GLib.Path.get_dirname(Paths.autostart); - if (!FileUtils.test(autostart_dir, FileTest.EXISTS | FileTest.IS_DIR)) { - DirUtils.create_with_parents(autostart_dir, 0755); - } - - try { - FileUtils.set_contents(Paths.autostart, autostart_entry); - FileUtils.chmod(Paths.autostart, 0755); - } catch (Error e) { - var d = new Gtk.MessageDialog (this, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, - "%s", e.message); - d.run (); - d.destroy (); - } - } - } - - ///////////////////////////////////////////////////////////////////// - /// Shows or hides the indicator. - ///////////////////////////////////////////////////////////////////// - - private void indicator_toggled(Gtk.ToggleButton check_box) { - var check = check_box as Gtk.CheckButton; - Config.global.show_indicator = check.active; - } - - ///////////////////////////////////////////////////////////////////// - /// Toggles whether the Pies are shown at the mouse or in the middle - /// of the screen. - ///////////////////////////////////////////////////////////////////// - - private void open_at_mouse_toggled(Gtk.ToggleButton check_box) { - var check = check_box as Gtk.CheckButton; - Config.global.open_at_mouse = check.active; - } -} - -} diff --git a/src/gui/preferencesWindow.vala b/src/gui/preferencesWindow.vala new file mode 100644 index 0000000..022e44b --- /dev/null +++ b/src/gui/preferencesWindow.vala @@ -0,0 +1,311 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// The settings menu of Gnome-Pie. +///////////////////////////////////////////////////////////////////////// + +public class PreferencesWindow : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// The ID of the currently selected Pie. + ///////////////////////////////////////////////////////////////////// + + private string selected_id = ""; + + ///////////////////////////////////////////////////////////////////// + /// Some Gtk widgets used by this window. + ///////////////////////////////////////////////////////////////////// + + private Gtk.Window? window = null; + private Gtk.Label? id_label = null; + private Gtk.Label? name_label = null; + private Gtk.Label? hotkey_label = null; + private Gtk.Label? no_pie_label = null; + private Gtk.Label? no_slice_label = null; + private Gtk.VBox? preview_box = null; + private Gtk.Image? icon = null; + private Gtk.EventBox? preview_background = null; + private Gtk.Button? icon_button = null; + private Gtk.Button? name_button = null; + private Gtk.Button? hotkey_button = null; + private Gtk.ToolButton? remove_pie_button = null; + + ///////////////////////////////////////////////////////////////////// + /// Some custom widgets and dialogs used by this window. + ///////////////////////////////////////////////////////////////////// + + private PiePreview? preview = null; + private PieList? pie_list = null; + private SettingsWindow? settings_window = null; + private TriggerSelectWindow? trigger_window = null; + private IconSelectWindow? icon_window = null; + private RenameWindow? rename_window = null; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, creates the window. + ///////////////////////////////////////////////////////////////////// + + public PreferencesWindow() { + try { + var builder = new Gtk.Builder(); + + builder.add_from_file (Paths.ui_files + "/preferences.ui"); + + this.window = builder.get_object("window") as Gtk.Window; + + this.window.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK | + Gdk.EventMask.KEY_RELEASE_MASK | + Gdk.EventMask.KEY_PRESS_MASK | + Gdk.EventMask.POINTER_MOTION_MASK); + + #if HAVE_GTK_3 + var toolbar = builder.get_object ("toolbar") as Gtk.Widget; + toolbar.get_style_context().add_class("primary-toolbar"); + + var inline_toolbar = builder.get_object ("pies-toolbar") as Gtk.Widget; + inline_toolbar.get_style_context().add_class("inline-toolbar"); + #endif + + this.pie_list = new PieList(); + this.pie_list.on_select.connect(this.on_pie_select); + + var scroll_area = builder.get_object("pies-scrolledwindow") as Gtk.ScrolledWindow; + scroll_area.add(this.pie_list); + + this.preview = new PiePreview(); + this.preview.on_first_slice_added.connect(() => { + this.no_slice_label.hide(); + }); + + this.preview.on_last_slice_removed.connect(() => { + this.no_slice_label.show(); + }); + + preview_box = builder.get_object("preview-box") as Gtk.VBox; + this.preview_box.pack_start(preview, true, true); + + this.id_label = builder.get_object("id-label") as Gtk.Label; + this.name_label = builder.get_object("pie-name-label") as Gtk.Label; + this.hotkey_label = builder.get_object("hotkey-label") as Gtk.Label; + this.no_pie_label = builder.get_object("no-pie-label") as Gtk.Label; + this.no_slice_label = builder.get_object("no-slice-label") as Gtk.Label; + this.icon = builder.get_object("icon") as Gtk.Image; + this.preview_background = builder.get_object("preview-background") as Gtk.EventBox; + + (builder.get_object("settings-button") as Gtk.ToolButton).clicked.connect(on_settings_button_clicked); + + this.hotkey_button = builder.get_object("key-button") as Gtk.Button; + this.hotkey_button.clicked.connect(on_key_button_clicked); + + this.icon_button = builder.get_object("icon-button") as Gtk.Button; + this.icon_button.clicked.connect(on_icon_button_clicked); + + this.name_button = builder.get_object("rename-button") as Gtk.Button; + this.name_button.clicked.connect(on_rename_button_clicked); + + this.remove_pie_button = builder.get_object("remove-pie-button") as Gtk.ToolButton; + this.remove_pie_button.clicked.connect(on_remove_pie_button_clicked); + + (builder.get_object("add-pie-button") as Gtk.ToolButton).clicked.connect(on_add_pie_button_clicked); + + this.window.hide.connect(() => { + // save settings on close + Config.global.save(); + Pies.save(); + }); + + this.window.delete_event.connect(this.window.hide_on_delete); + + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Shows the window. + ///////////////////////////////////////////////////////////////////// + + public void show() { + this.preview.draw_loop(); + this.window.show_all(); + this.pie_list.select_first(); + this.preview_background.modify_bg(Gtk.StateType.NORMAL, Gtk.rc_get_style(this.window).light[0]); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when a new Pie is selected in the PieList. + ///////////////////////////////////////////////////////////////////// + + private void on_pie_select(string id) { + selected_id = id; + + this.no_slice_label.hide(); + this.no_pie_label.hide(); + this.preview_box.hide(); + + this.name_button.sensitive = false; + this.hotkey_button.sensitive = false; + this.icon_button.sensitive = false; + this.remove_pie_button.sensitive = false; + + if (id == "") { + this.id_label.label = ""; + this.name_label.label = _("No Pie selected."); + this.hotkey_label.set_markup(""); + this.icon.icon_name = "application-default-icon"; + + this.no_pie_label.show(); + } else { + var pie = PieManager.all_pies[selected_id]; + this.id_label.label = ("ID: %s").printf(pie.id); + this.name_label.label = PieManager.get_name_of(pie.id); + this.hotkey_label.set_markup(PieManager.get_accelerator_label_of(pie.id)); + + if (pie.icon.contains("/")) + try { + this.icon.pixbuf = new Gdk.Pixbuf.from_file_at_scale(pie.icon, + this.icon.get_pixel_size(), + this.icon.get_pixel_size(), + true); + } catch (GLib.Error error) { + warning(error.message); + } + else + this.icon.icon_name = pie.icon; + + this.preview.set_pie(id); + this.preview_box.show(); + + if (pie.action_groups.size == 0) { + this.no_slice_label.show(); + } + + this.name_button.sensitive = true; + this.hotkey_button.sensitive = true; + this.icon_button.sensitive = true; + this.remove_pie_button.sensitive = true; + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the add Pie button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_add_pie_button_clicked(Gtk.ToolButton button) { + var new_pie = PieManager.create_persistent_pie(_("New Pie"), "application-default-icon", null); + this.pie_list.reload_all(); + this.pie_list.select(new_pie.id); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the remove Pie button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_remove_pie_button_clicked(Gtk.ToolButton button) { + if (this.selected_id != "") { + var dialog = new Gtk.MessageDialog((Gtk.Window)this.window.get_toplevel(), Gtk.DialogFlags.MODAL, + Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, + _("Do you really want to delete the selected Pie with all contained Slices?")); + + dialog.response.connect((response) => { + if (response == Gtk.ResponseType.YES) { + PieManager.remove_pie(selected_id); + this.pie_list.reload_all(); + this.pie_list.select_first(); + } + }); + + dialog.run(); + dialog.destroy(); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Called when rename Pie button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_rename_button_clicked(Gtk.Button button) { + if (this.rename_window == null) { + this.rename_window = new RenameWindow(); + this.rename_window.set_parent(window); + this.rename_window.on_ok.connect((name) => { + var pie = PieManager.all_pies[selected_id]; + pie.name = name; + PieManager.create_launcher(pie.id); + this.name_label.label = name; + this.pie_list.reload_all(); + }); + } + + this.rename_window.set_pie(selected_id); + this.rename_window.show(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the hotkey button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_key_button_clicked(Gtk.Button button) { + if (this.trigger_window == null) { + this.trigger_window = new TriggerSelectWindow(); + this.trigger_window.set_parent(window); + this.trigger_window.on_ok.connect((trigger) => { + PieManager.bind_trigger(trigger, selected_id); + this.hotkey_label.set_markup(trigger.label_with_specials); + }); + } + + this.trigger_window.set_pie(selected_id); + this.trigger_window.show(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the general settings button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_settings_button_clicked(Gtk.ToolButton button) { + if (this.settings_window == null) { + this.settings_window = new SettingsWindow(); + this.settings_window.set_parent(this.window.get_toplevel() as Gtk.Window); + } + + this.settings_window.show(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the icon button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_icon_button_clicked(Gtk.Button button) { + if (this.icon_window == null) { + this.icon_window = new IconSelectWindow(this.window); + this.icon_window.on_ok.connect((icon) => { + var pie = PieManager.all_pies[selected_id]; + pie.icon = icon; + PieManager.create_launcher(pie.id); + this.pie_list.reload_all(); + }); + } + + this.icon_window.show(); + } +} + +} diff --git a/src/gui/renameWindow.vala b/src/gui/renameWindow.vala new file mode 100644 index 0000000..389b460 --- /dev/null +++ b/src/gui/renameWindow.vala @@ -0,0 +1,109 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A window which allows selection of a new name for a Pie. +///////////////////////////////////////////////////////////////////////// + +public class RenameWindow : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// Gets emitted when the user selects a new name. + ///////////////////////////////////////////////////////////////////// + + public signal void on_ok(string new_name); + + ///////////////////////////////////////////////////////////////////// + /// Some Widgets used by this dialog. + ///////////////////////////////////////////////////////////////////// + + private Gtk.Dialog window = null; + private Gtk.Entry entry = null; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, constructs the Widget. + ///////////////////////////////////////////////////////////////////// + + public RenameWindow() { + try { + + Gtk.Builder builder = new Gtk.Builder(); + + builder.add_from_file (Paths.ui_files + "/rename_pie.ui"); + + window = builder.get_object("window") as Gtk.Dialog; + entry = builder.get_object("name-entry") as Gtk.Entry; + + entry.activate.connect(this.on_ok_button_clicked); + + (builder.get_object("ok-button") as Gtk.Button).clicked.connect(on_ok_button_clicked); + (builder.get_object("cancel-button") as Gtk.Button).clicked.connect(on_cancel_button_clicked); + + this.window.delete_event.connect(this.window.hide_on_delete); + + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Sets the parent window, in order to make this window stay in + /// front. + ///////////////////////////////////////////////////////////////////// + + public void set_parent(Gtk.Window parent) { + this.window.set_transient_for(parent); + } + + ///////////////////////////////////////////////////////////////////// + /// Displays the window on the screen. + ///////////////////////////////////////////////////////////////////// + + public void show() { + this.window.show_all(); + this.entry.is_focus = true; + } + + ///////////////////////////////////////////////////////////////////// + /// Make the text entry display the name of the Pie with given ID. + ///////////////////////////////////////////////////////////////////// + + public void set_pie(string id) { + entry.text = PieManager.get_name_of(id); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the ok button is pressed. + ///////////////////////////////////////////////////////////////////// + + private void on_ok_button_clicked() { + this.on_ok(entry.text); + this.window.hide(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the cancel button is pressed. + ///////////////////////////////////////////////////////////////////// + + private void on_cancel_button_clicked() { + this.window.hide(); + } +} + +} diff --git a/src/gui/settingsWindow.vala b/src/gui/settingsWindow.vala new file mode 100644 index 0000000..1eaa0b4 --- /dev/null +++ b/src/gui/settingsWindow.vala @@ -0,0 +1,174 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// The settings menu of Gnome-Pie, with options for theme switching and +/// some general options. +///////////////////////////////////////////////////////////////////////// + +public class SettingsWindow : GLib.Object { + + ///////////////////////////////////////////////////////////////////// + /// Some widgets. + ///////////////////////////////////////////////////////////////////// + + private Gtk.Dialog? window = null; + private ThemeList? theme_list = null; + private Gtk.ToggleButton? indicator = null; + private Gtk.ToggleButton? autostart = null; + + ///////////////////////////////////////////////////////////////////// + /// C'tor creates, the dialog. + ///////////////////////////////////////////////////////////////////// + + public SettingsWindow() { + try { + + Gtk.Builder builder = new Gtk.Builder(); + + builder.add_from_file (Paths.ui_files + "/settings.ui"); + + this.window = builder.get_object("window") as Gtk.Dialog; + + this.theme_list = new ThemeList(); + + var scroll_area = builder.get_object("theme-scrolledwindow") as Gtk.ScrolledWindow; + scroll_area.add(this.theme_list); + + (builder.get_object("close-button") as Gtk.Button).clicked.connect(on_close_button_clicked); + + this.autostart = (builder.get_object("autostart-checkbox") as Gtk.ToggleButton); + this.autostart.toggled.connect(on_autostart_toggled); + + this.indicator = (builder.get_object("indicator-checkbox") as Gtk.ToggleButton); + this.indicator.toggled.connect(on_indicator_toggled); + + var scale_slider = (builder.get_object("scale-hscale") as Gtk.HScale); + scale_slider.set_range(0.5, 2.0); + scale_slider.set_increments(0.05, 0.25); + scale_slider.set_value(Config.global.global_scale); + + bool changing = false; + bool changed_again = false; + + scale_slider.value_changed.connect(() => { + if (!changing) { + changing = true; + Timeout.add(300, () => { + if (changed_again) { + changed_again = false; + return true; + } + + Config.global.global_scale = scale_slider.get_value(); + Config.global.load_themes(Config.global.theme.name); + changing = false; + return false; + }); + } else { + changed_again = true; + } + }); + + this.window.delete_event.connect(this.window.hide_on_delete); + + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Sets the parent window, in order to make this window stay in + /// front. + ///////////////////////////////////////////////////////////////////// + + public void set_parent(Gtk.Window parent) { + this.window.set_transient_for(parent); + } + + ///////////////////////////////////////////////////////////////////// + /// Displays the window on the screen. + ///////////////////////////////////////////////////////////////////// + + public void show() { + this.indicator.active = Config.global.show_indicator; + this.autostart.active = Config.global.auto_start; + + this.window.show_all(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the close button is clicked. + ///////////////////////////////////////////////////////////////////// + + private void on_close_button_clicked() { + this.window.hide(); + } + + ///////////////////////////////////////////////////////////////////// + /// Creates or deletes the autostart file. This code is inspired + /// by project synapse as well. + ///////////////////////////////////////////////////////////////////// + + private void on_autostart_toggled(Gtk.ToggleButton check_box) { + bool active = check_box.active; + if (!active && FileUtils.test(Paths.autostart, FileTest.EXISTS)) { + // delete the autostart file + FileUtils.remove (Paths.autostart); + } + else if (active && !FileUtils.test(Paths.autostart, FileTest.EXISTS)) { + string autostart_entry = + "#!/usr/bin/env xdg-open\n" + + "[Desktop Entry]\n" + + "Name=Gnome-Pie\n" + + "Exec=gnome-pie\n" + + "Encoding=UTF-8\n" + + "Type=Application\n" + + "X-GNOME-Autostart-enabled=true\n" + + "Icon=gnome-pie\n"; + + // create the autostart file + string autostart_dir = GLib.Path.get_dirname(Paths.autostart); + if (!FileUtils.test(autostart_dir, FileTest.EXISTS | FileTest.IS_DIR)) { + DirUtils.create_with_parents(autostart_dir, 0755); + } + + try { + FileUtils.set_contents(Paths.autostart, autostart_entry); + FileUtils.chmod(Paths.autostart, 0755); + } catch (Error e) { + var d = new Gtk.MessageDialog (this.window, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, + "%s", e.message); + d.run (); + d.destroy (); + } + } + } + + ///////////////////////////////////////////////////////////////////// + /// Shows or hides the indicator. + ///////////////////////////////////////////////////////////////////// + + private void on_indicator_toggled(Gtk.ToggleButton check_box) { + var check = check_box as Gtk.CheckButton; + Config.global.show_indicator = check.active; + } +} + +} diff --git a/src/gui/sliceTypeList.vala b/src/gui/sliceTypeList.vala new file mode 100644 index 0000000..541658e --- /dev/null +++ b/src/gui/sliceTypeList.vala @@ -0,0 +1,172 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// A list displaying all available Action types and ActionGroup types. +///////////////////////////////////////////////////////////////////////// + +class SliceTypeList : Gtk.TreeView { + + ///////////////////////////////////////////////////////////////////// + /// This signal gets emitted when the user selects a new Type. + ///////////////////////////////////////////////////////////////////// + + public signal void on_select(string id, string icon_name); + + ///////////////////////////////////////////////////////////////////// + /// The listore which staroes all types internally. + ///////////////////////////////////////////////////////////////////// + + private Gtk.ListStore data; + private enum DataPos {ICON, ICON_NAME, NAME, ID} + + ///////////////////////////////////////////////////////////////////// + /// C'tor, constructs the Widget. + ///////////////////////////////////////////////////////////////////// + + public SliceTypeList() { + GLib.Object(); + + this.data = new Gtk.ListStore(4, typeof(Gdk.Pixbuf), + typeof(string), + typeof(string), + typeof(string)); + + this.data.set_sort_column_id(2, Gtk.SortType.ASCENDING); + + base.set_model(this.data); + base.set_headers_visible(true); + base.set_grid_lines(Gtk.TreeViewGridLines.NONE); + this.set_fixed_height_mode(true); + + var main_column = new Gtk.TreeViewColumn(); + main_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED); + main_column.title = _("Slice types"); + var icon_render = new Gtk.CellRendererPixbuf(); + main_column.pack_start(icon_render, false); + + var name_render = new Gtk.CellRendererText(); + main_column.pack_start(name_render, true); + + base.append_column(main_column); + + main_column.add_attribute(icon_render, "pixbuf", DataPos.ICON); + main_column.add_attribute(name_render, "markup", DataPos.NAME); + + this.get_selection().changed.connect(() => { + Gtk.TreeIter active; + if (this.get_selection().get_selected(null, out active)) { + string id = ""; + string icon = ""; + this.data.get(active, DataPos.ID, out id); + this.data.get(active, DataPos.ICON_NAME, out icon); + this.on_select(id, icon); + } + }); + + reload_all(); + } + + ///////////////////////////////////////////////////////////////////// + /// Loads a registered actions and action groups. + ///////////////////////////////////////////////////////////////////// + + public void reload_all() { + Gtk.TreeIter active; + string current_id = ""; + if (this.get_selection().get_selected(null, out active)) + this.data.get(active, DataPos.ID, out current_id); + + data.clear(); + + foreach (var action_type in ActionRegistry.types) { + var description = ActionRegistry.descriptions[action_type]; + + Gtk.TreeIter current; + data.append(out current); + var icon = new Icon(description.icon, 36); + data.set(current, DataPos.ICON, icon.to_pixbuf()); + data.set(current, DataPos.ICON_NAME, description.icon); + data.set(current, DataPos.NAME, "" + description.name + "\n" + + "" + description.description + ""); + data.set(current, DataPos.ID, description.id); + } + + foreach (var group_type in GroupRegistry.types) { + var description = GroupRegistry.descriptions[group_type]; + + Gtk.TreeIter current; + data.append(out current); + var icon = new Icon(description.icon, 36); + data.set(current, DataPos.ICON, icon.to_pixbuf()); + data.set(current, DataPos.ICON_NAME, description.icon); + data.set(current, DataPos.NAME, "" + description.name + "\n" + + "" + description.description + ""); + data.set(current, DataPos.ID, description.id); + } + + select_first(); + select(current_id); + } + + ///////////////////////////////////////////////////////////////////// + /// Selects the first type in the list. + ///////////////////////////////////////////////////////////////////// + + public void select_first() { + Gtk.TreeIter active; + + if(this.data.get_iter_first(out active) ) { + this.get_selection().select_iter(active); + string id = ""; + string icon = ""; + this.data.get(active, DataPos.ID, out id); + this.data.get(active, DataPos.ICON_NAME, out icon); + this.on_select(id, icon); + } else { + this.on_select("", "application-default-icon"); + } + } + + ///////////////////////////////////////////////////////////////////// + /// Select the given slice type. + ///////////////////////////////////////////////////////////////////// + + public void select(string id) { + this.data.foreach((model, path, iter) => { + string pie_id; + this.data.get(iter, DataPos.ID, out pie_id); + + if (id == pie_id) { + this.get_selection().select_iter(iter); + string icon = ""; + this.data.get(iter, DataPos.ICON_NAME, out icon); + this.on_select(pie_id, icon); + this.scroll_to_cell(path, null, true, 0.5f, 0.5f); + this.has_focus = true; + + return true; + } + + return false; + }); + } +} + +} diff --git a/src/gui/themeList.vala b/src/gui/themeList.vala index 7eadcdb..62e0721 100644 --- a/src/gui/themeList.vala +++ b/src/gui/themeList.vala @@ -28,6 +28,12 @@ class ThemeList : Gtk.TreeView { ///////////////////////////////////////////////////////////////////// private Gtk.TreeIter active { private get; private set; } + + ///////////////////////////////////////////////////////////////////// + /// The positions in the data list store. + ///////////////////////////////////////////////////////////////////// + + private enum DataPos {ICON, NAME} ///////////////////////////////////////////////////////////////////// /// C'tor, constructs the Widget. @@ -36,58 +42,50 @@ class ThemeList : Gtk.TreeView { public ThemeList() { GLib.Object(); - var data = new Gtk.ListStore(2, typeof(bool), // selected - typeof(string)); // description - base.set_model(data); - base.set_headers_visible(false); - base.set_rules_hint(true); - base.set_grid_lines(Gtk.TreeViewGridLines.NONE); + var data = new Gtk.ListStore(2, typeof(Gdk.Pixbuf), + typeof(string)); + this.set_model(data); + this.set_headers_visible(true); + this.set_grid_lines(Gtk.TreeViewGridLines.NONE); + this.set_fixed_height_mode(true); var main_column = new Gtk.TreeViewColumn(); - var check_render = new Gtk.CellRendererToggle(); - check_render.set_radio(true); - check_render.set_activatable(true); - main_column.pack_start(check_render, false); - - // switch the theme if the entry has been toggled - check_render.toggled.connect((r, path) => { - Gtk.TreeIter toggled; - data.get_iter(out toggled, new Gtk.TreePath.from_string(path)); - - if (toggled != this.active) { - Timeout.add(10, () => { - int index = int.parse(path); - Config.global.theme = Config.global.themes[index]; - Config.global.theme.load(); - Config.global.theme.load_images(); - return false; - }); - - data.set(this.active, 0, false); - data.set(toggled, 0, true); - - this.active = toggled; - } - }); + main_column.title = _("Themes"); + main_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED); + var icon_render = new Gtk.CellRendererPixbuf(); + main_column.pack_start(icon_render, false); var theme_render = new Gtk.CellRendererText(); main_column.pack_start(theme_render, true); - base.append_column(main_column); + this.append_column(main_column); + + main_column.add_attribute(icon_render, "pixbuf", DataPos.ICON); + main_column.add_attribute(theme_render, "markup", DataPos.NAME); - main_column.add_attribute(check_render, "active", 0); - main_column.add_attribute(theme_render, "markup", 1); + this.get_selection().changed.connect(() => { + Gtk.TreeIter active; + if (this.get_selection().get_selected(null, out active)) { + Timeout.add(10, () => { + int index = int.parse(data.get_path(active).to_string()); + Config.global.theme = Config.global.themes[index]; + Config.global.theme.load(); + Config.global.theme.load_images(); + return false; + }); + } + }); // load all themes into the list var themes = Config.global.themes; foreach(var theme in themes) { Gtk.TreeIter current; data.append(out current); - data.set(current, 0, theme == Config.global.theme); - data.set(current, 1, "" + theme.name + "\n" + theme.description - + " - " + _("by") + " " + theme.author + ""); + data.set(current, DataPos.ICON, theme.preview_icon.to_pixbuf()); + data.set(current, DataPos.NAME, ""+theme.name+" - "+theme.description+"\n" + +""+_("By")+" "+theme.author+""); if(theme == Config.global.theme) - this.active = current; + get_selection().select_iter(current); } } } diff --git a/src/gui/tipViewer.vala b/src/gui/tipViewer.vala deleted file mode 100644 index c653dd9..0000000 --- a/src/gui/tipViewer.vala +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright (c) 2011 by Simon Schneegans - -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, either version 3 of the License, or (at your option) -any later version. - -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 . -*/ - -namespace GnomePie { - -///////////////////////////////////////////////////////////////////////// -/// A widget showing tips. The tips are beautifully faded in and out. -///////////////////////////////////////////////////////////////////////// - -public class TipViewer : Gtk.Label { - - ///////////////////////////////////////////////////////////////////// - /// Some settings tweaking the behavior of the TipViewer. - ///////////////////////////////////////////////////////////////////// - - private const double fade_time = 0.5; - private const double frame_rate = 20.0; - private const double delay = 7.0; - - ///////////////////////////////////////////////////////////////////// - /// False, if the playback of tips is stopped. - ///////////////////////////////////////////////////////////////////// - - private bool playing = false; - - ///////////////////////////////////////////////////////////////////// - /// An array containing all tips. - ///////////////////////////////////////////////////////////////////// - - private string[] tips; - - ///////////////////////////////////////////////////////////////////// - /// The index of the currently displayed tip. - ///////////////////////////////////////////////////////////////////// - - private int index = -1; - - ///////////////////////////////////////////////////////////////////// - /// Colors of the font and the background. Used for fading effects. - ///////////////////////////////////////////////////////////////////// - - private Gdk.Color fg; - private Gdk.Color bg; - - ///////////////////////////////////////////////////////////////////// - /// The fading value. - ///////////////////////////////////////////////////////////////////// - - private AnimatedValue alpha; - - ///////////////////////////////////////////////////////////////////// - /// C'tor, initializes all members and sets the basic layout. - ///////////////////////////////////////////////////////////////////// - - public TipViewer(string[] tips) { - this.tips = tips; - this.fg = this.get_style().fg[0]; - this.bg = this.get_style().bg[0]; - - this.alpha = new AnimatedValue.linear(1.0, 0.0, this.fade_time); - - this.set_alignment (0.0f, 0.5f); - this.wrap = true; - this.set_use_markup(true); - this.modify_font(Pango.FontDescription.from_string("9")); - - this.set_random_tip(); - } - - ///////////////////////////////////////////////////////////////////// - /// Starts the playback of tips. - ///////////////////////////////////////////////////////////////////// - - public void start_slide_show() { - if (!this.playing && tips.length > 1) { - this.playing = true; - GLib.Timeout.add((uint)(this.delay*1000.0), () => { - this.fade_out(); - - GLib.Timeout.add((uint)(1000.0*this.fade_time), () => { - this.set_random_tip(); - this.fade_in(); - return false; - }); - - return this.playing; - }); - } - } - - ///////////////////////////////////////////////////////////////////// - /// Stops the playback of tips. - ///////////////////////////////////////////////////////////////////// - - public void stop_slide_show() { - this.playing = false; - } - - ///////////////////////////////////////////////////////////////////// - /// Starts the fading in. - ///////////////////////////////////////////////////////////////////// - - private void fade_in() { - this.alpha = new AnimatedValue.linear(this.alpha.val, 1.0, this.fade_time); - - GLib.Timeout.add((uint)(1000.0/this.frame_rate), () => { - this.alpha.update(1.0/this.frame_rate); - this.update_label(); - - return (this.alpha.val != 1.0); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Starts the fading out. - ///////////////////////////////////////////////////////////////////// - - private void fade_out() { - this.alpha = new AnimatedValue.linear(this.alpha.val, 0.0, this.fade_time); - - GLib.Timeout.add((uint)(1000.0/this.frame_rate), () => { - this.alpha.update(1.0/this.frame_rate); - this.update_label(); - - return (this.alpha.val != 0.0); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Updates the color of the label. Called every frame while fading. - ///////////////////////////////////////////////////////////////////// - - private void update_label() { - Gdk.Color color = {(uint32)(fg.pixel*this.alpha.val + bg.pixel*(1.0 - this.alpha.val)), - (uint16)(fg.red*this.alpha.val + bg.red*(1.0 - this.alpha.val)), - (uint16)(fg.green*this.alpha.val + bg.green*(1.0 - this.alpha.val)), - (uint16)(fg.blue*this.alpha.val + bg.blue*(1.0 - this.alpha.val))}; - - this.modify_fg(Gtk.StateType.NORMAL, color); - } - - ///////////////////////////////////////////////////////////////////// - /// Chooses the next random tip. - ///////////////////////////////////////////////////////////////////// - - private void set_random_tip() { - if (tips.length > 1) { - int next_index = -1; - do { - next_index = GLib.Random.int_range(0, tips.length); - } while (next_index == this.index); - this.index = next_index; - this.label = tips[this.index]; - } - } -} - -} diff --git a/src/gui/triggerSelectButton.vala b/src/gui/triggerSelectButton.vala new file mode 100644 index 0000000..eeb37e2 --- /dev/null +++ b/src/gui/triggerSelectButton.vala @@ -0,0 +1,161 @@ +/* +Copyright (c) 2011 by Simon Schneegans + +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, either version 3 of the License, or (at your option) +any later version. + +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 . +*/ + +namespace GnomePie { + +///////////////////////////////////////////////////////////////////////// +/// This window allows the selection of a hotkey. It is returned in form +/// of a Trigger. Therefore it can be either a keyboard driven hotkey or +/// a mouse based hotkey. +///////////////////////////////////////////////////////////////////////// + +public class TriggerSelectButton : Gtk.ToggleButton { + + ///////////////////////////////////////////////////////////////////// + /// This signal is emitted when the user selects a new hot key. + ///////////////////////////////////////////////////////////////////// + + public signal void on_select(Trigger trigger); + + ///////////////////////////////////////////////////////////////////// + /// The currently contained Trigger. + ///////////////////////////////////////////////////////////////////// + + private Trigger trigger = null; + + ///////////////////////////////////////////////////////////////////// + /// True, if mouse buttons can be bound as well. + ///////////////////////////////////////////////////////////////////// + + private bool enable_mouse = false; + + ///////////////////////////////////////////////////////////////////// + /// These modifiers are ignored. + ///////////////////////////////////////////////////////////////////// + + private Gdk.ModifierType lock_modifiers = Gdk.ModifierType.MOD2_MASK + |Gdk.ModifierType.LOCK_MASK + |Gdk.ModifierType.MOD5_MASK; + + ///////////////////////////////////////////////////////////////////// + /// C'tor, constructs a new TriggerSelectWindow. + ///////////////////////////////////////////////////////////////////// + + public TriggerSelectButton(bool enable_mouse) { + this.enable_mouse = enable_mouse; + + this.toggled.connect(() => { + if (this.active) { + this.set_label(_("Press a hotkey ...")); + Gtk.grab_add(this); + FocusGrabber.grab(this.get_window(), true, true, true); + } + }); + + this.button_press_event.connect(this.on_button_press); + this.key_press_event.connect(this.on_key_press); + this.set_trigger(new Trigger()); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes the button display the given Trigger. + ///////////////////////////////////////////////////////////////////// + + public void set_trigger(Trigger trigger) { + this.trigger = trigger; + this.set_label(trigger.label); + } + + ///////////////////////////////////////////////////////////////////// + /// Can be called to cancel the selection process. + ///////////////////////////////////////////////////////////////////// + + private void cancel() { + this.set_label(trigger.label); + this.set_active(false); + Gtk.grab_remove(this); + FocusGrabber.ungrab(true, true); + } + + ///////////////////////////////////////////////////////////////////// + /// Makes the button display the given Trigger. + ///////////////////////////////////////////////////////////////////// + + private void update_trigger(Trigger trigger) { + if (this.trigger.name != trigger.name) { + this.set_trigger(trigger); + this.on_select(this.trigger); + } + + this.cancel(); + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user presses a keyboard key. + ///////////////////////////////////////////////////////////////////// + + private bool on_key_press(Gdk.EventKey event) { + if (this.active) { + if (Gdk.keyval_name(event.keyval) == "Escape") { + this.cancel(); + } else if (Gdk.keyval_name(event.keyval) == "BackSpace") { + this.update_trigger(new Trigger()); + } else if (event.is_modifier == 0) { + Gdk.ModifierType state = event.state & ~ this.lock_modifiers; + this.update_trigger(new Trigger.from_values(event.keyval, state, false, false, false, false)); + } + + return true; + } + return false; + } + + ///////////////////////////////////////////////////////////////////// + /// Called when the user presses a button of the mouse. + ///////////////////////////////////////////////////////////////////// + + private bool on_button_press(Gdk.EventButton event) { + if (this.active) { + Gtk.Allocation rect; + this.get_allocation(out rect); + if (event.x < rect.x || event.x > rect.x + rect.width + || event.y < rect.y || event.y > rect.y + rect.height) { + + this.cancel(); + return true; + } + } + + if (this.active && this.enable_mouse) { + Gdk.ModifierType state = event.state & ~ this.lock_modifiers; + var new_trigger = new Trigger.from_values((int)event.button, state, true, + false, false, false); + + if (new_trigger.key_code != 1) this.update_trigger(new_trigger); + else this.cancel(); + + return true; + } else if (this.active) { + this.cancel(); + return true; + } + + return false; + } +} + +} diff --git a/src/gui/triggerSelectWindow.vala b/src/gui/triggerSelectWindow.vala index e003a84..23eea3c 100644 --- a/src/gui/triggerSelectWindow.vala +++ b/src/gui/triggerSelectWindow.vala @@ -23,21 +23,23 @@ namespace GnomePie { /// a mouse based hotkey. ///////////////////////////////////////////////////////////////////////// -public class TriggerSelectWindow : Gtk.Dialog { +public class TriggerSelectWindow : GLib.Object { ///////////////////////////////////////////////////////////////////// /// This signal is emitted when the user selects a new hot key. ///////////////////////////////////////////////////////////////////// - public signal void on_select(Trigger trigger); + public signal void on_ok(Trigger trigger); ///////////////////////////////////////////////////////////////////// /// Some private members which are needed by other methods. ///////////////////////////////////////////////////////////////////// + private Gtk.Dialog window; private Gtk.CheckButton turbo; private Gtk.CheckButton delayed; - private Gtk.Label preview; + private Gtk.CheckButton centered; + private TriggerSelectButton button; ///////////////////////////////////////////////////////////////////// /// The currently configured trigger. @@ -53,205 +55,134 @@ public class TriggerSelectWindow : Gtk.Dialog { private Trigger original_trigger = null; - ///////////////////////////////////////////////////////////////////// - /// These modifiers are ignored. - ///////////////////////////////////////////////////////////////////// - - private Gdk.ModifierType lock_modifiers = Gdk.ModifierType.MOD2_MASK - |Gdk.ModifierType.LOCK_MASK - |Gdk.ModifierType.MOD5_MASK; - ///////////////////////////////////////////////////////////////////// /// C'tor, constructs a new TriggerSelectWindow. ///////////////////////////////////////////////////////////////////// public TriggerSelectWindow() { - this.title = _("Define an open-command"); - this.resizable = false; - this.delete_event.connect(hide_on_delete); - this.key_press_event.connect(on_key_press); - this.button_press_event.connect(on_button_press); - - this.show.connect_after(() => { - FocusGrabber.grab(this); - }); + try { - this.hide.connect(() => { - FocusGrabber.ungrab(this); - }); + Gtk.Builder builder = new Gtk.Builder(); + + builder.add_from_file (Paths.ui_files + "/trigger_select.ui"); - var container = new Gtk.VBox(false, 6); - container.set_border_width(6); - - // click area - var click_frame = new Gtk.Frame(_("Click here if you want to bind a mouse button!")); + this.window = builder.get_object("window") as Gtk.Dialog; + this.button = new TriggerSelectButton(true); + this.button.show(); - var click_box = new Gtk.EventBox(); - click_box.height_request = 100; - click_box.button_press_event.connect(on_area_clicked); - - this.preview = new Gtk.Label(null); - - click_box.add(this.preview); - - click_frame.add(click_box); - - container.pack_start(click_frame, false); + this.button.on_select.connect((trigger) => { + this.trigger = new Trigger.from_values(trigger.key_sym, + trigger.modifiers, + trigger.with_mouse, + this.turbo.active, + this.delayed.active, + this.centered.active); + }); - // turbo checkbox - this.turbo = new Gtk.CheckButton.with_label (_("Turbo mode")); - this.turbo.tooltip_text = _("If checked, the Pie will close when you " + - "release the chosen hot key."); - this.turbo.active = false; - this.turbo.toggled.connect(() => { - if (this.trigger != null) - this.update_trigger(new Trigger.from_values( - this.trigger.key_sym, this.trigger.modifiers, - this.trigger.with_mouse, this.turbo.active, - this.delayed.active)); - }); - - container.pack_start(turbo, false); + (builder.get_object("trigger-box") as Gtk.VBox).pack_start(this.button, true, true); + + (builder.get_object("ok-button") as Gtk.Button).clicked.connect(this.on_ok_button_clicked); + (builder.get_object("cancel-button") as Gtk.Button).clicked.connect(this.on_cancel_button_clicked); + + this.turbo = builder.get_object("turbo-check") as Gtk.CheckButton; + this.turbo.toggled.connect(this.on_check_toggled); - // delayed checkbox - this.delayed = new Gtk.CheckButton.with_label (_("Long press for activation")); - this.delayed.tooltip_text = _("If checked, the Pie will only open if you " + - "press this hot key a bit longer."); - this.delayed.active = false; - this.delayed.toggled.connect(() => { - if (this.trigger != null) - this.update_trigger(new Trigger.from_values( - this.trigger.key_sym, this.trigger.modifiers, - this.trigger.with_mouse, this.turbo.active, - this.delayed.active)); - }); + this.delayed = builder.get_object("delay-check") as Gtk.CheckButton; + this.delayed.toggled.connect(this.on_check_toggled); + + this.centered = builder.get_object("center-check") as Gtk.CheckButton; + this.centered.toggled.connect(this.on_check_toggled); + + this.window.delete_event.connect(this.window.hide_on_delete); - container.pack_start(delayed, false); - - container.show_all(); - - this.vbox.pack_start(container, true, true); - - this.add_button(Gtk.Stock.CANCEL, 1); - this.add_button(Gtk.Stock.OK, 0); - - // select a new trigger on OK, hide on CANCEL - this.response.connect((id) => { - if (id == 1) - this.hide(); - else if (id == 0) { - var assigned_id = PieManager.get_assigned_id(this.trigger); + } catch (GLib.Error e) { + error("Could not load UI: %s\n", e.message); + } + } - if (this.trigger == this.original_trigger) { - // nothing did change - this.hide(); - } else if (this.trigger.key_code == this.original_trigger.key_code - && this.trigger.modifiers == this.original_trigger.modifiers - && this.trigger.with_mouse == this.original_trigger.with_mouse) { - // only turbo and/or delayed mode changed, no need to check for double assignment - this.on_select(this.trigger); - this.hide(); - } else if (assigned_id != "") { - // it's already assigned - var error = _("This hotkey is already assigned to the pie \"%s\"! \n\nPlease select " + - "another one or cancel your selection.").printf(PieManager.get_name_of(assigned_id)); - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), - Gtk.DialogFlags.MODAL, - Gtk.MessageType.ERROR, - Gtk.ButtonsType.CANCEL, - error); - dialog.run(); - dialog.destroy(); - } else { - // a unused hot key has been chosen, great! - this.on_select(this.trigger); - this.hide(); - } - } - }); + ///////////////////////////////////////////////////////////////////// + /// Sets the parent window, in order to make this window stay in + /// front. + ///////////////////////////////////////////////////////////////////// + + public void set_parent(Gtk.Window parent) { + this.window.set_transient_for(parent); } ///////////////////////////////////////////////////////////////////// - /// Used to set the currently selected trigger on opening. + /// Displays the window on the screen. ///////////////////////////////////////////////////////////////////// - public void set_trigger(Trigger trigger) { - this.turbo.active = trigger.turbo; - this.delayed.active = trigger.delayed; - this.original_trigger = trigger; - this.update_trigger(trigger); + public void show() { + this.window.show_all(); } ///////////////////////////////////////////////////////////////////// - /// Called when the user clicks in the click area. + /// Initilizes all members to match the Trigger of the Pie with the + /// given ID. ///////////////////////////////////////////////////////////////////// - private bool on_area_clicked(Gdk.EventButton event) { - Gdk.ModifierType state = event.state & ~ this.lock_modifiers; + public void set_pie(string id) { + var trigger = new Trigger.from_string(PieManager.get_accelerator_of(id)); - var new_trigger = new Trigger.from_values((int)event.button, state, true, - this.turbo.active, this.delayed.active); - if (new_trigger.key_code == 1) { - var dialog = new Gtk.MessageDialog((Gtk.Window)this.get_toplevel(), Gtk.DialogFlags.MODAL, - Gtk.MessageType.WARNING, - Gtk.ButtonsType.YES_NO, - _("It possible to make your system unusable if " + - "you bind a Pie to your left mouse button. Do " + - "you really want to do this?")); - - dialog.response.connect((response) => { - if (response == Gtk.ResponseType.YES) { - this.update_trigger(new_trigger); - } - }); - - dialog.run(); - dialog.destroy(); - } else { - this.update_trigger(new_trigger); - } + this.turbo.active = trigger.turbo; + this.delayed.active = trigger.delayed; + this.centered.active = trigger.centered; + this.original_trigger = trigger; + this.trigger = trigger; - return true; + this.button.set_trigger(trigger); } ///////////////////////////////////////////////////////////////////// - /// Called when the user presses a keyboard key. + /// Called when one of the three checkoxes is toggled. ///////////////////////////////////////////////////////////////////// - private bool on_key_press(Gdk.EventKey event) { - if (Gdk.keyval_name(event.keyval) == "Escape") { - this.hide(); - } else if (Gdk.keyval_name(event.keyval) == "BackSpace") { - this.update_trigger(new Trigger()); - } else if (event.is_modifier == 0) { - Gdk.ModifierType state = event.state & ~ this.lock_modifiers; - this.update_trigger(new Trigger.from_values((int)event.keyval, state, false, - this.turbo.active, this.delayed.active)); - } - - return true; + private void on_check_toggled() { + if (this.trigger != null) + this.trigger = new Trigger.from_values(this.trigger.key_sym, this.trigger.modifiers, + this.trigger.with_mouse, this.turbo.active, + this.delayed.active, this.centered.active); } ///////////////////////////////////////////////////////////////////// - /// Called when the user presses a mouse button. + /// Called when the OK-button is pressed. ///////////////////////////////////////////////////////////////////// - private bool on_button_press(Gdk.EventButton event) { - int width = 0, height = 0; - this.window.get_geometry(null, null, out width, out height, null); - if (event.x < 0 || event.x > width || event.y < 0 || event.y > height) - this.hide(); - return true; + private void on_ok_button_clicked() { + var assigned_id = PieManager.get_assigned_id(this.trigger); + + if (this.trigger == this.original_trigger) { + // nothing did change + this.window.hide(); + } else if (this.trigger.key_code == this.original_trigger.key_code + && this.trigger.modifiers == this.original_trigger.modifiers + && this.trigger.with_mouse == this.original_trigger.with_mouse) { + // only turbo and/or delayed mode changed, no need to check for double assignment + this.on_ok(this.trigger); + this.window.hide(); + } else if (assigned_id != "") { + // it's already assigned + var error = _("This hotkey is already assigned to the pie \"%s\"! \n\nPlease select " + + "another one or cancel your selection.").printf(PieManager.get_name_of(assigned_id)); + var dialog = new Gtk.MessageDialog((Gtk.Window)this.window.get_toplevel(), Gtk.DialogFlags.MODAL, + Gtk.MessageType.ERROR, Gtk.ButtonsType.CANCEL, error); + dialog.run(); + dialog.destroy(); + } else { + // a unused hot key has been chosen, great! + this.on_ok(this.trigger); + this.window.hide(); + } } ///////////////////////////////////////////////////////////////////// - /// Helper method to update the content of the trigger preview label. + /// Called when the cancel button is pressed. ///////////////////////////////////////////////////////////////////// - private void update_trigger(Trigger new_trigger) { - this.trigger = new_trigger; - this.preview.set_markup("" + this.trigger.label + ""); - } + private void on_cancel_button_clicked() { + this.window.hide(); + } } } diff --git a/src/images/icon.vala b/src/images/icon.vala index 1c8a9f4..81eb2d9 100644 --- a/src/images/icon.vala +++ b/src/images/icon.vala @@ -80,7 +80,17 @@ public class Icon : Image { public static string get_icon_file(string icon_name, int size) { string result = ""; - + + if (icon_name.contains("/")) { + var file = GLib.File.new_for_path(icon_name); + if(file.query_exists()) + return icon_name; + + warning("Icon \"" + icon_name + "\" not found! Using default icon..."); + icon_name = "application-default-icon"; + } + + var icon_theme = Gtk.IconTheme.get_default(); var file = icon_theme.lookup_icon(icon_name, size, 0); if (file != null) result = file.get_filename(); diff --git a/src/images/image.vala b/src/images/image.vala index 836e4e2..1d9674b 100644 --- a/src/images/image.vala +++ b/src/images/image.vala @@ -65,14 +65,39 @@ public class Image : GLib.Object { ///////////////////////////////////////////////////////////////////// public Image.from_pixbuf(Gdk.Pixbuf pixbuf) { - this.load_pixbuf(pixbuf); + if (pixbuf != null) this.load_pixbuf(pixbuf); + else this.surface = new Cairo.ImageSurface(Cairo.Format.ARGB32, 1, 1); } - public Image.capture_screen(int posx, int posy, int width, int height) { + ///////////////////////////////////////////////////////////////////// + /// Captures a part of the screen. + ///////////////////////////////////////////////////////////////////// + + public Image.capture_screen(int posx, int posy, int width, int height, bool hide_pies = true) { Gdk.Window root = Gdk.get_default_root_window(); - Gdk.Pixbuf pixbuf = Gdk.pixbuf_get_from_drawable(null, root, null, posx, posy, 0, 0, width, height); + #if HAVE_GTK_3 + Gdk.Pixbuf pixbuf = Gdk.pixbuf_get_from_window(root, posx, posy, width, height); + #else + Gdk.Pixbuf pixbuf = Gdk.pixbuf_get_from_drawable(null, root, null, posx, posy, 0, 0, width, height); + #endif + this.load_pixbuf(pixbuf); + + if (hide_pies) { + // check for opened pies + foreach (var window in PieManager.opened_windows) { + if (window.background != null) { + int x=0, y=0, dx=0, dy=0; + window.get_position(out x, out y); + window.get_size(out dx, out dy); + + var ctx = this.context(); + ctx.translate((int)(x-posx + (dx+3)/2), (int)(y-posy + (dy+3)/2)); + window.background.paint_on(ctx); + } + } + } } ///////////////////////////////////////////////////////////////////// @@ -87,6 +112,7 @@ public class Image : GLib.Object { this.load_pixbuf(pixbuf); } else { warning("Failed to load " + filename + "!"); + this.surface = new Cairo.ImageSurface(Cairo.Format.ARGB32, 1, 1); } } catch (GLib.Error e) { message("Error loading image file: %s", e.message); @@ -106,6 +132,7 @@ public class Image : GLib.Object { this.load_pixbuf(pixbuf); } else { warning("Failed to load " + filename + "!"); + this.surface = new Cairo.ImageSurface(Cairo.Format.ARGB32, width, height); } } catch (GLib.Error e) { message("Error loading image file: %s", e.message); @@ -130,17 +157,39 @@ public class Image : GLib.Object { ///////////////////////////////////////////////////////////////////// public void paint_on(Cairo.Context ctx, double alpha = 1.0) { - ctx.set_source_surface(this.surface, -0.5*this.width()-1, -0.5*this.height()-1); + ctx.set_source_surface(this.surface, (int)(-0.5*this.width()-1), (int)(-0.5*this.height()-1)); if (alpha >= 1.0) ctx.paint(); else ctx.paint_with_alpha(alpha); } + ///////////////////////////////////////////////////////////////////// + /// Converts the image to a Gdk.Pixbuf. + ///////////////////////////////////////////////////////////////////// + + public Gdk.Pixbuf to_pixbuf() { + var pixbuf = new Gdk.Pixbuf.from_data(surface.get_data(), Gdk.Colorspace.RGB, true, 8, + width(), height(), surface.get_stride(), null); + + pixbuf = pixbuf.copy(); + + // funny stuff here --- need to swap Red end Blue because Cairo + // and Gdk are different... + uint8* p = pixbuf.pixels; + for (int i=0; i size) size = layer.image.width(); } diff --git a/src/pies/load.vala b/src/pies/load.vala index 98fd72f..b606cf5 100644 --- a/src/pies/load.vala +++ b/src/pies/load.vala @@ -80,7 +80,7 @@ namespace Pies { string name = ""; string icon = ""; string id = ""; - int quick_action = -1; + int quickaction = -1; // parse all attributes of this node for (Xml.Attr* attribute = node->properties; attribute != null; attribute = attribute->next) { @@ -92,7 +92,7 @@ namespace Pies { hotkey = attr_content; break; case "quickaction": - quick_action = int.parse(attr_content); + quickaction = int.parse(attr_content); break; case "name": name = attr_content; @@ -145,7 +145,7 @@ namespace Pies { string icon=""; string command=""; string type=""; - bool quick_action = false; + bool quickaction = false; // parse all attributes of this node for (Xml.Attr* attribute = slice->properties; attribute != null; attribute = attribute->next) { @@ -166,7 +166,7 @@ namespace Pies { type = attr_content; break; case "quickaction": - quick_action = bool.parse(attr_content); + quickaction = bool.parse(attr_content); break; default: warning("Invalid attribute \"" + attr_name + "\" in element in pies.conf!"); @@ -174,19 +174,8 @@ namespace Pies { } } - Action action = null; - // create a new Action according to the loaded type - foreach (var action_type in ActionRegistry.types) { - if (ActionRegistry.settings_names[action_type] == type) { - - action = GLib.Object.new(action_type, "name", name, - "icon", icon, - "real_command", command, - "is_quick_action", quick_action) as Action; - break; - } - } + Action action = ActionRegistry.create_action(type, name, icon, command, quickaction); if (action != null) pie.add_action(action); } @@ -213,15 +202,7 @@ namespace Pies { } } - ActionGroup group = null; - - // create a new ActionGroup according to the loaded type - foreach (var group_type in GroupRegistry.types) { - if (GroupRegistry.settings_names[group_type] == type) { - group = GLib.Object.new(group_type, "parent_id", pie.id) as ActionGroup; - break; - } - } + ActionGroup group = GroupRegistry.create_group(type, pie.id); if (group != null) pie.add_group(group); } diff --git a/src/pies/pie.vala b/src/pies/pie.vala index 0f87d8f..fa205c7 100644 --- a/src/pies/pie.vala +++ b/src/pies/pie.vala @@ -29,14 +29,14 @@ public class Pie : GLib.Object { /// The name of this Pie. It has not to be unique. ///////////////////////////////////////////////////////////////////// - public string name { get; construct; } + public string name { get; set; } ///////////////////////////////////////////////////////////////////// /// The name of the icon to be used for this Pie. It should exist in /// the users current icon theme, else a standard icon will be used. ///////////////////////////////////////////////////////////////////// - public string icon { get; construct; } + public string icon { get; set; } ///////////////////////////////////////////////////////////////////// /// The ID of this Pie. It has to be unique among all Pies. This ID @@ -77,18 +77,44 @@ public class Pie : GLib.Object { /// Adds an Action to this Pie. ///////////////////////////////////////////////////////////////////// - public void add_action(Action action) { + public void add_action(Action action, int at_position = -1) { var group = new ActionGroup(this.id); group.add_action(action); - this.add_group(group); + this.add_group(group, at_position); } ///////////////////////////////////////////////////////////////////// /// Adds an ActionGroup to this Pie. ///////////////////////////////////////////////////////////////////// - public void add_group(ActionGroup group) { - this.action_groups.add(group); + public void add_group(ActionGroup group, int at_position = -1) { + if (group.has_quickaction()) { + foreach (var action_group in action_groups) + action_group.disable_quickactions(); + } + + if (at_position < 0 || at_position >= this.action_groups.size) + this.action_groups.add(group); + else + this.action_groups.insert(at_position, group); + } + + public void remove_group(int index) { + if (this.action_groups.size > index) + this.action_groups.remove_at(index); + } + + public void move_group(int from, int to) { + if (this.action_groups.size > from && this.action_groups.size > to) { + var tmp = this.action_groups[from]; + this.remove_group(from); + this.add_group(tmp, to); + } + } + + public void update_group(ActionGroup group, int index) { + if (this.action_groups.size > index) + this.action_groups.set(index, group); } } diff --git a/src/pies/pieManager.vala b/src/pies/pieManager.vala index 5f84ea0..0263d23 100644 --- a/src/pies/pieManager.vala +++ b/src/pies/pieManager.vala @@ -31,6 +31,13 @@ public class PieManager : GLib.Object { public static Gee.HashMap all_pies { get; private set; } + ///////////////////////////////////////////////////////////////////// + /// Stores all PieWindows which are currently opened. Should be + /// rarely more than two... + ///////////////////////////////////////////////////////////////////// + + public static Gee.HashSet opened_windows { get; private set; } + ///////////////////////////////////////////////////////////////////// /// Stores all global hotkeys. ///////////////////////////////////////////////////////////////////// @@ -42,7 +49,7 @@ public class PieManager : GLib.Object { /// will be false already. ///////////////////////////////////////////////////////////////////// - private static bool a_pie_is_opened = false; + private static bool a_pie_is_active = false; ///////////////////////////////////////////////////////////////////// /// Initializes all Pies. They are loaded from the pies.conf file. @@ -50,6 +57,7 @@ public class PieManager : GLib.Object { public static void init() { all_pies = new Gee.HashMap(); + opened_windows = new Gee.HashSet(); bindings = new BindingManager(); // load all Pies from th pies.conf file @@ -66,19 +74,27 @@ public class PieManager : GLib.Object { ///////////////////////////////////////////////////////////////////// public static void open_pie(string id) { - if (!a_pie_is_opened) { + if (!a_pie_is_active) { Pie? pie = all_pies[id]; if (pie != null) { - a_pie_is_opened = true; + a_pie_is_active = true; var window = new PieWindow(); window.load_pie(pie); window.open(); + opened_windows.add(window); + + window.on_closed.connect(() => { + opened_windows.remove(window); + }); + window.on_closing.connect(() => { - a_pie_is_opened = false; + a_pie_is_active = false; }); + + } else { warning("Failed to open pie with ID \"" + id + "\": ID does not exist!"); } @@ -102,6 +118,15 @@ public class PieManager : GLib.Object { return bindings.get_accelerator_label_of(id); } + ///////////////////////////////////////////////////////////////////// + /// Bind the Pie with the given ID to the given trigger. + ///////////////////////////////////////////////////////////////////// + + public static void bind_trigger(Trigger trigger, string id) { + bindings.unbind(id); + bindings.bind(trigger, id); + } + ///////////////////////////////////////////////////////////////////// /// Returns true if the pie with the given id is in turbo mode. ///////////////////////////////////////////////////////////////////// @@ -110,6 +135,15 @@ public class PieManager : GLib.Object { return bindings.get_is_turbo(id); } + ///////////////////////////////////////////////////////////////////// + /// Returns true if the pie with the given id opens in the middle of + /// the screen. + ///////////////////////////////////////////////////////////////////// + + public static bool get_is_centered(string id) { + return bindings.get_is_centered(id); + } + ///////////////////////////////////////////////////////////////////// /// Returns the name of the Pie with the given ID. ///////////////////////////////////////////////////////////////////// @@ -212,7 +246,11 @@ public class PieManager : GLib.Object { } } - private static void create_launcher(string id) { + ///////////////////////////////////////////////////////////////////// + /// Creates a desktop file for which opens the Pie with given ID. + ///////////////////////////////////////////////////////////////////// + + public static void create_launcher(string id) { if (all_pies.has_key(id)) { Pie? pie = all_pies[id]; @@ -220,7 +258,7 @@ public class PieManager : GLib.Object { "#!/usr/bin/env xdg-open\n" + "[Desktop Entry]\n" + "Name=%s\n".printf(pie.name) + - "Exec=gnome-pie -o %s\n".printf(pie.id) + + "Exec=%s -o %s\n".printf(Paths.executable, pie.id) + "Encoding=UTF-8\n" + "Type=Application\n" + "Icon=%s\n".printf(pie.icon); @@ -237,6 +275,10 @@ public class PieManager : GLib.Object { } } + ///////////////////////////////////////////////////////////////////// + /// Deletes the desktop file for the Pie with the given ID. + ///////////////////////////////////////////////////////////////////// + private static void remove_launcher(string id) { string launcher = Paths.launchers + "/%s.desktop".printf(id); if (FileUtils.test(launcher, FileTest.EXISTS)) { diff --git a/src/pies/save.vala b/src/pies/save.vala index d691a95..c940e5a 100644 --- a/src/pies/save.vala +++ b/src/pies/save.vala @@ -55,18 +55,18 @@ namespace Pies { if (group.get_type().depth() == 2) { foreach (var action in group.actions) { writer.start_element("slice"); - writer.write_attribute("type", ActionRegistry.settings_names[action.get_type()]); - if (ActionRegistry.icon_name_editables[action.get_type()]) { + writer.write_attribute("type", ActionRegistry.descriptions[action.get_type().name()].id); + if (ActionRegistry.descriptions[action.get_type().name()].icon_name_editable) { writer.write_attribute("name", action.name); writer.write_attribute("icon", action.icon); } writer.write_attribute("command", action.real_command); - writer.write_attribute("quickAction", action.is_quick_action ? "true" : "false"); + writer.write_attribute("quickAction", action.is_quickaction ? "true" : "false"); writer.end_element(); } } else { writer.start_element("group"); - writer.write_attribute("type", GroupRegistry.settings_names[group.get_type()]); + writer.write_attribute("type", GroupRegistry.descriptions[group.get_type().name()].id); writer.end_element(); } } diff --git a/src/renderers/pieRenderer.vala b/src/renderers/pieRenderer.vala index ffaf776..67a6b56 100644 --- a/src/renderers/pieRenderer.vala +++ b/src/renderers/pieRenderer.vala @@ -31,7 +31,7 @@ public class PieRenderer : GLib.Object { /// gets executed when the user clicks on the middle of the pie) ///////////////////////////////////////////////////////////////////// - public int quick_action { get; private set; } + public int quickaction { get; private set; } ///////////////////////////////////////////////////////////////////// /// The index of the currently active slice. @@ -83,13 +83,13 @@ public class PieRenderer : GLib.Object { public PieRenderer() { this.slices = new Gee.ArrayList(); this.center = new CenterRenderer(this); - this.quick_action = -1; + this.quickaction = -1; this.active_slice = -2; this.size = 0; } ///////////////////////////////////////////////////////////////////// - /// Loads an Pie. All members are initialized accordingly. + /// Loads a Pie. All members are initialized accordingly. ///////////////////////////////////////////////////////////////////// public void load_pie(Pie pie) { @@ -102,8 +102,8 @@ public class PieRenderer : GLib.Object { this.slices.add(renderer); renderer.load(action, slices.size-1); - if (action.is_quick_action) { - this.quick_action = count; + if (action.is_quickaction) { + this.quickaction = count; } ++count; @@ -112,7 +112,7 @@ public class PieRenderer : GLib.Object { this.turbo_mode = PieManager.get_is_turbo(pie.id); - this.set_highlighted_slice(this.quick_action); + this.set_highlighted_slice(this.quickaction); this.size = (int)fmax(2*Config.global.theme.radius + 2*Config.global.theme.slice_radius*Config.global.theme.max_zoom, 2*Config.global.theme.center_radius); @@ -227,39 +227,41 @@ public class PieRenderer : GLib.Object { ///////////////////////////////////////////////////////////////////// public void draw(double frame_time, Cairo.Context ctx, int mouse_x, int mouse_y) { - double distance = sqrt(mouse_x*mouse_x + mouse_y*mouse_y); - double angle = 0.0; + if (this.size > 0) { + double distance = sqrt(mouse_x*mouse_x + mouse_y*mouse_y); + double angle = 0.0; - if (this.key_board_control) { - angle = 2.0*PI*this.active_slice/(double)slice_count(); - } else { - - if (distance > 0) { - angle = acos(mouse_x/distance); - if (mouse_y < 0) - angle = 2*PI - angle; - } + if (this.key_board_control) { + angle = 2.0*PI*this.active_slice/(double)slice_count(); + } else { - int next_active_slice = this.active_slice; + if (distance > 0) { + angle = acos(mouse_x/distance); + if (mouse_y < 0) + angle = 2*PI - angle; + } + + int next_active_slice = this.active_slice; + + if (distance < Config.global.theme.active_radius + && this.quickaction >= 0 && this.quickaction < this.slices.size) { + + next_active_slice = this.quickaction; + angle = 2.0*PI*quickaction/(double)slice_count(); + } else if (distance > Config.global.theme.active_radius && this.slice_count() > 0) { + next_active_slice = (int)(angle*slices.size/(2*PI) + 0.5) % this.slice_count(); + } else { + next_active_slice = -1; + } - if (distance < Config.global.theme.active_radius - && this.quick_action >= 0 && this.quick_action < this.slices.size) { - - next_active_slice = this.quick_action; - angle = 2.0*PI*quick_action/(double)slice_count(); - } else if (distance > Config.global.theme.active_radius && this.slice_count() > 0) { - next_active_slice = (int)(angle*slices.size/(2*PI) + 0.5) % this.slice_count(); - } else { - next_active_slice = -1; + this.set_highlighted_slice(next_active_slice); } - - this.set_highlighted_slice(next_active_slice); - } - center.draw(frame_time, ctx, angle, distance); - - foreach (var slice in this.slices) - slice.draw(frame_time, ctx, angle, distance); + center.draw(frame_time, ctx, angle, distance); + + foreach (var slice in this.slices) + slice.draw(frame_time, ctx, angle, distance); + } } ///////////////////////////////////////////////////////////////////// @@ -278,8 +280,8 @@ public class PieRenderer : GLib.Object { if (index != this.active_slice) { if (index >= 0 && index < this.slice_count()) this.active_slice = index; - else if (this.quick_action >= 0) - this.active_slice = this.quick_action; + else if (this.quickaction >= 0) + this.active_slice = this.quickaction; else this.active_slice = -1; diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index 59117df..0a26110 100644 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -31,6 +31,19 @@ public class PieWindow : Gtk.Window { public signal void on_closing(); + ///////////////////////////////////////////////////////////////////// + /// Signal which gets emitted when the PieWindow is closed. + ///////////////////////////////////////////////////////////////////// + + public signal void on_closed(); + + ///////////////////////////////////////////////////////////////////// + /// The background image used for fake transparency if + /// has_compositing is false. + ///////////////////////////////////////////////////////////////////// + + public Image background { get; private set; default=null; } + ///////////////////////////////////////////////////////////////////// /// The owned renderer. ///////////////////////////////////////////////////////////////////// @@ -55,13 +68,6 @@ public class PieWindow : Gtk.Window { private bool has_compositing = false; - ///////////////////////////////////////////////////////////////////// - /// The background image used for fake transparency if - /// has_compositing is false. - ///////////////////////////////////////////////////////////////////// - - private Image background = null; - ///////////////////////////////////////////////////////////////////// /// C'tor, sets up the window. ///////////////////////////////////////////////////////////////////// @@ -73,7 +79,7 @@ public class PieWindow : Gtk.Window { this.set_skip_taskbar_hint(true); this.set_skip_pager_hint(true); this.set_keep_above(true); - this.set_type_hint(Gdk.WindowTypeHint.SPLASHSCREEN); + this.set_type_hint(Gdk.WindowTypeHint.UTILITY); this.set_decorated(false); this.set_resizable(false); this.icon_name = "gnome-pie"; @@ -81,7 +87,11 @@ public class PieWindow : Gtk.Window { // check for compositing if (this.screen.is_composited()) { - this.set_colormap(this.screen.get_rgba_colormap()); + #if HAVE_GTK_3 + this.set_visual(this.screen.get_rgba_visual()); + #else + this.set_colormap(this.screen.get_rgba_colormap()); + #endif this.has_compositing = true; } @@ -128,9 +138,18 @@ public class PieWindow : Gtk.Window { this.renderer.on_mouse_move(); return true; }); + + this.show.connect_after(() => { + Gtk.grab_add(this); + FocusGrabber.grab(this.get_window(), true, true, false); + }); // draw the pie on expose - this.expose_event.connect(this.draw); + #if HAVE_GTK_3 + this.draw.connect(this.draw_window); + #else + this.expose_event.connect(this.draw_window); + #endif } ///////////////////////////////////////////////////////////////////// @@ -139,7 +158,7 @@ public class PieWindow : Gtk.Window { public void load_pie(Pie pie) { this.renderer.load_pie(pie); - this.set_window_position(); + this.set_window_position(pie); this.set_size_request(renderer.size, renderer.size); } @@ -160,7 +179,6 @@ public class PieWindow : Gtk.Window { // capture the input focus this.show(); - FocusGrabber.grab(this); // start the timer this.timer = new GLib.Timer(); @@ -178,10 +196,13 @@ public class PieWindow : Gtk.Window { /// Draw the Pie. ///////////////////////////////////////////////////////////////////// - private bool draw(Gtk.Widget da, Gdk.EventExpose event) { - // clear the window - var ctx = Gdk.cairo_create(this.window); - + #if HAVE_GTK_3 + private bool draw_window(Cairo.Context ctx) { + #else + private bool draw_window(Gtk.Widget da, Gdk.EventExpose event) { + // clear the window + var ctx = Gdk.cairo_create(this.get_window()); + #endif // paint the background image if there is no compositing if (this.has_compositing) { ctx.set_operator (Cairo.Operator.CLEAR); @@ -219,12 +240,13 @@ public class PieWindow : Gtk.Window { if (!this.closing) { this.closing = true; this.on_closing(); - FocusGrabber.ungrab(this); + Gtk.grab_remove(this); + FocusGrabber.ungrab(); this.renderer.activate(); Timeout.add((uint)(Config.global.theme.fade_out_time*1000), () => { + this.on_closed(); this.destroy(); - ThemedIcon.clear_cache(); return false; }); } @@ -238,12 +260,13 @@ public class PieWindow : Gtk.Window { if (!this.closing) { this.closing = true; this.on_closing(); - FocusGrabber.ungrab(this); + Gtk.grab_remove(this); + FocusGrabber.ungrab(); this.renderer.cancel(); Timeout.add((uint)(Config.global.theme.fade_out_time*1000), () => { + this.on_closed(); this.destroy(); - ThemedIcon.clear_cache(); return false; }); } @@ -254,9 +277,9 @@ public class PieWindow : Gtk.Window { /// the mouse. ///////////////////////////////////////////////////////////////////// - private void set_window_position() { - if(Config.global.open_at_mouse) this.set_position(Gtk.WindowPosition.MOUSE); - else this.set_position(Gtk.WindowPosition.CENTER); + private void set_window_position(Pie pie) { + if(PieManager.get_is_centered(pie.id)) this.set_position(Gtk.WindowPosition.CENTER); + else this.set_position(Gtk.WindowPosition.MOUSE); } ///////////////////////////////////////////////////////////////////// diff --git a/src/renderers/sliceRenderer.vala b/src/renderers/sliceRenderer.vala index 61c50b1..4803070 100644 --- a/src/renderers/sliceRenderer.vala +++ b/src/renderers/sliceRenderer.vala @@ -20,7 +20,7 @@ using GLib.Math; namespace GnomePie { ///////////////////////////////////////////////////////////////////////// -/// Renders a Slice of a Pie. According to the current theme. +/// Renders a Slice of a Pie. According to the current theme. ///////////////////////////////////////////////////////////////////////// public class SliceRenderer : GLib.Object { @@ -123,7 +123,9 @@ public class SliceRenderer : GLib.Object { this.caption = new RenderedText(action.name, Config.global.theme.caption_width, Config.global.theme.caption_height, - Config.global.theme.caption_font); + Config.global.theme.caption_font, + Config.global.theme.caption_color, + Config.global.global_scale); this.active_icon = new ThemedIcon(action.icon, true); this.inactive_icon = new ThemedIcon(action.icon, false); @@ -138,7 +140,8 @@ public class SliceRenderer : GLib.Object { } this.hotkey = new RenderedText(hotkey_label, (int)Config.global.theme.slice_radius*2, - (int)Config.global.theme.slice_radius*2, "sans 20"); + (int)Config.global.theme.slice_radius*2, "sans 20", + Config.global.theme.caption_color, Config.global.global_scale); } ///////////////////////////////////////////////////////////////////// @@ -185,6 +188,13 @@ public class SliceRenderer : GLib.Object { ///////////////////////////////////////////////////////////////////// public void draw(double frame_time, Cairo.Context ctx, double angle, double distance) { + + // update the AnimatedValues + this.scale.update(frame_time); + this.alpha.update(frame_time); + this.fade.update(frame_time); + this.fade_scale.update(frame_time); + this.fade_rotation.update(frame_time); double direction = 2.0 * PI * position/parent.slice_count() + this.fade_rotation.val; double max_scale = 1.0/Config.global.theme.max_zoom; @@ -205,13 +215,6 @@ public class SliceRenderer : GLib.Object { if (fabs(this.scale.end - max_scale) > Config.global.theme.max_zoom*0.005) this.scale.reset_target(max_scale, Config.global.theme.transition_time); - // update the AnimatedValues - this.scale.update(frame_time); - this.alpha.update(frame_time); - this.fade.update(frame_time); - this.fade_scale.update(frame_time); - this.fade_rotation.update(frame_time); - ctx.save(); // distance from the center diff --git a/src/themes/theme.vala b/src/themes/theme.vala index 284e1ef..269a574 100644 --- a/src/themes/theme.vala +++ b/src/themes/theme.vala @@ -55,6 +55,7 @@ public class Theme : GLib.Object { public int caption_height {get; private set; default=100;} public double caption_position {get; private set; default=0.0;} public Color caption_color {get; private set; default=new Color();} + public Icon preview_icon {get; private set; default=new Icon("gnome-pie", 36);} public Gee.ArrayList center_layers {get; private set;} public Gee.ArrayList active_slice_layers {get; private set;} @@ -82,6 +83,8 @@ public class Theme : GLib.Object { this.center_layers.clear(); this.active_slice_layers.clear(); this.inactive_slice_layers.clear(); + + this.preview_icon = new Icon(this.directory + "/preview.png", 36); Xml.Parser.init(); string path = this.directory + "/theme.xml"; diff --git a/src/utilities/animatedValue.vala b/src/utilities/animatedValue.vala index 32ab889..7acc7a7 100644 --- a/src/utilities/animatedValue.vala +++ b/src/utilities/animatedValue.vala @@ -116,10 +116,16 @@ public class AnimatedValue : GLib.Object { ///////////////////////////////////////////////////////////////////// public void reset_target(double end, double duration) { - this.start = this.val; this.end = end; this.duration = duration; - this.state = 0.0; + this.start = this.val; + + if (duration == 0.0) { + this.val = end; + this.state = 1.0; + } else { + this.state = 0.0; + } } ///////////////////////////////////////////////////////////////////// @@ -129,7 +135,7 @@ public class AnimatedValue : GLib.Object { public void update(double time) { this.state += time/this.duration; - if (state < 1) { + if (this.state < 1) { switch (this.type) { case Type.LINEAR: @@ -152,6 +158,7 @@ public class AnimatedValue : GLib.Object { } break; } + } else if (this.val != this.end) { this.val = this.end; } diff --git a/src/utilities/bindingManager.vala b/src/utilities/bindingManager.vala index 437f4c1..5a4548e 100644 --- a/src/utilities/bindingManager.vala +++ b/src/utilities/bindingManager.vala @@ -54,6 +54,12 @@ public class BindingManager : GLib.Object { Gdk.ModifierType.MOD2_MASK|Gdk.ModifierType.LOCK_MASK|Gdk.ModifierType.MOD5_MASK }; + ///////////////////////////////////////////////////////////////////// + /// Some variables to remember which delayed binding was delayed. + /// When the delay passes without another event indicating that the + /// Trigger was released, the stored binding will be activated. + ///////////////////////////////////////////////////////////////////// + private uint32 delayed_count = 0; private X.Event? delayed_event = null; private Keybinding? delayed_binding = null; @@ -91,9 +97,8 @@ public class BindingManager : GLib.Object { public void bind(Trigger trigger, string id) { if(trigger.key_code != 0) { - Gdk.Window rootwin = Gdk.get_default_root_window(); - X.Display display = Gdk.x11_drawable_get_xdisplay(rootwin); - X.ID xid = Gdk.x11_drawable_get_xid(rootwin); + X.Display display = Gdk.x11_get_default_xdisplay(); + X.ID xid = Gdk.x11_get_default_root_xwindow(); Gdk.error_trap_push(); @@ -121,9 +126,9 @@ public class BindingManager : GLib.Object { ///////////////////////////////////////////////////////////////////// public void unbind(string id) { - Gdk.Window rootwin = Gdk.get_default_root_window(); - X.Display display = Gdk.x11_drawable_get_xdisplay(rootwin); - X.ID xid = Gdk.x11_drawable_get_xid(rootwin); + X.Display display = Gdk.x11_get_default_xdisplay(); + X.ID xid = Gdk.x11_get_default_root_xwindow(); + Gee.List remove_bindings = new Gee.ArrayList(); foreach(var binding in bindings) { if(id == binding.id) { @@ -184,6 +189,20 @@ public class BindingManager : GLib.Object { return false; } + ///////////////////////////////////////////////////////////////////// + /// Returns whether the pie with the given ID opens centered. + ///////////////////////////////////////////////////////////////////// + + public bool get_is_centered(string id) { + foreach (var binding in bindings) { + if (binding.id == id) { + return binding.trigger.centered; + } + } + + return false; + } + ///////////////////////////////////////////////////////////////////// /// Returns the name ID of the Pie bound to the given Trigger. /// Returns "" if there is nothing bound to this trigger. @@ -258,8 +277,7 @@ public class BindingManager : GLib.Object { // if the trigger is released and an event is currently waiting // simulate that the trigger has been pressed without any inter- // ference of Gnome-Pie - Gdk.Window rootwin = Gdk.get_default_root_window(); - X.Display display = Gdk.x11_drawable_get_xdisplay(rootwin); + X.Display display = Gdk.x11_get_default_xdisplay(); // unbind the trigger, else we'll capture that event again ;) unbind(delayed_binding.id); diff --git a/src/utilities/config.vala b/src/utilities/config.vala index cf4311d..5790eef 100644 --- a/src/utilities/config.vala +++ b/src/utilities/config.vala @@ -55,7 +55,6 @@ public class Config : GLib.Object { public double refresh_rate { get; set; default = 60.0; } public double global_scale { get; set; default = 1.0; } public bool show_indicator { get; set; default = true; } - public bool open_at_mouse { get; set; default = true; } public bool auto_start { get; set; default = false; } public Gee.ArrayList themes { get; private set; } @@ -71,7 +70,6 @@ public class Config : GLib.Object { writer.write_attribute("refresh_rate", refresh_rate.to_string()); writer.write_attribute("global_scale", global_scale.to_string()); writer.write_attribute("show_indicator", show_indicator ? "true" : "false"); - writer.write_attribute("open_at_mouse", open_at_mouse ? "true" : "false"); writer.end_element(); writer.end_document(); } @@ -114,9 +112,6 @@ public class Config : GLib.Object { case "show_indicator": show_indicator = bool.parse(attr_content); break; - case "open_at_mouse": - open_at_mouse = bool.parse(attr_content); - break; default: warning("Invalid setting \"" + attr_name + "\" in gnome-pie.conf!"); break; diff --git a/src/utilities/focusGrabber.vala b/src/utilities/focusGrabber.vala index 0e07b39..293e103 100644 --- a/src/utilities/focusGrabber.vala +++ b/src/utilities/focusGrabber.vala @@ -25,48 +25,95 @@ public class FocusGrabber : GLib.Object { ///////////////////////////////////////////////////////////////////// /// Utilities for grabbing focus. - /// Code from Gnome-Do/Synapse. + /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - public static void grab(Gtk.Window window) { - window.present_with_time(Gdk.CURRENT_TIME); - window.get_window().raise(); - window.get_window().focus(Gdk.CURRENT_TIME); + public static void grab(Gdk.Window window, bool keyboard = true, bool pointer = true, bool owner_events = true) { + if (keyboard || pointer) { + window.raise(); + window.focus(Gdk.CURRENT_TIME); - int i = 0; - Timeout.add(100, () => { - if (++i >= 100) return false; - return !try_grab_window(window); - }); + if (!try_grab_window(window, keyboard, pointer, owner_events)) { + int i = 0; + Timeout.add(100, () => { + if (++i >= 100) return false; + return !try_grab_window(window, keyboard, pointer, owner_events); + }); + } + } } ///////////////////////////////////////////////////////////////////// - /// Code from Gnome-Do/Synapse. + /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - public static void ungrab(Gtk.Window window) { - Gdk.pointer_ungrab(Gdk.CURRENT_TIME); - Gdk.keyboard_ungrab(Gdk.CURRENT_TIME); - Gtk.grab_remove(window); + public static void ungrab(bool keyboard = true, bool pointer = true) { + #if HAVE_GTK_3 + + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); + + unowned GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + foreach(var device in list) { + if ((device.input_source == Gdk.InputSource.KEYBOARD && keyboard) + || (device.input_source != Gdk.InputSource.KEYBOARD && pointer)) + + device.ungrab(Gdk.CURRENT_TIME); + } + + #else + + if (pointer) Gdk.pointer_ungrab(Gdk.CURRENT_TIME); + if (keyboard) Gdk.keyboard_ungrab(Gdk.CURRENT_TIME); + + #endif } ///////////////////////////////////////////////////////////////////// - /// Code from Gnome-Do/Synapse. + /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - private static bool try_grab_window(Gtk.Window window) { - if (Gdk.pointer_grab(window.get_window(), true, Gdk.EventMask.BUTTON_PRESS_MASK | - Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK, - null, null, Gdk.CURRENT_TIME) == Gdk.GrabStatus.SUCCESS) { + private static bool try_grab_window(Gdk.Window window, bool keyboard, bool pointer, bool owner_events) { + #if HAVE_GTK_3 + + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); - if (Gdk.keyboard_grab(window.get_window(), true, Gdk.CURRENT_TIME) == Gdk.GrabStatus.SUCCESS) { - Gtk.grab_add(window); + bool grabbed_all = true; + + unowned GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + foreach(var device in list) { + if ((device.input_source == Gdk.InputSource.KEYBOARD && keyboard) + || (device.input_source != Gdk.InputSource.KEYBOARD && pointer)) { + + var status = device.grab(window, Gdk.GrabOwnership.APPLICATION, owner_events, + Gdk.EventMask.ALL_EVENTS_MASK, null, Gdk.CURRENT_TIME); + + if (status != Gdk.GrabStatus.SUCCESS) + grabbed_all = false; + } + } + + if (grabbed_all) return true; - } else { - Gdk.pointer_ungrab(Gdk.CURRENT_TIME); - return false; + + ungrab(keyboard, pointer); + + #else + + if (!pointer || Gdk.pointer_grab(window, owner_events, Gdk.EventMask.BUTTON_PRESS_MASK | + Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK, + null, null, Gdk.CURRENT_TIME) == Gdk.GrabStatus.SUCCESS) { + + if (!keyboard || Gdk.keyboard_grab(window, owner_events, Gdk.CURRENT_TIME) == Gdk.GrabStatus.SUCCESS) { + return true; + } else if (pointer) { + ungrab(false, true); + return false; + } } - } + #endif + return false; } } diff --git a/src/utilities/key.vala b/src/utilities/key.vala index 6700b16..5f27a1e 100644 --- a/src/utilities/key.vala +++ b/src/utilities/key.vala @@ -54,11 +54,22 @@ public class Key : GLib.Object { private int key_code; private Gdk.ModifierType modifiers; + ///////////////////////////////////////////////////////////////////// + /// C'tor, initializes all members to defaults. + ///////////////////////////////////////////////////////////////////// + + public Key() { + this.accelerator = ""; + this.modifiers = 0; + this.key_code = 0; + this.label = _("Not bound"); + } + ///////////////////////////////////////////////////////////////////// /// C'tor, initializes all members. ///////////////////////////////////////////////////////////////////// - public Key(string stroke) { + public Key.from_string(string stroke) { this.accelerator = stroke; uint keysym; @@ -67,6 +78,17 @@ public class Key : GLib.Object { this.label = Gtk.accelerator_get_label(keysym, this.modifiers); } + ///////////////////////////////////////////////////////////////////// + /// C'tor, initializes all members. + ///////////////////////////////////////////////////////////////////// + + public Key.from_values(uint keysym, Gdk.ModifierType modifiers) { + this.accelerator = Gtk.accelerator_name(keysym, modifiers); + this.label = Gtk.accelerator_get_label(keysym, modifiers); + this.key_code = display.keysym_to_keycode(keysym); + this.modifiers = modifiers; + } + ///////////////////////////////////////////////////////////////////// /// Initializes static members. ///////////////////////////////////////////////////////////////////// @@ -113,7 +135,7 @@ public class Key : GLib.Object { private Gdk.ModifierType get_modifiers() { Gdk.ModifierType modifiers; - Gdk.Display.get_default().get_pointer(null, null, null, out modifiers); + Gtk.get_current_event_state(out modifiers); return modifiers; } diff --git a/src/utilities/paths.vala b/src/utilities/paths.vala index 1c42176..589cc36 100644 --- a/src/utilities/paths.vala +++ b/src/utilities/paths.vala @@ -59,6 +59,13 @@ public class Paths : GLib.Object { public static string locales { get; private set; default=""; } + ///////////////////////////////////////////////////////////////////// + /// The directory containing UI declaration files + /// usually /usr/share/gnome-pie/ui/. + ///////////////////////////////////////////////////////////////////// + + public static string ui_files { get; private set; default=""; } + ///////////////////////////////////////////////////////////////////// /// The autostart file of gnome-pie_config /// usually ~/.config/autostart/gnome-pie.desktop. @@ -73,44 +80,48 @@ public class Paths : GLib.Object { public static string launchers { get; private set; default=""; } + ///////////////////////////////////////////////////////////////////// + /// The path to the executable. + ///////////////////////////////////////////////////////////////////// + + public static string executable { get; private set; default=""; } + ///////////////////////////////////////////////////////////////////// /// Initializes all values above. ///////////////////////////////////////////////////////////////////// public static void init() { - // append resources to icon search path to icon theme, if neccasary + // get path of executable try { - var icon_dir = GLib.File.new_for_path(GLib.Path.get_dirname( - GLib.FileUtils.read_link("/proc/self/exe"))).get_child("resources"); - - if (icon_dir.query_exists()) { - string path = icon_dir.get_path(); - Gtk.IconTheme.get_default().append_search_path(path); - } - - Gtk.IconTheme.get_default().append_search_path("/usr/share/pixmaps/"); - + executable = GLib.File.new_for_path(GLib.FileUtils.read_link("/proc/self/exe")).get_path(); } catch (GLib.FileError e) { warning("Failed to get path of executable!"); } + // append resources to icon search path to icon theme, if neccasary + var icon_dir = GLib.File.new_for_path(GLib.Path.get_dirname(executable)).get_child("resources"); + + if (icon_dir.query_exists()) { + string path = icon_dir.get_path(); + Gtk.IconTheme.get_default().append_search_path(path); + } + + Gtk.IconTheme.get_default().append_search_path("/usr/share/pixmaps/"); + // get global paths var default_dir = GLib.File.new_for_path("/usr/share/gnome-pie/"); if(!default_dir.query_exists()) { default_dir = GLib.File.new_for_path("/usr/local/share/gnome-pie/"); if(!default_dir.query_exists()) { - try { - default_dir = GLib.File.new_for_path(GLib.Path.get_dirname( - GLib.FileUtils.read_link("/proc/self/exe"))).get_child("resources"); - } catch (GLib.FileError e) { - warning("Failed to get path of executable!"); - } + default_dir = GLib.File.new_for_path(GLib.Path.get_dirname( + executable)).get_child("resources"); } } global_themes = default_dir.get_path() + "/themes"; + ui_files = default_dir.get_path() + "/ui"; // get locales path var locale_dir = GLib.File.new_for_path("/usr/share/locale/de/LC_MESSAGES/gnomepie.mo"); @@ -121,22 +132,12 @@ public class Paths : GLib.Object { if(locale_dir.query_exists()) { locale_dir = GLib.File.new_for_path("/usr/local/share/locale"); } else { - - try { - locale_dir = GLib.File.new_for_path(GLib.Path.get_dirname( - GLib.FileUtils.read_link("/proc/self/exe"))).get_child( - "resources/locale/de/LC_MESSAGES/gnomepie.mo"); - } catch (GLib.FileError e) { - warning("Failed to get path of executable!"); - } + locale_dir = GLib.File.new_for_path(GLib.Path.get_dirname( + executable)).get_child("resources/locale/de/LC_MESSAGES/gnomepie.mo"); if(locale_dir.query_exists()) { - try { - locale_dir = GLib.File.new_for_path(GLib.Path.get_dirname( - GLib.FileUtils.read_link("/proc/self/exe"))).get_child("resources/locale"); - } catch (GLib.FileError e) { - warning("Failed to get path of executable!"); - } + locale_dir = GLib.File.new_for_path(GLib.Path.get_dirname( + executable)).get_child("resources/locale"); } } } @@ -204,7 +205,10 @@ public class Paths : GLib.Object { warning("Failed to find launchers directory!"); if (!GLib.File.new_for_path(global_themes).query_exists()) - warning("Failed to find global themes directory!"); + warning("Failed to find global themes directory!"); + + if (!GLib.File.new_for_path(ui_files).query_exists()) + warning("Failed to find UI files directory!"); } } diff --git a/src/utilities/trigger.vala b/src/utilities/trigger.vala index 1f6fcfe..4b6167b 100644 --- a/src/utilities/trigger.vala +++ b/src/utilities/trigger.vala @@ -80,6 +80,12 @@ public class Trigger : GLib.Object { public bool delayed { get; private set; default=false; } + ///////////////////////////////////////////////////////////////////// + /// True if the pie opens in the middle of the screen. + ///////////////////////////////////////////////////////////////////// + + public bool centered { get; private set; default=false; } + ///////////////////////////////////////////////////////////////////// /// C'tor, creates a new, "unbound" Trigger. ///////////////////////////////////////////////////////////////////// @@ -93,7 +99,7 @@ public class Trigger : GLib.Object { /// in this format: "[option(s)]button" where /// "" is something like "" or "", "button" /// something like "s", "F4" or "button0" and "[option]" is either - /// "[turbo]" or "["delayed"]". + /// "[turbo]", "[centered]" or "["delayed"]". ///////////////////////////////////////////////////////////////////// public Trigger.from_string(string trigger) { @@ -105,9 +111,12 @@ public class Trigger : GLib.Object { ///////////////////////////////////////////////////////////////////// public Trigger.from_values(uint key_sym, Gdk.ModifierType modifiers, - bool with_mouse, bool turbo, bool delayed ) { + bool with_mouse, bool turbo, bool delayed, + bool centered ) { - string trigger = (turbo ? "[turbo]" : "") + (delayed ? "[delayed]" : ""); + string trigger = (turbo ? "[turbo]" : "") + + (delayed ? "[delayed]" : "") + + (centered ? "[centered]" : ""); if (with_mouse) { trigger += Gtk.accelerator_name(0, modifiers) + "button%u".printf(key_sym); @@ -123,7 +132,7 @@ public class Trigger : GLib.Object { /// in this format: "[option(s)]button" where /// "" is something like "" or "", "button" /// something like "s", "F4" or "button0" and "[option]" is either - /// "[turbo]" or "["delayed"]". + /// "[turbo]", "[centered]" or "["delayed"]". ///////////////////////////////////////////////////////////////////// public void parse_string(string trigger) { @@ -135,10 +144,12 @@ public class Trigger : GLib.Object { this.turbo = check_string.contains("[turbo]"); this.delayed = check_string.contains("[delayed]"); + this.centered = check_string.contains("[centered]"); // remove optional arguments check_string = check_string.replace("[turbo]", ""); check_string = check_string.replace("[delayed]", ""); + check_string = check_string.replace("[centered]", ""); int button = this.get_mouse_button(check_string); if (button > 0) { @@ -177,12 +188,20 @@ public class Trigger : GLib.Object { this.label_with_specials = this.label; - if (this.turbo && this.delayed) - this.label_with_specials += ("\n" + _("Turbo") + " | " + _("Delayed") + ""); + if (this.turbo && this.delayed && this.centered) + this.label_with_specials += (" [ " + _("Turbo") + " | " + _("Delayed") + " | " + _("Centered") + " ]"); + else if (this.turbo && this.centered) + this.label_with_specials += (" [ " + _("Turbo") + " | " + _("Centered") + " ]"); + else if (this.turbo && this.delayed) + this.label_with_specials += (" [ " + _("Turbo") + " | " + _("Delayed") + " ]"); + else if (this.centered && this.delayed) + this.label_with_specials += (" [ " + _("Delayed") + " | " + _("Centered") + " ]"); else if (this.turbo) - this.label_with_specials += ("\n" + _("Turbo") + ""); + this.label_with_specials += (" [ " + _("Turbo") + " ]"); else if (this.delayed) - this.label_with_specials += ("\n" + _("Delayed") + ""); + this.label_with_specials += (" [ " + _("Delayed") + " ]"); + else if (this.centered) + this.label_with_specials += (" [ " + _("Centered") + " ]"); } else { this.set_unbound(); @@ -216,6 +235,7 @@ public class Trigger : GLib.Object { // remove optional arguments check_string = check_string.replace("[turbo]", ""); check_string = check_string.replace("[delayed]", ""); + check_string = check_string.replace("[centered]", ""); if (this.get_mouse_button(check_string) > 0) { // it seems to be a valid mouse-trigger so replace button part, diff --git a/vapi/libbamf3.vapi b/vapi/libbamf3.vapi new file mode 100644 index 0000000..1edeacc --- /dev/null +++ b/vapi/libbamf3.vapi @@ -0,0 +1,166 @@ +/* libbamf3.vapi generated by vapigen, do not modify. */ + +namespace Bamf { + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Application : Bamf.View { + [CCode (has_construct_function = false)] + protected Application (); + public unowned string get_application_type (); + public unowned string get_desktop_file (); + public bool get_show_menu_stubs (); + public unowned GLib.List get_windows (); + public unowned GLib.Array get_xids (); + public virtual signal void window_added (Bamf.View p0); + public virtual signal void window_removed (Bamf.View p0); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Control : GLib.Object { + [CCode (has_construct_function = false)] + protected Control (); + public static unowned Bamf.Control get_default (); + public void insert_desktop_file (string desktop_file); + public void register_application_for_pid (string application, int32 pid); + public void register_tab_provider (string path); + public void set_approver_behavior (int32 behavior); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Indicator : Bamf.View { + [CCode (has_construct_function = false)] + protected Indicator (); + public unowned string get_dbus_menu_path (); + public unowned string get_remote_address (); + public unowned string get_remote_path (); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Matcher : GLib.Object { + [CCode (has_construct_function = false)] + protected Matcher (); + public bool application_is_running (string application); + public unowned Bamf.Application get_active_application (); + public unowned Bamf.Window get_active_window (); + public unowned Bamf.Application get_application_for_desktop_file (string desktop_file_path, bool create_if_not_found); + public unowned Bamf.Application get_application_for_window (Bamf.Window window); + public unowned Bamf.Application get_application_for_xid (uint32 xid); + public unowned GLib.List get_applications (); + public static unowned Bamf.Matcher get_default (); + public unowned GLib.List get_running_applications (); + public unowned GLib.List get_tabs (); + public unowned GLib.List get_windows (); + public unowned GLib.Array get_xids_for_application (string application); + public void register_favorites (string favorites); + public virtual signal void active_application_changed (GLib.Object p0, GLib.Object p1); + public virtual signal void active_window_changed (GLib.Object p0, GLib.Object p1); + public virtual signal void view_closed (GLib.Object p0); + public virtual signal void view_opened (GLib.Object p0); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Tab : Bamf.View { + [CCode (has_construct_function = false)] + public Tab (string id, string uri); + public unowned string get_id (); + public unowned string get_preview (); + public unowned string get_uri (); + public void set_preview (string uri); + public void set_uri (string uri); + public virtual void show (); + [NoAccessorMethod] + public string id { owned get; set construct; } + public string preview { get; set; } + public string uri { get; set construct; } + public virtual signal void preview_updated (); + public virtual signal void uri_changed (string new_uri, string p1); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class TabSource : GLib.Object { + [CCode (has_construct_function = false)] + protected TabSource (); + public unowned string get_tab_ids (); + public unowned GLib.Array get_tab_preview (string tab_id); + public unowned string get_tab_uri (string tab_id); + public uint32 get_tab_xid (string tab_id); + public virtual void show_tab (string tab_id, GLib.Error error); + [NoWrapper] + public virtual unowned string tab_ids (); + [NoWrapper] + public virtual unowned GLib.Array tab_preview (string tab_id); + [NoWrapper] + public virtual unowned string tab_uri (string tab_id); + [NoWrapper] + public virtual uint32 tab_xid (string tab_id); + [NoAccessorMethod] + public string id { owned get; set construct; } + public virtual signal void tab_closed (string p0); + public virtual signal void tab_opened (string p0); + public virtual signal void tab_uri_changed (string p0, string p1, string p2); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class View : GLib.InitiallyUnowned { + [CCode (has_construct_function = false)] + protected View (); + [NoWrapper] + public virtual Bamf.ClickBehavior click_behavior (); + public virtual unowned GLib.List get_children (); + public Bamf.ClickBehavior get_click_suggestion (); + public virtual unowned string get_icon (); + public virtual unowned string get_name (); + public unowned string get_view_type (); + public virtual bool is_active (); + public bool is_closed (); + public virtual bool is_running (); + public bool is_sticky (); + public virtual bool is_urgent (); + [NoWrapper] + public virtual void set_path (string path); + public void set_sticky (bool value); + public bool user_visible (); + [NoWrapper] + public virtual unowned string view_type (); + [NoAccessorMethod] + public bool active { get; } + [NoAccessorMethod] + public string path { owned get; } + [NoAccessorMethod] + public bool running { get; } + [NoAccessorMethod] + public bool urgent { get; } + public virtual signal void active_changed (bool active); + public virtual signal void child_added (Bamf.View child); + public virtual signal void child_removed (Bamf.View child); + public virtual signal void closed (); + public virtual signal void name_changed (string old_name, string new_name); + public virtual signal void running_changed (bool running); + public virtual signal void urgent_changed (bool urgent); + public virtual signal void user_visible_changed (bool user_visible); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h")] + public class Window : Bamf.View { + [CCode (has_construct_function = false)] + protected Window (); + public unowned Bamf.Window get_transient (); + public Bamf.WindowType get_window_type (); + public uint32 get_xid (); + public ulong last_active (); + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h", cprefix = "BAMF_CLICK_BEHAVIOR_", has_type_id = false)] + public enum ClickBehavior { + NONE, + OPEN, + FOCUS, + FOCUS_ALL, + MINIMIZE, + RESTORE, + RESTORE_ALL, + PICKER + } + [CCode (cheader_filename = "libbamf3/libbamf/libbamf.h", cprefix = "BAMF_WINDOW_", has_type_id = false)] + public enum WindowType { + NORMAL, + DESKTOP, + DOCK, + DIALOG, + TOOLBAR, + MENU, + UTILITY, + SPLASHSCREEN + } +} diff --git a/vapi/libwnck-3.0.deps b/vapi/libwnck-3.0.deps new file mode 100644 index 0000000..85f5d99 --- /dev/null +++ b/vapi/libwnck-3.0.deps @@ -0,0 +1,2 @@ +gio-2.0 +gtk+-3.0 diff --git a/vapi/libwnck-3.0.vapi b/vapi/libwnck-3.0.vapi new file mode 100644 index 0000000..94c52a8 --- /dev/null +++ b/vapi/libwnck-3.0.vapi @@ -0,0 +1,369 @@ +/* libwnck-3.0.vapi generated by vapigen, do not modify. */ + +[CCode (cprefix = "Wnck", gir_namespace = "Wnck", gir_version = "3.0", lower_case_cprefix = "wnck_")] +namespace Wnck { + namespace Version { + [CCode (cheader_filename = "libwnck/libwnck.h", cname = "WNCK_MAJOR_VERSION")] + public const int MAJOR_VERSION; + [CCode (cheader_filename = "libwnck/libwnck.h", cname = "WNCK_MICRO_VERSION")] + public const int MICRO_VERSION; + [CCode (cheader_filename = "libwnck/libwnck.h", cname = "WNCK_MINOR_VERSION")] + public const int MINOR_VERSION; + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_action_menu_get_type ()")] + public class ActionMenu : Gtk.Menu, Atk.Implementor, Gtk.Buildable { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public ActionMenu (Wnck.Window window); + [NoAccessorMethod] + public void* window { get; construct; } + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_application_get_type ()")] + public class Application : GLib.Object { + [CCode (has_construct_function = false)] + protected Application (); + public static unowned Wnck.Application @get (ulong xwindow); + public unowned Gdk.Pixbuf get_icon (); + public bool get_icon_is_fallback (); + public unowned string get_icon_name (); + public unowned Gdk.Pixbuf get_mini_icon (); + public int get_n_windows (); + public unowned string get_name (); + public int get_pid (); + public unowned string get_startup_id (); + public unowned GLib.List get_windows (); + public ulong get_xid (); + public virtual signal void icon_changed (); + public virtual signal void name_changed (); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_class_group_get_type ()")] + public class ClassGroup : GLib.Object { + [CCode (has_construct_function = false)] + protected ClassGroup (); + public static unowned Wnck.ClassGroup @get (string id); + public unowned Gdk.Pixbuf get_icon (); + public unowned string get_id (); + public unowned Gdk.Pixbuf get_mini_icon (); + public unowned string get_name (); + public unowned string get_res_class (); + public unowned GLib.List get_windows (); + public virtual signal void icon_changed (); + public virtual signal void name_changed (); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_pager_get_type ()")] + public class Pager : Gtk.Widget, Atk.Implementor, Gtk.Buildable { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public Pager (); + public void set_display_mode (Wnck.PagerDisplayMode mode); + public bool set_n_rows (int n_rows); + public bool set_orientation (Gtk.Orientation orientation); + public void set_shadow_type (Gtk.ShadowType shadow_type); + public void set_show_all (bool show_all_workspaces); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_screen_get_type ()")] + public class Screen : GLib.Object { + [CCode (has_construct_function = false)] + protected Screen (); + public void calc_workspace_layout (int num_workspaces, int space_index, Wnck.WorkspaceLayout layout); + public void change_workspace_count (int count); + public void force_update (); + public static void free_workspace_layout (Wnck.WorkspaceLayout layout); + public static unowned Wnck.Screen @get (int index); + public unowned Wnck.Window get_active_window (); + public unowned Wnck.Workspace get_active_workspace (); + public ulong get_background_pixmap (); + public static unowned Wnck.Screen get_default (); + public static unowned Wnck.Screen get_for_root (ulong root_window_id); + public int get_height (); + public int get_number (); + public unowned Wnck.Window get_previously_active_window (); + public bool get_showing_desktop (); + public int get_width (); + public unowned string get_window_manager_name (); + public unowned GLib.List get_windows (); + public unowned GLib.List get_windows_stacked (); + public unowned Wnck.Workspace get_workspace (int workspace); + public int get_workspace_count (); + public unowned GLib.List get_workspaces (); + public void move_viewport (int x, int y); + public bool net_wm_supports (string atom); + public void release_workspace_layout (int current_token); + public void toggle_showing_desktop (bool show); + public int try_set_workspace_layout (int current_token, int rows, int columns); + public virtual signal void active_window_changed (Wnck.Window previous_window); + public virtual signal void active_workspace_changed (Wnck.Workspace previous_workspace); + public virtual signal void application_closed (Wnck.Application app); + public virtual signal void application_opened (Wnck.Application app); + public virtual signal void background_changed (); + public virtual signal void class_group_closed (Wnck.ClassGroup class_group); + public virtual signal void class_group_opened (Wnck.ClassGroup class_group); + public virtual signal void showing_desktop_changed (); + public virtual signal void viewports_changed (); + public virtual signal void window_closed (Wnck.Window window); + public virtual signal void window_manager_changed (); + public virtual signal void window_opened (Wnck.Window window); + public virtual signal void window_stacking_changed (); + public virtual signal void workspace_created (Wnck.Workspace space); + public virtual signal void workspace_destroyed (Wnck.Workspace space); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_selector_get_type ()")] + public class Selector : Gtk.MenuBar, Atk.Implementor, Gtk.Buildable { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public Selector (); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_tasklist_get_type ()")] + public class Tasklist : Gtk.Container, Atk.Implementor, Gtk.Buildable { + [CCode (has_construct_function = false, type = "GtkWidget*")] + public Tasklist (); + public int get_size_hint_list (int n_elements); + public void set_button_relief (Gtk.ReliefStyle relief); + public void set_grouping (Wnck.TasklistGroupingType grouping); + public void set_grouping_limit (int limit); + public void set_include_all_workspaces (bool include_all_workspaces); + public void set_switch_workspace_on_unminimize (bool switch_workspace_on_unminimize); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_window_get_type ()")] + public class Window : GLib.Object { + [CCode (has_construct_function = false)] + protected Window (); + public void activate (uint32 timestamp); + public void activate_transient (uint32 timestamp); + public void close (uint32 timestamp); + public static unowned Wnck.Window @get (ulong xwindow); + public Wnck.WindowActions get_actions (); + public unowned Wnck.Application get_application (); + public unowned Wnck.ClassGroup get_class_group (); + public unowned string get_class_group_name (); + public unowned string get_class_instance_name (); + public void get_client_window_geometry (out int xp, out int yp, out int widthp, out int heightp); + public void get_geometry (out int xp, out int yp, out int widthp, out int heightp); + public ulong get_group_leader (); + public unowned Gdk.Pixbuf get_icon (); + public bool get_icon_is_fallback (); + public unowned string get_icon_name (); + public unowned Gdk.Pixbuf get_mini_icon (); + public unowned string get_name (); + public int get_pid (); + public unowned Wnck.Screen get_screen (); + public unowned string get_session_id (); + public unowned string get_session_id_utf8 (); + public int get_sort_order (); + public Wnck.WindowState get_state (); + public unowned Wnck.Window get_transient (); + public Wnck.WindowType get_window_type (); + public unowned Wnck.Workspace get_workspace (); + public ulong get_xid (); + public bool has_icon_name (); + public bool has_name (); + public bool is_above (); + public bool is_active (); + public bool is_below (); + public bool is_fullscreen (); + public bool is_in_viewport (Wnck.Workspace workspace); + public bool is_maximized (); + public bool is_maximized_horizontally (); + public bool is_maximized_vertically (); + public bool is_minimized (); + public bool is_most_recently_activated (); + public bool is_on_workspace (Wnck.Workspace workspace); + public bool is_pinned (); + public bool is_shaded (); + public bool is_skip_pager (); + public bool is_skip_tasklist (); + public bool is_sticky (); + public bool is_visible_on_workspace (Wnck.Workspace workspace); + public void keyboard_move (); + public void keyboard_size (); + public void make_above (); + public void make_below (); + public void maximize (); + public void maximize_horizontally (); + public void maximize_vertically (); + public void minimize (); + public void move_to_workspace (Wnck.Workspace space); + public bool needs_attention (); + public bool or_transient_needs_attention (); + public void pin (); + public void set_fullscreen (bool fullscreen); + public void set_geometry (Wnck.WindowGravity gravity, Wnck.WindowMoveResizeMask geometry_mask, int x, int y, int width, int height); + public void set_icon_geometry (int x, int y, int width, int height); + public void set_skip_pager (bool skip); + public void set_skip_tasklist (bool skip); + public void set_sort_order (int order); + public void set_window_type (Wnck.WindowType wintype); + public void shade (); + public void stick (); + public bool transient_is_most_recently_activated (); + public void unmake_above (); + public void unmake_below (); + public void unmaximize (); + public void unmaximize_horizontally (); + public void unmaximize_vertically (); + public void unminimize (uint32 timestamp); + public void unpin (); + public void unshade (); + public void unstick (); + public virtual signal void actions_changed (Wnck.WindowActions changed_mask, Wnck.WindowActions new_actions); + public virtual signal void geometry_changed (); + public virtual signal void icon_changed (); + public virtual signal void name_changed (); + public virtual signal void state_changed (Wnck.WindowState changed_mask, Wnck.WindowState new_state); + public virtual signal void workspace_changed (); + } + [CCode (cheader_filename = "libwnck/libwnck.h", type_id = "wnck_workspace_get_type ()")] + public class Workspace : GLib.Object { + [CCode (has_construct_function = false)] + protected Workspace (); + public void activate (uint32 timestamp); + public void change_name (string name); + public int get_height (); + public int get_layout_column (); + public int get_layout_row (); + public unowned string get_name (); + public unowned Wnck.Workspace get_neighbor (Wnck.MotionDirection direction); + public int get_number (); + public unowned Wnck.Screen get_screen (); + public int get_viewport_x (); + public int get_viewport_y (); + public int get_width (); + public bool is_virtual (); + public virtual signal void name_changed (); + } + [CCode (cheader_filename = "libwnck/libwnck.h")] + public struct ResourceUsage { + public ulong total_bytes_estimate; + public ulong pixmap_bytes; + public uint n_pixmaps; + public uint n_windows; + public uint n_gcs; + public uint n_pictures; + public uint n_glyphsets; + public uint n_fonts; + public uint n_colormap_entries; + public uint n_passive_grabs; + public uint n_cursors; + public uint n_other; + [CCode (cname = "wnck_pid_read_resource_usage")] + public static Wnck.ResourceUsage pid_read (Gdk.Display gdk_display, ulong pid); + [CCode (cname = "wnck_xid_read_resource_usage")] + public static Wnck.ResourceUsage xid_read (Gdk.Display gdk_display, ulong xid); + } + [CCode (cheader_filename = "libwnck/libwnck.h")] + public struct WorkspaceLayout { + public int rows; + public int cols; + public int grid; + public int grid_area; + public int current_row; + public int current_col; + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_CLIENT_TYPE_")] + public enum ClientType { + APPLICATION, + PAGER + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_MOTION_")] + public enum MotionDirection { + UP, + DOWN, + LEFT, + RIGHT + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_PAGER_DISPLAY_")] + public enum PagerDisplayMode { + NAME, + CONTENT + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_TASKLIST_")] + public enum TasklistGroupingType { + NEVER_GROUP, + AUTO_GROUP, + ALWAYS_GROUP + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_WINDOW_ACTION_")] + [Flags] + public enum WindowActions { + MOVE, + RESIZE, + SHADE, + STICK, + MAXIMIZE_HORIZONTALLY, + MAXIMIZE_VERTICALLY, + CHANGE_WORKSPACE, + CLOSE, + UNMAXIMIZE_HORIZONTALLY, + UNMAXIMIZE_VERTICALLY, + UNSHADE, + UNSTICK, + MINIMIZE, + UNMINIMIZE, + MAXIMIZE, + UNMAXIMIZE, + FULLSCREEN, + ABOVE, + BELOW + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_WINDOW_GRAVITY_")] + public enum WindowGravity { + CURRENT, + NORTHWEST, + NORTH, + NORTHEAST, + WEST, + CENTER, + EAST, + SOUTHWEST, + SOUTH, + SOUTHEAST, + STATIC + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_WINDOW_CHANGE_")] + [Flags] + public enum WindowMoveResizeMask { + X, + Y, + WIDTH, + HEIGHT + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_WINDOW_STATE_")] + [Flags] + public enum WindowState { + MINIMIZED, + MAXIMIZED_HORIZONTALLY, + MAXIMIZED_VERTICALLY, + SHADED, + SKIP_PAGER, + SKIP_TASKLIST, + STICKY, + HIDDEN, + FULLSCREEN, + DEMANDS_ATTENTION, + URGENT, + ABOVE, + BELOW + } + [CCode (cheader_filename = "libwnck/libwnck.h", cprefix = "WNCK_WINDOW_")] + public enum WindowType { + NORMAL, + DESKTOP, + DOCK, + DIALOG, + TOOLBAR, + MENU, + UTILITY, + SPLASHSCREEN + } + [CCode (cheader_filename = "libwnck/libwnck.h", cname = "_WnckLayoutCorner", cprefix = "WNCK_LAYOUT_CORNER_")] + public enum _LayoutCorner { + TOPLEFT, + TOPRIGHT, + BOTTOMRIGHT, + BOTTOMLEFT + } + [CCode (cheader_filename = "libwnck/libwnck.h", cname = "_WnckLayoutOrientation", cprefix = "WNCK_LAYOUT_ORIENTATION_")] + public enum _LayoutOrientation { + HORIZONTAL, + VERTICAL + } + [CCode (cheader_filename = "libwnck/libwnck.h")] + public static void set_client_type (Wnck.ClientType ewmh_sourceindication_client_type); +} diff --git a/vapi/unique-3.0.deps b/vapi/unique-3.0.deps new file mode 100644 index 0000000..e762c58 --- /dev/null +++ b/vapi/unique-3.0.deps @@ -0,0 +1,8 @@ +gio-2.0 +cairo +atk +pango +gdk-3.0 +gdk-pixbuf-2.0 +gtk+-3.0 + diff --git a/vapi/unique-3.0.vapi b/vapi/unique-3.0.vapi new file mode 100644 index 0000000..79f67c5 --- /dev/null +++ b/vapi/unique-3.0.vapi @@ -0,0 +1,94 @@ +/* unique-3.0.vapi generated by vapigen, do not modify. */ +/* Pulled from http://permalink.gmane.org/gmane.linux.redhat.fedora.devel/147876 */ + +[CCode (cprefix = "Unique", lower_case_cprefix = "unique_")] +namespace Unique { + [CCode (cheader_filename = "unique/uniqueapp.h")] + public class App : GLib.Object { + [CCode (has_construct_function = false)] + public App (string name, string? startup_id); + public void add_command (string command_name, int command_id); + public bool is_running (); + public Unique.Response send_message (int command_id, Unique.MessageData? message_data); + public void watch_window (Gtk.Window window); + [CCode (has_construct_function = false)] + public App.with_commands (string name, string startup_id, ...); + [NoAccessorMethod] + public string name { owned get; construct; } + [NoAccessorMethod] + public Gdk.Screen screen { owned get; set construct; } + [NoAccessorMethod] + public string startup_id { owned get; construct; } + public virtual signal Unique.Response message_received (int command, Unique.MessageData message_data, uint time_); + } + [CCode (cheader_filename = "unique/uniquebackend.h")] + public class Backend : GLib.Object { + public weak string name; + public weak Unique.App parent; + public weak Gdk.Screen screen; + public weak string startup_id; + public uint workspace; + [CCode (has_construct_function = false)] + protected Backend (); + public static unowned Unique.Backend create (); + public unowned string get_name (); + public unowned Gdk.Screen get_screen (); + public unowned string get_startup_id (); + public uint get_workspace (); + public virtual bool request_name (); + public virtual Unique.Response send_message (int command_id, Unique.MessageData message_data, uint time_); + public void set_name (string name); + public void set_screen (Gdk.Screen screen); + public void set_startup_id (string startup_id); + } + [Compact] + [CCode (copy_function = "unique_message_data_copy", type_id = "UNIQUE_TYPE_MESSAGE_DATA", cheader_filename = "unique/uniquemessage.h")] + public class MessageData { + [CCode (has_construct_function = false)] + public MessageData (); + public unowned Unique.MessageData copy (); + public unowned uchar[] @get (size_t length); + public unowned string get_filename (); + public unowned Gdk.Screen get_screen (); + public unowned string get_startup_id (); + public unowned string get_text (); + public unowned string get_uris (); + public uint get_workspace (); + public void @set (uchar[] data, ssize_t length); + public void set_filename (string filename); + public bool set_text (string str, ssize_t length); + public bool set_uris (string uris); + } + [CCode (cprefix = "UNIQUE_", cheader_filename = "unique/uniqueenumtypes.h")] + public enum Command { + INVALID, + ACTIVATE, + NEW, + OPEN, + CLOSE + } + [CCode (cprefix = "UNIQUE_RESPONSE_", cheader_filename = "unique/uniqueenumtypes.h")] + public enum Response { + INVALID, + OK, + CANCEL, + FAIL, + PASSTHROUGH + } + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const string API_VERSION_S; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const string DEFAULT_BACKEND_S; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const int MAJOR_VERSION; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const int MICRO_VERSION; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const int MINOR_VERSION; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const string PROTOCOL_VERSION_S; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const int VERSION_HEX; + [CCode (cheader_filename = "unique/uniqueversion.h")] + public const string VERSION_S; +} -- cgit v1.2.3