diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 513eaeb..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -*.kdev4 diff --git a/CMakeLists.txt b/CMakeLists.txt index dcd4d65..4d3dc45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) project(lxqt-panel) option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) @@ -10,6 +10,17 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(FATAL "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. C++11 support is required") +endif() + macro(setByDefault VAR_NAME VAR_VALUE) if(NOT DEFINED ${VAR_NAME}) set (${VAR_NAME} ${VAR_VALUE}) @@ -23,6 +34,8 @@ if (CMAKE_COMPILER_IS_GNUCXX) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-no-undefined") endif() +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + ######################################################################### add_definitions (-Wall) @@ -30,7 +43,9 @@ include(GNUInstallDirs) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5DBus REQUIRED) @@ -40,30 +55,17 @@ find_package(Qt5X11Extras REQUIRED) find_package(KF5WindowSystem REQUIRED) find_package(lxqt REQUIRED) -find_package(Qt5Xdg REQUIRED QUIET) find_package(lxqt-globalkeys REQUIRED) find_package(lxqt-globalkeys-ui REQUIRED) -include(${LXQT_USE_FILE}) -include(${QTXDG_USE_FILE}) -include(${LXQT_GLOBALKEYS_USE_FILE}) -include(${LXQT_GLOBALKEYS_UI_USE_FILE}) include(LXQtTranslate) -include_directories( - ${LXQT_INCLUDE_DIRS} - ${QTXDG_INCLUDE_DIRS} - ${Qt5X11Extras_INCLUDE_DIRS} -) - # Warning: This must be before add_subdirectory(panel). Move with caution. set(PLUGIN_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/lxqt-panel") add_definitions(-DPLUGIN_DIR=\"${PLUGIN_DIR}\") message(STATUS "Panel plugins location: ${PLUGIN_DIR}") -add_subdirectory(panel) - ######################################################################### # Plugin system @@ -73,17 +75,20 @@ add_subdirectory(panel) include("cmake/BuildPlugin.cmake") -set(ENABLED_PLUGINS) +set(ENABLED_PLUGINS) # list of enabled plugins +set(STATIC_PLUGINS) # list of statically linked plugins setByDefault(CLOCK_PLUGIN Yes) if(CLOCK_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Clock") + list(APPEND STATIC_PLUGINS "clock") + add_definitions(-DWITH_CLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "Clock") add_subdirectory(plugin-clock) endif() setByDefault(COLORPICKER_PLUGIN Yes) if(COLORPICKER_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Color Picker") + list(APPEND ENABLED_PLUGINS "Color Picker") add_subdirectory(plugin-colorpicker) endif() @@ -92,7 +97,7 @@ if(CPULOAD_PLUGIN) find_library(STATGRAB_LIB statgrab) if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Cpu Load") + list(APPEND ENABLED_PLUGINS "Cpu Load") add_subdirectory(plugin-cpuload) else() message(STATUS "") @@ -101,49 +106,57 @@ if(CPULOAD_PLUGIN) endif() endif() -setByDefault(DOM_PLUGIN Yes) +setByDefault(DIRECTORYMENU_PLUGIN Yes) +if(DIRECTORYMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Directory menu") + add_subdirectory(plugin-directorymenu) +endif() + +setByDefault(DOM_PLUGIN No) if(DOM_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "DOM") + list(APPEND ENABLED_PLUGINS "DOM") add_subdirectory(plugin-dom) endif(DOM_PLUGIN) setByDefault(DESKTOPSWITCH_PLUGIN Yes) if(DESKTOPSWITCH_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Desktop Switcher") + list(APPEND STATIC_PLUGINS "desktopswitch") + add_definitions(-DWITH_DESKTOPSWITCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Desktop Switcher") add_subdirectory(plugin-desktopswitch) endif() setByDefault(KBINDICATOR_PLUGIN Yes) if(KBINDICATOR_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Keyboard Indicator") + list(APPEND ENABLED_PLUGINS "Keyboard Indicator") add_subdirectory(plugin-kbindicator) endif(KBINDICATOR_PLUGIN) setByDefault(MAINMENU_PLUGIN Yes) if(MAINMENU_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Application menu") + list(APPEND STATIC_PLUGINS "mainmenu") + add_definitions(-DWITH_MAINMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Application menu") add_subdirectory(plugin-mainmenu) endif() setByDefault(MOUNT_PLUGIN Yes) if(MOUNT_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Mount") - - find_package(lxqtmount REQUIRED) - include(${LXQTMOUNT_USE_FILE}) - + list(APPEND ENABLED_PLUGINS "Mount") add_subdirectory(plugin-mount) endif(MOUNT_PLUGIN) setByDefault(QUICKLAUNCH_PLUGIN Yes) if(QUICKLAUNCH_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Quicklaunch") + list(APPEND STATIC_PLUGINS "quicklaunch") + add_definitions(-DWITH_QUICKLAUNCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Quicklaunch") add_subdirectory(plugin-quicklaunch) endif() setByDefault(SCREENSAVER_PLUGIN Yes) if(SCREENSAVER_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Screensaver") + list(APPEND ENABLED_PLUGINS "Screensaver") add_subdirectory(plugin-screensaver) endif() @@ -152,7 +165,7 @@ if(SENSORS_PLUGIN) find_library(SENSORS_LIB sensors) if(NOT(${SENSORS_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Sensors") + list(APPEND ENABLED_PLUGINS "Sensors") add_subdirectory(plugin-sensors) else() message(STATUS "") @@ -163,7 +176,9 @@ endif() setByDefault(SHOWDESKTOP_PLUGIN Yes) if(SHOWDESKTOP_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Show Desktop") + list(APPEND STATIC_PLUGINS "showdesktop") + add_definitions(-DWITH_SHOWDESKTOP_PLUGIN) + list(APPEND ENABLED_PLUGINS "Show Desktop") add_subdirectory(plugin-showdesktop) endif() @@ -172,7 +187,7 @@ if(NETWORKMONITOR_PLUGIN) find_library(STATGRAB_LIB statgrab) if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Network Monitor") + list(APPEND ENABLED_PLUGINS "Network Monitor") add_subdirectory(plugin-networkmonitor) else() message(STATUS "") @@ -183,19 +198,31 @@ endif() setByDefault(SYSSTAT_PLUGIN Yes) if(SYSSTAT_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "System Stats") + list(APPEND ENABLED_PLUGINS "System Stats") add_subdirectory(plugin-sysstat) endif(SYSSTAT_PLUGIN) setByDefault(TASKBAR_PLUGIN Yes) if(TASKBAR_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Taskbar") + list(APPEND STATIC_PLUGINS "taskbar") + add_definitions(-DWITH_TASKBAR_PLUGIN) + list(APPEND ENABLED_PLUGINS "Taskbar") add_subdirectory(plugin-taskbar) endif() +setByDefault(STATUSNOTIFIER_PLUGIN Yes) +if(STATUSNOTIFIER_PLUGIN) + list(APPEND STATIC_PLUGINS "statusnotifier") + add_definitions(-DWITH_STATUSNOTIFIER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Status Notifier") + add_subdirectory(plugin-statusnotifier) +endif() + setByDefault(TRAY_PLUGIN Yes) if(TRAY_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "System Tray") + list(APPEND STATIC_PLUGINS "tray") + add_definitions(-DWITH_TRAY_PLUGIN) + list(APPEND ENABLED_PLUGINS "System Tray") add_subdirectory(plugin-tray) endif() @@ -212,7 +239,7 @@ if(VOLUME_PLUGIN) endif() if(PULSEAUDIO_FOUND OR ALSA_FOUND) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Volume") + list(APPEND ENABLED_PLUGINS "Volume") message(STATUS "") message(STATUS "Volume plugin will be built") message(STATUS " ALSA: ${ALSA_FOUND}") @@ -230,10 +257,20 @@ endif() setByDefault(WORLDCLOCK_PLUGIN Yes) if(WORLDCLOCK_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "World Clock") + list(APPEND STATIC_PLUGINS "worldclock") + add_definitions(-DWITH_WORLDCLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "World Clock") add_subdirectory(plugin-worldclock) endif(WORLDCLOCK_PLUGIN) +setByDefault(SPACER_PLUGIN Yes) +if(SPACER_PLUGIN) + list(APPEND STATIC_PLUGINS "spacer") + add_definitions(-DWITH_SPACER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Spacer") + add_subdirectory(plugin-spacer) +endif() + ######################################################################### message(STATUS "**************** The following plugins will be built ****************") @@ -242,6 +279,8 @@ foreach (PLUGIN_STR ${ENABLED_PLUGINS}) endforeach() message(STATUS "*********************************************************************") +add_subdirectory(panel) + # building tarball with CPack ------------------------------------------------- include(InstallRequiredSystemLibraries) set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION}) diff --git a/cmake/BuildPlugin.cmake b/cmake/BuildPlugin.cmake index cecbf74..a354255 100644 --- a/cmake/BuildPlugin.cmake +++ b/cmake/BuildPlugin.cmake @@ -33,9 +33,6 @@ MACRO (BUILD_LXQT_PLUGIN NAME) set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM}) endif (NOT DEFINED PLUGIN_DIR) - qt5_wrap_cpp(MOC_SOURCES ${MOCS}) - qt5_add_resources(QRC_SOURCES ${RESOURCES}) - qt5_wrap_ui(UI_SOURCES ${UIS}) set(QTX_LIBRARIES Qt5::Widgets) if(QT_USE_QTXML) set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::Xml) @@ -44,10 +41,16 @@ MACRO (BUILD_LXQT_PLUGIN NAME) set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::DBus) endif() - add_library(${NAME} MODULE ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${QRC_SOURCES} ${UIS} ${DESKTOP_FILES}) - target_link_libraries(${NAME} ${QTX_LIBRARIES} ${LXQT_LIBRARIES} ${LIBRARIES} KF5::WindowSystem) + list(FIND STATIC_PLUGINS ${NAME} IS_STATIC) + set(SRC ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES}) + if (${IS_STATIC} EQUAL -1) # not static + add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules + install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file + else() # static + add_library(${NAME} STATIC ${SRC}) # build statically linked lib + endif() + target_link_libraries(${NAME} ${QTX_LIBRARIES} lxqt ${LIBRARIES} KF5::WindowSystem) - install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) install(FILES ${CONFIG_FILES} DESTINATION ${PLUGIN_SHARE_DIR}) install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR}) diff --git a/lxqt-panel/AUTHORS b/lxqt-panel/AUTHORS new file mode 100644 index 0000000..190d298 --- /dev/null +++ b/lxqt-panel/AUTHORS @@ -0,0 +1,10 @@ +Upstream Authors: + LXQt team: http://lxqt.org + Razor team: http://razor-qt.org + +Copyright: + Copyright (c) 2010-2012 Razor team + Copyright (c) 2012-2014 LXQt team + +License: GPL-2 and LGPL-2.1+ +The full text of the licenses can be found in the 'COPYING' file. diff --git a/lxqt-panel/CMakeLists.txt b/lxqt-panel/CMakeLists.txt new file mode 100644 index 0000000..4d3dc45 --- /dev/null +++ b/lxqt-panel/CMakeLists.txt @@ -0,0 +1,292 @@ +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) +project(lxqt-panel) + +option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) + +# additional cmake files +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(FATAL "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. C++11 support is required") +endif() + +macro(setByDefault VAR_NAME VAR_VALUE) + if(NOT DEFINED ${VAR_NAME}) + set (${VAR_NAME} ${VAR_VALUE}) + endif(NOT DEFINED ${VAR_NAME}) +endmacro() + +# use gcc visibility feature to decrease unnecessary exported symbols +if (CMAKE_COMPILER_IS_GNUCXX) + # set visibility to hidden to hide symbols, unlesss they're exporeted manually in the code + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-no-undefined") +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + +######################################################################### + +add_definitions (-Wall) +include(GNUInstallDirs) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +find_package(Qt5Widgets REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(Qt5LinguistTools REQUIRED) +find_package(Qt5Xml REQUIRED) +find_package(Qt5X11Extras REQUIRED) +find_package(KF5WindowSystem REQUIRED) + +find_package(lxqt REQUIRED) +find_package(lxqt-globalkeys REQUIRED) +find_package(lxqt-globalkeys-ui REQUIRED) + + +include(LXQtTranslate) + +# Warning: This must be before add_subdirectory(panel). Move with caution. +set(PLUGIN_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/lxqt-panel") +add_definitions(-DPLUGIN_DIR=\"${PLUGIN_DIR}\") +message(STATUS "Panel plugins location: ${PLUGIN_DIR}") + +######################################################################### + +# Plugin system +# You can enable/disable building of the plugin using cmake options. +# cmake -DCLOCK_PLUGIN=Yes .. # Enable clock plugin +# cmake -DCLOCK_PLUGIN=No .. # Disable clock plugin + +include("cmake/BuildPlugin.cmake") + +set(ENABLED_PLUGINS) # list of enabled plugins +set(STATIC_PLUGINS) # list of statically linked plugins + +setByDefault(CLOCK_PLUGIN Yes) +if(CLOCK_PLUGIN) + list(APPEND STATIC_PLUGINS "clock") + add_definitions(-DWITH_CLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "Clock") + add_subdirectory(plugin-clock) +endif() + +setByDefault(COLORPICKER_PLUGIN Yes) +if(COLORPICKER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Color Picker") + add_subdirectory(plugin-colorpicker) +endif() + +setByDefault(CPULOAD_PLUGIN Yes) +if(CPULOAD_PLUGIN) + find_library(STATGRAB_LIB statgrab) + + if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) + list(APPEND ENABLED_PLUGINS "Cpu Load") + add_subdirectory(plugin-cpuload) + else() + message(STATUS "") + message(STATUS "CPU Load plugin requires libstatgrab") + message(STATUS "") + endif() +endif() + +setByDefault(DIRECTORYMENU_PLUGIN Yes) +if(DIRECTORYMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Directory menu") + add_subdirectory(plugin-directorymenu) +endif() + +setByDefault(DOM_PLUGIN No) +if(DOM_PLUGIN) + list(APPEND ENABLED_PLUGINS "DOM") + add_subdirectory(plugin-dom) +endif(DOM_PLUGIN) + +setByDefault(DESKTOPSWITCH_PLUGIN Yes) +if(DESKTOPSWITCH_PLUGIN) + list(APPEND STATIC_PLUGINS "desktopswitch") + add_definitions(-DWITH_DESKTOPSWITCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Desktop Switcher") + add_subdirectory(plugin-desktopswitch) +endif() + +setByDefault(KBINDICATOR_PLUGIN Yes) +if(KBINDICATOR_PLUGIN) + list(APPEND ENABLED_PLUGINS "Keyboard Indicator") + add_subdirectory(plugin-kbindicator) +endif(KBINDICATOR_PLUGIN) + +setByDefault(MAINMENU_PLUGIN Yes) +if(MAINMENU_PLUGIN) + list(APPEND STATIC_PLUGINS "mainmenu") + add_definitions(-DWITH_MAINMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Application menu") + add_subdirectory(plugin-mainmenu) +endif() + +setByDefault(MOUNT_PLUGIN Yes) +if(MOUNT_PLUGIN) + list(APPEND ENABLED_PLUGINS "Mount") + add_subdirectory(plugin-mount) +endif(MOUNT_PLUGIN) + +setByDefault(QUICKLAUNCH_PLUGIN Yes) +if(QUICKLAUNCH_PLUGIN) + list(APPEND STATIC_PLUGINS "quicklaunch") + add_definitions(-DWITH_QUICKLAUNCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Quicklaunch") + add_subdirectory(plugin-quicklaunch) +endif() + +setByDefault(SCREENSAVER_PLUGIN Yes) +if(SCREENSAVER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Screensaver") + add_subdirectory(plugin-screensaver) +endif() + +setByDefault(SENSORS_PLUGIN Yes) +if(SENSORS_PLUGIN) + find_library(SENSORS_LIB sensors) + + if(NOT(${SENSORS_LIB} MATCHES "NOTFOUND")) + list(APPEND ENABLED_PLUGINS "Sensors") + add_subdirectory(plugin-sensors) + else() + message(STATUS "") + message(STATUS "Sensors plugin requires lm_sensors") + message(STATUS "") + endif() +endif() + +setByDefault(SHOWDESKTOP_PLUGIN Yes) +if(SHOWDESKTOP_PLUGIN) + list(APPEND STATIC_PLUGINS "showdesktop") + add_definitions(-DWITH_SHOWDESKTOP_PLUGIN) + list(APPEND ENABLED_PLUGINS "Show Desktop") + add_subdirectory(plugin-showdesktop) +endif() + +setByDefault(NETWORKMONITOR_PLUGIN Yes) +if(NETWORKMONITOR_PLUGIN) + find_library(STATGRAB_LIB statgrab) + + if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) + list(APPEND ENABLED_PLUGINS "Network Monitor") + add_subdirectory(plugin-networkmonitor) + else() + message(STATUS "") + message(STATUS "Network Monitor plugin requires libstatgrab") + message(STATUS "") + endif() +endif() + +setByDefault(SYSSTAT_PLUGIN Yes) +if(SYSSTAT_PLUGIN) + list(APPEND ENABLED_PLUGINS "System Stats") + add_subdirectory(plugin-sysstat) +endif(SYSSTAT_PLUGIN) + +setByDefault(TASKBAR_PLUGIN Yes) +if(TASKBAR_PLUGIN) + list(APPEND STATIC_PLUGINS "taskbar") + add_definitions(-DWITH_TASKBAR_PLUGIN) + list(APPEND ENABLED_PLUGINS "Taskbar") + add_subdirectory(plugin-taskbar) +endif() + +setByDefault(STATUSNOTIFIER_PLUGIN Yes) +if(STATUSNOTIFIER_PLUGIN) + list(APPEND STATIC_PLUGINS "statusnotifier") + add_definitions(-DWITH_STATUSNOTIFIER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Status Notifier") + add_subdirectory(plugin-statusnotifier) +endif() + +setByDefault(TRAY_PLUGIN Yes) +if(TRAY_PLUGIN) + list(APPEND STATIC_PLUGINS "tray") + add_definitions(-DWITH_TRAY_PLUGIN) + list(APPEND ENABLED_PLUGINS "System Tray") + add_subdirectory(plugin-tray) +endif() + +setByDefault(VOLUME_PLUGIN Yes) +setByDefault(VOLUME_USE_PULSEAUDIO Yes) +setByDefault(VOLUME_USE_ALSA Yes) +if(VOLUME_PLUGIN) + if (VOLUME_USE_PULSEAUDIO) + find_package(PulseAudio) + endif(VOLUME_USE_PULSEAUDIO) + + if(VOLUME_USE_ALSA) + find_package(ALSA) + endif() + + if(PULSEAUDIO_FOUND OR ALSA_FOUND) + list(APPEND ENABLED_PLUGINS "Volume") + message(STATUS "") + message(STATUS "Volume plugin will be built") + message(STATUS " ALSA: ${ALSA_FOUND}") + message(STATUS " PulseAudio: ${PULSEAUDIO_FOUND}") + message(STATUS "") + add_subdirectory(plugin-volume) + else() + message(STATUS "") + message(STATUS "Volume plugin requires pulseaudio or alsa") + message(STATUS " ALSA: ${ALSA_FOUND}") + message(STATUS " PulseAudio: ${PULSEAUDIO_FOUND}") + message(STATUS "") + endif() +endif() + +setByDefault(WORLDCLOCK_PLUGIN Yes) +if(WORLDCLOCK_PLUGIN) + list(APPEND STATIC_PLUGINS "worldclock") + add_definitions(-DWITH_WORLDCLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "World Clock") + add_subdirectory(plugin-worldclock) +endif(WORLDCLOCK_PLUGIN) + +setByDefault(SPACER_PLUGIN Yes) +if(SPACER_PLUGIN) + list(APPEND STATIC_PLUGINS "spacer") + add_definitions(-DWITH_SPACER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Spacer") + add_subdirectory(plugin-spacer) +endif() + +######################################################################### + +message(STATUS "**************** The following plugins will be built ****************") +foreach (PLUGIN_STR ${ENABLED_PLUGINS}) + message(STATUS " ${PLUGIN_STR}") +endforeach() +message(STATUS "*********************************************************************") + +add_subdirectory(panel) + +# building tarball with CPack ------------------------------------------------- +include(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION}) +set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION}) +set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION}) +set(CPACK_GENERATOR TBZ2) +set(CPACK_SOURCE_GENERATOR TBZ2) +set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp) +include(CPack) diff --git a/lxqt-panel/COPYING b/lxqt-panel/COPYING new file mode 100644 index 0000000..a8dd823 --- /dev/null +++ b/lxqt-panel/COPYING @@ -0,0 +1,461 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/lxqt-panel/cmake/BuildPlugin.cmake b/lxqt-panel/cmake/BuildPlugin.cmake new file mode 100644 index 0000000..a354255 --- /dev/null +++ b/lxqt-panel/cmake/BuildPlugin.cmake @@ -0,0 +1,57 @@ +MACRO (BUILD_LXQT_PLUGIN NAME) + set(PROGRAM "lxqt-panel") + project(${PROGRAM}_${NAME}) + + set(PROG_SHARE_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/lxqt/${PROGRAM}) + set(PLUGIN_SHARE_DIR ${PROG_SHARE_DIR}/${NAME}) + + # Translations ********************************** + lxqt_translate_ts(${PROJECT_NAME}_QM_FILES + UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} + SOURCES + ${HEADERS} + ${SOURCES} + ${MOCS} + ${UIS} + TEMPLATE + ${NAME} + INSTALL_DIR + ${LXQT_TRANSLATIONS_DIR}/${PROGRAM}/${NAME} + ) + + #lxqt_translate_to(QM_FILES ${CMAKE_INSTALL_FULL_DATAROOTDIR}/lxqt/${PROGRAM}/${PROJECT_NAME}) + file (GLOB ${PROJECT_NAME}_DESKTOP_FILES_IN resources/*.desktop.in) + lxqt_translate_desktop(DESKTOP_FILES + SOURCES + ${${PROJECT_NAME}_DESKTOP_FILES_IN} + ) + #************************************************ + + file (GLOB CONFIG_FILES resources/*.conf) + + if (NOT DEFINED PLUGIN_DIR) + set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM}) + endif (NOT DEFINED PLUGIN_DIR) + + set(QTX_LIBRARIES Qt5::Widgets) + if(QT_USE_QTXML) + set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::Xml) + endif() + if(QT_USE_QTDBUS) + set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::DBus) + endif() + + list(FIND STATIC_PLUGINS ${NAME} IS_STATIC) + set(SRC ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES}) + if (${IS_STATIC} EQUAL -1) # not static + add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules + install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file + else() # static + add_library(${NAME} STATIC ${SRC}) # build statically linked lib + endif() + target_link_libraries(${NAME} ${QTX_LIBRARIES} lxqt ${LIBRARIES} KF5::WindowSystem) + + install(FILES ${CONFIG_FILES} DESTINATION ${PLUGIN_SHARE_DIR}) + install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR}) + +ENDMACRO(BUILD_LXQT_PLUGIN) diff --git a/lxqt-panel/panel/CMakeLists.txt b/lxqt-panel/panel/CMakeLists.txt new file mode 100644 index 0000000..4e23b53 --- /dev/null +++ b/lxqt-panel/panel/CMakeLists.txt @@ -0,0 +1,97 @@ +set(PROJECT lxqt-panel) + +set(PRIV_HEADERS + panelpluginsmodel.h + lxqtpanel.h + lxqtpanelapplication.h + lxqtpanellayout.h + plugin.h + lxqtpanellimits.h + popupmenu.h + pluginmoveprocessor.h + lxqtpanelpluginconfigdialog.h + config/configpaneldialog.h + config/configpanelwidget.h + config/configpluginswidget.h + config/addplugindialog.h +) + +# using LXQt namespace in the public headers. +set(PUB_HEADERS + lxqtpanelglobals.h + ilxqtpanelplugin.h + ilxqtpanel.h +) + +set(SOURCES + main.cpp + panelpluginsmodel.cpp + lxqtpanel.cpp + lxqtpanelapplication.cpp + lxqtpanellayout.cpp + plugin.cpp + popupmenu.cpp + pluginmoveprocessor.cpp + lxqtpanelpluginconfigdialog.cpp + config/configpaneldialog.cpp + config/configpanelwidget.cpp + config/configpluginswidget.cpp + config/addplugindialog.cpp +) + +set(UI + config/configpanelwidget.ui + config/configpluginswidget.ui + config/addplugindialog.ui +) + +set(LIBRARIES + lxqt +) + +file(GLOB CONFIG_FILES resources/*.conf) + +############################################ + +add_definitions(-DCOMPILE_LXQT_PANEL) + +set(PLUGIN_DESKTOPS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/lxqt/${PROJECT}") +add_definitions(-DPLUGIN_DESKTOPS_DIR=\"${PLUGIN_DESKTOPS_DIR}\") + +project(${PROJECT}) + +set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus) + +# Translations +lxqt_translate_ts(QM_FILES SOURCES + UPDATE_TRANSLATIONS + ${UPDATE_TRANSLATIONS} + SOURCES + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${SOURCES} + ${UI} + INSTALL_DIR + "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" +) + +lxqt_app_translation_loader(SOURCES ${PROJECT_NAME}) + +add_executable(${PROJECT} + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${QM_FILES} + ${SOURCES} + ${UI} +) + +target_link_libraries(${PROJECT} + ${LIBRARIES} + ${QTX_LIBRARIES} + KF5::WindowSystem + ${STATIC_PLUGINS} +) + +install(TARGETS ${PROJECT} RUNTIME DESTINATION bin) +install(FILES ${CONFIG_FILES} DESTINATION ${LXQT_ETC_XDG_DIR}/lxqt) +install(FILES ${PUB_HEADERS} DESTINATION include/lxqt) diff --git a/lxqt-panel/panel/config/addplugindialog.cpp b/lxqt-panel/panel/config/addplugindialog.cpp new file mode 100644 index 0000000..a604601 --- /dev/null +++ b/lxqt-panel/panel/config/addplugindialog.cpp @@ -0,0 +1,134 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "ui_addplugindialog.h" +#include "addplugindialog.h" +#include "plugin.h" +#include "../lxqtpanelapplication.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define SEARCH_ROLE Qt::UserRole +#define INDEX_ROLE SEARCH_ROLE+1 + +AddPluginDialog::AddPluginDialog(QWidget *parent): + QDialog(parent), + ui(new Ui::AddPluginDialog) +{ + ui->setupUi(this); + + QStringList desktopFilesDirs; + desktopFilesDirs << QString(getenv("LXQT_PANEL_PLUGINS_DIR")).split(':', QString::SkipEmptyParts); + desktopFilesDirs << QString("%1/%2").arg(XdgDirs::dataHome(), "/lxqt/lxqt-panel"); + desktopFilesDirs << PLUGIN_DESKTOPS_DIR; + + mPlugins = LxQt::PluginInfo::search(desktopFilesDirs, QStringLiteral("LxQtPanel/Plugin"), QStringLiteral("*")); + std::sort(mPlugins.begin(), mPlugins.end(), [](const LxQt::PluginInfo &p1, const LxQt::PluginInfo &p2) { + return p1.name() < p2.name() || (p1.name() == p2.name() && p1.comment() < p2.comment()); + }); + + ui->pluginList->setItemDelegate(new LxQt::HtmlDelegate(QSize(32, 32), ui->pluginList)); + ui->pluginList->setContextMenuPolicy(Qt::CustomContextMenu); + + filter(); + + // search + mSearchTimer.setInterval(300); + mSearchTimer.setSingleShot(true); + connect(ui->searchEdit, &QLineEdit::textEdited, + &mSearchTimer, static_cast(&QTimer::start)); + connect(&mSearchTimer, &QTimer::timeout, this, &AddPluginDialog::filter); + connect(ui->pluginList, &QListWidget::doubleClicked, this, &AddPluginDialog::emitPluginSelected); + connect(ui->addButton, &QPushButton::clicked, this, &AddPluginDialog::emitPluginSelected); + + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginAdded + , this, &AddPluginDialog::filter); + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginRemoved + , this, &AddPluginDialog::filter); +} + +AddPluginDialog::~AddPluginDialog() +{ + delete ui; +} + +void AddPluginDialog::filter() +{ + QListWidget* pluginList = ui->pluginList; + + const int curr_item = 0 < pluginList->count() ? pluginList->currentRow() : 0; + pluginList->clear(); + + static QIcon fallIco = XdgIcon::fromTheme("preferences-plugin"); + + int pluginCount = mPlugins.length(); + for (int i = 0; i < pluginCount; ++i) + { + const LxQt::PluginInfo &plugin = mPlugins.at(i); + + QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(), + plugin.comment(), + plugin.value("Name").toString(), + plugin.value("Comment").toString()); + if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive)) + continue; + + QListWidgetItem* item = new QListWidgetItem(ui->pluginList); + // disable single-instances plugins already in use + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(plugin.id())) + { + item->setFlags(item->flags() & ~Qt::ItemIsEnabled); + item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text)); + item->setText(QStringLiteral("%1
%2
%3") + .arg(plugin.name(), plugin.comment(), tr("(only one instance can run at a time)"))); + } else + item->setText(QStringLiteral("%1
%2").arg(plugin.name(), plugin.comment())); + item->setIcon(plugin.icon(fallIco)); + item->setData(INDEX_ROLE, i); + } + + if (pluginCount > 0) + ui->pluginList->setCurrentRow(curr_item < pluginCount ? curr_item : pluginCount - 1); +} + +void AddPluginDialog::emitPluginSelected() +{ + QListWidget* pluginList = ui->pluginList; + if (pluginList->currentItem() && pluginList->currentItem()->isSelected()) + { + LxQt::PluginInfo plugin = mPlugins.at(pluginList->currentItem()->data(INDEX_ROLE).toInt()); + emit pluginSelected(plugin); + } +} + diff --git a/lxqt-panel/panel/config/addplugindialog.h b/lxqt-panel/panel/config/addplugindialog.h new file mode 100644 index 0000000..16f2ba2 --- /dev/null +++ b/lxqt-panel/panel/config/addplugindialog.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_ADDPLUGINDIALOG_H +#define LXQT_ADDPLUGINDIALOG_H + +#include +#include +#include + +#define SEARCH_DELAY 125 + +namespace Ui { + class AddPluginDialog; +} + +class AddPluginDialog : public QDialog +{ + Q_OBJECT + +public: + AddPluginDialog(QWidget *parent = 0); + ~AddPluginDialog(); + +signals: + void pluginSelected(const LxQt::PluginInfo &plugin); + +private: + Ui::AddPluginDialog *ui; + LxQt::PluginInfoList mPlugins; + QTimer mSearchTimer; + +private slots: + void filter(); + void emitPluginSelected(); +}; + +#endif // LXQT_ADDPLUGINDIALOG_H diff --git a/lxqt-panel/panel/config/addplugindialog.ui b/lxqt-panel/panel/config/addplugindialog.ui new file mode 100644 index 0000000..57ab441 --- /dev/null +++ b/lxqt-panel/panel/config/addplugindialog.ui @@ -0,0 +1,144 @@ + + + AddPluginDialog + + + + 0 + 0 + 400 + 359 + + + + Add Plugins + + + + + + + + Search: + + + + + + + + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::Static + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + 0 + + + false + + + true + + + -1 + + + false + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add Widget + + + + + + + Close + + + false + + + true + + + + + + + + + pluginList + addButton + closeButton + searchEdit + + + + + closeButton + clicked() + AddPluginDialog + close() + + + 380 + 279 + + + 118 + 270 + + + + + diff --git a/lxqt-panel/panel/config/configpaneldialog.cpp b/lxqt-panel/panel/config/configpaneldialog.cpp new file mode 100644 index 0000000..32556b2 --- /dev/null +++ b/lxqt-panel/panel/config/configpaneldialog.cpp @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpaneldialog.h" + +ConfigPanelDialog::ConfigPanelDialog(LxQtPanel *panel, QWidget *parent): + LxQt::ConfigDialog(tr("Configure Panel"), panel->settings(), parent), + mPanelPage(nullptr), + mPluginsPage(nullptr) +{ + setAttribute(Qt::WA_DeleteOnClose); + + mPanelPage = new ConfigPanelWidget(panel, this); + addPage(mPanelPage, tr("Panel"), QStringLiteral("configure")); + connect(this, &ConfigPanelDialog::reset, mPanelPage, &ConfigPanelWidget::reset); + + mPluginsPage = new ConfigPluginsWidget(panel, this); + addPage(mPluginsPage, tr("Widgets"), QStringLiteral("preferences-plugin")); + connect(this, &ConfigPanelDialog::reset, mPluginsPage, &ConfigPluginsWidget::reset); + + connect(this, &ConfigPanelDialog::accepted, [panel] { + panel->saveSettings(); + }); +} + +void ConfigPanelDialog::showConfigPanelPage() +{ + showPage(mPanelPage); +} + +void ConfigPanelDialog::showConfigPluginsPage() +{ + showPage(mPluginsPage); +} diff --git a/lxqt-panel/panel/config/configpaneldialog.h b/lxqt-panel/panel/config/configpaneldialog.h new file mode 100644 index 0000000..52b51a6 --- /dev/null +++ b/lxqt-panel/panel/config/configpaneldialog.h @@ -0,0 +1,52 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPANELDIALOG_H +#define CONFIGPANELDIALOG_H + +#include "configpanelwidget.h" +#include "configpluginswidget.h" +#include "../lxqtpanel.h" + +#include + +class ConfigPanelDialog : public LxQt::ConfigDialog +{ + Q_OBJECT + +public: + ConfigPanelDialog(LxQtPanel *panel, QWidget *parent = 0); + + void showConfigPanelPage(); + void showConfigPluginsPage(); + +private: + ConfigPanelWidget *mPanelPage; + ConfigPluginsWidget *mPluginsPage; +}; + +#endif // CONFIGPANELDIALOG_H diff --git a/lxqt-panel/panel/config/configpanelwidget.cpp b/lxqt-panel/panel/config/configpanelwidget.cpp new file mode 100644 index 0000000..e3797e7 --- /dev/null +++ b/lxqt-panel/panel/config/configpanelwidget.cpp @@ -0,0 +1,394 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpanelwidget.h" +#include "ui_configpanelwidget.h" + +#include "../lxqtpanellimits.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace LxQt; + +struct ScreenPosition +{ + int screen; + ILxQtPanel::Position position; +}; +Q_DECLARE_METATYPE(ScreenPosition) + +ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) : + QWidget(parent), + ui(new Ui::ConfigPanelWidget), + mPanel(panel) +{ + ui->setupUi(this); + + fillComboBox_position(); + fillComboBox_alignment(); + + mOldPanelSize = mPanel->panelSize(); + mOldIconSize = mPanel->iconSize(); + mOldLineCount = mPanel->lineCount(); + + mOldLength = mPanel->length(); + mOldLengthInPercents = mPanel->lengthInPercents(); + + mOldAlignment = mPanel->alignment(); + + mOldScreenNum = mPanel->screenNum(); + mScreenNum = mOldScreenNum; + + mOldPosition = mPanel->position(); + mPosition = mOldPosition; + + mOldHidable = mPanel->hidable(); + + ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE); + ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE); + + mOldFontColor = mPanel->fontColor(); + mFontColor = mOldFontColor; + mOldBackgroundColor = mPanel->backgroundColor(); + mBackgroundColor = mOldBackgroundColor; + mOldBackgroundImage = mPanel->backgroundImage(); + mOldOpacity = mPanel->opacity(); + + // reset configurations from file + reset(); + + connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + + connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged())); + + connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged())); + connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged())); + connect(ui->checkBox_hidable, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + + connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor())); + connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor())); + connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage())); + connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged())); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::reset() +{ + ui->spinBox_panelSize->setValue(mOldPanelSize); + ui->spinBox_iconSize->setValue(mOldIconSize); + ui->spinBox_lineCount->setValue(mOldLineCount); + + ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition)); + + ui->checkBox_hidable->setChecked(mOldHidable); + + fillComboBox_alignment(); + ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1); + + ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1); + widthTypeChanged(); + ui->spinBox_length->setValue(mOldLength); + + mFontColor.setNamedColor(mOldFontColor.name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name())); + mBackgroundColor.setNamedColor(mOldBackgroundColor.name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name())); + ui->lineEdit_customBgImage->setText(mOldBackgroundImage); + ui->slider_opacity->setValue(mOldOpacity); + + ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid()); + ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid()); + ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists()); + + // update position + positionChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_position() +{ + int screenCount = QApplication::desktop()->screenCount(); + if (screenCount == 1) + { + addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom); + } + else + { + for (int screenNum = 0; screenNum < screenCount; screenNum++) + { + if (screenNum) + ui->comboBox_position->insertSeparator(9999); + + addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom); + } + } +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_alignment() +{ + ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft)); + ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter)); + ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight)); + + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + { + ui->comboBox_alignment->setItemText(0, tr("Left")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Right")); + } + else + { + ui->comboBox_alignment->setItemText(0, tr("Top")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Bottom")); + }; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position) +{ + if (LxQtPanel::canPlacedOn(screen, position)) + ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position})); +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position) +{ + for (int i = 0; i < ui->comboBox_position->count(); i++) + { + ScreenPosition sp = ui->comboBox_position->itemData(i).value(); + if (screen == sp.screen && position == sp.position) + return i; + } + return -1; +} + + +/************************************************ + * + ************************************************/ +ConfigPanelWidget::~ConfigPanelWidget() +{ + delete ui; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::editChanged() +{ + mPanel->setPanelSize(ui->spinBox_panelSize->value(), true); + mPanel->setIconSize(ui->spinBox_iconSize->value(), true); + mPanel->setLineCount(ui->spinBox_lineCount->value(), true); + + mPanel->setLength(ui->spinBox_length->value(), + ui->comboBox_lenghtType->currentIndex() == 0, + true); + + LxQtPanel::Alignment align = LxQtPanel::Alignment( + ui->comboBox_alignment->itemData( + ui->comboBox_alignment->currentIndex() + ).toInt()); + + mPanel->setAlignment(align, true); + mPanel->setPosition(mScreenNum, mPosition, true); + mPanel->setHidable(ui->checkBox_hidable->isChecked(), true); + + mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true); + if (ui->checkBox_customBgColor->isChecked()) + { + mPanel->setBackgroundColor(mBackgroundColor, true); + mPanel->setOpacity(ui->slider_opacity->value(), true); + } + else + { + mPanel->setBackgroundColor(QColor(), true); + mPanel->setOpacity(100, true); + } + + QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); + mPanel->setBackgroundImage(image, true); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::widthTypeChanged() +{ + int max = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 0) + { + // Percents ............................. + int v = ui->spinBox_length->value() * 100.0 / max; + ui->spinBox_length->setRange(1, 100); + ui->spinBox_length->setValue(v); + } + else + { + // Pixels ............................... + int v = max / 100.0 * ui->spinBox_length->value(); + ui->spinBox_length->setRange(-max, max); + ui->spinBox_length->setValue(v); + } +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::getMaxLength() +{ + QDesktopWidget* dw = QApplication::desktop(); + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + return dw->screenGeometry(mScreenNum).width(); + else + return dw->screenGeometry(mScreenNum).height(); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::positionChanged() +{ + ScreenPosition sp = ui->comboBox_position->itemData( + ui->comboBox_position->currentIndex()).value(); + + bool updateAlig = (sp.position == ILxQtPanel::PositionTop || + sp.position == ILxQtPanel::PositionBottom) != + (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom); + + int oldMax = getMaxLength(); + mPosition = sp.position; + mScreenNum = sp.screen; + int newMax = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 1 && + oldMax != newMax) + { + // Pixels ............................... + int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; + ui->spinBox_length->setMaximum(newMax); + ui->spinBox_length->setValue(v); + } + + if (updateAlig) + fillComboBox_alignment(); + + editChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickFontColor() +{ + QColorDialog d(QColor(mFontColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mFontColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundColor() +{ + QColorDialog d(QColor(mBackgroundColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mBackgroundColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundImage() +{ + QString picturesLocation; + picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + + QFileDialog* d = new QFileDialog(this, tr("Pick image"), picturesLocation, tr("Images (*.png *.gif *.jpg)")); + d->setAttribute(Qt::WA_DeleteOnClose); + d->setWindowModality(Qt::WindowModal); + connect(d, &QFileDialog::fileSelected, ui->lineEdit_customBgImage, &QLineEdit::setText); + d->show(); +} + diff --git a/lxqt-panel/panel/config/configpanelwidget.h b/lxqt-panel/panel/config/configpanelwidget.h new file mode 100644 index 0000000..3849a86 --- /dev/null +++ b/lxqt-panel/panel/config/configpanelwidget.h @@ -0,0 +1,99 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPANELWIDGET_H +#define CONFIGPANELWIDGET_H + +#include "../lxqtpanel.h" +#include +#include +#include + +class LxQtPanel; + +namespace Ui { + class ConfigPanelWidget; +} + +class ConfigPanelWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0); + ~ConfigPanelWidget(); + + int screenNum() const { return mScreenNum; } + ILxQtPanel::Position position() const { return mPosition; } + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void editChanged(); + void widthTypeChanged(); + void positionChanged(); + void pickFontColor(); + void pickBackgroundColor(); + void pickBackgroundImage(); + +private: + Ui::ConfigPanelWidget *ui; + LxQtPanel *mPanel; + int mScreenNum; + ILxQtPanel::Position mPosition; + + void addPosition(const QString& name, int screen, LxQtPanel::Position position); + void fillComboBox_position(); + void fillComboBox_alignment(); + int indexForPosition(int screen, ILxQtPanel::Position position); + int getMaxLength(); + + // new values + QColor mFontColor; + QColor mBackgroundColor; + + // old values for reset + int mOldPanelSize; + int mOldIconSize; + int mOldLineCount; + int mOldLength; + bool mOldLengthInPercents; + LxQtPanel::Alignment mOldAlignment; + ILxQtPanel::Position mOldPosition; + bool mOldHidable; + int mOldScreenNum; + QColor mOldFontColor; + QColor mOldBackgroundColor; + QString mOldBackgroundImage; + int mOldOpacity; +}; + +#endif diff --git a/lxqt-panel/panel/config/configpanelwidget.ui b/lxqt-panel/panel/config/configpanelwidget.ui new file mode 100644 index 0000000..f9abbcf --- /dev/null +++ b/lxqt-panel/panel/config/configpanelwidget.ui @@ -0,0 +1,619 @@ + + + ConfigPanelWidget + + + + 0 + 0 + 372 + 397 + + + + + 0 + 0 + + + + Configure panel + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Size + + + false + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + 1 + + + 100 + + + + + + + Size: + + + + + + + Length: + + + + + + + + % + + + + + px + + + + + + + + px + + + 24 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + px + + + 10 + + + 128 + + + + + + + Icon size: + + + + + + + Rows count: + + + + + + + 1 + + + 20 + + + + + + + + + + + + + + 0 + 0 + + + + Alignment && position + + + + + + Position: + + + + + + + + + + Alignment: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + + Left + + + + + Center + + + + + Right + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 15 + 20 + + + + + + + + + 0 + 0 + + + + Auto-hide + + + + + + + + + + + + + + 0 + 0 + + + + Custom styling + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Font color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + Background color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + 6 + + + 6 + + + + + false + + + Background opacity: + + + + + + + false + + + 100 + + + 5 + + + 100 + + + Qt::Horizontal + + + + + + + + + + false + + + <small>Compositing is required for panel transparency.</small> + + + Qt::AlignCenter + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Background image: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + + + + + checkBox_customBgColor + toggled(bool) + pushButton_customBgColor + setEnabled(bool) + + + 144 + 332 + + + 350 + 350 + + + + + checkBox_customBgImage + toggled(bool) + lineEdit_customBgImage + setEnabled(bool) + + + 137 + 403 + + + 149 + 440 + + + + + checkBox_customBgImage + toggled(bool) + pushButton_customBgImage + setEnabled(bool) + + + 125 + 403 + + + 350 + 441 + + + + + checkBox_customFontColor + toggled(bool) + pushButton_customFontColor + setEnabled(bool) + + + 190 + 294 + + + 350 + 312 + + + + + checkBox_customBgColor + toggled(bool) + slider_opacity + setEnabled(bool) + + + 99 + 333 + + + 114 + 367 + + + + + checkBox_customBgColor + toggled(bool) + label_2 + setEnabled(bool) + + + 34 + 341 + + + 32 + 362 + + + + + checkBox_customBgColor + toggled(bool) + compositingL + setEnabled(bool) + + + diff --git a/lxqt-panel/panel/config/configpluginswidget.cpp b/lxqt-panel/panel/config/configpluginswidget.cpp new file mode 100644 index 0000000..cdae414 --- /dev/null +++ b/lxqt-panel/panel/config/configpluginswidget.cpp @@ -0,0 +1,119 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpluginswidget.h" +#include "ui_configpluginswidget.h" +#include "addplugindialog.h" +#include "panelpluginsmodel.h" +#include "../plugin.h" +#include "../ilxqtpanelplugin.h" + +#include +#include +#include + +ConfigPluginsWidget::ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent) : + QWidget(parent), + ui(new Ui::ConfigPluginsWidget), + mPanel(panel) +{ + ui->setupUi(this); + + PanelPluginsModel * plugins = mPanel->mPlugins.data(); + { + QScopedPointer m(ui->listView_plugins->selectionModel()); + ui->listView_plugins->setModel(plugins); + } + { + QScopedPointer d(ui->listView_plugins->itemDelegate()); + ui->listView_plugins->setItemDelegate(new LxQt::HtmlDelegate(QSize(16, 16), ui->listView_plugins)); + } + + resetButtons(); + + connect(ui->listView_plugins, &QListView::activated, plugins, &PanelPluginsModel::onActivatedIndex); + connect(ui->listView_plugins->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &ConfigPluginsWidget::resetButtons); + + connect(ui->pushButton_moveUp, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginUp); + connect(ui->pushButton_moveDown, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginDown); + + connect(ui->pushButton_addPlugin, &QPushButton::clicked, this, &ConfigPluginsWidget::showAddPluginDialog); + connect(ui->pushButton_removePlugin, &QToolButton::clicked, plugins, &PanelPluginsModel::onRemovePlugin); + + connect(ui->pushButton_pluginConfig, &QToolButton::clicked, plugins, &PanelPluginsModel::onConfigurePlugin); + + connect(plugins, &PanelPluginsModel::pluginAdded, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginRemoved, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginMoved, this, &ConfigPluginsWidget::resetButtons); +} + +ConfigPluginsWidget::~ConfigPluginsWidget() +{ + delete ui; +} + +void ConfigPluginsWidget::reset() +{ + +} + +void ConfigPluginsWidget::showAddPluginDialog() +{ + if (mAddPluginDialog.isNull()) + { + mAddPluginDialog.reset(new AddPluginDialog); + connect(mAddPluginDialog.data(), &AddPluginDialog::pluginSelected, + mPanel->mPlugins.data(), &PanelPluginsModel::addPlugin); + } + mAddPluginDialog->show(); + mAddPluginDialog->raise(); + mAddPluginDialog->activateWindow(); +} + +void ConfigPluginsWidget::resetButtons() +{ + PanelPluginsModel *model = mPanel->mPlugins.data(); + QItemSelectionModel *selectionModel = ui->listView_plugins->selectionModel(); + bool hasSelection = selectionModel->hasSelection(); + bool isFirstSelected = selectionModel->isSelected(model->index(0)); + bool isLastSelected = selectionModel->isSelected(model->index(model->rowCount() - 1)); + + bool hasConfigDialog = false; + if (hasSelection) + { + Plugin const * plugin + = ui->listView_plugins->model()->data(selectionModel->currentIndex(), Qt::UserRole).value(); + if (nullptr != plugin) + hasConfigDialog = plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::HaveConfigDialog); + } + + ui->pushButton_removePlugin->setEnabled(hasSelection); + ui->pushButton_moveUp->setEnabled(hasSelection && !isFirstSelected); + ui->pushButton_moveDown->setEnabled(hasSelection && !isLastSelected); + ui->pushButton_pluginConfig->setEnabled(hasSelection && hasConfigDialog); +} diff --git a/lxqt-panel/panel/config/configpluginswidget.h b/lxqt-panel/panel/config/configpluginswidget.h new file mode 100644 index 0000000..344169f --- /dev/null +++ b/lxqt-panel/panel/config/configpluginswidget.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPLUGINSWIDGET_H +#define CONFIGPLUGINSWIDGET_H + +#include "../lxqtpanel.h" + +#include + +namespace Ui { + class ConfigPluginsWidget; +} +class AddPluginDialog; + +class ConfigPluginsWidget : public QWidget +{ + Q_OBJECT + +public: + ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent = 0); + ~ConfigPluginsWidget(); + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void showAddPluginDialog(); + void resetButtons(); + +private: + Ui::ConfigPluginsWidget *ui; + QScopedPointer mAddPluginDialog; + LxQtPanel *mPanel; +}; + +#endif diff --git a/lxqt-panel/panel/config/configpluginswidget.ui b/lxqt-panel/panel/config/configpluginswidget.ui new file mode 100644 index 0000000..413584c --- /dev/null +++ b/lxqt-panel/panel/config/configpluginswidget.ui @@ -0,0 +1,213 @@ + + + ConfigPluginsWidget + + + + 0 + 0 + 339 + 220 + + + + Configure Plugins + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + false + + + true + + + + + + + Note: changes made in this page cannot be reset. + + + true + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Move up + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Move down + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Add + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Remove + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Configure + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + diff --git a/lxqt-panel/panel/ilxqtpanel.h b/lxqt-panel/panel/ilxqtpanel.h new file mode 100644 index 0000000..a64cb69 --- /dev/null +++ b/lxqt-panel/panel/ilxqtpanel.h @@ -0,0 +1,79 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef ILXQTPANEL_H +#define ILXQTPANEL_H +#include +#include "lxqtpanelglobals.h" + +class ILxQtPanelPlugin; + +/** + **/ +class LXQT_PANEL_API ILxQtPanel +{ +public: + /** + Specifies the position of the panel on screen. + **/ + enum Position{ + PositionBottom, //! The bottom side of the screen. + PositionTop, //! The top side of the screen. + PositionLeft, //! The left side of the screen. + PositionRight //! The right side of the screen. + }; + + /** + This property holds position of the panel. + Possible values for this property are described by the Position enum + **/ + virtual Position position() const = 0; + + virtual int iconSize() const = 0; + virtual int lineCount() const = 0; + + /** + Helper functions for eazy direction checking. + Retuns true if panel on the top or bottom of the screen; otherwise returns false. + **/ + bool isHorizontal() const { return position() == PositionBottom || position() == PositionTop; } + + /** + Returns global screen coordinates of the panel. You no need to use mapToGlobal. + **/ + virtual QRect globalGometry() const = 0; + + /** + Helper functions for calculating global screen position of some popup window with windowSize size. + If you need to show some popup window, you can use it, to get global screen position for the new window. + **/ + virtual QRect calculatePopupWindowPos(const QPoint &absolutePos, const QSize &windowSize) const = 0; + virtual QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const = 0; +}; + +#endif // ILXQTPANEL_H diff --git a/lxqt-panel/panel/ilxqtpanelplugin.h b/lxqt-panel/panel/ilxqtpanelplugin.h new file mode 100644 index 0000000..cefcf53 --- /dev/null +++ b/lxqt-panel/panel/ilxqtpanelplugin.h @@ -0,0 +1,232 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef ILXQTPANELPLUGIN_H +#define ILXQTPANELPLUGIN_H + +#include +#include // For XEvent +#include +#include +#include "ilxqtpanel.h" +#include "lxqtpanelglobals.h" + +/** +LxQt panel plugins are standalone sharedlibraries +(*.so) located in PLUGIN_DIR (define provided by CMakeLists.txt). + +Plugin for the panel is a library written on C++. One more necessary thing +is a .desktop file describing this plugin. The same may be additional files, +like translations. Themselves plugins will be installed to +/usr/local/lib/lxqt-panel or /usr/lib/lxqt-panel (dependent on cmake option +-DCMAKE_INSTALL_PREFIX). Desktop files are installed to +/usr/local/share/lxqt/lxqt-panel, translations to +/usr/local/share/lxqt/lxqt-panel/PLUGIN_NAME. +**/ + +class QDialog; + +struct LXQT_PANEL_API ILxQtPanelPluginStartupInfo +{ + ILxQtPanel *lxqtPanel; + QSettings *settings; + const LxQt::PluginInfo *desktopFile; +}; + + +/** \brief Base abstract class for LxQt panel widgets/plugins. +All plugins *must* be inherited from this one. + +This class provides some basic API and inherited/implemented +plugins GUIs will be responsible on the functionality itself. + +See +How to write the panel plugin for more information about how to make your plugins. +**/ + +class LXQT_PANEL_API ILxQtPanelPlugin +{ +public: + /** + This enum describes the properties of an plugin. + **/ + enum Flag { + NoFlags = 0, ///< It does not have any properties set. + PreferRightAlignment = 1, /**< The plugin is prefer right alignment (for example the clock plugin); + otherwise plugin prefer left (like main menu). + This flag is used only at the first start, later positions of all + plugins saved in a config, and this saved information is used. */ + HaveConfigDialog = 2, ///< The plugin have a configuration dialog. + SingleInstance = 4, ///< The plugin allows only one instance to run. + NeedsHandle = 8 ///< The plugin needs a handle for the context menu + }; + + Q_DECLARE_FLAGS(Flags, Flag) + + /** + This enum describes the reason the plugin was activated. + **/ + enum ActivationReason { + Unknown = 0, ///< Unknown reason + DoubleClick = 2, ///< The plugin entry was double clicked + Trigger = 3, ///< The plugin was clicked + MiddleClick = 4 ///< The plugin was clicked with the middle mouse button + }; + + /** + Constructs a ILxQtPanelPlugin object with the given startupInfo. You do not have to worry + about the startupInfo parameters, ILxQtPanelPlugin process the parameters yourself. + **/ + ILxQtPanelPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + mSettings(startupInfo.settings), + mPanel(startupInfo.lxqtPanel), + mDesktopFile(startupInfo.desktopFile) + {} + + /** + Destroys the object. + **/ + virtual ~ILxQtPanelPlugin() {} + + /** + Returns the plugin flags. + The base class implementation returns a NoFlags. + **/ + virtual Flags flags() const { return NoFlags; } + + /** + Returns the string that is used in the theme QSS file. + If you retuns "WorldClock" string, theme author may write something like `#WorldClock { border: 1px solid red; }` + to set custom border for the your plugin. + **/ + virtual QString themeId() const = 0; + + /** + From users point of view plugin is a some visual widget on the panel. This function retuns pointer to it. + This method called only once, so you are free to return pointer on class member, or create widget on the fly. + **/ + virtual QWidget *widget() = 0; + + /** + Returns the plugin settings dialog. Reimplement this function if your plugin has it. + The panel does not take ownership of the dialog, it would probably a good idea to set Qt::WA_DeleteOnClose + attribute for the dialog. + The default implementation returns 0, no dialog; + + Note that the flags method has to return HaveConfigDialog flag. + To save the settings you should use a ready-to-use ILxQtPanelPlugin::settings() object. + + **/ + virtual QDialog *configureDialog() { return 0; } + + /** + This function is called when values are changed in the plugin settings. + Reimplement this function to your plugin corresponded the new settings. + + The default implementation do nothing. + **/ + virtual void settingsChanged() {} + + /** + This function is called when the user activates the plugin. reason specifies the reason for activation. + ILxQtPanelPlugin::ActivationReason enumerates the various reasons. + + The default implementation do nothing. + **/ + virtual void activated(ActivationReason reason) {} + + /** + This function is called when the panel geometry or lines count are changed. + + The default implementation do nothing. + + **/ + virtual void realign() {} + + /** + Returns the panel object. + **/ + ILxQtPanel *panel() const { return mPanel; } + + + QSettings *settings() const { return mSettings; } + const LxQt::PluginInfo *desktopFile() const { return mDesktopFile; } + + /** + Helper functions for calculating global screen position of some popup window with windowSize size. + If you need to show some popup window, you can use it, to get global screen position for the new window. + **/ + virtual QRect calculatePopupWindowPos(const QSize &windowSize) + { + return mPanel->calculatePopupWindowPos(this, windowSize); + } + + + virtual bool isSeparate() const { return false; } + virtual bool isExpandable() const { return false; } +private: + QSettings *mSettings; + ILxQtPanel *mPanel; + const LxQt::PluginInfo *mDesktopFile; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(ILxQtPanelPlugin::Flags) + +/** +Every plugin must has the loader. You shoul only reimplement instance() method, and return your plugin. +Example: +@code +class LxQtClockPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtClock(startupInfo);} +}; +@endcode +**/ +class LXQT_PANEL_API ILxQtPanelPluginLibrary +{ +public: + /** + Destroys the ILxQtPanelPluginLibrary object. + **/ + virtual ~ILxQtPanelPluginLibrary() {} + + /** + Returns the root component object of the plugin. When the library is finally unloaded, the root component will automatically be deleted. + **/ + virtual ILxQtPanelPlugin* instance(const ILxQtPanelPluginStartupInfo &startupInfo) const = 0; +}; + + +Q_DECLARE_INTERFACE(ILxQtPanelPluginLibrary, + "lxde-qt.org/Panel/PluginInterface/3.0") + +#endif // ILXQTPANELPLUGIN_H diff --git a/lxqt-panel/panel/lxqtpanel.cpp b/lxqt-panel/panel/lxqtpanel.cpp new file mode 100644 index 0000000..9b66994 --- /dev/null +++ b/lxqt-panel/panel/lxqtpanel.cpp @@ -0,0 +1,1143 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtpanel.h" +#include "lxqtpanellimits.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanelapplication.h" +#include "lxqtpanellayout.h" +#include "config/configpaneldialog.h" +#include "popupmenu.h" +#include "plugin.h" +#include "panelpluginsmodel.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// Turn on this to show the time required to load each plugin during startup +// #define DEBUG_PLUGIN_LOADTIME +#ifdef DEBUG_PLUGIN_LOADTIME +#include +#endif + +// Config keys and groups +#define CFG_KEY_SCREENNUM "desktop" +#define CFG_KEY_POSITION "position" +#define CFG_KEY_PANELSIZE "panelSize" +#define CFG_KEY_ICONSIZE "iconSize" +#define CFG_KEY_LINECNT "lineCount" +#define CFG_KEY_LENGTH "width" +#define CFG_KEY_PERCENT "width-percent" +#define CFG_KEY_ALIGNMENT "alignment" +#define CFG_KEY_FONTCOLOR "font-color" +#define CFG_KEY_BACKGROUNDCOLOR "background-color" +#define CFG_KEY_BACKGROUNDIMAGE "background-image" +#define CFG_KEY_OPACITY "opacity" +#define CFG_KEY_PLUGINS "plugins" +#define CFG_KEY_HIDABLE "hidable" + +/************************************************ + Returns the Position by the string. + String is one of "Top", "Left", "Bottom", "Right", string is not case sensitive. + If the string is not correct, returns defaultValue. + ************************************************/ +ILxQtPanel::Position LxQtPanel::strToPosition(const QString& str, ILxQtPanel::Position defaultValue) +{ + if (str.toUpper() == "TOP") return LxQtPanel::PositionTop; + if (str.toUpper() == "LEFT") return LxQtPanel::PositionLeft; + if (str.toUpper() == "RIGHT") return LxQtPanel::PositionRight; + if (str.toUpper() == "BOTTOM") return LxQtPanel::PositionBottom; + return defaultValue; +} + + +/************************************************ + Return string representation of the position + ************************************************/ +QString LxQtPanel::positionToStr(ILxQtPanel::Position position) +{ + switch (position) + { + case LxQtPanel::PositionTop: + return QString("Top"); + case LxQtPanel::PositionLeft: + return QString("Left"); + case LxQtPanel::PositionRight: + return QString("Right"); + case LxQtPanel::PositionBottom: + return QString("Bottom"); + } + + return QString(); +} + + +/************************************************ + + ************************************************/ +LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : + QFrame(parent), + mConfigGroup(configGroup), + mPlugins{nullptr}, + mPanelSize(0), + mIconSize(0), + mLineCount(0), + mLength(0), + mAlignment(AlignmentLeft), + mPosition(ILxQtPanel::PositionBottom), + mScreenNum(0), //whatever (avoid conditional on uninitialized value) + mHidable(false), + mHidden(false) +{ + Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; + + // NOTE: by PCMan: + // In Qt 4, the window is not activated if it has Qt::WA_X11NetWmWindowTypeDock. + // Since Qt 5, the default behaviour is changed. A window is always activated on mouse click. + // Please see the source code of Qt5: src/plugins/platforms/xcb/qxcbwindow.cpp. + // void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event) + // This new behaviour caused lxqt bug #161 - Cannot minimize windows from panel 1 when two task managers are open + // Besides, this breaks minimizing or restoring windows when clicking on the taskbar buttons. + // To workaround this regression bug, we need to add this window flag here. + // However, since the panel gets no keyboard focus, this may decrease accessibility since + // it's not possible to use the panel with keyboards. We need to find a better solution later. + flags |= Qt::WindowDoesNotAcceptFocus; + + setWindowFlags(flags); + setAttribute(Qt::WA_X11NetWmWindowTypeDock); + setAttribute(Qt::WA_AlwaysShowToolTips); + setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_AcceptDrops); + + setWindowTitle("LxQt Panel"); + setObjectName(QString("LxQtPanel %1").arg(configGroup)); + + LxQtPanelWidget = new QFrame(this); + LxQtPanelWidget->setObjectName("BackgroundWidget"); + QGridLayout* lav = new QGridLayout(); + lav->setMargin(0); + setLayout(lav); + this->layout()->addWidget(LxQtPanelWidget); + + mLayout = new LxQtPanelLayout(LxQtPanelWidget); + connect(mLayout, &LxQtPanelLayout::pluginMoved, this, &LxQtPanel::pluginMoved); + LxQtPanelWidget->setLayout(mLayout); + mLayout->setLineCount(mLineCount); + + mDelaySave.setSingleShot(true); + mDelaySave.setInterval(SETTINGS_SAVE_DELAY); + connect(&mDelaySave, SIGNAL(timeout()), this, SLOT(saveSettings())); + + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(PANEL_HIDE_DELAY); + connect(&mHideTimer, SIGNAL(timeout()), this, SLOT(hidePanelWork())); + + connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(realign())); + connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(ensureVisible())); + connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update())); + connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign())); + + LxQtPanelApplication *app = reinterpret_cast(qApp); + mSettings = app->settings(); + readSettings(); + // the old position might be on a visible screen + ensureVisible(); + loadPlugins(); + + show(); + + // show it the first first time, despite setting + if (mHidable) + { + showPanel(); + QTimer::singleShot(PANEL_HIDE_FIRST_TIME, this, SLOT(hidePanel())); + } +} + +/************************************************ + + ************************************************/ +void LxQtPanel::readSettings() +{ + // Read settings ...................................... + mSettings->beginGroup(mConfigGroup); + + // Let Hidability be the first thing we read + // so that every call to realign() is without side-effect + mHidable = mSettings->value(CFG_KEY_HIDABLE, mHidable).toBool(); + mHidden = mHidable; + + // By default we are using size & count from theme. + setPanelSize(mSettings->value(CFG_KEY_PANELSIZE, PANEL_DEFAULT_SIZE).toInt(), false); + setIconSize(mSettings->value(CFG_KEY_ICONSIZE, PANEL_DEFAULT_ICON_SIZE).toInt(), false); + setLineCount(mSettings->value(CFG_KEY_LINECNT, PANEL_DEFAULT_LINE_COUNT).toInt(), false); + + setLength(mSettings->value(CFG_KEY_LENGTH, 100).toInt(), + mSettings->value(CFG_KEY_PERCENT, true).toBool(), + false); + + setPosition(mSettings->value(CFG_KEY_SCREENNUM, QApplication::desktop()->primaryScreen()).toInt(), + strToPosition(mSettings->value(CFG_KEY_POSITION).toString(), PositionBottom), + false); + + setAlignment(Alignment(mSettings->value(CFG_KEY_ALIGNMENT, mAlignment).toInt()), false); + + QColor color = mSettings->value(CFG_KEY_FONTCOLOR, "").value(); + if (color.isValid()) + setFontColor(color, true); + + setOpacity(mSettings->value(CFG_KEY_OPACITY, 100).toInt(), true); + color = mSettings->value(CFG_KEY_BACKGROUNDCOLOR, "").value(); + if (color.isValid()) + setBackgroundColor(color, true); + + QString image = mSettings->value(CFG_KEY_BACKGROUNDIMAGE, "").toString(); + if (!image.isEmpty()) + setBackgroundImage(image, false); + + mSettings->endGroup(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::saveSettings(bool later) +{ + mDelaySave.stop(); + if (later) + { + mDelaySave.start(); + return; + } + + mSettings->beginGroup(mConfigGroup); + + //Note: save/load of plugin names is completely handled by mPlugins object + //mSettings->setValue(CFG_KEY_PLUGINS, mPlugins->pluginNames()); + + mSettings->setValue(CFG_KEY_PANELSIZE, mPanelSize); + mSettings->setValue(CFG_KEY_ICONSIZE, mIconSize); + mSettings->setValue(CFG_KEY_LINECNT, mLineCount); + + mSettings->setValue(CFG_KEY_LENGTH, mLength); + mSettings->setValue(CFG_KEY_PERCENT, mLengthInPercents); + + mSettings->setValue(CFG_KEY_SCREENNUM, mScreenNum); + mSettings->setValue(CFG_KEY_POSITION, positionToStr(mPosition)); + + mSettings->setValue(CFG_KEY_ALIGNMENT, mAlignment); + + mSettings->setValue(CFG_KEY_FONTCOLOR, mFontColor.isValid() ? mFontColor : QColor()); + mSettings->setValue(CFG_KEY_BACKGROUNDCOLOR, mBackgroundColor.isValid() ? mBackgroundColor : QColor()); + mSettings->setValue(CFG_KEY_BACKGROUNDIMAGE, QFileInfo(mBackgroundImage).exists() ? mBackgroundImage : QString()); + mSettings->setValue(CFG_KEY_OPACITY, mOpacity); + + mSettings->setValue(CFG_KEY_HIDABLE, mHidable); + + mSettings->endGroup(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::ensureVisible() +{ + if (!canPlacedOn(mScreenNum, mPosition)) + setPosition(findAvailableScreen(mPosition), mPosition, true); + + // the screen size might be changed, let's update the reserved screen space. + updateWmStrut(); +} + + +/************************************************ + + ************************************************/ +LxQtPanel::~LxQtPanel() +{ + mLayout->setEnabled(false); + // do not save settings because of "user deleted panel" functionality saveSettings(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::show() +{ + QWidget::show(); + KWindowSystem::setOnDesktop(effectiveWinId(), NET::OnAllDesktops); +} + + +/************************************************ + + ************************************************/ +QStringList pluginDesktopDirs() +{ + QStringList dirs; + dirs << QString(getenv("LXQT_PANEL_PLUGINS_DIR")).split(':', QString::SkipEmptyParts); + dirs << QString("%1/%2").arg(XdgDirs::dataHome(), "/lxqt/lxqt-panel"); + dirs << PLUGIN_DESKTOPS_DIR; + return dirs; +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::loadPlugins() +{ + QString names_key(mConfigGroup); + names_key += '/'; + names_key += QLatin1String(CFG_KEY_PLUGINS); + mPlugins.reset(new PanelPluginsModel(this, names_key, pluginDesktopDirs())); + + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, mLayout, &LxQtPanelLayout::addPlugin); + connect(mPlugins.data(), &PanelPluginsModel::pluginMovedUp, mLayout, &LxQtPanelLayout::moveUpPlugin); + //reemit signals + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, this, &LxQtPanel::pluginAdded); + connect(mPlugins.data(), &PanelPluginsModel::pluginRemoved, this, &LxQtPanel::pluginRemoved); + + for (auto const & plugin : mPlugins->plugins()) + mLayout->addPlugin(plugin); +} + +/************************************************ + + ************************************************/ +int LxQtPanel::getReserveDimension() +{ + return mHidable ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize); +} + +void LxQtPanel::setPanelGeometry() +{ + const QRect currentScreen = QApplication::desktop()->screenGeometry(mScreenNum); + QRect rect; + + if (isHorizontal()) + { + // Horiz panel *************************** + rect.setHeight(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); + if (mLengthInPercents) + rect.setWidth(currentScreen.width() * mLength / 100.0); + else + { + if (mLength <= 0) + rect.setWidth(currentScreen.width() + mLength); + else + rect.setWidth(mLength); + } + + rect.setWidth(qMax(rect.size().width(), mLayout->minimumSize().width())); + + // Horiz ...................... + switch (mAlignment) + { + case LxQtPanel::AlignmentLeft: + rect.moveLeft(currentScreen.left()); + break; + + case LxQtPanel::AlignmentCenter: + rect.moveCenter(currentScreen.center()); + break; + + case LxQtPanel::AlignmentRight: + rect.moveRight(currentScreen.right()); + break; + } + + // Vert ....................... + if (mPosition == ILxQtPanel::PositionTop) + rect.moveTop(currentScreen.top()); + else + rect.moveBottom(currentScreen.bottom()); + } + else + { + // Vert panel *************************** + rect.setWidth(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); + if (mLengthInPercents) + rect.setHeight(currentScreen.height() * mLength / 100.0); + else + { + if (mLength <= 0) + rect.setHeight(currentScreen.height() + mLength); + else + rect.setHeight(mLength); + } + + rect.setHeight(qMax(rect.size().height(), mLayout->minimumSize().height())); + + // Vert ....................... + switch (mAlignment) + { + case LxQtPanel::AlignmentLeft: + rect.moveTop(currentScreen.top()); + break; + + case LxQtPanel::AlignmentCenter: + rect.moveCenter(currentScreen.center()); + break; + + case LxQtPanel::AlignmentRight: + rect.moveBottom(currentScreen.bottom()); + break; + } + + // Horiz ...................... + if (mPosition == ILxQtPanel::PositionLeft) + rect.moveLeft(currentScreen.left()); + else + rect.moveRight(currentScreen.right()); + } + mLayout->setMargin(mHidden ? PANEL_HIDE_MARGIN : 0); + if (rect != geometry()) + { + setGeometry(rect); + setFixedSize(rect.size()); + } +} + +void LxQtPanel::realign() +{ + if (!isVisible()) + return; +#if 0 + qDebug() << "** Realign *********************"; + qDebug() << "PanelSize: " << mPanelSize; + qDebug() << "IconSize: " << mIconSize; + qDebug() << "LineCount: " << mLineCount; + qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px"); + qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right")); + qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum; + qDebug() << "Plugins count: " << mPlugins.count(); +#endif + + setPanelGeometry(); + + // Reserve our space on the screen .......... + // It's possible that our geometry is not changed, but screen resolution is changed, + // so resetting WM_STRUT is still needed. To make it simple, we always do it. + updateWmStrut(); +} + + +// Update the _NET_WM_PARTIAL_STRUT and _NET_WM_STRUT properties for the window +void LxQtPanel::updateWmStrut() +{ + WId wid = effectiveWinId(); + if(wid == 0 || !isVisible()) + return; + + const QRect rect = geometry(); + // NOTE: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html + // Quote from the EWMH spec: " Note that the strut is relative to the screen edge, and not the edge of the xinerama monitor." + // So, we use the geometry of the whole screen to calculate the strut rather than using the geometry of individual monitors. + // Though the spec only mention Xinerama and did not mention XRandR, the rule should still be applied. + // At least openbox is implemented like this. + switch (mPosition) + { + case LxQtPanel::PositionTop: + KWindowSystem::setExtendedStrut(wid, + /* Left */ 0, 0, 0, + /* Right */ 0, 0, 0, + /* Top */ getReserveDimension(), rect.left(), rect.right(), + /* Bottom */ 0, 0, 0 + ); + break; + + case LxQtPanel::PositionBottom: + KWindowSystem::setExtendedStrut(wid, + /* Left */ 0, 0, 0, + /* Right */ 0, 0, 0, + /* Top */ 0, 0, 0, + /* Bottom */ getReserveDimension(), rect.left(), rect.right() + ); + break; + + case LxQtPanel::PositionLeft: + KWindowSystem::setExtendedStrut(wid, + /* Left */ getReserveDimension(), rect.top(), rect.bottom(), + /* Right */ 0, 0, 0, + /* Top */ 0, 0, 0, + /* Bottom */ 0, 0, 0 + ); + + break; + + case LxQtPanel::PositionRight: + KWindowSystem::setExtendedStrut(wid, + /* Left */ 0, 0, 0, + /* Right */ getReserveDimension(), rect.top(), rect.bottom(), + /* Top */ 0, 0, 0, + /* Bottom */ 0, 0, 0 + ); + break; + } +} + + +/************************************************ + The panel can't be placed on boundary of two displays. + This function checks, is the panel can be placed on the display + @displayNum on @position. + ************************************************/ +bool LxQtPanel::canPlacedOn(int screenNum, LxQtPanel::Position position) +{ + QDesktopWidget* dw = QApplication::desktop(); + + switch (position) + { + case LxQtPanel::PositionTop: + for (int i = 0; i < dw->screenCount(); ++i) + if (dw->screenGeometry(i).bottom() < dw->screenGeometry(screenNum).top()) + return false; + return true; + + case LxQtPanel::PositionBottom: + for (int i = 0; i < dw->screenCount(); ++i) + if (dw->screenGeometry(i).top() > dw->screenGeometry(screenNum).bottom()) + return false; + return true; + + case LxQtPanel::PositionLeft: + for (int i = 0; i < dw->screenCount(); ++i) + if (dw->screenGeometry(i).right() < dw->screenGeometry(screenNum).left()) + return false; + return true; + + case LxQtPanel::PositionRight: + for (int i = 0; i < dw->screenCount(); ++i) + if (dw->screenGeometry(i).left() > dw->screenGeometry(screenNum).right()) + return false; + return true; + } + + return false; +} + + +/************************************************ + + ************************************************/ +int LxQtPanel::findAvailableScreen(LxQtPanel::Position position) +{ + int current = mScreenNum; + + for (int i = current; i < QApplication::desktop()->screenCount(); ++i) + if (canPlacedOn(i, position)) + return i; + + for (int i = 0; i < current; ++i) + if (canPlacedOn(i, position)) + return i; + + return 0; +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::showConfigDialog() +{ + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); + + mConfigDialog->showConfigPanelPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); + + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::showAddPluginDialog() +{ + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); + + mConfigDialog->showConfigPluginsPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); + + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::updateStyleSheet() +{ + QStringList sheet; + sheet << QString("Plugin > QAbstractButton, LxQtTray { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + sheet << QString("Plugin > * > QAbstractButton, TrayIcon { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + + if (mFontColor.isValid()) + sheet << QString("Plugin * { color: " + mFontColor.name() + "; }"); + + QString object = LxQtPanelWidget->objectName(); + + if (mBackgroundColor.isValid()) + { + QString color = QString("%1, %2, %3, %4") + .arg(mBackgroundColor.red()) + .arg(mBackgroundColor.green()) + .arg(mBackgroundColor.blue()) + .arg((float) mOpacity / 100); + sheet << QString("LxQtPanel #BackgroundWidget { background-color: rgba(" + color + "); }"); + } + + if (QFileInfo(mBackgroundImage).exists()) + sheet << QString("LxQtPanel #BackgroundWidget { background-image: url('" + mBackgroundImage + "');}"); + + setStyleSheet(sheet.join("\n")); +} + + + +/************************************************ + + ************************************************/ +void LxQtPanel::setPanelSize(int value, bool save) +{ + if (mPanelSize != value) + { + mPanelSize = value; + realign(); + + if (save) + saveSettings(true); + } +} + + + +/************************************************ + + ************************************************/ +void LxQtPanel::setIconSize(int value, bool save) +{ + if (mIconSize != value) + { + mIconSize = value; + updateStyleSheet(); + mLayout->setLineSize(mIconSize); + + if (save) + saveSettings(true); + + realign(); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::setLineCount(int value, bool save) +{ + if (mLineCount != value) + { + mLineCount = value; + mLayout->setEnabled(false); + mLayout->setLineCount(mLineCount); + mLayout->setEnabled(true); + + if (save) + saveSettings(true); + + realign(); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::setLength(int length, bool inPercents, bool save) +{ + if (mLength == length && + mLengthInPercents == inPercents) + return; + + mLength = length; + mLengthInPercents = inPercents; + + if (save) + saveSettings(true); + + realign(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::setPosition(int screen, ILxQtPanel::Position position, bool save) +{ + if (mScreenNum == screen && + mPosition == position) + return; + + mScreenNum = screen; + mPosition = position; + mLayout->setPosition(mPosition); + + if (save) + saveSettings(true); + + // Qt 5 adds a new class QScreen and add API for setting the screen of a QWindow. + // so we had better use it. However, without this, our program should still work + // as long as XRandR is used. Since XRandR combined all screens into a large virtual desktop + // every screen and their virtual siblings are actually on the same virtual desktop. + // So things still work if we don't set the screen correctly, but this is not the case + // for other backends, such as the upcoming wayland support. Hence it's better to set it. + if(windowHandle()) + { + // QScreen* newScreen = qApp->screens().at(screen); + // QScreen* oldScreen = windowHandle()->screen(); + // const bool shouldRecreate = windowHandle()->handle() && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen)); + // Q_ASSERT(shouldRecreate == false); + + // NOTE: When you move a window to another screen, Qt 5 might recreate the window as needed + // But luckily, this never happen in XRandR, so Qt bug #40681 is not triggered here. + // (The only exception is when the old screen is destroyed, Qt always re-create the window and + // this corner case triggers #40681.) + // When using other kind of multihead settings, such as Xinerama, this might be different and + // unless Qt developers can fix their bug, we have no way to workaround that. + windowHandle()->setScreen(qApp->screens().at(screen)); + } + + realign(); +} + +/************************************************ + * + ************************************************/ +void LxQtPanel::setAlignment(Alignment value, bool save) +{ + if (mAlignment == value) + return; + + mAlignment = value; + + if (save) + saveSettings(true); + + realign(); +} + +/************************************************ + * + ************************************************/ +void LxQtPanel::setFontColor(QColor color, bool save) +{ + mFontColor = color; + updateStyleSheet(); + + if (save) + saveSettings(true); +} + +/************************************************ + + ************************************************/ +void LxQtPanel::setBackgroundColor(QColor color, bool save) +{ + mBackgroundColor = color; + updateStyleSheet(); + + if (save) + saveSettings(true); +} + +/************************************************ + + ************************************************/ +void LxQtPanel::setBackgroundImage(QString path, bool save) +{ + mBackgroundImage = path; + updateStyleSheet(); + + if (save) + saveSettings(true); +} + + +/************************************************ + * + ************************************************/ +void LxQtPanel::setOpacity(int opacity, bool save) +{ + mOpacity = opacity; + updateStyleSheet(); + + if (save) + saveSettings(true); +} + + +/************************************************ + + ************************************************/ +QRect LxQtPanel::globalGometry() const +{ + return QRect(mapToGlobal(QPoint(0, 0)), this->size()); +} + + +/************************************************ + + ************************************************/ +bool LxQtPanel::event(QEvent *event) +{ + switch (event->type()) + { + case QEvent::ContextMenu: + showPopupMenu(); + break; + + case QEvent::LayoutRequest: + emit realigned(); + break; + + case QEvent::WinIdChange: + { + // qDebug() << "WinIdChange" << hex << effectiveWinId(); + if(effectiveWinId() == 0) + break; + + // Sometimes Qt needs to re-create the underlying window of the widget and + // the winId() may be changed at runtime. So we need to reset all X11 properties + // when this happens. + qDebug() << "WinIdChange" << hex << effectiveWinId() << "handle" << windowHandle() << windowHandle()->screen(); + + // Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5 + // See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887 + // Let's use KWindowSystem for that + KWindowSystem::setType(effectiveWinId(), NET::Dock); + + updateWmStrut(); // reserve screen space for the panel + KWindowSystem::setOnAllDesktops(effectiveWinId(), true); + break; + } + case QEvent::DragEnter: + event->ignore(); + //no break intentionally + case QEvent::Enter: + showPanel(); + break; + + case QEvent::Leave: + case QEvent::DragLeave: + hidePanel(); + break; + + default: + break; + } + + return QFrame::event(event); +} + +/************************************************ + + ************************************************/ + +void LxQtPanel::showEvent(QShowEvent *event) +{ + QFrame::showEvent(event); + realign(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::showPopupMenu(Plugin *plugin) +{ + PopupMenu * menu = new PopupMenu(tr("Panel"), this); + menu->setAttribute(Qt::WA_DeleteOnClose); + + menu->setIcon(XdgIcon::fromTheme("configure-toolbars")); + + // Plugin Menu .............................. + if (plugin) + { + QMenu *m = plugin->popupMenu(); + + if (m) + { + menu->addTitle(plugin->windowTitle()); + menu->addActions(m->actions()); + qobject_cast(m)->setParent(menu); + } + } + + // Panel menu ............................... + + menu->addTitle(QIcon(), tr("Panel")); + + menu->addAction(XdgIcon::fromTheme(QStringLiteral("configure")), + tr("Configure Panel"), + this, SLOT(showConfigDialog()) + ); + + menu->addAction(XdgIcon::fromTheme("preferences-plugin"), + tr("Manage Widgets"), + this, SLOT(showAddPluginDialog()) + ); + + LxQtPanelApplication *a = reinterpret_cast(qApp); + menu->addAction(XdgIcon::fromTheme(QLatin1String("list-add")), + tr("Add Panel"), + a, SLOT(addNewPanel()) + ); + + if (a->count() > 1) + { + menu->addAction(XdgIcon::fromTheme(QStringLiteral("list-remove")), + tr("Remove Panel"), + this, SLOT(userRequestForDeletion()) + ); + } + +#ifdef DEBUG + menu->addSeparator(); + menu->addAction("Exit (debug only)", qApp, SLOT(quit())); +#endif + + /* Note: in multihead & multipanel setup the QMenu::popup/exec places the window + * sometimes wrongly (it seems that this bug is somehow connected to misinterpretation + * of QDesktopWidget::availableGeometry) + */ + menu->setGeometry(calculatePopupWindowPos(QCursor::pos(), menu->sizeHint())); + menu->show(); +} + +Plugin* LxQtPanel::findPlugin(const ILxQtPanelPlugin* iPlugin) const +{ + Plugin *plugin = nullptr; + for (Plugin *plug : mPlugins->plugins()) + if (plug->iPlugin() == iPlugin) + plugin = plug; + return plugin; +} + +/************************************************ + + ************************************************/ +QRect LxQtPanel::calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const +{ + int x = absolutePos.x(), y = absolutePos.y(); + + switch (position()) + { + case ILxQtPanel::PositionTop: + y = globalGometry().bottom(); + break; + + case ILxQtPanel::PositionBottom: + y = globalGometry().top() - windowSize.height(); + break; + + case ILxQtPanel::PositionLeft: + x = globalGometry().right(); + break; + + case ILxQtPanel::PositionRight: + x = globalGometry().left() - windowSize.width(); + break; + } + + QRect res(QPoint(x, y), windowSize); + + QRect screen = QApplication::desktop()->screenGeometry(this); + // NOTE: We cannot use AvailableGeometry() which returns the work area here because when in a + // multihead setup with different resolutions. In this case, the size of the work area is limited + // by the smallest monitor and may be much smaller than the current screen and we will place the + // menu at the wrong place. This is very bad for UX. So let's use the full size of the screen. + if (res.right() > screen.right()) + res.moveRight(screen.right()); + + if (res.bottom() > screen.bottom()) + res.moveBottom(screen.bottom()); + + if (res.left() < screen.left()) + res.moveLeft(screen.left()); + + if (res.top() < screen.top()) + res.moveTop(screen.top()); + + return res; +} + +/************************************************ + + ************************************************/ +QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const +{ + Plugin *panel_plugin = findPlugin(plugin); + if (nullptr == panel_plugin) + return QRect(); + + return calculatePopupWindowPos(panel_plugin->mapToGlobal(QPoint(0, 0)), windowSize); +} + + +/************************************************ + + ************************************************/ +QString LxQtPanel::qssPosition() const +{ + return positionToStr(position()); +} + +/************************************************ + + ************************************************/ +void LxQtPanel::pluginMoved(Plugin * plug) +{ + //get new position of the moved plugin + bool found{false}; + QString plug_is_before; + for (int i=0; icount(); ++i) + { + Plugin *plugin = qobject_cast(mLayout->itemAt(i)->widget()); + if (plugin) + { + if (found) + { + //we found our plugin in previous cycle -> is before this (or empty as last) + plug_is_before = plugin->settingsGroup(); + break; + } else + found = (plug == plugin); + } + } + mPlugins->movePlugin(plug, plug_is_before); +} + + +/************************************************ + + ************************************************/ +void LxQtPanel::userRequestForDeletion() +{ + mSettings->beginGroup(mConfigGroup); + QStringList plugins = mSettings->value("plugins").toStringList(); + mSettings->endGroup(); + + Q_FOREACH(QString i, plugins) + if (!i.isEmpty()) + mSettings->remove(i); + + mSettings->remove(mConfigGroup); + + emit deletedByUser(this); +} + +void LxQtPanel::showPanel() +{ + if (mHidable) + { + mHideTimer.stop(); + if (mHidden) + { + mHidden = false; + setPanelGeometry(); + } + } +} + +void LxQtPanel::hidePanel() +{ + if (mHidable && !mHidden) + mHideTimer.start(); +} + +void LxQtPanel::hidePanelWork() +{ + if (mHidable && !mHidden && !geometry().contains(QCursor::pos())) + { + mHidden = true; + setPanelGeometry(); + } else + { + mHideTimer.start(); + } +} + +void LxQtPanel::setHidable(bool hidable, bool save) +{ + if (mHidable == hidable) + return; + + mHidable = mHidden = hidable; + + if (save) + saveSettings(true); + + realign(); +} + +bool LxQtPanel::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + Plugin const * plugin = mPlugins->pluginByID(pluginId); + if (nullptr == plugin) + return false; + else + return plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::SingleInstance); +} diff --git a/lxqt-panel/panel/lxqtpanel.h b/lxqt-panel/panel/lxqtpanel.h new file mode 100644 index 0000000..06aa608 --- /dev/null +++ b/lxqt-panel/panel/lxqtpanel.h @@ -0,0 +1,193 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTPANEL_H +#define LXQTPANEL_H + +#include +#include +#include +#include +#include "ilxqtpanel.h" +#include "lxqtpanelglobals.h" + +class QMenu; +class Plugin; +class QAbstractItemModel; + +namespace LxQt { +class Settings; +class PluginInfo; +} +class LxQtPanelLayout; +class ConfigPanelDialog; +class PanelPluginsModel; + +/*! \brief The LxQtPanel class provides a single lxqt-panel. + */ +class LXQT_PANEL_API LxQtPanel : public QFrame, public ILxQtPanel +{ + Q_OBJECT + + Q_PROPERTY(QString position READ qssPosition) + + // for configuration dialog + friend class ConfigPanelWidget; + friend class ConfigPluginsWidget; + +public: + enum Alignment { + AlignmentLeft = -1, + AlignmentCenter = 0, + AlignmentRight = 1 + }; + + LxQtPanel(const QString &configGroup, QWidget *parent = 0); + virtual ~LxQtPanel(); + + QString name() { return mConfigGroup; } + + void readSettings(); + + void showPopupMenu(Plugin *plugin = 0); + + // ILxQtPanel ......................... + ILxQtPanel::Position position() const { return mPosition; } + QRect globalGometry() const; + Plugin *findPlugin(const ILxQtPanelPlugin *iPlugin) const; + QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const; + QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const; + + // For QSS properties .................. + QString qssPosition() const; + + static bool canPlacedOn(int screenNum, LxQtPanel::Position position); + static QString positionToStr(ILxQtPanel::Position position); + static ILxQtPanel::Position strToPosition(const QString &str, ILxQtPanel::Position defaultValue); + + // Settings + int panelSize() const { return mPanelSize; } + int iconSize() const { return mIconSize; } + int lineCount() const { return mLineCount; } + int length() const { return mLength; } + bool lengthInPercents() const { return mLengthInPercents; } + LxQtPanel::Alignment alignment() const { return mAlignment; } + int screenNum() const { return mScreenNum; } + QColor fontColor() const { return mFontColor; }; + QColor backgroundColor() const { return mBackgroundColor; }; + QString backgroundImage() const { return mBackgroundImage; }; + int opacity() const { return mOpacity; }; + bool hidable() const { return mHidable; } + + LxQt::Settings *settings() const { return mSettings; } + + bool isPluginSingletonAndRunnig(QString const & pluginId) const; + +public slots: + void show(); + void showPanel(); + void hidePanel(); + void hidePanelWork(); + + // Settings + void setPanelSize(int value, bool save); + void setIconSize(int value, bool save); + void setLineCount(int value, bool save); + void setLength(int length, bool inPercents, bool save); + void setPosition(int screen, ILxQtPanel::Position position, bool save); + void setAlignment(LxQtPanel::Alignment value, bool save); + void setFontColor(QColor color, bool save); + void setBackgroundColor(QColor color, bool save); + void setBackgroundImage(QString path, bool save); + void setOpacity(int opacity, bool save); + void setHidable(bool hidable, bool save); + + void saveSettings(bool later=false); + void ensureVisible(); + +signals: + void realigned(); + void deletedByUser(LxQtPanel *self); + void pluginAdded(); + void pluginRemoved(); + +protected: + bool event(QEvent *event); + void showEvent(QShowEvent *event); + +public slots: + void showConfigDialog(); +private slots: + void showAddPluginDialog(); + void realign(); + void pluginMoved(Plugin * plug); + void userRequestForDeletion(); + +private: + LxQtPanelLayout* mLayout; + LxQt::Settings *mSettings; + QFrame *LxQtPanelWidget; + QString mConfigGroup; + QScopedPointer mPlugins; + + int findAvailableScreen(LxQtPanel::Position position); + void updateWmStrut(); + + void loadPlugins(); + + void setPanelGeometry(); + int getReserveDimension(); + + int mPanelSize; + int mIconSize; + int mLineCount; + + int mLength; + bool mLengthInPercents; + + Alignment mAlignment; + + ILxQtPanel::Position mPosition; + int mScreenNum; + QTimer mDelaySave; + bool mHidable; + bool mHidden; + QTimer mHideTimer; + + QColor mFontColor; + QColor mBackgroundColor; + QString mBackgroundImage; + // 0 to 100 + int mOpacity; + QPointer mConfigDialog; + + void updateStyleSheet(); +}; + + +#endif // LXQTPANEL_H diff --git a/lxqt-panel/panel/lxqtpanelapplication.cpp b/lxqt-panel/panel/lxqtpanelapplication.cpp new file mode 100644 index 0000000..d5c140a --- /dev/null +++ b/lxqt-panel/panel/lxqtpanelapplication.cpp @@ -0,0 +1,226 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtpanelapplication.h" +#include "lxqtpanel.h" +#include "config/configpaneldialog.h" +#include +#include +#include +#include +#include +#include + +LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv) + : LxQt::Application(argc, argv, true) +{ + QCoreApplication::setApplicationName(QStringLiteral("lxqt-panel")); + QCoreApplication::setApplicationVersion(LXQT_VERSION); + + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt panel")); + parser.addHelpOption(); + parser.addVersionOption(); + + QCommandLineOption configFileOption(QStringList() + << QStringLiteral("c") << QStringLiteral("config") << QStringLiteral("configfile"), + QCoreApplication::translate("main", "Use alternate configuration file."), + QCoreApplication::translate("main", "Configuration file")); + parser.addOption(configFileOption); + + parser.process(*this); + + const QString configFile = parser.value(configFileOption); + + if (configFile.isEmpty()) + mSettings = new LxQt::Settings(QStringLiteral("panel"), this); + else + mSettings = new LxQt::Settings(configFile, QSettings::IniFormat, this); + + // This is a workaround for Qt 5 bug #40681. + Q_FOREACH(QScreen* screen, screens()) + { + connect(screen, &QScreen::destroyed, this, &LxQtPanelApplication::screenDestroyed); + } + connect(this, &QGuiApplication::screenAdded, this, &LxQtPanelApplication::handleScreenAdded); + connect(this, &QCoreApplication::aboutToQuit, this, &LxQtPanelApplication::cleanup); + + + QStringList panels = mSettings->value("panels").toStringList(); + + if (panels.isEmpty()) + { + panels << "panel1"; + } + + Q_FOREACH(QString i, panels) + { + addPanel(i); + } +} + +LxQtPanelApplication::~LxQtPanelApplication() +{ +} + +void LxQtPanelApplication::cleanup() +{ + qDeleteAll(mPanels); +} + +void LxQtPanelApplication::addNewPanel() +{ + QString name("panel_" + QUuid::createUuid().toString()); + LxQtPanel *p = addPanel(name); + QStringList panels = mSettings->value("panels").toStringList(); + panels << name; + mSettings->setValue("panels", panels); + + // Poupup the configuration dialog to allow user configuration right away + p->showConfigDialog(); +} + +LxQtPanel* LxQtPanelApplication::addPanel(const QString& name) +{ + LxQtPanel *panel = new LxQtPanel(name); + mPanels << panel; + connect(panel, SIGNAL(deletedByUser(LxQtPanel*)), + this, SLOT(removePanel(LxQtPanel*))); + //reemit signals + connect(panel, &LxQtPanel::pluginAdded, this, &LxQtPanelApplication::pluginAdded); + connect(panel, &LxQtPanel::pluginRemoved, this, &LxQtPanelApplication::pluginRemoved); + + return panel; +} + +void LxQtPanelApplication::handleScreenAdded(QScreen* newScreen) +{ + // qDebug() << "LxQtPanelApplication::handleScreenAdded" << newScreen; + connect(newScreen, &QScreen::destroyed, this, &LxQtPanelApplication::screenDestroyed); +} + +void LxQtPanelApplication::reloadPanelsAsNeeded() +{ + // NOTE by PCMan: This is a workaround for Qt 5 bug #40681. + // Here we try to re-create the missing panels which are deleted in + // LxQtPanelApplication::screenDestroyed(). + + // qDebug() << "LxQtPanelApplication::reloadPanelsAsNeeded()"; + QStringList names = mSettings->value("panels").toStringList(); + Q_FOREACH(const QString& name, names) + { + bool found = false; + Q_FOREACH(LxQtPanel* panel, mPanels) + { + if(panel->name() == name) + { + found = true; + break; + } + } + if(!found) + { + // the panel is found in the config file but does not exist, create it. + qDebug() << "Workaround Qt 5 bug #40681: re-create panel:" << name; + addPanel(name); + } + } + qApp->setQuitOnLastWindowClosed(true); +} + +void LxQtPanelApplication::screenDestroyed(QObject* screenObj) +{ + // NOTE by PCMan: This is a workaround for Qt 5 bug #40681. + // With this very dirty workaround, we can fix lxde/lxde-qt bug #204, #205, and #206. + // Qt 5 has two new regression bugs which breaks lxqt-panel in a multihead environment. + // #40681: Regression bug: QWidget::winId() returns old value and QEvent::WinIdChange event is not emitted sometimes. (multihead setup) + // #40791: Regression: QPlatformWindow, QWindow, and QWidget::winId() are out of sync. + // Explanations for the workaround: + // Internally, Qt mantains a list of QScreens and update it when XRandR configuration changes. + // When the user turn off an monitor with xrandr --output --off, this will destroy the QScreen + // object which represent the output. If the QScreen being destroyed contains our panel widget, + // Qt will call QWindow::setScreen(0) on the internal windowHandle() of our panel widget to move it + // to the primary screen. However, moving a window to a different screen is more than just changing + // its position. With XRandR, all screens are actually part of the same virtual desktop. However, + // this is not the case in other setups, such as Xinerama and moving a window to another screen is + // not possible unless you destroy the widget and create it again for a new screen. + // Therefore, Qt destroy the widget and re-create it when moving our panel to a new screen. + // Unfortunately, destroying the window also destroy the child windows embedded into it, + // using XEMBED such as the tray icons. (#206) + // Second, when the window is re-created, the winId of the QWidget is changed, but Qt failed to + // generate QEvent::WinIdChange event so we have no way to know that. We have to set + // some X11 window properties using the native winId() to make it a dock, but this stop working + // because we cannot get the correct winId(), so this causes #204 and #205. + // + // The workaround is very simple. Just completely destroy the panel before Qt has a chance to do + // QWindow::setScreen() for it. Later, we reload the panel ourselves. So this can bypassing the Qt bugs. + QScreen* screen = static_cast(screenObj); + bool reloadNeeded = false; + qApp->setQuitOnLastWindowClosed(false); + Q_FOREACH(LxQtPanel* panel, mPanels) + { + QWindow* panelWindow = panel->windowHandle(); + if(panelWindow && panelWindow->screen() == screen) + { + // the screen containing the panel is destroyed + // delete and then re-create the panel ourselves + QString name = panel->name(); + panel->saveSettings(false); + delete panel; // delete the panel, so Qt does not have a chance to set a new screen to it. + mPanels.removeAll(panel); + reloadNeeded = true; + qDebug() << "Workaround Qt 5 bug #40681: delete panel:" << name; + } + } + if(reloadNeeded) + QTimer::singleShot(1000, this, SLOT(reloadPanelsAsNeeded())); + else + qApp->setQuitOnLastWindowClosed(true); +} + +void LxQtPanelApplication::removePanel(LxQtPanel* panel) +{ + Q_ASSERT(mPanels.contains(panel)); + + mPanels.removeAll(panel); + + QStringList panels = mSettings->value("panels").toStringList(); + panels.removeAll(panel->name()); + mSettings->setValue("panels", panels); + + panel->deleteLater(); +} + +bool LxQtPanelApplication::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + for (auto const & panel : mPanels) + if (panel->isPluginSingletonAndRunnig(pluginId)) + return true; + + return false; +} diff --git a/lxqt-panel/panel/lxqtpanelapplication.h b/lxqt-panel/panel/lxqtpanelapplication.h new file mode 100644 index 0000000..55d13ca --- /dev/null +++ b/lxqt-panel/panel/lxqtpanelapplication.h @@ -0,0 +1,78 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTPANELAPPLICATION_H +#define LXQTPANELAPPLICATION_H + +#include +#include "ilxqtpanelplugin.h" + +class QScreen; + +class LxQtPanel; +namespace LxQt { +class Settings; +} + +class LxQtPanelApplication : public LxQt::Application +{ + Q_OBJECT +public: + explicit LxQtPanelApplication(int& argc, char** argv); + ~LxQtPanelApplication(); + + int count() { return mPanels.count(); } + LxQt::Settings *settings() { return mSettings; } + bool isPluginSingletonAndRunnig(QString const & pluginId) const; + +public slots: + void addNewPanel(); + +signals: + void pluginAdded(); + void pluginRemoved(); + +private: + QList mPanels; + + LxQtPanel* addPanel(const QString &name); + +private slots: + void removePanel(LxQtPanel* panel); + + void handleScreenAdded(QScreen* newScreen); + void screenDestroyed(QObject* screenObj); + void reloadPanelsAsNeeded(); + void cleanup(); + +private: + LxQt::Settings *mSettings; +}; + + +#endif // LXQTPANELAPPLICATION_H diff --git a/lxqt-panel/panel/lxqtpanelglobals.h b/lxqt-panel/panel/lxqtpanelglobals.h new file mode 100644 index 0000000..36da6a7 --- /dev/null +++ b/lxqt-panel/panel/lxqtpanelglobals.h @@ -0,0 +1,39 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxde.org/ + * + * Copyright: 2013 LXDE-Qt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef __LXQT_PANEL_GLOBALS_H__ +#define __LXQT_PANEL_GLOBALS_H__ + +#include + +#ifdef COMPILE_LXQT_PANEL +#define LXQT_PANEL_API Q_DECL_EXPORT +#else +#define LXQT_PANEL_API Q_DECL_IMPORT +#endif + +#endif // __LXQT_PANEL_GLOBALS_H__ diff --git a/lxqt-panel/panel/lxqtpanellayout.cpp b/lxqt-panel/panel/lxqtpanellayout.cpp new file mode 100644 index 0000000..6416bca --- /dev/null +++ b/lxqt-panel/panel/lxqtpanellayout.cpp @@ -0,0 +1,1007 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtpanellayout.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "plugin.h" +#include "lxqtpanellimits.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanel.h" +#include "pluginmoveprocessor.h" +#include +#include + +#define ANIMATION_DURATION 250 + +class ItemMoveAnimation : public QVariantAnimation +{ +public: + ItemMoveAnimation(QLayoutItem *item) : + mItem(item) + { + setEasingCurve(QEasingCurve::OutBack); + setDuration(ANIMATION_DURATION); + } + + void updateCurrentValue(const QVariant ¤t) + { + mItem->setGeometry(current.toRect()); + } + +private: + QLayoutItem* mItem; + +}; + + +struct LayoutItemInfo +{ + LayoutItemInfo(QLayoutItem *layoutItem=0); + QLayoutItem *item; + QRect geometry; + bool separate; + bool expandable; +}; + + +LayoutItemInfo::LayoutItemInfo(QLayoutItem *layoutItem): + item(layoutItem), + separate(false), + expandable(false) +{ + if (!item) + return; + + Plugin *p = qobject_cast(item->widget()); + if (p) + { + separate = p->isSeparate(); + expandable = p->isExpandable(); + return; + } +} + + + +/************************************************ + This is logical plugins grid, it's same for + horizontal and vertical panel. Plugins keeps as: + + <---LineCount--> + + ---+----+----+ + | P1 | P2 | P3 | + +----+----+----+ + | P4 | P5 | | + +----+----+----+ + ... + +----+----+----+ + | PN | | | + +----+----+----+ + ************************************************/ +class LayoutItemGrid +{ +public: + explicit LayoutItemGrid(); + + void addItem(QLayoutItem *item); + int count() const { return mItems.count(); } + QLayoutItem *itemAt(int index) const { return mItems[index]; } + QLayoutItem *takeAt(int index); + + + const LayoutItemInfo &itemInfo(int row, int col) const; + LayoutItemInfo &itemInfo(int row, int col); + + void update(); + + int lineSize() const { return mLineSize; } + void setLineSize(int value); + + int colCount() const { return mColCount; } + void setColCount(int value); + + int usedColCount() const { return mUsedColCount; } + + int rowCount() const { return mRowCount; } + + void invalidate() { mValid = false; } + bool isValid() const { return mValid; } + + QSize sizeHint() const { return mSizeHint; } + + bool horiz() const { return mHoriz; } + void setHoriz(bool value); + + void clear(); + void rebuild(); + + bool isExpandable() const { return mExpandable; } + int expandableSize() const { return mExpandableSize; } + + void moveItem(int from, int to); + +private: + QVector mInfoItems; + int mColCount; + int mUsedColCount; + int mRowCount; + bool mValid; + int mExpandableSize; + int mLineSize; + + QSize mSizeHint; + QSize mMinSize; + bool mHoriz; + + int mNextRow; + int mNextCol; + bool mExpandable; + QList mItems; + + void doAddToGrid(QLayoutItem *item); +}; + + +/************************************************ + + ************************************************/ +LayoutItemGrid::LayoutItemGrid() +{ + mLineSize = 0; + mHoriz = true; + clear(); +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::clear() +{ + mRowCount = 0; + mNextRow = 0; + mNextCol = 0; + mInfoItems.resize(0); + mValid = false; + mExpandable = false; + mExpandableSize = 0; + mUsedColCount = 0; + mSizeHint = QSize(0,0); + mMinSize = QSize(0,0); +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::rebuild() +{ + clear(); + + foreach(QLayoutItem *item, mItems) + { + doAddToGrid(item); + } +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::addItem(QLayoutItem *item) +{ + doAddToGrid(item); + mItems.append(item); +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::doAddToGrid(QLayoutItem *item) +{ + LayoutItemInfo info(item); + + if (info.separate && mNextCol > 0) + { + mNextCol = 0; + mNextRow++; + } + + int cnt = (mNextRow + 1 ) * mColCount; + if (mInfoItems.count() <= cnt) + mInfoItems.resize(cnt); + + int idx = mNextRow * mColCount + mNextCol; + mInfoItems[idx] = info; + mUsedColCount = qMax(mUsedColCount, mNextCol + 1); + mExpandable = mExpandable || info.expandable; + mRowCount = qMax(mRowCount, mNextRow+1); + + if (info.separate || mNextCol >= mColCount-1) + { + mNextRow++; + mNextCol = 0; + } + else + { + mNextCol++; + } + + invalidate(); +} + + +/************************************************ + + ************************************************/ +QLayoutItem *LayoutItemGrid::takeAt(int index) +{ + QLayoutItem *item = mItems.takeAt(index); + rebuild(); + return item; +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::moveItem(int from, int to) +{ + mItems.move(from, to); + rebuild(); +} + + +/************************************************ + + ************************************************/ +const LayoutItemInfo &LayoutItemGrid::itemInfo(int row, int col) const +{ + return mInfoItems[row * mColCount + col]; +} + + +/************************************************ + + ************************************************/ +LayoutItemInfo &LayoutItemGrid::itemInfo(int row, int col) +{ + return mInfoItems[row * mColCount + col]; +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::update() +{ + mExpandableSize = 0; + mSizeHint = QSize(0,0); + + if (mHoriz) + { + mSizeHint.setHeight(mLineSize * mColCount); + int x = 0; + for (int r=0; rsizeHint(); + info.geometry = QRect(QPoint(x,y), sz); + y += sz.height(); + rw = qMax(rw, sz.width()); + } + x += rw; + + if (itemInfo(r, 0).expandable) + mExpandableSize += rw; + + mSizeHint.setWidth(x); + mSizeHint.rheight() = qMax(mSizeHint.rheight(), y); + } + } + else + { + mSizeHint.setWidth(mLineSize * mColCount); + int y = 0; + for (int r=0; rsizeHint(); + info.geometry = QRect(QPoint(x,y), sz); + x += sz.width(); + rh = qMax(rh, sz.height()); + } + y += rh; + + if (itemInfo(r, 0).expandable) + mExpandableSize += rh; + + mSizeHint.setHeight(y); + mSizeHint.rwidth() = qMax(mSizeHint.rwidth(), x); + } + } + + mValid = true; +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::setLineSize(int value) +{ + mLineSize = qMax(1, value); + invalidate(); +} + + +/************************************************ + + ************************************************/ +void LayoutItemGrid::setColCount(int value) +{ + mColCount = qMax(1, value); + rebuild(); +} + +/************************************************ + + ************************************************/ +void LayoutItemGrid::setHoriz(bool value) +{ + mHoriz = value; + invalidate(); +} + + + +/************************************************ + + ************************************************/ +LxQtPanelLayout::LxQtPanelLayout(QWidget *parent) : + QLayout(parent), + mLeftGrid(new LayoutItemGrid()), + mRightGrid(new LayoutItemGrid()), + mPosition(ILxQtPanel::PositionBottom), + mAnimate(false) +{ + setMargin(0); +} + + +/************************************************ + + ************************************************/ +LxQtPanelLayout::~LxQtPanelLayout() +{ + delete mLeftGrid; + delete mRightGrid; +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::addItem(QLayoutItem *item) +{ + LayoutItemGrid *grid = mRightGrid; + + Plugin *p = qobject_cast(item->widget()); + if (p && p->alignment() == Plugin::AlignLeft) + grid = mLeftGrid; + + grid->addItem(item); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::globalIndexToLocal(int index, LayoutItemGrid **grid, int *gridIndex) +{ + if (index < mLeftGrid->count()) + { + *grid = mLeftGrid; + *gridIndex = index; + return; + } + + *grid = mRightGrid; + *gridIndex = index - mLeftGrid->count(); +} + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::globalIndexToLocal(int index, LayoutItemGrid **grid, int *gridIndex) const +{ + if (index < mLeftGrid->count()) + { + *grid = mLeftGrid; + *gridIndex = index; + return; + } + + *grid = mRightGrid; + *gridIndex = index - mLeftGrid->count(); +} + + +/************************************************ + + ************************************************/ +QLayoutItem *LxQtPanelLayout::itemAt(int index) const +{ + if (index < 0 || index >= count()) + return 0; + + LayoutItemGrid *grid=0; + int idx=0; + globalIndexToLocal(index, &grid, &idx); + + return grid->itemAt(idx); +} + + +/************************************************ + + ************************************************/ +QLayoutItem *LxQtPanelLayout::takeAt(int index) +{ + if (index < 0 || index >= count()) + return 0; + + LayoutItemGrid *grid=0; + int idx=0; + globalIndexToLocal(index, &grid, &idx); + + return grid->takeAt(idx); +} + + +/************************************************ + + ************************************************/ +int LxQtPanelLayout::count() const +{ + return mLeftGrid->count() + mRightGrid->count(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::moveItem(int from, int to, bool withAnimation) +{ + if (from != to) + { + LayoutItemGrid *fromGrid=0; + int fromIdx=0; + globalIndexToLocal(from, &fromGrid, &fromIdx); + + LayoutItemGrid *toGrid=0; + int toIdx=0; + globalIndexToLocal(to, &toGrid, &toIdx); + + if (fromGrid == toGrid) + { + fromGrid->moveItem(fromIdx, toIdx); + } + else + { + QLayoutItem *item = fromGrid->takeAt(fromIdx); + toGrid->addItem(item); + //recalculate position because we removed from one and put to another grid + LayoutItemGrid *toGridAux=0; + globalIndexToLocal(to, &toGridAux, &toIdx); + Q_ASSERT(toGrid == toGridAux); //grid must be the same (if not something is wrong with our logic) + toGrid->moveItem(toGridAux->count()-1, toIdx); + } + } + + mAnimate = withAnimation; + invalidate(); +} + + +/************************************************ + + ************************************************/ +QSize LxQtPanelLayout::sizeHint() const +{ + if (!mLeftGrid->isValid()) + mLeftGrid->update(); + + if (!mRightGrid->isValid()) + mRightGrid->update(); + + QSize ls = mLeftGrid->sizeHint(); + QSize rs = mRightGrid->sizeHint(); + + if (isHorizontal()) + { + return QSize(ls.width() + rs.width(), + qMax(ls.height(), rs.height())); + } + else + { + return QSize(qMax(ls.width(), rs.width()), + ls.height() + rs.height()); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setGeometry(const QRect &geometry) +{ + if (!mLeftGrid->isValid()) + mLeftGrid->update(); + + if (!mRightGrid->isValid()) + mRightGrid->update(); + + QRect my_geometry{geometry}; + my_geometry -= contentsMargins(); + if (count()) + { + if (isHorizontal()) + setGeometryHoriz(my_geometry); + else + setGeometryVert(my_geometry); + } + + mAnimate = false; + QLayout::setGeometry(my_geometry); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setItemGeometry(QLayoutItem *item, const QRect &geometry, bool withAnimation) +{ + Plugin *plugin = qobject_cast(item->widget()); + if (withAnimation && plugin) + { + ItemMoveAnimation* animation = new ItemMoveAnimation(item); + animation->setStartValue(item->geometry()); + animation->setEndValue(geometry); + animation->start(animation->DeleteWhenStopped); + } + else + { + item->setGeometry(geometry); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) +{ + // Calc expFactor for expandable plugins like TaskBar. + double expFactor; + { + int expWidth = mLeftGrid->expandableSize() + mRightGrid->expandableSize(); + int nonExpWidth = mLeftGrid->sizeHint().width() - mLeftGrid->expandableSize() + + mRightGrid->sizeHint().width() - mRightGrid->expandableSize(); + expFactor = expWidth ? ((1.0 * geometry.width() - nonExpWidth) / expWidth) : 1; + } + + // Calc baselines for plugins like button. + QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); + { + int bh = geometry.height() / baseLines.count(); + int base = geometry.top() + (bh >> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bh) + { + *i = base; + } + } + +#if 0 + qDebug() << "** LxQtPanelLayout::setGeometryHoriz **************"; + qDebug() << "geometry: " << geometry; + + qDebug() << "Left grid"; + qDebug() << " cols:" << mLeftGrid->colCount() << " rows:" << mLeftGrid->rowCount(); + qDebug() << " usedCols" << mLeftGrid->usedColCount(); + + qDebug() << "Right grid"; + qDebug() << " cols:" << mRightGrid->colCount() << " rows:" << mRightGrid->rowCount(); + qDebug() << " usedCols" << mRightGrid->usedColCount(); +#endif + + + // Left aligned plugins. + int left=geometry.left(); + for (int r=0; rrowCount(); ++r) + { + int rw = 0; + for (int c=0; cusedColCount(); ++c) + { + const LayoutItemInfo &info = mLeftGrid->itemInfo(r, c); + if (info.item) + { + QRect rect; + if (info.separate) + { + rect.setLeft(left); + rect.setTop(geometry.top()); + rect.setHeight(geometry.height()); + + if (info.expandable) + rect.setWidth(info.geometry.width() * expFactor); + else + rect.setWidth(info.geometry.width()); + } + else + { + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); + rect.moveCenter(QPoint(0, baseLines[c])); + rect.moveLeft(left); + } + + rw = qMax(rw, rect.width()); + setItemGeometry(info.item, rect, mAnimate); + } + } + left += rw; + } + + // Right aligned plugins. + int right=geometry.right(); + for (int r=mRightGrid->rowCount()-1; r>=0; --r) + { + int rw = 0; + for (int c=0; cusedColCount(); ++c) + { + const LayoutItemInfo &info = mRightGrid->itemInfo(r, c); + if (info.item) + { + QRect rect; + if (info.separate) + { + rect.setTop(geometry.top()); + rect.setHeight(geometry.height()); + + if (info.expandable) + rect.setWidth(info.geometry.width() * expFactor); + else + rect.setWidth(info.geometry.width()); + + rect.moveRight(right); + } + else + { + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); + rect.moveCenter(QPoint(0, baseLines[c])); + rect.moveRight(right); + } + + rw = qMax(rw, rect.width()); + setItemGeometry(info.item, rect, mAnimate); + } + } + right -= rw; + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setGeometryVert(const QRect &geometry) +{ + // Calc expFactor for expandable plugins like TaskBar. + double expFactor; + { + int expHeight = mLeftGrid->expandableSize() + mRightGrid->expandableSize(); + int nonExpHeight = mLeftGrid->sizeHint().height() - mLeftGrid->expandableSize() + + mRightGrid->sizeHint().height() - mRightGrid->expandableSize(); + expFactor = expHeight ? ((1.0 * geometry.height() - nonExpHeight) / expHeight) : 1; + } + + // Calc baselines for plugins like button. + QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); + { + int bw = geometry.width() / baseLines.count(); + int base = geometry.left() + (bw >> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bw) + { + *i = base; + } + } + +#if 0 + qDebug() << "** LxQtPanelLayout::setGeometryVert **************"; + qDebug() << "geometry: " << geometry; + + qDebug() << "Left grid"; + qDebug() << " cols:" << mLeftGrid->colCount() << " rows:" << mLeftGrid->rowCount(); + qDebug() << " usedCols" << mLeftGrid->usedColCount(); + + qDebug() << "Right grid"; + qDebug() << " cols:" << mRightGrid->colCount() << " rows:" << mRightGrid->rowCount(); + qDebug() << " usedCols" << mRightGrid->usedColCount(); +#endif + + // Top aligned plugins. + int top=geometry.top(); + for (int r=0; rrowCount(); ++r) + { + int rh = 0; + for (int c=0; cusedColCount(); ++c) + { + const LayoutItemInfo &info = mLeftGrid->itemInfo(r, c); + if (info.item) + { + QRect rect; + if (info.separate) + { + rect.moveTop(top); + rect.setLeft(geometry.left()); + rect.setWidth(geometry.width()); + + if (info.expandable) + rect.setHeight(info.geometry.height() * expFactor); + else + rect.setHeight(info.geometry.height()); + } + else + { + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); + rect.moveCenter(QPoint(baseLines[c], 0)); + rect.moveTop(top); + } + + rh = qMax(rh, rect.height()); + setItemGeometry(info.item, rect, mAnimate); + } + } + top += rh; + } + + + // Bottom aligned plugins. + int bottom=geometry.bottom(); + for (int r=mRightGrid->rowCount()-1; r>=0; --r) + { + int rh = 0; + for (int c=0; cusedColCount(); ++c) + { + const LayoutItemInfo &info = mRightGrid->itemInfo(r, c); + if (info.item) + { + QRect rect; + if (info.separate) + { + rect.setLeft(geometry.left()); + rect.setWidth(geometry.width()); + + if (info.expandable) + rect.setHeight(info.geometry.height() * expFactor); + else + rect.setHeight(info.geometry.height()); + rect.moveBottom(bottom); + } + else + { + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); + rect.moveCenter(QPoint(baseLines[c], 0)); + rect.moveBottom(bottom); + } + + rh = qMax(rh, rect.height()); + setItemGeometry(info.item, rect, mAnimate); + } + } + bottom -= rh; + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::invalidate() +{ + mLeftGrid->invalidate(); + mRightGrid->invalidate(); + mMinPluginSize = QSize(); + QLayout::invalidate(); +} + + +/************************************************ + + ************************************************/ +int LxQtPanelLayout::lineCount() const +{ + return mLeftGrid->colCount(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setLineCount(int value) +{ + mLeftGrid->setColCount(value); + mRightGrid->setColCount(value); + invalidate(); +} + + +/************************************************ + + ************************************************/ +int LxQtPanelLayout::lineSize() const +{ + return mLeftGrid->lineSize(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setLineSize(int value) +{ + mLeftGrid->setLineSize(value); + mRightGrid->setLineSize(value); + invalidate(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::setPosition(ILxQtPanel::Position value) +{ + mPosition = value; + mLeftGrid->setHoriz(isHorizontal()); + mRightGrid->setHoriz(isHorizontal()); +} + + +/************************************************ + + ************************************************/ +bool LxQtPanelLayout::isHorizontal() const +{ + return mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom; +} + + +/************************************************ + + ************************************************/ +bool LxQtPanelLayout::itemIsSeparate(QLayoutItem *item) +{ + if (!item) + return true; + + Plugin *p = qobject_cast(item->widget()); + if (!p) + return true; + + return p->isSeparate(); +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::startMovePlugin() +{ + Plugin *plugin = qobject_cast(sender()); + if (plugin) + { + // We have not memoryleaks there. + // The processor will be automatically deleted when stopped. + PluginMoveProcessor *moveProcessor = new PluginMoveProcessor(this, plugin); + moveProcessor->start(); + connect(moveProcessor, SIGNAL(finished()), this, SLOT(finishMovePlugin())); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::finishMovePlugin() +{ + PluginMoveProcessor *moveProcessor = qobject_cast(sender()); + if (moveProcessor) + { + Plugin *plugin = moveProcessor->plugin(); + int n = indexOf(plugin); + plugin->setAlignment(ncount() ? Plugin::AlignLeft : Plugin::AlignRight); + emit pluginMoved(plugin); + } +} + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::moveUpPlugin(Plugin * plugin) +{ + const int i = indexOf(plugin); + if (0 < i) + moveItem(i, i - 1, true); +} + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::addPlugin(Plugin * plugin) +{ + connect(plugin, &Plugin::startMove, this, &LxQtPanelLayout::startMovePlugin); + + const int prev_count = count(); + addWidget(plugin); + + //check actual position + const int pos = indexOf(plugin); + if (prev_count > pos) + moveItem(pos, prev_count, false); +} diff --git a/lxqt-panel/panel/lxqtpanellayout.h b/lxqt-panel/panel/lxqtpanellayout.h new file mode 100644 index 0000000..c833647 --- /dev/null +++ b/lxqt-panel/panel/lxqtpanellayout.h @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTPANELLAYOUT_H +#define LXQTPANELLAYOUT_H + +#include +#include +#include +#include +#include "ilxqtpanel.h" +#include "lxqtpanelglobals.h" + +class MoveInfo; +class QMouseEvent; +class QEvent; + +class Plugin; +class LayoutItemGrid; + +class LXQT_PANEL_API LxQtPanelLayout : public QLayout +{ + Q_OBJECT +public: + explicit LxQtPanelLayout(QWidget *parent); + ~LxQtPanelLayout(); + + void addItem(QLayoutItem *item); + QLayoutItem *itemAt(int index) const; + QLayoutItem *takeAt(int index); + int count() const; + void moveItem(int from, int to, bool withAnimation=false); + + QSize sizeHint() const; + //QSize minimumSize() const; + void setGeometry(const QRect &geometry); + + bool isHorizontal() const; + + void invalidate(); + + int lineCount() const; + void setLineCount(int value); + + int lineSize() const; + void setLineSize(int value); + + ILxQtPanel::Position position() const { return mPosition; } + void setPosition(ILxQtPanel::Position value); + + static bool itemIsSeparate(QLayoutItem *item); +signals: + void pluginMoved(Plugin * plugin); + +public slots: + void startMovePlugin(); + void finishMovePlugin(); + void moveUpPlugin(Plugin * plugin); + void addPlugin(Plugin * plugin); + +private: + mutable QSize mMinPluginSize; + LayoutItemGrid *mLeftGrid; + LayoutItemGrid *mRightGrid; + ILxQtPanel::Position mPosition; + bool mAnimate; + + + void setGeometryHoriz(const QRect &geometry); + void setGeometryVert(const QRect &geometry); + void globalIndexToLocal(int index, LayoutItemGrid **grid, int *gridIndex); + void globalIndexToLocal(int index, LayoutItemGrid **grid, int *gridIndex) const; + + void setItemGeometry(QLayoutItem *item, const QRect &geometry, bool withAnimation); +}; + +#endif // LXQTPANELLAYOUT_H diff --git a/lxqt-panel/panel/lxqtpanellimits.h b/lxqt-panel/panel/lxqtpanellimits.h new file mode 100644 index 0000000..0dfff4f --- /dev/null +++ b/lxqt-panel/panel/lxqtpanellimits.h @@ -0,0 +1,46 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Luís Pereira + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTPANELLIMITS_H +#define LXQTPANELLIMITS_H + +#define PANEL_DEFAULT_SIZE 32 +#define PANEL_MINIMUM_SIZE 16 +#define PANEL_MAXIMUM_SIZE 200 +#define PANEL_HIDE_SIZE 4 +#define PANEL_HIDE_MARGIN (PANEL_HIDE_SIZE / 2) + +#define PANEL_DEFAULT_ICON_SIZE 22 +#define PANEL_DEFAULT_LINE_COUNT 1 + +#define PANEL_DEFAULT_BACKGROUND_COLOR "#CCCCCC" + +#define PANEL_HIDE_DELAY 500 +#define PANEL_HIDE_FIRST_TIME (5000 - PANEL_HIDE_DELAY) + +#define SETTINGS_SAVE_DELAY 3000 +#endif // LXQTPANELLIMITS_H diff --git a/lxqt-panel/panel/lxqtpanelpluginconfigdialog.cpp b/lxqt-panel/panel/lxqtpanelpluginconfigdialog.cpp new file mode 100644 index 0000000..57bedaf --- /dev/null +++ b/lxqt-panel/panel/lxqtpanelpluginconfigdialog.cpp @@ -0,0 +1,94 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtpanelpluginconfigdialog.h" + + +#include +#include +#include +#include +/************************************************ + + ************************************************/ +LxQtPanelPluginConfigDialog::LxQtPanelPluginConfigDialog(QSettings &settings, QWidget *parent) : + QDialog(parent), + mSettings(settings), + mOldSettings(settings) +{ +} + + +/************************************************ + + ************************************************/ +LxQtPanelPluginConfigDialog::~LxQtPanelPluginConfigDialog() +{ +} + + +/************************************************ + + ************************************************/ +QSettings& LxQtPanelPluginConfigDialog::settings() const +{ + return mSettings; +} + + + +/************************************************ + + ************************************************/ +void LxQtPanelPluginConfigDialog::dialogButtonsAction(QAbstractButton *btn) +{ + QDialogButtonBox *box = qobject_cast(btn->parent()); + + if (box && box->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + + +/************************************************ + + ************************************************/ +void LxQtPanelPluginConfigDialog::setComboboxIndexByData(QComboBox *comboBox, const QVariant &data, int defaultIndex) const +{ + int index = comboBox ->findData(data); + if (index < 0) + index = defaultIndex; + + comboBox->setCurrentIndex(index); +} diff --git a/lxqt-panel/panel/lxqtpanelpluginconfigdialog.h b/lxqt-panel/panel/lxqtpanelpluginconfigdialog.h new file mode 100644 index 0000000..690e383 --- /dev/null +++ b/lxqt-panel/panel/lxqtpanelpluginconfigdialog.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTPANELPLUGINCONFIGDIALOG_H +#define LXQTPANELPLUGINCONFIGDIALOG_H + +#include +#include +#include +#include "lxqtpanelglobals.h" + +class QComboBox; + +class LXQT_PANEL_API LxQtPanelPluginConfigDialog : public QDialog +{ + Q_OBJECT +public: + explicit LxQtPanelPluginConfigDialog(QSettings &settings, QWidget *parent = 0); + virtual ~LxQtPanelPluginConfigDialog(); + + QSettings& settings() const; + +protected slots: + /* + Saves settings in conf file. + */ + virtual void loadSettings() = 0; + virtual void dialogButtonsAction(QAbstractButton *btn); + +protected: + void setComboboxIndexByData(QComboBox *comboBox, const QVariant &data, int defaultIndex = 0) const; + +private: + QSettings &mSettings; + LxQt::SettingsCache mOldSettings; + +}; + +#endif // LXQTPANELPLUGINCONFIGDIALOG_H diff --git a/lxqt-panel/panel/main.cpp b/lxqt-panel/panel/main.cpp new file mode 100644 index 0000000..53d6921 --- /dev/null +++ b/lxqt-panel/panel/main.cpp @@ -0,0 +1,42 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtpanelapplication.h" + +/*! The lxqt-panel is the panel of LXDE-Qt. + Usage: lxqt-panel [CONFIG_ID] + CONFIG_ID Section name in config file ~/.config/lxqt-panel/panel.conf + (default main) + */ + +int main(int argc, char *argv[]) +{ + LxQtPanelApplication app(argc, argv); + + return app.exec(); +} diff --git a/lxqt-panel/panel/man/lxqt-panel.1 b/lxqt-panel/panel/man/lxqt-panel.1 new file mode 100644 index 0000000..c3eb14a --- /dev/null +++ b/lxqt-panel/panel/man/lxqt-panel.1 @@ -0,0 +1,57 @@ +.TH lxqt-panel "1" "September 2012" "LXQt\ 0.5.0" "LXQt\ Module" +.SH NAME +lxqt-panel \- Panel of \fBLXQt\fR: the faster and lighter QT Desktop Environment +.SH SYNOPSIS +.B lxqt-panel +.br +.SH DESCRIPTION +This module adds a panel to the desktop. +.P +.P +The \fBLXQt modules\fR are desktop independent tools, +and operate as daemons for the local user for desktop specific operations. +.P +\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt +technologies, ships several core desktop components, all of which are optional: +.P + * Panel \fI(this)\fR + * Desktop + * Application launcher + * Settings center + * Session handler + * Polkit handler + * SSH password access + * Display manager handler +.P +These components perform similar actions to those available in other desktop +environments, and their name is self-descriptive. They are usually not launched +by hand but automatically, when choosing a \fBLXQt\fR session in the Display +Manager. +.SH BEHAVIOR +The module can be run standard alone, and also autostarted at logon. Show a bar panel +by default in bottom of desktop. +.P +The panel works with plugins, each component are a plugin, like the menu or the volume icon. +.P +Several plugins are loaded by default, the desktop menu and windows workspaces can also managed here. +.SH CONFIGURATIONS +By right clickin over there show config setting options for each plugins and also panel itsefl. +.SH AUTOSTART +The module only are showed on \fBLXQt\fR desktop environment, but you can create an autostart action +for you prefered desktop environment. +.SH "REPORTING BUGS" +Report bugs to https://github.com/LXDE/LXQt/issues +.SH "SEE ALSO" +\fBLXQt\fR it has been tailored for users who value simplicity, speed, and +an intuitive interface, also intended for less powerful machines. See: +.\" any module must refers to session app, for more info on start it +.P +\fBlxqt-session.1\fR LXQt for manage LXQt complete environment +.P +\fBstart-lxqt.1\fR LXQt display management independient starup. +.P +\fBlxqt-config.1\fR LXQt config center application for performing settings +.P +.SH AUTHOR +This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR +for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/lxqt-panel/panel/panelpluginsmodel.cpp b/lxqt-panel/panel/panelpluginsmodel.cpp new file mode 100644 index 0000000..9e87f34 --- /dev/null +++ b/lxqt-panel/panel/panelpluginsmodel.cpp @@ -0,0 +1,331 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "panelpluginsmodel.h" +#include "plugin.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanel.h" +#include "lxqtpanelapplication.h" +#include +#include +#include + +#include + +PanelPluginsModel::PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent/* = nullptr*/) + : QAbstractListModel{parent}, + mNamesKey(namesKey), + mPanel(panel) +{ + loadPlugins(desktopDirs); +} + +PanelPluginsModel::~PanelPluginsModel() +{ + qDeleteAll(plugins()); +} + +int PanelPluginsModel::rowCount(const QModelIndex & parent/* = QModelIndex()*/) const +{ + return QModelIndex() == parent ? mPlugins.size() : 0; +} + + +QVariant PanelPluginsModel::data(const QModelIndex & index, int role/* = Qt::DisplayRole*/) const +{ + Q_ASSERT(QModelIndex() == index.parent() + && 0 == index.column() + && mPlugins.size() > index.row() + ); + + pluginslist_t::const_reference plugin = mPlugins[index.row()]; + QVariant ret; + switch (role) + { + case Qt::DisplayRole: + if (plugin.second.isNull()) + ret = QStringLiteral("Unknown (%1)").arg(plugin.first); + else + ret = QStringLiteral("%1 (%2)").arg(plugin.second->name(), plugin.first); + break; + case Qt::DecorationRole: + if (plugin.second.isNull()) + ret = XdgIcon::fromTheme("preferences-plugin"); + else + ret = plugin.second->desktopFile().icon(XdgIcon::fromTheme("preferences-plugin")); + break; + case Qt::UserRole: + ret = QVariant::fromValue(const_cast(plugin.second.data())); + break; + } + return ret; +} + +Qt::ItemFlags PanelPluginsModel::flags(const QModelIndex & index) const +{ + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemNeverHasChildren; +} + +QStringList PanelPluginsModel::pluginNames() const +{ + QStringList names; + for (auto const & p : mPlugins) + names.append(p.first); + return std::move(names); +} + +QList PanelPluginsModel::plugins() const +{ + QList plugins; + for (auto const & p : mPlugins) + if (!p.second.isNull()) + plugins.append(p.second.data()); + return std::move(plugins); +} + +Plugin* PanelPluginsModel::pluginByName(QString name) const +{ + for (auto const & p : mPlugins) + if (p.first == name) + return p.second.data(); + return nullptr; +} + +Plugin const * PanelPluginsModel::pluginByID(QString id) const +{ + for (auto const & p : mPlugins) + { + Plugin *plugin = p.second.data(); + if (plugin && plugin->desktopFile().id() == id) + return plugin; + } + return nullptr; +} + +void PanelPluginsModel::addPlugin(const LxQt::PluginInfo &desktopFile) +{ + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(desktopFile.id())) + return; + + QString name = findNewPluginSettingsGroup(desktopFile.id()); + + QPointer plugin = loadPlugin(desktopFile, name); + if (plugin.isNull()) + return; + + beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size()); + mPlugins.append({name, plugin}); + endInsertRows(); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + emit pluginAdded(plugin.data()); +} + +void PanelPluginsModel::removePlugin(pluginslist_t::iterator plugin) +{ + if (mPlugins.end() != plugin) + { + mPanel->settings()->remove(plugin->first); + Plugin * p = plugin->second.data(); + const int row = plugin - mPlugins.begin(); + beginRemoveRows(QModelIndex(), row, row); + mPlugins.erase(plugin); + endRemoveRows(); + mActive = mPlugins.isEmpty() ? QModelIndex() : createIndex(mPlugins.size() > row ? row : row - 1, 0); + emit pluginRemoved(p); // p can be nullptr + mPanel->settings()->setValue(mNamesKey, pluginNames()); + if (nullptr != p) + p->deleteLater(); + } +} + +void PanelPluginsModel::removePlugin() +{ + Plugin * p = qobject_cast(sender()); + auto plugin = std::find_if(mPlugins.begin(), mPlugins.end(), + [p] (pluginslist_t::const_reference obj) { return p == obj.second; }); + removePlugin(std::move(plugin)); +} + +void PanelPluginsModel::movePlugin(Plugin * plugin, QString const & nameAfter) +{ + //merge list of plugins (try to preserve original position) + const int from = + std::find_if(mPlugins.begin(), mPlugins.end(), [plugin] (pluginslist_t::const_reference obj) { return plugin == obj.second.data(); }) + - mPlugins.begin(); + const int to = + std::find_if(mPlugins.begin(), mPlugins.end(), [nameAfter] (pluginslist_t::const_reference obj) { return nameAfter == obj.first; }) + - mPlugins.begin(); + const int to_plugins = from < to ? to - 1 : to; + + if (from != to && from != to_plugins) + { + beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + mPlugins.move(from, to_plugins); + endMoveRows(); + emit pluginMoved(plugin); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + } +} + +void PanelPluginsModel::loadPlugins(QStringList const & desktopDirs) +{ + QStringList plugin_names = mPanel->settings()->value(mNamesKey).toStringList(); + +#ifdef DEBUG_PLUGIN_LOADTIME + QElapsedTimer timer; + timer.start(); + qint64 lastTime = 0; +#endif + for (auto const & name : plugin_names) + { + pluginslist_t::iterator i = mPlugins.insert(mPlugins.end(), {name, nullptr}); + QString type = mPanel->settings()->value(name + "/type").toString(); + if (type.isEmpty()) + { + qWarning() << QString("Section \"%1\" not found in %2.").arg(name, mPanel->settings()->fileName()); + continue; + } + + LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type)); + if( !list.count()) + { + qWarning() << QString("Plugin \"%1\" not found.").arg(type); + continue; + } + + i->second = loadPlugin(list.first(), name); +#ifdef DEBUG_PLUGIN_LOADTIME + qDebug() << "load plugin" << type << "takes" << (timer.elapsed() - lastTime) << "ms"; + lastTime = timer.elapsed(); +#endif + } +} + +QPointer PanelPluginsModel::loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup) +{ + std::unique_ptr plugin(new Plugin(desktopFile, mPanel->settings()->fileName(), settingsGroup, mPanel)); + if (plugin->isLoaded()) + { + connect(mPanel, &LxQtPanel::realigned, plugin.get(), &Plugin::realign); + connect(plugin.get(), &Plugin::remove, + this, static_cast(&PanelPluginsModel::removePlugin)); + return plugin.release(); + } + + return nullptr; +} + +QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType) const +{ + QStringList groups = mPanel->settings()->childGroups(); + groups.sort(); + + // Generate new section name + for (int i = 2; true; ++i) + if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i))) + return QStringLiteral("%1%2").arg(pluginType).arg(i); +} + +void PanelPluginsModel::onActivatedIndex(QModelIndex const & index) +{ + mActive = index; +} + +bool PanelPluginsModel::isActiveIndexValid() const +{ + return mActive.isValid() && QModelIndex() == mActive.parent() + && 0 == mActive.column() && mPlugins.size() > mActive.row(); +} + +void PanelPluginsModel::onMovePluginUp() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (0 >= row) + return; //can't move up + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1); + mPlugins.swap(row - 1, row); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row - 1]; + pluginslist_t::const_reference prev_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !prev_plugin.second.isNull()) + emit pluginMovedUp(moved_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onMovePluginDown() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (mPlugins.size() <= row + 1) + return; //can't move down + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2); + mPlugins.swap(row, row + 1); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row + 1]; + pluginslist_t::const_reference next_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !next_plugin.second.isNull()) + emit pluginMovedUp(next_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onConfigurePlugin() +{ + if (!isActiveIndexValid()) + return; + + Plugin * const plugin = mPlugins[mActive.row()].second.data(); + if (nullptr != plugin && (ILxQtPanelPlugin::HaveConfigDialog & plugin->iPlugin()->flags())) + plugin->showConfigureDialog(); +} + +void PanelPluginsModel::onRemovePlugin() +{ + if (!isActiveIndexValid()) + return; + + auto plugin = mPlugins.begin() + mActive.row(); + if (plugin->second.isNull()) + removePlugin(std::move(plugin)); + else + plugin->second->requestRemove(); +} diff --git a/lxqt-panel/panel/panelpluginsmodel.h b/lxqt-panel/panel/panelpluginsmodel.h new file mode 100644 index 0000000..ed9a8a3 --- /dev/null +++ b/lxqt-panel/panel/panelpluginsmodel.h @@ -0,0 +1,104 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef PANELPLUGINSMODEL_H +#define PANELPLUGINSMODEL_H + +#include +#include + +namespace LxQt +{ + class PluginInfo; + struct PluginData; +} + +class LxQtPanel; +class Plugin; + +class PanelPluginsModel : public QAbstractListModel +{ + Q_OBJECT +public: + PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent = nullptr); + ~PanelPluginsModel(); + + virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override; + virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; + virtual Qt::ItemFlags flags(const QModelIndex & index) const override; + + QStringList pluginNames() const; + QList plugins() const; + Plugin *pluginByName(QString name) const; + Plugin const *pluginByID(QString id) const; + + /*! + * \param plugin plugin that has been moved + * \param nameAfter name of plugin that is right after moved plugin + */ + void movePlugin(Plugin * plugin, QString const & nameAfter); + +signals: + void pluginAdded(Plugin * plugin); + void pluginRemoved(Plugin * plugin); + void pluginMoved(Plugin * plugin); //plugin can be nullptr in case of move of not loaded plugin + /*! + * Emiting only move-up for simplification of using (and problematic layout/list move) + */ + void pluginMovedUp(Plugin * plugin); + +public slots: + void addPlugin(const LxQt::PluginInfo &desktopFile); + void removePlugin(); + + // slots for configuration dialog + void onActivatedIndex(QModelIndex const & index); + void onMovePluginUp(); + void onMovePluginDown(); + void onConfigurePlugin(); + void onRemovePlugin(); + +private: + typedef QList > > pluginslist_t; + +private: + void loadPlugins(QStringList const & desktopDirs); + QPointer loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup); + QString findNewPluginSettingsGroup(const QString &pluginType) const; + bool isActiveIndexValid() const; + void removePlugin(pluginslist_t::iterator plugin); + + const QString mNamesKey; + pluginslist_t mPlugins; + LxQtPanel * mPanel; + QPersistentModelIndex mActive; +}; + +Q_DECLARE_METATYPE(Plugin const *) + +#endif // PANELPLUGINSMODEL_H diff --git a/lxqt-panel/panel/plugin.cpp b/lxqt-panel/panel/plugin.cpp new file mode 100644 index 0000000..b6f930b --- /dev/null +++ b/lxqt-panel/panel/plugin.cpp @@ -0,0 +1,484 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "plugin.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanel.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// statically linked built-in plugins +#include "../plugin-clock/lxqtclock.h" // clock +#include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch +#include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu +#include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch +#include "../plugin-showdesktop/showdesktop.h" // showdesktop +#include "../plugin-spacer/spacer.h" // spacer +#include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier +#include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar +#include "../plugin-tray/lxqttrayplugin.h" // tray +#include "../plugin-worldclock/lxqtworldclock.h" // worldclock + +QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255); + +/************************************************ + + ************************************************/ +Plugin::Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, const QString &settingsGroup, LxQtPanel *panel) : + QFrame(panel), + mDesktopFile(desktopFile), + mPluginLoader(0), + mPlugin(0), + mPluginWidget(0), + mAlignment(AlignLeft), + mSettingsGroup(settingsGroup), + mPanel(panel) +{ + + mSettings = new LxQt::Settings(settingsFile, QSettings::IniFormat, this); + connect(mSettings, SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); + mSettings->beginGroup(settingsGroup); + + mSettingsHash = calcSettingsHash(); + + setWindowTitle(desktopFile.name()); + mName = desktopFile.name(); + + QStringList dirs; + dirs << QProcessEnvironment::systemEnvironment().value("LXQTPANEL_PLUGIN_PATH").split(":"); + dirs << PLUGIN_DIR; + + bool found = false; + if(ILxQtPanelPluginLibrary const * pluginLib = findStaticPlugin(desktopFile.id())) + { + // this is a static plugin + found = true; + loadLib(pluginLib); + } + else { + // this plugin is a dynamically loadable module + QString baseName = QString("lib%1.so").arg(desktopFile.id()); + foreach(QString dirName, dirs) + { + QFileInfo fi(QDir(dirName), baseName); + if (fi.exists()) + { + found = true; + if (loadModule(fi.absoluteFilePath())) + break; + } + } + } + + if (!isLoaded()) + { + if (!found) + qWarning() << QString("Plugin %1 not found in the").arg(desktopFile.id()) << dirs; + + return; + } + + // Load plugin translations + LxQt::Translator::translatePlugin(desktopFile.id(), QLatin1String("lxqt-panel")); + + setObjectName(mPlugin->themeId() + "Plugin"); + + // plugin handle for easy context menu + setProperty("NeedsHandle", mPlugin->flags().testFlag(ILxQtPanelPlugin::NeedsHandle)); + + QString s = mSettings->value("alignment").toString(); + + // Retrun default value + if (s.isEmpty()) + { + mAlignment = (mPlugin->flags().testFlag(ILxQtPanelPlugin::PreferRightAlignment)) ? + Plugin::AlignRight : + Plugin::AlignLeft; + } + else + { + mAlignment = (s.toUpper() == "RIGHT") ? + Plugin::AlignRight : + Plugin::AlignLeft; + + } + + if (mPluginWidget) + { + QGridLayout* layout = new QGridLayout(this); + layout->setSpacing(0); + layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); + setLayout(layout); + layout->addWidget(mPluginWidget, 0, 0); + } + + saveSettings(); +} + + +/************************************************ + + ************************************************/ +Plugin::~Plugin() +{ + delete mPlugin; + if (mPluginLoader) + { + mPluginLoader->unload(); + delete mPluginLoader; + } +} + +void Plugin::setAlignment(Plugin::Alignment alignment) +{ + mAlignment = alignment; + saveSettings(); +} + + +/************************************************ + + ************************************************/ +namespace +{ + //helper types for static plugins storage & binary search + typedef std::unique_ptr plugin_ptr_t; + typedef std::pair plugin_pair_t; + + //NOTE: Please keep the plugins sorted by name while adding new plugins. + static plugin_pair_t const static_plugins[] = { +#if defined(WITH_CLOCK_PLUGIN) + { QStringLiteral("clock"), plugin_ptr_t{new LxQtClockPluginLibrary} },// clock +#endif +#if defined(WITH_DESKTOPSWITCH_PLUGIN) + { QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary} },// desktopswitch +#endif +#if defined(WITH_MAINMENU_PLUGIN) + { QStringLiteral("mainmenu"), plugin_ptr_t{new LxQtMainMenuPluginLibrary} },// mainmenu +#endif +#if defined(WITH_QUICKLAUNCH_PLUGIN) + { QStringLiteral("quicklaunch"), plugin_ptr_t{new LxQtQuickLaunchPluginLibrary} },// quicklaunch +#endif +#if defined(WITH_SHOWDESKTOP_PLUGIN) + { QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary} },// showdesktop +#endif +#if defined(WITH_SPACER_PLUGIN) + { QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary} },// spacer +#endif +#if defined(WITH_STATUSNOTIFIER_PLUGIN) + { QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary} },// statusnotifier +#endif +#if defined(WITH_TASKBAR_PLUGIN) + { QStringLiteral("taskbar"), plugin_ptr_t{new LxQtTaskBarPluginLibrary} },// taskbar +#endif +#if defined(WITH_TRAY_PLUGIN) + { QStringLiteral("tray"), plugin_ptr_t{new LxQtTrayPluginLibrary} },// tray +#endif +#if defined(WITH_WORLDCLOCK_PLUGIN) + { QStringLiteral("worldclock"), plugin_ptr_t{new LxQtWorldClockLibrary} },// worldclock +#endif + }; + static constexpr plugin_pair_t const * const plugins_begin = static_plugins; + static constexpr plugin_pair_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]); + + struct assert_helper + { + assert_helper() + { + Q_ASSERT(std::is_sorted(plugins_begin, plugins_end + , [] (plugin_pair_t const & p1, plugin_pair_t const & p2) -> bool { return p1.first < p2.first; })); + } + }; + static assert_helper h; +} + +ILxQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName) +{ + // find a static plugin library by name -> binary search + plugin_pair_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName + , [] (plugin_pair_t const & plugin, QString const & name) -> bool { return plugin.first < name; }); + if (plugins_end != plugin && libraryName == plugin->first) + return plugin->second.get(); + return nullptr; +} + +// load a plugin from a library +bool Plugin::loadLib(ILxQtPanelPluginLibrary const * pluginLib) +{ + ILxQtPanelPluginStartupInfo startupInfo; + startupInfo.settings = mSettings; + startupInfo.desktopFile = &mDesktopFile; + startupInfo.lxqtPanel = mPanel; + + mPlugin = pluginLib->instance(startupInfo); + if (!mPlugin) + { + qWarning() << QString("Can't load plugin \"%1\". Plugin can't build ILxQtPanelPlugin.").arg(mPluginLoader->fileName()); + return false; + } + + mPluginWidget = mPlugin->widget(); + if (mPluginWidget) + { + mPluginWidget->setObjectName(mPlugin->themeId()); + } + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + return true; +} + +// load dynamic plugin from a *.so module +bool Plugin::loadModule(const QString &libraryName) +{ + mPluginLoader = new QPluginLoader(libraryName); + + if (!mPluginLoader->load()) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + QObject *obj = mPluginLoader->instance(); + if (!obj) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + ILxQtPanelPluginLibrary* pluginLib= qobject_cast(obj); + if (!pluginLib) + { + qWarning() << QString("Can't load plugin \"%1\". Plugin is not a ILxQtPanelPluginLibrary.").arg(mPluginLoader->fileName()); + delete obj; + return false; + } + return loadLib(pluginLib); +} + + +/************************************************ + + ************************************************/ +QByteArray Plugin::calcSettingsHash() +{ + QCryptographicHash hash(QCryptographicHash::Md5); + QStringList keys = mSettings->allKeys(); + foreach (const QString &key, keys) + { + hash.addData(key.toUtf8()); + hash.addData(mSettings->value(key).toByteArray()); + } + return hash.result(); +} + + +/************************************************ + + ************************************************/ +void Plugin::settingsChanged() +{ + QByteArray hash = calcSettingsHash(); + if (mSettingsHash != hash) + { + mSettingsHash = hash; + mPlugin->settingsChanged(); + } +} + + +/************************************************ + + ************************************************/ +void Plugin::saveSettings() +{ + mSettings->setValue("alignment", (mAlignment == AlignLeft) ? "Left" : "Right"); + mSettings->setValue("type", mDesktopFile.id()); + mSettings->sync(); + +} + + +/************************************************ + + ************************************************/ +void Plugin::contextMenuEvent(QContextMenuEvent *event) +{ + mPanel->showPopupMenu(this); +} + + +/************************************************ + + ************************************************/ +void Plugin::mousePressEvent(QMouseEvent *event) +{ + switch (event->button()) + { + case Qt::LeftButton: + mPlugin->activated(ILxQtPanelPlugin::Trigger); + break; + + case Qt::MidButton: + mPlugin->activated(ILxQtPanelPlugin::MiddleClick); + break; + + default: + break; + } +} + + +/************************************************ + + ************************************************/ +void Plugin::mouseDoubleClickEvent(QMouseEvent*) +{ + mPlugin->activated(ILxQtPanelPlugin::DoubleClick); +} + + +/************************************************ + + ************************************************/ +void Plugin::showEvent(QShowEvent *) +{ + if (mPluginWidget) + mPluginWidget->adjustSize(); +} + + +/************************************************ + + ************************************************/ +QMenu *Plugin::popupMenu() const +{ + QString name = this->name().replace("&", "&&"); + QMenu* menu = new QMenu(windowTitle()); + + if (mPlugin->flags().testFlag(ILxQtPanelPlugin::HaveConfigDialog)) + { + QAction* configAction = new QAction( + XdgIcon::fromTheme(QStringLiteral("preferences-other")), + tr("Configure \"%1\"").arg(name), menu); + menu->addAction(configAction); + connect(configAction, SIGNAL(triggered()), this, SLOT(showConfigureDialog())); + } + + QAction* moveAction = new QAction(XdgIcon::fromTheme("transform-move"), tr("Move \"%1\"").arg(name), menu); + menu->addAction(moveAction); + connect(moveAction, SIGNAL(triggered()), this, SIGNAL(startMove())); + + menu->addSeparator(); + + QAction* removeAction = new QAction( + XdgIcon::fromTheme(QStringLiteral("list-remove")), + tr("Remove \"%1\"").arg(name), menu); + menu->addAction(removeAction); + connect(removeAction, SIGNAL(triggered()), this, SLOT(requestRemove())); + + return menu; +} + + +/************************************************ + + ************************************************/ +bool Plugin::isSeparate() const +{ + return mPlugin->isSeparate(); +} + + +/************************************************ + + ************************************************/ +bool Plugin::isExpandable() const +{ + return mPlugin->isExpandable(); +} + + +/************************************************ + + ************************************************/ +void Plugin::realign() +{ + if (mPlugin) + mPlugin->realign(); +} + + +/************************************************ + + ************************************************/ +void Plugin::showConfigureDialog() +{ + // store a pointer to each plugin using the plugins' names + static QHash > refs; + QDialog *dialog = refs[name()].data(); + + if (!dialog) + { + dialog = mPlugin->configureDialog(); + refs[name()] = dialog; + connect(this, SIGNAL(destroyed()), dialog, SLOT(close())); + } + + if (!dialog) + return; + + dialog->show(); + dialog->raise(); + dialog->activateWindow(); +} + + +/************************************************ + + ************************************************/ +void Plugin::requestRemove() +{ + emit remove(); + deleteLater(); +} diff --git a/lxqt-panel/panel/plugin.h b/lxqt-panel/panel/plugin.h new file mode 100644 index 0000000..d8eff78 --- /dev/null +++ b/lxqt-panel/panel/plugin.h @@ -0,0 +1,124 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef PLUGIN_H +#define PLUGIN_H + +#include +#include +#include +#include "ilxqtpanel.h" +#include "lxqtpanelglobals.h" + +class QPluginLoader; +class QSettings; +class ILxQtPanelPlugin; +class ILxQtPanelPluginLibrary; +class LxQtPanel; +class QMenu; + + +class LXQT_PANEL_API Plugin : public QFrame +{ + Q_OBJECT + + Q_PROPERTY(QColor moveMarkerColor READ moveMarkerColor WRITE setMoveMarkerColor) +public: + enum Alignment { + AlignLeft, + AlignRight + }; + + + explicit Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, const QString &settingsGroup, LxQtPanel *panel); + ~Plugin(); + + bool isLoaded() const { return mPlugin != 0; } + Alignment alignment() const { return mAlignment; } + void setAlignment(Alignment alignment); + + QString settingsGroup() const { return mSettingsGroup; } + + void saveSettings(); + + QMenu* popupMenu() const; + const ILxQtPanelPlugin * iPlugin() const { return mPlugin; } + + const LxQt::PluginInfo desktopFile() const { return mDesktopFile; } + + bool isSeparate() const; + bool isExpandable() const; + + QWidget *widget() { return mPluginWidget; } + + QString name() const { return mName; } + + // For QSS properties .................. + static QColor moveMarkerColor() { return mMoveMarkerColor; } + static void setMoveMarkerColor(QColor color) { mMoveMarkerColor = color; } + +public slots: + void realign(); + void showConfigureDialog(); + void requestRemove(); + +signals: + void startMove(); + void remove(); + +protected: + void contextMenuEvent(QContextMenuEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); + void showEvent(QShowEvent *event); + +private: + bool loadLib(ILxQtPanelPluginLibrary const * pluginLib); + bool loadModule(const QString &libraryName); + ILxQtPanelPluginLibrary const * findStaticPlugin(const QString &libraryName); + + const LxQt::PluginInfo mDesktopFile; + QByteArray calcSettingsHash(); + QPluginLoader *mPluginLoader; + ILxQtPanelPlugin *mPlugin; + QWidget *mPluginWidget; + Alignment mAlignment; + QSettings *mSettings; + QString mSettingsGroup; + LxQtPanel *mPanel; + QByteArray mSettingsHash; + static QColor mMoveMarkerColor; + QString mName; + +private slots: + void settingsChanged(); + +}; + + +#endif // PLUGIN_H diff --git a/lxqt-panel/panel/pluginmoveprocessor.cpp b/lxqt-panel/panel/pluginmoveprocessor.cpp new file mode 100644 index 0000000..4b7ddb0 --- /dev/null +++ b/lxqt-panel/panel/pluginmoveprocessor.cpp @@ -0,0 +1,314 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "pluginmoveprocessor.h" +#include "plugin.h" +#include "lxqtpanellayout.h" +#include + + +/************************************************ + + ************************************************/ +PluginMoveProcessor::PluginMoveProcessor(LxQtPanelLayout *layout, Plugin *plugin): + QWidget(plugin), + mLayout(layout), + mPlugin(plugin) +{ + mDestIndex = mLayout->indexOf(plugin); + + grabKeyboard(); +} + + +/************************************************ + + ************************************************/ +PluginMoveProcessor::~PluginMoveProcessor() +{ +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::start() +{ + // We have not memoryleaks there. + // The animation will be automatically deleted when stopped. + CursorAnimation *cursorAnimation = new CursorAnimation(); + connect(cursorAnimation, SIGNAL(finished()), this, SLOT(doStart())); + cursorAnimation->setEasingCurve(QEasingCurve::InOutQuad); + cursorAnimation->setDuration(150); + + cursorAnimation->setStartValue(QCursor::pos()); + cursorAnimation->setEndValue(mPlugin->mapToGlobal(mPlugin->rect().center())); + cursorAnimation->start(QAbstractAnimation::DeleteWhenStopped); +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::doStart() +{ + setMouseTracking(true); + show(); // Only visible widgets can grab mouse input. + grabMouse(mLayout->isHorizontal() ? Qt::SizeHorCursor : Qt::SizeVerCursor); +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::mouseMoveEvent(QMouseEvent *event) +{ + QPoint mouse = mLayout->parentWidget()->mapFromGlobal(event->globalPos()); + + MousePosInfo pos = itemByMousePos(mouse); + + QLayoutItem *prevItem = 0; + QLayoutItem *nextItem = 0; + if (pos.after) + { + mDestIndex = pos.index + 1; + prevItem = pos.item; + nextItem = mLayout->itemAt(pos.index + 1); + } + else + { + prevItem = mLayout->itemAt(pos.index - 1); + nextItem = pos.item; + mDestIndex = pos.index; + } + + bool plugSep = mPlugin->isSeparate(); + bool prevSep = LxQtPanelLayout::itemIsSeparate(prevItem); + bool nextSep = LxQtPanelLayout::itemIsSeparate(nextItem); + + if (!nextItem) + { + if (mLayout->isHorizontal()) + drawMark(prevItem, prevSep ? RightMark : BottomMark); + else + drawMark(prevItem, prevSep ? BottomMark : RightMark); + return; + } + + if (mLayout->lineCount() == 1) + { + if (mLayout->isHorizontal()) + drawMark(nextItem, LeftMark); + else + drawMark(nextItem, TopMark); + return; + } + + + if (!prevItem) + { + if (mLayout->isHorizontal()) + drawMark(nextItem, nextSep ? LeftMark : TopMark); + else + drawMark(nextItem, nextSep ? TopMark : LeftMark); + return; + } + + // We prefer to draw line at the top/left of next item. + // But if next item and moved plugin have different types (separate an not) and + // previous item hase same type as moved plugin we draw line at the end of previous one. + if (plugSep != nextSep && plugSep == prevSep) + { + if (mLayout->isHorizontal()) + drawMark(prevItem, prevSep ? RightMark : BottomMark); + else + drawMark(prevItem, prevSep ? BottomMark : RightMark); + } + else + { + if (mLayout->isHorizontal()) + drawMark(nextItem, nextSep ? LeftMark : TopMark); + else + drawMark(nextItem, nextSep ? TopMark : LeftMark); + } +} + + +/************************************************ + + ************************************************/ +PluginMoveProcessor::MousePosInfo PluginMoveProcessor::itemByMousePos(const QPoint mouse) const +{ + MousePosInfo ret; + + for (int i = mLayout->count()-1; i > -1; --i) + { + QLayoutItem *item = mLayout->itemAt(i); + QRect itemRect = item->geometry(); + if (mouse.x() > itemRect.left() && + mouse.y() > itemRect.top()) + { + + ret.index = i; + ret.item = item; + if (mLayout->isHorizontal()) + { + ret.after = LxQtPanelLayout::itemIsSeparate(item) ? + mouse.x() > itemRect.center().x() : + mouse.y() > itemRect.center().y() ; + } + else + { + ret.after = LxQtPanelLayout::itemIsSeparate(item) ? + mouse.y() > itemRect.center().y() : + mouse.x() > itemRect.center().x() ; + } + return ret; + } + } + + ret.index = 0; + ret.item = mLayout->itemAt(0); + ret.after = false; + return ret; +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::drawMark(QLayoutItem *item, MarkType markType) +{ + QWidget *widget = (item) ? item->widget() : 0; + + static QWidget *prevWidget = 0; + if (prevWidget && prevWidget != widget) + prevWidget->setStyleSheet(""); + + prevWidget = widget; + + if (!widget) + return; + + QString border1; + QString border2; + switch(markType) + { + case TopMark: + border1 = "top"; + border2 = "bottom"; + break; + + case BottomMark: + border1 = "bottom"; + border2 = "top"; + break; + + case LeftMark: + border1 = "left"; + border2 = "right"; + break; + + case RightMark: + border1 = "right"; + border2 = "left"; + break; + + } + + widget->setStyleSheet(QString("#%1 {" + "border-%2: 2px solid rgba(%4, %5, %6, %7); " + "border-%3: -2px solid; " + "background-color: transparent; }") + .arg(widget->objectName()) + .arg(border1) + .arg(border2) + .arg(Plugin::moveMarkerColor().red()) + .arg(Plugin::moveMarkerColor().green()) + .arg(Plugin::moveMarkerColor().blue()) + .arg(Plugin::moveMarkerColor().alpha()) + ); +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::mousePressEvent(QMouseEvent *event) +{ + event->accept(); +} + + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::mouseReleaseEvent(QMouseEvent *event) +{ + event->accept(); + releaseMouse(); + setMouseTracking(false); + doFinish(false); +} + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Escape) { + doFinish(true); + return; + } + QWidget::keyPressEvent(event); +} + +/************************************************ + + ************************************************/ +void PluginMoveProcessor::doFinish(bool cancel) +{ + releaseKeyboard(); + + drawMark(0, TopMark); + + if (!cancel) + { + int currentIdx = mLayout->indexOf(mPlugin); + if (currentIdx == mDestIndex) + return; + + if (mDestIndex > currentIdx) + mDestIndex--; + + mLayout->moveItem(currentIdx, mDestIndex, true); + } + + emit finished(); + deleteLater(); +} diff --git a/lxqt-panel/panel/pluginmoveprocessor.h b/lxqt-panel/panel/pluginmoveprocessor.h new file mode 100644 index 0000000..9a25ebb --- /dev/null +++ b/lxqt-panel/panel/pluginmoveprocessor.h @@ -0,0 +1,99 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef PLUGINMOVEPROCESSOR_H +#define PLUGINMOVEPROCESSOR_H + +#include +#include +#include +#include "plugin.h" +#include "lxqtpanelglobals.h" + +class LxQtPanelLayout; +class QLayoutItem; + + +class LXQT_PANEL_API PluginMoveProcessor : public QWidget +{ + Q_OBJECT +public: + explicit PluginMoveProcessor(LxQtPanelLayout *layout, Plugin *plugin); + ~PluginMoveProcessor(); + + Plugin *plugin() const { return mPlugin; } + +signals: + void finished(); + +public slots: + void start(); + +protected: + void mouseMoveEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event); + +private slots: + void doStart(); + void doFinish(bool cancel); + +private: + enum MarkType + { + TopMark, + BottomMark, + LeftMark, + RightMark + }; + + struct MousePosInfo + { + int index; + QLayoutItem *item; + bool after; + }; + + LxQtPanelLayout *mLayout; + Plugin *mPlugin; + int mDestIndex; + + MousePosInfo itemByMousePos(const QPoint mouse) const; + void drawMark(QLayoutItem *item, MarkType markType); +}; + + +class LXQT_PANEL_API CursorAnimation: public QVariantAnimation +{ + Q_OBJECT +public: + void updateCurrentValue(const QVariant &value) { QCursor::setPos(value.toPoint()); } +}; + +#endif // PLUGINMOVEPROCESSOR_H diff --git a/lxqt-panel/panel/popupmenu.cpp b/lxqt-panel/panel/popupmenu.cpp new file mode 100644 index 0000000..d8aa3b6 --- /dev/null +++ b/lxqt-panel/panel/popupmenu.cpp @@ -0,0 +1,123 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "popupmenu.h" +#include +#include +#include +#include + +static const char POPUPMENU_TITLE[] = "POPUP_MENU_TITLE_OBJECT_NAME"; + +/************************************************ + + ************************************************/ +QAction* PopupMenu::addTitle(const QIcon &icon, const QString &text) +{ + QAction *buttonAction = new QAction(this); + QFont font = buttonAction->font(); + font.setBold(true); + buttonAction->setText(QString(text).replace("&", "&&")); + buttonAction->setFont(font); + buttonAction->setIcon(icon); + + QWidgetAction *action = new QWidgetAction(this); + action->setObjectName(POPUPMENU_TITLE); + QToolButton *titleButton = new QToolButton(this); + titleButton->installEventFilter(this); // prevent clicks on the title of the menu + titleButton->setDefaultAction(buttonAction); + titleButton->setDown(true); // prevent hover style changes in some styles + titleButton->setCheckable(true); + titleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + action->setDefaultWidget(titleButton); + + addAction(action); + return action; +} + + +/************************************************ + + ************************************************/ +QAction* PopupMenu::addTitle(const QString &text) +{ + return addTitle(QIcon(), text); +} + + +/************************************************ + + ************************************************/ +bool PopupMenu::eventFilter(QObject *object, QEvent *event) +{ + Q_UNUSED(object); + + if (event->type() == QEvent::Paint || + event->type() == QEvent::KeyPress || + event->type() == QEvent::KeyRelease + ) + { + return false; + } + + event->accept(); + return true; +} + + +/************************************************ + + ************************************************/ +void PopupMenu::keyPressEvent(QKeyEvent* e) +{ + if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) + { + QMenu::keyPressEvent(e); + + QWidgetAction *action = qobject_cast(this->activeAction()); + QWidgetAction *firstAction = action; + + while (action && action->objectName() == POPUPMENU_TITLE) + { + this->keyPressEvent(e); + action = qobject_cast(this->activeAction()); + + if (firstAction == action) // we looped and only found titles + { + this->setActiveAction(0); + break; + } + } + + return; + } + + QMenu::keyPressEvent(e); +} + + diff --git a/lxqt-panel/panel/popupmenu.h b/lxqt-panel/panel/popupmenu.h new file mode 100644 index 0000000..408b913 --- /dev/null +++ b/lxqt-panel/panel/popupmenu.h @@ -0,0 +1,50 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef POPUPMENU_H +#define POPUPMENU_H + +#include +#include "lxqtpanelglobals.h" + +class LXQT_PANEL_API PopupMenu: public QMenu +{ +public: + explicit PopupMenu(QWidget *parent = 0): QMenu(parent) {} + explicit PopupMenu(const QString &title, QWidget *parent = 0): QMenu(title, parent) {} + + QAction* addTitle(const QIcon &icon, const QString &text); + QAction* addTitle(const QString &text); + + bool eventFilter(QObject *object, QEvent *event); + +protected: + virtual void keyPressEvent(QKeyEvent* e); +}; + +#endif // POPUPMENU_H diff --git a/lxqt-panel/panel/resources/panel.conf b/lxqt-panel/panel/resources/panel.conf new file mode 100644 index 0000000..59653f4 --- /dev/null +++ b/lxqt-panel/panel/resources/panel.conf @@ -0,0 +1,44 @@ +panels=panel1 + +[panel1] +plugins=mainmenu,desktopswitch,quicklaunch,taskbar,tray,statusnotifier,mount,volume,clock,showdesktop +position=Bottom +desktop=0 + +[mainmenu] +type=mainmenu + +[desktopswitch] +type=desktopswitch + +[quicklaunch] +type=quicklaunch +apps/size=5 +apps/1/desktop=firefox.desktop +apps/2/desktop=chromium-browser.desktop +apps/3/desktop=pcmanfm-qt.desktop +apps/5/desktop=lxqt-config.desktop + +[taskbar] +type=taskbar + +[tray] +type=tray + +[mount] +type=mount + +[clock] +type=clock + +[volume] +device=0 +type=volume + +[showdesktop] +alignment=Right +type=showdesktop + +[statusnotifier] +alignment=Right +type=statusnotifier diff --git a/lxqt-panel/panel/translations/lxqt-panel.ts b/lxqt-panel/panel/translations/lxqt-panel.ts new file mode 100644 index 0000000..29a35b1 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel.ts @@ -0,0 +1,346 @@ + + + + + AddPluginDialog + + + Add Plugins + + + + + Search: + + + + + Add Widget + + + + + Close + + + + + (only one instance can run at a time) + + + + + ConfigPanelDialog + + + Configure Panel + + + + + Panel + + + + + Widgets + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + Size: + + + + + Length: + + + + + % + + + + + px + + + + + + px + + + + + Icon size: + + + + + Rows count: + + + + + Alignment && position + + + + + Position: + + + + + Alignment: + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Auto-hide + + + + + Custom styling + + + + + Font color: + + + + + Background color: + + + + + Background opacity: + + + + + <small>Compositing is required for panel transparency.</small> + + + + + Background image: + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Pick image + + + + + Images (*.png *.gif *.jpg) + + + + + ConfigPluginsWidget + + + Configure Plugins + + + + + Note: changes made in this page cannot be reset. + + + + + Move up + + + + + + + + + ... + + + + + Move down + + + + + Add + + + + + Remove + + + + + Configure + + + + + LxQtPanel + + + + Panel + + + + + Configure Panel + + + + + Manage Widgets + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + + main + + + Use alternate configuration file. + + + + + Configuration file + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ar.ts b/lxqt-panel/panel/translations/lxqt-panel_ar.ts new file mode 100644 index 0000000..69084ec --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ar.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + تهيئة اللوحة + + + Panel size + حجم اللوحة + + + Size: + الحجم: + + + px + نقطة ضوئيَّة + + + Use automatic sizing + استخدم التَّحجيم اﻵلي + + + Panel length && position + طول وموقع اللوحة + + + Left + اليسار + + + Center + الوسظ + + + Right + اليمين + + + % + % + + + Alignment: + المحاذاة: + + + Length: + الطُّول: + + + Position: + الموقع: + + + Top of desktop + أعلى سطح المكتب + + + Left of desktop + يسار سطح المكتب + + + Right of desktop + يمين سطح المكتب + + + Bottom of desktop + أسفل سطح المكتب + + + Top of desktop %1 + أعلى سطح المكتب %1 + + + Left of desktop %1 + يسار سطح المكتب %1 + + + Right of desktop %1 + يمين سطح المكتب %1 + + + Bottom of desktop %1 + أسفل سطح المكتب %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + تهيئة اللوحة + + + + Size + + + + + Size: + الحجم: + + + + + px + + + + + Icon size: + + + + + Length: + الطُّول: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + نقطة ضوئيَّة + + + + Rows count: + + + + + Alignment && position + + + + + + Left + اليسار + + + + + + Center + الوسظ + + + + + Right + اليمين + + + + Alignment: + المحاذاة: + + + + Position: + الموقع: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + أعلى سطح المكتب + + + + Left of desktop + يسار سطح المكتب + + + + Right of desktop + يمين سطح المكتب + + + + Bottom of desktop + أسفل سطح المكتب + + + + Top of desktop %1 + أعلى سطح المكتب %1 + + + + Left of desktop %1 + يسار سطح المكتب %1 + + + + Right of desktop %1 + يمين سطح المكتب %1 + + + + Bottom of desktop %1 + أسفل سطح المكتب %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + قائمة التطبيقات + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + تهيئة اللوحة... + + + Add plugins ... + ضمُّ إضافات... + + + + LxQtPanelPlugin + + Configure + تهيئة + + + Move + تحريك + + + Remove + إزالة + + + + LxQtPanelPrivate + + Configure panel + تهيئة اللوحة + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_cs.ts b/lxqt-panel/panel/translations/lxqt-panel_cs.ts new file mode 100644 index 0000000..81fe3e7 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_cs.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Nastavit panel + + + Panel size + Velikost panelu + + + Size: + Velikost: + + + px + px + + + Use automatic sizing + Použít automatickou velikost + + + Panel length && position + Délka &a poloha panelu + + + Left + Zarovnat vlevo + + + Center + Zarovnat na střed + + + Right + Zarovnat vpravo + + + % + % + + + Alignment: + Zarovnání: + + + Length: + Délka: + + + Position: + Poloha: + + + Top of desktop + Horní strana pracovní plochy + + + Left of desktop + Levá strana pracovní plochy + + + Right of desktop + Pravá strana pracovní plochy + + + Bottom of desktop + Dolní strana pracovní plochy + + + Top of desktop %1 + Horní strana pracovní plochy %1 + + + Left of desktop %1 + Levá strana pracovní plochy %1 + + + Right of desktop %1 + Pravá strana pracovní plochy %1 + + + Bottom of desktop %1 + Dolní strana pracovní plochy %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Nastavit panel + + + + Size + + + + + Size: + Velikost: + + + + + px + + + + + Icon size: + + + + + Length: + Délka: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Zarovnat vlevo + + + + + + Center + Zarovnat na střed + + + + + Right + Zarovnat vpravo + + + + Alignment: + Zarovnání: + + + + Position: + Poloha: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Horní strana pracovní plochy + + + + Left of desktop + Levá strana pracovní plochy + + + + Right of desktop + Pravá strana pracovní plochy + + + + Bottom of desktop + Dolní strana pracovní plochy + + + + Top of desktop %1 + Horní strana pracovní plochy %1 + + + + Left of desktop %1 + Levá strana pracovní plochy %1 + + + + Right of desktop %1 + Pravá strana pracovní plochy %1 + + + + Bottom of desktop %1 + Dolní strana pracovní plochy %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Nastavit panel... + + + Add plugins ... + Přidat přídavné moduly... + + + + LxQtPanelPlugin + + Configure + Nastavit + + + Move + Přesunout + + + Remove + Odstranit + + + + LxQtPanelPrivate + + Configure panel + Nastavit panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_cs_CZ.ts b/lxqt-panel/panel/translations/lxqt-panel_cs_CZ.ts new file mode 100644 index 0000000..c3dc66e --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_cs_CZ.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Nastavit panel + + + Panel size + Velikost panelu + + + Size: + Velikost: + + + px + px + + + Use automatic sizing + Použít automatickou velikost + + + Panel length && position + Délka &a poloha panelu + + + Left + Zarovnat vlevo + + + Center + Zarovnat na střed + + + Right + Zarovnat vpravo + + + % + % + + + Alignment: + Zarovnání: + + + Length: + Délka: + + + Position: + Poloha: + + + Top of desktop + Horní strana pracovní plochy + + + Left of desktop + Levá strana pracovní plochy + + + Right of desktop + Pravá strana pracovní plochy + + + Bottom of desktop + Dolní strana pracovní plochy + + + Top of desktop %1 + Horní strana pracovní plochy %1 + + + Left of desktop %1 + Levá strana pracovní plochy %1 + + + Right of desktop %1 + Pravá strana pracovní plochy %1 + + + Bottom of desktop %1 + Dolní strana pracovní plochy %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Nastavit panel + + + + Size + + + + + Size: + Velikost: + + + + + px + + + + + Icon size: + + + + + Length: + Délka: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Zarovnat vlevo + + + + + + Center + Zarovnat na střed + + + + + Right + Zarovnat vpravo + + + + Alignment: + Zarovnání: + + + + Position: + Poloha: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Horní strana pracovní plochy + + + + Left of desktop + Levá strana pracovní plochy + + + + Right of desktop + Pravá strana pracovní plochy + + + + Bottom of desktop + Dolní strana pracovní plochy + + + + Top of desktop %1 + Horní strana pracovní plochy %1 + + + + Left of desktop %1 + Levá strana pracovní plochy %1 + + + + Right of desktop %1 + Pravá strana pracovní plochy %1 + + + + Bottom of desktop %1 + Dolní strana pracovní plochy %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Nastavit panel... + + + Add plugins ... + Přidat přídavné moduly... + + + + LxQtPanelPlugin + + Configure + Nastavit + + + Move + Přesunout + + + Remove + Odstranit + + + + LxQtPanelPrivate + + Configure panel + Nastavit panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_da.ts b/lxqt-panel/panel/translations/lxqt-panel_da.ts new file mode 100644 index 0000000..38d7997 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_da.ts @@ -0,0 +1,377 @@ + + + + + ConfigPanelDialog + + Configure panel + Indstil panel + + + Panel size + Panelstørrelse + + + Size: + Størrelse: + + + px + pkt + + + Use theme size + Brug tema-størrelse + + + Panel lenght & position + Panel længde & position + + + Length: + Længde: + + + Alignment: + Placering: + + + Left + Venstre + + + Center + Midtpå + + + Right + Højre + + + % + % + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Indstil panel + + + + Size + + + + + Size: + Størrelse: + + + + + px + + + + + Icon size: + + + + + Length: + Længde: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + pkt + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Venstre + + + + + + Center + Midtpå + + + + + Right + Højre + + + + Alignment: + Placering: + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Toppen af skrivebordet + + + + Left of desktop + Venstre side af skrivebordet + + + + Right of desktop + Højre side af skrivebordet + + + + Bottom of desktop + Bunden af skrivebordet + + + + Top of desktop %1 + Toppen af skrivebord %1 + + + + Left of desktop %1 + Venstre side af skrivebord %1 + + + + Right of desktop %1 + Højre side af skrivebord %1 + + + + Bottom of desktop %1 + Bunden af skrivebord %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + LxQtPanelPluginPrivate + + Configure + Indstil + + + Move + Flyt + + + Delete + Slet + + + + LxQtPanelPrivate + + Panel + Panel + + + Plugins + Udvidelsesmoduler + + + Add plugins ... + Tilføj udvidelsesmoduler ... + + + Move plugin + Flyt udvidelsesmodul + + + Configure plugin + Indstil udvidelsesmodul + + + Delete plugin + Fjern udvidelsesmodul + + + Show this panel at + Vis dette panel ved + + + Configure panel + Indstil panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + + PositionAction + + Top of desktop + Toppen af skrivebordet + + + Bottom of desktop + Bunden af skrivebordet + + + Left of desktop + Venstre side af skrivebordet + + + Right of desktop + Højre side af skrivebordet + + + Top of desktop %1 + Toppen af skrivebord %1 + + + Bottom of desktop %1 + Bunden af skrivebord %1 + + + Left of desktop %1 + Venstre side af skrivebord %1 + + + Right of desktop %1 + Højre side af skrivebord %1 + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_da_DK.ts b/lxqt-panel/panel/translations/lxqt-panel_da_DK.ts new file mode 100644 index 0000000..f4d72d3 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_da_DK.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Panelindstillinger + + + Panel size + Panelstørrelse + + + Size: + Størrelse: + + + px + px + + + Use automatic sizing + Brug automatisk dimensionering + + + Panel length && position + Panel længde && position + + + Left + Venstrestillet + + + Center + Midterstillet + + + Right + Højrestillet + + + % + % + + + Alignment: + Tilpasning: + + + Length: + Længde: + + + Position: + Position: + + + Top of desktop + Toppen af skrivebordet + + + Left of desktop + Venstre side af skrivebordet + + + Right of desktop + Højre side af skrivebordet + + + Bottom of desktop + Bunden af skrivebordet + + + Top of desktop %1 + Toppen af skrivebord %1 + + + Left of desktop %1 + Venstre side af skrivebord %1 + + + Right of desktop %1 + Højre side af skrivebord %1 + + + Bottom of desktop %1 + Bunden af skrivebord %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + Størrelse: + + + + + px + + + + + Icon size: + + + + + Length: + Længde: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Venstrestillet + + + + + + Center + Midterstillet + + + + + Right + Højrestillet + + + + Alignment: + Tilpasning: + + + + Position: + Position: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Toppen af skrivebordet + + + + Left of desktop + Venstre side af skrivebordet + + + + Right of desktop + Højre side af skrivebordet + + + + Bottom of desktop + Bunden af skrivebordet + + + + Top of desktop %1 + Toppen af skrivebord %1 + + + + Left of desktop %1 + Venstre side af skrivebord %1 + + + + Right of desktop %1 + Højre side af skrivebord %1 + + + + Bottom of desktop %1 + Bunden af skrivebord %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Hej Verden + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Indstil panelet... + + + Add plugins ... + Tilføj plugins ... + + + + LxQtPanelPlugin + + Configure + Indstil + + + Move + Flyt + + + Remove + Fjern + + + + LxQtPanelPrivate + + Configure panel + Indstil panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_de.ts b/lxqt-panel/panel/translations/lxqt-panel_de.ts new file mode 100644 index 0000000..9d73207 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_de.ts @@ -0,0 +1,346 @@ + + + + + AddPluginDialog + + + Add Plugins + Plugins hinzufügen + + + + Search: + Suchen: + + + + Add Widget + Widget hinzufügen + + + + Close + Schließen + + + + (only one instance can run at a time) + (es kann nur eine Instanz gleichzeitig ausgeführt werden) + + + + ConfigPanelDialog + + + Configure Panel + Leiste konfigurieren + + + + Panel + Leiste + + + + Widgets + Widgets + + + + ConfigPanelWidget + + + Configure panel + Leiste konfigurieren + + + + Size + Größe + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Negative Pixelwerte setzen die Leistenlänge auf den Wert verfügbare Größe minus angegebener Größe.</p><p/><p><i>Z.B. bei "Länge" gesetzt auf -100px und einer Bildschirmgröße von 1000px hat die Leiste eine Größe von 900 px.</i></p> + + + + Size: + Größe: + + + + Length: + Länge: + + + + % + % + + + + px + px + + + + + px + px + + + + Icon size: + Symbolgröße: + + + + Rows count: + Zeilenzahl: + + + + Alignment && position + Ausrichtung und Position + + + + Position: + Position: + + + + Alignment: + Ausrichtung: + + + + + Left + Links + + + + + + Center + Mitte + + + + + Right + Rechts + + + + Auto-hide + Automatisch ausblenden + + + + Custom styling + Eigener Stil + + + + Font color: + Schriftfarbe: + + + + Background color: + Hintergrundfarbe: + + + + Background opacity: + Deckkraft: + + + + <small>Compositing is required for panel transparency.</small> + <small>Für Transparenzeffekt wird Compositing benötigt.</small> + + + + Background image: + Hintergrundbild: + + + + Top of desktop + Oben auf der Arbeitsfläche + + + + Left of desktop + Links auf der Arbeitsfläche + + + + Right of desktop + Rechts auf der Arbeitsfläche + + + + Bottom of desktop + Unten auf der Arbeitsfläche + + + + Top of desktop %1 + Oben auf Arbeitsfläche %1 + + + + Left of desktop %1 + Links auf Arbeitsfläche %1 + + + + Right of desktop %1 + Rechts auf Arbeitsfläche %1 + + + + Bottom of desktop %1 + Unten auf Arbeitsfläche %1 + + + + Top + Oben + + + + Bottom + Unten + + + + + Pick color + Farbe auswählen + + + + Pick image + Bild auswählen + + + + Images (*.png *.gif *.jpg) + Bilder (*.png *.gif *.jpg) + + + + ConfigPluginsWidget + + + Configure Plugins + Plugins konfigurieren + + + + Note: changes made in this page cannot be reset. + Hinweis: Hier gemachte Änderungen können nicht rückgängig gemacht werden. + + + + Move up + Nach oben schieben + + + + + + + + ... + ... + + + + Move down + Nach unten schieben + + + + Add + Hinzufügen + + + + Remove + Entfernen + + + + Configure + Konfigurieren + + + + LxQtPanel + + + + Panel + Leiste + + + + Configure Panel + Leiste konfigurieren + + + + Manage Widgets + Widgets verwalten + + + + Add Panel + Leiste hinzufügen + + + + Remove Panel + Leiste entfernen + + + + Plugin + + + Configure "%1" + "%1" konfigurieren + + + + Move "%1" + "%1" verschieben + + + + Remove "%1" + "%1" entfernen + + + + main + + + Use alternate configuration file. + Alternative Konfigurationsdatei verwenden. + + + + Configuration file + Konfigurationsdatei + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_el_GR.ts b/lxqt-panel/panel/translations/lxqt-panel_el_GR.ts new file mode 100644 index 0000000..b0a3b99 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_el_GR.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Διαμόρφωση πίνακα + + + Panel size + Μέγεθος πίνακα + + + Size: + Μέγεθος: + + + px + px + + + Use automatic sizing + Χρήση αυτόματου μεγέθους + + + Panel length && position + Μήκος && θέση πίνακα + + + Left + Αριστερά + + + Center + Κέντρο + + + Right + Δεξιά + + + % + % + + + Alignment: + Στοίχιση: + + + Length: + Μήκος: + + + Position: + Θέση: + + + Top of desktop + Επάνω στην επιφάνεια εργασίας + + + Left of desktop + Αριστερά στην επιφάνεια εργασίας + + + Right of desktop + Δεξιά στην επιφάνεια εργασίας + + + Bottom of desktop + Κάτω στην επιφάνεια εργασίας + + + Top of desktop %1 + Επάνω στην επιφάνεια εργασίας %1 + + + Left of desktop %1 + Αριστερά στην επιφάνεια εργασίας %1 + + + Right of desktop %1 + Δεξιά στην επιφάνεια εργασίας %1 + + + Bottom of desktop %1 + Κάτω στην επιφάνεια εργασίας %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Διαμόρφωση πίνακα + + + + Size + + + + + Size: + Μέγεθος: + + + + + px + + + + + Icon size: + + + + + Length: + Μήκος: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Αριστερά + + + + + + Center + Κέντρο + + + + + Right + Δεξιά + + + + Alignment: + Στοίχιση: + + + + Position: + Θέση: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Επάνω στην επιφάνεια εργασίας + + + + Left of desktop + Αριστερά στην επιφάνεια εργασίας + + + + Right of desktop + Δεξιά στην επιφάνεια εργασίας + + + + Bottom of desktop + Κάτω στην επιφάνεια εργασίας + + + + Top of desktop %1 + Επάνω στην επιφάνεια εργασίας %1 + + + + Left of desktop %1 + Αριστερά στην επιφάνεια εργασίας %1 + + + + Right of desktop %1 + Δεξιά στην επιφάνεια εργασίας %1 + + + + Bottom of desktop %1 + Κάτω στην επιφάνεια εργασίας %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Πίνακας + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Διαμόρφωση πίνακα... + + + Add plugins ... + Προσθήκη επεκτάσεων... + + + + LxQtPanelPlugin + + Configure + Διαμόρφωση + + + Move + Μετακίνηση + + + Remove + Αφαίρεση + + + + LxQtPanelPrivate + + Configure panel + Διαμόρφωση πίνακα + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_eo.ts b/lxqt-panel/panel/translations/lxqt-panel_eo.ts new file mode 100644 index 0000000..4cb2801 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_eo.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Agordi panelon + + + Panel size + Grando de panelo + + + Size: + Grando: + + + px + rastr + + + Use automatic sizing + Uzi aŭtomatan grandigon + + + Panel length && position + Longo kaj loko de panelo + + + Left + Maldekstre + + + Center + Centre + + + Right + Dekstre + + + % + % + + + Alignment: + Loko: + + + Length: + Longo: + + + Position: + Loko: + + + Top of desktop + Supre de labortablo + + + Left of desktop + Maldekstre de labortablo + + + Right of desktop + Dekstre de labortablo + + + Bottom of desktop + Malsupre de labortablo + + + Top of desktop %1 + Supre de labortablo %1 + + + Left of desktop %1 + Maldekstre de labortablo %1 + + + Right of desktop %1 + Dekstre de labortablo %1 + + + Bottom of desktop %1 + Malsupre de labortablo %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Agordi panelon + + + + Size + + + + + Size: + Grando: + + + + + px + + + + + Icon size: + + + + + Length: + Longo: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + rastr + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Maldekstre + + + + + + Center + Centre + + + + + Right + Dekstre + + + + Alignment: + Loko: + + + + Position: + Loko: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Supre de labortablo + + + + Left of desktop + Maldekstre de labortablo + + + + Right of desktop + Dekstre de labortablo + + + + Bottom of desktop + Malsupre de labortablo + + + + Top of desktop %1 + Supre de labortablo %1 + + + + Left of desktop %1 + Maldekstre de labortablo %1 + + + + Right of desktop %1 + Dekstre de labortablo %1 + + + + Bottom of desktop %1 + Malsupre de labortablo %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Agordoj de muso por LxQto + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Agordi panelon... + + + Add plugins ... + Aldoni kromprogramojn... + + + + LxQtPanelPlugin + + Configure + Agordi + + + Move + Movi + + + Remove + Forigi + + + + LxQtPanelPrivate + + Configure panel + Agordi panelon + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_es.ts b/lxqt-panel/panel/translations/lxqt-panel_es.ts new file mode 100644 index 0000000..23fd321 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_es.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurar panel + + + Panel size + Tamaño del panel + + + Size: + Tamaño: + + + px + px + + + Use automatic sizing + Usar tamaño automático + + + Panel length && position + Largo y posición del panel + + + Left + Izquierda + + + Center + Centro + + + Right + Derecha + + + % + % + + + Alignment: + Alineación: + + + Length: + Largo: + + + Position: + Posición: + + + Top of desktop + Extremo superior del escritorio + + + Left of desktop + Extremo izquierdo del escritorio + + + Right of desktop + Extremo derecho del escritorio + + + Bottom of desktop + Extremo inferior del escritorio + + + Top of desktop %1 + Extremo superior del escritorio %1 + + + Left of desktop %1 + Extremo izquierdo del escritorio %1 + + + Right of desktop %1 + Extremo derecho del escritorio %1 + + + Bottom of desktop %1 + Extremo inferior del escritorio %1 + + + + + Configure Panel + Configurar Panel + + + + ConfigPanelWidget + + + Configure panel + Configurar panel + + + + Size + Tamaño + + + + Size: + Tamaño: + + + + + px + px + + + + Icon size: + Tamaño de ícono: + + + + Length: + Largo: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Un largo negativo en píxeles configura el largo del panel a esa cantidad de píxeles menos que el espacio disponible en la pantalla.</p><p/><p><i>E.j. "Largo" configurado a -100px, el tamaño de la pantalla es 1000px, entonces el largo real del panel será de 900 px.</i></p> + + + + % + % + + + + px + px + + + + Rows count: + Cantidad de filas: + + + + Alignment && position + Alineación y posición + + + + + Left + Izquierda + + + + + + Center + Centro + + + + + Right + Derecha + + + + Alignment: + Alineación: + + + + Position: + Posición: + + + + Auto-hide + Ocultar automáticamente + + + + Styling + Estilo + + + + Custom font color: + Color de fuente personalizado: + + + + Custom background image: + Imagen de fondo personalizada: + + + + Custom background color: + Color de fondo personalizado: + + + + Opacity + Opacidad + + + + Top of desktop + Extremo superior del escritorio + + + + Left of desktop + Extremo izquierdo del escritorio + + + + Right of desktop + Extremo derecho del escritorio + + + + Bottom of desktop + Extremo inferior del escritorio + + + + Top of desktop %1 + Extremo superior del escritorio %1 + + + + Left of desktop %1 + Extremo izquierdo del escritorio %1 + + + + Right of desktop %1 + Extremo derecho del escritorio %1 + + + + Bottom of desktop %1 + Extremo inferior del escritorio %1 + + + + Top + Arriba + + + + Bottom + Abajo + + + + + Pick color + Seleccione un color + + + + Images (*.png *.gif *.jpg) + Imágenes (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + Agregar Widgets al Panel + + + + + Panel + Panel + + + + Configure Panel... + Configurar Panel... + + + + Add Panel Widgets... + Agregar Widgets al Panel... + + + + Add Panel + Agregar Panel + + + + Remove Panel + Eliminar Panel + + + Configure panel... + Configuración del panel... + + + Add plugins ... + Añadir extensiones... + + + + LxQtPanelPlugin + + Configure + Configurar + + + Move + Mover + + + Remove + Quitar + + + + LxQtPanelPrivate + + Configure panel + Configurar panel + + + + Plugin + + + Configure "%1" + Configurar "%1" + + + + Move "%1" + Mover "%1" + + + + Remove "%1" + Eliminar "%1" + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_es_UY.ts b/lxqt-panel/panel/translations/lxqt-panel_es_UY.ts new file mode 100644 index 0000000..bb6c46e --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_es_UY.ts @@ -0,0 +1,310 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Arriba del escritorio + + + + Left of desktop + A la izquierda del escritorio + + + + Right of desktop + A la derecha del escritorio + + + + Bottom of desktop + Abajo del escritorio + + + + Top of desktop %1 + Arriba del escritorio %1 + + + + Left of desktop %1 + A la izquierda del escritorio %1 + + + + Right of desktop %1 + A la derecha del excritorio %1 + + + + Bottom of desktop %1 + Abajo del escritorio %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + LxQtPanelPrivate + + Panel + Panel + + + Plugins + Complementos + + + Add plugins ... + Agregar complemento ... + + + Move plugin + Mover complemento + + + Configure plugin + Configurar complemento + + + Delete plugin + Borrar complemento + + + Show this panel at + Mostrar este complemento + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + + PositionAction + + Top of desktop + Arriba del escritorio + + + Bottom of desktop + Abajo del escritorio + + + Left of desktop + A la izquierda del escritorio + + + Right of desktop + A la derecha del escritorio + + + Top of desktop %1 + Arriba del escritorio %1 + + + Bottom of desktop %1 + Abajo del escritorio %1 + + + Left of desktop %1 + A la izquierda del escritorio %1 + + + Right of desktop %1 + A la derecha del excritorio %1 + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_es_VE.ts b/lxqt-panel/panel/translations/lxqt-panel_es_VE.ts new file mode 100644 index 0000000..999c321 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_es_VE.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurar panel + + + Panel size + Tamaño de panel + + + Size: + Tamaño: + + + px + px + + + Use automatic sizing + Tamaño automatico + + + Panel length && position + Tamaño & posicion el panel + + + Left + Izquierda + + + Center + Centrado + + + Right + Derecha + + + % + % + + + Alignment: + Alineacion: + + + Length: + Largo: + + + Position: + Posicion: + + + Top of desktop + Tope del escritorio + + + Left of desktop + Izquierda del escritorio + + + Right of desktop + Derecha del escritorio + + + Bottom of desktop + Inferior del escritorio + + + Top of desktop %1 + Tope del escritorio %1 + + + Left of desktop %1 + Izquierda del escritorio %1 + + + Right of desktop %1 + Derecha del escritorio %1 + + + Bottom of desktop %1 + Inferior del escritorio %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Configurar panel + + + + Size + + + + + Size: + Tamaño: + + + + + px + + + + + Icon size: + + + + + Length: + Largo: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Izquierda + + + + + + Center + Centrado + + + + + Right + Derecha + + + + Alignment: + Alineacion: + + + + Position: + Posicion: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Tope del escritorio + + + + Left of desktop + Izquierda del escritorio + + + + Right of desktop + Derecha del escritorio + + + + Bottom of desktop + Inferior del escritorio + + + + Top of desktop %1 + Tope del escritorio %1 + + + + Left of desktop %1 + Izquierda del escritorio %1 + + + + Right of desktop %1 + Derecha del escritorio %1 + + + + Bottom of desktop %1 + Inferior del escritorio %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Configura el panel + + + Add plugins ... + Agregar plugins + + + + LxQtPanelPlugin + + Configure + Configurar + + + Move + Mover + + + Remove + Remover + + + + LxQtPanelPrivate + + Configure panel + Configurar panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_eu.ts b/lxqt-panel/panel/translations/lxqt-panel_eu.ts new file mode 100644 index 0000000..6c1ef09 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_eu.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Konfiguratu panela + + + Panel size + Panelaren tamaina + + + Size: + Tamaina: + + + px + px + + + Use automatic sizing + Erabili tamaina automatikoa + + + Panel length && position + Panelaren luzera eta posizioa + + + Left + Ezkerra + + + Center + Erdia + + + Right + Eskuina + + + % + % + + + Alignment: + Lerrokatzea: + + + Length: + Luzera: + + + Position: + Posizioa: + + + Top of desktop + Mahaigainaren goialdea + + + Left of desktop + Mahaigainaren ezkerraldea + + + Right of desktop + Mahaigainaren eskuinaldea + + + Bottom of desktop + Mahaigainaren behealdea + + + Top of desktop %1 + %1 mahaigainaren goialdea + + + Left of desktop %1 + %1 mahaigainaren ezkerraldea + + + Right of desktop %1 + %1 mahaigainaren eskuinaldea + + + Bottom of desktop %1 + %1 mahaigainaren behealdea + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Konfiguratu panela + + + + Size + + + + + Size: + Tamaina: + + + + + px + + + + + Icon size: + + + + + Length: + Luzera: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Ezkerra + + + + + + Center + Erdia + + + + + Right + Eskuina + + + + Alignment: + Lerrokatzea: + + + + Position: + Posizioa: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Mahaigainaren goialdea + + + + Left of desktop + Mahaigainaren ezkerraldea + + + + Right of desktop + Mahaigainaren eskuinaldea + + + + Bottom of desktop + Mahaigainaren behealdea + + + + Top of desktop %1 + %1 mahaigainaren goialdea + + + + Left of desktop %1 + %1 mahaigainaren ezkerraldea + + + + Right of desktop %1 + %1 mahaigainaren eskuinaldea + + + + Bottom of desktop %1 + %1 mahaigainaren behealdea + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panela + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Konfiguratu panela... + + + Add plugins ... + Gehitu pluginak... + + + + LxQtPanelPlugin + + Configure + Konfiguratu + + + Move + Mugitu + + + Remove + Kendu + + + + LxQtPanelPrivate + + Configure panel + Konfiguratu panela + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_fi.ts b/lxqt-panel/panel/translations/lxqt-panel_fi.ts new file mode 100644 index 0000000..615991e --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_fi.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Muokkaa paneelia + + + Panel size + Paneelin koko + + + Size: + Koko: + + + px + pikseliä + + + Use automatic sizing + Käytä automaattista kokoa + + + Panel length && position + Paneelin pituus && sijainti + + + Left + Vasemmalla + + + Center + Keskellä + + + Right + Oikealla + + + % + % + + + Alignment: + Kohdistus: + + + Length: + Leveys: + + + Position: + Sijainti: + + + Top of desktop + Työpöydän yläosassa + + + Left of desktop + Työpöydän vasemmassa laidassa + + + Right of desktop + Työpöydän oikeassa laidassa + + + Bottom of desktop + Työpöydän alaosassa + + + Top of desktop %1 + Työpöydän %1 yläosassa + + + Left of desktop %1 + Työpöydän %1 vasemmassa laidassa + + + Right of desktop %1 + Työpöydän %1 oikeassa laidassa + + + Bottom of desktop %1 + Työpöydän %1 alaosassa + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Muokkaa paneelia + + + + Size + + + + + Size: + Koko: + + + + + px + + + + + Icon size: + + + + + Length: + Leveys: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + pikseliä + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Vasemmalla + + + + + + Center + Keskellä + + + + + Right + Oikealla + + + + Alignment: + Kohdistus: + + + + Position: + Sijainti: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Työpöydän yläosassa + + + + Left of desktop + Työpöydän vasemmassa laidassa + + + + Right of desktop + Työpöydän oikeassa laidassa + + + + Bottom of desktop + Työpöydän alaosassa + + + + Top of desktop %1 + Työpöydän %1 yläosassa + + + + Left of desktop %1 + Työpöydän %1 vasemmassa laidassa + + + + Right of desktop %1 + Työpöydän %1 oikeassa laidassa + + + + Bottom of desktop %1 + Työpöydän %1 alaosassa + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Paneeli + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Muokkaa paneelia... + + + Add plugins ... + Lisää liitännäisiä... + + + + LxQtPanelPlugin + + Configure + Muokkaa + + + Move + Siirrä + + + Remove + Poista + + + + LxQtPanelPrivate + + Configure panel + Muokkaa paneelia + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_fr_FR.ts b/lxqt-panel/panel/translations/lxqt-panel_fr_FR.ts new file mode 100644 index 0000000..18f34f9 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_fr_FR.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurer le tableau de bord + + + Panel size + Taille du tableau de bord + + + Size: + Taille : + + + px + px + + + Use automatic sizing + Utiliser le dimensionnement automatique + + + Panel length && position + Longueur et position du tableau de bord + + + Left + Gauche + + + Center + Centre + + + Right + Droite + + + % + % + + + Alignment: + Alignement : + + + Length: + Longueur : + + + Position: + Position : + + + Top of desktop + Haut du bureau + + + Left of desktop + Gauche du bureau + + + Right of desktop + Droite du bureau + + + Bottom of desktop + Bas du bureau + + + Top of desktop %1 + Haut du bureau %1 + + + Left of desktop %1 + Gauche du bureau %1 + + + Right of desktop %1 + Droite du bureau %1 + + + Bottom of desktop %1 + Bas du bureau %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Configurer le tableau de bord + + + + Size + + + + + Size: + Taille : + + + + + px + + + + + Icon size: + + + + + Length: + Longueur : + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Gauche + + + + + + Center + Centre + + + + + Right + Droite + + + + Alignment: + Alignement : + + + + Position: + Position : + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Haut du bureau + + + + Left of desktop + Gauche du bureau + + + + Right of desktop + Droite du bureau + + + + Bottom of desktop + Bas du bureau + + + + Top of desktop %1 + Haut du bureau %1 + + + + Left of desktop %1 + Gauche du bureau %1 + + + + Right of desktop %1 + Droite du bureau %1 + + + + Bottom of desktop %1 + Bas du bureau %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Bloc-notes + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Configurer le tableau de bord... + + + Add plugins ... + Ajouter des extensions... + + + + LxQtPanelPlugin + + Configure + Configurer + + + Move + Déplacer + + + Remove + Supprimer + + + + LxQtPanelPrivate + + Configure panel + Configurer le tableau de bord + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_hu.ts b/lxqt-panel/panel/translations/lxqt-panel_hu.ts new file mode 100644 index 0000000..2927d16 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_hu.ts @@ -0,0 +1,280 @@ + + + + + ConfigPanelDialog + + Top of desktop + Az asztal tetejére + + + Left of desktop + Az asztal bal oldalára + + + Right of desktop + Az asztal jobb oldalára + + + Bottom of desktop + Az asztal aljára + + + Top of desktop %1 + A(z) %1. asztal tetejére + + + Left of desktop %1 + A(z) %1. asztal bal oldalára + + + Right of desktop %1 + A(z) %1. asztal jobb oldalára + + + Bottom of desktop %1 + A(z) %1. asztal aljára + + + + + Configure Panel + Panelbeállítás + + + + ConfigPanelWidget + + + Configure panel + Panelbeállítás + + + + Size + Méret + + + + Size: + Méret: + + + + + px + pixel + + + + Icon size: + Ikonméret: + + + + Length: + Hossz: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p + + + + % + + + + + px + pixel + + + + Rows count: + Sorszámláló: + + + + Alignment && position + Igazítás && helyzet + + + + + Left + Balra + + + + + + Center + Középre + + + + + Right + Jobbra + + + + Alignment: + Igazítás: + + + + Position: + Pozíció: + + + + Auto-hide + Automata elrejtés + + + + Styling + Hangolás + + + + Custom font color: + Egyéni betűszín: + + + + Custom background image: + Egyéni háttérkép: + + + + Custom background color: + Egyéni háttérszín: + + + + Opacity + Áttetszőség + + + + Top of desktop + Az asztal tetejére + + + + Left of desktop + Az asztal bal oldalára + + + + Right of desktop + Az asztal jobb oldalára + + + + Bottom of desktop + Az asztal aljára + + + + Top of desktop %1 + A(z) %1. asztal tetejére + + + + Left of desktop %1 + A(z) %1. asztal bal oldalára + + + + Right of desktop %1 + A(z) %1. asztal jobb oldalára + + + + Bottom of desktop %1 + A(z) %1. asztal aljára + + + + Top + Fenn + + + + Bottom + Lenn + + + + + Pick color + Színválasztás + + + + Images (*.png *.gif *.jpg) + Képek (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + Panelelem hozzáadás + + + + + Panel + Panel + + + + Configure Panel... + Panel beállítása… + + + + Add Panel Widgets... + Panelelem hozzáadás... + + + + Add Panel + Panel hozzáadás + + + + Remove Panel + Panel törlése + + + Add plugins ... + Bővítmények hozzáadása… + + + + Plugin + + + Configure "%1" + "%1" beállítása + + + + Move "%1" + "%1" mozgatása + + + + Remove "%1" + "%1" törlése + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_hu_HU.ts b/lxqt-panel/panel/translations/lxqt-panel_hu_HU.ts new file mode 100644 index 0000000..36e03e1 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_hu_HU.ts @@ -0,0 +1,280 @@ + + + + + ConfigPanelDialog + + Top of desktop + Az asztal tetejére + + + Left of desktop + Az asztal bal oldalára + + + Right of desktop + Az asztal jobb oldalára + + + Bottom of desktop + Az asztal aljára + + + Top of desktop %1 + A(z) %1. asztal tetejére + + + Left of desktop %1 + A(z) %1. asztal bal oldalára + + + Right of desktop %1 + A(z) %1. asztal jobb oldalára + + + Bottom of desktop %1 + A(z) %1. asztal aljára + + + + + Configure Panel + Panelbeállítás + + + + ConfigPanelWidget + + + Configure panel + Panelbeállítás + + + + Size + Méret + + + + Size: + Méret: + + + + + px + pixel + + + + Icon size: + Ikonméret: + + + + Length: + Hossz: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p + + + + % + + + + + px + pixel + + + + Rows count: + Sorszámláló: + + + + Alignment && position + Igazítás && helyzet + + + + + Left + Balra + + + + + + Center + Középre + + + + + Right + Jobbra + + + + Alignment: + Igazítás: + + + + Position: + Pozíció: + + + + Auto-hide + Automata elrejtés + + + + Styling + Hangolás + + + + Custom font color: + Egyéni betűszín: + + + + Custom background image: + Egyéni háttérkép: + + + + Custom background color: + Egyéni háttérszín: + + + + Opacity + Áttetszőség + + + + Top of desktop + Az asztal tetejére + + + + Left of desktop + Az asztal bal oldalára + + + + Right of desktop + Az asztal jobb oldalára + + + + Bottom of desktop + Az asztal aljára + + + + Top of desktop %1 + A(z) %1. asztal tetejére + + + + Left of desktop %1 + A(z) %1. asztal bal oldalára + + + + Right of desktop %1 + A(z) %1. asztal jobb oldalára + + + + Bottom of desktop %1 + A(z) %1. asztal aljára + + + + Top + Fenn + + + + Bottom + Lenn + + + + + Pick color + Színválasztás + + + + Images (*.png *.gif *.jpg) + Képek (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + Panelelem hozzáadás + + + + + Panel + Panel + + + + Configure Panel... + Panel beállítása… + + + + Add Panel Widgets... + Panelelem hozzáadás... + + + + Add Panel + Panel hozzáadás + + + + Remove Panel + Panel törlése + + + Add plugins ... + Bővítmények hozzáadása… + + + + Plugin + + + Configure "%1" + "%1" beállítása + + + + Move "%1" + "%1" mozgatása + + + + Remove "%1" + "%1" törlése + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ia.ts b/lxqt-panel/panel/translations/lxqt-panel_ia.ts new file mode 100644 index 0000000..d6eee7d --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ia.ts @@ -0,0 +1,252 @@ + + + + + ConfigPanelDialog + + Panel size + Dimension de pannello + + + Size: + Dimension + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + Dimension + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_id_ID.ts b/lxqt-panel/panel/translations/lxqt-panel_id_ID.ts new file mode 100644 index 0000000..9798e2f --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_id_ID.ts @@ -0,0 +1,244 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Hell World + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_it.ts b/lxqt-panel/panel/translations/lxqt-panel_it.ts new file mode 100644 index 0000000..8af869e --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_it.ts @@ -0,0 +1,359 @@ + + + + + ConfigPanelDialog + + Configure panel + Configura il pannello + + + Panel size + Dimensione pannello + + + Size: + Dimensione: + + + px + px + + + Use automatic sizing + Usa dimensionamento automatico + + + Panel length && position + Lunghezza e posizione del pannello + + + Left + Sinistra + + + Center + Centro + + + Right + Destra + + + % + % + + + Alignment: + Allineamento: + + + Length: + Lunghezza: + + + Position: + Posizione: + + + Top of desktop + Alto del desktop + + + Left of desktop + Sinistra del desktop + + + Right of desktop + Destra del desktop + + + Bottom of desktop + Basso del desktop + + + Top of desktop %1 + Alto del desktop %1 + + + Left of desktop %1 + Sinistra del desktop %1 + + + Right of desktop %1 + Destra del desktop %1 + + + Bottom of desktop %1 + Basso del desktop %1 + + + + + Configure Panel + Configura panello + + + + ConfigPanelWidget + + + Configure panel + Configura panello + + + + Size + Dimensione + + + + Size: + Dimensione: + + + + + px + + + + + Icon size: + Dimensione icone: + + + + Length: + Lunghezza: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> + + + + % + % + + + + px + px + + + + Rows count: + Numero righe: + + + + Alignment && position + Allineamento e posizione + + + + + Left + Sinistra + + + + + + Center + Centro + + + + + Right + Destra + + + + Alignment: + Allineamento: + + + + Position: + Posizione: + + + + Auto-hide + + + + + Styling + Aspetto + + + + Custom font color: + Colore carattere personalizzato: + + + + Custom background image: + Immagine sfondo: + + + + Custom background color: + Colore sfondo personalizzato: + + + + Opacity + Trasparenza + + + + Top of desktop + Alto del desktop + + + + Left of desktop + Sinistra del desktop + + + + Right of desktop + Destra del desktop + + + + Bottom of desktop + Basso del desktop + + + + Top of desktop %1 + Alto del desktop %1 + + + + Left of desktop %1 + Sinistra del desktop %1 + + + + Right of desktop %1 + Destra del desktop %1 + + + + Bottom of desktop %1 + Basso del desktop %1 + + + + Top + In cima + + + + Bottom + In fondo + + + + + Pick color + Scegli colore + + + + Images (*.png *.gif *.jpg) + Immagini (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + Aggiungi elementi + + + + + Panel + Panello + + + + Configure Panel... + Configura pannello... + + + + Add Panel Widgets... + Call them "plugins" better? + Aggiungi elementi... + + + + Add Panel + Aggiungi panello + + + + Remove Panel + Rimuovi panello + + + Configure panel... + Configura pannello... + + + Add plugins ... + Aggiungi plugin... + + + + LxQtPanelPlugin + + Configure + Configura + + + Move + Sposta + + + Remove + Rimuovi + + + + LxQtPanelPrivate + + Configure panel + Configura pannello + + + + Plugin + + + Configure "%1" + Configura "%1" + + + + Move "%1" + Sposta "%1" + + + + Remove "%1" + Rimuovi "%1" + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_it_IT.ts b/lxqt-panel/panel/translations/lxqt-panel_it_IT.ts new file mode 100644 index 0000000..c5e4236 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_it_IT.ts @@ -0,0 +1,359 @@ + + + + + ConfigPanelDialog + + Configure panel + Configura il pannello + + + Panel size + Dimensione pannello + + + Size: + Dimensione: + + + px + px + + + Use automatic sizing + Usa dimensionamento automatico + + + Panel length && position + Lunghezza e posizione del pannello + + + Left + Sinistra + + + Center + Centro + + + Right + Destra + + + % + % + + + Alignment: + Allineamento: + + + Length: + Lunghezza: + + + Position: + Posizione: + + + Top of desktop + Alto del desktop + + + Left of desktop + Sinistra del desktop + + + Right of desktop + Destra del desktop + + + Bottom of desktop + Basso del desktop + + + Top of desktop %1 + Alto del desktop %1 + + + Left of desktop %1 + Sinistra del desktop %1 + + + Right of desktop %1 + Destra del desktop %1 + + + Bottom of desktop %1 + Basso del desktop %1 + + + + + Configure Panel + Configura panello + + + + ConfigPanelWidget + + + Configure panel + Configura panello + + + + Size + Dimensione + + + + Size: + Dimensione: + + + + + px + + + + + Icon size: + Dimensione icone: + + + + Length: + Lunghezza: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> + + + + % + % + + + + px + px + + + + Rows count: + Numero righe: + + + + Alignment && position + Allineamento e posizione + + + + + Left + Sinistra + + + + + + Center + Centro + + + + + Right + Destra + + + + Alignment: + Allineamento: + + + + Position: + Posizione: + + + + Auto-hide + + + + + Styling + Aspetto + + + + Custom font color: + Colore carattere personalizzato: + + + + Custom background image: + Immagine sfondo: + + + + Custom background color: + Colore sfondo personalizzato: + + + + Opacity + Trasparenza + + + + Top of desktop + Alto del desktop + + + + Left of desktop + Sinistra del desktop + + + + Right of desktop + Destra del desktop + + + + Bottom of desktop + Basso del desktop + + + + Top of desktop %1 + Alto del desktop %1 + + + + Left of desktop %1 + Sinistra del desktop %1 + + + + Right of desktop %1 + Destra del desktop %1 + + + + Bottom of desktop %1 + Basso del desktop %1 + + + + Top + In cima + + + + Bottom + In fondo + + + + + Pick color + Scegli colore + + + + Images (*.png *.gif *.jpg) + Immagini (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + Aggiungi elementi + + + + + Panel + Panello + + + + Configure Panel... + Configura pannello... + + + + Add Panel Widgets... + Call them "plugins" better? + Aggiungi elementi... + + + + Add Panel + Aggiungi panello + + + + Remove Panel + Rimuovi panello + + + Configure panel... + Configura pannello... + + + Add plugins ... + Aggiungi plugin... + + + + LxQtPanelPlugin + + Configure + Configura + + + Move + Sposta + + + Remove + Rimuovi + + + + LxQtPanelPrivate + + Configure panel + Configura pannello + + + + Plugin + + + Configure "%1" + Configura "%1" + + + + Move "%1" + Sposta "%1" + + + + Remove "%1" + Rimuovi "%1" + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ja.ts b/lxqt-panel/panel/translations/lxqt-panel_ja.ts new file mode 100644 index 0000000..8cd0fbd --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ja.ts @@ -0,0 +1,244 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + パネルを設定 + + + + ConfigPanelWidget + + + Configure panel + パネルを設定 + + + + Size + 大きさ + + + + Size: + 幅: + + + + + px + ピクセル + + + + Icon size: + アイコンの大きさ: + + + + Length: + 長さ: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>負のピクセル値を設定すると、スクリーンの最大領域からその値を差し引いた長さになります。</p><p/><p><i>例: スクリーンの大きさが 1000 ピクセルである場合に -100 ピクセルを設定すると、パネルの長さは 900 ピクセルになります。</i></p> + + + + % + % + + + + px + ピクセル + + + + Rows count: + 列の数 + + + + Alignment && position + 位置寄せと場所 + + + + + Left + 左寄せ + + + + + + Center + 中央 + + + + + Right + 右寄せ + + + + Alignment: + 位置寄せ: + + + + Position: + 場所: + + + + Auto-hide + + + + + Styling + 見た目 + + + + Custom font color: + フォントの色を変更: + + + + Custom background image: + 背景画像を指定 + + + + Custom background color: + 背景の色を変更: + + + + Opacity + 透明度 + + + + Top of desktop + デスクトップの上 + + + + Left of desktop + デスクトップの左 + + + + Right of desktop + デスクトップの右 + + + + Bottom of desktop + デスクトップの下 + + + + Top of desktop %1 + デスクトップ %1 の上 + + + + Left of desktop %1 + デスクトップ %1 の左 + + + + Right of desktop %1 + デスクトップ %1 の右 + + + + Bottom of desktop %1 + デスクトップ %1 の下 + + + + Top + + + + + Bottom + + + + + + Pick color + 色を選ぶ + + + + Images (*.png *.gif *.jpg) + 画像 (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + パネルウィジェットを追加 + + + + + Panel + パネル + + + + Configure Panel... + パネルの設定 + + + + Add Panel Widgets... + ウィジェットを追加 + + + + Add Panel + パネルを追加 + + + + Remove Panel + パネルを削除 + + + + Plugin + + + Configure "%1" + "%1" を設定 + + + + Move "%1" + "%1" を移動 + + + + Remove "%1" + "%1" を削除 + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ko.ts b/lxqt-panel/panel/translations/lxqt-panel_ko.ts new file mode 100644 index 0000000..50f62a4 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ko.ts @@ -0,0 +1,244 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_lt.ts b/lxqt-panel/panel/translations/lxqt-panel_lt.ts new file mode 100644 index 0000000..5798d13 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_lt.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Skydelio konfigūravimas + + + Panel size + Skydelio dydis + + + Size: + Dydis: + + + px + taškeliai + + + Use automatic sizing + Automatinis dydis + + + Panel length && position + Skydelio ilgis ir padėtis + + + Left + Kairinė + + + Center + Centrinė + + + Right + Dešininė + + + % + % + + + Alignment: + Lygiuotė: + + + Length: + Ilgis: + + + Position: + Padėtis: + + + Top of desktop + Darbalaukio viršuje + + + Left of desktop + Darbalaukio kairėje + + + Right of desktop + Darbalaukio dešinėje + + + Bottom of desktop + Darbalaukio apačioje + + + Top of desktop %1 + %1 darbalaukio viršuje + + + Left of desktop %1 + %1 darbalaukio kairėje + + + Right of desktop %1 + %1 darbalaukio dešinėje + + + Bottom of desktop %1 + %1 darbalaukio apačioje + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Skydelio konfigūravimas + + + + Size + + + + + Size: + Dydis: + + + + + px + + + + + Icon size: + + + + + Length: + Ilgis: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + taškeliai + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Kairinė + + + + + + Center + Centrinė + + + + + Right + Dešininė + + + + Alignment: + Lygiuotė: + + + + Position: + Padėtis: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Darbalaukio viršuje + + + + Left of desktop + Darbalaukio kairėje + + + + Right of desktop + Darbalaukio dešinėje + + + + Bottom of desktop + Darbalaukio apačioje + + + + Top of desktop %1 + %1 darbalaukio viršuje + + + + Left of desktop %1 + %1 darbalaukio kairėje + + + + Right of desktop %1 + %1 darbalaukio dešinėje + + + + Bottom of desktop %1 + %1 darbalaukio apačioje + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Qlipper + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Konfigūruoti skydelį... + + + Add plugins ... + Įdėti papildinių... + + + + LxQtPanelPlugin + + Configure + Konfigūruoti + + + Move + Perkelti + + + Remove + Pašalinti + + + + LxQtPanelPrivate + + Configure panel + Skydelio konfigūravimas + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/panel/translations/lxqt-panel_de_DE.ts b/lxqt-panel/panel/translations/lxqt-panel_nl.ts similarity index 73% rename from panel/translations/lxqt-panel_de_DE.ts rename to lxqt-panel/panel/translations/lxqt-panel_nl.ts index 4f1c3dd..cc219c0 100644 --- a/panel/translations/lxqt-panel_de_DE.ts +++ b/lxqt-panel/panel/translations/lxqt-panel_nl.ts @@ -1,19 +1,19 @@ - + ConfigPanelDialog Configure panel - Panel konfigurieren + Paneel instellen Panel size - Panelgröße + Paneelgrootte Size: - Größe: + Grootte: px @@ -21,11 +21,11 @@ Use automatic sizing - Größe automatisch anpassen + Gebruik automatische afmetingen Panel length && position - Panel Länge && Position + Lengte && positie van paneel Left @@ -33,7 +33,7 @@ Center - Mitte + Midden Right @@ -45,47 +45,47 @@ Alignment: - Ausrichtung: + Uitlijning: Length: - Länge: + Lengte: Position: - Position: + Positie: Top of desktop - Oben auf dem Desktop + Bovenaan bureaublad Left of desktop - Links auf dem Desktop + Linkerzijkant van bureaublad Right of desktop - Rechts auf dem Desktop + Rechterzijkant van bureaublad Bottom of desktop - Unten auf dem Desktop + Onderkant van bureaublad Top of desktop %1 - Oben auf dem Desktop %1 + Bovenkant van bureaublad %1 Left of desktop %1 - Links auf dem Desktop %1 + Linkerzijkant van bureaublad %1 Right of desktop %1 - Rechts auf dem Desktop %1 + Rechterzijkant van bureaublad %1 Bottom of desktop %1 - Unten auf dem Desktop %1 + Onderkant van bureaublad %1 @@ -99,7 +99,7 @@ Configure panel - Panel konfigurieren + @@ -109,7 +109,7 @@ Size: - Größe: + Grootte: @@ -125,7 +125,7 @@ Length: - Länge: + Lengte: @@ -154,116 +154,121 @@ - + Left Links - - + + Center - Mitte + Midden - + Right Rechts Alignment: - Ausrichtung: + Uitlijning: Position: - Position: + Positie: + + + + Auto-hide + - + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - Oben auf dem Desktop + Bovenaan bureaublad - + Left of desktop - Links auf dem Desktop + Linkerzijkant van bureaublad - + Right of desktop - Rechts auf dem Desktop + Rechterzijkant van bureaublad - + Bottom of desktop - Unten auf dem Desktop + Onderkant van bureaublad - + Top of desktop %1 - Oben auf dem Desktop %1 + Bovenkant van bureaublad %1 - + Left of desktop %1 - Links auf dem Desktop %1 + Linkerzijkant van bureaublad %1 - + Right of desktop %1 - Rechts auf dem Desktop %1 + Rechterzijkant van bureaublad %1 - + Bottom of desktop %1 - Unten auf dem Desktop %1 + Onderkant van bureaublad %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,81 +276,81 @@ LxQtPanel - + Add Panel Widgets - - + + Panel - Anwendungsmenü + Paneel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel Configure panel... - Konfiguriere Panel... + Paneel instellen... Add plugins ... - Plugins hinzufügen ... + Invoegtoepassingen toevoegen... LxQtPanelPlugin Configure - Konfigurieren + Instellen Move - Bewegen + Verplaatsen Remove - Entfernen + Verwijderen LxQtPanelPrivate Configure panel - Panel konfigurieren + Paneel instellingen Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/lxqt-panel/panel/translations/lxqt-panel_pl.ts b/lxqt-panel/panel/translations/lxqt-panel_pl.ts new file mode 100644 index 0000000..5663502 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_pl.ts @@ -0,0 +1,244 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Menu + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_pl_PL.ts b/lxqt-panel/panel/translations/lxqt-panel_pl_PL.ts new file mode 100644 index 0000000..a7b9e3c --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_pl_PL.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Konfiguruj panel + + + Panel size + Rozmiar panelu + + + Size: + Rozmiar: + + + px + px + + + Use automatic sizing + Użyj automatycznego dopasowywania + + + Panel length && position + Długość i położenie panelu + + + Left + Lewa + + + Center + Środek + + + Right + Prawa + + + % + % + + + Alignment: + Wyrównanie: + + + Length: + Długość: + + + Position: + Pozycja: + + + Top of desktop + Górna krawędź pulpitu + + + Left of desktop + Lewa krawędź pulpitu + + + Right of desktop + Prawa krawędź pulpitu + + + Bottom of desktop + Dolna krawędź pulpitu + + + Top of desktop %1 + Górna krawędź pulpitu %1 + + + Left of desktop %1 + Lewa krawędź pulpitu %1 + + + Right of desktop %1 + Prawa krawędź pulpitu %1 + + + Bottom of desktop %1 + Dolna krawędź pulpitu %1 + + + + + Configure Panel + KOnfiguruj Panel + + + + ConfigPanelWidget + + + Configure panel + Konfiguruj panel + + + + Size + Rozmiar + + + + Size: + Rozmiar: + + + + + px + px + + + + Icon size: + Rozmiar ikon: + + + + Length: + Długość: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Ujemna ilość pikseli powoduje zmniejszenie panelu .</p><p/><p><i>Np. "Długość" ustawiona na -100px, rozmiar ekranu 1000px, długość panelu wyniesie 900 px.</i></p> + + + + % + % + + + + px + px + + + + Rows count: + Ilość wierszy: + + + + Alignment && position + Wyrównanie i pozycja + + + + + Left + Lewa + + + + + + Center + Środek + + + + + Right + Prawa + + + + Alignment: + Wyrównanie: + + + + Position: + Pozycja: + + + + Auto-hide + + + + + Styling + Wygląd + + + + Custom font color: + Własny kolor czcionki: + + + + Custom background image: + Własny obrazek tła: + + + + Custom background color: + Własny kolor tła: + + + + Opacity + Przezroczystość + + + + Top of desktop + Górna krawędź pulpitu + + + + Left of desktop + Lewa krawędź pulpitu + + + + Right of desktop + Prawa krawędź pulpitu + + + + Bottom of desktop + Dolna krawędź pulpitu + + + + Top of desktop %1 + Górna krawędź pulpitu %1 + + + + Left of desktop %1 + Lewa krawędź pulpitu %1 + + + + Right of desktop %1 + Prawa krawędź pulpitu %1 + + + + Bottom of desktop %1 + Dolna krawędź pulpitu %1 + + + + Top + Góra + + + + Bottom + Dół + + + + + Pick color + Wybierz kolor + + + + Images (*.png *.gif *.jpg) + Obrazki (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + DOdaj Widgety + + + + + Panel + Panel + + + + Configure Panel... + Konfiguruj Panel... + + + + Add Panel Widgets... + Dodaj Widgety... + + + + Add Panel + Dodaj Panel + + + + Remove Panel + Usuń panel + + + Configure panel... + Konfiguruj panel... + + + Add plugins ... + Dodaj wtyczkę ... + + + + LxQtPanelPlugin + + Configure + Konfiguruj + + + Move + Przesuń + + + Remove + Usuń + + + + LxQtPanelPrivate + + Configure panel + Konfiguruj panel + + + + Plugin + + + Configure "%1" + Konfiguruj "%1" + + + + Move "%1" + Przesuń "%1" + + + + Remove "%1" + Usuń "%1" + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_pt.ts b/lxqt-panel/panel/translations/lxqt-panel_pt.ts new file mode 100644 index 0000000..fa48398 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_pt.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurar painel + + + Panel size + Tamanho do painel + + + Size: + Tamanho: + + + px + px + + + Use automatic sizing + Tamanho automático + + + Panel length && position + Posição e comprimento do painel + + + Left + À esquerda + + + Center + Ao centro + + + Right + À direita + + + % + % + + + Alignment: + Alinhamento + + + Length: + Comprimento: + + + Position: + Posição: + + + Top of desktop + Em cima + + + Left of desktop + À esquerda + + + Right of desktop + À direita + + + Bottom of desktop + Em baixo + + + Top of desktop %1 + Em cima, área de trabalho %1 + + + Left of desktop %1 + À esquerda, área de trabalho %1 + + + Right of desktop %1 + À direita, área de trabalho %1 + + + Bottom of desktop %1 + Em baixo, área de trabalho %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Configurar painel + + + + Size + + + + + Size: + Tamanho: + + + + + px + + + + + Icon size: + + + + + Length: + Comprimento: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + À esquerda + + + + + + Center + Ao centro + + + + + Right + À direita + + + + Alignment: + Alinhamento + + + + Position: + Posição: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Em cima + + + + Left of desktop + À esquerda + + + + Right of desktop + À direita + + + + Bottom of desktop + Em baixo + + + + Top of desktop %1 + Em cima, área de trabalho %1 + + + + Left of desktop %1 + À esquerda, área de trabalho %1 + + + + Right of desktop %1 + À direita, área de trabalho %1 + + + + Bottom of desktop %1 + Em baixo, área de trabalho %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Painel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Configurar painel... + + + Add plugins ... + Adicionar extras... + + + + LxQtPanelPlugin + + Configure + Configurar + + + Move + Mover + + + Remove + Remover + + + + LxQtPanelPrivate + + Configure panel + Configurar painel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_pt_BR.ts b/lxqt-panel/panel/translations/lxqt-panel_pt_BR.ts new file mode 100644 index 0000000..b39ddf3 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_pt_BR.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurar painel + + + Panel size + Tamanho do painel + + + Size: + Tamanho: + + + px + px + + + Use automatic sizing + Usar dimensionamento automático + + + Panel length && position + Comprimento e posição do painel + + + Left + Esquerda + + + Center + Centro + + + Right + Direita + + + % + % + + + Alignment: + Alinhamento: + + + Length: + Comprimento: + + + Position: + Posição: + + + Top of desktop + Na parte superior da área de trabalho + + + Left of desktop + À esquerda da área de trabalho + + + Right of desktop + À direita da área de trabalho + + + Bottom of desktop + Na parte inferior da área de trabalho + + + Top of desktop %1 + Na parte superior da área de trabalho %1 + + + Left of desktop %1 + A esquerda da área de trabalho %1 + + + Right of desktop %1 + À direita da área de trabalho %1 + + + Bottom of desktop %1 + Na parte inferior da área de trabalho %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Configurar painel + + + + Size + + + + + Size: + Tamanho: + + + + + px + + + + + Icon size: + + + + + Length: + Comprimento: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Esquerda + + + + + + Center + Centro + + + + + Right + Direita + + + + Alignment: + Alinhamento: + + + + Position: + Posição: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Na parte superior da área de trabalho + + + + Left of desktop + À esquerda da área de trabalho + + + + Right of desktop + À direita da área de trabalho + + + + Bottom of desktop + Na parte inferior da área de trabalho + + + + Top of desktop %1 + Na parte superior da área de trabalho %1 + + + + Left of desktop %1 + A esquerda da área de trabalho %1 + + + + Right of desktop %1 + À direita da área de trabalho %1 + + + + Bottom of desktop %1 + Na parte inferior da área de trabalho %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Suspender Automaticamente + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Configurar painel... + + + Add plugins ... + Adicionar plug-ins... + + + + LxQtPanelPlugin + + Configure + Configurar + + + Move + Mover + + + Remove + Remover + + + + LxQtPanelPrivate + + Configure panel + Configurar painel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ro_RO.ts b/lxqt-panel/panel/translations/lxqt-panel_ro_RO.ts new file mode 100644 index 0000000..a23cd5d --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ro_RO.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Configurează panoul + + + Panel size + Dimensiune panou + + + Size: + Dimensiune: + + + px + px + + + Use automatic sizing + Utilizează dimensionarea automată + + + Panel length && position + Lungime && poziție panou + + + Left + Stânga + + + Center + Centru + + + Right + Dreapta + + + % + % + + + Alignment: + Aliniere: + + + Length: + Lungime: + + + Position: + Poziție: + + + Top of desktop + Partea de sus a ecranului + + + Left of desktop + Stânga ecranului + + + Right of desktop + Dreapta ecranului + + + Bottom of desktop + Partea de jos a ecranului + + + Top of desktop %1 + Partea de sus a ecranului %1 + + + Left of desktop %1 + Stânga ecranului %1 + + + Right of desktop %1 + Dreapta ecranului %1 + + + Bottom of desktop %1 + Partea de jos a ecranului %1 + + + + + Configure Panel + Configurează panoul + + + + ConfigPanelWidget + + + Configure panel + Configurează panoul + + + + Size + Dimensiune + + + + Size: + Dimensiune: + + + + + px + px + + + + Icon size: + Dimensiune pictograme: + + + + Length: + Lungime: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Pentru valori negative, dimensiunea panoului va fi calculată ca diferenta dintre marimea disponibilă a ecranului și valoarea introdusă.</p><p/><p><i>De ex. introducând o "lungime" de -100 px si o dimensiune a ecranului de 1000 px, dimensiunea reala a panoului va fi de 900 px.</i></p> + + + + % + % + + + + px + px + + + + Rows count: + Număr coloane: + + + + Alignment && position + Aliniere și poziție + + + + + Left + Stânga + + + + + + Center + Centru + + + + + Right + Dreapta + + + + Alignment: + Aliniere: + + + + Position: + Poziție: + + + + Auto-hide + Auto-ascundere + + + + Styling + Stil + + + + Custom font color: + Culoare de font personalizată + + + + Custom background image: + Imagine de fundal personalizată + + + + Custom background color: + Culoare de fundal personalizată + + + + Opacity + Opacitate + + + + Top of desktop + Partea de sus a ecranului + + + + Left of desktop + Stânga ecranului + + + + Right of desktop + Dreapta ecranului + + + + Bottom of desktop + Partea de jos a ecranului + + + + Top of desktop %1 + Partea de sus a ecranului %1 + + + + Left of desktop %1 + Stânga ecranului %1 + + + + Right of desktop %1 + Dreapta ecranului %1 + + + + Bottom of desktop %1 + Partea de jos a ecranului %1 + + + + Top + Sus + + + + Bottom + Jos + + + + + Pick color + Alege culoare + + + + Images (*.png *.gif *.jpg) + Imagini (*.png *.gif *.jpg) + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panou + + + + Configure Panel... + Configurează panoul... + + + + Add Panel Widgets... + Adaugă widget de panou + + + + Add Panel + Adaugă panou + + + + Remove Panel + Îndepărtează panou + + + Configure panel... + Configurează panoul... + + + Add plugins ... + Adaugă module.... + + + + LxQtPanelPlugin + + Configure + Configurează + + + Move + Mută + + + Remove + Îndepărtează + + + + LxQtPanelPrivate + + Configure panel + Configurează panoul + + + + Plugin + + + Configure "%1" + Configurează "%1" + + + + Move "%1" + Mută "%1" + + + + Remove "%1" + Îndepărtează "%1" + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ru.ts b/lxqt-panel/panel/translations/lxqt-panel_ru.ts new file mode 100644 index 0000000..e5b72a8 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ru.ts @@ -0,0 +1,346 @@ + + + + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + + + ConfigPanelDialog + + + Configure Panel + Настроить панель + + + + Panel + Панель + + + + Widgets + Виджеты + + + + ConfigPanelWidget + + + Configure panel + Настроить панель + + + + px + пикс + + + + Rows count: + Количество строк: + + + + Icon size: + Размер иконок: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> + + + + + Left + Слева + + + + + + Center + По центру + + + + + Right + Справа + + + + % + % + + + + Size + Размер + + + + Size: + Размер: + + + + + px + пикс + + + + Alignment && position + Выравнивание && расположение + + + + Alignment: + Выравнивание: + + + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: + + + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> + + + + Background image: + Фоновое изображение: + + + + Background color: + Цвет фона: + + + + Auto-hide + Автоматически скрывать + + + + Length: + Длина: + + + + Position: + Расположение: + + + + Top of desktop + Вверху + + + + Left of desktop + Слева + + + + Right of desktop + Справа + + + + Bottom of desktop + Внизу + + + + Top of desktop %1 + Вверху %1 рабочего стола + + + + Left of desktop %1 + Слева на %1 рабочем столе + + + + Right of desktop %1 + Справа на %1 рабочем столе + + + + Bottom of desktop %1 + Внизу %1 рабочего стола + + + + Top + Вверху + + + + Bottom + Внизу + + + + + Pick color + Выбрать цвет + + + + Images (*.png *.gif *.jpg) + Изображения (*.png *.gif *.jpg) + + + + Pick image + Выберите изображение + + + + ConfigPluginsWidget + + + Configure Plugins + Настроить плагины + + + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + + Panel + Панель + + + + Configure Panel + Настроить панель + + + + Manage Widgets + Управление виджетами + + + + Add Panel + Добавить панель + + + + Remove Panel + Удалить панель + + + + Plugin + + + Configure "%1" + Настроить «%1» + + + + Move "%1" + Переместить «%1» + + + + Remove "%1" + Удалить «%1» + + + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_ru_RU.ts b/lxqt-panel/panel/translations/lxqt-panel_ru_RU.ts new file mode 100644 index 0000000..a5ad7a3 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_ru_RU.ts @@ -0,0 +1,346 @@ + + + + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + + + ConfigPanelDialog + + + Configure Panel + Настроить панель + + + + Panel + Панель + + + + Widgets + Виджеты + + + + ConfigPanelWidget + + + Configure panel + Настроить панель + + + + px + пикс + + + + Rows count: + Количество строк: + + + + Icon size: + Размер иконок: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> + + + + + Left + Слева + + + + + + Center + По центру + + + + + Right + Справа + + + + % + % + + + + Size + Размер + + + + Size: + Размер: + + + + + px + пикс + + + + Alignment && position + Выравнивание && расположение + + + + Alignment: + Выравнивание: + + + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: + + + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> + + + + Background image: + Фоновое изображение: + + + + Background color: + Цвет фона: + + + + Auto-hide + Автоматически скрывать + + + + Length: + Длина: + + + + Position: + Расположение: + + + + Top of desktop + Вверху + + + + Left of desktop + Слева + + + + Right of desktop + Справа + + + + Bottom of desktop + Внизу + + + + Top of desktop %1 + Вверху %1 рабочего стола + + + + Left of desktop %1 + Слева на %1 рабочем столе + + + + Right of desktop %1 + Справа на %1 рабочем столе + + + + Bottom of desktop %1 + Внизу %1 рабочего стола + + + + Top + Вверху + + + + Bottom + Внизу + + + + + Pick color + Выбрать цвет + + + + Images (*.png *.gif *.jpg) + Изображения (*.png *.gif *.jpg) + + + + Pick image + Выберите изображение + + + + ConfigPluginsWidget + + + Configure Plugins + Настроить плагины + + + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + + Panel + Панель + + + + Configure Panel + Настроить панель + + + + Manage Widgets + Управление виджетами + + + + Add Panel + Добавить панель + + + + Remove Panel + Удалить панель + + + + Plugin + + + Configure "%1" + Настроить «%1» + + + + Move "%1" + Переместить «%1» + + + + Remove "%1" + Удалить «%1» + + + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_sk_SK.ts b/lxqt-panel/panel/translations/lxqt-panel_sk_SK.ts new file mode 100644 index 0000000..f60ceb5 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_sk_SK.ts @@ -0,0 +1,311 @@ + + + + + ConfigPanelDialog + + Configure panel + Nastaviť panel + + + px + px + + + Left + Vľavo + + + Center + Stred + + + Right + Vpravo + + + % + % + + + Top of desktop + Vrch plochy + + + Left of desktop + Ľavá strana plochy + + + Right of desktop + Pravá strana plochy + + + Bottom of desktop + Spodok plochy + + + Top of desktop %1 + Vrch plochy %1 + + + Left of desktop %1 + Ľavá strana plochy %1 + + + Right of desktop %1 + Pravá strana plochy %1 + + + Bottom of desktop %1 + Spodok plochy %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Nastaviť panel + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Vľavo + + + + + + Center + Stred + + + + + Right + Vpravo + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Vrch plochy + + + + Left of desktop + Ľavá strana plochy + + + + Right of desktop + Pravá strana plochy + + + + Bottom of desktop + Spodok plochy + + + + Top of desktop %1 + Vrch plochy %1 + + + + Left of desktop %1 + Ľavá strana plochy %1 + + + + Right of desktop %1 + Pravá strana plochy %1 + + + + Bottom of desktop %1 + Spodok plochy %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Panel + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Add plugins ... + Pridať moduly... + + + + LxQtPanelPrivate + + Configure panel + Nastaviť panel + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_sl.ts b/lxqt-panel/panel/translations/lxqt-panel_sl.ts new file mode 100644 index 0000000..c8c880a --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_sl.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Nastavitev pulta + + + Panel size + Velikost pulta + + + Size: + Velikost: + + + px + pik + + + Use automatic sizing + Uporabi samodejno prilagajanje velikosti + + + Panel length && position + Dolžina in položaj pulta + + + Left + Levo + + + Center + Na sredini + + + Right + Desno + + + % + % + + + Alignment: + Poravnava: + + + Length: + Dolžina: + + + Position: + Položaj: + + + Top of desktop + Vrh namizja + + + Left of desktop + Leva stran namizja + + + Right of desktop + Desna stran namizja + + + Bottom of desktop + Dno namizja + + + Top of desktop %1 + Vrh namizja %1 + + + Left of desktop %1 + Leva stran namizja %1 + + + Right of desktop %1 + Desna stran namizja %1 + + + Bottom of desktop %1 + Dno namizja %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Nastavitev pulta + + + + Size + + + + + Size: + Velikost: + + + + + px + + + + + Icon size: + + + + + Length: + Dolžina: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + pik + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Levo + + + + + + Center + Na sredini + + + + + Right + Desno + + + + Alignment: + Poravnava: + + + + Position: + Položaj: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Vrh namizja + + + + Left of desktop + Leva stran namizja + + + + Right of desktop + Desna stran namizja + + + + Bottom of desktop + Dno namizja + + + + Top of desktop %1 + Vrh namizja %1 + + + + Left of desktop %1 + Leva stran namizja %1 + + + + Right of desktop %1 + Desna stran namizja %1 + + + + Bottom of desktop %1 + Dno namizja %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Pult + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Nastavitev pulta ... + + + Add plugins ... + Dodaj vstavke ... + + + + LxQtPanelPlugin + + Configure + Nastavitev + + + Move + Premakni + + + Remove + Odstrani + + + + LxQtPanelPrivate + + Configure panel + Nastavitev pulta + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_sr@latin.ts b/lxqt-panel/panel/translations/lxqt-panel_sr@latin.ts new file mode 100644 index 0000000..ec6115e --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_sr@latin.ts @@ -0,0 +1,244 @@ + + + + + ConfigPanelDialog + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + + + + + + px + + + + + Icon size: + + + + + Length: + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + + + + + px + + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + + + + + + Right + + + + + Alignment: + + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + + + + + Left of desktop + + + + + Right of desktop + + + + + Bottom of desktop + + + + + Top of desktop %1 + + + + + Left of desktop %1 + + + + + Right of desktop %1 + + + + + Bottom of desktop %1 + + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Automatsko suspendovanje + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_sr_BA.ts b/lxqt-panel/panel/translations/lxqt-panel_sr_BA.ts new file mode 100644 index 0000000..d2f3456 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_sr_BA.ts @@ -0,0 +1,377 @@ + + + + + ConfigPanelDialog + + Configure panel + Подешавање панела + + + % + % + + + px + px + + + Left + Лијево + + + Right + Десно + + + Center + Центар + + + Panel size + Величина панела + + + Size: + Величина: + + + Use theme size + Величина постављена темом + + + Panel lenght & position + Дужина и положај панела + + + Length: + Дужина: + + + Alignment: + Поравнање: + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + Величина: + + + + + px + + + + + Icon size: + + + + + Length: + Дужина: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Лијево + + + + + + Center + Центар + + + + + Right + Десно + + + + Alignment: + Поравнање: + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + врху површи + + + + Left of desktop + лијевој страни површи + + + + Right of desktop + десној страни површи + + + + Bottom of desktop + дну површи + + + + Top of desktop %1 + врху површи %1 + + + + Left of desktop %1 + лијевој страни површи %1 + + + + Right of desktop %1 + десној страни површи %1 + + + + Bottom of desktop %1 + дну површи %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Панел + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + + LxQtPanelPluginPrivate + + Configure + Подеси + + + Move + Помјери + + + Delete + Обриши + + + + LxQtPanelPrivate + + Panel + Панел + + + Plugins + Модули + + + Add plugins ... + Додај модуле... + + + Move plugin + Помјери модул + + + Configure plugin + Подеси модул + + + Delete plugin + Обриши модул + + + Show this panel at + Прикажи овај панел на + + + Configure panel + Подеси панел + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + + PositionAction + + Top of desktop + врху површи + + + Bottom of desktop + дну површи + + + Left of desktop + лијевој страни површи + + + Right of desktop + десној страни површи + + + Top of desktop %1 + врху површи %1 + + + Bottom of desktop %1 + дну површи %1 + + + Left of desktop %1 + лијевој страни површи %1 + + + Right of desktop %1 + десној страни површи %1 + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_sr_RS.ts b/lxqt-panel/panel/translations/lxqt-panel_sr_RS.ts new file mode 100644 index 0000000..f44a87f --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_sr_RS.ts @@ -0,0 +1,338 @@ + + + + + ConfigPanelDialog + + Configure panel + Подешавање панела + + + Panel size + Величина панела + + + Size: + Величина: + + + px + px + + + Left + Лево + + + Center + Центар + + + Right + Десно + + + % + % + + + Alignment: + Поравнање: + + + Length: + Дужина: + + + Top of desktop + врху површи + + + Left of desktop + левој страни површи + + + Right of desktop + десној страни површи + + + Bottom of desktop + дну површи + + + Top of desktop %1 + врху површи %1 + + + Left of desktop %1 + левој страни површи %1 + + + Right of desktop %1 + десној страни површи %1 + + + Bottom of desktop %1 + дну површи %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + + + + + Size + + + + + Size: + Величина: + + + + + px + + + + + Icon size: + + + + + Length: + Дужина: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Лево + + + + + + Center + Центар + + + + + Right + Десно + + + + Alignment: + Поравнање: + + + + Position: + + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + врху површи + + + + Left of desktop + левој страни површи + + + + Right of desktop + десној страни површи + + + + Bottom of desktop + дну површи + + + + Top of desktop %1 + врху површи %1 + + + + Left of desktop %1 + левој страни површи %1 + + + + Right of desktop %1 + десној страни површи %1 + + + + Bottom of desktop %1 + дну површи %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Панел + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Add plugins ... + Додај модуле... + + + + LxQtPanelPlugin + + Configure + Подеси + + + Move + Помери + + + + LxQtPanelPrivate + + Configure panel + Подеси панел + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_th_TH.ts b/lxqt-panel/panel/translations/lxqt-panel_th_TH.ts new file mode 100644 index 0000000..fcd59a2 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_th_TH.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + ปรับแต่งพาเนล + + + Panel size + ขนาดพาเนล + + + Size: + ขนาด: + + + px + px + + + Use automatic sizing + ใช้การปรับขนาดอัตโนมัติ + + + Panel length && position + ความยาว && ตำแหน่งพาเนล + + + Left + ทางซ้าย + + + Center + ตรงกลาง + + + Right + ทางขวา + + + % + % + + + Alignment: + การจัดวาง: + + + Length: + ความยาว: + + + Position: + ตำแหน่ง: + + + Top of desktop + ด้านบนของหน้าจอ + + + Left of desktop + ด้านซ้ายของหน้าจอ + + + Right of desktop + ด้านขวาของหน้าจอ + + + Bottom of desktop + ด้านล่างของหน้าจอ + + + Top of desktop %1 + ด้านบนของหน้าจอ %1 + + + Left of desktop %1 + ด้านซ้ายของหน้าจอ %1 + + + Right of desktop %1 + ด้านขวาของหน้าจอ %1 + + + Bottom of desktop %1 + ด้านล่างของหน้าจอ %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + ปรับแต่งพาเนล + + + + Size + + + + + Size: + ขนาด: + + + + + px + + + + + Icon size: + + + + + Length: + ความยาว: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + ทางซ้าย + + + + + + Center + ตรงกลาง + + + + + Right + ทางขวา + + + + Alignment: + การจัดวาง: + + + + Position: + ตำแหน่ง: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + ด้านบนของหน้าจอ + + + + Left of desktop + ด้านซ้ายของหน้าจอ + + + + Right of desktop + ด้านขวาของหน้าจอ + + + + Bottom of desktop + ด้านล่างของหน้าจอ + + + + Top of desktop %1 + ด้านบนของหน้าจอ %1 + + + + Left of desktop %1 + ด้านซ้ายของหน้าจอ %1 + + + + Right of desktop %1 + ด้านขวาของหน้าจอ %1 + + + + Bottom of desktop %1 + ด้านล่างของหน้าจอ %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + พาเนล + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + ปรับแต่งพาเนล... + + + Add plugins ... + เพิ่มปลั๊กอิน + + + + LxQtPanelPlugin + + Configure + ปรับแต่ง + + + Move + ย้าย + + + Remove + ลบทิ้ง + + + + LxQtPanelPrivate + + Configure panel + ปรับแต่งพาเนล + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_tr.ts b/lxqt-panel/panel/translations/lxqt-panel_tr.ts new file mode 100644 index 0000000..fe15170 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_tr.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Paneli yapılandır + + + Panel size + Panel boyutu + + + Size: + Boyut: + + + px + px + + + Use automatic sizing + Otomatik boyutlandırmayı kullan + + + Panel length && position + Panel uzunluğu && konumu + + + Left + Sol + + + Center + Merkez + + + Right + Sağ + + + % + % + + + Alignment: + Yerleştirme: + + + Length: + Uzunluk: + + + Position: + Konum: + + + Top of desktop + Masasüstünün üst kısmı + + + Left of desktop + Masaüstünün sol kısmı + + + Right of desktop + Masaüstünün sağ kısmı + + + Bottom of desktop + Masaüstünün alt kısmı + + + Top of desktop %1 + Masaüstünün üst kısmı %1 + + + Left of desktop %1 + Masaüstünün sol kısmı %1 + + + Right of desktop %1 + Masaüstünün sağ kısmı %1 + + + Bottom of desktop %1 + Masaüstünün alt kısmı %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Paneli yapılandır + + + + Size + + + + + Size: + Boyut: + + + + + px + + + + + Icon size: + + + + + Length: + Uzunluk: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Sol + + + + + + Center + Merkez + + + + + Right + Sağ + + + + Alignment: + Yerleştirme: + + + + Position: + Konum: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Masasüstünün üst kısmı + + + + Left of desktop + Masaüstünün sol kısmı + + + + Right of desktop + Masaüstünün sağ kısmı + + + + Bottom of desktop + Masaüstünün alt kısmı + + + + Top of desktop %1 + Masaüstünün üst kısmı %1 + + + + Left of desktop %1 + Masaüstünün sol kısmı %1 + + + + Right of desktop %1 + Masaüstünün sağ kısmı %1 + + + + Bottom of desktop %1 + Masaüstünün alt kısmı %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Not Defteri + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Paneli yapılandır... + + + Add plugins ... + Eklenti ekle... + + + + LxQtPanelPlugin + + Configure + Yapılandır + + + Move + Taşı + + + Remove + Sil + + + + LxQtPanelPrivate + + Configure panel + Paneli yapılandır + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_uk.ts b/lxqt-panel/panel/translations/lxqt-panel_uk.ts new file mode 100644 index 0000000..30af3eb --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_uk.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + Налаштувати панель + + + Panel size + Розмір панелі + + + Size: + Розмір: + + + px + px + + + Use automatic sizing + Використовувати автоматичний розмір + + + Panel length && position + Довжина та місце панелі + + + Left + Зліва + + + Center + Посередині + + + Right + Справа + + + % + % + + + Alignment: + Вирівнювання: + + + Length: + Довжина: + + + Position: + Місце: + + + Top of desktop + Згори стільниці + + + Left of desktop + Зліва стільниці + + + Right of desktop + Справа стільниці + + + Bottom of desktop + Знизу стільниці + + + Top of desktop %1 + Згори стільниці %1 + + + Left of desktop %1 + Зліва стільниці %1 + + + Right of desktop %1 + Справа стільниці %1 + + + Bottom of desktop %1 + Знизу стільниці %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + Налаштувати панель + + + + Size + + + + + Size: + Розмір: + + + + + px + + + + + Icon size: + + + + + Length: + Довжина: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + Зліва + + + + + + Center + Посередині + + + + + Right + Справа + + + + Alignment: + Вирівнювання: + + + + Position: + Місце: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + Згори стільниці + + + + Left of desktop + Зліва стільниці + + + + Right of desktop + Справа стільниці + + + + Bottom of desktop + Знизу стільниці + + + + Top of desktop %1 + Згори стільниці %1 + + + + Left of desktop %1 + Зліва стільниці %1 + + + + Right of desktop %1 + Справа стільниці %1 + + + + Bottom of desktop %1 + Знизу стільниці %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + Панель + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + Налаштувати панель... + + + Add plugins ... + Додати плаґіни... + + + + LxQtPanelPlugin + + Configure + Налаштувати + + + Move + Пересунути + + + Remove + Вилучити + + + + LxQtPanelPrivate + + Configure panel + Налаштувати панель + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_zh_CN.ts b/lxqt-panel/panel/translations/lxqt-panel_zh_CN.ts new file mode 100644 index 0000000..8aa41d3 --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_zh_CN.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + 配置面板 + + + Panel size + 面板大小 + + + Size: + 大小: + + + px + px + + + Use automatic sizing + 使用自动缩放 + + + Panel length && position + 面板长度和位置 + + + Left + + + + Center + 居中 + + + Right + + + + % + % + + + Alignment: + 对齐: + + + Length: + 长度: + + + Position: + 位置: + + + Top of desktop + 桌面顶部 + + + Left of desktop + 桌面左侧 + + + Right of desktop + 桌面右侧 + + + Bottom of desktop + 桌面底部 + + + Top of desktop %1 + 桌面顶部 %1 + + + Left of desktop %1 + 桌面左侧 %1 + + + Right of desktop %1 + 左面右侧 %1 + + + Bottom of desktop %1 + 桌面底部 %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + 配置面板 + + + + Size + + + + + Size: + 大小: + + + + + px + + + + + Icon size: + + + + + Length: + 长度: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + + + + + + + Center + 居中 + + + + + Right + + + + + Alignment: + 对齐: + + + + Position: + 位置: + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + 桌面顶部 + + + + Left of desktop + 桌面左侧 + + + + Right of desktop + 桌面右侧 + + + + Bottom of desktop + 桌面底部 + + + + Top of desktop %1 + 桌面顶部 %1 + + + + Left of desktop %1 + 桌面左侧 %1 + + + + Right of desktop %1 + 左面右侧 %1 + + + + Bottom of desktop %1 + 桌面底部 %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + qxkb + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + 配置面板... + + + Add plugins ... + 添加插件 ... + + + + LxQtPanelPlugin + + Configure + 配置 + + + Move + 移动 + + + Remove + 删除 + + + + LxQtPanelPrivate + + Configure panel + 配置面板 + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/panel/translations/lxqt-panel_zh_TW.ts b/lxqt-panel/panel/translations/lxqt-panel_zh_TW.ts new file mode 100644 index 0000000..9c329bb --- /dev/null +++ b/lxqt-panel/panel/translations/lxqt-panel_zh_TW.ts @@ -0,0 +1,358 @@ + + + + + ConfigPanelDialog + + Configure panel + 設定面板 + + + Panel size + 面板尺寸 + + + Size: + 尺寸: + + + px + px + + + Use automatic sizing + 大小自動調整 + + + Panel length && position + 面板長度以及位置 + + + Left + 向左 + + + Center + 中間 + + + Right + 向右 + + + % + % + + + Alignment: + 對齊: + + + Length: + 長度: + + + Position: + 位置 : + + + Top of desktop + 桌面頂端 + + + Left of desktop + 桌面左方 + + + Right of desktop + 桌面右方 + + + Bottom of desktop + 桌面底端 + + + Top of desktop %1 + 桌面頂端 %1 + + + Left of desktop %1 + 桌面左方 %1 + + + Right of desktop %1 + 桌面右方 %1 + + + Bottom of desktop %1 + 桌面底端 %1 + + + + + Configure Panel + + + + + ConfigPanelWidget + + + Configure panel + 設定面板 + + + + Size + + + + + Size: + 尺寸: + + + + + px + + + + + Icon size: + + + + + Length: + 長度: + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + + + % + % + + + + px + px + + + + Rows count: + + + + + Alignment && position + + + + + + Left + 向左 + + + + + + Center + 中間 + + + + + Right + 向右 + + + + Alignment: + 對齊: + + + + Position: + 位置 : + + + + Auto-hide + + + + + Styling + + + + + Custom font color: + + + + + Custom background image: + + + + + Custom background color: + + + + + Opacity + + + + + Top of desktop + 桌面頂端 + + + + Left of desktop + 桌面左方 + + + + Right of desktop + 桌面右方 + + + + Bottom of desktop + 桌面底端 + + + + Top of desktop %1 + 桌面頂端 %1 + + + + Left of desktop %1 + 桌面左方 %1 + + + + Right of desktop %1 + 桌面右方 %1 + + + + Bottom of desktop %1 + 桌面底端 %1 + + + + Top + + + + + Bottom + + + + + + Pick color + + + + + Images (*.png *.gif *.jpg) + + + + + LxQtPanel + + + Add Panel Widgets + + + + + + Panel + LxQt滑鼠設定 + + + + Configure Panel... + + + + + Add Panel Widgets... + + + + + Add Panel + + + + + Remove Panel + + + + Configure panel... + 面板設定... + + + Add plugins ... + 新增外掛... + + + + LxQtPanelPlugin + + Configure + 設定 + + + Move + 移動 + + + Remove + 移除 + + + + LxQtPanelPrivate + + Configure panel + 設定面板 + + + + Plugin + + + Configure "%1" + + + + + Move "%1" + + + + + Remove "%1" + + + + diff --git a/lxqt-panel/plugin-clock/CMakeLists.txt b/lxqt-panel/plugin-clock/CMakeLists.txt new file mode 100644 index 0000000..d044761 --- /dev/null +++ b/lxqt-panel/plugin-clock/CMakeLists.txt @@ -0,0 +1,19 @@ +set(PLUGIN "clock") + +set(HEADERS + lxqtclock.h + lxqtclockconfiguration.h + calendarpopup.h +) + +set(SOURCES + lxqtclock.cpp + lxqtclockconfiguration.cpp + calendarpopup.cpp +) + +set(UIS + lxqtclockconfiguration.ui +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-clock/calendarpopup.cpp b/lxqt-panel/plugin-clock/calendarpopup.cpp new file mode 100644 index 0000000..6866302 --- /dev/null +++ b/lxqt-panel/plugin-clock/calendarpopup.cpp @@ -0,0 +1,65 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2014 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "calendarpopup.h" +#include +#include + +CalendarPopup::CalendarPopup(QWidget *parent): + QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) +{ + setLayout(new QHBoxLayout(this)); + layout()->setMargin(1); + + cal = new QCalendarWidget(this); + layout()->addWidget(cal); + adjustSize(); +} + +CalendarPopup::~CalendarPopup() +{ +} + +void CalendarPopup::show() +{ + cal->setSelectedDate(QDate::currentDate()); + activateWindow(); + QDialog::show(); +} + +bool CalendarPopup::event(QEvent *event) +{ + if (event->type() == QEvent::WindowDeactivate) + hide(); + + return QDialog::event(event); +} + +void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday) +{ + cal->setFirstDayOfWeek(wday); +} diff --git a/lxqt-panel/plugin-clock/calendarpopup.h b/lxqt-panel/plugin-clock/calendarpopup.h new file mode 100644 index 0000000..cf52392 --- /dev/null +++ b/lxqt-panel/plugin-clock/calendarpopup.h @@ -0,0 +1,52 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2014 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CALENDARPOPUP_H +#define CALENDARPOPUP_H + +#include +#include + +class CalendarPopup : public QDialog +{ + Q_OBJECT + +public: + CalendarPopup(QWidget *parent = 0); + ~CalendarPopup(); + void setFirstDayOfWeek(Qt::DayOfWeek wday); + + void show(); + +protected: + virtual bool event(QEvent* ); + +private: + QCalendarWidget *cal; +}; + +#endif // CALENDARPOPUP_H diff --git a/lxqt-panel/plugin-clock/lxqtclock.cpp b/lxqt-panel/plugin-clock/lxqtclock.cpp new file mode 100644 index 0000000..47bc42f --- /dev/null +++ b/lxqt-panel/plugin-clock/lxqtclock.cpp @@ -0,0 +1,313 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2013 Razor team + * Authors: + * Christopher "VdoP" Regali + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtclock.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +/** + * @file lxqtclock.cpp + * @brief implements LxQtclock and LxQtclockgui + * @author Christopher "VdoP" Regali + * @author Kuzma Shapran + */ + +class DownscaleFontStyle : public QProxyStyle +{ + using QProxyStyle::QProxyStyle; +public: + + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override + { + while (1 < painter->font().pointSize() + && !(rect.size() - painter->fontMetrics().boundingRect(text).size()).isValid()) + { + QFont f{painter->font()}; + f.setPointSize(f.pointSize() - 1); + painter->setFont(f); + } + return QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } +}; + +/** + * @brief constructor + */ +LxQtClock::LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mAutoRotate(true), + mTextStyle{new DownscaleFontStyle}, + mCurrentCharCount(0) +{ + mMainWidget = new QWidget(); + mRotatedWidget = new LxQt::RotatedWidget(*(new QWidget()), mMainWidget); + mContent = mRotatedWidget->content(); + mContent->setStyle(mTextStyle.data()); + mTimeLabel = new QLabel(mContent); + mDateLabel = new QLabel(mContent); + + QVBoxLayout *borderLayout = new QVBoxLayout(mMainWidget); + borderLayout->setContentsMargins(0, 0, 0, 0); + borderLayout->setSpacing(0); + borderLayout->addWidget(mRotatedWidget, 0, Qt::AlignCenter); + + mTimeLabel->setObjectName("TimeLabel"); + mDateLabel->setObjectName("DateLabel"); + + mTimeLabel->setAlignment(Qt::AlignCenter); + mDateLabel->setAlignment(Qt::AlignCenter); + + mContent->setLayout(new QVBoxLayout{mContent}); + mContent->layout()->setContentsMargins(0, 0, 0, 0); + mContent->layout()->setSpacing(0); + mContent->layout()->addWidget(mTimeLabel); + mContent->layout()->addWidget(mDateLabel); + + mClockTimer = new QTimer(this); + mClockTimer->setTimerType(Qt::PreciseTimer); + connect (mClockTimer, SIGNAL(timeout()), SLOT(updateTime())); + + mClockFormat = "hh:mm"; + + mCalendarPopup = new CalendarPopup(mContent); + + mMainWidget->installEventFilter(this); + settingsChanged(); +} + +/** + * @brief destructor + */ +LxQtClock::~LxQtClock() +{ + delete mMainWidget; +} + +QDateTime LxQtClock::currentDateTime() +{ + return QDateTime(mUseUTC ? QDateTime::currentDateTimeUtc() : QDateTime::currentDateTime()); +} + +/** + * @brief updates the time + * Color and font settings can be configured in Qt CSS + */ +void LxQtClock::updateTime() +{ + //XXX: do we need this with PreciseTimer ? + if (currentDateTime().time().msec() > 500) + restartTimer(); + + showTime(); +} + +void LxQtClock::showTime() +{ + QDateTime now{currentDateTime()}; + int new_char_count; + if (mDateOnNewLine) + { + QString new_time = QLocale::system().toString(now, mTimeFormat); + QString new_date = QLocale::system().toString(now, mDateFormat); + new_char_count = qMax(new_time.size(), new_date.size()); + mTimeLabel->setText(new_time); + mDateLabel->setText(new_date); + } + else + { + QString new_time = QLocale::system().toString(now, mClockFormat); + new_char_count = new_time.size(); + mTimeLabel->setText(new_time); + } + + if (mCurrentCharCount != new_char_count) + { + mCurrentCharCount = new_char_count; + realign(); + } +} + +void LxQtClock::restartTimer() +{ + if (mClockTimer->isActive()) + mClockTimer->stop(); + int updateInterval = mClockTimer->interval(); + QDateTime now{currentDateTime()}; + int delay = updateInterval - ((now.time().msec() + now.time().second() * 1000) % updateInterval); + QTimer::singleShot(delay, Qt::PreciseTimer, mClockTimer, SLOT(start())); + QTimer::singleShot(delay, Qt::PreciseTimer, this, SLOT(updateTime())); +} + +void LxQtClock::settingsChanged() +{ + mFirstDayOfWeek = settings()->value("firstDayOfWeek", -1).toInt(); + if (-1 == mFirstDayOfWeek) + mCalendarPopup->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); + else + mCalendarPopup->setFirstDayOfWeek(static_cast(mFirstDayOfWeek)); + + mTimeFormat = settings()->value("timeFormat", QLocale::system().timeFormat(QLocale::ShortFormat).toUpper().contains("AP") ? "h:mm AP" : "HH:mm").toString(); + + mUseUTC = settings()->value("UTC", false).toBool(); + if (mUseUTC) + mTimeFormat += "' Z'"; + + mDateFormat = settings()->value("dateFormat", Qt::SystemLocaleShortDate).toString(); + + bool dateBeforeTime = (settings()->value("showDate", "no").toString().toLower() == "before"); + bool dateAfterTime = (settings()->value("showDate", "no").toString().toLower() == "after"); + mDateOnNewLine = (settings()->value("showDate", "no").toString().toLower() == "below"); + + mAutoRotate = settings()->value("autoRotate", true).toBool(); + + if (dateBeforeTime) + mClockFormat = QString("%1 %2").arg(mDateFormat).arg(mTimeFormat); + else if (dateAfterTime) + mClockFormat = QString("%1 %2").arg(mTimeFormat).arg(mDateFormat); + else + mClockFormat = mTimeFormat; + + mDateLabel->setHidden(!mDateOnNewLine); + + // mDateFormat usually does not contain time portion, but since it's possible to use custom date format - it has to be supported. [Kuzma Shapran] + int updateInterval = QString(mTimeFormat + " " + mDateFormat).replace(QRegExp("'[^']*'"),"").contains("s") ? 1000 : 60000; + + QDateTime now = currentDateTime(); + + showTime(); + + if (mClockTimer->interval() != updateInterval) + { + mClockTimer->setInterval(updateInterval); + + restartTimer(); + } +} + +void LxQtClock::realign() +{ + QSize size{QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}; + Qt::Corner origin = Qt::TopLeftCorner; + if (mAutoRotate || panel()->isHorizontal()) + { + switch (panel()->position()) + { + case ILxQtPanel::PositionTop: + case ILxQtPanel::PositionBottom: + origin = Qt::TopLeftCorner; + break; + + case ILxQtPanel::PositionLeft: + origin = Qt::BottomLeftCorner; + break; + + case ILxQtPanel::PositionRight: + origin = Qt::TopRightCorner; + break; + } + + //set minwidth + QFontMetrics metrics{mTimeLabel->font()}; + //Note: using a constant string of reasonably wide characters for computing the width + // (not the current text as width of text can differ for each particular string (based on font)) + size.setWidth(metrics.boundingRect(QString{mCurrentCharCount, 'A'}).width()); + } else if (!panel()->isHorizontal()) + { + size.setWidth(panel()->globalGometry().width()); + } + + mTimeLabel->setFixedWidth(size.width()); + mDateLabel->setFixedWidth(size.width()); + + int label_height = mTimeLabel->sizeHint().height(); + size.setHeight(mDateOnNewLine ? label_height * 2 : label_height); + + const bool changed = mContent->maximumSize() != size || mRotatedWidget->origin() != origin; + + mContent->setFixedSize(size); + mRotatedWidget->setOrigin(origin); + + if (changed) + { + mRotatedWidget->adjustContentSize(); + mRotatedWidget->update(); + } +} + +void LxQtClock::activated(ActivationReason reason) +{ + if (reason != ILxQtPanelPlugin::Trigger) + return; + + if (!mCalendarPopup->isVisible()) + { + QRect pos = calculatePopupWindowPos(mCalendarPopup->size()); + mCalendarPopup->move(pos.topLeft()); + mCalendarPopup->show(); + } + else + { + mCalendarPopup->hide(); + } +} + +QDialog * LxQtClock::configureDialog() +{ + return new LxQtClockConfiguration(*settings()); +} + +bool LxQtClock::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == mMainWidget) + { + if (event->type() == QEvent::ToolTip) + mMainWidget->setToolTip(QDateTime::currentDateTime().toString(Qt::DefaultLocaleLongDate)); + + return false; + } + + return false; +} diff --git a/lxqt-panel/plugin-clock/lxqtclock.h b/lxqt-panel/plugin-clock/lxqtclock.h new file mode 100644 index 0000000..b3ac0b7 --- /dev/null +++ b/lxqt-panel/plugin-clock/lxqtclock.h @@ -0,0 +1,105 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2013 Razor team + * Authors: + * Christopher "VdoP" Regali + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTCLOCK_H +#define LXQTCLOCK_H + +#include "../panel/ilxqtpanelplugin.h" +#include "lxqtclockconfiguration.h" +#include "calendarpopup.h" +#include + +#include + +class QLabel; +class QDialog; +class QTimer; +class QProxyStyle; + +class LxQtClock : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtClock(); + + virtual Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } + QString themeId() const { return "Clock"; } + QWidget *widget() { return mMainWidget; } + QDialog *configureDialog(); + void settingsChanged(); + + void activated(ActivationReason reason); + bool isSeparate() const { return true; } + + void realign(); + +public slots: + void updateTime(); + +protected: + bool eventFilter(QObject *watched, QEvent *event); + +private: + QTimer* mClockTimer; + QWidget *mMainWidget; + QWidget *mContent; + LxQt::RotatedWidget* mRotatedWidget; + QLabel* mTimeLabel; + QLabel* mDateLabel; + QString mClockFormat; + QString mToolTipFormat; + CalendarPopup* mCalendarPopup; + QString mTimeFormat; + QString mDateFormat; + bool mDateOnNewLine; + bool mUseUTC; + int mFirstDayOfWeek; + bool mAutoRotate; + QScopedPointer mTextStyle; + int mCurrentCharCount; + + QDateTime currentDateTime(); + void showTime(); + void restartTimer(); +}; + + +class LxQtClockPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtClock(startupInfo);} +}; + + +#endif diff --git a/lxqt-panel/plugin-clock/lxqtclockconfiguration.cpp b/lxqt-panel/plugin-clock/lxqtclockconfiguration.cpp new file mode 100644 index 0000000..ef401a3 --- /dev/null +++ b/lxqt-panel/plugin-clock/lxqtclockconfiguration.cpp @@ -0,0 +1,317 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include +#include +#include + +#include "lxqtclockconfiguration.h" +#include "ui_lxqtclockconfiguration.h" + + +namespace +{ + class FirstDayCombo : public QStandardItemModel + { + public: + FirstDayCombo() + { + QStandardItem* item = 0; + int row = 0; + item = new QStandardItem; + item->setData(-1, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(tr(""), Qt::DisplayRole); + setItem(row, 1, item); + ++row; + for (int wday = Qt::Monday; Qt::Sunday >= wday; ++wday, ++row) + { + item = new QStandardItem; + item->setData(wday, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(QLocale::system().dayName(wday), Qt::DisplayRole); + setItem(row, 1, item); + } + } + + int findIndex(int wday) + { + int i = rowCount() - 1; + for ( ; 0 <= i; --i) + { + if (item(i)->data(Qt::UserRole).toInt() == wday) + break; + } + return i; + } + + }; +} + +LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtClockConfiguration), + mSettings(settings), + oldSettings(settings), + mOldIndex(1) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("ClockConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + + ui->firstDayOfWeekCB->setModel(new FirstDayCombo); + ui->firstDayOfWeekCB->setModelColumn(1); + + loadSettings(); + /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly + change of state */ + + connect(ui->dateFormatCOB, SIGNAL(activated(int)), SLOT(dateFormatActivated(int))); + + connect(ui->showSecondsCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->ampmClockCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->useUtcCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->dontShowDateRB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->showDateBeforeTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->showDateAfterTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->showDateBelowTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); + + connect(ui->autorotateCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->firstDayOfWeekCB, SIGNAL(activated(int)), SLOT(saveSettings())); +} + +LxQtClockConfiguration::~LxQtClockConfiguration() +{ + delete ui; +} + +static int currentYear = QDate::currentDate().year(); + +void LxQtClockConfiguration::addDateFormat(const QString &format) +{ + if (ui->dateFormatCOB->findData(QVariant(format)) == -1) + ui->dateFormatCOB->addItem(QDate(currentYear, 1, 1).toString(format), QVariant(format)); +} + +void LxQtClockConfiguration::createDateFormats() +{ + ui->dateFormatCOB->clear(); + + QString systemDateLocale = QLocale::system().dateFormat(QLocale::ShortFormat).toUpper(); + + if (systemDateLocale.indexOf("Y") < systemDateLocale.indexOf("D")) + // Big-endian (year, month, day) -> in some Asia countires like China or Japan + { + addDateFormat("MMM d"); + addDateFormat("MMMM d"); + addDateFormat("MMM d, ddd"); + addDateFormat("MMMM d, dddd"); + addDateFormat("yyyy MMM d"); + addDateFormat("yyyy MMMM d"); + addDateFormat("yyyy MMM d, ddd"); + addDateFormat("yyyy MMMM d, dddd"); + addDateFormat("MMM dd"); + addDateFormat("MMMM dd"); + addDateFormat("MMM dd, ddd"); + addDateFormat("MMMM dd, dddd"); + addDateFormat("yyyy MMM dd"); + addDateFormat("yyyy MMMM dd"); + addDateFormat("yyyy MMM dd, ddd"); + addDateFormat("yyyy MMMM dd, dddd"); + } + else if (systemDateLocale.indexOf("M") < systemDateLocale.indexOf("D")) + // Middle-endian (month, day, year) -> USA + { + addDateFormat("MMM d"); + addDateFormat("MMMM d"); + addDateFormat("ddd, MMM d"); + addDateFormat("dddd, MMMM d"); + addDateFormat("MMM d yyyy"); + addDateFormat("MMMM d yyyy"); + addDateFormat("ddd, MMM d yyyy"); + addDateFormat("dddd, MMMM d yyyy"); + addDateFormat("MMM dd"); + addDateFormat("MMMM dd"); + addDateFormat("ddd, MMM dd"); + addDateFormat("dddd, MMMM dd"); + addDateFormat("MMM dd yyyy"); + addDateFormat("MMMM dd yyyy"); + addDateFormat("ddd, MMM dd yyyy"); + addDateFormat("dddd, MMMM dd yyyy"); + } + else + // Little-endian (day, month, year) -> most of Europe + { + addDateFormat("d MMM"); + addDateFormat("d MMMM"); + addDateFormat("ddd, d MMM"); + addDateFormat("dddd, d MMMM"); + addDateFormat("d MMM yyyy"); + addDateFormat("d MMMM yyyy"); + addDateFormat("ddd, d MMM yyyy"); + addDateFormat("dddd, d MMMM yyyy"); + addDateFormat("dd MMM"); + addDateFormat("dd MMMM"); + addDateFormat("ddd, dd MMM"); + addDateFormat("dddd, dd MMMM"); + addDateFormat("dd MMM yyyy"); + addDateFormat("dd MMMM yyyy"); + addDateFormat("ddd, dd MMM yyyy"); + addDateFormat("dddd, dd MMMM yyyy"); + } + + addDateFormat(QLocale::system().dateFormat(QLocale::ShortFormat)); + addDateFormat(QLocale::system().dateFormat(QLocale::LongFormat)); + + addDateFormat("yyyy-MM-dd"); // ISO + + if (mCustomDateFormat.isEmpty()) + ui->dateFormatCOB->addItem("Custom ...", QVariant(mCustomDateFormat)); + else + ui->dateFormatCOB->addItem(QString("Custom (%1) ...").arg(QDate(currentYear, 1, 1).toString(mCustomDateFormat)), QVariant(mCustomDateFormat)); +} + +void LxQtClockConfiguration::loadSettings() +{ + QString systemDateLocale = QLocale::system().dateFormat(QLocale::ShortFormat).toUpper(); + QString systemTimeLocale = QLocale::system().timeFormat(QLocale::ShortFormat).toUpper(); + + QString timeFormat = mSettings.value("timeFormat", systemTimeLocale.contains("AP") ? "h:mm AP" : "HH:mm").toString(); + + ui->showSecondsCB->setChecked(timeFormat.indexOf("ss") > -1); + + ui->ampmClockCB->setChecked(timeFormat.toUpper().indexOf("AP") > -1); + + ui->useUtcCB->setChecked(mSettings.value("UTC", false).toBool()); + + ui->dontShowDateRB->setChecked(true); + ui->showDateBeforeTimeRB->setChecked(mSettings.value("showDate", "no").toString().toLower() == "before"); + ui->showDateAfterTimeRB->setChecked(mSettings.value("showDate", "no").toString().toLower() == "after"); + ui->showDateBelowTimeRB->setChecked(mSettings.value("showDate", "no").toString().toLower() == "below"); + + mCustomDateFormat = mSettings.value("customDateFormat", QString()).toString(); + QString dateFormat = mSettings.value("dateFormat", QLocale::system().dateFormat(QLocale::ShortFormat)).toString(); + + createDateFormats(); + + if (mCustomDateFormat == dateFormat) + ui->dateFormatCOB->setCurrentIndex(ui->dateFormatCOB->count() - 1); + else + { + ui->dateFormatCOB->setCurrentIndex(ui->dateFormatCOB->findData(dateFormat)); + if (ui->dateFormatCOB->currentIndex() < 0) + ui->dateFormatCOB->setCurrentIndex(1); + } + mOldIndex = ui->dateFormatCOB->currentIndex(); + + ui->autorotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); + ui->firstDayOfWeekCB->setCurrentIndex(dynamic_cast(*(ui->firstDayOfWeekCB->model())).findIndex(mSettings.value("firstDayOfWeek", -1).toInt())); +} + +void LxQtClockConfiguration::saveSettings() +{ + QString timeFormat(ui->ampmClockCB->isChecked() ? "h:mm AP" : "HH:mm"); + + if (ui->showSecondsCB->isChecked()) + timeFormat.insert(timeFormat.indexOf("mm") + 2, ":ss"); + + mSettings.setValue("timeFormat", timeFormat); + + mSettings.setValue("UTC", ui->useUtcCB->isChecked()); + + mSettings.setValue("showDate", + ui->showDateBeforeTimeRB->isChecked() ? "before" : + (ui->showDateAfterTimeRB->isChecked() ? "after" : + (ui->showDateBelowTimeRB->isChecked() ? "below" : "no" ))); + + mSettings.setValue("customDateFormat", mCustomDateFormat); + if (ui->dateFormatCOB->currentIndex() == (ui->dateFormatCOB->count() - 1)) + mSettings.setValue("dateFormat", mCustomDateFormat); + else + mSettings.setValue("dateFormat", ui->dateFormatCOB->itemData(ui->dateFormatCOB->currentIndex())); + + mSettings.setValue("autoRotate", ui->autorotateCB->isChecked()); + mSettings.setValue("firstDayOfWeek", dynamic_cast(*ui->firstDayOfWeekCB->model()).item(ui->firstDayOfWeekCB->currentIndex(), 0)->data(Qt::UserRole)); +} + +void LxQtClockConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + oldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + +void LxQtClockConfiguration::dateFormatActivated(int index) +{ + if (index == ui->dateFormatCOB->count() - 1) + { + bool ok; + QString newCustomDateFormat = QInputDialog::getText(this, tr("Input custom date format"), tr( + "Interpreted sequences of date format are:\n" + "\n" + "d\tthe day as number without a leading zero (1 to 31)\n" + "dd\tthe day as number with a leading zero (01 to 31)\n" + "ddd\tthe abbreviated localized day name (e.g. 'Mon' to 'Sun').\n" + "dddd\tthe long localized day name (e.g. 'Monday' to 'Sunday').\n" + "M\tthe month as number without a leading zero (1-12)\n" + "MM\tthe month as number with a leading zero (01-12)\n" + "MMM\tthe abbreviated localized month name (e.g. 'Jan' to 'Dec').\n" + "MMMM\tthe long localized month name (e.g. 'January' to 'December').\n" + "yy\tthe year as two digit number (00-99)\n" + "yyyy\tthe year as four digit number\n" + "\n" + "All other input characters will be treated as text.\n" + "Any sequence of characters that are enclosed in single quotes (')\n" + "will also be treated as text and not be used as an expression.\n" + "\n" + "\n" + "Custom date format:" + ), QLineEdit::Normal, mCustomDateFormat, &ok); + if (ok) + { + mCustomDateFormat = newCustomDateFormat; + mOldIndex = index; + createDateFormats(); + } + ui->dateFormatCOB->setCurrentIndex(mOldIndex); + } + else + mOldIndex = index; + + saveSettings(); +} diff --git a/lxqt-panel/plugin-clock/lxqtclockconfiguration.h b/lxqt-panel/plugin-clock/lxqtclockconfiguration.h new file mode 100644 index 0000000..96e508d --- /dev/null +++ b/lxqt-panel/plugin-clock/lxqtclockconfiguration.h @@ -0,0 +1,82 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTCLOCKCONFIGURATION_H +#define LXQTCLOCKCONFIGURATION_H + +#include +#include +#include +#include +#include + +#include + +namespace Ui { + class LxQtClockConfiguration; +} + +class LxQtClockConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtClockConfiguration(QSettings &settings, QWidget *parent = 0); + ~LxQtClockConfiguration(); + +private: + Ui::LxQtClockConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache oldSettings; + + /* + Read settings from conf file and put data into controls. + */ + void loadSettings(); + + /* + Creates a date formats consistent with the region read from locale. + */ + void createDateFormats(); + +private slots: + /* + Saves settings in conf file. + */ + void saveSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void dateFormatActivated(int); + +private: + int mOldIndex; + QString mCustomDateFormat; + + void addDateFormat(const QString &format); +}; + +#endif // LXQTCLOCKCONFIGURATION_H diff --git a/lxqt-panel/plugin-clock/lxqtclockconfiguration.ui b/lxqt-panel/plugin-clock/lxqtclockconfiguration.ui new file mode 100644 index 0000000..2eb731e --- /dev/null +++ b/lxqt-panel/plugin-clock/lxqtclockconfiguration.ui @@ -0,0 +1,232 @@ + + + LxQtClockConfiguration + + + + 0 + 0 + 330 + 447 + + + + Clock Settings + + + + + + Time + + + + + + &Show seconds + + + + + + + 12 &hour style + + + + + + + &Use UTC + + + + + + + + + + Date + + + + + + false + + + Date &format + + + dateFormatCOB + + + + + + + false + + + + + + + &Do not show date + + + true + + + + + + + Show date &before time + + + + + + + Show date &after time + + + + + + + Show date below time on new &line + + + + + + + First day of week in calendar + + + firstDayOfWeekCB + + + + + + + + + + + + + + Orientation + + + + + + Auto&rotate when the panel is vertical + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + LxQtClockConfiguration + accept() + + + 214 + 350 + + + 157 + 274 + + + + + buttons + rejected() + LxQtClockConfiguration + reject() + + + 214 + 350 + + + 196 + 274 + + + + + dontShowDateRB + toggled(bool) + dateFormatL + setDisabled(bool) + + + 68 + 166 + + + 63 + 267 + + + + + dontShowDateRB + toggled(bool) + dateFormatCOB + setDisabled(bool) + + + 174 + 167 + + + 239 + 275 + + + + + diff --git a/lxqt-panel/plugin-clock/resources/clock.desktop.in b/lxqt-panel/plugin-clock/resources/clock.desktop.in new file mode 100644 index 0000000..6c9cb32 --- /dev/null +++ b/lxqt-panel/plugin-clock/resources/clock.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. +Icon=preferences-system-time + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-clock/translations/clock.ts b/lxqt-panel/plugin-clock/translations/clock.ts new file mode 100644 index 0000000..7914ecd --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock.ts @@ -0,0 +1,113 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + + + + + Time + + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + + + + + Date &format + + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ar.desktop b/lxqt-panel/plugin-clock/translations/clock_ar.desktop new file mode 100644 index 0000000..92f15ce --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=السَّاعة والتَّقويم +Name[ar]=السَّاعة diff --git a/lxqt-panel/plugin-clock/translations/clock_ar.ts b/lxqt-panel/plugin-clock/translations/clock_ar.ts new file mode 100644 index 0000000..1086869 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ar.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + إعدادات ساعة ريزر + + + + Clock Settings + + + + + Time + الوقت + + + + &Show seconds + إ&ظهار الثَّواني + + + + 12 &hour style + عرض 12 سا&عة + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + ال&خطُّ + + + Font + الخطُّ + + + + Date + التَّاريخ + + + Show &date + إظهار ال&تَّاريخ + + + D&ate format + تنسيق التَّ&أريخ + + + Fon&t + الخ&طُّ + + + Show date in &new line + إظهار التَّارخ في سطرٍ &جديدٍ + + + &Use theme fonts + استخد&م خطوط الواجهة المخصَّصة + + + Time font + الخطُّ المستخدم للوقت + + + Date font + الخطُّ المستخدم للتَّاريخ + + + Ultra light + فاتحٌ زيادة + + + Light + فاتح + + + Ultra black + أسود دامس + + + Black + أسود + + + Bold + ثخين + + + Demi bold + نصف ثخين + + + Italic + مائل + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/plugin-clock/translations/clock_de_DE.desktop b/lxqt-panel/plugin-clock/translations/clock_cs.desktop similarity index 79% rename from plugin-clock/translations/clock_de_DE.desktop rename to lxqt-panel/plugin-clock/translations/clock_cs.desktop index ee59172..47cf14a 100644 --- a/plugin-clock/translations/clock_de_DE.desktop +++ b/lxqt-panel/plugin-clock/translations/clock_cs.desktop @@ -8,5 +8,5 @@ Comment=Displays the current time. Comes with a calendar. # Translations -Comment[de_DE]=Uhr und Kalender -Name[de_DE]=Uhr +Comment[cs]=Hodiny a kalendář +Name[cs]=Hodiny diff --git a/lxqt-panel/plugin-clock/translations/clock_cs.ts b/lxqt-panel/plugin-clock/translations/clock_cs.ts new file mode 100644 index 0000000..4841169 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_cs.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Nastavení hodin + + + + Clock Settings + + + + + Time + Čas + + + + &Show seconds + &Ukázat sekundy + + + + 12 &hour style + 12 &hodinový styl + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Písmo + + + Font + Písmo + + + + Date + Datum + + + Show &date + Ukázat &datum + + + D&ate format + Formát d&ata + + + Fon&t + Pí&smo + + + Show date in &new line + Ukázat datum na &novém řádku + + + &Use theme fonts + &Použít písma motivu + + + Time font + Písmo pro čas + + + Date font + Písmo pro datum + + + Ultra light + Hodně světlé + + + Light + Světlé + + + Ultra black + Hodně černé + + + Black + Černé + + + Bold + Tučné + + + Demi bold + Polotučné + + + Italic + Kurzíva + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_cs_CZ.desktop b/lxqt-panel/plugin-clock/translations/clock_cs_CZ.desktop new file mode 100644 index 0000000..186125e --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Hodiny a kalendář +Name[cs_CZ]=Hodiny diff --git a/lxqt-panel/plugin-clock/translations/clock_cs_CZ.ts b/lxqt-panel/plugin-clock/translations/clock_cs_CZ.ts new file mode 100644 index 0000000..42c09e5 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_cs_CZ.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Nastavení hodin + + + + Clock Settings + + + + + Time + Čas + + + + &Show seconds + &Ukázat sekundy + + + + 12 &hour style + 12 &hodinový styl + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Písmo + + + Font + Písmo + + + + Date + Datum + + + Show &date + Ukázat &datum + + + D&ate format + Formát d&ata + + + Fon&t + Pí&smo + + + Show date in &new line + Ukázat datum na &novém řádku + + + &Use theme fonts + &Použít písma motivu + + + Time font + Písmo pro čas + + + Date font + Písmo pro datum + + + Ultra light + Hodně světlé + + + Light + Světlé + + + Ultra black + Hodně černé + + + Black + Černé + + + Bold + Tučné + + + Demi bold + Polotučné + + + Italic + Kurzíva + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_da.desktop b/lxqt-panel/plugin-clock/translations/clock_da.desktop new file mode 100644 index 0000000..297c3d5 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Ur og kalender +Name[da]=Ur diff --git a/lxqt-panel/plugin-clock/translations/clock_da.ts b/lxqt-panel/plugin-clock/translations/clock_da.ts new file mode 100644 index 0000000..3a5030c --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_da.ts @@ -0,0 +1,137 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LXQt Ur-Indstillinger + + + + Clock Settings + + + + + Time + Tid + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + Show seconds + Vis sekunder + + + 12 hour style + 12 timers visning + + + + Date + Dato + + + Show date + Vis dato + + + Show date in new line + Vis dato i ny linie + + + Date format + Datoformat + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_da_DK.desktop b/lxqt-panel/plugin-clock/translations/clock_da_DK.desktop new file mode 100644 index 0000000..b9b678a --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Ur og kalender +Name[da_DK]=Ur diff --git a/plugin-clock/translations/clock_de_DE.ts b/lxqt-panel/plugin-clock/translations/clock_da_DK.ts similarity index 73% rename from plugin-clock/translations/clock_de_DE.ts rename to lxqt-panel/plugin-clock/translations/clock_da_DK.ts index e211e6e..3c6ef0e 100644 --- a/plugin-clock/translations/clock_de_DE.ts +++ b/lxqt-panel/plugin-clock/translations/clock_da_DK.ts @@ -1,11 +1,19 @@ - + + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration LxQt Clock Settings - LxQt-Uhr Einstellungen + LxQt Urindstillinger @@ -15,17 +23,17 @@ Time - Zeit + Tid &Show seconds - &Sekunden anzeigen + Vis &sekunder 12 &hour style - 12 Stunden U&hr-Stil + 12 &timers ur @@ -58,91 +66,96 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical &Font - &Font + Skri&fttype Font - Schriftart + Skrifttype Date - Datum + Dato Show &date - Zeige &Datum + Vis &dato D&ate format - D&atumsformat + D&atoformat Fon&t - Schriftar&t + Skrif&ttype Show date in &new line - Datum in &neuer Zeile zeigen + Vis dato i &ny linie &Use theme fonts - Ben&utze System-Schriftart + Br&ug temaskrifttyper Time font - Zeit Schriftart + Dato skrifttype Date font - Datum Schriftart + Dato skrifttype Ultra light - Ultra light + Ultralyst Light - Light + Lyst Ultra black - Ultra schwarz + Ultramørkt Black - Schwarz + Mørkt Bold - Fett + Fed Demi bold - Halbfett + Halvfed Italic Kursiv - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/lxqt-panel/plugin-clock/translations/clock_de.desktop b/lxqt-panel/plugin-clock/translations/clock_de.desktop new file mode 100644 index 0000000..f24f08e --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Uhr und Kalender +Comment[de]=Zeigt die aktuelle Uhrzeit. Ein Kalender ist auch enthalten. diff --git a/lxqt-panel/plugin-clock/translations/clock_de.ts b/lxqt-panel/plugin-clock/translations/clock_de.ts new file mode 100644 index 0000000..af939b0 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_de.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + <Basierend auf lokale Datumseinstellungen> + + + + LxQtClockConfiguration + + + Clock Settings + Uhr-Einstellungen + + + + Time + Zeit + + + + &Show seconds + &Sekunden anzeigen + + + + 12 &hour style + 12 Stunden U&hr-Stil + + + + &Use UTC + &UTC verwenden + + + + Date + Datum + + + + Date &format + Datums&format + + + + &Do not show date + &Datum nicht anzeigen + + + + Show date &before time + Datum &vor Zeit anzeigen + + + + Show date &after time + Datum hinter Uhrzeit &anzeigen + + + + Show date below time on new &line + Datum unterha&lb Uhrzeit anzeigen + + + + First day of week in calendar + Erster Wochentag im Kalender + + + + Orientation + Ausrichtung + + + + Auto&rotate when the panel is vertical + Automatisch d&rehen bei vertikaler Leiste + + + + Input custom date format + Eigenes Datumsformat + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Interpretierte Datumsformatsequenzen sind: + +d Tag als Zahl ohne führende Null (1 bis 31) +dd Tag als Zahl mit führender Null (01 bis 31) +ddd abgekürzter lokalisierter Tagesname (d.h. 'Mon' bis 'Son'). +dddd ganzer lokalisierter Tagesname (d.h. 'Montag' bis 'Sonntag'). +M Monat als Zahl ohne führende Null (1-12) +MM Monat als Zahl mit führender Null (01-12) +MMM abgekürzter lokalisierter Monatsname (d.h. 'Jan' bis 'Dez'). +MMMM ganzer lokalisierter Monatsname (d.h. 'Januar' bis 'Dezember'). +yy Jahr als zweistellige Zahl (00-99) +yyyy Jahr als vierstellige Zahl + +Alle anderen Zeichen werden als Text behandelt. +Jede Zeichenfolge, die in einfachen Hochkommas eingeschlossen ist ('), +wird ebenfalls als Text behandelt und nicht als Ausdruck benutzt. + + +Eigenes Datumsformat: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_el_GR.desktop b/lxqt-panel/plugin-clock/translations/clock_el_GR.desktop new file mode 100644 index 0000000..6d41201 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Ρολόι και ημερολόγιο +Name[el_GR]=Ρολόι diff --git a/lxqt-panel/plugin-clock/translations/clock_el_GR.ts b/lxqt-panel/plugin-clock/translations/clock_el_GR.ts new file mode 100644 index 0000000..c549c03 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_el_GR.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Ρυθμίσεις ρολογιού LxQt + + + + Clock Settings + + + + + Time + Ώρα + + + + &Show seconds + Εμ&φάνιση δευτερολέπτων + + + + 12 &hour style + 12 &ωρη μορφή + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Γραμματοσειρά + + + Font + Γραμματοσειρά + + + + Date + Ημερομηνία + + + Show &date + Εμφάνιση &ημερομηνίας + + + D&ate format + Μορφή η&μερομηνίας + + + Fon&t + Γρ&αμματοσειρά + + + Show date in &new line + Εμφάνιση ημερομηνίας σε &νέα γραμμή + + + &Use theme fonts + Χρήση γραμματοσειρών &θέματος + + + Time font + Γραμματοσειρά ώρας + + + Date font + Γραμματοσειρά ημερομηνίας + + + Ultra light + Υπερβολικά ελαφρύ + + + Light + Ελαφρύ + + + Ultra black + Υπερβολικά μαύρο + + + Black + Μαύρο + + + Bold + Έντονο + + + Demi bold + Ελαφρώς έντονο + + + Italic + Πλάγια + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_eo.desktop b/lxqt-panel/plugin-clock/translations/clock_eo.desktop new file mode 100644 index 0000000..829eca2 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Horloĝo kaj kalendaro +Name[eo]=Horloĝo diff --git a/lxqt-panel/plugin-clock/translations/clock_eo.ts b/lxqt-panel/plugin-clock/translations/clock_eo.ts new file mode 100644 index 0000000..e6ed7ae --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_eo.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Agordoj de horloĝo de LxQt + + + + Clock Settings + + + + + Time + Tempo + + + + &Show seconds + Montri &sekundojn + + + + 12 &hour style + 12-&hora aranĝo + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Tiparo + + + Font + Tiparo + + + + Date + Dato + + + Show &date + Montri &daton + + + D&ate format + &Aranĝo de dato + + + Fon&t + &Tiparo + + + Show date in &new line + Montri daton en &nova linio + + + &Use theme fonts + &Uzi tiparojn de etoso + + + Time font + Tiparo de tempo + + + Date font + Tiparo de dato + + + Ultra light + Tre maldike + + + Light + Maldike + + + Ultra black + Tre nigre + + + Black + Nigre + + + Bold + Dike + + + Demi bold + Mezdike + + + Italic + Kursive + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_es.desktop b/lxqt-panel/plugin-clock/translations/clock_es.desktop new file mode 100644 index 0000000..4532966 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Reloj y calendario +Name[es]=Reloj diff --git a/lxqt-panel/plugin-clock/translations/clock_es.ts b/lxqt-panel/plugin-clock/translations/clock_es.ts new file mode 100644 index 0000000..bbfa100 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_es.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Configuración del reloj de LxQt + + + + Clock Settings + + + + + Time + Hora + + + + &Show seconds + &Mostrar segundos + + + + 12 &hour style + Estilo de 12 &horas + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Fuente + + + Font + Fuente + + + + Date + Fecha + + + Show &date + Mostrar &fecha + + + D&ate format + Formato de &fecha + + + Fon&t + Fuen&te + + + Show date in &new line + Mostrar fecha en &nueva línea + + + &Use theme fonts + &Usar fuente del tema + + + Time font + Fuente de la hora + + + Date font + Fuente de la fecha + + + Ultra light + Ultra ligero + + + Light + Ligero + + + Ultra black + Ultra negro + + + Black + Negro + + + Bold + Negrita + + + Demi bold + Semi negrita + + + Italic + Cursiva + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_es_UY.ts b/lxqt-panel/plugin-clock/translations/clock_es_UY.ts new file mode 100644 index 0000000..ed6fe8d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_es_UY.ts @@ -0,0 +1,117 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Configuración de Reloj LxQt + + + + Clock Settings + + + + + Time + Hora + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + Fecha + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_es_VE.desktop b/lxqt-panel/plugin-clock/translations/clock_es_VE.desktop new file mode 100644 index 0000000..57a9390 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Reloj y calendario +Name[es_VE]=Reloj diff --git a/lxqt-panel/plugin-clock/translations/clock_es_VE.ts b/lxqt-panel/plugin-clock/translations/clock_es_VE.ts new file mode 100644 index 0000000..7e34690 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_es_VE.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Configuración de Reloj LxQt + + + + Clock Settings + + + + + Time + Hora + + + + &Show seconds + Mostrar &Segundos + + + + 12 &hour style + Estilo 12 &horas + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Fuente + + + Font + Fuente + + + + Date + Fecha + + + Show &date + Mostrar &fecha + + + D&ate format + Formato &De Fecha + + + Fon&t + Fuen&te + + + Show date in &new line + Mostrar la fecha en una &nueva linea + + + &Use theme fonts + &Usar las letras del tema + + + Time font + Fuente de hora + + + Date font + Fuente de fecha + + + Ultra light + Ultra delgada + + + Light + Delgada + + + Ultra black + Ultra negrita + + + Black + Negra + + + Bold + Negrita + + + Demi bold + Semi negrilla + + + Italic + Italica + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_eu.desktop b/lxqt-panel/plugin-clock/translations/clock_eu.desktop new file mode 100644 index 0000000..50de260 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Erlojua eta egutegia +Name[eu]=Erlojua diff --git a/lxqt-panel/plugin-clock/translations/clock_eu.ts b/lxqt-panel/plugin-clock/translations/clock_eu.ts new file mode 100644 index 0000000..eed3552 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_eu.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQt erlojuaren ezarpenak + + + + Clock Settings + + + + + Time + Ordua + + + + &Show seconds + &Erakutsi segundoak + + + + 12 &hour style + 12 &orduko estiloa + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Letra-tipoa + + + Font + Letra-tipoa + + + + Date + Data + + + Show &date + Erakutsi &data + + + D&ate format + D&ata-formatua + + + Fon&t + Letra-&tipoa + + + Show date in &new line + Erakutsi data lerro &berri batean + + + &Use theme fonts + &Erabili letra-tipoen gaiak + + + Time font + Orduaren letra-tipoa + + + Date font + Dataren letra-tipoa + + + Ultra light + Ultra argia + + + Light + Argia + + + Ultra black + Ultra beltza + + + Black + Beltza + + + Bold + Lodia + + + Demi bold + Erdi-lodia + + + Italic + Etzana + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_fi.desktop b/lxqt-panel/plugin-clock/translations/clock_fi.desktop new file mode 100644 index 0000000..1607eed --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Kello ja kalenteri +Name[fi]=Kello diff --git a/lxqt-panel/plugin-clock/translations/clock_fi.ts b/lxqt-panel/plugin-clock/translations/clock_fi.ts new file mode 100644 index 0000000..8c1281a --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_fi.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQtin kellon asetukset + + + + Clock Settings + + + + + Time + Aika + + + + &Show seconds + &Näytä sekunnit + + + + 12 &hour style + &12 tunnin esitystapa + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Kirjasin + + + Font + Kirjasin + + + + Date + Päivä + + + Show &date + Näytä &päivä + + + D&ate format + Päiväyksen &muoto + + + Fon&t + Ki&rjasin + + + Show date in &new line + Näytä päivä &omalla rivillä + + + &Use theme fonts + Käytä &teeman kirjasimia + + + Time font + Kirjasin aikaa varten + + + Date font + Kirjasin päiväystä varten + + + Ultra light + Todella vaalea + + + Light + Vaalea + + + Ultra black + Todella musta + + + Black + Musta + + + Bold + Lihavoitu + + + Demi bold + Hieman lihavoitu + + + Italic + Kursivoitu + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_fr_FR.desktop b/lxqt-panel/plugin-clock/translations/clock_fr_FR.desktop new file mode 100644 index 0000000..0c70162 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Horloge et calendrier +Name[fr_FR]=Horloge diff --git a/lxqt-panel/plugin-clock/translations/clock_fr_FR.ts b/lxqt-panel/plugin-clock/translations/clock_fr_FR.ts new file mode 100644 index 0000000..8ed0b11 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_fr_FR.ts @@ -0,0 +1,129 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Paramètres de l'horloge de LxQt + + + + Clock Settings + + + + + Time + Heure + + + + &Show seconds + &Montrer les secondes + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + Font + Police + + + + Date + Date + + + Bold + Gras + + + Italic + Italique + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_hu.desktop b/lxqt-panel/plugin-clock/translations/clock_hu.desktop new file mode 100644 index 0000000..89658b5 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Óra és naptár +Name[hu]=Óra diff --git a/lxqt-panel/plugin-clock/translations/clock_hu.ts b/lxqt-panel/plugin-clock/translations/clock_hu.ts new file mode 100644 index 0000000..1a4cd0e --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_hu.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + Órabeállítás + + + + Time + Idő + + + + &Show seconds + Má&sodpercek + + + + 12 &hour style + 12 órás &stílus + + + + &Use UTC + &UTC használat + + + + &Do not show date + Ne legyen &dátum + + + + Show date &before time + &Dátum az óra előtt + + + + Show date &after time + Dátum &az óra után + + + + Show date below time on new &line + Dátum az órával új sorban + + + + First day of week in calendar + A hét első napja + + + + Orientation + Helyzet + + + + Auto&rotate when the panel is vertical + Függélyes panelnél automata görgetés + + + + Date + Dátum + + + + Date &format + Dá&tumalak + + + + Input custom date format + Egyéni dátumalak + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_hu_HU.ts b/lxqt-panel/plugin-clock/translations/clock_hu_HU.ts new file mode 100644 index 0000000..cd65f86 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_hu_HU.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + Órabeállítás + + + + Time + Idő + + + + &Show seconds + Má&sodpercek + + + + 12 &hour style + 12 órás &stílus + + + + &Use UTC + &UTC használat + + + + &Do not show date + Ne legyen &dátum + + + + Show date &before time + &Dátum az óra előtt + + + + Show date &after time + Dátum &az óra után + + + + Show date below time on new &line + Dátum az órával új sorban + + + + First day of week in calendar + A hét első napja + + + + Orientation + Helyzet + + + + Auto&rotate when the panel is vertical + Függélyes panelnél automata görgetés + + + + Date + Dátum + + + + Date &format + Dá&tumalak + + + + Input custom date format + Egyéni dátumalak + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ia.desktop b/lxqt-panel/plugin-clock/translations/clock_ia.desktop new file mode 100644 index 0000000..525a89d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Clock +Comment=Clock and calendar + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-clock/translations/clock_ia.ts b/lxqt-panel/plugin-clock/translations/clock_ia.ts new file mode 100644 index 0000000..e75a468 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ia.ts @@ -0,0 +1,113 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + + + + + Time + + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_id_ID.desktop b/lxqt-panel/plugin-clock/translations/clock_id_ID.desktop new file mode 100644 index 0000000..525a89d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Clock +Comment=Clock and calendar + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-clock/translations/clock_id_ID.ts b/lxqt-panel/plugin-clock/translations/clock_id_ID.ts new file mode 100644 index 0000000..3c7ecab --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_id_ID.ts @@ -0,0 +1,117 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Setting Waktu LxQt + + + + Clock Settings + + + + + Time + Waktu + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + Tanggal + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_it_IT.desktop b/lxqt-panel/plugin-clock/translations/clock_it_IT.desktop new file mode 100644 index 0000000..599acac --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Orologio e calendario +Name[it_IT]=Orologio diff --git a/lxqt-panel/plugin-clock/translations/clock_it_IT.ts b/lxqt-panel/plugin-clock/translations/clock_it_IT.ts new file mode 100644 index 0000000..e9585d5 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_it_IT.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Impostazioni dell'orologio di LxQt + + + + Clock Settings + Impostazioni orologio + + + + Time + Ora + + + + &Show seconds + &Mostra i secondi + + + + 12 &hour style + &Stile 12 ore + + + + &Use UTC + &Usa UTC + + + + Date &format + Formato &data + + + + &Do not show date + &Non mostrare la data + + + + Show date &before time + Prima la &data + + + + Show date &after time + Prima l'&ora + + + + Show date below time on new &line + Mostra la data su una seconda riga + + + + First day of week in calendar + + + + + Orientation + Orientamento + + + + Auto&rotate when the panel is vertical + Ruota automaticamente se il panello è verticale + + + &Font + &Carattere + + + Font + Carattere + + + + Date + Data + + + Show &date + Mostra la &data + + + D&ate format + &Formato della data + + + Fon&t + Cara&ttere + + + Show date in &new line + Mostra la data in una &nuova riga + + + &Use theme fonts + &Utilizza i caratteri del tema + + + Time font + Carattere dell'ora + + + Date font + Carattere della data + + + Ultra light + Chiarissimo + + + Light + Chiaro + + + Ultra black + Nerissimo + + + Black + Nero + + + Bold + Grassetto + + + Demi bold + Neretto + + + Italic + Corsivo + + + + Input custom date format + Formato personalizzato + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ja.desktop b/lxqt-panel/plugin-clock/translations/clock_ja.desktop new file mode 100644 index 0000000..e931829 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=時計とカレンダー +Name[ja]=時計 diff --git a/lxqt-panel/plugin-clock/translations/clock_ja.ts b/lxqt-panel/plugin-clock/translations/clock_ja.ts new file mode 100644 index 0000000..11b263b --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ja.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + 時計の設定 + + + + Time + 時刻 + + + + &Show seconds + 秒を表示(&S) + + + + 12 &hour style + 12時間表示(&H) + + + + &Use UTC + UTCを使用する(&U) + + + + Date &format + 日時の形式(&F) + + + + &Do not show date + 日付を表示しない(&D) + + + + Show date &before time + 日付のあとに時刻(&B) + + + + Show date &after time + 時刻のあとに日付(&A) + + + + Show date below time on new &line + 時刻の下に日付(&L) + + + + First day of week in calendar + + + + + Orientation + 回転 + + + + Auto&rotate when the panel is vertical + パネルが縦のときに自動回転(&R) + + + + Date + 日付 + + + + Input custom date format + 日付の表示形式を指定 + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + 解釈される記法: + +d 日(ゼロなし) (1 - 31) +dd 日(ゼロ埋め) (01 - 31) +ddd 曜日(短い) ('月' - '日') +dddd 曜日(長い) ('月曜日' - '日曜日') +M 月(ゼロなし) (1 - 12) +MM 月(ゼロ埋め) (01 - 12) +MMM 月の名称(短い) ('1月' - '12月') +MMMM 月の名称 (長い) ('1月' - '12月'、※日本語では上記と同じ) +yy 西暦年(2桁) (00 - 99) +yyyy 西暦年(4桁) + +そのほかの文字は解釈されず、テキストとして表示されます。 +上記の解釈される文字も、シングルクオーテーション(')で括ると +一般の文字として扱われ、上記の解釈はされません。 + + +日付形式の指定: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ko.desktop b/lxqt-panel/plugin-clock/translations/clock_ko.desktop new file mode 100644 index 0000000..525a89d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Clock +Comment=Clock and calendar + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-clock/translations/clock_ko.ts b/lxqt-panel/plugin-clock/translations/clock_ko.ts new file mode 100644 index 0000000..cd7fe2f --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ko.ts @@ -0,0 +1,113 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + + + + + Time + + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_lt.desktop b/lxqt-panel/plugin-clock/translations/clock_lt.desktop new file mode 100644 index 0000000..d19d0b4 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Laikrodis ir kalendorius +Name[lt]=Laikrodis diff --git a/lxqt-panel/plugin-clock/translations/clock_lt.ts b/lxqt-panel/plugin-clock/translations/clock_lt.ts new file mode 100644 index 0000000..5fc25b6 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_lt.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQt laikrodžio nuostatos + + + + Clock Settings + + + + + Time + Laikas + + + + &Show seconds + &Rodyti sekundes + + + + 12 &hour style + 12 &valandų stilius + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + Šri&ftas + + + Font + Šriftas + + + + Date + Data + + + Show &date + Rodyti &datą + + + D&ate format + D&atos formatas + + + Fon&t + Šrif&tas + + + Show date in &new line + Datą rodyti &naujoje eilutėje + + + &Use theme fonts + Na&udoti apipavidalinimo šriftus + + + Time font + Laiko šriftas + + + Date font + Datos šriftas + + + Ultra light + Ypač lengvas + + + Light + Lengvas + + + Ultra black + Ypač juodas + + + Black + Juodas + + + Bold + Pusjuodis + + + Demi bold + Šiek tiek pastorintas + + + Italic + Pasviręs + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_nl.desktop b/lxqt-panel/plugin-clock/translations/clock_nl.desktop new file mode 100644 index 0000000..e188043 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Klok en kalender +Name[nl]=Klok diff --git a/lxqt-panel/plugin-clock/translations/clock_nl.ts b/lxqt-panel/plugin-clock/translations/clock_nl.ts new file mode 100644 index 0000000..809e602 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_nl.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Instellingen van LxQt Klok + + + + Clock Settings + + + + + Time + Tijd + + + + &Show seconds + &Toon seconden + + + + 12 &hour style + 12 &uur stijl + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Lettertype + + + Font + Lettertype + + + + Date + Datum + + + Show &date + Toon &datum + + + D&ate format + Datumnotatie + + + Fon&t + Lettertype + + + Show date in &new line + Toon datum in &nieuwe regel + + + &Use theme fonts + &Gebruik lettertypes van thema + + + Time font + Lettertype voor de tijd + + + Date font + Lettertype voor de datum + + + Ultra light + Ultralicht + + + Light + Licht + + + Ultra black + Ultrazwart + + + Black + Zwart + + + Bold + Vet + + + Demi bold + Halfvet + + + Italic + Schuin + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_pl.desktop b/lxqt-panel/plugin-clock/translations/clock_pl.desktop new file mode 100644 index 0000000..bbfd0ef --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Zegar oraz kalendarz +Name[pl]=Zegar diff --git a/lxqt-panel/plugin-clock/translations/clock_pl_PL.desktop b/lxqt-panel/plugin-clock/translations/clock_pl_PL.desktop new file mode 100644 index 0000000..7abe53d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Zegar i kalendarz +Name[pl_PL]=Zegar diff --git a/lxqt-panel/plugin-clock/translations/clock_pl_PL.ts b/lxqt-panel/plugin-clock/translations/clock_pl_PL.ts new file mode 100644 index 0000000..13d814a --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pl_PL.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Ustawienia zegara LxQt + + + + Clock Settings + Ustawienia zegara + + + + Time + Czas + + + + &Show seconds + &Pokaż sekundy + + + + 12 &hour style + 12 &godzinny styl + + + + &Use UTC + &Użyj UTC + + + + Date &format + &Format daty + + + + &Do not show date + &Nie pokazuj daty + + + + Show date &before time + Poka&ż datę przed godziną + + + + Show date &after time + Pokaż datę &za godziną + + + + Show date below time on new &line + Pokaż datę pod godziną w nowej &linii + + + + First day of week in calendar + + + + + Orientation + Orientacja + + + + Auto&rotate when the panel is vertical + Ob&róć gdy panel jest pionowy + + + &Font + &Czcionka + + + Font + Czcionka + + + + Date + Data + + + Show &date + Pokaż &date + + + D&ate format + Format C&zasu + + + Fon&t + Czcionk&a + + + Show date in &new line + Pokaż datę w &nowej linii + + + &Use theme fonts + &Użyj motywów czcionek + + + Time font + Czcionka czasu + + + Date font + Czcionka daty + + + Ultra light + Bardzo cienka + + + Light + Cienka + + + Ultra black + Bardzo czarna + + + Black + Czarna + + + Bold + Pogrubiona + + + Demi bold + Wpół pogrubiona + + + Italic + Kursywa + + + + Input custom date format + Własny format daty + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_pt.desktop b/lxqt-panel/plugin-clock/translations/clock_pt.desktop new file mode 100644 index 0000000..059951e --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Relógio +Comment[pt]=Relógio e calendário + diff --git a/lxqt-panel/plugin-clock/translations/clock_pt.ts b/lxqt-panel/plugin-clock/translations/clock_pt.ts new file mode 100644 index 0000000..d542707 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pt.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Definições do relógio LxQt + + + + Clock Settings + + + + + Time + Horas + + + + &Show seconds + Mo&strar segundos + + + + 12 &hour style + Estilo 12 &horas + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + Tipo &de letra + + + Font + Tipo de letra + + + + Date + Data + + + Show &date + Mostrar &data + + + D&ate format + Form&ato da data + + + Fon&t + &Tipo de letra + + + Show date in &new line + Mostrar data em linha disti&nta + + + &Use theme fonts + &Utilizar tipo de letra do tema + + + Time font + Tipo de letra das horas + + + Date font + Tipo de letra da data + + + Ultra light + Mais clara + + + Light + Clara + + + Ultra black + Normal carregado + + + Black + Normal + + + Bold + Negrito + + + Demi bold + Negrito suave + + + Italic + Itálico + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_pt_BR.desktop b/lxqt-panel/plugin-clock/translations/clock_pt_BR.desktop new file mode 100644 index 0000000..e36ef5f --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Relógio e calendário +Name[pt_BR]=Relógio diff --git a/lxqt-panel/plugin-clock/translations/clock_pt_BR.ts b/lxqt-panel/plugin-clock/translations/clock_pt_BR.ts new file mode 100644 index 0000000..8b11d95 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_pt_BR.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Configurações do relógio do LxQt + + + + Clock Settings + + + + + Time + Hora + + + + &Show seconds + &Mostrar segundos + + + + 12 &hour style + Estilo 12 &horas + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Fonte + + + Font + Fonte + + + + Date + Data + + + Show &date + Mostrar &data + + + D&ate format + Formato da d&ata + + + Fon&t + Fon&te + + + Show date in &new line + Mostrar data em &nova linha + + + &Use theme fonts + &Utilizar fontes do tema + + + Time font + Fonte da hora + + + Date font + Fonte da data + + + Ultra light + Super claro + + + Light + Claro + + + Ultra black + Super escuro + + + Black + Escuro + + + Bold + Negrito + + + Demi bold + Semi negrito + + + Italic + Itálico + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ro_RO.desktop b/lxqt-panel/plugin-clock/translations/clock_ro_RO.desktop new file mode 100644 index 0000000..8962abd --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Afișează ora curentă incluzând și un calendar. +Name[ro_RO]=Data și ora diff --git a/lxqt-panel/plugin-clock/translations/clock_ro_RO.ts b/lxqt-panel/plugin-clock/translations/clock_ro_RO.ts new file mode 100644 index 0000000..02d159a --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ro_RO.ts @@ -0,0 +1,147 @@ + + + + + FirstDayCombo + + + <locale based> + <bazat pe localizare> + + + + LxQtClockConfiguration + + LxQt Clock Settings + Setări ceas LxQt + + + + Clock Settings + Setări ceas + + + + Time + Oră + + + + &Show seconds + Afișează &secundele + + + + 12 &hour style + Stil 12 de &ore + + + + &Use UTC + &Utilizează UTC + + + + Date &format + &Formatul datei + + + + &Do not show date + &Nu afișa data + + + + Show date &before time + Afișează data &înaintea orei + + + + Show date &after time + Afișează data &după timp + + + + Show date below time on new &line + Afișează data pe un &rând nou sub oră + + + + First day of week in calendar + Prima zi a săptămânii + + + + Orientation + Orientare + + + + Auto&rotate when the panel is vertical + Rotire automată când panoul e vertical + + + + Date + Dată + + + Show &date + Afișează &data + + + D&ate format + Format d&ată + + + Show date in &new line + Afișează data pe rând &nou + + + + Input custom date format + Format de dată personalizat + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Secvențe interpretate pentru formatarea datei sunt: + +d numărul zilei fără zero în față (între 1 și 31) +dd numărul zilei cu zero în față (între 01 și 31) +ddd numele abreviat al zilei (de ex. 'Lu' până 'Du'). +dddd numele lung al zilei (de ex. 'Luni' până 'Duminică'). +M numărul lunii fără zero în față (1-12) +MM numărul lunii cu zero în față (01-12) +MMM numele abreviat și localizat al lunii (de ex. 'Ian' - 'Dec'). +MMMM numele lung și localizat al lunii (de ex. 'Ianuarie' - 'December'). +yy anul ca un număr din 2 cifre (00-99) +yyyy anul ca un număr din 4 cifre + +Orice alt caracter introdus va fi tratat ca text. +Orice secvență de caractere intre ghilimele simple (') +vor fi la fel tratate ca text si nu vor fi interpretate in expresie. + + +Format de dată personalizat: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ru.desktop b/lxqt-panel/plugin-clock/translations/clock_ru.desktop new file mode 100644 index 0000000..4645ab6 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Часы и календарь +Name[ru]=Дата и время diff --git a/lxqt-panel/plugin-clock/translations/clock_ru.ts b/lxqt-panel/plugin-clock/translations/clock_ru.ts new file mode 100644 index 0000000..a42c171 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ru.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + Настройка даты и времени + + + + Time + Время + + + + &Show seconds + &Показывать секунды + + + + 12 &hour style + 12 &часовой формат + + + + &Use UTC + &Использовать UTC + + + + Date + Дата + + + + Date &format + Ф&ормат даты + + + + &Do not show date + &Не показывать дату + + + + Show date &before time + Показывать дату &перед временем + + + + Show date &after time + Показывать дату &после времени + + + + Show date below time on new &line + Показывать дату под временем новой &строкой + + + + First day of week in calendar + + + + + Orientation + Ориентация + + + + Auto&rotate when the panel is vertical + Авто&поворот для вертикальной панели + + + + Input custom date format + Введите свой формат даты + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Интерпретация последовательностей формата даты: + +d день как число без ноля перед ним (от 1 до 31) +dd день как число с нолём перед ним (от 01 до 31) +ddd аббревиат́ура названия дня недели (от «Пн» к «Вс»). +dddd полное название дня недели (от «Понедельник» к «Воскресенье»). +M месяц как число без ноля перед ним (от 1 до 12) +MM месяц как число с нолём перед ним (от 01 до 12) +MMM аббревиат́ура названия месяца (от «Янв» до «Дек»). +MMMM полное название месяца (от «Январь» до «Декабрь»). +yy год как двухразрядное число (00-99) +yyyy год как четырёхразрядное число + +Все прочие введёные знаки будут обработаны как текст. +Любая последовательность знаков, заключённая в одинарные кавычки ('), +также будет обработана как текст и не будет использована в выражении. + + +Свой формат даты: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_ru_RU.desktop b/lxqt-panel/plugin-clock/translations/clock_ru_RU.desktop new file mode 100644 index 0000000..2203144 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Часы и календарь +Name[ru_RU]=Дата и время diff --git a/lxqt-panel/plugin-clock/translations/clock_ru_RU.ts b/lxqt-panel/plugin-clock/translations/clock_ru_RU.ts new file mode 100644 index 0000000..3a7d645 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_ru_RU.ts @@ -0,0 +1,131 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + Настройка даты и времени + + + + Time + Время + + + + &Show seconds + &Показывать секунды + + + + 12 &hour style + 12 &часовой формат + + + + &Use UTC + &Использовать UTC + + + + Date + Дата + + + + Date &format + Ф&ормат даты + + + + &Do not show date + &Не показывать дату + + + + Show date &before time + Показывать дату &перед временем + + + + Show date &after time + Показывать дату &после времени + + + + Show date below time on new &line + Показывать дату под временем новой &строкой + + + + First day of week in calendar + + + + + Orientation + Ориентация + + + + Auto&rotate when the panel is vertical + Авто&поворот для вертикальной панели + + + + Input custom date format + Введите свой формат даты + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + Интерпретация последовательностей формата даты: + +d день как число без ноля перед ним (от 1 до 31) +dd день как число с нолём перед ним (от 01 до 31) +ddd аббревиат́ура названия дня недели (от «Пн» к «Вс»). +dddd полное название дня недели (от «Понедельник» к «Воскресенье»). +M месяц как число без ноля перед ним (от 1 до 12) +MM месяц как число с нолём перед ним (от 01 до 12) +MMM аббревиат́ура названия месяца (от «Янв» до «Дек»). +MMMM полное название месяца (от «Январь» до «Декабрь»). +yy год как двухразрядное число (00-99) +yyyy год как четырёхразрядное число + +Все прочие введёные знаки будут обработаны как текст. +Любая последовательность знаков, заключённая в одинарные кавычки ('), +также будет обработана как текст и не будет использована в выражении. + + +Свой формат даты: + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_sk.desktop b/lxqt-panel/plugin-clock/translations/clock_sk.desktop new file mode 100644 index 0000000..3dd7569 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Hodiny a kalendár +Name[sk]=Hodiny diff --git a/lxqt-panel/plugin-clock/translations/clock_sk_SK.ts b/lxqt-panel/plugin-clock/translations/clock_sk_SK.ts new file mode 100644 index 0000000..7b18d0f --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sk_SK.ts @@ -0,0 +1,117 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Nastavenia hodín prostredia LxQt + + + + Clock Settings + + + + + Time + Čas + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + Dátum + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_sl.desktop b/lxqt-panel/plugin-clock/translations/clock_sl.desktop new file mode 100644 index 0000000..746a765 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Ura in koledar +Name[sl]=Ura diff --git a/lxqt-panel/plugin-clock/translations/clock_sl.ts b/lxqt-panel/plugin-clock/translations/clock_sl.ts new file mode 100644 index 0000000..8d4578e --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sl.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Nastavitve ure za LxQt + + + + Clock Settings + + + + + Time + Čas + + + + &Show seconds + Pokaži &sekunde + + + + 12 &hour style + 12-&urni slog + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Pisava + + + Font + Pisava + + + + Date + Datum + + + Show &date + Pokaži &datum + + + D&ate format + &Oblika datuma + + + Fon&t + P&isava + + + Show date in &new line + Pokaži datum v &novi vrstici + + + &Use theme fonts + &Uporabi pisavo teme + + + Time font + Pisava za čas + + + Date font + Pisava za datum + + + Ultra light + Ultra lahko + + + Light + Lahko + + + Ultra black + Ultra krepko + + + Black + Krepko + + + Bold + Polkrepko + + + Demi bold + Pol-polkrepko + + + Italic + Ležeče + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_sr.desktop b/lxqt-panel/plugin-clock/translations/clock_sr.desktop new file mode 100644 index 0000000..5d8c28d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Сат и календар +Name[sr]=Сат diff --git a/lxqt-panel/plugin-clock/translations/clock_sr@ijekavian.desktop b/lxqt-panel/plugin-clock/translations/clock_sr@ijekavian.desktop new file mode 100644 index 0000000..2c1f609 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Сат +Comment[sr@ijekavian]=Сат и календар diff --git a/lxqt-panel/plugin-clock/translations/clock_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-clock/translations/clock_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..f484549 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Sat +Comment[sr@ijekavianlatin]=Sat i kalendar diff --git a/lxqt-panel/plugin-clock/translations/clock_sr@latin.desktop b/lxqt-panel/plugin-clock/translations/clock_sr@latin.desktop new file mode 100644 index 0000000..6a2d68d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Sat i kalendar +Name[sr@latin]=Sat diff --git a/lxqt-panel/plugin-clock/translations/clock_sr@latin.ts b/lxqt-panel/plugin-clock/translations/clock_sr@latin.ts new file mode 100644 index 0000000..e5388d4 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr@latin.ts @@ -0,0 +1,113 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + + Clock Settings + + + + + Time + + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_sr_BA.ts b/lxqt-panel/plugin-clock/translations/clock_sr_BA.ts new file mode 100644 index 0000000..47959f0 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr_BA.ts @@ -0,0 +1,137 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Подешавање Рејзоровог сата + + + + Clock Settings + + + + + Time + Вријеме + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + Show seconds + Прикажи секунде + + + 12 hour style + 12-часовни сат + + + + Date + Датум + + + Show date + Прикажи датум + + + Show date in new line + Прикажи датум у новој линији + + + Date format + Формат датума + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_sr_RS.ts b/lxqt-panel/plugin-clock/translations/clock_sr_RS.ts new file mode 100644 index 0000000..0bd4928 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_sr_RS.ts @@ -0,0 +1,117 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Подешавање Рејзоровог сата + + + + Clock Settings + + + + + Time + Време + + + + &Show seconds + + + + + 12 &hour style + + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + + Date + Датум + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_th_TH.desktop b/lxqt-panel/plugin-clock/translations/clock_th_TH.desktop new file mode 100644 index 0000000..77446b0 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=นาฬิกาและปฏิทิน +Name[th_TH]=นาฬิกา diff --git a/lxqt-panel/plugin-clock/translations/clock_th_TH.ts b/lxqt-panel/plugin-clock/translations/clock_th_TH.ts new file mode 100644 index 0000000..82b7b13 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_th_TH.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + ค่าตั้งนาฬิกา LxQt + + + + Clock Settings + + + + + Time + เวลา + + + + &Show seconds + แ&สดงวินาที + + + + 12 &hour style + รูปแบบ 12 ชั่วโ&มง + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + แบบอั&กษร + + + Font + แบบอักษร + + + + Date + วันที่ + + + Show &date + แสดง&เวลา + + + D&ate format + รูปแ&บบวันที่ + + + Fon&t + แบบอักษ&ร + + + Show date in &new line + แสดงวันที่ในบรรทัดใ&หม่ + + + &Use theme fonts + &ใช้แบบอักษรของชุดตกแต่ง + + + Time font + แบบอักษรของเวลา + + + Date font + แบบอักษรของวันที่ + + + Ultra light + สว่างจ้า + + + Light + สว่าง + + + Ultra black + ดำมืด + + + Black + ดำ + + + Bold + ตัวหนา + + + Demi bold + ตัวกึ่งหนา + + + Italic + ตัวเอียง + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_tr.desktop b/lxqt-panel/plugin-clock/translations/clock_tr.desktop new file mode 100644 index 0000000..5069f2a --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Saat ve takvim +Name[tr]=Saat diff --git a/lxqt-panel/plugin-clock/translations/clock_tr.ts b/lxqt-panel/plugin-clock/translations/clock_tr.ts new file mode 100644 index 0000000..5d767f1 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_tr.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQt Saat Ayarları + + + + Clock Settings + + + + + Time + Zaman + + + + &Show seconds + &Saniyeyi göster + + + + 12 &hour style + 12 saatlik &gösterim biçimi + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Yazı tipi + + + Font + Yazı Tipi + + + + Date + Tarih + + + Show &date + Tarihi gö&ster + + + D&ate format + T&arih biçimi + + + Fon&t + Yazı &Tipi + + + Show date in &new line + Tarihi &yeni satırda göster + + + &Use theme fonts + &Tema yazıtipini kullan + + + Time font + Zaman yazı tipi + + + Date font + Tarih yazıtipi + + + Ultra light + Aşırı ince + + + Light + Hafif + + + Ultra black + Aşırı siyah + + + Black + Siyah + + + Bold + Koyu + + + Demi bold + Yarı koyu + + + Italic + Eğik + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_uk.desktop b/lxqt-panel/plugin-clock/translations/clock_uk.desktop new file mode 100644 index 0000000..72a0e17 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Показує поточний час. Календар +Name[uk]=Дата і час diff --git a/lxqt-panel/plugin-clock/translations/clock_uk.ts b/lxqt-panel/plugin-clock/translations/clock_uk.ts new file mode 100644 index 0000000..c209093 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_uk.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + Налаштування годинника LxQt + + + + Clock Settings + + + + + Time + Час + + + + &Show seconds + Показувати &секунди + + + + 12 &hour style + 12-&годинний стиль + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + &Шрифт + + + Font + Шрифт + + + + Date + Дата + + + Show &date + Показувати &дату + + + D&ate format + Формат д&ати + + + Fon&t + Шриф&т + + + Show date in &new line + Показувати дату в &новому рядку + + + &Use theme fonts + &Використовувати шрифти з теми + + + Time font + Шрифт часу + + + Date font + Шрифт дати + + + Ultra light + Надтонкий + + + Light + Тонкий + + + Ultra black + Дуже темний + + + Black + Темний + + + Bold + Жирний + + + Demi bold + Напівжирний + + + Italic + Нахилений + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_zh_CN.GB2312.desktop b/lxqt-panel/plugin-clock/translations/clock_zh_CN.GB2312.desktop new file mode 100644 index 0000000..525a89d --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Clock +Comment=Clock and calendar + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-clock/translations/clock_zh_CN.desktop b/lxqt-panel/plugin-clock/translations/clock_zh_CN.desktop new file mode 100644 index 0000000..ed6f3ae --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=时钟和日历 +Name[zh_CN]=时钟 diff --git a/lxqt-panel/plugin-clock/translations/clock_zh_CN.ts b/lxqt-panel/plugin-clock/translations/clock_zh_CN.ts new file mode 100644 index 0000000..93a07c5 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_zh_CN.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQt时钟设置 + + + + Clock Settings + + + + + Time + 时间 + + + + &Show seconds + 显示秒(&S) + + + + 12 &hour style + 12小时样式(&H) + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + 字体(&F) + + + Font + 字体 + + + + Date + 日期 + + + Show &date + 显示日期(&D) + + + D&ate format + 日期格式(&A) + + + Fon&t + 字体(&T) + + + Show date in &new line + 在新行显示日期(&N) + + + &Use theme fonts + 使用主题字体(&U) + + + Time font + 时间字体 + + + Date font + 日期字体 + + + Ultra light + 超亮 + + + Light + + + + Ultra black + 超黑 + + + Black + + + + Bold + 黑体 + + + Demi bold + 半粗体 + + + Italic + 斜体 + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-clock/translations/clock_zh_TW.desktop b/lxqt-panel/plugin-clock/translations/clock_zh_TW.desktop new file mode 100644 index 0000000..fb8312c --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Date & time +Comment=Displays the current time. Comes with a calendar. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=時鐘與日曆 +Name[zh_TW]=時鐘 diff --git a/lxqt-panel/plugin-clock/translations/clock_zh_TW.ts b/lxqt-panel/plugin-clock/translations/clock_zh_TW.ts new file mode 100644 index 0000000..bc16a59 --- /dev/null +++ b/lxqt-panel/plugin-clock/translations/clock_zh_TW.ts @@ -0,0 +1,181 @@ + + + + + FirstDayCombo + + + <locale based> + + + + + LxQtClockConfiguration + + LxQt Clock Settings + LxQt時鐘設定 + + + + Clock Settings + + + + + Time + 時間 + + + + &Show seconds + 顯示秒(&S) + + + + 12 &hour style + 十二小時制(&h) + + + + &Use UTC + + + + + Date &format + + + + + &Do not show date + + + + + Show date &before time + + + + + Show date &after time + + + + + Show date below time on new &line + + + + + First day of week in calendar + + + + + Orientation + + + + + Auto&rotate when the panel is vertical + + + + &Font + 字體(&F) + + + Font + 字體 + + + + Date + 日期 + + + Show &date + 顯示日期(&d) + + + D&ate format + 日期格式(&a) + + + Fon&t + 字體(&t) + + + Show date in &new line + 日期顯示在下一行中 + + + &Use theme fonts + 使用主題預設字體(&U) + + + Time font + 時間的字體 + + + Date font + 日期的字體 + + + Ultra light + 極亮 + + + Light + + + + Ultra black + 極暗 + + + Black + + + + Bold + 粗體 + + + Demi bold + 半粗體 + + + Italic + 斜體 + + + + Input custom date format + + + + + Interpreted sequences of date format are: + +d the day as number without a leading zero (1 to 31) +dd the day as number with a leading zero (01 to 31) +ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). +dddd the long localized day name (e.g. 'Monday' to 'Sunday'). +M the month as number without a leading zero (1-12) +MM the month as number with a leading zero (01-12) +MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). +MMMM the long localized month name (e.g. 'January' to 'December'). +yy the year as two digit number (00-99) +yyyy the year as four digit number + +All other input characters will be treated as text. +Any sequence of characters that are enclosed in single quotes (') +will also be treated as text and not be used as an expression. + + +Custom date format: + + + + diff --git a/lxqt-panel/plugin-colorpicker/CMakeLists.txt b/lxqt-panel/plugin-colorpicker/CMakeLists.txt new file mode 100644 index 0000000..8d6484e --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/CMakeLists.txt @@ -0,0 +1,17 @@ +set(PLUGIN "colorpicker") + +set(HEADERS + colorpicker.h +) + +set(SOURCES + colorpicker.cpp +) + +set(UIS "") + +set(LIBRARIES + lxqt +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-colorpicker/colorpicker.cpp b/lxqt-panel/plugin-colorpicker/colorpicker.cpp new file mode 100644 index 0000000..e5da880 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/colorpicker.cpp @@ -0,0 +1,101 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Aaron Lewis + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "colorpicker.h" +#include +#include + + +ColorPicker::ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + realign(); +} + + +ColorPicker::~ColorPicker() +{ +} + + +void ColorPicker::realign() +{ + mWidget.button()->setFixedHeight(panel()->iconSize()); + mWidget.button()->setFixedWidth(panel()->iconSize()); + mWidget.lineEdit()->setFixedHeight(panel()->iconSize()); +} + + +ColorPickerWidget::ColorPickerWidget(QWidget *parent): + QFrame(parent) +{ + QFontMetrics fm (mLineEdit.font()); + mLineEdit.setFixedWidth ( 10*fm.width ("a") ); + + QHBoxLayout *layout = new QHBoxLayout(this); + setLayout(layout); + layout->addWidget (&mButton); + layout->addWidget (&mLineEdit); + + + mButton.setIcon(XdgIcon::fromTheme("color-picker", "kcolorchooser")); + + mCapturing = false; + connect(&mButton, SIGNAL(clicked()), this, SLOT(captureMouse())); + +} + + +ColorPickerWidget::~ColorPickerWidget() +{ +} + + +void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) +{ + if (!mCapturing) + return; + + WId id = QApplication::desktop()->winId(); + QPixmap pixmap = QPixmap::grabWindow(id, event->globalX(), event->globalY(), 1, 1); + + QImage img = pixmap.toImage(); + QColor col = QColor(img.pixel(0,0)); + + mLineEdit.setText (col.name()); + + mCapturing = false; + releaseMouse(); +} + + +void ColorPickerWidget::captureMouse() +{ + grabMouse(Qt::CrossCursor); + mCapturing = true; +} diff --git a/lxqt-panel/plugin-colorpicker/colorpicker.h b/lxqt-panel/plugin-colorpicker/colorpicker.h new file mode 100644 index 0000000..de63a48 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/colorpicker.h @@ -0,0 +1,95 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Aaron Lewis + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_COLORPICKER_H +#define LXQT_COLORPICKER_H + +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include +#include +#include +#include +#include + + +class ColorPickerWidget: public QFrame +{ + Q_OBJECT +public: + ColorPickerWidget(QWidget* parent = 0); + ~ColorPickerWidget(); + + QLineEdit *lineEdit() { return &mLineEdit; } + QToolButton *button() { return &mButton; } + + +protected: + void mouseReleaseEvent(QMouseEvent *event); + +private slots: + void captureMouse(); + +private: + QLineEdit mLineEdit; + QToolButton mButton; + bool mCapturing; +}; + + +class ColorPicker : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo); + ~ColorPicker(); + + virtual QWidget *widget() { return &mWidget; } + virtual QString themeId() const { return "ColorPicker"; } + + bool isSeparate() const { return true; } + + void realign(); + +private: + ColorPickerWidget mWidget; +}; + +class ColorPickerLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new ColorPicker(startupInfo); + } +}; + +#endif diff --git a/lxqt-panel/plugin-colorpicker/resources/colorpicker.desktop.in b/lxqt-panel/plugin-colorpicker/resources/colorpicker.desktop.in new file mode 100644 index 0000000..b34ac80 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/resources/colorpicker.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. +Icon=color-picker + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker.ts b/lxqt-panel/plugin-colorpicker/translations/colorpicker.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker.ts @@ -0,0 +1,4 @@ + + + + diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs.desktop new file mode 100644 index 0000000..b36929e --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[cs]=Dostaňte barvu pod ukazovátkem. Pro vývojáře webu. +Name[cs]=Volič barev diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs_CZ.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs_CZ.desktop new file mode 100644 index 0000000..09c6dfb --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_cs_CZ.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[cs_CZ]=Dostaňte barvu pod ukazovátkem. Pro vývojáře webu. +Name[cs_CZ]=Volič barev diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_da.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_da.desktop new file mode 100644 index 0000000..c3b07fe --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_da.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[da]=Find farven under musemarkøren. For webudviklere. +Name[da]=Farvevælger diff --git a/plugin-colorpicker/translations/colorpicker_de_DE.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_da_DK.desktop similarity index 63% rename from plugin-colorpicker/translations/colorpicker_de_DE.desktop rename to lxqt-panel/plugin-colorpicker/translations/colorpicker_da_DK.desktop index 17f8972..58858be 100644 --- a/plugin-colorpicker/translations/colorpicker_de_DE.desktop +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_da_DK.desktop @@ -6,5 +6,5 @@ Comment=Get the color under the cursor. For web developers. # Translations -Comment[de_DE]=Wählt Farbe unter dem Cursor. Für Webentwickler. -Name[de_DE]=Farbwähler +Comment[da_DK]=Find farven under musemarkøren. For webudviklere. +Name[da_DK]=Farvevælger diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_de.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_de.desktop new file mode 100644 index 0000000..cc441ce --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Farbwähler +Comment[de]=Wählt Farbe unter dem Cursor. Für Webentwickler. diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_el_GR.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_el_GR.desktop new file mode 100644 index 0000000..f2ae6b5 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_el_GR.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[el_GR]=Λήψη του χρώματος κάτω από τον δείκτη. Για σχεδιαστές ιστοσελίδων. +Name[el_GR]=Επιλογέας χρωμάτων diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_es.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_es.desktop new file mode 100644 index 0000000..cbfa2ab --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_es.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[es]=Obtiene el color bajo el cursor. Para desarrolladores web. +Name[es]=Selector de color diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_es_VE.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_es_VE.desktop new file mode 100644 index 0000000..9a9ed72 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_es_VE.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[es_VE]=Toma un color de la pantalla con el cursor, para desarrolladores web. +Name[es_VE]=Recoge colores diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_eu.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_eu.desktop new file mode 100644 index 0000000..75de838 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_eu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[eu]=Eskuratu kurtsorearen azpiko kolorea. Web-garatzaileentzat. +Name[eu]=Kolore-hautatzailea diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_fi.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_fi.desktop new file mode 100644 index 0000000..9ecf4a5 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_fi.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[fi]=Näyttää hiiren osoittimen alla olevan värin. +Name[fi]=Värivalitsin diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_hu.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_hu.desktop new file mode 100644 index 0000000..4ac60b7 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_hu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[hu]=Színszippantó. Fejlesztőknek. +Name[hu]=Színválasztó diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_it_IT.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_it_IT.desktop new file mode 100644 index 0000000..2e47e9c --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_it_IT.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[it_IT]=Rileva il colore sotto il cursore. Per sviluppatori web. +Name[it_IT]=Selettore del colore diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_ja.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ja.desktop new file mode 100644 index 0000000..28d5645 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ja.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=カラーピッカー +Comment=カーソルの下の色を取得します。ウェブ制作者向け diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_pl_PL.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pl_PL.desktop new file mode 100644 index 0000000..54f8b77 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pl_PL.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[pl_PL]=Pobierz kolor spod kursora. Dla webdeveloperów. +Name[pl_PL]=Wybieracz kolorów diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt.desktop new file mode 100644 index 0000000..883aee7 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + +# Translations +Name[pt]=Seletor de cores +Comment[pt]=Obter a cor por baixo do cursor. Para programadores web. diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt_BR.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt_BR.desktop new file mode 100644 index 0000000..c11923a --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_pt_BR.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[pt_BR]=Obter a cor sob o cursor. Para desenvolvedores web. +Name[pt_BR]=Seletor de cores diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_ro_RO.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ro_RO.desktop new file mode 100644 index 0000000..39f7cdf --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ro_RO.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[ro_RO]=Obține culoarea de sub cursor. Pentru dezvoltatori web. diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru.desktop new file mode 100644 index 0000000..c6f49bc --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[ru]=Получить цвет под курсором мыши. Для веб-разработчиков. +Name[ru]=Цветовая палитра \ No newline at end of file diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru_RU.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru_RU.desktop new file mode 100644 index 0000000..84caabe --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_ru_RU.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[ru_RU]=Получить цвет под курсором мыши. Для веб-разработчиков. +Name[ru_RU]=Цветовая палитра \ No newline at end of file diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_th_TH.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_th_TH.desktop new file mode 100644 index 0000000..f00ba2d --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_th_TH.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[th_TH]=นำค่าสีที่อยู่ใต้เคอร์เซอร์ขึ้นมา สำหรับนักพัฒนาเว็บ +Name[th_TH]=ตัวเลือกค่าสี diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_uk.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_uk.desktop new file mode 100644 index 0000000..807d3e2 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_uk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[uk]=Бере колір під курсором. Для web-розробників. +Name[uk]=Селектор кольору diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_CN.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_CN.desktop new file mode 100644 index 0000000..6017e30 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_CN.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[zh_CN]=为网络开发者获取鼠标下的颜色。 +Name[zh_CN]=颜色拾取器 diff --git a/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_TW.desktop b/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_TW.desktop new file mode 100644 index 0000000..0438cb1 --- /dev/null +++ b/lxqt-panel/plugin-colorpicker/translations/colorpicker_zh_TW.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[zh_TW]=取得由標下的顏色。網頁開發者推荐使用。 +Name[zh_TW]=取得顏色 diff --git a/lxqt-panel/plugin-cpuload/CMakeLists.txt b/lxqt-panel/plugin-cpuload/CMakeLists.txt new file mode 100644 index 0000000..4017b67 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/CMakeLists.txt @@ -0,0 +1,21 @@ +set(PLUGIN "cpuload") + +set(HEADERS + lxqtcpuloadplugin.h + lxqtcpuload.h + lxqtcpuloadconfiguration.h +) + +set(SOURCES + lxqtcpuloadplugin.cpp + lxqtcpuload.cpp + lxqtcpuloadconfiguration.cpp +) + +set(UIS + lxqtcpuloadconfiguration.ui +) + +set(LIBRARIES ${STATGRAB_LIB}) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuload.cpp b/lxqt-panel/plugin-cpuload/lxqtcpuload.cpp new file mode 100644 index 0000000..1e08ac3 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuload.cpp @@ -0,0 +1,210 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtcpuload.h" +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include +#include + +extern "C" { +#include +} + +#ifdef __sg_public +// since libstatgrab 0.90 this macro is defined, so we use it for version check +#define STATGRAB_NEWER_THAN_0_90 1 +#endif + +#define BAR_ORIENT_BOTTOMUP "bottomUp" +#define BAR_ORIENT_TOPDOWN "topDown" +#define BAR_ORIENT_LEFTRIGHT "leftRight" +#define BAR_ORIENT_RIGHTLEFT "rightLeft" + + +LxQtCpuLoad::LxQtCpuLoad(ILxQtPanelPlugin* plugin, QWidget* parent): + QFrame(parent), + mPlugin(plugin), + m_showText(false), + m_barWidth(20), + m_barOrientation(TopDownBar), + m_timerID(-1) +{ + setObjectName("LxQtCpuLoad"); + + QHBoxLayout *layout = new QHBoxLayout(this); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + layout->addWidget(&m_stuff); + + /* Initialise statgrab */ +#ifdef STATGRAB_NEWER_THAN_0_90 + sg_init(0); +#else + sg_init(); +#endif + + /* Drop setuid/setgid privileges. */ + if (sg_drop_privileges() != 0) { + perror("Error. Failed to drop privileges"); + } + + m_font.setPointSizeF(8); + + settingsChanged(); +} + +LxQtCpuLoad::~LxQtCpuLoad() +{ +} + +void LxQtCpuLoad::setSizes() +{ + if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) + { + m_stuff.setFixedHeight(m_barWidth); + m_stuff.setMinimumWidth(24); + } + else + { + m_stuff.setFixedWidth(m_barWidth); + m_stuff.setMinimumHeight(24); + } +} + +void LxQtCpuLoad::resizeEvent(QResizeEvent *) +{ + setSizes(); + update(); +} + + +double LxQtCpuLoad::getLoadCpu() const +{ +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t count; + sg_cpu_percents* cur = sg_get_cpu_percents(&count); +#else + sg_cpu_percents* cur = sg_get_cpu_percents(); +#endif + return (cur->user + cur->kernel + cur->nice); +} + +void LxQtCpuLoad::timerEvent(QTimerEvent *event) +{ + double avg = getLoadCpu(); + if ( qAbs(m_avg-avg)>1 ) + { + m_avg = avg; + setToolTip(tr("CPU load %1%").arg(m_avg)); + update(); + } +} + +void LxQtCpuLoad::paintEvent ( QPaintEvent * ) +{ + QPainter p(this); + QPen pen; + pen.setWidth(2); + p.setPen(pen); + p.setRenderHint(QPainter::Antialiasing, true); + + p.setFont(m_font); + QRectF r = rect(); + + QRectF r1; + QLinearGradient shade(0,0,1,1); + if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) + { + float vo = (r.height() - static_cast(m_barWidth))/2.0; + float ho = r.width()*(1-m_avg*0.01); + + if (m_barOrientation == RightToLeftBar) + { + r1.setRect(r.left()+ho, r.top()+vo, r.width()-ho, r.height()-2*vo ); + } + else // LeftToRightBar + { + r1.setRect(r.left(), r.top()+vo, r.width()-ho, r.height()-2*vo ); + } + shade.setFinalStop(0, r1.height()); + } + else // BottomUpBar || TopDownBar + { + float vo = r.height()*(1-m_avg*0.01); + float ho = (r.width() - static_cast(m_barWidth) )/2.0; + + if (m_barOrientation == TopDownBar) + { + r1.setRect(r.left()+ho, r.top(), r.width()-2*ho, r.height()-vo ); + } + else // BottomUpBar + { + r1.setRect(r.left()+ho, r.top()+vo, r.width()-2*ho, r.height()-vo ); + } + shade.setFinalStop(r1.width(), 0); + } + + shade.setSpread(QLinearGradient::ReflectSpread); + shade.setColorAt(0, QColor(0, 196, 0, 128)); + shade.setColorAt(0.5, QColor(0, 128, 0, 255) ); + shade.setColorAt(1, QColor(0, 196, 0 , 128)); + + p.fillRect(r1, shade); + + if (m_showText) + { + p.setPen(fontColor); + p.drawText(rect(), Qt::AlignCenter, QString::number(m_avg)); + } +} + + +void LxQtCpuLoad::settingsChanged() +{ + if (m_timerID != -1) + killTimer(m_timerID); + + m_showText = mPlugin->settings()->value("showText", false).toBool(); + m_barWidth = mPlugin->settings()->value("barWidth", 20).toInt(); + m_updateInterval = mPlugin->settings()->value("updateInterval", 1000).toInt(); + + QString barOrientation = mPlugin->settings()->value("barOrientation", BAR_ORIENT_BOTTOMUP).toString(); + if (barOrientation == BAR_ORIENT_RIGHTLEFT) + m_barOrientation = RightToLeftBar; + else if (barOrientation == BAR_ORIENT_LEFTRIGHT) + m_barOrientation = LeftToRightBar; + else if (barOrientation == BAR_ORIENT_TOPDOWN) + m_barOrientation = TopDownBar; + else + m_barOrientation = BottomUpBar; + + m_timerID = startTimer(m_updateInterval); + setSizes(); + update(); +} diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuload.h b/lxqt-panel/plugin-cpuload/lxqtcpuload.h new file mode 100644 index 0000000..ca35e1d --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuload.h @@ -0,0 +1,89 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTCPULOAD_H +#define LXQTCPULOAD_H +#include + +class ILxQtPanelPlugin; + +class LxQtCpuLoad: public QFrame +{ + Q_OBJECT + + Q_PROPERTY(QColor fontColor READ getFontColor WRITE setFontColor) + +public: + /** + Describes orientation of cpu load bar + **/ + enum BarOrientation { + BottomUpBar, //! Bar begins at bottom and grows up + TopDownBar, //! Bar begins at top and grows down + RightToLeftBar, //! Bar begins at right edge and grows to the left + LeftToRightBar //! Bar begins at left edge and grows to the right + }; + + LxQtCpuLoad(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~LxQtCpuLoad(); + + + void settingsChanged(); + + void setFontColor(QColor value) { fontColor = value; } + QColor getFontColor() const { return fontColor; } + +protected: + void virtual timerEvent(QTimerEvent *event); + void virtual paintEvent ( QPaintEvent * event ); + void virtual resizeEvent(QResizeEvent *); + +private: + double getLoadCpu() const; + void setSizes(); + + ILxQtPanelPlugin *mPlugin; + QWidget m_stuff; + + //! average load + int m_avg; + + bool m_showText; + int m_barWidth; + BarOrientation m_barOrientation; + int m_updateInterval; + int m_timerID; + + QFont m_font; + + QColor fontColor; +}; + + +#endif // LXQTCPULOAD_H + + diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.cpp b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.cpp new file mode 100644 index 0000000..c52e1a2 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.cpp @@ -0,0 +1,128 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtcpuloadconfiguration.h" +#include "ui_lxqtcpuloadconfiguration.h" + +#define BAR_ORIENT_BOTTOMUP "bottomUp" +#define BAR_ORIENT_TOPDOWN "topDown" +#define BAR_ORIENT_LEFTRIGHT "leftRight" +#define BAR_ORIENT_RIGHTLEFT "rightLeft" + +LxQtCpuLoadConfiguration::LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtCpuLoadConfiguration), + mSettings(settings), + mOldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("CpuLoadConfigurationWindow"); + ui->setupUi(this); + + fillBarOrientations(); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), + this, SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + + connect(ui->showTextCB, SIGNAL(toggled(bool)), + this, SLOT(showTextChanged(bool))); + connect(ui->barWidthSB, SIGNAL(valueChanged(int)), + this, SLOT(barWidthChanged(int))); + connect(ui->updateIntervalSpinBox, SIGNAL(valueChanged(double)), + this, SLOT(updateIntervalChanged(double))); + connect(ui->barOrientationCOB, SIGNAL(currentIndexChanged(int)), + this, SLOT(barOrientationChanged(int))); +} + +LxQtCpuLoadConfiguration::~LxQtCpuLoadConfiguration() +{ + delete ui; +} + +void LxQtCpuLoadConfiguration::fillBarOrientations() +{ + ui->barOrientationCOB->addItem(trUtf8("Bottom up"), BAR_ORIENT_BOTTOMUP); + ui->barOrientationCOB->addItem(trUtf8("Top down"), BAR_ORIENT_TOPDOWN); + ui->barOrientationCOB->addItem(trUtf8("Left to right"), BAR_ORIENT_LEFTRIGHT); + ui->barOrientationCOB->addItem(trUtf8("Right to left"), BAR_ORIENT_RIGHTLEFT); +} + +void LxQtCpuLoadConfiguration::loadSettings() +{ + ui->showTextCB->setChecked(mSettings->value("showText", false).toBool()); + ui->barWidthSB->setValue(mSettings->value("barWidth", 20).toInt()); + ui->updateIntervalSpinBox->setValue(mSettings->value("updateInterval", 1000).toInt() / 1000.0); + + int boIndex = ui->barOrientationCOB->findData( + mSettings->value("barOrientation", BAR_ORIENT_BOTTOMUP)); + boIndex = (boIndex < 0) ? 1 : boIndex; + ui->barOrientationCOB->setCurrentIndex(boIndex); + +// QString menuFile = mSettings->value("menu_file", "").toString(); +// if (menuFile.isEmpty()) +// { +// menuFile = XdgMenu::getMenuFileName(); +// } +// ui->menuFilePathLE->setText(menuFile); +// ui->shortcutEd->setKeySequence(mSettings->value("shortcut", "Alt+F1").toString()); +} + +void LxQtCpuLoadConfiguration::showTextChanged(bool value) +{ + mSettings->setValue("showText", value); +} + +void LxQtCpuLoadConfiguration::barWidthChanged(int value) +{ + mSettings->setValue("barWidth", value); +} + +void LxQtCpuLoadConfiguration::updateIntervalChanged(double value) +{ + mSettings->setValue("updateInterval", value*1000); +} + +void LxQtCpuLoadConfiguration::barOrientationChanged(int index) +{ + mSettings->setValue("barOrientation", ui->barOrientationCOB->itemData(index).toString()); +} + +void LxQtCpuLoadConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.h b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.h new file mode 100644 index 0000000..c1a4336 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.h @@ -0,0 +1,74 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTCPULOADCONFIGURATION_H +#define LXQTCPULOADCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class LxQtCpuLoadConfiguration; +} + +class LxQtCpuLoadConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent = 0); + ~LxQtCpuLoadConfiguration(); + +private: + Ui::LxQtCpuLoadConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + + /* + Fills Bar orientation combobox + */ + void fillBarOrientations(); + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void showTextChanged(bool value); + void barWidthChanged(int value); + void updateIntervalChanged(double value); + void barOrientationChanged(int index); + +}; + +#endif // LXQTCPULOADCONFIGURATION_H diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.ui b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.ui new file mode 100644 index 0000000..b578503 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuloadconfiguration.ui @@ -0,0 +1,128 @@ + + + LxQtCpuLoadConfiguration + + + + 0 + 0 + 285 + 191 + + + + CPU Load Settings + + + + + + General + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + false + + + + + + Show text + + + + + + + Update interval: + + + + + + + sec + + + 1 + + + 0.500000000000000 + + + 10000.000000000000000 + + + 0.500000000000000 + + + 1.000000000000000 + + + + + + + Bar orientation: + + + + + + + + + + Bar width: + + + + + + + 4 + + + 2048 + + + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 41 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.cpp b/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.cpp new file mode 100644 index 0000000..24c16ef --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.cpp @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtcpuloadplugin.h" +#include "lxqtcpuload.h" +#include "lxqtcpuloadconfiguration.h" + +#include + +LxQtCpuLoadPlugin::LxQtCpuLoadPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + mWidget = new QWidget(); + mContent = new LxQtCpuLoad(this, mWidget); + QVBoxLayout *layout = new QVBoxLayout(mWidget); + layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); + layout->addWidget(mContent); + layout->setStretchFactor(mContent, 1); +} + +LxQtCpuLoadPlugin::~LxQtCpuLoadPlugin() +{ + delete mWidget; +} + +QWidget *LxQtCpuLoadPlugin::widget() +{ + return mWidget; +} + +QDialog *LxQtCpuLoadPlugin::configureDialog() +{ + return new LxQtCpuLoadConfiguration(settings()); +} + +void LxQtCpuLoadPlugin::settingsChanged() +{ + mContent->settingsChanged(); +} diff --git a/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.h b/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.h new file mode 100644 index 0000000..9f60712 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/lxqtcpuloadplugin.h @@ -0,0 +1,73 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTCPULOADPLUGIN_H +#define LXQTCPULOADPLUGIN_H + + +#include "../panel/ilxqtpanelplugin.h" +#include +class LxQtCpuLoad; + +class LxQtCpuLoadPlugin: public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + explicit LxQtCpuLoadPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtCpuLoadPlugin(); + + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } + virtual QWidget *widget(); + virtual QString themeId() const { return "CpuLoad"; } + + bool isSeparate() const { return true; } + QDialog *configureDialog(); + +protected: + virtual void settingsChanged(); + +private: + QWidget *mWidget; + LxQtCpuLoad *mContent; +}; + + +class LxQtCpuLoadPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtCpuLoadPlugin(startupInfo); + } +}; + + +#endif // LXQTCPULOADPLUGIN_H diff --git a/lxqt-panel/plugin-cpuload/resources/cpuload.desktop.in b/lxqt-panel/plugin-cpuload/resources/cpuload.desktop.in new file mode 100644 index 0000000..fe52e0d --- /dev/null +++ b/lxqt-panel/plugin-cpuload/resources/cpuload.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=CPU monitor +Comment=Displays the current CPU load. +Icon=cpu + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload.ts b/lxqt-panel/plugin-cpuload/translations/cpuload.ts new file mode 100644 index 0000000..24f94e7 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + + + + + Show text + + + + + Update interval: + + + + + sec + + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ar.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_ar.desktop new file mode 100644 index 0000000..1d22bc6 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ar.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[ar]=مُراقب عبء المعالج +Name[ar]=عبء المعالج diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ar.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_ar.ts new file mode 100644 index 0000000..21c7afa --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ar.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + العامّ + + + + Show text + إظهار النَّصّ + + + + Update interval: + + + + + sec + + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_cs.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_cs.desktop new file mode 100644 index 0000000..58b2e3e --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_cs.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[cs]=Sledování zatížení procesoru +Name[cs]=Zatížení procesoru diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_cs.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_cs.ts new file mode 100644 index 0000000..f2a68b6 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_cs.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Vytížení procesoru %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Nastavení vytížení procesoru v LxQtu + + + + CPU Load Settings + + + + + General + Obecné + + + + Show text + Ukázat text + + + + Update interval: + Obnovovací interval: + + + + sec + s + + + + Bar orientation: + Směr pruhu + + + + Bar width: + + + + + Bottom up + Zdola nahoru + + + + Top down + Shora dolů + + + + Left to right + Zleva doprava + + + + Right to left + Zprava doleva + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.desktop new file mode 100644 index 0000000..c33207b --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[cs_CZ]=Sledování zatížení procesoru +Name[cs_CZ]=Zatížení procesoru diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.ts new file mode 100644 index 0000000..4353ca8 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_cs_CZ.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Vytížení procesoru %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Nastavení vytížení procesoru v LxQtu + + + + CPU Load Settings + + + + + General + Obecné + + + + Show text + Ukázat text + + + + Update interval: + Obnovovací interval: + + + + sec + s + + + + Bar orientation: + Směr pruhu + + + + Bar width: + + + + + Bottom up + Zdola nahoru + + + + Top down + Shora dolů + + + + Left to right + Zleva doprava + + + + Right to left + Zprava doleva + + + diff --git a/plugin-cpuload/translations/cpuload_de_DE.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_da.desktop similarity index 71% rename from plugin-cpuload/translations/cpuload_de_DE.desktop rename to lxqt-panel/plugin-cpuload/translations/cpuload_da.desktop index b6df13b..2258043 100644 --- a/plugin-cpuload/translations/cpuload_de_DE.desktop +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_da.desktop @@ -9,5 +9,5 @@ Comment=Displays the current CPU load. # Translations -Comment[de_DE]=Cpu -Name[de_DE]=CPU-Auslastung +Comment[da]=CPU Overvågning +Name[da]=CPU-belastning diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.desktop new file mode 100644 index 0000000..81e2292 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[da_DK]=CPU Overvågning +Name[da_DK]=CPU Belastning + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.ts new file mode 100644 index 0000000..85f499f --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_da_DK.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + CPU belastning %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + LxQt CPU-belastning indstillinger + + + + CPU Load Settings + + + + + General + Generelt + + + + Show text + Vis tekst + + + + Update interval: + Opdateringsinterval: + + + + sec + sek + + + + Bar orientation: + Bjælkens orientering: + + + + Bar width: + + + + + Bottom up + Nedefra + + + + Top down + Oppefra + + + + Left to right + Venstre mod højre + + + + Right to left + Højre mod venstre + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_de.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_de.desktop new file mode 100644 index 0000000..11579ac --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Prozessorauslastung +Comment[de]=Prozessorlast-Monitor diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_de.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_de.ts new file mode 100644 index 0000000..f1dc15b --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_de.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Prozessorauslastung %1% + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Einstellungen zur Prozessorlast-Anzeige + + + + General + Allgemein + + + + Show text + Text anzeigen + + + + Update interval: + Aktualisierungsintervall: + + + + sec + s + + + + Bar orientation: + Balkenrichtung: + + + + Bar width: + Balkenbreite: + + + + Bottom up + von unten nach oben + + + + Top down + von oben nach unten + + + + Left to right + von links nach rechts + + + + Right to left + von rechts nach links + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.desktop new file mode 100644 index 0000000..55dd675 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[el_GR]=Εμφανίζει την τρέχουσα χρήση ΚΜΕ. +Name[el_GR]=Επόπτης ΚΜΕ diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.ts new file mode 100644 index 0000000..f0f61cd --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_el_GR.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Φορτίο ΚΜΕ %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Ρυθμίσεις φορτίου ΚΜΕ + + + + CPU Load Settings + + + + + General + Γενικά + + + + Show text + Εμφάνιση κειμένου + + + + Update interval: + Διάστημα ενημέρωσης: + + + + sec + δευτ + + + + Bar orientation: + Προσανατολισμός γραμμής: + + + + Bar width: + + + + + Bottom up + Κάτω προς τα πάνω + + + + Top down + Πάνω προς τα κάτω + + + + Left to right + Αριστερά προς δεξιά + + + + Right to left + Δεξιά προς αριστερά + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_eo.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_eo.desktop new file mode 100644 index 0000000..c9f168c --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_eo.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[eo]=Monitorado de CPU-ŝarĝo +Name[eo]=CPU-ŝarĝo diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_eo.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_eo.ts new file mode 100644 index 0000000..9ae1913 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_eo.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Ĝenerala + + + + Show text + Montri tekston + + + + Update interval: + + + + + sec + + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_es.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_es.desktop new file mode 100644 index 0000000..467dd1c --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_es.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[es]=Monitor de carga de CPU +Name[es]=Carga de CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_es.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_es.ts new file mode 100644 index 0000000..e005744 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_es.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Carga de CPU %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Opciones de Carga de CPU LxQt + + + + CPU Load Settings + + + + + General + General + + + + Show text + Mostrar texto + + + + Update interval: + Intervalo de actualización + + + + sec + segundos + + + + Bar orientation: + Orientación de la barra: + + + + Bar width: + + + + + Bottom up + De Abajo hacia Arriba + + + + Top down + De Arriba hacia Abajo + + + + Left to right + De Izquierda a Derecha + + + + Right to left + De Derecha a Izquierda + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.desktop new file mode 100644 index 0000000..53509af --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[es_VE]=Monitor de carga del CPU +Name[es_VE]=Carga del CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.ts new file mode 100644 index 0000000..16bdb99 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_es_VE.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Cpu al %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Configuracion de Monitor de Cpu LxQt + + + + CPU Load Settings + + + + + General + General + + + + Show text + Mostrar etiqueta + + + + Update interval: + Intervalo actualizacion + + + + sec + seg + + + + Bar orientation: + Orientacion barra + + + + Bar width: + + + + + Bottom up + Abajo a Arriba + + + + Top down + Arriba a abajo + + + + Left to right + Izquierda a derecha + + + + Right to left + Derecha a izquierda + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_eu.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_eu.desktop new file mode 100644 index 0000000..0368098 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_eu.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[eu]=PUZaren uneko karga bistaratzen du. +Name[eu]=PUZaren monitorea diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_eu.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_eu.ts new file mode 100644 index 0000000..5450df6 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_eu.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + PUZaren karga %%1 + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + LxQt PUZaren kargaren ezarpenak + + + + CPU Load Settings + + + + + General + Orokorra + + + + Show text + Erakutsi testua + + + + Update interval: + Eguneratze-tartea: + + + + sec + seg + + + + Bar orientation: + Barraren orientazioa: + + + + Bar width: + + + + + Bottom up + Behetik gora + + + + Top down + Goitik behera + + + + Left to right + Ezkerretik eskuinera + + + + Right to left + Eskuinetik ezkerrera + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_fi.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_fi.desktop new file mode 100644 index 0000000..8d76e41 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_fi.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[fi]=Suorittimen kuormituksen seuranta +Name[fi]=Suorittimen kuormitus diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_fi.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_fi.ts new file mode 100644 index 0000000..bb69382 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_fi.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Suoritinkuorma %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + LxQtin suoritinkuorman asetukset + + + + CPU Load Settings + + + + + General + Yleiset + + + + Show text + Näytä teksti + + + + Update interval: + Päivitysväli: + + + + sec + s + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_fr_FR.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_fr_FR.ts new file mode 100644 index 0000000..5d8199f --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_fr_FR.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Généraux + + + + Show text + Montrer le texte + + + + Update interval: + + + + + sec + + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_hr.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_hr.ts new file mode 100644 index 0000000..12ae080 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_hr.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Učitavanje procesora %1 + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Postavke učitavanja procesora + + + + General + Općenito + + + + Show text + Pokaži tekst + + + + Update interval: + Interval ažuriranja: + + + + sec + sek + + + + Bar orientation: + Orijentacija trake: + + + + Bar width: + Duljina trake: + + + + Bottom up + Odozdo gore + + + + Top down + Odozgo dolje + + + + Left to right + S lijeva na desno + + + + Right to left + S desna na lijevo + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_hu.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_hu.desktop new file mode 100644 index 0000000..efabda5 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_hu.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[hu]=Megjeleníti a processzorterhelést. +Name[hu]=CPU-figyelő diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_hu.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_hu.ts new file mode 100644 index 0000000..e7f92b8 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_hu.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Általános + + + + Show text + Szöveg megjelenítése + + + + Update interval: + Frissítési köz: + + + + sec + mp + + + + Bar orientation: + Sáv irány: + + + + Bar width: + Sáv szélesség: + + + + Bottom up + Felfele + + + + Top down + Lefele + + + + Left to right + Jobbra + + + + Right to left + Balra + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_hu_HU.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_hu_HU.ts new file mode 100644 index 0000000..62ec026 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_hu_HU.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Általános + + + + Show text + Szöveg megjelenítése + + + + Update interval: + Frissítési köz: + + + + sec + mp + + + + Bar orientation: + Sáv irány: + + + + Bar width: + Sáv szélesség: + + + + Bottom up + Felfele + + + + Top down + Lefele + + + + Left to right + Jobbra + + + + Right to left + Balra + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.desktop new file mode 100644 index 0000000..76de5a9 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[it_IT]=Monitor del carico del processore +Name[it_IT]=Carico del processore diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.ts new file mode 100644 index 0000000..5d46003 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_it_IT.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Carico del processore %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Impostazioni del carico del processore di LxQt + + + + CPU Load Settings + + + + + General + Generale + + + + Show text + Mostra testo + + + + Update interval: + Intervallo di aggiornamento: + + + + sec + sec + + + + Bar orientation: + Orientamento della barra: + + + + Bar width: + + + + + Bottom up + Dal basso all'alto + + + + Top down + Dall'alto al basso + + + + Left to right + Da sinistra a destra + + + + Right to left + Da destra a sinistra + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ja.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_ja.desktop new file mode 100644 index 0000000..fd254cb --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ja.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=CPU monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[ja]=現在のCPUの負荷を表示します +Name[ja]=CPUモニター diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ja.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_ja.ts new file mode 100644 index 0000000..b86f71b --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ja.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + CPU負荷 %1% + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + CPUモニターの設定 + + + + General + 一般 + + + + Show text + テキストを表示 + + + + Update interval: + 更新頻度: + + + + sec + + + + + Bar orientation: + バーの向き: + + + + Bar width: + + + + + Bottom up + 下から上へ + + + + Top down + 上から下へ + + + + Left to right + 左から右へ + + + + Right to left + 右から左へ + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_lt.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_lt.desktop new file mode 100644 index 0000000..cf6a18a --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_lt.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[lt]=Procesoriaus stebėtojas +Name[lt]=Procesoriaus apkrova diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_lt.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_lt.ts new file mode 100644 index 0000000..ffd5557 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_lt.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Pagrindinės + + + + Show text + Rodyti tekstą + + + + Update interval: + + + + + sec + + + + + Bar orientation: + + + + + Bar width: + + + + + Bottom up + + + + + Top down + + + + + Left to right + + + + + Right to left + + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_nl.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_nl.desktop new file mode 100644 index 0000000..04271be --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_nl.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[nl]=CPU belasting monitor +Name[nl]=Cpu belasting diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_nl.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_nl.ts new file mode 100644 index 0000000..b7bc8eb --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_nl.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Cpu-belasting %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Instellingen voor CPU-belasting van LxQt + + + + CPU Load Settings + + + + + General + Algemeen + + + + Show text + Tekst weergeven + + + + Update interval: + Tussenpoze voor bijwerken: + + + + sec + sec + + + + Bar orientation: + Balkoriëntatie: + + + + Bar width: + + + + + Bottom up + Van beneden naar boven + + + + Top down + Van boven naar beneden + + + + Left to right + Van links naar rechts + + + + Right to left + Van rechts naar links + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.desktop new file mode 100644 index 0000000..1d2f883 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[pl_PL]=Monitor obciążenia CPU +Name[pl_PL]=Obciążenie CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.ts new file mode 100644 index 0000000..9ebbfab --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pl_PL.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Obciążenie CPU %1% + + + + CPU load %1% + Obciążenie procesora %1% + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Ustawienia LxQt CPU Load + + + + CPU Load Settings + Obciążenie procesora - ustawienia + + + + General + Ogólne + + + + Show text + Pokaż tekst + + + + Update interval: + Odświeżanie widoku: + + + + sec + sek + + + + Bar orientation: + Orientacja paska stanu + + + + Bar width: + + + + + Bottom up + Z dołu do góry + + + + Top down + Z góry na dół + + + + Left to right + Lewo na prawo + + + + Right to left + Prawo na lewo + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pt.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_pt.desktop new file mode 100644 index 0000000..cabb08a --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pt.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Cpu monitor +Comment=Displays the current CPU load. + +# Translations +Name[pt]=Carga do CPU +Comment[pt]=Monitor de carga do CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pt.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_pt.ts new file mode 100644 index 0000000..1061704 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pt.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Carga do cpu %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Definições da Carga do cpu + + + + CPU Load Settings + + + + + General + Geral + + + + Show text + Mostrar texto + + + + Update interval: + Intervalo: + + + + sec + seg. + + + + Bar orientation: + Orientação da barra: + + + + Bar width: + + + + + Bottom up + De baixo para cima + + + + Top down + De cima para baixo + + + + Left to right + Da esquerda para a direita + + + + Right to left + Da direita para a esquerda + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.desktop new file mode 100644 index 0000000..5be6c9a --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[pt_BR]=Monitor de carga da CPU +Name[pt_BR]=Carga da CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.ts new file mode 100644 index 0000000..c3b67e7 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_pt_BR.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Carga da Cpu %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Configurações da Carga Da Cpu + + + + CPU Load Settings + + + + + General + Geral + + + + Show text + Exibir texto + + + + Update interval: + Intervalo de atualização: + + + + sec + seg + + + + Bar orientation: + Orientação da barra: + + + + Bar width: + + + + + Bottom up + De baixo para cima + + + + Top down + De cima para baixo + + + + Left to right + Da esquerda para a direita + + + + Right to left + Da direita para a esquerda + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.desktop new file mode 100644 index 0000000..d0cdb2d --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[ro_RO]=Monitor de încărcare a procesorului +Name[ro_RO]=Afișează gradul de încărcare al procesorului diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.ts new file mode 100644 index 0000000..2709dad --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ro_RO.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Încărcare procesor %1% + + + + CPU load %1% + Încărcare procesor + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Setări încărcare procesor LxQt + + + + CPU Load Settings + Setări încărcare procesor + + + + General + General + + + + Show text + Afișează text + + + + Update interval: + Interval de actualizare + + + + sec + sec + + + + Bar orientation: + Orientare bară: + + + + Bar width: + Lățime bară: + + + + Bottom up + De jos în sus + + + + Top down + De sus în jos + + + + Left to right + De la stânga la dreapta + + + + Right to left + De la dreapta la stânga + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ru.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_ru.desktop new file mode 100644 index 0000000..6a10460 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ru.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[ru]=Отображает текущую загрузку процессора. +Name[ru]=Монитор загрузки процессора + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ru.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_ru.ts new file mode 100644 index 0000000..31ab786 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ru.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Загрузка процессора %1% + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Настройки загрузки процессора + + + + General + Общие + + + + Show text + Показать текст + + + + Update interval: + Интервал обновления: + + + + sec + сек + + + + Bar orientation: + Расположение панели: + + + + Bar width: + + + + + Bottom up + Снизу вверх + + + + Top down + Сверху вниз + + + + Left to right + Слева направо + + + + Right to left + Справа налево + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.desktop new file mode 100644 index 0000000..a750ca5 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[ru_RU]=Отображает текущую загрузку процессора. +Name[ru_RU]=Монитор загрузки процессора diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.ts new file mode 100644 index 0000000..b40c0ff --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_ru_RU.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Загрузка процессора %1% + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Настройки загрузки процессора + + + + General + Общие + + + + Show text + Показать текст + + + + Update interval: + Интервал обновления: + + + + sec + сек + + + + Bar orientation: + Расположение панели: + + + + Bar width: + + + + + Bottom up + Снизу вверх + + + + Top down + Сверху вниз + + + + Left to right + Слева направо + + + + Right to left + Справа налево + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_sl.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_sl.desktop new file mode 100644 index 0000000..16f7101 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_sl.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[sl]=Nadzornik obremenitve CPE +Name[sl]=Obremenitev CPE diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_sl.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_sl.ts new file mode 100644 index 0000000..99a7356 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_sl.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Uporaba CPE: %1 % + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Nastavitve prikaza uporabe CPE za LXQt + + + + CPU Load Settings + + + + + General + Splošno + + + + Show text + Pokaži besedilo + + + + Update interval: + Hitrost osveževanja: + + + + sec + s + + + + Bar orientation: + Usmerjenost vrstice: + + + + Bar width: + + + + + Bottom up + Od spodaj navzgor + + + + Top down + Od zgoraj navzdol + + + + Left to right + Iz leve proti desni + + + + Right to left + Iz desne proti levi + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.desktop new file mode 100644 index 0000000..1a089c9 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[th_TH]=เฝ้าสังเกตการทำงานซีพียู +Name[th_TH]=การทำงานซีพียู diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.ts new file mode 100644 index 0000000..0345d68 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_th_TH.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Cpu โหลด %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + ค่าตั้ง Cpu โหลด LxQt + + + + CPU Load Settings + + + + + General + ทั่วไป + + + + Show text + แสดงข้อความ + + + + Update interval: + ทิ้งระยะการปรับข้อมูล: + + + + sec + วิ + + + + Bar orientation: + การจัดเรียง: + + + + Bar width: + + + + + Bottom up + ล่างขึ้นบน + + + + Top down + บนลงล่าง + + + + Left to right + ซ้ายไปขวา + + + + Right to left + ขวาไปซ้าย + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_tr.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_tr.desktop new file mode 100644 index 0000000..5abb7c9 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_tr.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[tr]=İşlemci Yükü izleyici +Name[tr]=İşlemci Yükü diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_tr.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_tr.ts new file mode 100644 index 0000000..602b644 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_tr.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + İşlemci yükü %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + LxQt İşlemci Yükü ayarları + + + + CPU Load Settings + + + + + General + Genel + + + + Show text + Metin göster + + + + Update interval: + Güncelleme aralığı: + + + + sec + sn + + + + Bar orientation: + Çubuk yönelimi: + + + + Bar width: + + + + + Bottom up + Aşağıdan yukarı + + + + Top down + Yukarıdan aşağı + + + + Left to right + Soldan sağa + + + + Right to left + Sağdan sola + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_uk.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_uk.desktop new file mode 100644 index 0000000..d5ef8d8 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_uk.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[uk]=Показує поточне навантаження CPU. +Name[uk]=Монітор CPU diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_uk.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_uk.ts new file mode 100644 index 0000000..2145c8e --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_uk.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + Завантаження Cpu %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + Налаштування завантаження ЦП LxQt + + + + CPU Load Settings + + + + + General + Загальне + + + + Show text + Показувати текст + + + + Update interval: + Період поновлення: + + + + sec + сек + + + + Bar orientation: + Напрямок планки: + + + + Bar width: + + + + + Bottom up + Знизу вверх + + + + Top down + Зверху вниз + + + + Left to right + Зліва направо + + + + Right to left + Зправа наліво + + + diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.desktop new file mode 100644 index 0000000..5cd9ddd --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[zh_CN]=CPU 负载监视器 +Name[zh_CN]=CPU 负载 diff --git a/plugin-cpuload/translations/cpuload_de_DE.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.ts similarity index 68% rename from plugin-cpuload/translations/cpuload_de_DE.ts rename to lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.ts index 6001586..149c8f8 100644 --- a/plugin-cpuload/translations/cpuload_de_DE.ts +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_CN.ts @@ -1,14 +1,14 @@ - + LxQtCpuLoad Cpu load %1% - Cpu Last %1% + Cpu 负载 %1% - + CPU load %1% @@ -17,7 +17,7 @@ LxQtCpuLoadConfiguration LxQt Cpu Load settings - LxQt Cpu Last Einstellungen + LxQt Cpu 负载设置 @@ -27,47 +27,52 @@ General - Allgemein + 常规 Show text - Zeige Text + 显示文本 Update interval: - Aktualisierungs Intervall: + 更新间隔: sec - Sek + Bar orientation: - Balken Orientierung + 状态栏方向: - + + Bar width: + + + + Bottom up - Von unten nach oben + 自下而上 - + Top down - Von oben nach unten + 自上而下 - + Left to right - Von Links nach Rechts + 从左到右 - + Right to left - Von Rechts nach Links + 从右到左 diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.desktop b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.desktop new file mode 100644 index 0000000..481a589 --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Cpu monitor +Comment=Displays the current CPU load. + + + + +# Translations +Comment[zh_TW]=CPU使用監視器 +Name[zh_TW]=CPU使用 diff --git a/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.ts b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.ts new file mode 100644 index 0000000..b3893db --- /dev/null +++ b/lxqt-panel/plugin-cpuload/translations/cpuload_zh_TW.ts @@ -0,0 +1,78 @@ + + + + + LxQtCpuLoad + + Cpu load %1% + CPU使用率 %1% + + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + LxQt Cpu Load settings + LxQtCPU使用率提示設定 + + + + CPU Load Settings + + + + + General + 一般 + + + + Show text + 顯示文字 + + + + Update interval: + 更新間隔 + + + + sec + + + + + Bar orientation: + 進度條方向 + + + + Bar width: + + + + + Bottom up + 由下至上 + + + + Top down + 由上至下 + + + + Left to right + 由左至右 + + + + Right to left + 由右至左 + + + diff --git a/lxqt-panel/plugin-desktopswitch/CMakeLists.txt b/lxqt-panel/plugin-desktopswitch/CMakeLists.txt new file mode 100644 index 0000000..6f3b792 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/CMakeLists.txt @@ -0,0 +1,22 @@ +set(PLUGIN "desktopswitch") + +set(HEADERS + desktopswitch.h + desktopswitchbutton.h + desktopswitchconfiguration.h +) + +set(SOURCES + desktopswitch.cpp + desktopswitchbutton.cpp + desktopswitchconfiguration.cpp +) + +set(UIS + desktopswitchconfiguration.ui +) + + +set(LIBRARIES ${LIBRARIES} lxqt lxqt-globalkeys) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitch.cpp b/lxqt-panel/plugin-desktopswitch/desktopswitch.cpp new file mode 100644 index 0000000..26c9434 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitch.cpp @@ -0,0 +1,262 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "desktopswitch.h" +#include "desktopswitchbutton.h" +#include "desktopswitchconfiguration.h" + +#define DEFAULT_SHORTCUT_TEMPLATE QStringLiteral("Control+F%1") + +DesktopSwitch::DesktopSwitch(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo), + m_pSignalMapper(new QSignalMapper(this)), + m_desktopCount(KWindowSystem::numberOfDesktops()), + mRows(-1), + mDesktops(new NETRootInfo(QX11Info::connection(), NET::NumberOfDesktops | NET::CurrentDesktop | NET::DesktopNames, NET::WM2DesktopLayout)), + mLabelType(static_cast(-1)) +{ + m_buttons = new QButtonGroup(this); + connect (m_pSignalMapper, SIGNAL(mapped(int)), this, SLOT(setDesktop(int))); + + mLayout = new LxQt::GridLayout(&mWidget); + mWidget.setLayout(mLayout); + + settingsChanged(); + + onCurrentDesktopChanged(KWindowSystem::currentDesktop()); + QTimer::singleShot(0, this, SLOT(registerShortcuts())); + + connect(m_buttons, SIGNAL(buttonClicked(int)), this, SLOT(setDesktop(int))); + + connect(KWindowSystem::self(), SIGNAL(numberOfDesktopsChanged(int)), SLOT(onNumberOfDesktopsChanged(int))); + connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), SLOT(onCurrentDesktopChanged(int))); + connect(KWindowSystem::self(), SIGNAL(desktopNamesChanged()), SLOT(onDesktopNamesChanged())); + + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged), + this, &DesktopSwitch::onWindowChanged); +} + +void DesktopSwitch::registerShortcuts() +{ + // Register shortcuts to change desktop + GlobalKeyShortcut::Action * gshortcut; + QString path; + QString description; + for (int i = 0; i < 12; ++i) + { + path = QString("/panel/%1/desktop_%2").arg(settings()->group()).arg(i + 1); + description = tr("Switch to desktop %1").arg(i + 1); + + gshortcut = GlobalKeyShortcut::Client::instance()->addAction(QStringLiteral(), path, description, this); + if (nullptr != gshortcut) + { + m_keys << gshortcut; + connect(gshortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); + connect(gshortcut, SIGNAL(activated()), m_pSignalMapper, SLOT(map())); + m_pSignalMapper->setMapping(gshortcut, i); + } + } +} + +void DesktopSwitch::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + disconnect(shortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); + + const int i = m_keys.indexOf(shortcut); + Q_ASSERT(-1 != i); + + if (shortcut->shortcut().isEmpty()) + { + shortcut->changeShortcut(DEFAULT_SHORTCUT_TEMPLATE.arg(i + 1)); + } +} + +void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2) +{ + if (properties.testFlag(NET::WMState)) + { + KWindowInfo info = KWindowInfo(id, NET::WMDesktop | NET::WMState); + int desktop = info.desktop(); + if (!info.valid() || info.onAllDesktops()) + return; + else + { + DesktopSwitchButton *button = static_cast(m_buttons->button(desktop - 1)); + if(button) + button->setUrgencyHint(id, info.hasState(NET::DemandsAttention)); + } + } +} + +void DesktopSwitch::refresh() +{ + QList btns = m_buttons->buttons(); + + int i = 0; + const int current_cnt = btns.count(); + const int border = qMin(btns.count(), m_desktopCount); + //update existing buttons + for ( ; i < border; ++i) + { + ((DesktopSwitchButton*)m_buttons->button(i))->update(i, mLabelType, + KWindowSystem::desktopName(i + 1).isEmpty() ? + tr("Desktop %1").arg(i + 1) : + KWindowSystem::desktopName(i + 1)); + } + + //create new buttons (if neccessary) + QAbstractButton *b; + for ( ; i < m_desktopCount; ++i) + { + b = new DesktopSwitchButton(&mWidget, i, mLabelType, + KWindowSystem::desktopName(i+1).isEmpty() ? + tr("Desktop %1").arg(i+1) : + KWindowSystem::desktopName(i+1)); + mWidget.layout()->addWidget(b); + m_buttons->addButton(b, i); + } + + //delete unneeded buttons (if neccessary) + for ( ; i < current_cnt; ++i) + { + b = m_buttons->buttons().last(); + m_buttons->removeButton(b); + mWidget.layout()->removeWidget(b); + delete b; + } +} + +DesktopSwitch::~DesktopSwitch() +{ +} + +void DesktopSwitch::setDesktop(int desktop) +{ + KWindowSystem::setCurrentDesktop(desktop + 1); +} + +void DesktopSwitch::onNumberOfDesktopsChanged(int count) +{ + qDebug() << "Desktop count changed from" << m_desktopCount << "to" << count; + m_desktopCount = count; + refresh(); +} + +void DesktopSwitch::onCurrentDesktopChanged(int current) +{ + QAbstractButton *button = m_buttons->button(current - 1); + if (button) + button->setChecked(true); +} + +void DesktopSwitch::onDesktopNamesChanged() +{ + refresh(); +} + +void DesktopSwitch::settingsChanged() +{ + int value = settings()->value("rows", 1).toInt(); + if (mRows != value) + { + mRows = value; + realign(); + } + value = settings()->value("labelType", DesktopSwitchButton::LABEL_TYPE_NUMBER).toInt(); + if (mLabelType != static_cast(value)) + { + mLabelType = static_cast(value); + refresh(); + } +} + +void DesktopSwitch::realign() +{ + int columns = static_cast(ceil(static_cast(m_desktopCount) / mRows)); + mLayout->setEnabled(false); + if (panel()->isHorizontal()) + { + mLayout->setRowCount(mRows); + mLayout->setColumnCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, columns, mRows, NET::DesktopLayoutCornerTopLeft); + } + else + { + mLayout->setColumnCount(mRows); + mLayout->setRowCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, mRows, columns, NET::DesktopLayoutCornerTopLeft); + } + mLayout->setEnabled(true); +} + +QDialog *DesktopSwitch::configureDialog() +{ + return new DesktopSwitchConfiguration(settings()); +} + +DesktopSwitchWidget::DesktopSwitchWidget(): + QFrame(), + m_mouseWheelThresholdCounter(0) +{ +} + +void DesktopSwitchWidget::wheelEvent(QWheelEvent *e) +{ + // Without some sort of threshold which has to be passed, scrolling is too sensitive + m_mouseWheelThresholdCounter -= e->delta(); + // If the user hasn't scrolled far enough in one direction (positive or negative): do nothing + if(abs(m_mouseWheelThresholdCounter) < 100) + return; + + int max = KWindowSystem::numberOfDesktops(); + int delta = e->delta() < 0 ? 1 : -1; + int current = KWindowSystem::currentDesktop() + delta; + + if (current > max){ + current = 1; + } + else if (current < 1) + current = max; + + m_mouseWheelThresholdCounter = 0; + KWindowSystem::setCurrentDesktop(current); +} diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitch.h b/lxqt-panel/plugin-desktopswitch/desktopswitch.h new file mode 100644 index 0000000..23ea20a --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitch.h @@ -0,0 +1,110 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DESKTOPSWITCH_H +#define DESKTOPSWITCH_H + +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include + +#include "desktopswitchbutton.h" + +class QSignalMapper; +class QButtonGroup; +class NETRootInfo; +namespace LxQt { +class GridLayout; +} + +class DesktopSwitchWidget: public QFrame +{ + Q_OBJECT +public: + DesktopSwitchWidget(); + +private: + int m_mouseWheelThresholdCounter; + +protected: + void wheelEvent(QWheelEvent* e); +}; + +/** + * @brief Desktop switcher. A very simple one... + */ +class DesktopSwitch : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + DesktopSwitch(const ILxQtPanelPluginStartupInfo &startupInfo); + ~DesktopSwitch(); + + QString themeId() const { return "DesktopSwitch"; } + QWidget *widget() { return &mWidget; } + bool isSeparate() const { return true; } + void realign(); + + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + +private: + QButtonGroup * m_buttons; + QList m_keys; + QSignalMapper* m_pSignalMapper; + int m_desktopCount; + DesktopSwitchWidget mWidget; + LxQt::GridLayout *mLayout; + int mRows; + QScopedPointer mDesktops; + DesktopSwitchButton::LabelType mLabelType; + + void refresh(); + +private slots: + void setDesktop(int desktop); + void onNumberOfDesktopsChanged(int); + void onCurrentDesktopChanged(int); + void onDesktopNamesChanged(); + virtual void settingsChanged(); + void registerShortcuts(); + void shortcutRegistered(); + void onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2); +}; + +class DesktopSwitchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new DesktopSwitch(startupInfo);} +}; + +#endif diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.cpp b/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.cpp new file mode 100644 index 0000000..b458780 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.cpp @@ -0,0 +1,79 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include +#include +#include +#include + +#include "desktopswitchbutton.h" + +DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title) + : QToolButton(parent), + mUrgencyHint(false) +{ + update(index, labelType, title); + + setCheckable(true); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +} + +void DesktopSwitchButton::update(int index, LabelType labelType, const QString &title) +{ + switch (labelType) + { + case LABEL_TYPE_NAME: + setText(title); + break; + + default: // LABEL_TYPE_NUMBER + setText(QString::number(index + 1)); + } + + if (!title.isEmpty()) + { + setToolTip(title); + } +} + +void DesktopSwitchButton::setUrgencyHint(WId id, bool urgent) +{ + if (urgent) + mUrgentWIds.insert(id); + else + mUrgentWIds.remove(id); + + if (mUrgencyHint != !mUrgentWIds.empty()) + { + mUrgencyHint = !mUrgentWIds.empty(); + setProperty("urgent", mUrgencyHint); + style()->unpolish(this); + style()->polish(this); + QToolButton::update(); + } +} diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.h b/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.h new file mode 100644 index 0000000..18bebcc --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitchbutton.h @@ -0,0 +1,62 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DESKTOPSWITCHBUTTON_H +#define DESKTOPSWITCHBUTTON_H + +#include +#include + +namespace GlobalKeyShortcut +{ +class Action; +} + +class DesktopSwitchButton : public QToolButton +{ + Q_OBJECT + +public: + enum LabelType { // Must match with combobox indexes + LABEL_TYPE_NUMBER = 0, + LABEL_TYPE_NAME = 1 + }; + + DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title=QString()); + void update(int index, LabelType labelType, const QString &title); + + void setUrgencyHint(WId, bool); + +private: + + // for urgency hint handling + bool mUrgencyHint; + QSet mUrgentWIds; +}; + +#endif diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.cpp b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.cpp new file mode 100644 index 0000000..62457b6 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "desktopswitchconfiguration.h" +#include "ui_desktopswitchconfiguration.h" +#include +#include + +DesktopSwitchConfiguration::DesktopSwitchConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::DesktopSwitchConfiguration) + , mSettings(settings) + , mOldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DesktopSwitchConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + + connect(ui->rowsSB, SIGNAL(valueChanged(int)), this, SLOT(rowsChanged(int))); + connect(ui->labelTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(labelTypeChanged(int))); + + loadDesktopsNames(); +} + +DesktopSwitchConfiguration::~DesktopSwitchConfiguration() +{ + delete ui; +} + +void DesktopSwitchConfiguration::loadSettings() +{ + ui->rowsSB->setValue(mSettings->value("rows", 1).toInt()); + ui->labelTypeCB->setCurrentIndex(mSettings->value("labelType", 0).toInt()); +} + +void DesktopSwitchConfiguration::loadDesktopsNames() +{ + int n = KWindowSystem::numberOfDesktops(); + for (int i = 1; i <= n; i++) + { + QLineEdit *edit = new QLineEdit(KWindowSystem::desktopName(i), this); + ((QFormLayout *) ui->namesGroupBox->layout())->addRow(QString("Desktop %1:").arg(i), edit); + + // C++11 rocks! + QTimer *timer = new QTimer(this); + timer->setInterval(400); + timer->setSingleShot(true); + connect(timer, &QTimer::timeout, [=] { KWindowSystem::setDesktopName(i, edit->text()); }); + connect(edit, &QLineEdit::textEdited, [=] { timer->start(); }); + } +} + +void DesktopSwitchConfiguration::rowsChanged(int value) +{ + mSettings->setValue("rows", value); +} + +void DesktopSwitchConfiguration::labelTypeChanged(int type) +{ + mSettings->setValue("labelType", type); +} + +void DesktopSwitchConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.h b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.h new file mode 100644 index 0000000..a2338c8 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.h @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DESKTOPSWITCHCERCONFIGURATION_H +#define DESKTOPSWITCHCERCONFIGURATION_H + +#include + +#include +#include +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class DesktopSwitchConfiguration; +} + +class DesktopSwitchConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit DesktopSwitchConfiguration(QSettings *settings, QWidget *parent = 0); + ~DesktopSwitchConfiguration(); + +private: + Ui::DesktopSwitchConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void loadDesktopsNames(); + void dialogButtonsAction(QAbstractButton *btn); + void rowsChanged(int value); + void labelTypeChanged(int type); +}; + +#endif // DESKTOPSWITCHCERCONFIGURATION_H diff --git a/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.ui b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.ui new file mode 100644 index 0000000..e387800 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/desktopswitchconfiguration.ui @@ -0,0 +1,89 @@ + + + DesktopSwitchConfiguration + + + + 0 + 0 + 213 + 207 + + + + DesktopSwitch settings + + + + + + Rows + + + + + + 1 + + + 40 + + + 1 + + + + + + + Desktop labels: + + + + + + + Number of rows: + + + + + + + + Numbers + + + + + Names + + + + + + + + + + + Desktop names + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + diff --git a/lxqt-panel/plugin-desktopswitch/resources/desktopswitch.desktop.in b/lxqt-panel/plugin-desktopswitch/resources/desktopswitch.desktop.in new file mode 100644 index 0000000..36e8714 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/resources/desktopswitch.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. +Icon=user-desktop + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch.ts new file mode 100644 index 0000000..8e780fe --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.desktop new file mode 100644 index 0000000..3336011 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=السماح بتغيير أسطح المكتب اﻻفتراضيَّة +Name[ar]=مفتاح تبديل سطح المكتب diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.ts new file mode 100644 index 0000000..9b4b8c2 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ar.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + سطح المكتب %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/plugin-desktopswitch/translations/desktopswitch_de_DE.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.desktop similarity index 63% rename from plugin-desktopswitch/translations/desktopswitch_de_DE.desktop rename to lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.desktop index 6ba8d0b..6ca2359 100644 --- a/plugin-desktopswitch/translations/desktopswitch_de_DE.desktop +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.desktop @@ -8,5 +8,5 @@ Comment=Allows easy switching between virtual desktops. # Translations -Comment[de_DE]=Wechsel zwischen virtuellen Arbeitsflächen erlauben -Name[de_DE]=Arbeitsflächen-Umschalter +Comment[cs]=Povolit přepínání virtuálních ploch +Name[cs]=Přepínání ploch diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.ts new file mode 100644 index 0000000..4ed8a99 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Plocha %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.desktop new file mode 100644 index 0000000..a9000a5 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Povolit přepínání virtuálních pracovních ploch +Name[cs_CZ]=Přepínání pracovních ploch diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts new file mode 100644 index 0000000..25bd4e7 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Plocha %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.desktop new file mode 100644 index 0000000..c06691c --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Tillader skift imellem virtuelle skriveborde +Name[da]=Skrivebordsskifter diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.ts new file mode 100644 index 0000000..ec70c62 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Skrivebord %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.desktop new file mode 100644 index 0000000..af439a1 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Skift imellem virtuelle skriveborde +Name[da_DK]=Skrivebords Skifter diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.ts new file mode 100644 index 0000000..4b7d15c --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_da_DK.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Skrivebord %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.desktop new file mode 100644 index 0000000..d914d52 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Arbeitsflächenumschalter +Comment[de]=Zwischen den virtuellen Arbeitsflächen umschalten diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.ts new file mode 100644 index 0000000..70e8cb8 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_de.ts @@ -0,0 +1,56 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Zu Arbeitsfläche %1 wechseln + + + + + Desktop %1 + Arbeitsfläche %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Arbeitsflächenumschalter - Einstellungen + + + + Rows + Zeilen + + + + Desktop labels: + Arbeitsflächenbezeichnungen: + + + + Number of rows: + Anzahl der Zeilen: + + + + Numbers + Ziffern + + + + Names + Namen + + + + Desktop names + Arbeitsflächenbezeichnungen + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.desktop new file mode 100644 index 0000000..f13027f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Να επιτρέπεται η εναλλαγή εικονικών επιφανειών εργασίας +Name[el_GR]=Εναλλαγή επιφάνειας εργασίας diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.ts new file mode 100644 index 0000000..5324f55 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_el_GR.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Επιφάνεια εργασίας %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.desktop new file mode 100644 index 0000000..dfe90f3 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Permesi ŝaltadon de virtualaj labortabloj +Name[eo]=Ŝalto de labortabloj diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.ts new file mode 100644 index 0000000..d22161e --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eo.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Labortablo %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.desktop new file mode 100644 index 0000000..8866056 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Permite cambiar entre escritorios virtuales +Name[es]=Cambiador de escritorios diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.ts new file mode 100644 index 0000000..d661b75 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Escritorio %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_UY.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_UY.ts new file mode 100644 index 0000000..3139142 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_UY.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Escritorio %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.desktop new file mode 100644 index 0000000..067654d --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Permitir cambiar a escritorios virtuales +Name[es_VE]=Cambiador de Escritorios diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.ts new file mode 100644 index 0000000..c936769 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_es_VE.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Escritorio %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.desktop new file mode 100644 index 0000000..594692e --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Mahaigain birtualen artean modu errazean aldatzeko aukera eskaintzen du. +Name[eu]=Mahaigain-aldatzailea diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.ts new file mode 100644 index 0000000..e23ee1b --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_eu.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + %1 mahaigaina + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.desktop new file mode 100644 index 0000000..0bb615b --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Vaihda virtuaalisten työpöytien välillä +Name[fi]=Työpöydän vaihtaja diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.ts new file mode 100644 index 0000000..5d78386 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fi.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Työpöytä %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.desktop new file mode 100644 index 0000000..2458f8c --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Autoriser à basculer entre les bureaux virtuels +Name[fr_FR]=Changeur de bureau diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts new file mode 100644 index 0000000..884e24b --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Bureau %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hr.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hr.ts new file mode 100644 index 0000000..68078e7 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hr.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Prebaci na radnu površinu %1 + + + + + Desktop %1 + Radna površina %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Postavke prebacivaša radnih površina + + + + Number of rows: + Broj redaka: + + + + Desktop labels: + + + + + Numbers + Brojevi + + + + Names + Imena + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.desktop new file mode 100644 index 0000000..2ed4c79 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Lehetővé teszi a virtuális asztalok közötti váltást +Name[hu]=Aszatlváltó diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.ts new file mode 100644 index 0000000..0c05cfb --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + %1. asztalra váltás + + + + + Desktop %1 + %1. asztal + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts new file mode 100644 index 0000000..4c43b72 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + %1. asztalra váltás + + + + + Desktop %1 + %1. asztal + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.desktop new file mode 100644 index 0000000..5f9296f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktopswitch +Comment=Allow to switch virtual desktops + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.ts new file mode 100644 index 0000000..053e80f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ia.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.desktop new file mode 100644 index 0000000..5f9296f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktopswitch +Comment=Allow to switch virtual desktops + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.ts new file mode 100644 index 0000000..f5ff166 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_id_ID.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.desktop new file mode 100644 index 0000000..f74f898 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Permette di passare ad altri desktop virtuali +Name[it_IT]=Cambia desktop diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.ts new file mode 100644 index 0000000..6d599e2 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_it_IT.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Desktop %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.desktop new file mode 100644 index 0000000..b187b22 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=仮想デスクトップの切り替えを可能にします +Name[ja]=デスクトップ切り替え diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.ts new file mode 100644 index 0000000..6f5e4c9 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ja.ts @@ -0,0 +1,53 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + デスクトップ%1に切り替える + + + + + Desktop %1 + デスクトップ %1 + + + + DesktopSwitchButton + + Switch to desktop %1 + デスクトップ%1に切り替える + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.desktop new file mode 100644 index 0000000..5f9296f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktopswitch +Comment=Allow to switch virtual desktops + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.ts new file mode 100644 index 0000000..44ccfb1 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ko.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.desktop new file mode 100644 index 0000000..5e83044 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Leidžia judėti tarp virtualių darbalaukių +Name[lt]=Darbalaukių perjungimas diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.ts new file mode 100644 index 0000000..99c393c --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_lt.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + %1 darbalaukis + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.desktop new file mode 100644 index 0000000..21e27ca --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Wisselen tussen virtuele-bureaubladen toestaan +Name[nl]=Wissel bureaublad diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.ts new file mode 100644 index 0000000..977987b --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_nl.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Bureaublad %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl.desktop new file mode 100644 index 0000000..254ffc4 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Pozwala przełączać się pomiędzy writualnymi pulpitami +Name[pl]=Obszary robocze diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.desktop new file mode 100644 index 0000000..2745b17 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Zezwól na przełączanie między pulpitami +Name[pl_PL]=Zmień pulpit diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts new file mode 100644 index 0000000..3e7c7f3 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Pulpit %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.desktop new file mode 100644 index 0000000..f570b8e --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Alternador de áreas de trabalho +Comment[pt]=Permite trocar entre as áreas de trabalho diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.ts new file mode 100644 index 0000000..b71d7a6 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Área de trabalho %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.desktop new file mode 100644 index 0000000..f46fa51 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Permite alternar áreas de trabalho virtuais +Name[pt_BR]=Alternador de área de trabalho diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts new file mode 100644 index 0000000..e7b91e9 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Área de trabalho %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.desktop new file mode 100644 index 0000000..75f90d8 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Permite comutarea între ecranele virtuale +Name[ro_RO]=Comutare ecrane virtuale diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts new file mode 100644 index 0000000..93055b1 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Comutare la ecranul %1 + + + + + Desktop %1 + Ecranul %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Setäri de comutare a ecranului + + + + Number of rows: + Numărul de rânduri: + + + + Desktop labels: + Etichetele ecranelor: + + + + Numbers + Numere + + + + Names + Nume + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.desktop new file mode 100644 index 0000000..73b960e --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Позволяет легко переключаться между виртуальными рабочими столами. +Name[ru]=Переключение рабочих столов diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.ts new file mode 100644 index 0000000..dead547 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru.ts @@ -0,0 +1,53 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + + Desktop %1 + Рабочий стол %1 + + + + DesktopSwitchButton + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.desktop new file mode 100644 index 0000000..8096b0b --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Позволяет легко переключаться между виртуальными рабочими столами. +Name[ru_RU]=Переключение рабочих столов diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts new file mode 100644 index 0000000..95aa9c4 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts @@ -0,0 +1,53 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + + Desktop %1 + Рабочий стол %1 + + + + DesktopSwitchButton + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk.desktop new file mode 100644 index 0000000..01cd625 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Umožňuje prepínanie medzi virtuálnymi plochami +Name[sk]=Prepínač plôch diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts new file mode 100644 index 0000000..c5777c5 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Plocha %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.desktop new file mode 100644 index 0000000..44456a8 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Omogoča preklop med navideznimi namizji +Name[sl]=Desktopswitch diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.ts new file mode 100644 index 0000000..3b9d207 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sl.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Namizje %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr.desktop new file mode 100644 index 0000000..e6223e3 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Пребацујте виртуелне површи +Name[sr]=Пребацивач површи diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavian.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavian.desktop new file mode 100644 index 0000000..8ba6d4c --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Пребацивач површи +Comment[sr@ijekavian]=Пребацујте виртуелне површи diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..9e20fb5 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Prebacivač površi +Comment[sr@ijekavianlatin]=Prebacujte virtuelne površi diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.desktop new file mode 100644 index 0000000..3730920 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Prebacujte virtuelne površi +Name[sr@latin]=Prebacivač površi diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts new file mode 100644 index 0000000..1ab6a1d --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts new file mode 100644 index 0000000..bc8eaaa --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Површ %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts new file mode 100644 index 0000000..5001657 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Површ %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.desktop new file mode 100644 index 0000000..4ad3f83 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=อนุญาตให้ทำการสลับพื้นโต๊ะ +Name[th_TH]=สลับพื้นโต๊ะ diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.ts new file mode 100644 index 0000000..0f54e7a --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_th_TH.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + พื้นโต๊ะ %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.desktop new file mode 100644 index 0000000..9ea5b88 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Sanal masaüstleri arasında geçiş yapın +Name[tr]=Masaüstü değiştirici diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.ts new file mode 100644 index 0000000..c088b69 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_tr.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Masaüstü %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.desktop new file mode 100644 index 0000000..196c656 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Дозволяє легко перемикатися між віртуальними стільницями +Name[uk]=Перемикач стільниць diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.ts new file mode 100644 index 0000000..2d513d0 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_uk.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + Стільниця %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.GB2312.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.GB2312.desktop new file mode 100644 index 0000000..5f9296f --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktopswitch +Comment=Allow to switch virtual desktops + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.desktop new file mode 100644 index 0000000..6b6087d --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=在虚拟桌面间切换 +Name[zh_CN]=桌面切换 diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts new file mode 100644 index 0000000..96fe963 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + 桌面 %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.desktop b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.desktop new file mode 100644 index 0000000..969102a --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Desktop switcher +Comment=Allows easy switching between virtual desktops. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=允許切換虛擬桌面 +Name[zh_TW]=桌面切換 diff --git a/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts new file mode 100644 index 0000000..430f5d1 --- /dev/null +++ b/lxqt-panel/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + + + + + + Desktop %1 + 桌面 %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + + + + diff --git a/lxqt-panel/plugin-directorymenu/CMakeLists.txt b/lxqt-panel/plugin-directorymenu/CMakeLists.txt new file mode 100644 index 0000000..319b02d --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/CMakeLists.txt @@ -0,0 +1,23 @@ +set(PLUGIN "directorymenu") + +set(HEADERS + directorymenu.h + directorymenuconfiguration.h +) + +set(SOURCES + directorymenu.cpp + directorymenuconfiguration.cpp +) + +set(UIS + directorymenuconfiguration.ui +) + +set(LIBRARIES + ${LIBRARIES} + Qt5Xdg +) + +include ("../cmake/BuildPlugin.cmake") +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-directorymenu/directorymenu.cpp b/lxqt-panel/plugin-directorymenu/directorymenu.cpp new file mode 100644 index 0000000..4ffee7f --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/directorymenu.cpp @@ -0,0 +1,192 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is diinstributed 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#include "directorymenu.h" +#include +#include +#include +#include +#include + +#include + +DirectoryMenu::DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo), + mMenu(0), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + mOpenDirectorySignalMapper = new QSignalMapper(this); + mMenuSignalMapper = new QSignalMapper(this); + + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + mButton.setIcon(XdgIcon::fromTheme("folder")); + + connect(&mButton, SIGNAL(clicked()), this, SLOT(showMenu())); + connect(mOpenDirectorySignalMapper, SIGNAL(mapped(QString)), this, SLOT(openDirectory(QString))); + connect(mMenuSignalMapper, SIGNAL(mapped(QString)), this, SLOT(addMenu(QString))); + + settingsChanged(); +} + +DirectoryMenu::~DirectoryMenu() +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } +} + +void DirectoryMenu::showMenu() +{ + if(mBaseDirectory.exists()) + { + buildMenu(mBaseDirectory.absolutePath()); + } + else + { + buildMenu(QDir::homePath()); + } + + + int x=0, y=0; + + switch (panel()->position()) + { + case ILxQtPanel::PositionTop: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().bottom(); + break; + + case ILxQtPanel::PositionBottom: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().top() - mMenu->sizeHint().height(); + break; + + case ILxQtPanel::PositionLeft: + x = panel()->globalGometry().right(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + + case ILxQtPanel::PositionRight: + x = panel()->globalGometry().left() - mMenu->sizeHint().width(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + } + + // Just using Qt`s activateWindow() won't work on some WMs like Kwin. + // Solution is to execute menu 1ms later using timer + mButton.activateWindow(); + mMenu->exec(QPoint(x, y)); +} + +void DirectoryMenu::buildMenu(const QString& path) +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } + + mPathStrings.clear(); + + mMenu = new QMenu(); + + addActions(mMenu, path); +} + +void DirectoryMenu::openDirectory(const QString& path) +{ + QDesktopServices::openUrl(QUrl("file://" + QDir::toNativeSeparators(path))); +} + +void DirectoryMenu::addMenu(QString path) +{ + QSignalMapper* sender = (QSignalMapper* )QObject::sender(); + QMenu* parentMenu = (QMenu*) sender->mapping(path); + + if(parentMenu->isEmpty()) + { + addActions(parentMenu, path); + } +} + +void DirectoryMenu::addActions(QMenu* menu, const QString& path) +{ + mPathStrings.push_back(path); + + QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme("folder"), tr("Open")); + connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map())); + mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back()); + + menu->addSeparator(); + + QDir dir(path); + QFileInfoList list = dir.entryInfoList(); + + foreach (const QFileInfo& entry, list) + { + if(entry.isDir() && !entry.isHidden()) + { + mPathStrings.push_back(entry.fileName()); + + QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme("folder"), mPathStrings.back()); + + connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map())); + mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath()); + } + } +} + +QDialog* DirectoryMenu::configureDialog() +{ + return new DirectoryMenuConfiguration(*settings()); +} + +void DirectoryMenu::settingsChanged() +{ + mBaseDirectory.setPath(settings()->value("baseDirectory", QDir::homePath()).toString()); + + QString iconPath = settings()->value("icon", QString()).toString(); + QIcon icon = QIcon(iconPath); + + if(!icon.isNull()) + { + QIcon buttonIcon = QIcon(icon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + mButton.setIcon(buttonIcon); + return; + } + } + + mButton.setIcon(mDefaultIcon); +} diff --git a/lxqt-panel/plugin-directorymenu/directorymenu.h b/lxqt-panel/plugin-directorymenu/directorymenu.h new file mode 100644 index 0000000..a3825da --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/directorymenu.h @@ -0,0 +1,94 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DIRECTORYMENU_H +#define DIRECTORYMENU_H + +#include "../panel/ilxqtpanelplugin.h" + #include "directorymenuconfiguration.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +class DirectoryMenu : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo); + ~DirectoryMenu(); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "DirectoryMenu"; } + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + void settingsChanged(); + +private slots: + void showMenu(); + void openDirectory(const QString& path); + void addMenu(QString path); + +protected slots: + void buildMenu(const QString& path); + +private: + void addActions(QMenu* menu, const QString& path); + + QToolButton mButton; + QMenu *mMenu; + QSignalMapper *mOpenDirectorySignalMapper; + QSignalMapper *mMenuSignalMapper; + + QDir mBaseDirectory; + QIcon mDefaultIcon; + std::vector mPathStrings; +}; + +class DirectoryMenuLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new DirectoryMenu(startupInfo); + } +}; + + +#endif + diff --git a/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.cpp b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.cpp new file mode 100644 index 0000000..501d585 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.cpp @@ -0,0 +1,140 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include +#include +#include +#include + +#include + +#include "directorymenuconfiguration.h" +#include "ui_directorymenuconfiguration.h" + + +DirectoryMenuConfiguration::DirectoryMenuConfiguration(QSettings &settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::DirectoryMenuConfiguration), + mSettings(settings), + mOldSettings(settings), + mBaseDirectory(QDir::homePath()), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DirectoryMenuConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + ui->baseDirectoryB->setIcon(mDefaultIcon); + + connect(ui->baseDirectoryB, SIGNAL(clicked()), SLOT(showDirectoryDialog())); + connect(ui->iconB, SIGNAL(clicked()), SLOT(showIconDialog())); +} + +DirectoryMenuConfiguration::~DirectoryMenuConfiguration() +{ + delete ui; +} + +void DirectoryMenuConfiguration::loadSettings() +{ + mBaseDirectory.setPath(mSettings.value("baseDirectory", QDir::homePath()).toString()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + mIcon = mSettings.value("icon", QString()).toString(); + if(!mIcon.isNull()) + { + QIcon buttonIcon = QIcon(mIcon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + ui->iconB->setIcon(buttonIcon); + return; + } + } + + ui->iconB->setIcon(mDefaultIcon); +} + +void DirectoryMenuConfiguration::saveSettings() +{ + mSettings.setValue("baseDirectory", mBaseDirectory.absolutePath()); + mSettings.setValue("icon", mIcon); +} + +void DirectoryMenuConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + +void DirectoryMenuConfiguration::showDirectoryDialog() +{ + QFileDialog d(this, tr("Choose Base Directory"), mBaseDirectory.absolutePath()); + d.setFileMode(QFileDialog::Directory); + d.setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + mBaseDirectory.setPath(d.selectedFiles().front()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + saveSettings(); + } +} + +void DirectoryMenuConfiguration::showIconDialog() +{ + QFileDialog d(this, tr("Choose Icon"), QDir::homePath(), tr("Icons (*.png *.xpm *.jpg)")); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + QIcon newIcon = QIcon(d.selectedFiles().front()); + + if(newIcon.pixmap(QSize(24,24)).isNull()) + { + QMessageBox::warning(this, tr("Directory Menu"), tr("An error occurred while loading the icon.")); + return; + } + + ui->iconB->setIcon(newIcon); + mIcon = d.selectedFiles().front(); + saveSettings(); + } +} diff --git a/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.h b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.h new file mode 100644 index 0000000..9bdcca4 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.h @@ -0,0 +1,79 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DIRECTORYMENUCONFIGURATION_H +#define DIRECTORYMENUCONFIGURATION_H + +#include +#include +#include +#include +#include +#include + +#include + +namespace Ui { + class DirectoryMenuConfiguration; +} + +class DirectoryMenuConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit DirectoryMenuConfiguration(QSettings &settings, QWidget *parent = 0); + ~DirectoryMenuConfiguration(); + +private: + Ui::DirectoryMenuConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache mOldSettings; + QDir mBaseDirectory; + QString mIcon; + QIcon mDefaultIcon; + + /* + Read settings from conf file and put data into controls. + */ + void loadSettings(); + +private slots: + /* + Saves settings in conf file. + */ + void saveSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void showDirectoryDialog(); + void showIconDialog(); + +private: +}; + +#endif // DIRECTORYMENUCONFIGURATION_H diff --git a/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.ui b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.ui new file mode 100644 index 0000000..6a592d2 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/directorymenuconfiguration.ui @@ -0,0 +1,113 @@ + + + DirectoryMenuConfiguration + + + + 0 + 0 + 342 + 168 + + + + Directory Menu Settings + + + + + + Appearance + + + + + + Base directory: + + + + + + + + 0 + 0 + + + + BaseDirectoryName + + + + + + + Icon: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + DirectoryMenuConfiguration + accept() + + + 214 + 350 + + + 157 + 274 + + + + + buttons + rejected() + DirectoryMenuConfiguration + reject() + + + 214 + 350 + + + 196 + 274 + + + + + diff --git a/lxqt-panel/plugin-directorymenu/resources/directorymenu.desktop.in b/lxqt-panel/plugin-directorymenu/resources/directorymenu.desktop.in new file mode 100644 index 0000000..c86b448 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/resources/directorymenu.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory +Icon=folder + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu.ts new file mode 100644 index 0000000..d27edc1 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + + + + + Appearance + + + + + Base directory: + + + + + BaseDirectoryName + + + + + Icon: + + + + + Choose Base Directory + + + + + Choose Icon + + + + + Icons (*.png *.xpm *.jpg) + + + + + Directory Menu + + + + + An error occurred while loading the icon. + + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.desktop b/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.desktop new file mode 100644 index 0000000..4edd17a --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Ordnermenü +Comment[de]=Zeigt ein Menü mit dem Inhalt eines Ordners an diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.ts new file mode 100644 index 0000000..415bc4e --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_de.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Öffnen + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Einstellungen des Verzeichnismenüs + + + + Appearance + Erscheinungsbild + + + + Base directory: + Basisverzeichnis: + + + + BaseDirectoryName + BasisVerzeichnisName + + + + Icon: + Symbol: + + + + Choose Base Directory + Basisverzeichnis auswählen + + + + Choose Icon + Symbol auswählen + + + + Icons (*.png *.xpm *.jpg) + Symbole (*.png *.xpm *.jpg) + + + + Directory Menu + Verzeichnismenü + + + + An error occurred while loading the icon. + Beim Laden des Symbols trat ein Fehler auf. + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_hr.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hr.ts new file mode 100644 index 0000000..8c7e6f1 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hr.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Otvori + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Postavke izbornika direktorija + + + + Appearance + Izgled + + + + Base directory: + Osnovni direktorij: + + + + BaseDirectoryName + Ime osnovnog direktorija + + + + Icon: + Ikona: + + + + Choose Base Directory + Izaberite osnovni direktorij + + + + Choose Icon + Izaberite ikonu + + + + Icons (*.png *.xpm *.jpg) + Ikone (*.png *.xpm *.jpg) + + + + Directory Menu + Izbornik direktorija + + + + An error occurred while loading the icon. + Došlo je do greške pri učitavanju ikone. + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.desktop b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.desktop new file mode 100644 index 0000000..edc6c3b --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Egy könyvtár tartalmát mutató menü +Name[hu]=Könyvtármenü diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.ts new file mode 100644 index 0000000..573fec1 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu_HU.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu_HU.ts new file mode 100644 index 0000000..3bac2f9 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_hu_HU.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.desktop b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.desktop new file mode 100644 index 0000000..0ee5c98 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Меню папки +Comment[ru]=Показывает меню, отображающее содержимое папки diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.ts new file mode 100644 index 0000000..b900d65 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.desktop b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.desktop new file mode 100644 index 0000000..5a29599 --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Меню папки +Comment[ru_RU]=Показывает меню, отображающее содержимое папки diff --git a/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.ts b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.ts new file mode 100644 index 0000000..00d70bb --- /dev/null +++ b/lxqt-panel/plugin-directorymenu/translations/directorymenu_ru_RU.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/lxqt-panel/plugin-dom/CMakeLists.txt b/lxqt-panel/plugin-dom/CMakeLists.txt new file mode 100644 index 0000000..8bddcb9 --- /dev/null +++ b/lxqt-panel/plugin-dom/CMakeLists.txt @@ -0,0 +1,23 @@ +set(PLUGIN "dom") + +set(HEADERS + domplugin.h + treewindow.h + domtreeitem.h +) + +set(SOURCES + domplugin.cpp + treewindow.cpp + domtreeitem.cpp +) + +set(UIS + treewindow.ui +) + +set(RESOURCES + resources.qrc +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-dom/domplugin.cpp b/lxqt-panel/plugin-dom/domplugin.cpp new file mode 100644 index 0000000..e7b5551 --- /dev/null +++ b/lxqt-panel/plugin-dom/domplugin.cpp @@ -0,0 +1,56 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "domplugin.h" +#include "treewindow.h" +#include +#include + + +DomPlugin::DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mButton.setIcon(XdgIcon::fromTheme("preferences-plugin")); + connect(&mButton, SIGNAL(clicked()), this, SLOT(showDialog())); +} + + +void DomPlugin::showDialog() +{ + TreeWindow *dialog = mButton.findChild(); + + if (dialog == 0) + { + dialog = new TreeWindow(&mButton); + dialog->setAttribute(Qt::WA_DeleteOnClose); + } + + dialog->show(); + dialog->activateWindow(); +} diff --git a/lxqt-panel/plugin-dom/domplugin.h b/lxqt-panel/plugin-dom/domplugin.h new file mode 100644 index 0000000..20c3e7b --- /dev/null +++ b/lxqt-panel/plugin-dom/domplugin.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DOMPLUGIN_H +#define DOMPLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class DomPlugin: public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "Dom"; } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment; } + +private slots: + void showDialog(); + +private: + QToolButton mButton; + +}; + +class DomPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new DomPlugin(startupInfo); + } +}; + +#endif // DOMPLUGIN_H diff --git a/lxqt-panel/plugin-dom/domtreeitem.cpp b/lxqt-panel/plugin-dom/domtreeitem.cpp new file mode 100644 index 0000000..1782be3 --- /dev/null +++ b/lxqt-panel/plugin-dom/domtreeitem.cpp @@ -0,0 +1,161 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "domtreeitem.h" +#include +#include +#include +#include + + +DomTreeItem::DomTreeItem(QTreeWidget *view, QWidget *widget): + QTreeWidgetItem(view), + mWidget(widget) +{ + init(); + mWidget->installEventFilter(this); + connect(mWidget, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); +} + + +DomTreeItem::DomTreeItem(QTreeWidgetItem *parent, QWidget *widget): + QTreeWidgetItem(parent), + mWidget(widget) +{ + init(); + mWidget->installEventFilter(this); + connect(mWidget, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); +} + + +void DomTreeItem::init() +{ + QStringList hierarcy = widgetClassHierarcy(); + + for (int i=0; iobjectName(); + setText(0, QString("%1 (%2)%3").arg( + name , + widgetClassName(), + text)); + setText(1, hierarcy.join(" :: ")); + + fill(); +} + + +void DomTreeItem::fill() +{ + QList widgets = mWidget->findChildren(); + + foreach (QWidget *w, widgets) + { + if (w->parentWidget() != mWidget) + continue; + + new DomTreeItem(this, w); + } +} + + +bool DomTreeItem::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == mWidget && + event->type() == QEvent::ChildPolished) + { + QChildEvent *ce = static_cast(event); + QWidget *w = qobject_cast(ce->child()); + if (w) + { + for (int i=0; i(child(i)); + if (ci->widget() == w) + ci->deleteLater(); + } + + new DomTreeItem(this, w); + } + } + + return QObject::eventFilter(watched, event); +} + + +QString DomTreeItem::widgetObjectName() const +{ + return mWidget->objectName(); +} + + +QString DomTreeItem::widgetText() const +{ + QToolButton *toolButton = qobject_cast(mWidget); + if (toolButton) + return toolButton->text(); + + return ""; +} + + +QString DomTreeItem::widgetClassName() const +{ + return mWidget->metaObject()->className(); +} + + +QStringList DomTreeItem::widgetClassHierarcy() const +{ + QStringList hierarcy; + const QMetaObject *m = mWidget->metaObject(); + while (m) + { + hierarcy << m->className(); + m = m->superClass(); + } + return hierarcy; +} + + +void DomTreeItem::widgetDestroyed() +{ + deleteLater(); +} diff --git a/lxqt-panel/plugin-dom/domtreeitem.h b/lxqt-panel/plugin-dom/domtreeitem.h new file mode 100644 index 0000000..3a2f8ec --- /dev/null +++ b/lxqt-panel/plugin-dom/domtreeitem.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef DOMTREEITEM_H +#define DOMTREEITEM_H + +#include +#include + + +class DomTreeItem: public QObject, public QTreeWidgetItem +{ + Q_OBJECT +public: + explicit DomTreeItem(QTreeWidget *view, QWidget *widget); + explicit DomTreeItem(QTreeWidgetItem *parent, QWidget *widget); + bool eventFilter(QObject *watched, QEvent *event); + + QString widgetObjectName() const; + QString widgetText() const; + QString widgetClassName() const; + QStringList widgetClassHierarcy() const; + QWidget *widget() const { return mWidget; } + +private slots: + void widgetDestroyed(); + +private: + QWidget *mWidget; + void init(); + void fill(); +}; + +#endif // DOMTREEITEM_H diff --git a/lxqt-panel/plugin-dom/images/widgets/calendarwidget.png b/lxqt-panel/plugin-dom/images/widgets/calendarwidget.png new file mode 100644 index 0000000..26737b8 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/calendarwidget.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/checkbox.png b/lxqt-panel/plugin-dom/images/widgets/checkbox.png new file mode 100644 index 0000000..ab6f53e Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/checkbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/columnview.png b/lxqt-panel/plugin-dom/images/widgets/columnview.png new file mode 100644 index 0000000..4132ee6 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/columnview.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/combobox.png b/lxqt-panel/plugin-dom/images/widgets/combobox.png new file mode 100644 index 0000000..bf3ed79 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/combobox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/commandlinkbutton.png b/lxqt-panel/plugin-dom/images/widgets/commandlinkbutton.png new file mode 100644 index 0000000..6bbd84a Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/commandlinkbutton.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/dateedit.png b/lxqt-panel/plugin-dom/images/widgets/dateedit.png new file mode 100644 index 0000000..6827fa7 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/dateedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/datetimeedit.png b/lxqt-panel/plugin-dom/images/widgets/datetimeedit.png new file mode 100644 index 0000000..7d8e6fe Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/datetimeedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/dial.png b/lxqt-panel/plugin-dom/images/widgets/dial.png new file mode 100644 index 0000000..050d1db Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/dial.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/dialogbuttonbox.png b/lxqt-panel/plugin-dom/images/widgets/dialogbuttonbox.png new file mode 100644 index 0000000..b1f89fb Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/dialogbuttonbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/dockwidget.png b/lxqt-panel/plugin-dom/images/widgets/dockwidget.png new file mode 100644 index 0000000..9eee04f Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/dockwidget.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/doublespinbox.png b/lxqt-panel/plugin-dom/images/widgets/doublespinbox.png new file mode 100644 index 0000000..5686ac8 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/doublespinbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/fontcombobox.png b/lxqt-panel/plugin-dom/images/widgets/fontcombobox.png new file mode 100644 index 0000000..6848f15 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/fontcombobox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/frame.png b/lxqt-panel/plugin-dom/images/widgets/frame.png new file mode 100644 index 0000000..68f5da0 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/frame.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/graphicsview.png b/lxqt-panel/plugin-dom/images/widgets/graphicsview.png new file mode 100644 index 0000000..93fe760 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/graphicsview.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/groupbox.png b/lxqt-panel/plugin-dom/images/widgets/groupbox.png new file mode 100644 index 0000000..4025b4d Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/groupbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/groupboxcollapsible.png b/lxqt-panel/plugin-dom/images/widgets/groupboxcollapsible.png new file mode 100644 index 0000000..62fd1ad Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/groupboxcollapsible.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/hscrollbar.png b/lxqt-panel/plugin-dom/images/widgets/hscrollbar.png new file mode 100644 index 0000000..466c58d Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/hscrollbar.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/hslider.png b/lxqt-panel/plugin-dom/images/widgets/hslider.png new file mode 100644 index 0000000..525bd1c Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/hslider.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/hsplit.png b/lxqt-panel/plugin-dom/images/widgets/hsplit.png new file mode 100644 index 0000000..1ea8f2a Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/hsplit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/label.png b/lxqt-panel/plugin-dom/images/widgets/label.png new file mode 100644 index 0000000..5d7d7b4 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/label.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/lcdnumber.png b/lxqt-panel/plugin-dom/images/widgets/lcdnumber.png new file mode 100644 index 0000000..c3cac18 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/lcdnumber.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/line.png b/lxqt-panel/plugin-dom/images/widgets/line.png new file mode 100644 index 0000000..5c64dfb Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/line.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/lineedit.png b/lxqt-panel/plugin-dom/images/widgets/lineedit.png new file mode 100644 index 0000000..75fc890 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/lineedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/listbox.png b/lxqt-panel/plugin-dom/images/widgets/listbox.png new file mode 100644 index 0000000..367e67f Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/listbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/listview.png b/lxqt-panel/plugin-dom/images/widgets/listview.png new file mode 100644 index 0000000..d1308d5 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/listview.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/mdiarea.png b/lxqt-panel/plugin-dom/images/widgets/mdiarea.png new file mode 100644 index 0000000..7783dd5 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/mdiarea.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/plaintextedit.png b/lxqt-panel/plugin-dom/images/widgets/plaintextedit.png new file mode 100644 index 0000000..077bf16 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/plaintextedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/plugin.png b/lxqt-panel/plugin-dom/images/widgets/plugin.png new file mode 100644 index 0000000..1d23b91 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/plugin.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/progress.png b/lxqt-panel/plugin-dom/images/widgets/progress.png new file mode 100644 index 0000000..44ae094 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/progress.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/pushbutton.png b/lxqt-panel/plugin-dom/images/widgets/pushbutton.png new file mode 100644 index 0000000..61f779c Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/pushbutton.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/radiobutton.png b/lxqt-panel/plugin-dom/images/widgets/radiobutton.png new file mode 100644 index 0000000..10c1d8c Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/radiobutton.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/scrollarea.png b/lxqt-panel/plugin-dom/images/widgets/scrollarea.png new file mode 100644 index 0000000..651ea24 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/scrollarea.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/spacer.png b/lxqt-panel/plugin-dom/images/widgets/spacer.png new file mode 100644 index 0000000..8a0931b Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/spacer.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/spinbox.png b/lxqt-panel/plugin-dom/images/widgets/spinbox.png new file mode 100644 index 0000000..cdd9fe1 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/spinbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/tabbar.png b/lxqt-panel/plugin-dom/images/widgets/tabbar.png new file mode 100644 index 0000000..d5d3783 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/tabbar.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/table.png b/lxqt-panel/plugin-dom/images/widgets/table.png new file mode 100644 index 0000000..4bbd9c2 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/table.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/tabwidget.png b/lxqt-panel/plugin-dom/images/widgets/tabwidget.png new file mode 100644 index 0000000..1254bb6 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/tabwidget.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/textedit.png b/lxqt-panel/plugin-dom/images/widgets/textedit.png new file mode 100644 index 0000000..32e897d Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/textedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/timeedit.png b/lxqt-panel/plugin-dom/images/widgets/timeedit.png new file mode 100644 index 0000000..c66d91b Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/timeedit.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/toolbox.png b/lxqt-panel/plugin-dom/images/widgets/toolbox.png new file mode 100644 index 0000000..2ab71dc Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/toolbox.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/toolbutton.png b/lxqt-panel/plugin-dom/images/widgets/toolbutton.png new file mode 100644 index 0000000..0bff069 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/toolbutton.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/vline.png b/lxqt-panel/plugin-dom/images/widgets/vline.png new file mode 100644 index 0000000..35a7300 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/vline.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/vscrollbar.png b/lxqt-panel/plugin-dom/images/widgets/vscrollbar.png new file mode 100644 index 0000000..28b7c40 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/vscrollbar.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/vslider.png b/lxqt-panel/plugin-dom/images/widgets/vslider.png new file mode 100644 index 0000000..59f06ba Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/vslider.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/vspacer.png b/lxqt-panel/plugin-dom/images/widgets/vspacer.png new file mode 100644 index 0000000..ce5e8bd Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/vspacer.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/widget.png b/lxqt-panel/plugin-dom/images/widgets/widget.png new file mode 100644 index 0000000..1cf960e Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/widget.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/widgetstack.png b/lxqt-panel/plugin-dom/images/widgets/widgetstack.png new file mode 100644 index 0000000..2c6964e Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/widgetstack.png differ diff --git a/lxqt-panel/plugin-dom/images/widgets/wizard.png b/lxqt-panel/plugin-dom/images/widgets/wizard.png new file mode 100644 index 0000000..7c0e107 Binary files /dev/null and b/lxqt-panel/plugin-dom/images/widgets/wizard.png differ diff --git a/lxqt-panel/plugin-dom/resources.qrc b/lxqt-panel/plugin-dom/resources.qrc new file mode 100644 index 0000000..7680eb3 --- /dev/null +++ b/lxqt-panel/plugin-dom/resources.qrc @@ -0,0 +1,53 @@ + + + images/widgets/plugin.png + images/widgets/calendarwidget.png + images/widgets/checkbox.png + images/widgets/columnview.png + images/widgets/combobox.png + images/widgets/commandlinkbutton.png + images/widgets/dateedit.png + images/widgets/datetimeedit.png + images/widgets/dialogbuttonbox.png + images/widgets/dial.png + images/widgets/dockwidget.png + images/widgets/doublespinbox.png + images/widgets/fontcombobox.png + images/widgets/frame.png + images/widgets/graphicsview.png + images/widgets/groupboxcollapsible.png + images/widgets/groupbox.png + images/widgets/hscrollbar.png + images/widgets/hslider.png + images/widgets/hsplit.png + images/widgets/label.png + images/widgets/lcdnumber.png + images/widgets/lineedit.png + images/widgets/line.png + images/widgets/listbox.png + images/widgets/listview.png + images/widgets/mdiarea.png + images/widgets/plaintextedit.png + images/widgets/plugin.png + images/widgets/progress.png + images/widgets/pushbutton.png + images/widgets/radiobutton.png + images/widgets/scrollarea.png + images/widgets/spacer.png + images/widgets/spinbox.png + images/widgets/tabbar.png + images/widgets/table.png + images/widgets/tabwidget.png + images/widgets/textedit.png + images/widgets/timeedit.png + images/widgets/toolbox.png + images/widgets/toolbutton.png + images/widgets/vline.png + images/widgets/vscrollbar.png + images/widgets/vslider.png + images/widgets/vspacer.png + images/widgets/widget.png + images/widgets/widgetstack.png + images/widgets/wizard.png + + diff --git a/lxqt-panel/plugin-dom/resources/dom.desktop.in b/lxqt-panel/plugin-dom/resources/dom.desktop.in new file mode 100644 index 0000000..2146b3b --- /dev/null +++ b/lxqt-panel/plugin-dom/resources/dom.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Panel DOM tree +Comment=Show a DOM tree of the LXQt panel. +Icon=view-web-browser-dom-tree + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-dom/translations/dom.ts b/lxqt-panel/plugin-dom/translations/dom.ts new file mode 100644 index 0000000..6ffbe17 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + + + + + + Property + + + + + Value + + + + + All properties + + + + + Type + + + + + String value + + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_de.desktop b/lxqt-panel/plugin-dom/translations/dom_de.desktop new file mode 100644 index 0000000..52f901f --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Leiste DOM-Baum +Comment[de]=Zeigt einen DOM-Baum der LXQt-Leiste. diff --git a/lxqt-panel/plugin-dom/translations/dom_de.ts b/lxqt-panel/plugin-dom/translations/dom_de.ts new file mode 100644 index 0000000..c1b910d --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_de.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM-Baum der Leiste + + + + + Property + Eigenschaft + + + + Value + Wert + + + + All properties + Alle Eigenschaften + + + + Type + Typ + + + + String value + Zeichenkettenwert + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_hu.desktop b/lxqt-panel/plugin-dom/translations/dom_hu.desktop new file mode 100644 index 0000000..83f6021 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_hu.desktop @@ -0,0 +1,3 @@ +# Translations +Name[hu]=Panel DOM fa +Comment[hu]=DOM faszerkezet az LxQt panelen diff --git a/lxqt-panel/plugin-dom/translations/dom_hu.ts b/lxqt-panel/plugin-dom/translations/dom_hu.ts new file mode 100644 index 0000000..adfb252 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_hu.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_hu_HU.ts b/lxqt-panel/plugin-dom/translations/dom_hu_HU.ts new file mode 100644 index 0000000..47b5a63 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_hu_HU.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_ja.desktop b/lxqt-panel/plugin-dom/translations/dom_ja.desktop new file mode 100644 index 0000000..a207142 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ja.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ja]=パネルのDOMツリー +Comment[ja]=LXQtパネルのDOMツリーを表示する diff --git a/lxqt-panel/plugin-dom/translations/dom_ja.ts b/lxqt-panel/plugin-dom/translations/dom_ja.ts new file mode 100644 index 0000000..7bf60ed --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ja.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + パネルのDOMツリー + + + + + Property + プロパティー + + + + Value + + + + + All properties + + + + + Type + + + + + String value + + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_pt.desktop b/lxqt-panel/plugin-dom/translations/dom_pt.desktop new file mode 100644 index 0000000..87430f9 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_pt.desktop @@ -0,0 +1,3 @@ +# Translations +Name[pt]=Árvore do painel DOM +Comment[pt]=Mostra a árvore DOM do painel do LxQt. diff --git a/lxqt-panel/plugin-dom/translations/dom_pt.ts b/lxqt-panel/plugin-dom/translations/dom_pt.ts new file mode 100644 index 0000000..17e1bbd --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_pt.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + Árvore do painel DOM + + + + + Property + Propriedade + + + + Value + Valor + + + + All properties + + + + + Type + + + + + String value + + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_ru.desktop b/lxqt-panel/plugin-dom/translations/dom_ru.desktop new file mode 100644 index 0000000..f97ba11 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ru.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru]=Дерево DOM панели. +Comment[ru]=Показать дерево DOM панели LXQt. diff --git a/lxqt-panel/plugin-dom/translations/dom_ru.ts b/lxqt-panel/plugin-dom/translations/dom_ru.ts new file mode 100644 index 0000000..219982a --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ru.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + Дерево DOM панели + + + + + Property + Свойство + + + + Value + Значение + + + + All properties + + + + + Type + + + + + String value + + + + diff --git a/lxqt-panel/plugin-dom/translations/dom_ru_RU.desktop b/lxqt-panel/plugin-dom/translations/dom_ru_RU.desktop new file mode 100644 index 0000000..ddf0c19 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ru_RU.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru_RU]=Дерево DOM панели. +Comment[ru_RU]=Показать дерево DOM панели LXQt. diff --git a/lxqt-panel/plugin-dom/translations/dom_ru_RU.ts b/lxqt-panel/plugin-dom/translations/dom_ru_RU.ts new file mode 100644 index 0000000..6d09d78 --- /dev/null +++ b/lxqt-panel/plugin-dom/translations/dom_ru_RU.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + Дерево DOM панели + + + + + Property + Свойство + + + + Value + Значение + + + + All properties + + + + + Type + + + + + String value + + + + diff --git a/lxqt-panel/plugin-dom/treewindow.cpp b/lxqt-panel/plugin-dom/treewindow.cpp new file mode 100644 index 0000000..78426b9 --- /dev/null +++ b/lxqt-panel/plugin-dom/treewindow.cpp @@ -0,0 +1,172 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "treewindow.h" +#include "ui_treewindow.h" +#include "domtreeitem.h" +#include +#include +#include + +#define PROP_OBJECT_NAME 0 +#define PROP_CLASS_NAME 1 +#define PROP_TEXT 2 +#define PROP_CLASS_HIERARCY 3 + + +TreeWindow::TreeWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::TreeWindow) +{ + mRootWidget = this; + while (mRootWidget->parentWidget()) + mRootWidget = mRootWidget->parentWidget(); + + ui->setupUi(this); + + ui->tree->setStyleSheet( + "QTreeView::item { " + "padding: 2px;" + "}" + ); + + initPropertiesView(); + + QList widgets = mRootWidget->findChildren(); + + ui->tree->setRootIsDecorated(false); + + DomTreeItem *item = new DomTreeItem(ui->tree, mRootWidget); + ui->tree->expandItem(item); + ui->tree->resizeColumnToContents(0); + + + connect(ui->tree, SIGNAL(itemSelectionChanged()), this, SLOT(updatePropertiesView())); + item->setSelected(true); + + QHeaderView* h = new QHeaderView(Qt::Horizontal); + h->setStretchLastSection(true); + ui->allPropertiesView->setHorizontalHeader(h); + connect(h, &QHeaderView::sectionDoubleClicked, this, &TreeWindow::sectionDoubleClickedSlot); +} + + +TreeWindow::~TreeWindow() +{ + delete ui; +} + + +void TreeWindow::initPropertiesView() +{ + ui->propertiesView->viewport()->setAutoFillBackground(false); + + ui->propertiesView->setRowCount(4); + ui->propertiesView->setColumnCount(2); + + QTableWidgetItem *item; + item = new QTableWidgetItem("Object name"); + ui->propertiesView->setItem(PROP_OBJECT_NAME, 0, item); + ui->propertiesView->setItem(PROP_OBJECT_NAME, 1, new QTableWidgetItem()); + + item = new QTableWidgetItem("Class name"); + ui->propertiesView->setItem(PROP_CLASS_NAME, 0, item); + ui->propertiesView->setItem(PROP_CLASS_NAME, 1, new QTableWidgetItem()); + + item = new QTableWidgetItem("Text"); + ui->propertiesView->setItem(PROP_TEXT, 0, item); + ui->propertiesView->setItem(PROP_TEXT, 1, new QTableWidgetItem()); + + item = new QTableWidgetItem("Class hierarcy"); + ui->propertiesView->setItem(PROP_CLASS_HIERARCY, 0, item); + ui->propertiesView->setItem(PROP_CLASS_HIERARCY, 1, new QTableWidgetItem()); + + +} + + +void TreeWindow::updatePropertiesView() +{ + if (ui->tree->selectedItems().isEmpty()) + { + clearPropertiesView(); + return; + } + + QTreeWidgetItem *item = ui->tree->selectedItems().first(); + if (!item) + { + clearPropertiesView(); + return; + } + + DomTreeItem *treeItem = static_cast(item); + + ui->propertiesView->item(PROP_OBJECT_NAME, 1)->setText(treeItem->widgetObjectName()); + ui->propertiesView->item(PROP_CLASS_NAME, 1)->setText(treeItem->widgetClassName()); + ui->propertiesView->item(PROP_TEXT, 1)->setText(treeItem->widgetText()); + ui->propertiesView->item(PROP_CLASS_HIERARCY, 1)->setText(treeItem->widgetClassHierarcy().join(" :: ")); + + QString s; + QDebug out(&s); + QMetaObject const * const m = treeItem->widget()->metaObject(); + const int curr_cnt = ui->allPropertiesView->rowCount(); + ui->allPropertiesView->setRowCount(m->propertyCount()); + for (int i = 0, cnt = m->propertyCount(); cnt > i; ++i) + { + if (curr_cnt <= i) + { + ui->allPropertiesView->setItem(i, 0, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 1, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 2, new QTableWidgetItem); + } + QMetaProperty const & prop = m->property(i); + ui->allPropertiesView->item(i, 0)->setText(prop.name()); + ui->allPropertiesView->item(i, 1)->setText(prop.typeName()); + s.clear(); + out << prop.read(treeItem->widget()); + ui->allPropertiesView->item(i, 2)->setText(s); + } + for (int i = m->propertyCount(); curr_cnt > i; ++i) + ui->allPropertiesView->removeRow(i); +} + + +void TreeWindow::clearPropertiesView() +{ + for (int i=0; ipropertiesView->rowCount(); ++i) + ui->propertiesView->item(i, 1)->setText(""); + for (int i = ui->allPropertiesView->rowCount(); 0 <= i; --i) + ui->allPropertiesView->removeRow(i); + ui->allPropertiesView->setRowCount(0); +} + +void TreeWindow::sectionDoubleClickedSlot(int column) +{ + ui->allPropertiesView->sortByColumn(column, Qt::AscendingOrder); +} diff --git a/lxqt-panel/plugin-dom/treewindow.h b/lxqt-panel/plugin-dom/treewindow.h new file mode 100644 index 0000000..e4c9f91 --- /dev/null +++ b/lxqt-panel/plugin-dom/treewindow.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TREEWINDOW_H +#define TREEWINDOW_H + +#include +#include + + +class QTreeWidgetItem; +class QTreeWidget; +class QEvent; + +namespace Ui { +class TreeWindow; +} + + +class TreeWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit TreeWindow(QWidget *parent = 0); + ~TreeWindow(); + +private slots: + void updatePropertiesView(); + void clearPropertiesView(); + void sectionDoubleClickedSlot(int column); + +private: + Ui::TreeWindow *ui; + QWidget *mRootWidget; + + void initPropertiesView(); +}; + +#endif // TREEWINDOW_H diff --git a/lxqt-panel/plugin-dom/treewindow.ui b/lxqt-panel/plugin-dom/treewindow.ui new file mode 100644 index 0000000..042dda1 --- /dev/null +++ b/lxqt-panel/plugin-dom/treewindow.ui @@ -0,0 +1,132 @@ + + + TreeWindow + + + + 0 + 0 + 800 + 424 + + + + Panel DOM tree + + + + + + + Qt::Horizontal + + + + + 1 + 0 + + + + + Name + + + + + + + 1 + 0 + + + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + 1 + 0 + + + + true + + + + Property + + + + + Value + + + + + + + + All properties + + + + 0 + 0 + + + + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + Property + + + + + Type + + + + + String value + + + + + + + + + + + + + + + 0 + 0 + 601 + 21 + + + + + + + + diff --git a/lxqt-panel/plugin-kbindicator/CMakeLists.txt b/lxqt-panel/plugin-kbindicator/CMakeLists.txt new file mode 100644 index 0000000..e235b51 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/CMakeLists.txt @@ -0,0 +1,64 @@ +set(PLUGIN "kbindicator") + +set(HEADERS + src/kbdstate.h + src/settings.h + src/content.h + src/kbdlayout.h + src/kbdinfo.h + src/kbdkeeper.h + src/kbdwatcher.h + src/controls.h + src/kbdstateconfig.h +) + +set(SOURCES + kbindicator-plugin.cpp + src/kbdstate.cpp + src/settings.cpp + src/content.cpp + src/kbdkeeper.cpp + src/kbdwatcher.cpp + src/kbdstateconfig.cpp +) + +set(UIS + src/kbdstateconfig.ui +) + +set(LIBRARIES +) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(XKB_COMMON REQUIRED xkbcommon) +pkg_check_modules(XKB_COMMON_X11 QUIET xkbcommon-x11) + +if(XKB_COMMON_X11_FOUND) + message(STATUS "XkbCommon X11 was found") + find_package(Qt5 COMPONENTS X11Extras Xml) + pkg_check_modules(XCB_XCB xcb-xkb) + + set(HEADERS + ${HEADERS} + src/x11/kbdlayout.h + ) + + set(SOURCES + ${SOURCES} + src/x11/kbdlayout.cpp + ) + + set(LIBRARIES + ${LIBRARIES} + ${XKB_COMMON_X11_LIBRARIES} + ${XCB_XCB_LIBRARIES} + Qt5::Xml + ) + + add_definitions(-DX11_ENABLED) +else() + message(FATAL_ERROR "No XkbCommon backend(X11) found!") +endif() + +BUILD_LXQT_PLUGIN(${PLUGIN}) + diff --git a/lxqt-panel/plugin-kbindicator/kbindicator-plugin.cpp b/lxqt-panel/plugin-kbindicator/kbindicator-plugin.cpp new file mode 100644 index 0000000..c81ba00 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/kbindicator-plugin.cpp @@ -0,0 +1,18 @@ +#include +#include "src/kbdstate.h" +#include "../panel/ilxqtpanelplugin.h" + +class LxQtKbIndicatorPlugin: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + virtual ~LxQtKbIndicatorPlugin() + {} + + virtual ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { return new KbdState(startupInfo); } +}; + +#include "kbindicator-plugin.moc" diff --git a/lxqt-panel/plugin-kbindicator/resources/kbindicator.desktop.in b/lxqt-panel/plugin-kbindicator/resources/kbindicator.desktop.in new file mode 100644 index 0000000..1fa16db --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/resources/kbindicator.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Keyboard state indicator +Comment=Keyboard state indicator and switcher plugin. +Icon=input-keyboard + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-kbindicator/src/content.cpp b/lxqt-panel/plugin-kbindicator/src/content.cpp new file mode 100644 index 0000000..3313a86 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/content.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include "kbdstate.h" +#include "content.h" + +Content::Content(bool layoutEnabled): + QWidget(), + m_layoutEnabled(layoutEnabled) +{ + QBoxLayout *box = new QBoxLayout(QBoxLayout::LeftToRight); + box->setContentsMargins(0, 0, 0, 0); + box->setSpacing(0); + setLayout(box); + + m_capsLock = new QLabel("C"); + m_capsLock->setObjectName("CapsLockLabel"); + m_capsLock->setAlignment(Qt::AlignCenter); + m_capsLock->installEventFilter(this); + layout()->addWidget(m_capsLock); + + m_numLock = new QLabel("N"); + m_numLock->setObjectName("NumLockLabel"); + m_numLock->setAlignment(Qt::AlignCenter); + m_numLock->installEventFilter(this); + layout()->addWidget(m_numLock); + + m_scrollLock = new QLabel("S"); + m_scrollLock->setObjectName("ScrollLockLabel"); + m_scrollLock->setAlignment(Qt::AlignCenter); + m_scrollLock->installEventFilter(this); + layout()->addWidget(m_scrollLock); + + m_layout = new QLabel; + m_layout->setObjectName("LayoutLabel"); + m_layout->setAlignment(Qt::AlignCenter); + m_layout->installEventFilter(this); + layout()->addWidget(m_layout); +} + +Content::~Content() +{} + +bool Content::setup() +{ + m_capsLock->setVisible(Settings::instance().showCapLock()); + m_numLock->setVisible(Settings::instance().showNumLock()); + m_scrollLock->setVisible(Settings::instance().showScrollLock()); + m_layout->setVisible(m_layoutEnabled && Settings::instance().showLayout()); + return true; +} + +void Content::layoutChanged(const QString & sym, const QString & name, const QString & variant) +{ + m_layout->setText(sym.toUpper()); + QString txt = QString("\ + \ + \ +
%1: %3
%2: %4
").arg(tr("Layout")).arg(tr("Variant")).arg(name).arg(variant); + m_layout->setToolTip(txt); +} + +void Content::modifierStateChanged(Controls mod, bool active) +{ + setEnabled(mod, active); +} + + +void Content::setEnabled(Controls cnt, bool enabled) +{ + widget(cnt)->setEnabled(enabled); +} + +QWidget* Content::widget(Controls cnt) const +{ + switch(cnt){ + case Caps: return m_capsLock; + case Num: return m_numLock; + case Scroll: return m_scrollLock; + case Layout: return m_layout; + } + return 0; +} + +bool Content::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::QEvent::MouseButtonRelease) + { + if (object == m_capsLock) + emit controlClicked(Controls::Caps); + else if (object == m_numLock) + emit controlClicked(Controls::Num); + else if (object == m_scrollLock) + emit controlClicked(Controls::Scroll); + else if(object == m_layout){ + emit controlClicked(Controls::Layout); + } + return true; + } + + return QObject::eventFilter(object, event); +} + +void Content::showHorizontal() +{ + qobject_cast(layout())->setDirection(QBoxLayout::LeftToRight); +} + +void Content::showVertical() +{ + qobject_cast(layout())->setDirection(QBoxLayout::TopToBottom); +} + diff --git a/lxqt-panel/plugin-kbindicator/src/content.h b/lxqt-panel/plugin-kbindicator/src/content.h new file mode 100644 index 0000000..5395d53 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/content.h @@ -0,0 +1,38 @@ +#ifndef _CONTENT_H_ +#define _CONTENT_H_ + +#include +#include "controls.h" + +class QLabel; + +class Content : public QWidget +{ + Q_OBJECT +public: + Content(bool layoutEnabled); + ~Content(); + +public: + void setEnabled(Controls cnt, bool enabled); + QWidget* widget(Controls cnt) const; + bool setup(); + + virtual bool eventFilter(QObject *object, QEvent *event); + + void showHorizontal(); + void showVertical(); +public slots: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); +signals: + void controlClicked(Controls cnt); +private: + bool m_layoutEnabled; + QLabel *m_capsLock; + QLabel *m_numLock; + QLabel *m_scrollLock; + QLabel *m_layout; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/controls.h b/lxqt-panel/plugin-kbindicator/src/controls.h new file mode 100644 index 0000000..b751619 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/controls.h @@ -0,0 +1,11 @@ +#ifndef _CONTROLS_H_ +#define _CONTROLS_H_ + +enum Controls { + Caps, + Num, + Scroll, + Layout +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdinfo.h b/lxqt-panel/plugin-kbindicator/src/kbdinfo.h new file mode 100644 index 0000000..24d4e71 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdinfo.h @@ -0,0 +1,52 @@ +#ifndef _KBDINFO_H_ +#define _KBDINFO_H_ + +#include +#include + +class KbdInfo +{ +public: + KbdInfo() + {} + + struct Info + { + QString sym; + QString name; + QString variant; + }; + +public: + const QString & currentSym() const + { return m_keyboardInfo[m_current].sym; } + + const QString & currentName() const + { return m_keyboardInfo[m_current].name; } + + const QString & currentVariant() const + { return m_keyboardInfo[m_current].variant; } + + int currentGroup() const + { return m_current; } + + void setCurrentGroup(int group) + { m_current = group; } + + uint size() const + { return m_keyboardInfo.size(); } + + const Info & current() const + { return m_keyboardInfo[m_current]; } + + void clear() + { m_keyboardInfo.clear(); } + + void append(const Info & info) + { m_keyboardInfo.append(info); } +private: + QList m_keyboardInfo; + int m_current = 0; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdkeeper.cpp b/lxqt-panel/plugin-kbindicator/src/kbdkeeper.cpp new file mode 100644 index 0000000..251b552 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdkeeper.cpp @@ -0,0 +1,160 @@ +#include +#include +#include +#include +#include "kbdkeeper.h" + +//-------------------------------------------------------------------------------------------------- + +KbdKeeper::KbdKeeper(const KbdLayout & layout, KeeperType type): + m_layout(layout), + m_type(type) +{ + m_layout.readKbdInfo(m_info); +} + +KbdKeeper::~KbdKeeper() +{} + +bool KbdKeeper::setup() +{ + connect(&m_layout, SIGNAL(keyboardChanged()), SLOT(keyboardChanged())); + connect(&m_layout, SIGNAL(layoutChanged(uint)), SLOT(layoutChanged(uint))); + connect(&m_layout, SIGNAL(checkState()), SLOT(checkState())); + + return true; +} + +void KbdKeeper::keyboardChanged() +{ + m_layout.readKbdInfo(m_info); + emit changed(); +} + +void KbdKeeper::layoutChanged(uint group) +{ + m_info.setCurrentGroup(group); + emit changed(); +} + +void KbdKeeper::checkState() +{} + +void KbdKeeper::switchToNext() +{ + uint index = m_info.currentGroup(); + if (index < m_info.size() - 1) + ++index; + else + index = 0; + + switchToGroup(index); +} + +void KbdKeeper::switchToGroup(uint group) +{ + m_layout.lockGroup(group); + emit changed(); +} + +//-------------------------------------------------------------------------------------------------- + +WinKbdKeeper::WinKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +WinKbdKeeper::~WinKbdKeeper() +{} + +void WinKbdKeeper::layoutChanged(uint group) +{ + WId win = KWindowSystem::activeWindow(); + + if (m_active == win){ + m_mapping[win] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + } + emit changed(); +} + +void WinKbdKeeper::checkState() +{ + WId win = KWindowSystem::activeWindow(); + + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + emit changed(); +} + +void WinKbdKeeper::switchToGroup(uint group) +{ + WId win = KWindowSystem::activeWindow(); + m_mapping[win] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} + + +//-------------------------------------------------------------------------------------------------- + +AppKbdKeeper::AppKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +AppKbdKeeper::~AppKbdKeeper() +{} + +void AppKbdKeeper::layoutChanged(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (m_active == app){ + m_mapping[app] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + } + emit changed(); +} + +void AppKbdKeeper::checkState() +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + emit changed(); +} + + +void AppKbdKeeper::switchToGroup(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + m_mapping[app] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} diff --git a/lxqt-panel/plugin-kbindicator/src/kbdkeeper.h b/lxqt-panel/plugin-kbindicator/src/kbdkeeper.h new file mode 100644 index 0000000..3b41630 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdkeeper.h @@ -0,0 +1,80 @@ +#ifndef _KBDKEEPER_H_ +#define _KBDKEEPER_H_ + +#include +#include +#include "kbdlayout.h" +#include "kbdinfo.h" +#include "settings.h" + +//-------------------------------------------------------------------------------------------------- + +class KbdKeeper: public QObject +{ + Q_OBJECT +public: + KbdKeeper(const KbdLayout & layout, KeeperType type = KeeperType::Global); + virtual ~KbdKeeper(); + virtual bool setup(); + + const QString & sym() const + { return m_info.currentSym(); } + + const QString & name() const + { return m_info.currentName(); } + + const QString & variant() const + { return m_info.currentVariant(); } + + KeeperType type() const + { return m_type; } + + void switchToNext(); + virtual void switchToGroup(uint group); +protected slots: + virtual void keyboardChanged(); + virtual void layoutChanged(uint group); + virtual void checkState(); +signals: + void changed(); +protected: + const KbdLayout & m_layout; + KbdInfo m_info; + KeeperType m_type; +}; + +//-------------------------------------------------------------------------------------------------- + +class WinKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + WinKbdKeeper(const KbdLayout & layout); + virtual ~WinKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + WId m_active; +}; + +//-------------------------------------------------------------------------------------------------- + +class AppKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + AppKbdKeeper(const KbdLayout & layout); + virtual ~AppKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + QString m_active; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdlayout.h b/lxqt-panel/plugin-kbindicator/src/kbdlayout.h new file mode 100644 index 0000000..cf95f61 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdlayout.h @@ -0,0 +1,9 @@ +#ifndef _KBDLAYOUT_H_ +#define _KBDLAYOUT_H_ + +#ifdef X11_ENABLED +#include "x11/kbdlayout.h" +typedef X11Kbd KbdLayout; +#endif + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdstate.cpp b/lxqt-panel/plugin-kbindicator/src/kbdstate.cpp new file mode 100644 index 0000000..157958b --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdstate.cpp @@ -0,0 +1,46 @@ +#include +#include + +#include "kbdstate.h" +#include "kbdkeeper.h" +#include "kbdstateconfig.h" +#include + +KbdState::KbdState(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + m_content(m_watcher.isLayoutEnabled()) +{ + Settings::instance().init(settings()); + + connect(&m_content, &Content::controlClicked, &m_watcher, &KbdWatcher::controlClicked); + connect(&m_watcher, &KbdWatcher::layoutChanged, &m_content, &Content::layoutChanged); + connect(&m_watcher, &KbdWatcher::modifierStateChanged, &m_content, &Content::modifierStateChanged); + + settingsChanged(); +} + +KbdState::~KbdState() +{} + +void KbdState::settingsChanged() +{ + m_content.setup(); + m_watcher.setup(); +} + +QDialog *KbdState::configureDialog() +{ + return new KbdStateConfig(&m_content); +} + +void KbdState::realign() +{ + if (panel()->isHorizontal()){ + m_content.setMinimumSize(0, panel()->iconSize()); + m_content.showHorizontal(); + } else { + m_content.setMinimumSize(panel()->iconSize(), 0); + m_content.showVertical(); + } +} diff --git a/lxqt-panel/plugin-kbindicator/src/kbdstate.h b/lxqt-panel/plugin-kbindicator/src/kbdstate.h new file mode 100644 index 0000000..f958eed --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdstate.h @@ -0,0 +1,49 @@ +#ifndef _KDBSTATE_H_ +#define _KDBSTATE_H_ + +#include "../panel/ilxqtpanelplugin.h" +#include "settings.h" +#include "content.h" +#include "kbdwatcher.h" + +class QLabel; + +class KbdState : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + KbdState(const ILxQtPanelPluginStartupInfo &startupInfo); + virtual ~KbdState(); + + virtual QString themeId() const + { return "KbIndicator"; } + + virtual ILxQtPanelPlugin::Flags flags() const + { return PreferRightAlignment | HaveConfigDialog; } + + virtual bool isSeparate() const + { return false; } + + virtual QWidget *widget() + { return &m_content; } + + QDialog *configureDialog(); + virtual void realign(); + + const Settings & prefs() const + { return m_settings; } + + Settings & prefs() + { return m_settings; } + +protected slots: + virtual void settingsChanged(); + +private: + Settings m_settings; + KbdWatcher m_watcher; + Content m_content; +}; + + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.cpp b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.cpp new file mode 100644 index 0000000..5a08447 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.cpp @@ -0,0 +1,84 @@ +#include +#include +#include "kbdstateconfig.h" +#include "ui_kbdstateconfig.h" +#include "settings.h" + +KbdStateConfig::KbdStateConfig(QWidget *parent) : + QDialog(parent), + m_ui(new Ui::KbdStateConfig) +{ + setAttribute(Qt::WA_DeleteOnClose); + m_ui->setupUi(this); + + connect(m_ui->showCaps, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showNum, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showScroll, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showLayout, &QCheckBox::clicked, this, &KbdStateConfig::save); + + connect(m_ui->modes, static_cast(&QButtonGroup::buttonClicked), + [this](int){ + KbdStateConfig::save(); + } + ); + + connect(m_ui->showLayout, &QCheckBox::stateChanged, [this](int checked){ + //m_ui->showFlags->setEnabled(checked); //TODO: Country flags support + m_ui->switchGlobal->setEnabled(checked); + m_ui->switchWindow->setEnabled(checked); + m_ui->switchApplication->setEnabled(checked); + }); + + connect(m_ui->configureLayouts, &QPushButton::clicked, this, &KbdStateConfig::configureLayouts); + + load(); +} + +KbdStateConfig::~KbdStateConfig() +{ + delete m_ui; +} + +void KbdStateConfig::load() +{ + Settings & sets = Settings::instance(); + + m_ui->showCaps->setChecked(sets.showCapLock()); + m_ui->showNum->setChecked(sets.showNumLock()); + m_ui->showScroll->setChecked(sets.showScrollLock()); + m_ui->showLayout->setChecked(sets.showLayout()); + + switch(sets.keeperType()){ + case KeeperType::Global: + m_ui->switchGlobal->setChecked(true); + break; + case KeeperType::Window: + m_ui->switchWindow->setChecked(true); + break; + case KeeperType::Application: + m_ui->switchApplication->setChecked(true); + break; + } +} + +void KbdStateConfig::save() +{ + Settings & sets = Settings::instance(); + + sets.setShowCapLock(m_ui->showCaps->isChecked()); + sets.setShowNumLock(m_ui->showNum->isChecked()); + sets.setShowScrollLock(m_ui->showScroll->isChecked()); + sets.setShowLayout(m_ui->showLayout->isChecked()); + + if (m_ui->switchGlobal->isChecked()) + sets.setKeeperType(KeeperType::Global); + if (m_ui->switchWindow->isChecked()) + sets.setKeeperType(KeeperType::Window); + if (m_ui->switchApplication->isChecked()) + sets.setKeeperType(KeeperType::Application); +} + +void KbdStateConfig::configureLayouts() +{ + QProcess::startDetached(QStringLiteral("lxqt-config-input")); +} diff --git a/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.h b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.h new file mode 100644 index 0000000..b01972d --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.h @@ -0,0 +1,26 @@ +#ifndef _KBDSTATECONFIG_H_ +#define _KBDSTATECONFIG_H_ + +#include + +namespace Ui { +class KbdStateConfig; +} + +class KbdStateConfig : public QDialog +{ + Q_OBJECT + +public: + explicit KbdStateConfig(QWidget *parent = 0); + ~KbdStateConfig(); +private: + void save(); + void load(); + + void configureLayouts(); +private: + Ui::KbdStateConfig *m_ui; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.ui b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.ui new file mode 100644 index 0000000..932933c --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdstateconfig.ui @@ -0,0 +1,222 @@ + + + KbdStateConfig + + + + 0 + 0 + 249 + 390 + + + + Dialog + + + + + + Leds + + + + + + Show Caps Lock + + + + + + + Show Num Lock + + + + + + + Show Scroll Lock + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + Show keyboard layout + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Show flags instead labels + + + + + + + Layout mode: + + + + + + + false + + + Global + + + modes + + + + + + + false + + + Window + + + modes + + + + + + + false + + + Application + + + modes + + + + + + + Configure layouts + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + btns + accepted() + KbdStateConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + btns + rejected() + KbdStateConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + + + + diff --git a/lxqt-panel/plugin-kbindicator/src/kbdwatcher.cpp b/lxqt-panel/plugin-kbindicator/src/kbdwatcher.cpp new file mode 100644 index 0000000..539f31d --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdwatcher.cpp @@ -0,0 +1,58 @@ +#include +#include "kbdwatcher.h" + +KbdWatcher::KbdWatcher() +{ + connect(&m_layout, SIGNAL(modifierChanged(Controls,bool)), SIGNAL(modifierStateChanged(Controls,bool))); + m_layout.init(); +} + +void KbdWatcher::setup() +{ + emit modifierStateChanged(Controls::Caps, m_layout.isModifierLocked(Controls::Caps)); + emit modifierStateChanged(Controls::Num, m_layout.isModifierLocked(Controls::Num)); + emit modifierStateChanged(Controls::Scroll, m_layout.isModifierLocked(Controls::Scroll)); + + if (!m_keeper || m_keeper->type() != Settings::instance().keeperType()){ + createKeeper(Settings::instance().keeperType()); + } +} + +void KbdWatcher::createKeeper(KeeperType type) +{ + switch(type) + { + case KeeperType::Global: + m_keeper.reset(new KbdKeeper(m_layout)); + break; + case KeeperType::Window: + m_keeper.reset(new WinKbdKeeper(m_layout)); + break; + case KeeperType::Application: + m_keeper.reset(new AppKbdKeeper(m_layout)); + break; + } + + connect(m_keeper.data(), SIGNAL(changed()), this, SLOT(keeperChanged())); + + m_keeper->setup(); + keeperChanged(); +} + +void KbdWatcher::keeperChanged() +{ + emit layoutChanged(m_keeper->sym(), m_keeper->name(), m_keeper->variant()); +} + +void KbdWatcher::controlClicked(Controls cnt) +{ + switch(cnt){ + case Controls::Layout: + m_keeper->switchToNext(); + break; + default: + m_layout.lockModifier(cnt, !m_layout.isModifierLocked(cnt)); + break; + } + +} diff --git a/lxqt-panel/plugin-kbindicator/src/kbdwatcher.h b/lxqt-panel/plugin-kbindicator/src/kbdwatcher.h new file mode 100644 index 0000000..17f580b --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/kbdwatcher.h @@ -0,0 +1,38 @@ +#ifndef _KBDWATCHER_H_ +#define _KBDWATCHER_H_ + +#include "kbdlayout.h" +#include "controls.h" +#include "kbdkeeper.h" + +class KbdKeeper; + +class KbdWatcher: public QObject +{ + Q_OBJECT +public: + KbdWatcher(); + + void setup(); + const KbdLayout & kbdLayout() const + { return m_layout; } + + bool isLayoutEnabled() const + { return m_layout.isEnabled(); } +public slots: + void controlClicked(Controls cnt); +signals: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); + +private: + void createKeeper(KeeperType type); +private slots: + void keeperChanged(); + +private: + KbdLayout m_layout; + QScopedPointer m_keeper; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/settings.cpp b/lxqt-panel/plugin-kbindicator/src/settings.cpp new file mode 100644 index 0000000..49fab1c --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/settings.cpp @@ -0,0 +1,65 @@ +#include +#include "settings.h" + +Settings::Settings() +{} + +Settings & Settings::instance() +{ + static Settings _instance; + return _instance; +} + +void Settings::init(QSettings *settings) +{ m_settings = settings; } + +bool Settings::showCapLock() const +{ return m_settings->value("show_caps_lock", true).toBool(); } + +bool Settings::showNumLock() const +{ return m_settings->value("show_num_lock", true).toBool(); } + +bool Settings::showScrollLock() const +{ return m_settings->value("show_scroll_lock", true).toBool(); } + +bool Settings::showLayout() const +{ return m_settings->value("show_layout", true).toBool(); } + +void Settings::setShowCapLock(bool show) +{ m_settings->setValue("show_caps_lock", show); } + +void Settings::setShowNumLock(bool show) +{ m_settings->setValue("show_num_lock", show); } + +void Settings::setShowScrollLock(bool show) +{ m_settings->setValue("show_scroll_lock", show); } + +void Settings::setShowLayout(bool show) +{ m_settings->setValue("show_layout", show); } + +KeeperType Settings::keeperType() const +{ + QString type = m_settings->value("keeper_type", "application").toString(); + if(type == "global") + return KeeperType::Global; + if(type == "window") + return KeeperType::Window; + if(type == "application") + return KeeperType::Application; + return KeeperType::Application; +} + +void Settings::setKeeperType(KeeperType type) const +{ + switch (type) { + case KeeperType::Global: + m_settings->setValue("keeper_type", "global"); + break; + case KeeperType::Window: + m_settings->setValue("keeper_type", "window"); + break; + case KeeperType::Application: + m_settings->setValue("keeper_type", "application"); + break; + } +} diff --git a/lxqt-panel/plugin-kbindicator/src/settings.h b/lxqt-panel/plugin-kbindicator/src/settings.h new file mode 100644 index 0000000..49e6a56 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/settings.h @@ -0,0 +1,37 @@ +#ifndef _SETTINGS_H_ +#define _SETTINGS_H_ + +class QSettings; + +enum class KeeperType +{ + Global, + Window, + Application +}; + +class Settings +{ +public: + Settings(); + static Settings & instance(); + + void init(QSettings *settings); + +public: + bool showCapLock() const; + bool showNumLock() const; + bool showScrollLock() const; + bool showLayout() const; + KeeperType keeperType() const; +public: + void setShowCapLock(bool show); + void setShowNumLock(bool show); + void setShowScrollLock(bool show); + void setShowLayout(bool show); + void setKeeperType(KeeperType type) const; +private: + QSettings *m_settings = 0; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.cpp b/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.cpp new file mode 100644 index 0000000..0ddccbb --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.cpp @@ -0,0 +1,292 @@ +#include +#include +#include +#include +#include +#include "kbdlayout.h" + +#include +#include +#define explicit _explicit +#include +#include "../kbdinfo.h" +#include "../controls.h" + +namespace pimpl { + +struct LangInfo +{ + QString name; + QString syn; + QString variant; +}; + +class X11Kbd: public QAbstractNativeEventFilter +{ +public: + X11Kbd(::X11Kbd *pub): + m_pub(pub) + {} + + bool init() + { + m_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + m_connection = xcb_connect(0, 0); + + if (!m_connection || xcb_connection_has_error(m_connection)){ + qWarning() << "Couldn't connect to X server: error code" + << (m_connection ? xcb_connection_has_error(m_connection) : -1); + return false; + } + + xkb_x11_setup_xkb_extension(m_connection, + XKB_X11_MIN_MAJOR_XKB_VERSION, + XKB_X11_MIN_MINOR_XKB_VERSION, + XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS, + NULL, NULL, &m_eventType, NULL + ); + + m_deviceId = xkb_x11_get_core_keyboard_device_id(m_connection); + qApp->installNativeEventFilter(this); + + readState(); + return true; + } + + virtual ~X11Kbd() + { + xkb_state_unref(m_state); + xkb_keymap_unref(m_keymap); + xcb_disconnect(m_connection); + xkb_context_unref(m_context); + } + + bool isEnabled() const + { return true; } + + virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *) + { + if (eventType != "xcb_generic_event_t") + return false; + + xcb_generic_event_t *event = static_cast(message); + if ((event->response_type & ~0x80) == m_eventType){ + xcb_xkb_state_notify_event_t *sevent = reinterpret_cast(event); + switch(sevent->xkbType){ + case XCB_XKB_STATE_NOTIFY: + xkb_state_update_mask(m_state, + sevent->baseMods, + sevent->latchedMods, + sevent->lockedMods, + sevent->baseGroup, + sevent->latchedGroup, + sevent->lockedGroup + ); + + if(sevent->changed & XCB_XKB_STATE_PART_GROUP_STATE){ + emit m_pub->layoutChanged(sevent->group); + } + + if(sevent->changed & XCB_XKB_STATE_PART_MODIFIER_LOCK){ + for(Controls cnt: m_modifiers.keys()){ + bool oldState = m_modifiers[cnt]; + bool newState = xkb_state_led_name_is_active(m_state, modName(cnt)); + if(oldState != newState){ + m_modifiers[cnt] = newState; + emit m_pub->modifierChanged(cnt, newState); + } + } + } + break; + case XCB_XKB_NEW_KEYBOARD_NOTIFY: + readState(); + break; + } + } + + emit m_pub->checkState(); + return false; + } + + void readKbdInfo(KbdInfo & info) const + { + info.clear(); + xkb_layout_index_t count = xkb_keymap_num_layouts(m_keymap); + for(xkb_layout_index_t i = 0; i < count; ++i){ + QString name = xkb_keymap_layout_get_name(m_keymap, i); + const LangInfo & linfo = names(name); + info.append({linfo.syn, linfo.name, linfo.variant}); + if (xkb_state_layout_index_is_active(m_state, i, XKB_STATE_LAYOUT_EFFECTIVE)) + info.setCurrentGroup(i); + } + } + + void lockGroup(uint group) + { + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, 0, 0, 1, group, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + void lockModifier(Controls cnt, bool locked) + { + quint8 mask = fetchMask(cnt); + quint8 curMask = locked ? mask : 0; + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, mask, curMask, 0, 0, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + bool isModifierLocked(Controls cnt) const + { return m_modifiers[cnt]; } + +private: + quint8 fetchMask(Controls cnt) const + { + static QHash masks; + if (masks.contains(cnt)) + return masks[cnt]; + + xkb_mod_index_t index = xkb_keymap_led_get_index(m_keymap, modName(cnt)); + + xcb_generic_error_t *error = 0; + quint8 mask = 0; + + xcb_xkb_get_indicator_map_cookie_t cookie = xcb_xkb_get_indicator_map(m_connection, m_deviceId, 1 << index); + xcb_xkb_get_indicator_map_reply_t *reply = xcb_xkb_get_indicator_map_reply(m_connection, cookie, &error); + + + if (!reply || error){ + qWarning() << "Cannot fetch mask " << error->error_code; + return mask; + } + + xcb_xkb_indicator_map_t *map = xcb_xkb_get_indicator_map_maps(reply); + + mask = map->mods; + masks[cnt] = mask; + + free(reply); + return mask; + } + + const char * modName(Controls cnt) const + { + switch(cnt){ + case Controls::Caps: + return XKB_LED_NAME_CAPS; + case Controls::Num: + return XKB_LED_NAME_NUM; + case Controls::Scroll: + return XKB_LED_NAME_SCROLL; + default: + return 0; + } + } + + void readState() + { + if (m_keymap) + xkb_keymap_unref(m_keymap); + m_keymap = xkb_x11_keymap_new_from_device(m_context, m_connection, m_deviceId, (xkb_keymap_compile_flags)0); + + if (m_state) + xkb_state_unref(m_state); + m_state = xkb_x11_state_new_from_device(m_keymap, m_connection, m_deviceId); + + for(Controls cnt: m_modifiers.keys()){ + m_modifiers[cnt] = xkb_state_led_name_is_active(m_state, modName(cnt)); + } + emit m_pub->keyboardChanged(); + } + + const LangInfo & names(const QString & langName) const + { + static LangInfo def{"Unknown", "??", "None"}; + static QHash names; + if (names.empty()){ + if(QFile::exists("/usr/share/X11/xkb/rules/evdev.xml")){ + QDomDocument doc; + + QFile file("/usr/share/X11/xkb/rules/evdev.xml"); + if (file.open(QIODevice::ReadOnly)){ + if (doc.setContent(&file)) { + QDomElement docElem = doc.documentElement(); + + auto layout= docElem.firstChildElement("layoutList"); + for(int i = 0; i < layout.childNodes().count(); ++i){ + auto conf = layout.childNodes().at(i).firstChildElement("configItem"); + names.insert( + conf.firstChildElement("description").firstChild().toText().data(),{ + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + "None" + } + ); + auto variants = layout.childNodes().at(i).firstChildElement("variantList"); + for(int j = 0; j < variants.childNodes().count(); ++j){ + auto var = variants.childNodes().at(j).firstChildElement("configItem"); + names.insert( + var.firstChildElement("description").firstChild().toText().data(), { + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + var.firstChildElement("name").firstChild().toText().data() + } + ); + } + } + } + file.close(); + } + } + } + if (names.contains(langName)) + return names[langName]; + return def; + } + +private: + struct xkb_context *m_context = 0; + xcb_connection_t *m_connection = 0; + int32_t m_deviceId; + uint8_t m_eventType; + xkb_state *m_state = 0; + xkb_keymap *m_keymap = 0; + ::X11Kbd *m_pub; + QHash m_modifiers = { + {Controls::Caps, false}, + {Controls::Num, false}, + {Controls::Scroll, false}, + }; +}; + +} + +X11Kbd::X11Kbd(): + m_priv(new pimpl::X11Kbd(this)) +{} + +X11Kbd::~X11Kbd() +{} + +bool X11Kbd::init() +{ return m_priv->init(); } + +bool X11Kbd::isEnabled() const +{ return true; } + +void X11Kbd::readKbdInfo(KbdInfo & info) const +{ m_priv->readKbdInfo(info); } + +void X11Kbd::lockGroup(uint layId) const +{ m_priv->lockGroup(layId); } + +void X11Kbd::lockModifier(Controls cnt, bool locked) +{ m_priv->lockModifier(cnt, locked); } + +bool X11Kbd::isModifierLocked(Controls cnt) const +{ return m_priv->isModifierLocked(cnt); } diff --git a/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.h b/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.h new file mode 100644 index 0000000..2e11b73 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/src/x11/kbdlayout.h @@ -0,0 +1,34 @@ +#ifndef _X11KBD_H_ +#define _X11KBD_H_ + +#include +#include "../controls.h" + +class KbdInfo; + +namespace pimpl +{ class X11Kbd; } + +class X11Kbd: public QObject +{ + Q_OBJECT +public: + X11Kbd(); + virtual ~X11Kbd(); + + bool init(); + bool isEnabled() const; + void readKbdInfo(KbdInfo & info) const; + void lockGroup(uint layId) const; + void lockModifier(Controls cnt, bool locked); + bool isModifierLocked(Controls cnt) const; +signals: + void layoutChanged(uint layId); + void modifierChanged(Controls cnt, bool locked); + void checkState(); + void keyboardChanged(); +private: + QScopedPointer m_priv; +}; + +#endif diff --git a/lxqt-panel/plugin-kbindicator/translations/kbindicator.ts b/lxqt-panel/plugin-kbindicator/translations/kbindicator.ts new file mode 100644 index 0000000..26dc157 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/translations/kbindicator.ts @@ -0,0 +1,80 @@ + + + + + Content + + + Layout + + + + + Variant + + + + + KbdStateConfig + + + Dialog + + + + + Leds + + + + + Show Caps Lock + + + + + Show Num Lock + + + + + Show Scroll Lock + + + + + Show keyboard layout + + + + + Show flags instead labels + + + + + Layout mode: + + + + + Global + + + + + Window + + + + + Application + + + + + Configure layouts + + + + diff --git a/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.desktop b/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.desktop new file mode 100644 index 0000000..6852c6b --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Tastatur-LED-Anzeige +Comment[de]=Plugin zum Anzeigen der Tastatur-LEDs und Umschalten des Layouts. diff --git a/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.ts b/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.ts new file mode 100644 index 0000000..e0060a8 --- /dev/null +++ b/lxqt-panel/plugin-kbindicator/translations/kbindicator_de.ts @@ -0,0 +1,80 @@ + + + + + Content + + + Layout + Layout + + + + Variant + Variante + + + + KbdStateConfig + + + Dialog + Tastatur + + + + Leds + LEDs + + + + Show Caps Lock + Feststelltaste anzeigen + + + + Show Num Lock + NumLock-Taste anzeigen + + + + Show Scroll Lock + Rollen-Taste anzeigen + + + + Show keyboard layout + Tastatur-Layout anzeigen + + + + Show flags instead labels + Flaggen statt Kennung anzeigen + + + + Layout mode: + Layout-Modus: + + + + Global + Global + + + + Window + Fenster + + + + Application + Anwendung + + + + Configure layouts + Layout konfigurieren... + + + diff --git a/lxqt-panel/plugin-mainmenu/CMakeLists.txt b/lxqt-panel/plugin-mainmenu/CMakeLists.txt new file mode 100644 index 0000000..1d2e683 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/CMakeLists.txt @@ -0,0 +1,45 @@ +set(PLUGIN "mainmenu") + +set(HEADERS + lxqtmainmenu.h + menustyle.h + lxqtmainmenuconfiguration.h +) + +set(SOURCES + lxqtmainmenu.cpp + menustyle.cpp + lxqtmainmenuconfiguration.cpp +) + +set(UIS + lxqtmainmenuconfiguration.ui +) + +# optionally use libmenu-cache to generate the application menu +find_package(PkgConfig) +if(NOT WITHOUT_MENU_CACHE) + pkg_check_modules(MENU_CACHE + libmenu-cache>=0.3.3 + ) +endif() + +if(MENU_CACHE_FOUND) + list(APPEND SOURCES xdgcachedmenu.cpp) + list(APPEND MOCS xdgcachedmenu.h) + + include_directories(${MENU_CACHE_INCLUDE_DIRS}) + add_definitions(-DHAVE_MENU_CACHE=1) +endif() + +set(LIBRARIES + lxqt + lxqt-globalkeys + lxqt-globalkeys-ui + ${MENU_CACHE_LIBRARIES} +) + +set(QT_USE_QTXML 1) +set(QT_USE_QTDBUS 1) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-mainmenu/lxqtmainmenu.cpp b/lxqt-panel/plugin-mainmenu/lxqtmainmenu.cpp new file mode 100644 index 0000000..a14d5d2 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/lxqtmainmenu.cpp @@ -0,0 +1,357 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtmainmenu.h" +#include "lxqtmainmenuconfiguration.h" +#include "../panel/lxqtpanel.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for find_if() +#include + +#include +#include +#include + +#ifdef HAVE_MENU_CACHE +#include "xdgcachedmenu.h" +#endif + +#include +#include +#include + +#define DEFAULT_SHORTCUT "Alt+F1" + +LxQtMainMenu::LxQtMainMenu(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mMenu(0), + mShortcut(0), + mLockCascadeChanges(false) +{ +#ifdef HAVE_MENU_CACHE + mMenuCache = NULL; + mMenuCacheNotify = 0; +#endif + + mDelayedPopup.setSingleShot(true); + mDelayedPopup.setInterval(250); + connect(&mDelayedPopup, &QTimer::timeout, this, &LxQtMainMenu::showHideMenu); + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(250); + + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + mButton.installEventFilter(this); + + connect(&mButton, &QToolButton::clicked, this, &LxQtMainMenu::showHideMenu); + + settingsChanged(); + + connect(mShortcut, SIGNAL(activated()), &mDelayedPopup, SLOT(start())); + connect(mShortcut, SIGNAL(shortcutChanged(QString,QString)), this, SLOT(shortcutChanged(QString,QString))); +} + + +/************************************************ + + ************************************************/ +LxQtMainMenu::~LxQtMainMenu() +{ + mButton.removeEventFilter(this); +#ifdef HAVE_MENU_CACHE + if(mMenuCache) + { + menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); + menu_cache_unref(mMenuCache); + } +#endif +} + + +/************************************************ + + ************************************************/ +void LxQtMainMenu::showHideMenu() +{ + + if (mMenu && (mMenu->isVisible() || mHideTimer.isActive())) + mMenu->hide(); + else + showMenu(); +} + +/************************************************ + + ************************************************/ +void LxQtMainMenu::shortcutChanged(const QString &/*oldShortcut*/, const QString &newShortcut) +{ + if (!newShortcut.isEmpty()) + { + mLockCascadeChanges = true; + + settings()->setValue("dialog/shortcut", newShortcut); + settings()->sync(); + mShortcutSeq = QKeySequence(newShortcut); + + mLockCascadeChanges = false; + } +} + + +/************************************************ + + ************************************************/ +void LxQtMainMenu::showMenu() +{ + if (!mMenu) + return; + + // Just using Qt`s activateWindow() won't work on some WMs like Kwin. + // Solution is to execute menu 1ms later using timer + mMenu->popup(calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); +} + +#ifdef HAVE_MENU_CACHE +// static +void LxQtMainMenu::menuCacheReloadNotify(MenuCache* cache, gpointer user_data) +{ + reinterpret_cast(user_data)->buildMenu(); +} +#endif + +/************************************************ + + ************************************************/ +void LxQtMainMenu::settingsChanged() +{ + if (mLockCascadeChanges) + return; + + if (settings()->value("showText", false).toBool()) + { + mButton.setText(settings()->value("text", "Start").toString()); + mButton.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + } + else + { + mButton.setText(""); + mButton.setToolButtonStyle(Qt::ToolButtonIconOnly); + } + + mLogDir = settings()->value("log_dir", "").toString(); + + QString menu_file = settings()->value("menu_file", "").toString(); + if (menu_file.isEmpty()) + menu_file = XdgMenu::getMenuFileName(); + + if (mMenuFile != menu_file) + { + mMenuFile = menu_file; +#ifdef HAVE_MENU_CACHE + menu_cache_init(0); + if(mMenuCache) + { + menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); + menu_cache_unref(mMenuCache); + } + mMenuCache = menu_cache_lookup(mMenuFile.toLocal8Bit()); + if (menu_cache_get_root_dir(mMenuCache)) + buildMenu(); + mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this); +#else + mXdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LxQt"); + mXdgMenu.setLogDir(mLogDir); + + bool res = mXdgMenu.read(mMenuFile); + connect(&mXdgMenu, SIGNAL(changed()), this, SLOT(buildMenu())); + if (res) + { + QTimer::singleShot(1000, this, SLOT(buildMenu())); + } + else + { + QMessageBox::warning(0, "Parse error", mXdgMenu.errorString()); + return; + } +#endif + } + + QString shortcut = settings()->value("shortcut", DEFAULT_SHORTCUT).toString(); + if (shortcut.isEmpty()) + shortcut = DEFAULT_SHORTCUT; + + if (!mShortcut) + mShortcut = GlobalKeyShortcut::Client::instance()->addAction(shortcut, QString("/panel/%1/show_hide").arg(settings()->group()), tr("Show/hide main menu"), this); + else if (mShortcut->shortcut() != shortcut) + { + mShortcut->changeShortcut(shortcut); + } + mShortcutSeq = QKeySequence(shortcut); + + setMenuFontSize(); + + realign(); +} + + +/************************************************ + + ************************************************/ +void LxQtMainMenu::buildMenu() +{ +#ifdef HAVE_MENU_CACHE + XdgCachedMenu* menu = new XdgCachedMenu(mMenuCache, &mButton); +#else + XdgMenuWidget *menu = new XdgMenuWidget(mXdgMenu, "", &mButton); +#endif + menu->setObjectName("TopLevelMainMenu"); + menu->setStyle(&mTopMenuStyle); + + menu->addSeparator(); + + Q_FOREACH(QAction* action, menu->actions()) + { + if (action->menu()) + action->menu()->installEventFilter(this); + } + + menu->installEventFilter(this); + connect(menu, &QMenu::aboutToHide, &mHideTimer, static_cast(&QTimer::start)); + connect(menu, &QMenu::aboutToShow, &mHideTimer, &QTimer::stop); + // panel notification (needed in case of auto-hide) + connect(menu, &QMenu::aboutToHide, dynamic_cast(panel()), &LxQtPanel::hidePanel); + + QMenu *oldMenu = mMenu; + mMenu = menu; + if(oldMenu) + delete oldMenu; + + setMenuFontSize(); +} + +/************************************************ + + ************************************************/ +void LxQtMainMenu::setMenuFontSize() +{ + if (!mMenu) + return; + + QFont menuFont = mButton.font(); + if(settings()->value("customFont", false).toBool()) + { + menuFont = mMenu->font(); + menuFont.setPointSize(settings()->value("customFontSize").toInt()); + } + + if (mMenu->font() != menuFont) + { + mMenu->setFont(menuFont); + QList subMenuList = mMenu->findChildren(); + foreach (QMenu* subMenu, subMenuList) + { + subMenu->setFont(menuFont); + } + } +} + + +/************************************************ + + ************************************************/ +QDialog *LxQtMainMenu::configureDialog() +{ + return new LxQtMainMenuConfiguration(*settings(), DEFAULT_SHORTCUT); +} +/************************************************ + + ************************************************/ + +// functor used to match a QAction by prefix +struct MatchAction +{ + MatchAction(QString key):key_(key) {} + bool operator()(QAction* action) { return action->text().startsWith(key_, Qt::CaseInsensitive); } + QString key_; +}; + +bool LxQtMainMenu::eventFilter(QObject *obj, QEvent *event) +{ + if(obj == &mButton) + { + // the application is given a new QStyle + if(event->type() == QEvent::StyleChange) + { + // reset proxy style for the menus so they can apply the new styles + mTopMenuStyle.setBaseStyle(NULL); + mMenuStyle.setBaseStyle(NULL); + } + } + else if(QMenu* menu = qobject_cast(obj)) + { + if(event->type() == QEvent::KeyPress) + { + // if our shortcut key is pressed while the menu is open, close the menu + QKeyEvent* keyEvent = static_cast(event); + if(mShortcutSeq == QKeySequence(keyEvent->modifiers() + keyEvent->key())) + { + mMenu->hide(); // close the app menu + return true; + } + else // go to the menu item starts with the pressed key + { + QString key = keyEvent->text(); + if(key.isEmpty()) + return false; + QAction* action = menu->activeAction(); + QList actions = menu->actions(); + QList::iterator it = qFind(actions.begin(), actions.end(), action); + it = std::find_if(it + 1, actions.end(), MatchAction(key)); + if(it == actions.end()) + it = std::find_if(actions.begin(), it, MatchAction(key)); + if(it != actions.end()) + menu->setActiveAction(*it); + } + } + } + return false; +} + +#undef DEFAULT_SHORTCUT diff --git a/lxqt-panel/plugin-mainmenu/lxqtmainmenu.h b/lxqt-panel/plugin-mainmenu/lxqtmainmenu.h new file mode 100644 index 0000000..9653809 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/lxqtmainmenu.h @@ -0,0 +1,125 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_MAINMENU_H +#define LXQT_MAINMENU_H + +#include "../panel/ilxqtpanelplugin.h" +#include + +#ifdef HAVE_MENU_CACHE +#include +#endif + +#include +#include +#include +#include +#include +#include + +#include "menustyle.h" + + +class QMenu; +class LxQtBar; + +namespace LxQt { +class PowerManager; +class ScreenSaver; +} + +namespace GlobalKeyShortcut +{ +class Action; +} + +class LxQtMainMenu : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtMainMenu(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtMainMenu(); + + QString themeId() const { return "MainMenu"; } + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog ; } + + QWidget *widget() { return &mButton; } + QDialog *configureDialog(); + + bool isSeparate() const { return true; } + +protected: + bool eventFilter(QObject *obj, QEvent *event); + +private: + void setMenuFontSize(); + +private: + QToolButton mButton; + QString mLogDir; + QMenu* mMenu; + GlobalKeyShortcut::Action *mShortcut; + MenuStyle mTopMenuStyle; + MenuStyle mMenuStyle; + +#ifdef HAVE_MENU_CACHE + MenuCache* mMenuCache; + MenuCacheNotifyId mMenuCacheNotify; + static void menuCacheReloadNotify(MenuCache* cache, gpointer user_data); +#else + XdgMenu mXdgMenu; +#endif + + bool mLockCascadeChanges; + QTimer mDelayedPopup; + QTimer mHideTimer; + QKeySequence mShortcutSeq; + QString mMenuFile; + +protected slots: + + virtual void settingsChanged(); + void buildMenu(); + +private slots: + void showMenu(); + void showHideMenu(); + void shortcutChanged(const QString &oldShortcut, const QString &newShortcut); +}; + +class LxQtMainMenuPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtMainMenu(startupInfo);} +}; + +#endif diff --git a/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.cpp b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.cpp new file mode 100644 index 0000000..2c78cb5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.cpp @@ -0,0 +1,151 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtmainmenuconfiguration.h" +#include "ui_lxqtmainmenuconfiguration.h" +#include +#include + +#include + +LxQtMainMenuConfiguration::LxQtMainMenuConfiguration(QSettings &settings, const QString &defaultShortcut, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtMainMenuConfiguration), + mSettings(settings), + mOldSettings(settings), + mDefaultShortcut(defaultShortcut) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("MainMenuConfigurationWindow"); + ui->setupUi(this); + + ui->chooseMenuFilePB->setIcon(XdgIcon::fromTheme("folder")); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + + connect(ui->showTextCB, SIGNAL(toggled(bool)), this, SLOT(showTextChanged(bool))); + connect(ui->textLE, SIGNAL(textEdited(QString)), this, SLOT(textButtonChanged(QString))); + connect(ui->chooseMenuFilePB, SIGNAL(clicked()), this, SLOT(chooseMenuFile())); + connect(ui->menuFilePathLE, &QLineEdit::textChanged, [this] (QString const & file) + { + mSettings.setValue(QStringLiteral("menu_file"), file); + }); + + connect(ui->shortcutEd, SIGNAL(shortcutGrabbed(QString)), this, SLOT(shortcutChanged(QString))); + connect(ui->shortcutEd->addMenuAction(tr("Reset")), SIGNAL(triggered()), this, SLOT(shortcutReset())); + + connect(ui->customFontCB, SIGNAL(toggled(bool)), this, SLOT(customFontChanged(bool))); + connect(ui->customFontSizeSB, SIGNAL(valueChanged(int)), this, SLOT(customFontSizeChanged(int))); +} + +LxQtMainMenuConfiguration::~LxQtMainMenuConfiguration() +{ + delete ui; +} + +void LxQtMainMenuConfiguration::loadSettings() +{ + ui->showTextCB->setChecked(mSettings.value("showText", false).toBool()); + ui->textLE->setText(mSettings.value("text", "").toString()); + + QString menuFile = mSettings.value("menu_file", "").toString(); + if (menuFile.isEmpty()) + { + menuFile = XdgMenu::getMenuFileName(); + } + ui->menuFilePathLE->setText(menuFile); + ui->shortcutEd->setText(mSettings.value("shortcut", "Alt+F1").toString()); + + ui->customFontCB->setChecked(mSettings.value("customFont", false).toBool()); + LxQt::Settings lxqtSettings("lxqt"); //load system font size as init value + QFont systemFont; + lxqtSettings.beginGroup(QLatin1String("Qt")); + systemFont.fromString(lxqtSettings.value("font", this->font()).toString()); + lxqtSettings.endGroup(); + ui->customFontSizeSB->setValue(mSettings.value("customFontSize", systemFont.pointSize()).toInt()); +} + +void LxQtMainMenuConfiguration::textButtonChanged(const QString &value) +{ + mSettings.setValue("text", value); +} + +void LxQtMainMenuConfiguration::showTextChanged(bool value) +{ + mSettings.setValue("showText", value); +} + +void LxQtMainMenuConfiguration::chooseMenuFile() +{ + QFileDialog *d = new QFileDialog(this, + tr("Choose menu file"), + QStringLiteral("/etc/xdg/menus"), + tr("Menu files (*.menu)")); + d->setWindowModality(Qt::WindowModal); + d->setAttribute(Qt::WA_DeleteOnClose); + connect(d, &QFileDialog::fileSelected, [&] (const QString &file) { + ui->menuFilePathLE->setText(file); + }); + d->show(); +} + +void LxQtMainMenuConfiguration::shortcutChanged(const QString &value) +{ + ui->shortcutEd->setText(value); + mSettings.setValue("shortcut", value); +} + +void LxQtMainMenuConfiguration::shortcutReset() +{ + shortcutChanged(mDefaultShortcut); +} + +void LxQtMainMenuConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + +void LxQtMainMenuConfiguration::customFontChanged(bool value) +{ + mSettings.setValue("customFont", value); +} + +void LxQtMainMenuConfiguration::customFontSizeChanged(int value) +{ + mSettings.setValue("customFontSize", value); +} diff --git a/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.h b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.h new file mode 100644 index 0000000..496bdbc --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.h @@ -0,0 +1,72 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTMAINMENUCONFIGURATION_H +#define LXQTMAINMENUCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class LxQtMainMenuConfiguration; +} + +class LxQtMainMenuConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtMainMenuConfiguration(QSettings &settings, const QString &defaultShortcut, QWidget *parent = 0); + ~LxQtMainMenuConfiguration(); + +private: + Ui::LxQtMainMenuConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache mOldSettings; + QString mDefaultShortcut; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void textButtonChanged(const QString &value); + void showTextChanged(bool value); + void chooseMenuFile(); + void shortcutChanged(const QString &value); + void shortcutReset(); + void customFontChanged(bool value); + void customFontSizeChanged(int value); +}; + +#endif // LXQTMAINMENUCONFIGURATION_H diff --git a/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.ui b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.ui new file mode 100644 index 0000000..7ba4d93 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/lxqtmainmenuconfiguration.ui @@ -0,0 +1,196 @@ + + + LxQtMainMenuConfiguration + + + + 0 + 0 + 434 + 325 + + + + Main Menu settings + + + + + + General + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + false + + + + + + Button text: + + + + + + + false + + + + + + + true + + + Custom font size: + + + + + + + false + + + pt + + + 1 + + + 11 + + + + + + + + + + true + + + Menu file + + + + + + Menu file: + + + + + + + + + + + + + + + + Keyboard Shortcut + + + + + + + 200 + 0 + + + + + + + + + + + Click the button to record shortcut: + + + + + + + + + + Qt::Vertical + + + + 20 + 41 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + ShortcutSelector + QToolButton +
LXQtGlobalKeysUi/ShortcutSelector
+
+
+ + + + customFontCB + toggled(bool) + customFontSizeSB + setEnabled(bool) + + + 60 + 249 + + + 280 + 277 + + + + + showTextCB + toggled(bool) + textLE + setEnabled(bool) + + + 239 + 39 + + + 313 + 68 + + + + +
diff --git a/lxqt-panel/plugin-mainmenu/menustyle.cpp b/lxqt-panel/plugin-mainmenu/menustyle.cpp new file mode 100644 index 0000000..6c660f5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/menustyle.cpp @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "menustyle.h" +#include + + +/************************************************ + + ************************************************/ +MenuStyle::MenuStyle(): + QProxyStyle() +{ + mIconSize = 16; +} + + +/************************************************ + + ************************************************/ +int MenuStyle::pixelMetric(PixelMetric metric, const QStyleOption * option, const QWidget * widget) const +{ + if (metric == QProxyStyle::PM_SmallIconSize) + return mIconSize; + + return QProxyStyle::pixelMetric(metric, option, widget); +} + +/************************************************ + + ************************************************/ +int MenuStyle::styleHint(StyleHint hint, const QStyleOption * option, const QWidget* widget, QStyleHintReturn* returnData) const +{ + // By default, the popup menu will be closed when Alt key + // is pressed. If SH_MenuBar_AltKeyNavigation style hint returns + // false, this behavior can be supressed so let's do it. + if(hint == QStyle::SH_MenuBar_AltKeyNavigation) + return 0; + return QProxyStyle::styleHint(hint, option, widget, returnData); +} + diff --git a/lxqt-panel/plugin-mainmenu/menustyle.h b/lxqt-panel/plugin-mainmenu/menustyle.h new file mode 100644 index 0000000..116dd20 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/menustyle.h @@ -0,0 +1,48 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef MENUSTYLE_H +#define MENUSTYLE_H + +#include + +class MenuStyle : public QProxyStyle +{ + Q_OBJECT +public: + explicit MenuStyle(); + int pixelMetric(PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const; + int styleHint(StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0, QStyleHintReturn* returnData = 0) const; + int iconSize() const { return mIconSize; } + void setIconSize(int value) { mIconSize = value; } + +private: + int mIconSize; +}; + +#endif // MENUSTYLE_H diff --git a/lxqt-panel/plugin-mainmenu/resources/mainmenu.desktop.in b/lxqt-panel/plugin-mainmenu/resources/mainmenu.desktop.in new file mode 100644 index 0000000..6cecd44 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/resources/mainmenu.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. +Icon=start-here-lxqt + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu.ts new file mode 100644 index 0000000..73d2fc8 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + + LxQtMainMenuConfiguration + + + General + + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + + + + + Menu file: + + + + + ... + + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.desktop new file mode 100644 index 0000000..b10541f --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=بادئ التطبيقات المعتمد على قائمة +Name[ar]=قائمة التطبيقات diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.ts new file mode 100644 index 0000000..0577531 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ar.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + مغادرة + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + إعدادات قائمة ريزر الرئيسيَّة + + + + General + العامّ + + + Show text + إظهار النَّصّ + + + Button text + نصُّ الزُّرّ + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + ملفُّ القائمة + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + اختصار المفاتيح + + + + Click the button to record shortcut: + اضغط المفتاح لتسجيل الاختصار + + + + Reset + + + + + Choose menu file + اختيار ملفِّ القائمة + + + + Menu files (*.menu) + ملفَّات القائمة (*.menu) + + + diff --git a/plugin-mainmenu/translations/mainmenu_de_DE.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.desktop similarity index 69% rename from plugin-mainmenu/translations/mainmenu_de_DE.desktop rename to lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.desktop index 790ac37..4392af2 100644 --- a/plugin-mainmenu/translations/mainmenu_de_DE.desktop +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.desktop @@ -8,5 +8,5 @@ Comment=A menu of all your applications. # Translations -Comment[de_DE]=Menü-basierter Anwendungsstarter -Name[de_DE]=Anwendungsmenü +Comment[cs]=Hlavní nabídka +Name[cs]=Nabídka diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.ts new file mode 100644 index 0000000..cf03517 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Opustit + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Nastavení hlavní nabídky + + + + General + Obecné + + + Show text + Ukázat text + + + Button text + Text + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Soubor s nabídkou + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Klávesová zkratka + + + + Click the button to record shortcut: + Klepněte na tlačítko pro nahrání klávesové zkratky: + + + + Reset + + + + + Choose menu file + Vybrat soubor s nabídkou + + + + Menu files (*.menu) + Soubory s nabídkami (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.desktop new file mode 100644 index 0000000..c0a6c5b --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Spouštěč programů založený na nabídce +Name[cs_CZ]=Nabídka programů diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.ts new file mode 100644 index 0000000..97ac808 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_cs_CZ.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Opustit + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Nastavení hlavní nabídky + + + + General + Obecné + + + Show text + Ukázat text + + + Button text + Text + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Soubor s nabídkou + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Klávesová zkratka + + + + Click the button to record shortcut: + Klepněte na tlačítko pro nahrání klávesové zkratky: + + + + Reset + + + + + Choose menu file + Vybrat soubor s nabídkou + + + + Menu files (*.menu) + Soubory s nabídkami (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.desktop new file mode 100644 index 0000000..cbbdaa5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Menubaseret programstarter +Name[da]=Programmenu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.ts new file mode 100644 index 0000000..60e01a5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Forlad + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LXQt Hovedmenu Indstillinger + + + + General + Generelt + + + Show text + Vis tekst + + + Button text + Knaptekst + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menufil + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Tastaturgenvej + + + + Click the button to record shortcut: + Klik på knappen for at optage genvej: + + + + Reset + + + + + Choose menu file + Vælg menufil + + + + Menu files (*.menu) + Menufiler (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.desktop new file mode 100644 index 0000000..4c429bc --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Menubaseret programstarter +Name[da_DK]=Program menu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.ts new file mode 100644 index 0000000..b1cacce --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_da_DK.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Forlad + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt Hoved Menu Indstillinger + + + + General + Generelt + + + Show text + Vis tekst + + + Button text + Knaptekst + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menu konfigurationsfil + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Tastaturgenveje + + + + Click the button to record shortcut: + Klik for at optage genvej: + + + + Reset + + + + + Choose menu file + Vælg menu konfigurationsfil + + + + Menu files (*.menu) + Menu konfigurationsfiler (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.desktop new file mode 100644 index 0000000..eaf499e --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Anwendungsmenü +Comment[de]=Menübasierter Anwendungsstarter diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.ts new file mode 100644 index 0000000..94cb85d --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_de.ts @@ -0,0 +1,75 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Hauptmenü anzeigen/verstecken + + + + LxQtMainMenuConfiguration + + + Main Menu settings + Hauptmenü-Einstellungen + + + + General + Allgemein + + + + Button text: + Schaltflächentext: + + + + Custom font size: + Eigene Schriftgröße: + + + + pt + pt + + + + Menu file + Menü-Datei + + + + Menu file: + Menü-Datei: + + + + Keyboard Shortcut + Tastenkürzel + + + + Click the button to record shortcut: + Auf die Schaltfläche klicken, um ein Tastenkürzel aufzunehmen: + + + + Reset + Zurücksetzen + + + + Choose menu file + Menü-Datei auswählen + + + + Menu files (*.menu) + Menü-Dateien (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.desktop new file mode 100644 index 0000000..fde6090 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Μενού εκκίνησης εφαρμογών +Name[el_GR]=Μενού εφαρμογών diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.ts new file mode 100644 index 0000000..9ff8f32 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_el_GR.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Έξοδος + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Ρυθμίσεις κυρίως μενού LxQt + + + + General + Γενικά + + + Show text + Εμφάνιση κειμένου + + + Button text + Κείμενου πλήκτρου + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Αρχείο μενού + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Συντόμευση πληκτρολογίου + + + + Click the button to record shortcut: + Κλικ στο πλήκτρο για εγγραφή της συντόμευσης: + + + + Reset + + + + + Choose menu file + Επιλογή αρχείου μενού + + + + Menu files (*.menu) + Αρχεία μενού (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.desktop new file mode 100644 index 0000000..616b575 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Lanĉilo de aplikaĵoj baziĝita sur menuo +Name[eo]=Menuo de aplikaĵoj diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.ts new file mode 100644 index 0000000..400c5ac --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eo.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Forlasi + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Agordoj de ĉefa menuo de LxQt + + + + General + Ĝenerala + + + Show text + Montri tekston + + + Button text + Teksto de butonoj + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menua dosiero + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Klavkombinoj + + + + Click the button to record shortcut: + Alklaku sur la butono por registi klavkombinon: + + + + Reset + + + + + Choose menu file + lektu menuan dosieron + + + + Menu files (*.menu) + Menuaj dosieroj (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.desktop new file mode 100644 index 0000000..85625cf --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Lanzador de aplicaciones con menú +Name[es]=Menu de Aplicaciones diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.ts new file mode 100644 index 0000000..25f31f2 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Salir + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Configuración del menú principal de LxQt + + + + General + General + + + Show text + Mostrar texto + + + Button text + Texto de los botones + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Archivo del menú + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Atajos del teclado + + + + Click the button to record shortcut: + Presione el botón para registrar el atajo: + + + + Reset + + + + + Choose menu file + Escoger un archivo de menú + + + + Menu files (*.menu) + Archivos de menú (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_UY.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_UY.ts new file mode 100644 index 0000000..e4c69eb --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_UY.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Salir + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Configuración del Menú Principal LxQt + + + + General + General + + + Show text + Mostrar etiqueta + + + Button text + Etiqueta del botón + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Archivo de menú + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + Seleccionar archivo de menú + + + + Menu files (*.menu) + Archivos de menú (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.desktop new file mode 100644 index 0000000..cb25745 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Menu para lanzar las aplicaciones instaladas graficas +Name[es_VE]=Menu de aplicaciones diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.ts new file mode 100644 index 0000000..9c1628f --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_es_VE.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Salir + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Configuración del Menú Principal LxQt + + + + General + General + + + Show text + Mostrar etiqueta + + + Button text + Etiqueta del botón + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Archivo de menú alterno + + + + Menu file: + + + + + ... + Buscar ... + + + + Keyboard Shortcut + Tecla de acceso rapido + + + + Click the button to record shortcut: + Pulsa en el boton para grabar el acceso rapido: + + + + Reset + + + + + Choose menu file + Seleccionar archivo de menú + + + + Menu files (*.menu) + Archivos de menú (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.desktop new file mode 100644 index 0000000..e73f5c7 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Menu bidezko aplikazio-abiarazlea +Name[eu]=Aplikazio menua diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.ts new file mode 100644 index 0000000..0fe6784 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_eu.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Irten + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt menu nagusiaren ezarpenak + + + + General + Orokorra + + + Show text + Erakutsi testua + + + Button text + Botoi-testua + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menu fitxategia + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Teklatuko lasterbidea + + + + Click the button to record shortcut: + Klikatu botoia lasterbidea grabatzeko: + + + + Reset + + + + + Choose menu file + Aukeratu menu fitxategia + + + + Menu files (*.menu) + Menu fitxategiak (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.desktop new file mode 100644 index 0000000..334eeb5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Valikkopohjainen sovelluskäynnistin +Name[fi]=Sovellusvalikko diff --git a/plugin-mainmenu/translations/mainmenu_de_DE.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.ts similarity index 80% rename from plugin-mainmenu/translations/mainmenu_de_DE.ts rename to lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.ts index d83bd7a..4d556a2 100644 --- a/plugin-mainmenu/translations/mainmenu_de_DE.ts +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fi.ts @@ -1,37 +1,36 @@ - + LxQtMainMenu - + Show/hide main menu - Leave - Verlassen + Poistu LxQtMainMenuConfiguration LxQt Main Menu settings - LxQt Hauptmenü Einstellungen + LxQtin päävalikon asetukset General - Allgemein + Yleiset Show text - Zeige Text + Näytä teksti Button text - Schaltflächen Text + Painiketeksti @@ -56,7 +55,7 @@ Menu file - Menü Datei + Valikkotiedosto @@ -71,12 +70,12 @@ Keyboard Shortcut - Tastenkürzel + Pikanäppäin Click the button to record shortcut: - Klicke um Tastenkürzel zu ändern: + Napsauta painiketta nauhoittaaksesi pikanäppäimen: @@ -86,12 +85,12 @@ Choose menu file - Wähle Menü Datei + Valitse valikkotiedosto Menu files (*.menu) - Menü Datei (*.menu) + Valikkotiedostot (*.menu) diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.desktop new file mode 100644 index 0000000..00992de --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Lanceur d'application sous forme de menu +Name[fr_FR]=Menu d'application diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.ts new file mode 100644 index 0000000..f127304 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_fr_FR.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Quitter + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Menu principal des paramètres de LxQt + + + + General + Généraux + + + Show text + Montrer le texte + + + Button text + Texte des boutons + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Fichier de menu + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Raccourcis clavier + + + + Click the button to record shortcut: + Cliquez sur le bouton pour enregistrer le raccourci : + + + + Reset + + + + + Choose menu file + Choisissez un fichier de menu + + + + Menu files (*.menu) + Fichiers de menu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_hr.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hr.ts new file mode 100644 index 0000000..e82b93c --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hr.ts @@ -0,0 +1,75 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Pokaži/sakrij glavni izbornik + + + + LxQtMainMenuConfiguration + + + General + Općenito + + + + Main Menu settings + Postavke glavnoga izbornika + + + + Button text: + + + + + Custom font size: + Prilagođena veličina fonta: + + + + pt + pt + + + + Menu file + Datoteka izbornika + + + + Menu file: + Datoteka izbornika: + + + + Keyboard Shortcut + Kratica tipkovnice + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + Izaberite datoteku izbornika + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.desktop new file mode 100644 index 0000000..b862473 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Alkalmazásindító alapú menü +Name[hu]=Alkalmazásmenü diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.ts new file mode 100644 index 0000000..0958db1 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Menü láttatás/elrejtés + + + Leave + Leállítás + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt főmenü beállítás + + + + General + Általános + + + Show text + Szöveg megjelenítése + + + Button text + Gombszöveg + + + + Main Menu settings + Menübeállítás + + + + Button text: + Gombszöveg: + + + + Custom font size: + Saját betűnagyság: + + + + pt + .pont + + + + Menu file + Menüfájl + + + + Menu file: + Menüfájl: + + + + ... + + + + + Keyboard Shortcut + Gyorsbillentyű + + + + Click the button to record shortcut: + Billentyű nyomása a megjegyzéshez... + + + + Reset + Visszaállít + + + + Choose menu file + Menüfájl kiválasztása + + + + Menu files (*.menu) + Menüfájlok (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu_HU.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu_HU.ts new file mode 100644 index 0000000..4514508 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_hu_HU.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Menü láttatás/elrejtés + + + Leave + Leállítás + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt főmenü beállítás + + + + General + Általános + + + Show text + Szöveg megjelenítése + + + Button text + Gombszöveg + + + + Main Menu settings + Menübeállítás + + + + Button text: + Gombszöveg: + + + + Custom font size: + Saját betűnagyság: + + + + pt + .pont + + + + Menu file + Menüfájl + + + + Menu file: + Menüfájl: + + + + ... + + + + + Keyboard Shortcut + Gyorsbillentyű + + + + Click the button to record shortcut: + Billentyű nyomása a megjegyzéshez... + + + + Reset + Visszaállít + + + + Choose menu file + Menüfájl kiválasztása + + + + Menu files (*.menu) + Menüfájlok (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.desktop new file mode 100644 index 0000000..6c4d961 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=Menu based application launcher + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.ts new file mode 100644 index 0000000..7cc16c2 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ia.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + + LxQtMainMenuConfiguration + + + General + + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + + + + + Menu file: + + + + + ... + + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.desktop new file mode 100644 index 0000000..3f5234a --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[id_ID]=Peluncur aplikasi berbasis menu +Name[id_ID]=Menu aplikasi diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.ts new file mode 100644 index 0000000..095b42b --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_id_ID.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + + LxQtMainMenuConfiguration + + + General + + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + + + + + Menu file: + + + + + ... + + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.desktop new file mode 100644 index 0000000..d87003f --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Avviatore delle applicazioni basato su menu +Name[it_IT]=Menu delle applicazioni diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.ts new file mode 100644 index 0000000..b3a286a --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_it_IT.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Mostra/nascondi menu principale + + + Leave + Esci + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Impostazioni del menu principale di LxQt + + + + General + Generali + + + Show text + Mostra testo + + + Button text + Testo del pulsante + + + + Main Menu settings + Impostazioni del menu principale di LXQt + + + + Button text: + Testo pulsante: + + + + Custom font size: + Dimensione carattere personalizzato: + + + + pt + + + + + Menu file + File del menu + + + + Menu file: + File del menu: + + + + ... + ... + + + + Keyboard Shortcut + Scorciatoia da tastiera + + + + Click the button to record shortcut: + Fai clic sul pulsante per impostare una scorciatoia: + + + + Reset + Ripristina + + + + Choose menu file + Scegli il file del menu + + + + Menu files (*.menu) + File del menu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.desktop new file mode 100644 index 0000000..dc18ca1 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=アプリケーションランチャーを元にしたメニューです +Name[ja]=アプリケーションメニュー diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.ts new file mode 100644 index 0000000..5f3b0d3 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ja.ts @@ -0,0 +1,84 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + メインメニューを表示/隠す + + + Leave + 終了 + + + + LxQtMainMenuConfiguration + + + General + 一般 + + + + Main Menu settings + メインメニューの設定 + + + + Button text: + ボタンの文字列: + + + + Custom font size: + フォントサイズの指定: + + + + pt + ポイント + + + + Menu file + メニューファイル + + + + Menu file: + メニューファイル: + + + + ... + ... + + + + Keyboard Shortcut + キーボードショートカット + + + + Click the button to record shortcut: + ショートカットを記録するにはボタンをクリック: + + + + Reset + リセット + + + + Choose menu file + メニューファイルを選択 + + + + Menu files (*.menu) + メニューファイル(*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.desktop new file mode 100644 index 0000000..6c4d961 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=Menu based application launcher + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.ts new file mode 100644 index 0000000..d1a91b9 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ko.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + + LxQtMainMenuConfiguration + + + General + + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + + + + + Menu file: + + + + + ... + + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.desktop new file mode 100644 index 0000000..54decc5 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Programų paleidimo meniu +Name[lt]=Programų meniu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.ts new file mode 100644 index 0000000..7f03949 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_lt.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Išeiti + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt pagrindinio meniu nuostatos + + + + General + Pagrindinės + + + Show text + Rodyti tekstą + + + Button text + Mygtuko tekstas + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Meniu rinkmena + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Spartusis klavišas + + + + Click the button to record shortcut: + Norėdami pakeisti klavišą, spragtelėkite + + + + Reset + + + + + Choose menu file + Pasirinkite meniu failą + + + + Menu files (*.menu) + Meniu failai (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.desktop new file mode 100644 index 0000000..b133bad --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Menu-gebasseerde applicatie starter +Name[nl]=Applicatie menu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.ts new file mode 100644 index 0000000..9724c07 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_nl.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Verlaten + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Instellingen van hoofdmenu van LxQt + + + + General + Algemeen + + + Show text + Tekst weergeven + + + Button text + Knoptekst + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menubestand + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Sneltoets + + + + Click the button to record shortcut: + Klik op de knop om de sneltoets vast te leggen: + + + + Reset + + + + + Choose menu file + Kies menubestand + + + + Menu files (*.menu) + Menubestanden (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl.desktop new file mode 100644 index 0000000..0ac249d --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Główne menu +Name[pl]=Menu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.desktop new file mode 100644 index 0000000..837de4c --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Menu aplikacji +Name[pl_PL]=Menu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.ts new file mode 100644 index 0000000..7ff8b07 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pl_PL.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Pokaż/ukryj menu + + + Leave + Opuść + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Ustawienia menu LxQt + + + + General + Ogólne + + + Show text + Pokaż tekst + + + Button text + Tekst + + + + Main Menu settings + Ustawienia Menu + + + + Button text: + Tekst przycisku: + + + + Custom font size: + Własny rozmiar czcionki: + + + + pt + pt + + + + Menu file + Plik menu + + + + Menu file: + Plik menu: + + + + ... + ... + + + + Keyboard Shortcut + Skrót klawiatury + + + + Click the button to record shortcut: + Wciśnij przycisk aby ustawić skrót: + + + + Reset + Zresetuj + + + + Choose menu file + Wybierz plik menu + + + + Menu files (*.menu) + Pliki menu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.desktop new file mode 100644 index 0000000..a1ec648 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Menu de aplicações +Comment[pt]=Lançador de aplicações baseado no menu diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.ts new file mode 100644 index 0000000..f59075d --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Sair + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Definições do menu principal do LxQt + + + + General + Geral + + + Show text + Mostrar texto + + + Button text + Texto do botão + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Ficheiro de menu + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Atalho de teclado + + + + Click the button to record shortcut: + Clique no botão para registar o atalho: + + + + Reset + + + + + Choose menu file + Escolha o ficheiro de menu + + + + Menu files (*.menu) + Ficheiros de menu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.desktop new file mode 100644 index 0000000..df9b5f6 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Lançador de aplicativos baseado em menu +Name[pt_BR]=Menu de aplicativos diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.ts new file mode 100644 index 0000000..90a5fd0 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_pt_BR.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Sair + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Configurações do menu principal do LxQt + + + + General + Geral + + + Show text + Exibir texto + + + Button text + Texto do botão + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Arquvo do menu + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Atalho do teclado + + + + Click the button to record shortcut: + Clique no botão para gravar o atalho: + + + + Reset + + + + + Choose menu file + Escolher arquivo do menu + + + + Menu files (*.menu) + Arquivos do menu (*.menus) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.desktop new file mode 100644 index 0000000..3bb9334 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Lansator de aplicații bazat pe meniuri +Name[ro_RO]=Meniu aplicații diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.ts new file mode 100644 index 0000000..20c0fa4 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ro_RO.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Părăsește + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Setări meniu principal LxQt + + + + General + General + + + Show text + Afișează text + + + Button text + Text buton + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Fișier meniu + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Tastă rapidă + + + + Click the button to record shortcut: + Apăsați butonul pentru a memora tasta rapidă: + + + + Reset + + + + + Choose menu file + Selectați fișierul meniu + + + + Menu files (*.menu) + Fișiere meniu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.desktop new file mode 100644 index 0000000..25de0e2 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Меню всех ваших программ. +Name[ru]=Меню приложений diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.ts new file mode 100644 index 0000000..d9cf260 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Показать/скрыть главное меню + + + + LxQtMainMenuConfiguration + + + Main Menu settings + Настройки главного меню + + + + General + Общие + + + + Button text: + Текст кнопки: + + + + Custom font size: + Выбрать кегль: + + + + pt + п + + + + Menu file + Файл меню + + + + Menu file: + Файл меню: + + + + ... + + + + + Keyboard Shortcut + Сочетание клавиш + + + + Click the button to record shortcut: + Нажмите на кнопку для записи сочетания клавиш: + + + + Reset + Сбросить + + + + Choose menu file + Выбрать файл меню + + + + Menu files (*.menu) + Файл меню (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.desktop new file mode 100644 index 0000000..abeb28e --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Меню всех ваших программ. +Name[ru_RU]=Меню приложений diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.ts new file mode 100644 index 0000000..b4a25ce --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_ru_RU.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Показать/скрыть главное меню + + + + LxQtMainMenuConfiguration + + + Main Menu settings + Настройки главного меню + + + + General + Общие + + + + Button text: + Текст кнопки: + + + + Custom font size: + Выбрать кегль: + + + + pt + п + + + + Menu file + Файл меню + + + + Menu file: + Файл меню: + + + + ... + + + + + Keyboard Shortcut + Сочетание клавиш + + + + Click the button to record shortcut: + Нажмите на кнопку для записи сочетания клавиш: + + + + Reset + Сбросить + + + + Choose menu file + Выбрать файл меню + + + + Menu files (*.menu) + Файл меню (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk.desktop new file mode 100644 index 0000000..2d17def --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Spúšťanie aplikácií z menu +Name[sk]=Menu aplikácií diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk_SK.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk_SK.ts new file mode 100644 index 0000000..872a01b --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sk_SK.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Opustiť + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Nastavenia Hlavného menu prostredia LxQt + + + + General + Všeobecné + + + Show text + Zobraziť text + + + Button text + Text tlačidla + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Súbor menu + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + Vybrať súbor menu + + + + Menu files (*.menu) + Súbory menu (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.desktop new file mode 100644 index 0000000..0480879 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Zaganjalnik programov, temelječ na meniju +Name[sl]=Programski meni diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.ts new file mode 100644 index 0000000..2d3f242 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sl.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Zapusti + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Nastavitve glavnega menija + + + + General + Splošno + + + Show text + Pokaži besedilo + + + Button text + Besedilo na gumbih + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Datoteka z menijem + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Tipkovna bližnjica + + + + Click the button to record shortcut: + Kliknite gumb za nastavitev bližnjice: + + + + Reset + + + + + Choose menu file + Izberite datoteko z menijem + + + + Menu files (*.menu) + Datoteke z menijem (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr.desktop new file mode 100644 index 0000000..487db48 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Мени покретача програма +Name[sr]=Мени програма diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavian.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavian.desktop new file mode 100644 index 0000000..b90d1f6 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Мени програма +Comment[sr@ijekavian]=Мени покретача програма diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..72d4aff --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Meni programa +Comment[sr@ijekavianlatin]=Meni pokretača programa diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.desktop new file mode 100644 index 0000000..6e7b8ea --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Meni pokretača programa +Name[sr@latin]=Meni programa diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.ts new file mode 100644 index 0000000..d1449a7 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr@latin.ts @@ -0,0 +1,80 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + + LxQtMainMenuConfiguration + + + General + + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + + + + + Menu file: + + + + + ... + + + + + Keyboard Shortcut + + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + + + + + Menu files (*.menu) + + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_BA.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_BA.ts new file mode 100644 index 0000000..9582e30 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_BA.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Напуштање + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Подешавања главног менија + + + + General + Опште + + + Show text + Прикажи текст + + + Button text + Текст тастера + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Фајл менија + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Пречица тастатуре + + + + Click the button to record shortcut: + Кликните на тастер да снимите пречицу: + + + + Reset + + + + + Choose menu file + Изабери фајл менија + + + + Menu files (*.menu) + Фајлови менија (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_RS.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_RS.ts new file mode 100644 index 0000000..91a5d24 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_sr_RS.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Напуштање + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Подешавања главног менија + + + + General + Опште + + + Show text + Прикажи текст + + + Button text + Текст тастера + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Фајл менија + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Пречица тастатуре + + + + Click the button to record shortcut: + Кликните на тастер да снимите пречицу: + + + + Reset + + + + + Choose menu file + Изабери фајл менија + + + + Menu files (*.menu) + Фајлови менија (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.desktop new file mode 100644 index 0000000..b5f327b --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=ปุ่มเรียกโปรแกรมพื้นฐานทางเมนู +Name[th_TH]=เมนูโปรแกรม diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.ts new file mode 100644 index 0000000..cf050cc --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_th_TH.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + ออก + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + ค่าตั้งเมนูหลัก LxQt + + + + General + ทั่วไป + + + Show text + แสดงข้อความ + + + Button text + ข้อความตรงปุ่ม + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + แฟ้มเมนู + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + ปุ่มลัด + + + + Click the button to record shortcut: + กดปุ่มที่จะใช้เป็นปุ่มลัด: + + + + Reset + + + + + Choose menu file + เลือกแฟ้มเมนู + + + + Menu files (*.menu) + แฟ้มเมนู (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.desktop new file mode 100644 index 0000000..7156143 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Menü temelli uygulama çalıştırıcı +Name[tr]=Uygulama menüsü diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.ts new file mode 100644 index 0000000..88516fc --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_tr.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Çık + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt Ana Menü ayarları + + + + General + Genel + + + Show text + Metin göster + + + Button text + Düğme metni + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Menü dosyası + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Klavye Kısayolu + + + + Click the button to record shortcut: + Kısayolu kaydetmek için düğmeye tıklayın: + + + + Reset + + + + + Choose menu file + Menü dosyası seç + + + + Menu files (*.menu) + Menü dosyaları (*.menü) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.desktop new file mode 100644 index 0000000..2a70645 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Меню з усіма програмами. +Name[uk]=Меню програм diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.ts new file mode 100644 index 0000000..1e21f47 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_uk.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + Полишити + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + Налаштування головного меню LxQt + + + + General + Загальне + + + Show text + Показувати текст + + + Button text + Текст кнопки + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + Файл меню + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + Клавіатурне скорочення + + + + Click the button to record shortcut: + Натисніть кнопку, щоб змінити клавіатурне скорочення: + + + + Reset + + + + + Choose menu file + Оберіть файл меню + + + + Menu files (*.menu) + Файли меню (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.GB2312.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.GB2312.desktop new file mode 100644 index 0000000..6c4d961 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=Menu based application launcher + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.desktop new file mode 100644 index 0000000..d8b020c --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=基于菜单的程序启动器 +Name[zh_CN]=程序菜单 diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.ts new file mode 100644 index 0000000..f9ddeee --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_CN.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + 离开 + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt主菜单设置 + + + + General + 常规 + + + Show text + 显示文本 + + + Button text + 按钮文本 + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + 菜单文件 + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + 键盘快捷键 + + + + Click the button to record shortcut: + 点击按钮记录快捷键 + + + + Reset + + + + + Choose menu file + 选择菜单文件 + + + + Menu files (*.menu) + 菜单文件 (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.desktop b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.desktop new file mode 100644 index 0000000..aacebcb --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Application menu +Comment=A menu of all your applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=以選單方式呈現的應用程式啟動器 +Name[zh_TW]=應用程式選單 diff --git a/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.ts b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.ts new file mode 100644 index 0000000..5bc02fb --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/translations/mainmenu_zh_TW.ts @@ -0,0 +1,96 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + + + + Leave + 離開 + + + + LxQtMainMenuConfiguration + + LxQt Main Menu settings + LxQt主選單設定 + + + + General + 通用 + + + Show text + 顯示文件 + + + Button text + 按鈕文件 + + + + Main Menu settings + + + + + Button text: + + + + + Custom font size: + + + + + pt + + + + + Menu file + 選單文件 + + + + Menu file: + + + + + ... + ... + + + + Keyboard Shortcut + 快捷鍵 + + + + Click the button to record shortcut: + 按下按鈕並設定為快捷鍵: + + + + Reset + + + + + Choose menu file + 選擇選單文件 + + + + Menu files (*.menu) + 選單文件 (*.menu) + + + diff --git a/lxqt-panel/plugin-mainmenu/xdgcachedmenu.cpp b/lxqt-panel/plugin-mainmenu/xdgcachedmenu.cpp new file mode 100644 index 0000000..11ac97b --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/xdgcachedmenu.cpp @@ -0,0 +1,187 @@ +/* + * + * Copyright (C) 2013 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "xdgcachedmenu.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +XdgCachedMenuAction::XdgCachedMenuAction(MenuCacheItem* item, QObject* parent): + QAction(parent), + item_(menu_cache_item_ref(item)) +{ + QString title = QString::fromUtf8(menu_cache_item_get_name(item)); + title = title.replace('&', QLatin1String("&&")); // & is reserved for mnemonics + setText(title); + // Only set tooltips for app items + if(menu_cache_item_get_type(item) == MENU_CACHE_TYPE_APP) + { + QString comment = QString::fromUtf8(menu_cache_item_get_comment(item)); + setToolTip(comment); + } +} + +XdgCachedMenuAction::~XdgCachedMenuAction() +{ + if(item_) + menu_cache_item_unref(item_); +} + +void XdgCachedMenuAction::updateIcon() +{ + if(icon().isNull()) + { + QIcon icon = XdgIcon::fromTheme(menu_cache_item_get_icon(item_)); + setIcon(icon); + } +} + +XdgCachedMenu::XdgCachedMenu(QWidget* parent): QMenu(parent) +{ + connect(this, SIGNAL(aboutToShow()), SLOT(onAboutToShow())); +} + +XdgCachedMenu::XdgCachedMenu(MenuCache* menuCache, QWidget* parent): QMenu(parent) +{ + // qDebug() << "CREATE MENU FROM CACHE" << menuCache; + MenuCacheDir* dir = menu_cache_get_root_dir(menuCache); + addMenuItems(this, dir); + connect(this, SIGNAL(aboutToShow()), SLOT(onAboutToShow())); +} + +XdgCachedMenu::~XdgCachedMenu() +{ +} + +void XdgCachedMenu::addMenuItems(QMenu* menu, MenuCacheDir* dir) +{ + for(GSList* l = menu_cache_dir_get_children(dir); l; l = l->next) + { + MenuCacheItem* item = (MenuCacheItem*)l->data; + MenuCacheType type = menu_cache_item_get_type(item); + + if(type == MENU_CACHE_TYPE_SEP) + { + menu->addSeparator(); + continue; + } + else + { + XdgCachedMenuAction* action = new XdgCachedMenuAction(item, menu); + menu->addAction(action); + if(type == MENU_CACHE_TYPE_APP) + connect(action, SIGNAL(triggered(bool)), SLOT(onItemTrigerred())); + else if(type == MENU_CACHE_TYPE_DIR) + { + XdgCachedMenu* submenu = new XdgCachedMenu(menu); + action->setMenu(submenu); + addMenuItems(submenu, (MenuCacheDir*)item); + } + } + } +} + +void XdgCachedMenu::onItemTrigerred() +{ + XdgCachedMenuAction* action = static_cast(sender()); + XdgDesktopFile df; + char* desktop_file = menu_cache_item_get_file_path(action->item()); + df.load(desktop_file); + g_free(desktop_file); + df.startDetached(); +} + +// taken from libqtxdg: XdgMenuWidget +bool XdgCachedMenu::event(QEvent* event) +{ + if (event->type() == QEvent::MouseButtonPress) + { + QMouseEvent *e = static_cast(event); + if (e->button() == Qt::LeftButton) + mDragStartPosition = e->pos(); + } + + else if (event->type() == QEvent::MouseMove) + { + QMouseEvent *e = static_cast(event); + handleMouseMoveEvent(e); + } + + else if(event->type() == QEvent::ToolTip) + { + QHelpEvent* helpEvent = static_cast(event); + QAction* action = actionAt(helpEvent->pos()); + if(action && action->menu() == NULL) + QToolTip::showText(helpEvent->globalPos(), action->toolTip(), this); + } + + return QMenu::event(event); +} + +// taken from libqtxdg: XdgMenuWidget +void XdgCachedMenu::handleMouseMoveEvent(QMouseEvent *event) +{ + if (!(event->buttons() & Qt::LeftButton)) + return; + + if ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance()) + return; + + XdgCachedMenuAction *a = qobject_cast(actionAt(mDragStartPosition)); + if (!a) + return; + + QList urls; + char* desktop_file = menu_cache_item_get_file_path(a->item()); + urls << QUrl(desktop_file); + g_free(desktop_file); + + QMimeData *mimeData = new QMimeData(); + mimeData->setUrls(urls); + + QDrag *drag = new QDrag(this); + drag->setMimeData(mimeData); + drag->exec(Qt::CopyAction | Qt::LinkAction); +} + +void XdgCachedMenu::onAboutToShow() +{ + Q_FOREACH(QAction* action, actions()) + { + if(action->inherits("XdgCachedMenuAction")) + { + static_cast(action)->updateIcon(); + + // this seems to cause some incorrect menu behaviour. + // qApp->processEvents(); + } + } +} diff --git a/lxqt-panel/plugin-mainmenu/xdgcachedmenu.h b/lxqt-panel/plugin-mainmenu/xdgcachedmenu.h new file mode 100644 index 0000000..4f380d1 --- /dev/null +++ b/lxqt-panel/plugin-mainmenu/xdgcachedmenu.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (C) 2013 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef XDGCACHEDMENU_H +#define XDGCACHEDMENU_H + +#include +#include + +class QEvent; +class QMouseEvent; + +class XdgCachedMenu : public QMenu +{ + Q_OBJECT +public: + XdgCachedMenu(QWidget* parent = NULL); + XdgCachedMenu(MenuCache* menuCache, QWidget* parent); + virtual ~XdgCachedMenu(); + +protected: + bool event(QEvent* event); + +private: + void addMenuItems(QMenu* menu, MenuCacheDir* dir); + void handleMouseMoveEvent(QMouseEvent *event); + +private Q_SLOTS: + void onItemTrigerred(); + void onAboutToShow(); + +private: + QPoint mDragStartPosition; +}; + +class XdgCachedMenuAction: public QAction +{ + Q_OBJECT +public: + explicit XdgCachedMenuAction(MenuCacheItem* item, QObject* parent = 0); + virtual ~XdgCachedMenuAction(); + + MenuCacheItem* item() const { + return item_; + } + + void updateIcon(); + +private: + MenuCacheItem* item_; +}; + + +#endif // XDGCACHEDMENU_H diff --git a/lxqt-panel/plugin-mount/CMakeLists.txt b/lxqt-panel/plugin-mount/CMakeLists.txt new file mode 100644 index 0000000..e9e2211 --- /dev/null +++ b/lxqt-panel/plugin-mount/CMakeLists.txt @@ -0,0 +1,34 @@ +set(PLUGIN "mount") + +set(HEADERS + lxqtmountplugin.h + configuration.h + button.h + menudiskitem.h + popup.h + actions/deviceaction.h + actions/deviceaction_info.h + actions/deviceaction_menu.h + actions/deviceaction_nothing.h +) + +set(SOURCES + lxqtmountplugin.cpp + configuration.cpp + button.cpp + menudiskitem.cpp + popup.cpp + actions/deviceaction.cpp + actions/deviceaction_info.cpp + actions/deviceaction_menu.cpp + actions/deviceaction_nothing.cpp +) + +set(UIS + configuration.ui +) + +find_package(KF5Solid REQUIRED) +set(LIBRARIES Qt5Xdg KF5::Solid) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-mount/actions/deviceaction.cpp b/lxqt-panel/plugin-mount/actions/deviceaction.cpp new file mode 100644 index 0000000..1165d8c --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction.cpp @@ -0,0 +1,105 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "deviceaction.h" +#include "deviceaction_info.h" +#include "deviceaction_menu.h" +#include "deviceaction_nothing.h" +#include "../menudiskitem.h" +#include "../lxqtmountplugin.h" + +#include + +#define ACT_NOTHING "nothing" +#define ACT_INFO "showInfo" +#define ACT_MENU "showMenu" + +#define ACT_NOTHING_UPPER QString(ACT_NOTHING).toUpper() +#define ACT_INFO_UPPER QString(ACT_INFO).toUpper() +#define ACT_MENU_UPPER QString(ACT_MENU).toUpper() + +DeviceAction::DeviceAction(LxQtMountPlugin *plugin, QObject *parent): + mPlugin(plugin) +{ +} + +DeviceAction::~DeviceAction() +{ +} + +DeviceAction *DeviceAction::create(ActionId id, LxQtMountPlugin *plugin, QObject *parent) +{ + switch (id) + { + case ActionNothing: + return new DeviceActionNothing(plugin, parent); + + case ActionInfo: + return new DeviceActionInfo(plugin, parent); + + case ActionMenu: + return new DeviceActionMenu(plugin, parent); + } + + return 0; +} + +QString DeviceAction::actionIdToString(DeviceAction::ActionId id) +{ + switch (id) + { + case ActionNothing: return ACT_NOTHING; + case ActionInfo: return ACT_INFO; + case ActionMenu: return ACT_MENU; + } + + return ACT_INFO; +} + +void DeviceAction::onDeviceAdded(QString const & udi) +{ + Solid::Device device(udi); + if (device.is()) + doDeviceAdded(device); +} + +void DeviceAction::onDeviceRemoved(QString const & udi) +{ + Solid::Device device(udi); + if (device.is()) + doDeviceRemoved(device); +} + +DeviceAction::ActionId DeviceAction::stringToActionId(const QString &string, ActionId defaultValue) +{ + QString s = string.toUpper(); + if (s == ACT_NOTHING_UPPER) return ActionNothing; + if (s == ACT_INFO_UPPER) return ActionInfo; + if (s == ACT_MENU_UPPER) return ActionMenu; + + return defaultValue; +} diff --git a/lxqt-panel/plugin-mount/actions/deviceaction.h b/lxqt-panel/plugin-mount/actions/deviceaction.h new file mode 100644 index 0000000..58ecc27 --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction.h @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_H + +#include +#include +#include + +class LxQtMountPlugin; + +class DeviceAction: public QObject +{ + Q_OBJECT + +public: + enum ActionId + { + ActionNothing, + ActionInfo, + ActionMenu + }; + + virtual ~DeviceAction(); + virtual ActionId Type() const throw () = 0; + + static DeviceAction *create(ActionId id, LxQtMountPlugin *plugin, QObject *parent = 0); + static ActionId stringToActionId(const QString &string, ActionId defaultValue); + static QString actionIdToString(ActionId id); + +public slots: + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); + +protected: + explicit DeviceAction(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual void doDeviceAdded(Solid::Device device) = 0; + virtual void doDeviceRemoved(Solid::Device device) = 0; + + LxQtMountPlugin *mPlugin; +}; + +#endif // DEVICEACTION_H diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_info.cpp b/lxqt-panel/plugin-mount/actions/deviceaction_info.cpp new file mode 100644 index 0000000..5a5b4c7 --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_info.cpp @@ -0,0 +1,51 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "../lxqtmountplugin.h" +#include "deviceaction_info.h" + +#include + +DeviceActionInfo::DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent): + DeviceAction(plugin, parent) +{ +} + +void DeviceActionInfo::doDeviceAdded(Solid::Device device) +{ + showMessage(tr("The device \"%1\" is connected.").arg(device.description())); +} + +void DeviceActionInfo::doDeviceRemoved(Solid::Device device) +{ + showMessage(tr("The device \"%1\" is removed.").arg(device.description())); +} + +void DeviceActionInfo::showMessage(const QString &text) +{ + LxQt::Notification::notify(tr("Removable media/devices manager"), text, mPlugin->icon().name()); +} diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_info.h b/lxqt-panel/plugin-mount/actions/deviceaction_info.h new file mode 100644 index 0000000..99e8733 --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_info.h @@ -0,0 +1,53 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H + +#include "deviceaction.h" + +#include +#include + +class Popup; + +class DeviceActionInfo : public DeviceAction +{ + Q_OBJECT +public: + explicit DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionInfo; } + +protected: + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); + +private: + void showMessage(const QString &text); +}; + +#endif // DEVICEACTION_INFO_H diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_menu.cpp b/lxqt-panel/plugin-mount/actions/deviceaction_menu.cpp new file mode 100644 index 0000000..982834a --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_menu.cpp @@ -0,0 +1,50 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "deviceaction_menu.h" +#include "../lxqtmountplugin.h" +#include "../popup.h" + +DeviceActionMenu::DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent): + DeviceAction(plugin, parent) +{ + mPopup = plugin->popup(); + + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(5000); + connect(&mHideTimer, &QTimer::timeout, mPopup, &Popup::hide); +} + +void DeviceActionMenu::doDeviceAdded(Solid::Device device) +{ + mHideTimer.start(); + mPopup->show(); +} + +void DeviceActionMenu::doDeviceRemoved(Solid::Device device) +{ +} diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_menu.h b/lxqt-panel/plugin-mount/actions/deviceaction_menu.h new file mode 100644 index 0000000..66a0244 --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_menu.h @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H + +#include "deviceaction.h" + +#include +#include + +class Popup; + +class DeviceActionMenu : public DeviceAction +{ + Q_OBJECT +public: + explicit DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionMenu; } + +protected: + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); + +private: + Popup *mPopup; + QTimer mHideTimer; +}; + +#endif // DEVICEACTIONMENU_H diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_nothing.cpp b/lxqt-panel/plugin-mount/actions/deviceaction_nothing.cpp new file mode 100644 index 0000000..3e4bd9b --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_nothing.cpp @@ -0,0 +1,41 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "deviceaction_nothing.h" + +DeviceActionNothing::DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent): + DeviceAction(plugin, parent) +{ +} + +void DeviceActionNothing::doDeviceAdded(Solid::Device device) +{ +} + +void DeviceActionNothing::doDeviceRemoved(Solid::Device device) +{ +} diff --git a/lxqt-panel/plugin-mount/actions/deviceaction_nothing.h b/lxqt-panel/plugin-mount/actions/deviceaction_nothing.h new file mode 100644 index 0000000..105bf97 --- /dev/null +++ b/lxqt-panel/plugin-mount/actions/deviceaction_nothing.h @@ -0,0 +1,48 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * 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; only version 2 of + * the License is valid for this program. + * + * 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 Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H + +#include "deviceaction.h" +#include + +class DeviceActionNothing : public DeviceAction +{ + Q_OBJECT + +public: + explicit DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionNothing; }; + +protected: + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); +}; + +#endif // DEVICEACTIONNOTHING_H diff --git a/plugin-mount/mountbutton.cpp b/lxqt-panel/plugin-mount/button.cpp similarity index 79% rename from plugin-mount/mountbutton.cpp rename to lxqt-panel/plugin-mount/button.cpp index fa709b6..962f438 100644 --- a/plugin-mount/mountbutton.cpp +++ b/lxqt-panel/plugin-mount/button.cpp @@ -26,27 +26,17 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include - +#include "button.h" #include -#include "mountbutton.h" -MountButton::MountButton(QWidget * parent) : +Button::Button(QWidget * parent) : QToolButton(parent) { - setIcon(XdgIcon::fromTheme(QStringList() << "device-notifier" << "drive-removable-media-usb" << "drive-removable-media")); - + setIcon(XdgIcon::fromTheme(QStringLiteral("drive-removable-media"))); setToolTip(tr("Removable media/devices manager")); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } - -MountButton::~MountButton() -{ -} - - -void MountButton::setDown(bool down) +Button::~Button() { - QToolButton::setDown(down); } diff --git a/plugin-mount/mountbutton.h b/lxqt-panel/plugin-mount/button.h similarity index 85% rename from plugin-mount/mountbutton.h rename to lxqt-panel/plugin-mount/button.h index 227da1b..2628cbc 100644 --- a/plugin-mount/mountbutton.h +++ b/lxqt-panel/plugin-mount/button.h @@ -26,20 +26,18 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef MOUNTBUTTON_H -#define MOUNTBUTTON_H +#ifndef LXQT_PLUGIN_MOUNT_BUTTON_H +#define LXQT_PLUGIN_MOUNT_BUTTON_H #include -class MountButton : public QToolButton + +class Button : public QToolButton { Q_OBJECT public: - MountButton(QWidget *parent = 0); - ~MountButton(); - -public slots: - void setDown(bool down); + Button(QWidget *parent = 0); + ~Button(); }; #endif diff --git a/plugin-mount/lxqtmountconfiguration.cpp b/lxqt-panel/plugin-mount/configuration.cpp similarity index 54% rename from plugin-mount/lxqtmountconfiguration.cpp rename to lxqt-panel/plugin-mount/configuration.cpp index 8351b3e..c7a92ac 100644 --- a/plugin-mount/lxqtmountconfiguration.cpp +++ b/lxqt-panel/plugin-mount/configuration.cpp @@ -26,44 +26,40 @@ * END_COMMON_COPYRIGHT_HEADER */ -#include "lxqtmountconfiguration.h" -#include "ui_lxqtmountconfiguration.h" +#include "configuration.h" +#include "ui_configuration.h" #include -#include +#include -#define ACT_SHOW_MENU "showMenu" -#define ACT_SHOW_INFO "showInfo" -#define ACT_NOTHING "nothing" - -LxQtMountConfiguration::LxQtMountConfiguration(QSettings &settings, QWidget *parent) : +Configuration::Configuration(QSettings &settings, QWidget *parent) : LxQtPanelPluginConfigDialog(settings, parent), - ui(new Ui::LxQtMountConfiguration) + ui(new Ui::Configuration) { ui->setupUi(this); - ui->devAddedCombo->addItem(tr("Popup menu"), ACT_SHOW_MENU); - ui->devAddedCombo->addItem(tr("Show info"), ACT_SHOW_INFO); - ui->devAddedCombo->addItem(tr("Do nothing"), ACT_NOTHING); + ui->devAddedCombo->addItem(tr("Popup menu"), QStringLiteral(ACT_SHOW_MENU)); + ui->devAddedCombo->addItem(tr("Show info"), QStringLiteral(ACT_SHOW_INFO)); + ui->devAddedCombo->addItem(tr("Do nothing"), QStringLiteral(ACT_NOTHING)); loadSettings(); - connect(ui->devAddedCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(devAddedChanged(int))); - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + connect(ui->devAddedCombo, static_cast(&QComboBox::currentIndexChanged), + this, &Configuration::devAddedChanged); + connect(ui->buttons, &QDialogButtonBox::clicked, this, &Configuration::dialogButtonsAction); } -LxQtMountConfiguration::~LxQtMountConfiguration() +Configuration::~Configuration() { delete ui; } - -void LxQtMountConfiguration::loadSettings() +void Configuration::loadSettings() { - setComboboxIndexByData(ui->devAddedCombo, settings().value("newDeviceAction", ACT_SHOW_INFO), 1); + QVariant value = settings().value(QStringLiteral(CFG_KEY_ACTION), QStringLiteral(ACT_SHOW_INFO)); + setComboboxIndexByData(ui->devAddedCombo, value, 1); } - -void LxQtMountConfiguration::devAddedChanged(int index) +void Configuration::devAddedChanged(int index) { QString s = ui->devAddedCombo->itemData(index).toString(); - settings().setValue("newDeviceAction", s); + settings().setValue(QStringLiteral(CFG_KEY_ACTION), s); } diff --git a/plugin-mount/lxqtmountconfiguration.h b/lxqt-panel/plugin-mount/configuration.h similarity index 74% rename from plugin-mount/lxqtmountconfiguration.h rename to lxqt-panel/plugin-mount/configuration.h index 7801b87..aadd967 100644 --- a/plugin-mount/lxqtmountconfiguration.h +++ b/lxqt-panel/plugin-mount/configuration.h @@ -25,32 +25,34 @@ * * END_COMMON_COPYRIGHT_HEADER */ - - -#ifndef LXQTMOUNTCONFIGURATION_H -#define LXQTMOUNTCONFIGURATION_H - +#ifndef LXQT_PLUGIN_MOUNT_CONFIGURATION_H +#define LXQT_PLUGIN_MOUNT_CONFIGURATION_H #include "../panel/lxqtpanelpluginconfigdialog.h" +#define CFG_KEY_ACTION "newDeviceAction" +#define ACT_SHOW_MENU "showMenu" +#define ACT_SHOW_INFO "showInfo" +#define ACT_NOTHING "nothing" + namespace Ui { - class LxQtMountConfiguration; + class Configuration; } -class LxQtMountConfiguration : public LxQtPanelPluginConfigDialog +class Configuration : public LxQtPanelPluginConfigDialog { Q_OBJECT public: - explicit LxQtMountConfiguration(QSettings &settings, QWidget *parent = 0); - ~LxQtMountConfiguration(); + explicit Configuration(QSettings &settings, QWidget *parent = 0); + ~Configuration(); protected slots: virtual void loadSettings(); void devAddedChanged(int index); private: - Ui::LxQtMountConfiguration *ui; + Ui::Configuration *ui; }; #endif // LXQTMOUNTCONFIGURATION_H diff --git a/plugin-mount/lxqtmountconfiguration.ui b/lxqt-panel/plugin-mount/configuration.ui similarity index 82% rename from plugin-mount/lxqtmountconfiguration.ui rename to lxqt-panel/plugin-mount/configuration.ui index ae6a546..2deef8c 100644 --- a/plugin-mount/lxqtmountconfiguration.ui +++ b/lxqt-panel/plugin-mount/configuration.ui @@ -1,13 +1,13 @@ - LxQtMountConfiguration - + Configuration + 0 0 - 313 - 144 + 407 + 129 @@ -19,15 +19,15 @@ Behaviour - - + + - When a device is connected + When a device is connected : - + @@ -63,7 +63,7 @@ buttons accepted() - LxQtMountConfiguration + Configuration accept() @@ -79,7 +79,7 @@ buttons rejected() - LxQtMountConfiguration + Configuration reject() diff --git a/lxqt-panel/plugin-mount/lxqtmountplugin.cpp b/lxqt-panel/plugin-mount/lxqtmountplugin.cpp new file mode 100644 index 0000000..263a15d --- /dev/null +++ b/lxqt-panel/plugin-mount/lxqtmountplugin.cpp @@ -0,0 +1,84 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtmountplugin.h" +#include "configuration.h" + +#include + +LxQtMountPlugin::LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mPopup(nullptr), + mDeviceAction(nullptr) +{ + mButton = new Button; + mPopup = new Popup(this); + + connect(mButton, &QToolButton::clicked, mPopup, &Popup::showHide); + connect(mPopup, &Popup::visibilityChanged, mButton, &QToolButton::setDown); +} + +LxQtMountPlugin::~LxQtMountPlugin() +{ + delete mButton; + delete mPopup; +} + +QDialog *LxQtMountPlugin::configureDialog() +{ + if (mPopup) + mPopup->hide(); + + Configuration *configWindow = new Configuration(*settings()); + configWindow->setAttribute(Qt::WA_DeleteOnClose, true); + return configWindow; +} + +void LxQtMountPlugin::realign() +{ + //nothing to do +} + +void LxQtMountPlugin::settingsChanged() +{ + QString s = settings()->value(QStringLiteral(CFG_KEY_ACTION)).toString(); + DeviceAction::ActionId actionId = DeviceAction::stringToActionId(s, DeviceAction::ActionMenu); + + if (mDeviceAction == nullptr || mDeviceAction->Type() != actionId) + { + delete mDeviceAction; + mDeviceAction = DeviceAction::create(actionId, this); + + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + mDeviceAction, &DeviceAction::onDeviceAdded); + + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + mDeviceAction, &DeviceAction::onDeviceRemoved); + } + +} diff --git a/plugin-kbindicator/lxqtkbindicator.h b/lxqt-panel/plugin-mount/lxqtmountplugin.h similarity index 57% rename from plugin-kbindicator/lxqtkbindicator.h rename to lxqt-panel/plugin-mount/lxqtmountplugin.h index 592e9bf..66d8e1c 100644 --- a/plugin-kbindicator/lxqtkbindicator.h +++ b/lxqt-panel/plugin-mount/lxqtmountplugin.h @@ -4,9 +4,9 @@ * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org * - * Copyright: 2012 Razor team + * Copyright: 2010-2011 Razor team * Authors: - * Kuzma Shapran + * Petr Vanek * * This program or library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser General Public @@ -25,59 +25,60 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQTPANELKBINDICATOR_H -#define LXQTPANELKBINDICATOR_H +#ifndef LXQTMOUNTPLUGIN_H +#define LXQTMOUNTPLUGIN_H #include "../panel/ilxqtpanelplugin.h" -#include "lxqtkbindicatorconfiguration.h" -#include +#include "../panel/lxqtpanel.h" +#include "button.h" +#include "popup.h" +#include "actions/deviceaction.h" -class QLabel; +#include -class LxQtKbIndicator : public QObject, public ILxQtPanelPlugin +/*! +\author Petr Vanek +*/ + +class LxQtMountPlugin : public QObject, public ILxQtPanelPlugin { Q_OBJECT + public: - LxQtKbIndicator(const ILxQtPanelPluginStartupInfo &startupInfo); - ~LxQtKbIndicator(); + LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtMountPlugin(); - virtual QWidget *widget(); - virtual QString themeId() const { return "KbIndicator"; } + virtual QWidget *widget() { return mButton; } + virtual QString themeId() const { return QStringLiteral("LxQtMount"); } virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } - virtual bool isSeparate() const { return false; } + Popup *popup() { return mPopup; } + QIcon icon() { return mButton->icon(); }; QDialog *configureDialog(); - virtual void realign(); - virtual bool eventFilter(QObject *object, QEvent *event); + +public slots: + void realign(); protected slots: - void delayedInit(); virtual void settingsChanged(); - void modifierStateChanged(Qt::Key key, bool active); private: - KModifierKeyInfo *modifierInfo; - QWidget *mContent; - - bool mShowCapsLock; - bool mShowNumLock; - bool mShowScrollLock; - - QLabel *mCapsLock; - QLabel *mNumLock; - QLabel *mScrollLock; + Button *mButton; + Popup *mPopup; + DeviceAction *mDeviceAction; }; -class LxQtKbIndicatorLibrary: public QObject, public ILxQtPanelPluginLibrary +class LxQtMountPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) + public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { - return new LxQtKbIndicator(startupInfo); + return new LxQtMountPlugin(startupInfo); } }; -#endif // LXQTPANELKBINDICATOR_H +#endif diff --git a/lxqt-panel/plugin-mount/menudiskitem.cpp b/lxqt-panel/plugin-mount/menudiskitem.cpp new file mode 100644 index 0000000..3f70618 --- /dev/null +++ b/lxqt-panel/plugin-mount/menudiskitem.cpp @@ -0,0 +1,179 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "menudiskitem.h" +#include "popup.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MenuDiskItem::MenuDiskItem(Solid::Device device, Popup *popup): + QFrame(popup), + mPopup(popup), + mDevice(device), + mDiskButton(nullptr), + mEjectButton(nullptr), + mDiskButtonClicked(false), + mEjectButtonClicked(false) +{ + Solid::StorageAccess * const iface = device.as(); + Q_ASSERT(nullptr != iface); + + mDiskButton = new QToolButton(this); + mDiskButton->setObjectName("DiskButton"); + mDiskButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + mDiskButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + connect(mDiskButton, &QToolButton::clicked, this, &MenuDiskItem::diskButtonClicked); + + mEjectButton = new QToolButton(this); + mEjectButton->setObjectName("EjectButton"); + mEjectButton->setIcon(XdgIcon::fromTheme("media-eject")); + connect(mEjectButton, &QToolButton::clicked, this, &MenuDiskItem::ejectButtonClicked); + + QHBoxLayout *layout = new QHBoxLayout(this); + layout->addWidget(mDiskButton); + layout->addWidget(mEjectButton); + layout->setMargin(0); + layout->setSpacing(0); + setLayout(layout); + + connect(iface, &Solid::StorageAccess::setupDone, this, &MenuDiskItem::onMounted); + connect(iface, &Solid::StorageAccess::teardownDone, this, &MenuDiskItem::onUnmounted); + connect(iface, &Solid::StorageAccess::accessibilityChanged, [this] (bool accessible, QString const &) { + updateMountStatus(); + }); + + updateMountStatus(); +} + +MenuDiskItem::~MenuDiskItem() +{ +} + +void MenuDiskItem::setMountStatus(bool mounted) +{ + mEjectButton->setEnabled(mounted); +} + +void MenuDiskItem::updateMountStatus() +{ + static const QIcon icon = XdgIcon::fromTheme(mDevice.icon(), QStringLiteral("drive-removable-media")); + + if (mDevice.isValid()) + { + mDiskButton->setIcon(icon); + mDiskButton->setText(mDevice.description()); + + setMountStatus(mDevice.as()->isAccessible() || !opticalParent().udi().isEmpty()); + } + else + emit invalid(mDevice.udi()); +} + +Solid::Device MenuDiskItem::opticalParent() const +{ + Solid::Device it; + if (mDevice.isValid()) + { + it = mDevice; + // search for parent drive + for (; !it.udi().isEmpty(); it = it.parent()) + if (it.is()) + break; + } + return it; +} + +void MenuDiskItem::diskButtonClicked() +{ + mDiskButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (!di->isAccessible()) + di->setup(); + else + onMounted(Solid::NoError, QString(), mDevice.udi()); + + mPopup->hide(); +} + +void MenuDiskItem::ejectButtonClicked() +{ + mEjectButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (di->isAccessible()) + di->teardown(); + else + onUnmounted(Solid::NoError, QString(), mDevice.udi()); + + mPopup->hide(); +} + +void MenuDiskItem::onMounted(Solid::ErrorType error, QVariant resultData, const QString &udi) +{ + if (mDiskButtonClicked) + { + mDiskButtonClicked = false; + + if (Solid::NoError == error) + QDesktopServices::openUrl(QUrl(mDevice.as()->filePath())); + else + { + QString errorMsg = tr("Mounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } +} + +void MenuDiskItem::onUnmounted(Solid::ErrorType error, QVariant resultData, const QString &udi) +{ + if (mEjectButtonClicked) + { + mEjectButtonClicked = false; + + if (Solid::NoError == error) + { + Solid::Device opt_parent = opticalParent(); + if (!opt_parent.udi().isEmpty()) + opt_parent.as()->eject(); + } + else + { + QString errorMsg = tr("Unmounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } +} diff --git a/lxqt-panel/plugin-mount/menudiskitem.h b/lxqt-panel/plugin-mount/menudiskitem.h new file mode 100644 index 0000000..ccd26e7 --- /dev/null +++ b/lxqt-panel/plugin-mount/menudiskitem.h @@ -0,0 +1,76 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_MENUDISKITEM_H +#define LXQT_PLUGIN_MOUNT_MENUDISKITEM_H + +#include +#include +#include +#include + +class Popup; + +class MenuDiskItem : public QFrame +{ + Q_OBJECT + +public: + explicit MenuDiskItem(Solid::Device device, Popup *popup); + ~MenuDiskItem(); + + QString deviceUdi() const { return mDevice.udi(); } + void setMountStatus(bool mounted); + +private: + void updateMountStatus(); + Solid::Device opticalParent() const; + +signals: + void invalid(QString const & udi); + +private slots: + void diskButtonClicked(); + void ejectButtonClicked(); + + void onMounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); + void onUnmounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); + +private: + Popup *mPopup; + Solid::Device mDevice; + QToolButton *mDiskButton; + QToolButton *mEjectButton; + bool mDiskButtonClicked; + bool mEjectButtonClicked; +}; + +#endif // MENUDISKITEM_H diff --git a/lxqt-panel/plugin-mount/popup.cpp b/lxqt-panel/plugin-mount/popup.cpp new file mode 100644 index 0000000..6a6b76e --- /dev/null +++ b/lxqt-panel/plugin-mount/popup.cpp @@ -0,0 +1,167 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011-2013 Razor team + * Authors: + * Petr Vanek + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "popup.h" +#include "../panel/ilxqtpanelplugin.h" + +#include +#include +#include +#include +#include +#include + +// Paulo: I'm not sure what this is for +static bool hasRemovableParent(Solid::Device device) +{ + // qDebug() << "acess:" << device.udi(); + for ( ; !device.udi().isEmpty(); device = device.parent()) + { + Solid::StorageDrive* drive = device.as(); + if (drive && drive->isRemovable()) + { + // qDebug() << "removable parent drive:" << device.udi(); + return true; + } + } + return false; +} + +Popup::Popup(ILxQtPanelPlugin * plugin, QWidget* parent): + QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint), + mPlugin(plugin), + mPlaceholder(nullptr), + mDisplayCount(0) +{ + setObjectName("LxQtMountPopup"); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setLayout(new QVBoxLayout(this)); + layout()->setMargin(0); + + setAttribute(Qt::WA_AlwaysShowToolTips); + + mPlaceholder = new QLabel(tr("No devices are available"), this); + mPlaceholder->setObjectName("NoDiskLabel"); + layout()->addWidget(mPlaceholder); + + //Perform the potential long time operation after object construction + //Note: can't use QTimer::singleShot with lambda in pre QT 5.4 code + QTimer * aux_timer = new QTimer; + connect(aux_timer, &QTimer::timeout, [this, aux_timer] + { + delete aux_timer; //cleanup + for (Solid::Device device : Solid::Device::listFromType(Solid::DeviceInterface::StorageAccess)) + if (hasRemovableParent(device)) + addItem(device); + }); + aux_timer->setSingleShot(true); + aux_timer->start(0); + + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + this, &Popup::onDeviceAdded); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + this, &Popup::onDeviceRemoved); +} + +void Popup::showHide() +{ + setVisible(isHidden()); +} + +void Popup::onDeviceAdded(QString const & udi) +{ + Solid::Device device(udi); + if (device.is() && hasRemovableParent(device)) + addItem(device); +} + +void Popup::onDeviceRemoved(QString const & udi) +{ + MenuDiskItem* item = nullptr; + const int size = layout()->count() - 1; + for (int i = size; 0 <= i; --i) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w == mPlaceholder) + continue; + + MenuDiskItem *it = static_cast(w); + if (udi == it->deviceUdi()) + { + item = it; + break; + } + } + + if (item != nullptr) + { + layout()->removeWidget(item); + item->deleteLater(); + + --mDisplayCount; + if (mDisplayCount == 0) + mPlaceholder->show(); + } +} + +void Popup::showEvent(QShowEvent *event) +{ + mPlaceholder->setVisible(mDisplayCount == 0); + realign(); + setFocus(); + activateWindow(); + QWidget::showEvent(event); + emit visibilityChanged(true); +} + +void Popup::hideEvent(QHideEvent *event) +{ + QWidget::hideEvent(event); + emit visibilityChanged(false); +} + +void Popup::addItem(Solid::Device device) +{ + MenuDiskItem *item = new MenuDiskItem(device, this); + connect(item, &MenuDiskItem::invalid, this, &Popup::onDeviceRemoved); + item->setVisible(true); + layout()->addWidget(item); + + mDisplayCount++; + if (mDisplayCount != 0) + mPlaceholder->hide(); + + if (isVisible()) + realign(); +} + +void Popup::realign() +{ + adjustSize(); + setGeometry(mPlugin->calculatePopupWindowPos(sizeHint())); +} diff --git a/lxqt-panel/plugin-mount/popup.h b/lxqt-panel/plugin-mount/popup.h new file mode 100644 index 0000000..63dd098 --- /dev/null +++ b/lxqt-panel/plugin-mount/popup.h @@ -0,0 +1,70 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011-2013 Razor team + * Authors: + * Petr Vanek + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_POPUP_H +#define LXQT_PLUGIN_MOUNT_POPUP_H + +#include "menudiskitem.h" + +#include +#include +#include + +class ILxQtPanelPlugin; + +class Popup: public QDialog +{ + Q_OBJECT + +public: + explicit Popup(ILxQtPanelPlugin * plugin, QWidget* parent = 0); + void realign(); + +public slots: + void showHide(); + +private slots: + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); + +signals: + void visibilityChanged(bool visible); + +protected: + void showEvent(QShowEvent *event); + void hideEvent(QHideEvent *event); + +private: + ILxQtPanelPlugin * mPlugin; + QLabel *mPlaceholder; + int mDisplayCount; + + void addItem(Solid::Device device); +}; + +#endif // POPUP_H diff --git a/lxqt-panel/plugin-mount/resources/mount.desktop.in b/lxqt-panel/plugin-mount/resources/mount.desktop.in new file mode 100644 index 0000000..4a64eea --- /dev/null +++ b/lxqt-panel/plugin-mount/resources/mount.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. +Icon=drive-removable-media + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-mount/translations/mount.ts b/lxqt-panel/plugin-mount/translations/mount.ts new file mode 100644 index 0000000..50d142b --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount.ts @@ -0,0 +1,90 @@ + + + + + Button + + + Removable media/devices manager + + + + + Configuration + + + Removable Media Settings + + + + + Behaviour + + + + + When a device is connected : + + + + + Popup menu + + + + + Show info + + + + + Do nothing + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + + + + + + Removable media/devices manager + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ar.desktop b/lxqt-panel/plugin-mount/translations/mount_ar.desktop new file mode 100644 index 0000000..641c83e --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=معالج الوسائط القابلة للفصل (يو إس بي و أقراص مدمجة...) +Name[ar]=الوسائط القابلة للفصل diff --git a/lxqt-panel/plugin-mount/translations/mount_ar.ts b/lxqt-panel/plugin-mount/translations/mount_ar.ts new file mode 100644 index 0000000..bcb7bf3 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ar.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + الجهاز <b><nobr>"%1"</b> موصول. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + الجهاز <b><nobr>"%1"</b> مفصول. + + + + Removable media/devices manager + مدير الوسائط واﻷقراص القابلة للفصل + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + إعدادات مدير ريزر للوسائط القابلة للفصل + + + + Removable Media Settings + + + + + Behaviour + السلوك + + + + When a device is connected + عند وصل الجهاز + + + + Popup menu + القائمة اﻵنيَّة + + + + Show info + إظهار المعلومات + + + + Do nothing + عدم القيام بأيِّ شيء + + + + MenuDiskItem + + Click to access this device from other applications. + اضغط للوصول إلى هذا الجهاز من تطبيقاتٍ أخرى. + + + Click to eject this disc. + اضغط ﻹخراج هذا القرص. + + + + + Removable media/devices manager + مدير الوسائط واﻷقراص القابلة للفصل + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + مدير الوسائط واﻷقراص القابلة للفصل + + + The device <b><nobr>"%1"</nobr></b> is connected. + الجهاز <b><nobr>"%1"</b> موصول. + + + The device <b><nobr>"%1"</nobr></b> is removed. + الجهاز <b><nobr>"%1"</b> مفصول. + + + No devices Available. + ﻻ توجد أجهزة. + + + + Popup + + + No devices are available + + + + diff --git a/plugin-mount/translations/mount_de_DE.desktop b/lxqt-panel/plugin-mount/translations/mount_cs.desktop similarity index 66% rename from plugin-mount/translations/mount_de_DE.desktop rename to lxqt-panel/plugin-mount/translations/mount_cs.desktop index 26aad74..c8cd61e 100644 --- a/plugin-mount/translations/mount_de_DE.desktop +++ b/lxqt-panel/plugin-mount/translations/mount_cs.desktop @@ -8,5 +8,5 @@ Comment=Easy mounting and unmounting of USB and optical drives. # Translations -Comment[de_DE]=Wechseldatenträger (USB, CD, DVD, ...) -Name[de_DE]=Entfernbare Wechseldatenträger +Comment[cs]=Správa odstranitelných zařízení (USB, CD, DVD, ...) +Name[cs]=Správce zařízení diff --git a/lxqt-panel/plugin-mount/translations/mount_cs.ts b/lxqt-panel/plugin-mount/translations/mount_cs.ts new file mode 100644 index 0000000..2fed6e0 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_cs.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zařízení <b><nobr>"%1"</nobr></b> je zapojeno. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zařízení <b><nobr>"%1"</nobr></b> je odstraněno. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Nastavení správce odstranitelných zařízení + + + + Removable Media Settings + + + + + Behaviour + Chování + + + + When a device is connected + Když je zařízení zapojeno + + + + Popup menu + Ukázat vyskakovací nabídku + + + + Show info + Ukázat informace + + + + Do nothing + Nedělat nic + + + + MenuDiskItem + + Click to access this device from other applications. + Klepněte pro přistoupení k tomuto zařízení z jiných aplikací. + + + Click to eject this disc. + Klepněte pro vysunutí tohoto disku. + + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zařízení <b><nobr>"%1"</nobr></b> je zapojeno. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zařízení <b><nobr>"%1"</nobr></b> je odstraněno. + + + No devices Available. + Nejsou dostupná žádná zařízení. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_cs_CZ.desktop b/lxqt-panel/plugin-mount/translations/mount_cs_CZ.desktop new file mode 100644 index 0000000..1ecdf70 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Zacházení s odstranitelnými médii (USB, CD, DVD, ...) +Name[cs_CZ]=Odstranitelná média diff --git a/lxqt-panel/plugin-mount/translations/mount_cs_CZ.ts b/lxqt-panel/plugin-mount/translations/mount_cs_CZ.ts new file mode 100644 index 0000000..95a721b --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_cs_CZ.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zařízení <b><nobr>"%1"</nobr></b> je zapojeno. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zařízení <b><nobr>"%1"</nobr></b> je odstraněno. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Nastavení správce odstranitelných zařízení + + + + Removable Media Settings + + + + + Behaviour + Chování + + + + When a device is connected + Když je zařízení zapojeno + + + + Popup menu + Ukázat vyskakovací nabídku + + + + Show info + Ukázat informace + + + + Do nothing + Nedělat nic + + + + MenuDiskItem + + Click to access this device from other applications. + Klepněte pro přistoupení k tomuto zařízení z jiných aplikací. + + + Click to eject this disc. + Klepněte pro vysunutí tohoto disku. + + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zařízení <b><nobr>"%1"</nobr></b> je zapojeno. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zařízení <b><nobr>"%1"</nobr></b> je odstraněno. + + + No devices Available. + Nejsou dostupná žádná zařízení. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_da.desktop b/lxqt-panel/plugin-mount/translations/mount_da.desktop new file mode 100644 index 0000000..327c68d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Håndtering af flytbare enheder og medier (USB, CD, DVD, ...) +Name[da]=Flytbare enheder diff --git a/lxqt-panel/plugin-mount/translations/mount_da.ts b/lxqt-panel/plugin-mount/translations/mount_da.ts new file mode 100644 index 0000000..f0a9538 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_da.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Enheden <b><nobr>"%1"</nobr></b> er forbundet. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Enheden <b><nobr>"%1"</nobr></b> er fjernet. + + + + Removable media/devices manager + Håndtering af medier/enheder + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LXQt Indstillinger for flytbare medier + + + + Removable Media Settings + + + + + Behaviour + Opførsel + + + + When a device is connected + Når en enhed forbinder + + + + Popup menu + Pop op-menu + + + + Show info + Vis information + + + + Do nothing + Gør intet + + + + MenuDiskItem + + Click to access this device from other applications. + Klik for at tilgå denne enhed fra andre programmer. + + + Click to eject this disc. + Klik for at skubbe disken ud. + + + + + Removable media/devices manager + Håndtering af medier/enheder + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Håndtering af medier/enheder + + + The device <b><nobr>"%1"</nobr></b> is connected. + Enheden <b><nobr>"%1"</nobr></b> er forbundet. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Enheden <b><nobr>"%1"</nobr></b> er fjernet. + + + No devices Available. + Ingen tilgængelige enheder. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_da_DK.desktop b/lxqt-panel/plugin-mount/translations/mount_da_DK.desktop new file mode 100644 index 0000000..f2f2ccc --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Håndtering af flytbare enheder (USB, CD, DVD, ...) +Name[da_DK]=Flytbare enheder diff --git a/lxqt-panel/plugin-mount/translations/mount_da_DK.ts b/lxqt-panel/plugin-mount/translations/mount_da_DK.ts new file mode 100644 index 0000000..0c71bcf --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_da_DK.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Enheden <b><nobr>"%1"</nobr></b> er forbundet. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Enheden <b><nobr>"%1"</nobr></b> er fjernet. + + + + Removable media/devices manager + Håndtering af flytbare medier + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Indstillinger til håndtering af flytbare enheder + + + + Removable Media Settings + + + + + Behaviour + Adfærd + + + + When a device is connected + Når en enhed tilsluttes + + + + Popup menu + Popup menu + + + + Show info + Vis info + + + + Do nothing + Gør ingenting + + + + MenuDiskItem + + Click to access this device from other applications. + Klik for at give adgang fra andre programmer. + + + Click to eject this disc. + Skub ud. + + + + + Removable media/devices manager + Håndtering af flytbare medier + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Håndtering af flytbare medier + + + The device <b><nobr>"%1"</nobr></b> is connected. + Enheden <b><nobr>"%1"</nobr></b> er forbundet. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Enheden <b><nobr>"%1"</nobr></b> er fjernet. + + + No devices Available. + Ingen enheder tilgængelige. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_de.desktop b/lxqt-panel/plugin-mount/translations/mount_de.desktop new file mode 100644 index 0000000..71a2208 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Wechseldatenträger +Comment[de]=Wechseldatenträgerverwaltung (USB, CD, DVD, ...) diff --git a/lxqt-panel/plugin-mount/translations/mount_de.ts b/lxqt-panel/plugin-mount/translations/mount_de.ts new file mode 100644 index 0000000..335269f --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_de.ts @@ -0,0 +1,90 @@ + + + + + Button + + + Removable media/devices manager + Entfernbare Medien-/Geräteverwaltung + + + + Configuration + + + Removable Media Settings + Entfernbare Medien - Einstellungen + + + + Behaviour + Verhalten + + + + When a device is connected : + Wenn ein Gerät verbunden ist: + + + + Popup menu + Aufklapp-Menü + + + + Show info + Informationen anzeigen + + + + Do nothing + Nichts tun + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. + + + + Removable media/devices manager + Entfernbare Medien-/Geräteverwaltung + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Das Einbinden von <b><nobr>"%1"</nobr></b> ist fehlgeschlagen: %2 + + + + + Removable media/devices manager + Entfernbare Medien-/Geräteverwaltung + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Das Lösen von <strong><nobr>"%1"</nobr></strong> ist fehlgeschlagen: %2 + + + + Popup + + + No devices are available + Keine Geräte verfügbar + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_el_GR.desktop b/lxqt-panel/plugin-mount/translations/mount_el_GR.desktop new file mode 100644 index 0000000..163cca5 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Διαχείριση αφαιρούμενων μέσων (USB, CD, DVD, ...) +Name[el_GR]=Αφαιρούμενα μέσα diff --git a/lxqt-panel/plugin-mount/translations/mount_el_GR.ts b/lxqt-panel/plugin-mount/translations/mount_el_GR.ts new file mode 100644 index 0000000..ffdc669 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_el_GR.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Συνδέθηκε η συσκευή <b><nobr>"%1"</nobr></b>. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Αφαιρέθηκε η συσκευή <b><nobr>"%1"</nobr></b>. + + + + Removable media/devices manager + Διαχειριστής αφαιρούμενων μέσων/συσκευών + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Ρυθμίσεις διαχειριστή αφαιρούμενων μέσων LxQt + + + + Removable Media Settings + + + + + Behaviour + Συμπεριφορά + + + + When a device is connected + Όταν μια συσκευή συνδέεται + + + + Popup menu + Αναδυόμενο μενού + + + + Show info + Εμφάνιση πληροφοριών + + + + Do nothing + Καμία ενέργεια + + + + MenuDiskItem + + Click to access this device from other applications. + Κλίκ για πρόσβαση σε αυτή τη συσκευή από άλλες εφαρμογές. + + + Click to eject this disc. + Κλίκ για εξαγωγή αυτού του δίσκου. + + + + + Removable media/devices manager + Διαχειριστής αφαιρούμενων μέσων/συσκευών + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Διαχειριστής αφαιρούμενων μέσων/συσκευών + + + The device <b><nobr>"%1"</nobr></b> is connected. + Συνδέθηκε η συσκευή <b><nobr>"%1"</nobr></b>. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Αφαιρέθηκε η συσκευή <b><nobr>"%1"</nobr></b>. + + + No devices Available. + Καμία διαθέσιμη συσκευή. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_eo.desktop b/lxqt-panel/plugin-mount/translations/mount_eo.desktop new file mode 100644 index 0000000..b04760d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Traktilo de demeteblaj aparatoj (USB, KD, DVD, ...) +Name[eo]=Demetebla datumportilo diff --git a/lxqt-panel/plugin-mount/translations/mount_eo.ts b/lxqt-panel/plugin-mount/translations/mount_eo.ts new file mode 100644 index 0000000..df1448d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_eo.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + La aparato <b><nobr>"%1"</nobr></b> estas konektita. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + La aparato <b><nobr>"%1"</nobr></b> estas demetita. + + + + Removable media/devices manager + Mastrumilo de demeteblaj aparatoj + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Agordoj de la mastrumilo de dementeblaj aparatoj de LxQt + + + + Removable Media Settings + + + + + Behaviour + Konduto + + + + When a device is connected + Kiam aparato estas konektita + + + + Popup menu + Ŝprucfenestra menuo + + + + Show info + Montri informojn + + + + Do nothing + Fari nenion + + + + MenuDiskItem + + Click to access this device from other applications. + Alklaku por atingi al ĉi tiu aparato el aliaj aplikaĵoj. + + + Click to eject this disc. + Alklaku por elĵeti ĉi tiun diskon. + + + + + Removable media/devices manager + Mastrumilo de demeteblaj aparatoj + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Mastrumilo de demeteblaj aparatoj + + + The device <b><nobr>"%1"</nobr></b> is connected. + La aparato <b><nobr>"%1"</nobr></b> estas konektita. + + + The device <b><nobr>"%1"</nobr></b> is removed. + La aparato <b><nobr>"%1"</nobr></b> estas demetita. + + + No devices Available. + Neniu disponebla aparato. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_es.desktop b/lxqt-panel/plugin-mount/translations/mount_es.desktop new file mode 100644 index 0000000..e1aafaa --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Manejador de dispositivos desmontables (USB, CD, DVD, ...) +Name[es]=Dispositivos desmontables diff --git a/lxqt-panel/plugin-mount/translations/mount_es.ts b/lxqt-panel/plugin-mount/translations/mount_es.ts new file mode 100644 index 0000000..f934515 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_es.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Se conectó el dispositivo <b><nobr>"%1"</nobr></b>. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Se expulsó el dispositivo <b><nobr>"%1"</nobr></b>. + + + + Removable media/devices manager + Gestor de medios y dispositivos extraíbles + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Configuración del gestor de medios extraíbles de LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamiento + + + + When a device is connected + Cuando un dispositivo se conecte + + + + Popup menu + Menú contextual + + + + Show info + Mostrar información + + + + Do nothing + No hacer nada + + + + MenuDiskItem + + Click to access this device from other applications. + Haga clic para acceder a este dispositivo desde otras aplicaciones. + + + Click to eject this disc. + Haga clic para expulsar este disco. + + + + + Removable media/devices manager + Gestor de medios y dispositivos extraíbles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Gestor de medios y dispositivos extraíbles + + + The device <b><nobr>"%1"</nobr></b> is connected. + Se conectó el dispositivo <b><nobr>"%1"</nobr></b>. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Se expulsó el dispositivo <b><nobr>"%1"</nobr></b>. + + + No devices Available. + No hay dispositivos disponibles. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_es_UY.ts b/lxqt-panel/plugin-mount/translations/mount_es_UY.ts new file mode 100644 index 0000000..9adc366 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_es_UY.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + El dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + El dispositivo <b><nobr>"%1"</nobr></b> fue quitado. + + + + Removable media/devices manager + Administrador de dispositivos desmontables + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Configuración de dispositivos desmontables LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamiento + + + + When a device is connected + Cuando un dispositivo es conectado + + + + Popup menu + Menú emergente + + + + Show info + Mostrar información + + + + Do nothing + No hacer nada + + + + MenuDiskItem + + Click to access this device from other applications. + Presione para acceder a este dispositivo desde otras aplicaciones. + + + Click to eject this disc. + Presione para expulsar este disco. + + + + + Removable media/devices manager + Administrador de dispositivos desmontables + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Administrador de dispositivos desmontables + + + The device <b><nobr>"%1"</nobr></b> is connected. + El dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + The device <b><nobr>"%1"</nobr></b> is removed. + El dispositivo <b><nobr>"%1"</nobr></b> fue quitado. + + + No devices Available. + No hay dispositivos disponibles. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_es_VE.desktop b/lxqt-panel/plugin-mount/translations/mount_es_VE.desktop new file mode 100644 index 0000000..bc62fb2 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Manejador de dispositivos removibles (USB, DVD, CAM, ..) +Name[es_VE]=Dispositivos diff --git a/lxqt-panel/plugin-mount/translations/mount_es_VE.ts b/lxqt-panel/plugin-mount/translations/mount_es_VE.ts new file mode 100644 index 0000000..cce1821 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_es_VE.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + El dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + El dispositivo <b><nobr>"%1"</nobr></b> fue quitado. + + + + Removable media/devices manager + Administrador de medios y dispositivos + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Configuración de manejador de dispositivos LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamiento + + + + When a device is connected + Cuando un dispositivo es conectado + + + + Popup menu + Menú emergente + + + + Show info + Mostrar información + + + + Do nothing + No hacer nada + + + + MenuDiskItem + + Click to access this device from other applications. + Presione para acceder a este dispositivo desde la palicacion por defecto. + + + Click to eject this disc. + Presione para expulsar este disco. + + + + + Removable media/devices manager + Administrador de medios y dispositivos + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Administrador de medios y dispositivos + + + The device <b><nobr>"%1"</nobr></b> is connected. + El dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + The device <b><nobr>"%1"</nobr></b> is removed. + El dispositivo <b><nobr>"%1"</nobr></b> fue quitado. + + + No devices Available. + No hay dispositivos disponibles. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_eu.desktop b/lxqt-panel/plugin-mount/translations/mount_eu.desktop new file mode 100644 index 0000000..8c1bc79 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Gailu aldagarrien maneiatzailea (USB, CD, DVD, ...) +Name[eu]=Gailu aldagarria diff --git a/lxqt-panel/plugin-mount/translations/mount_eu.ts b/lxqt-panel/plugin-mount/translations/mount_eu.ts new file mode 100644 index 0000000..7f5d9bc --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_eu.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + <b><nobr>"%1"</nobr></b>gailua konektatuta. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + <b><nobr>"%1"</nobr></b>gailua kenduta. + + + + Removable media/devices manager + Eduki/gailu aldagarrien kudeatzailea + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQt gailu aldagarrien kudeatzailearen ezarpenak + + + + Removable Media Settings + + + + + Behaviour + Portaera + + + + When a device is connected + Gailu bat konektatzean + + + + Popup menu + Laster-menua + + + + Show info + Erakutsi informazioa + + + + Do nothing + Ez egin ezer + + + + MenuDiskItem + + Click to access this device from other applications. + Klikatu gailu hau beste aplikazioetatik atzitzeko. + + + Click to eject this disc. + Klikatu diskoa egozteko. + + + + + Removable media/devices manager + Eduki/gailu aldagarrien kudeatzailea + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Eduki/gailu aldagarrien kudeatzailea + + + The device <b><nobr>"%1"</nobr></b> is connected. + <b><nobr>"%1"</nobr></b>gailua konektatuta. + + + The device <b><nobr>"%1"</nobr></b> is removed. + <b><nobr>"%1"</nobr></b>gailua kenduta. + + + No devices Available. + Gailurik ez erabilgarri. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_fi.desktop b/lxqt-panel/plugin-mount/translations/mount_fi.desktop new file mode 100644 index 0000000..6b253df --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Irrotettavien laitteiden ja medioiden käsittelijä (USB, CD, DVD...) +Name[fi]=Irrotettavat laitteet ja mediat diff --git a/lxqt-panel/plugin-mount/translations/mount_fi.ts b/lxqt-panel/plugin-mount/translations/mount_fi.ts new file mode 100644 index 0000000..d5c7403 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_fi.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Laite <b><nobr>"%1"</nobr></b> on liitetty. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Laite <b><nobr>"%1"</nobr></b> on irrotettu. + + + + Removable media/devices manager + Irrotettavien laitteiden ja levyjen hallinta + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQtin irrotettavien laitteiden asetukset + + + + Removable Media Settings + + + + + Behaviour + Toiminta + + + + When a device is connected + Kun laite liitetään + + + + Popup menu + Näytä valikko + + + + Show info + Näytä tiedot + + + + Do nothing + Älä tee mitään + + + + MenuDiskItem + + Click to access this device from other applications. + Napsauta käyttääksesi tätä laitetta muilla sovelluksilla. + + + Click to eject this disc. + Napsauta poistaaksesi tämän levyn. + + + + + Removable media/devices manager + Irrotettavien laitteiden ja levyjen hallinta + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Irrotettavien laitteiden ja levyjen hallinta + + + The device <b><nobr>"%1"</nobr></b> is connected. + Laite <b><nobr>"%1"</nobr></b> on liitetty. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Laite <b><nobr>"%1"</nobr></b> on irrotettu. + + + No devices Available. + Ei laitteita saatavilla. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_fr_FR.desktop b/lxqt-panel/plugin-mount/translations/mount_fr_FR.desktop new file mode 100644 index 0000000..f2de564 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Gestionnaire de médias amovibles (USB, CD, DVD, ...) +Name[fr_FR]=Média amovible diff --git a/lxqt-panel/plugin-mount/translations/mount_fr_FR.ts b/lxqt-panel/plugin-mount/translations/mount_fr_FR.ts new file mode 100644 index 0000000..9e34d71 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_fr_FR.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Le périphérique <b><nobr>"%1"</nobr></b>est connecté. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Le périphérique <b><nobr>"%1"</nobr></b> a été retiré. + + + + Removable media/devices manager + Gestionnaire de médias/périphériques amovibles + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Paramètres du gestionnaire de médias amovibles + + + + Removable Media Settings + + + + + Behaviour + Comportement + + + + When a device is connected + Quand un périphérique est connecté + + + + Popup menu + Menu pop-up + + + + Show info + Montrer les informations + + + + Do nothing + Ne rien faire + + + + MenuDiskItem + + Click to access this device from other applications. + Cliquez pour accéder à ce périphérique depuis d'autres applications. + + + Click to eject this disc. + Cliquez pour éjecter ce disque. + + + + + Removable media/devices manager + Gestionnaire de médias/périphériques amovibles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Gestionnaire de médias/périphériques amovibles + + + The device <b><nobr>"%1"</nobr></b> is connected. + Le périphérique <b><nobr>"%1"</nobr></b>est connecté. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Le périphérique <b><nobr>"%1"</nobr></b> a été retiré. + + + No devices Available. + Aucun périphérique disponible. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_hr.ts b/lxqt-panel/plugin-mount/translations/mount_hr.ts new file mode 100644 index 0000000..395f717 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_hr.ts @@ -0,0 +1,90 @@ + + + + + Button + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Configuration + + + Removable Media Settings + Postavke uklonjivih medija + + + + Behaviour + Ponašanje + + + + When a device is connected : + + + + + Popup menu + + + + + Show info + Pokaži info + + + + Do nothing + Ne čini ništa + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Uređaj <b><nobr>"%1"</nobr></b> je spojen. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Uređaj <b><nobr>"%1"</nobr></b> je uklonjen. + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Montiranje <b><nobr>"%1"</nobr></b> nije uspjelo: %2 + + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Odmontiranje <strong><nobr>"%1"</nobr></strong> nije uspjelo: %2 + + + + Popup + + + No devices are available + Nije dostupan nijedan uređaj + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_hu.desktop b/lxqt-panel/plugin-mount/translations/mount_hu.desktop new file mode 100644 index 0000000..877d885 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Cserélhetőeszköz-kezelő (USB, CD, DVD, …) +Name[hu]=Cserélhető eszköz diff --git a/lxqt-panel/plugin-mount/translations/mount_hu.ts b/lxqt-panel/plugin-mount/translations/mount_hu.ts new file mode 100644 index 0000000..6915125 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_hu.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + A LxQt cserélhetőeszköz-kezelő beállításai + + + + Removable Media Settings + Cserélhető eszközbeállítás + + + + Behaviour + Működés + + + + When a device is connected + Ha az eszköz csatlakoztatva van + + + + Popup menu + Felugró menü + + + + Show info + Információ megjelenítése + + + + Do nothing + Ne tegyen semmit + + + + MenuDiskItem + + Click to access this device from other applications. + Kattintson az eszköz más alkalmazásokból való eléréséhez. + + + Click to eject this disc. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 + + + + MountButton + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + No devices Available. + Nem érhetők el eszközök. + + + + Popup + + + No devices are available + Nincs elérhető eszköz + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_hu_HU.ts b/lxqt-panel/plugin-mount/translations/mount_hu_HU.ts new file mode 100644 index 0000000..1c1eb09 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_hu_HU.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + A LxQt cserélhetőeszköz-kezelő beállításai + + + + Removable Media Settings + Cserélhető eszközbeállítás + + + + Behaviour + Működés + + + + When a device is connected + Ha az eszköz csatlakoztatva van + + + + Popup menu + Felugró menü + + + + Show info + Információ megjelenítése + + + + Do nothing + Ne tegyen semmit + + + + MenuDiskItem + + Click to access this device from other applications. + Kattintson az eszköz más alkalmazásokból való eléréséhez. + + + Click to eject this disc. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 + + + + MountButton + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + No devices Available. + Nem érhetők el eszközök. + + + + Popup + + + No devices are available + Nincs elérhető eszköz + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ia.desktop b/lxqt-panel/plugin-mount/translations/mount_ia.desktop new file mode 100644 index 0000000..15f0263 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Removable media handler (USB, CD, DVD, ...) + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mount/translations/mount_ia.ts b/lxqt-panel/plugin-mount/translations/mount_ia.ts new file mode 100644 index 0000000..110a061 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ia.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + LxQtMountConfiguration + + + Removable Media Settings + + + + + Behaviour + + + + + When a device is connected + + + + + Popup menu + + + + + Show info + + + + + Do nothing + + + + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_id_ID.desktop b/lxqt-panel/plugin-mount/translations/mount_id_ID.desktop new file mode 100644 index 0000000..15f0263 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Removable media handler (USB, CD, DVD, ...) + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/plugin-mount/translations/mount_de_DE.ts b/lxqt-panel/plugin-mount/translations/mount_id_ID.ts similarity index 54% rename from plugin-mount/translations/mount_de_DE.ts rename to lxqt-panel/plugin-mount/translations/mount_id_ID.ts index 2c6c7e0..943bfd6 100644 --- a/plugin-mount/translations/mount_de_DE.ts +++ b/lxqt-panel/plugin-mount/translations/mount_id_ID.ts @@ -1,30 +1,26 @@ - + DeviceActionInfo The device <b><nobr>"%1"</nobr></b> is connected. - Der Datenträger <br><nobr>"%1"</nobr></br> ist verbunden. + The device <b><nobr>"%1"</nobr></b> is removed. - Der Datenträger <b><nobr>"%1"</nobr></br> ist entfernt. + Removable media/devices manager - Wechseldatenträger Manager + LxQtMountConfiguration - - LxQt Removable media manager settings - LxQt-Wechseldatenträger-Verwalter Einstellungen - Removable Media Settings @@ -33,64 +29,68 @@ Behaviour - Verhalten + When a device is connected - Wenn ein Datenträger angeschlossen ist + Popup menu - Popup Menü + Show info - Zeige Informationen + Do nothing - Mach nichts + MenuDiskItem Click to access this device from other applications. - Klicke um von anderen Anwendungen auf diesen Datenträger zugreifen zu können. + Klik untuk mengakses device ini dari aplikasi lain. Click to eject this disc. - Klicke um den Datenträger auszuwerfen. + Klik untuk mengeluarkan disk ini. - - - MountButton - + + Removable media/devices manager - Wechseldatenträger Manager + - The device <b><nobr>"%1"</nobr></b> is connected. - Der Datenträger <br><nobr>"%1"</nobr></br> ist verbunden. + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + - The device <b><nobr>"%1"</nobr></b> is removed. - Der Datenträger <b><nobr>"%1"</nobr></br> ist entfernt. + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + MountButton - No devices Available. - Kein Datenträger verfügbar. + + Removable media/devices manager + Popup - + No devices are available diff --git a/lxqt-panel/plugin-mount/translations/mount_it_IT.desktop b/lxqt-panel/plugin-mount/translations/mount_it_IT.desktop new file mode 100644 index 0000000..5b1a514 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Gestore dei dispositivi rimovibili (USB, CD, DVD, ...) +Name[it_IT]=Dispositivi rimovibili diff --git a/lxqt-panel/plugin-mount/translations/mount_it_IT.ts b/lxqt-panel/plugin-mount/translations/mount_it_IT.ts new file mode 100644 index 0000000..88d590f --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_it_IT.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Il dispositivo <b><nobr>"%1"</nobr></b> è connesso. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Il dispositivo <b><nobr>"%1"</nobr></b> è stato rimosso. + + + + Removable media/devices manager + Gestore dei dispositivi rimovibili + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Impostazioni del gestore dei dispositivi rimovibili di LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamento + + + + When a device is connected + Quando un dispositivo è connesso + + + + Popup menu + Menu a comparsa + + + + Show info + Mostra informazioni + + + + Do nothing + Non fare nulla + + + + MenuDiskItem + + Click to access this device from other applications. + Fai clic per accedere al dispositivo da altre applicazioni. + + + Click to eject this disc. + Fai clic per espellere il disco. + + + + + Removable media/devices manager + Gestore dei dispositivi rimovibili + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Gestore dei dispositivi rimovibili + + + The device <b><nobr>"%1"</nobr></b> is connected. + Il dispositivo <b><nobr>"%1"</nobr></b> è connesso. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Il dispositivo <b><nobr>"%1"</nobr></b> è stato rimosso. + + + No devices Available. + Nessun dispositivo disponibile. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ja.desktop b/lxqt-panel/plugin-mount/translations/mount_ja.desktop new file mode 100644 index 0000000..213cd62 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=USBや光学ドライブのマウントやアンマウントを容易にします +Name[ja]=リムーバルメディア diff --git a/lxqt-panel/plugin-mount/translations/mount_ja.ts b/lxqt-panel/plugin-mount/translations/mount_ja.ts new file mode 100644 index 0000000..f62b4dc --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ja.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + デバイス <b><nobr>"%1"</nobr></b> は接続されました + + + + The device <b><nobr>"%1"</nobr></b> is removed. + デバイス <b><nobr>"%1"</nobr></b> は接続解除されました + + + + Removable media/devices manager + リムーバルメディア/デバイスの管理 + + + + LxQtMountConfiguration + + + Removable Media Settings + リムーバブルメディアの設定 + + + + Behaviour + 挙動 + + + + When a device is connected + デバイスが接続されたとき + + + + Popup menu + メニューをポップアップ + + + + Show info + 情報を表示 + + + + Do nothing + 何もしない + + + + MenuDiskItem + + + + Removable media/devices manager + リムーバルメディア/デバイスの管理 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + リムーバルメディア/デバイスの管理 + + + + Popup + + + No devices are available + 接続可能なデバイスはありません + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ko.desktop b/lxqt-panel/plugin-mount/translations/mount_ko.desktop new file mode 100644 index 0000000..15f0263 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Removable media handler (USB, CD, DVD, ...) + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mount/translations/mount_ko.ts b/lxqt-panel/plugin-mount/translations/mount_ko.ts new file mode 100644 index 0000000..7f8db3b --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ko.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + LxQtMountConfiguration + + + Removable Media Settings + + + + + Behaviour + + + + + When a device is connected + + + + + Popup menu + + + + + Show info + + + + + Do nothing + + + + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_lt.desktop b/lxqt-panel/plugin-mount/translations/mount_lt.desktop new file mode 100644 index 0000000..03fbaf8 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Pašalinimų įrenginių tvarkymas (USB, CD, DVD, ...) +Name[lt]=Pašalinami įrenginiai diff --git a/lxqt-panel/plugin-mount/translations/mount_lt.ts b/lxqt-panel/plugin-mount/translations/mount_lt.ts new file mode 100644 index 0000000..6855c3e --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_lt.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Įrenginys <b><nobr>"%1"</nobr></b> prijungtas. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Įrenginys <b><nobr>"%1"</nobr></b> pašalintas + + + + Removable media/devices manager + Pašalinamų įrenginių tvarkytuvė + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQt pašalinamų įrenginių tvarkytuvės nuostatos + + + + Removable Media Settings + + + + + Behaviour + Elgsena + + + + When a device is connected + Prijungus įrenginį + + + + Popup menu + Iškylantis meniu + + + + Show info + Rodyti informaciją + + + + Do nothing + Nieko nedaryti + + + + MenuDiskItem + + Click to access this device from other applications. + Norėdami šį įrenginį pasiekti kitomis programomis, spragtelėkite. + + + Click to eject this disc. + Norėdami išstumti diską, spragtelėkite. + + + + + Removable media/devices manager + Pašalinamų įrenginių tvarkytuvė + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Pašalinamų įrenginių tvarkytuvė + + + The device <b><nobr>"%1"</nobr></b> is connected. + Įrenginys <b><nobr>"%1"</nobr></b> prijungtas. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Įrenginys <b><nobr>"%1"</nobr></b> pašalintas + + + No devices Available. + Įrenginių nėra + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_nl.desktop b/lxqt-panel/plugin-mount/translations/mount_nl.desktop new file mode 100644 index 0000000..8bc1779 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Verwijderbare media beheerder (USB, CD, DVD, ...) +Name[nl]=Verwijderbare media diff --git a/lxqt-panel/plugin-mount/translations/mount_nl.ts b/lxqt-panel/plugin-mount/translations/mount_nl.ts new file mode 100644 index 0000000..5f2db72 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_nl.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Het apparaat <b><nobr>"%1"</nobr></b> is verbonden. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Het apparaat <b><nobr>"%1"</nobr></b> is verwijderd. + + + + Removable media/devices manager + Beheerder van verwijderbare media/apparaten + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Instellingen voor beheerder van verwijderbare media in LxQt + + + + Removable Media Settings + + + + + Behaviour + Gedrag + + + + When a device is connected + Wanneer een apparaat wordt verbonden + + + + Popup menu + Opduikmenu + + + + Show info + Toon informatie + + + + Do nothing + Niets doen + + + + MenuDiskItem + + Click to access this device from other applications. + Klik om dit apparaat te benaderen vanuit andere toepassingen. + + + Click to eject this disc. + Klik om deze schijf uit te werpen. + + + + + Removable media/devices manager + Beheerder van verwijderbare media/apparaten + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Beheerder van verwijderbare media/apparaten + + + The device <b><nobr>"%1"</nobr></b> is connected. + Het apparaat <b><nobr>"%1"</nobr></b> is verbonden. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Het apparaat <b><nobr>"%1"</nobr></b> is verwijderd. + + + No devices Available. + Geen apparaten beschikbaar. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_pl.desktop b/lxqt-panel/plugin-mount/translations/mount_pl.desktop new file mode 100644 index 0000000..4b55fab --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Menedżer urządzeń (USB, CD, DVD, ...) +Name[pl]=Menedżer urządzeń diff --git a/lxqt-panel/plugin-mount/translations/mount_pl_PL.desktop b/lxqt-panel/plugin-mount/translations/mount_pl_PL.desktop new file mode 100644 index 0000000..a2f14a9 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Nośniki wymienne (USB, CD, DVD, ...) +Name[pl_PL]=Nośniki wymienne diff --git a/lxqt-panel/plugin-mount/translations/mount_pl_PL.ts b/lxqt-panel/plugin-mount/translations/mount_pl_PL.ts new file mode 100644 index 0000000..5154fbc --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pl_PL.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. + + + + Removable media/devices manager + Menedżer nośników wymiennych + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Ustawienia menedżera nośników wymiennych + + + + Removable Media Settings + Ustawienia nośników wymiennych + + + + Behaviour + Zachowanie + + + + When a device is connected + Kiedy nośnik jest podłączony + + + + Popup menu + Pokaż listę + + + + Show info + Pokaż informacje + + + + Do nothing + Nic nierób + + + + MenuDiskItem + + Click to access this device from other applications. + Kliknij aby uzyskać dostęp do tego nośnika z innych aplikacji. + + + Click to eject this disc. + Kliknij aby wysunąć ten dysk. + + + + + Removable media/devices manager + Menedżer nośników wymiennych + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Menedżer nośników wymiennych + + + The device <b><nobr>"%1"</nobr></b> is connected. + Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. + + + No devices Available. + Brak nośników. + + + + Popup + + + No devices are available + Brak dostępnych urządzeń + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_pt.desktop b/lxqt-panel/plugin-mount/translations/mount_pt.desktop new file mode 100644 index 0000000..a6ba0de --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Discos amovíveis +Comment[pt]=Montar e desmontar discos óticos e unidades USB. diff --git a/lxqt-panel/plugin-mount/translations/mount_pt.ts b/lxqt-panel/plugin-mount/translations/mount_pt.ts new file mode 100644 index 0000000..9e96135 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pt.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + O dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + O dispositivo <b><nobr>"%1"</nobr></b> foi removido. + + + + Removable media/devices manager + Gestor de discos e unidades amovíveis + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Definições do gestor de unidades e discos amovíveis do LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamento + + + + When a device is connected + Ao conectar um dispositivo + + + + Popup menu + Menu + + + + Show info + Mostrar informações + + + + Do nothing + Nada fazer + + + + MenuDiskItem + + Click to access this device from other applications. + Clique para aceder a este dispositivo a partir de outras aplicações. + + + Click to eject this disc. + Clique para ejetar este disco. + + + + + Removable media/devices manager + Gestor de discos e unidades amovíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Gestor de discos e unidades amovíveis + + + The device <b><nobr>"%1"</nobr></b> is connected. + O dispositivo <b><nobr>"%1"</nobr></b> está conectado. + + + The device <b><nobr>"%1"</nobr></b> is removed. + O dispositivo <b><nobr>"%1"</nobr></b> foi removido. + + + No devices Available. + Nenhum dispositivo. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_pt_BR.desktop b/lxqt-panel/plugin-mount/translations/mount_pt_BR.desktop new file mode 100644 index 0000000..cfb8564 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Manipulador de mídia removível (USB, CD, DVD, ...) +Name[pt_BR]=Mídia removível diff --git a/lxqt-panel/plugin-mount/translations/mount_pt_BR.ts b/lxqt-panel/plugin-mount/translations/mount_pt_BR.ts new file mode 100644 index 0000000..d886a6d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_pt_BR.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + O dispositivo <b><nobr>"%1"</nobr></br> está conectado. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + O dispositivo <b><nobr>"%1"</nobr></br> foi removido. + + + + Removable media/devices manager + Gerenciador de dispositivos/mídias removíveis + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Configurações do gerenciador de mídia removível do LxQt + + + + Removable Media Settings + + + + + Behaviour + Comportamento + + + + When a device is connected + Quando o dispositivo for conectado + + + + Popup menu + Menu de contexto + + + + Show info + Exibir informações + + + + Do nothing + Não fazer nada + + + + MenuDiskItem + + Click to access this device from other applications. + Clique para acessar este dispositivo a partir de outros aplicativos. + + + Click to eject this disc. + Clique para ejetar este disco. + + + + + Removable media/devices manager + Gerenciador de dispositivos/mídias removíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Gerenciador de dispositivos/mídias removíveis + + + The device <b><nobr>"%1"</nobr></b> is connected. + O dispositivo <b><nobr>"%1"</nobr></br> está conectado. + + + The device <b><nobr>"%1"</nobr></b> is removed. + O dispositivo <b><nobr>"%1"</nobr></br> foi removido. + + + No devices Available. + Nenhum dispositivo disponível. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ro_RO.desktop b/lxqt-panel/plugin-mount/translations/mount_ro_RO.desktop new file mode 100644 index 0000000..73da7c6 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Administrator de dispozitive detașabile (USB, CD, DVD, ...) +Name[ro_RO]=Dispozitive detașabile diff --git a/lxqt-panel/plugin-mount/translations/mount_ro_RO.ts b/lxqt-panel/plugin-mount/translations/mount_ro_RO.ts new file mode 100644 index 0000000..b7fcad5 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ro_RO.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Dispozitivul <b><nobr>"%1"</nobr></b> a fost conectat. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Dispozitivul <b><nobr>"%1"</nobr></b> a fost eliminat. + + + + Removable media/devices manager + Administrator medii/dispozitive detașabile + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Configurație Administrator medii detașabile + + + + Removable Media Settings + + + + + Behaviour + Comportament + + + + When a device is connected + Când este conectat un dispozitiv + + + + Popup menu + Meniu popup + + + + Show info + Afișează informații + + + + Do nothing + Nicio acțiune + + + + MenuDiskItem + + Click to access this device from other applications. + Apăsați pentru a accesa acest dispozitiv din alte aplicații. + + + Click to eject this disc. + Clic pentru a scoate acest disc. + + + + + Removable media/devices manager + Administrator medii/dispozitive detașabile + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Administrator medii/dispozitive detașabile + + + The device <b><nobr>"%1"</nobr></b> is connected. + Dispozitivul <b><nobr>"%1"</nobr></b> a fost conectat. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Dispozitivul <b><nobr>"%1"</nobr></b> a fost eliminat. + + + No devices Available. + Nu este disponibil nici un dispozitiv. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ru.desktop b/lxqt-panel/plugin-mount/translations/mount_ru.desktop new file mode 100644 index 0000000..562dbb3 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Простое подключение и отключение USB и оптических приводов. +Name[ru_RU]=Съёмные устройства diff --git a/lxqt-panel/plugin-mount/translations/mount_ru.ts b/lxqt-panel/plugin-mount/translations/mount_ru.ts new file mode 100644 index 0000000..836576d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ru.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Устройство <b><nobr>«%1»</nobr></b> подключено. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Устройство <b><nobr>«%1»</nobr></b> отключено. + + + + Removable media/devices manager + Диспетчер отключаемых медиа/устройств + + + + LxQtMountConfiguration + + + Removable Media Settings + Настройки съёмных устройств + + + + Behaviour + Поведение + + + + When a device is connected + Когда устройство подключено + + + + Popup menu + Всплывающее меню + + + + Show info + Показать информацию + + + + Do nothing + Ничего не делать + + + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Диспетчер съёмных медиа/устройств + + + + Popup + + + No devices are available + Нет доступных устройств + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_ru_RU.desktop b/lxqt-panel/plugin-mount/translations/mount_ru_RU.desktop new file mode 100644 index 0000000..562dbb3 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Простое подключение и отключение USB и оптических приводов. +Name[ru_RU]=Съёмные устройства diff --git a/lxqt-panel/plugin-mount/translations/mount_ru_RU.ts b/lxqt-panel/plugin-mount/translations/mount_ru_RU.ts new file mode 100644 index 0000000..f6e59b4 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_ru_RU.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Устройство <b><nobr>«%1»</nobr></b> подключено. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Устройство <b><nobr>«%1»</nobr></b> отключено. + + + + Removable media/devices manager + Диспетчер отключаемых медиа/устройств + + + + LxQtMountConfiguration + + + Removable Media Settings + Настройки съёмных устройств + + + + Behaviour + Поведение + + + + When a device is connected + Когда устройство подключено + + + + Popup menu + Всплывающее меню + + + + Show info + Показать информацию + + + + Do nothing + Ничего не делать + + + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Диспетчер съёмных медиа/устройств + + + + Popup + + + No devices are available + Нет доступных устройств + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_sk.desktop b/lxqt-panel/plugin-mount/translations/mount_sk.desktop new file mode 100644 index 0000000..f01d1de --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Práca s prenosnými médiami (USB, CD, DVD, ...) +Name[sk]=Prenosné médiá diff --git a/lxqt-panel/plugin-mount/translations/mount_sk_SK.ts b/lxqt-panel/plugin-mount/translations/mount_sk_SK.ts new file mode 100644 index 0000000..742c1e6 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sk_SK.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zariadenie <b><nobr>„%1“</nobr></b> je zapojené. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zariadenie <b><nobr>„%1“</nobr></b> je odstránené. + + + + Removable media/devices manager + Správca prenosných médií a zariadení + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Nastavenia správcu prenosných médií prostredia LxQt + + + + Removable Media Settings + + + + + Behaviour + Správanie + + + + When a device is connected + Pri pripojení zariadenia + + + + Popup menu + Zobraziť menu + + + + Show info + Zobraziť informácie + + + + Do nothing + Nerobiť nič + + + + MenuDiskItem + + Click to access this device from other applications. + Kliknutím môžete pristupovať na toto zariadenie z iných aplikácií. + + + Click to eject this disc. + Kliknutím vysuniete tento disk. + + + + + Removable media/devices manager + Správca prenosných médií a zariadení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Správca prenosných médií a zariadení + + + The device <b><nobr>"%1"</nobr></b> is connected. + Zariadenie <b><nobr>„%1“</nobr></b> je zapojené. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Zariadenie <b><nobr>„%1“</nobr></b> je odstránené. + + + No devices Available. + Žiadne zariadenia nie sú dostupné. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_sl.desktop b/lxqt-panel/plugin-mount/translations/mount_sl.desktop new file mode 100644 index 0000000..1f8f23c --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Upravljalnik odstranljivih nosilcev (USB, CD, DVD, ...) +Name[sl]=Odstranljivi nosilci diff --git a/lxqt-panel/plugin-mount/translations/mount_sl.ts b/lxqt-panel/plugin-mount/translations/mount_sl.ts new file mode 100644 index 0000000..d325a6d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sl.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Naprava <b><nobr>%1</nobr></b> je priključena. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Naprava <b><nobr>%1</nobr></b> je odstranjena. + + + + Removable media/devices manager + Upravljalnik odstranljivih nosilcev/naprav + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Nastavitve upravljalnika odstranljivih nosilcev + + + + Removable Media Settings + + + + + Behaviour + Obnašanje + + + + When a device is connected + Ko se naprava priključi + + + + Popup menu + Prikaži meni + + + + Show info + Prikaži podatke + + + + Do nothing + Ne naredi nič + + + + MenuDiskItem + + Click to access this device from other applications. + Kliknite, da omogočite dostop do naprave iz programov. + + + Click to eject this disc. + Kliknite za izmet diska. + + + + + Removable media/devices manager + Upravljalnik odstranljivih nosilcev/naprav + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Upravljalnik odstranljivih nosilcev/naprav + + + The device <b><nobr>"%1"</nobr></b> is connected. + Naprava <b><nobr>%1</nobr></b> je priključena. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Naprava <b><nobr>%1</nobr></b> je odstranjena. + + + No devices Available. + Na voljo ni nobene naprave + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_sr.desktop b/lxqt-panel/plugin-mount/translations/mount_sr.desktop new file mode 100644 index 0000000..048f5a0 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Руковаоц уклоњивим медијима (УСБ, ЦД, ДВД...) +Name[sr]=Уклоњиви медији diff --git a/lxqt-panel/plugin-mount/translations/mount_sr@ijekavian.desktop b/lxqt-panel/plugin-mount/translations/mount_sr@ijekavian.desktop new file mode 100644 index 0000000..93c2944 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Уклоњиви медији +Comment[sr@ijekavian]=Руковаоц уклоњивим медијима (УСБ, ЦД, ДВД...) diff --git a/lxqt-panel/plugin-mount/translations/mount_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-mount/translations/mount_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..8fa702c --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Uklonjivi mediji +Comment[sr@ijekavianlatin]=Rukovaoc uklonjivim medijima (USB, CD, DVD...) diff --git a/lxqt-panel/plugin-mount/translations/mount_sr@latin.desktop b/lxqt-panel/plugin-mount/translations/mount_sr@latin.desktop new file mode 100644 index 0000000..39ba4ca --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Rukovaoc uklonjivim medijima (USB, CD, DVD...) +Name[sr@latin]=Uklonjivi mediji diff --git a/lxqt-panel/plugin-mount/translations/mount_sr@latin.ts b/lxqt-panel/plugin-mount/translations/mount_sr@latin.ts new file mode 100644 index 0000000..950b4ea --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr@latin.ts @@ -0,0 +1,90 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + LxQtMountConfiguration + + + Removable Media Settings + + + + + Behaviour + + + + + When a device is connected + + + + + Popup menu + + + + + Show info + + + + + Do nothing + + + + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_sr_BA.ts b/lxqt-panel/plugin-mount/translations/mount_sr_BA.ts new file mode 100644 index 0000000..1d05e04 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr_BA.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Уређај <b><nobr>„%1“</nobr></b> је прикључен. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Уређај <b><nobr>„%1“</nobr></b> је уклоњен. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Подешавање менаџера уклоњивих медија + + + + Removable Media Settings + + + + + Behaviour + Понашање + + + + When a device is connected + Кад је уређај прикључен + + + + Popup menu + прикажи мени + + + + Show info + прикажи инфо + + + + Do nothing + не ради ништа + + + + MenuDiskItem + + Click to access this device from other applications. + Кликните да приступате овом уређају из других програма. + + + Click to eject this disc. + Кликните да избаците диск. + + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + The device <b><nobr>"%1"</nobr></b> is connected. + Уређај <b><nobr>„%1“</nobr></b> је прикључен. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Уређај <b><nobr>„%1“</nobr></b> је уклоњен. + + + No devices Available. + Нема доступних уређаја. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_sr_RS.ts b/lxqt-panel/plugin-mount/translations/mount_sr_RS.ts new file mode 100644 index 0000000..1d05e04 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_sr_RS.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Уређај <b><nobr>„%1“</nobr></b> је прикључен. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Уређај <b><nobr>„%1“</nobr></b> је уклоњен. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Подешавање менаџера уклоњивих медија + + + + Removable Media Settings + + + + + Behaviour + Понашање + + + + When a device is connected + Кад је уређај прикључен + + + + Popup menu + прикажи мени + + + + Show info + прикажи инфо + + + + Do nothing + не ради ништа + + + + MenuDiskItem + + Click to access this device from other applications. + Кликните да приступате овом уређају из других програма. + + + Click to eject this disc. + Кликните да избаците диск. + + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + The device <b><nobr>"%1"</nobr></b> is connected. + Уређај <b><nobr>„%1“</nobr></b> је прикључен. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Уређај <b><nobr>„%1“</nobr></b> је уклоњен. + + + No devices Available. + Нема доступних уређаја. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_th_TH.desktop b/lxqt-panel/plugin-mount/translations/mount_th_TH.desktop new file mode 100644 index 0000000..72220dd --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=ตัวจัดการสื่อที่สามารถถอดเสียบได้ (USB, CD, DVD, ...) +Name[th_TH]=สื่อที่สามารถถอดเสียบได้ diff --git a/lxqt-panel/plugin-mount/translations/mount_th_TH.ts b/lxqt-panel/plugin-mount/translations/mount_th_TH.ts new file mode 100644 index 0000000..00cb276 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_th_TH.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + อุปกรณ์ <b><nobr>"%1"</nobr></b> ถูกเชื่อมต่อแล้ว + + + + The device <b><nobr>"%1"</nobr></b> is removed. + อุปกรณ์ <b><nobr>"%1"</nobr></b> ถูกถอดออกแล้ว + + + + Removable media/devices manager + ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + ค่าตั้งตัวจัดการสื่อแบบถอดเสียบได้ LxQt + + + + Removable Media Settings + + + + + Behaviour + พฤติกรรม + + + + When a device is connected + เมื่ออุปกรณ์ถูกเชื่อมต่อ + + + + Popup menu + เมนูผุดขึ้น + + + + Show info + แสดงข้อมูล + + + + Do nothing + ไม่ต้องทำอะไร + + + + MenuDiskItem + + Click to access this device from other applications. + คลิกเพื่อเข้าใช้อุปกรณ์จากโปรแกรมต่างๆ + + + Click to eject this disc. + คลิกเพื่อดันแผ่นดิสก์ออก + + + + + Removable media/devices manager + ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ + + + The device <b><nobr>"%1"</nobr></b> is connected. + อุปกรณ์ <b><nobr>"%1"</nobr></b> ถูกเชื่อมต่อแล้ว + + + The device <b><nobr>"%1"</nobr></b> is removed. + อุปกรณ์ <b><nobr>"%1"</nobr></b> ถูกถอดออกแล้ว + + + No devices Available. + ไม่มีอุปกรณ์ที่ใช้งานได้ + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_tr.desktop b/lxqt-panel/plugin-mount/translations/mount_tr.desktop new file mode 100644 index 0000000..4018fbe --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Çıkarılabilir aygıt yöneticisi (USB, CD, DVD, ...) +Name[tr]=Çıkarılabilir aygıt diff --git a/lxqt-panel/plugin-mount/translations/mount_tr.ts b/lxqt-panel/plugin-mount/translations/mount_tr.ts new file mode 100644 index 0000000..bae5385 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_tr.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + <b><nobr>"%1"</nobr></b> aygıtı bağlı. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + <b><nobr>"%1"</nobr></b> aygıtı çıkarıldı. + + + + Removable media/devices manager + Çıkarılabilir ortam/aygıt yönetici + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQt Çıkarılabilir ortam yönetici ayarları + + + + Removable Media Settings + + + + + Behaviour + Davranış + + + + When a device is connected + Bir aygıt bağlandığında + + + + Popup menu + Açılır menü + + + + Show info + Bilgi görüntüle + + + + Do nothing + Hiç bir şey yapma + + + + MenuDiskItem + + Click to access this device from other applications. + Diğer uygulamalardan bu aygıta erişmek için tıklayın + + + Click to eject this disc. + Bu diski çıkartmak için tıklayın. + + + + + Removable media/devices manager + Çıkarılabilir ortam/aygıt yönetici + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Çıkarılabilir ortam/aygıt yönetici + + + The device <b><nobr>"%1"</nobr></b> is connected. + <b><nobr>"%1"</nobr></b> aygıtı bağlı. + + + The device <b><nobr>"%1"</nobr></b> is removed. + <b><nobr>"%1"</nobr></b> aygıtı çıkarıldı. + + + No devices Available. + Erişilebilir aygıt yok. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_uk.desktop b/lxqt-panel/plugin-mount/translations/mount_uk.desktop new file mode 100644 index 0000000..112063f --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Легке керування знімними носіями (USB, CD, DVD тощо) +Name[uk]=Знімні носії diff --git a/lxqt-panel/plugin-mount/translations/mount_uk.ts b/lxqt-panel/plugin-mount/translations/mount_uk.ts new file mode 100644 index 0000000..3838030 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_uk.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Пристрій <b><nobr>"%1"</nobr></b> приєднано. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Пристрій <b><nobr>"%1"</nobr></b> від’єднано. + + + + Removable media/devices manager + Керування знімними носіями + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + Налаштування знімних носіїв LxQt + + + + Removable Media Settings + + + + + Behaviour + Поведінка + + + + When a device is connected + Коли пристрій приєднано: + + + + Popup menu + показати спливне меню + + + + Show info + показати інформацію + + + + Do nothing + нічого не робити + + + + MenuDiskItem + + Click to access this device from other applications. + Натисніть, щоб надати доступ до цього пристрою іншим програмам. + + + Click to eject this disc. + Натисніть, щоб витягти диск. + + + + + Removable media/devices manager + Керування знімними носіями + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + Керування знімними носіями + + + The device <b><nobr>"%1"</nobr></b> is connected. + Пристрій <b><nobr>"%1"</nobr></b> приєднано. + + + The device <b><nobr>"%1"</nobr></b> is removed. + Пристрій <b><nobr>"%1"</nobr></b> від’єднано. + + + No devices Available. + Пристрої відсутні. + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_zh_CN.GB2312.desktop b/lxqt-panel/plugin-mount/translations/mount_zh_CN.GB2312.desktop new file mode 100644 index 0000000..15f0263 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Removable media handler (USB, CD, DVD, ...) + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-mount/translations/mount_zh_CN.desktop b/lxqt-panel/plugin-mount/translations/mount_zh_CN.desktop new file mode 100644 index 0000000..2558918 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=移动存储处理(USB, CD, DVD, ...) +Name[zh_CN]=移动存储 diff --git a/lxqt-panel/plugin-mount/translations/mount_zh_CN.ts b/lxqt-panel/plugin-mount/translations/mount_zh_CN.ts new file mode 100644 index 0000000..e01eac9 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_zh_CN.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + 设备 <b><nobr>"%1"</nobr></b> 已连接。 + + + + The device <b><nobr>"%1"</nobr></b> is removed. + 设备 <b><nobr>"%1"</nobr></b> 已移除。 + + + + Removable media/devices manager + 可移动存储设备管理器 + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQt可移动媒体管理器设置 + + + + Removable Media Settings + + + + + Behaviour + 行为 + + + + When a device is connected + 当一个设备连接时 + + + + Popup menu + 弹出菜单 + + + + Show info + 显示信息 + + + + Do nothing + 什么都不做 + + + + MenuDiskItem + + Click to access this device from other applications. + 点击以从其它应用程序访问此设备。 + + + Click to eject this disc. + 点击以弹出该存储卷。 + + + + + Removable media/devices manager + 可移动存储设备管理器 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + 可移动存储设备管理器 + + + The device <b><nobr>"%1"</nobr></b> is connected. + 设备 <b><nobr>"%1"</nobr></b> 已连接。 + + + The device <b><nobr>"%1"</nobr></b> is removed. + 设备 <b><nobr>"%1"</nobr></b> 已移除。 + + + No devices Available. + 没有可用设备。 + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-mount/translations/mount_zh_TW.desktop b/lxqt-panel/plugin-mount/translations/mount_zh_TW.desktop new file mode 100644 index 0000000..bd69a9d --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Removable media +Comment=Easy mounting and unmounting of USB and optical drives. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=可卸除式裝置管理(USB、光碟...) +Name[zh_TW]=可卸除式裝置 diff --git a/lxqt-panel/plugin-mount/translations/mount_zh_TW.ts b/lxqt-panel/plugin-mount/translations/mount_zh_TW.ts new file mode 100644 index 0000000..81bf339 --- /dev/null +++ b/lxqt-panel/plugin-mount/translations/mount_zh_TW.ts @@ -0,0 +1,114 @@ + + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + 裝置 <b><nobr>"%1"</nobr></b> 已連接。 + + + + The device <b><nobr>"%1"</nobr></b> is removed. + 裝置 <b><nobr>"%1"</nobr></b> 已卸除。 + + + + Removable media/devices manager + 可卸除式裝置管理員 + + + + LxQtMountConfiguration + + LxQt Removable media manager settings + LxQt可卸除式裝置管理員設定 + + + + Removable Media Settings + + + + + Behaviour + 行為 + + + + When a device is connected + 當一個裝置連接時 + + + + Popup menu + 彈出選單 + + + + Show info + 顯示訊息 + + + + Do nothing + 什麼都不做 + + + + MenuDiskItem + + Click to access this device from other applications. + 點擊以從其他應用程式讀取此裝置。 + + + Click to eject this disc. + 點擊以退出此磁片。 + + + + + Removable media/devices manager + 可卸除式裝置管理員 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + MountButton + + + Removable media/devices manager + 可卸除式裝置管理員 + + + The device <b><nobr>"%1"</nobr></b> is connected. + 裝置 <b><nobr>"%1"</nobr></b> 已連接。 + + + The device <b><nobr>"%1"</nobr></b> is removed. + 裝置 <b><nobr>"%1"</nobr></b> 已卸除。 + + + No devices Available. + 無可用裝置。 + + + + Popup + + + No devices are available + + + + diff --git a/lxqt-panel/plugin-networkmonitor/CMakeLists.txt b/lxqt-panel/plugin-networkmonitor/CMakeLists.txt new file mode 100644 index 0000000..f83b32f --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/CMakeLists.txt @@ -0,0 +1,25 @@ +set(PLUGIN "networkmonitor") + +set(HEADERS + lxqtnetworkmonitorplugin.h + lxqtnetworkmonitor.h + lxqtnetworkmonitorconfiguration.h +) + +set(SOURCES + lxqtnetworkmonitorplugin.cpp + lxqtnetworkmonitor.cpp + lxqtnetworkmonitorconfiguration.cpp +) + +set(UIS + lxqtnetworkmonitorconfiguration.ui +) + +set(RESOURCES + resources.qrc +) + +set(LIBRARIES ${STATGRAB_LIB}) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-error.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-error.png new file mode 100644 index 0000000..8d49723 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-error.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-idle.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-idle.png new file mode 100644 index 0000000..0287aef Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-idle.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-offline.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-offline.png new file mode 100644 index 0000000..f93afc3 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-offline.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-receive.png new file mode 100644 index 0000000..cc3bcc6 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit-receive.png new file mode 100644 index 0000000..40a1480 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit.png b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit.png new file mode 100644 index 0000000..92752fa Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-modem-transmit.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-error.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-error.png new file mode 100644 index 0000000..926cd9c Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-error.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-idle.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-idle.png new file mode 100644 index 0000000..aabf851 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-idle.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-offline.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-offline.png new file mode 100644 index 0000000..ec0d60f Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-offline.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-receive.png new file mode 100644 index 0000000..391f9ee Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit-receive.png new file mode 100644 index 0000000..221cbe5 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit.png b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit.png new file mode 100644 index 0000000..b23ea99 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-monitor-transmit.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-error.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-error.png new file mode 100644 index 0000000..4135687 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-error.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-idle.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-idle.png new file mode 100644 index 0000000..6fb9882 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-idle.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-offline.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-offline.png new file mode 100644 index 0000000..90a2d69 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-offline.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-receive.png new file mode 100644 index 0000000..013199d Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit-receive.png new file mode 100644 index 0000000..3b3c4d2 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit.png b/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit.png new file mode 100644 index 0000000..cf991f3 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-network-transmit.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-error.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-error.png new file mode 100644 index 0000000..98f1c4b Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-error.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-idle.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-idle.png new file mode 100644 index 0000000..bc1d79a Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-idle.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-offline.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-offline.png new file mode 100644 index 0000000..6791d49 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-offline.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-receive.png new file mode 100644 index 0000000..ff0f2d6 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit-receive.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit-receive.png new file mode 100644 index 0000000..eedd9dd Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit-receive.png differ diff --git a/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit.png b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit.png new file mode 100644 index 0000000..864ec59 Binary files /dev/null and b/lxqt-panel/plugin-networkmonitor/images/knemo-wireless-transmit.png differ diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.cpp b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.cpp new file mode 100644 index 0000000..7df0e0a --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.cpp @@ -0,0 +1,216 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtnetworkmonitor.h" +#include "lxqtnetworkmonitorconfiguration.h" +#include "../panel/ilxqtpanelplugin.h" + +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +#ifdef __sg_public +// since libstatgrab 0.90 this macro is defined, so we use it for version check +#define STATGRAB_NEWER_THAN_0_90 1 +#endif + +LxQtNetworkMonitor::LxQtNetworkMonitor(ILxQtPanelPlugin *plugin, QWidget* parent): + QFrame(parent), + mPlugin(plugin) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + layout->addWidget(&m_stuff); + setLayout(layout); + /* Initialise statgrab */ +#ifdef STATGRAB_NEWER_THAN_0_90 + sg_init(0); +#else + sg_init(); +#endif + + m_iconList << "modem" << "monitor" + << "network" << "wireless"; + + startTimer(800); + + settingsChanged(); +} + +LxQtNetworkMonitor::~LxQtNetworkMonitor() +{ +} + +void LxQtNetworkMonitor::resizeEvent(QResizeEvent *) +{ + m_stuff.setMinimumWidth(m_pic.width() + 2); + m_stuff.setMinimumHeight(m_pic.height() + 2); + + update(); +} + + +void LxQtNetworkMonitor::timerEvent(QTimerEvent *event) +{ + bool matched = false; + +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t num_network_stats; + size_t x; +#else + int num_network_stats; + int x; +#endif + sg_network_io_stats *network_stats = sg_get_network_io_stats_diff(&num_network_stats); + + for (x = 0; x < num_network_stats; x++) + { + if (m_interface == QString::fromLocal8Bit(network_stats->interface_name)) + { + if (network_stats->rx != 0 && network_stats->tx != 0) + { + m_pic.load(iconName("transmit-receive")); + } + else if (network_stats->rx != 0 && network_stats->tx == 0) + { + m_pic.load(iconName("receive")); + } + else if (network_stats->rx == 0 && network_stats->tx != 0) + { + m_pic.load(iconName("transmit")); + } + else + { + m_pic.load(iconName("idle")); + } + + matched = true; + + break; + } + + network_stats++; + } + + if (!matched) + { + m_pic.load(iconName("error")); + } + + update(); +} + +void LxQtNetworkMonitor::paintEvent(QPaintEvent *) +{ + QPainter p(this); + + QRectF r = rect(); + + int leftOffset = (r.width() - m_pic.width() + 2) / 2; + int topOffset = (r.height() - m_pic.height() + 2) / 2; + + p.drawPixmap(leftOffset, topOffset, m_pic); +} + +bool LxQtNetworkMonitor::event(QEvent *event) +{ + if (event->type() == QEvent::ToolTip) + { +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t num_network_stats; + size_t x; +#else + int num_network_stats; + int x; +#endif + sg_network_io_stats *network_stats = sg_get_network_io_stats(&num_network_stats); + + for (x = 0; x < num_network_stats; x++) + { + if (m_interface == QString::fromLocal8Bit(network_stats->interface_name)) + { + setToolTip(tr("Network interface %1").arg(m_interface) + "
" + + tr("Transmitted %1").arg(convertUnits(network_stats->tx)) + "
" + + tr("Received %1").arg(convertUnits(network_stats->rx)) + ); + } + network_stats++; + } + } + return QFrame::event(event); +} + +//void LxQtNetworkMonitor::showConfigureDialog() +//{ +// LxQtNetworkMonitorConfiguration *confWindow = +// this->findChild("LxQtNetworkMonitorConfigurationWindow"); + +// if (!confWindow) +// { +// confWindow = new LxQtNetworkMonitorConfiguration(settings(), this); +// } + +// confWindow->show(); +// confWindow->raise(); +// confWindow->activateWindow(); +//} + +void LxQtNetworkMonitor::settingsChanged() +{ + m_iconIndex = mPlugin->settings()->value("icon", 1).toInt(); + m_interface = mPlugin->settings()->value("interface").toString(); + if (m_interface.isEmpty()) + { +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t count; +#else + int count; +#endif + sg_network_iface_stats* stats = sg_get_network_iface_stats(&count); + if (count > 0) + m_interface = QString(stats[0].interface_name); + } + + m_pic.load(iconName("error")); +} + +QString LxQtNetworkMonitor::convertUnits(double num) +{ + QString unit = tr("B"); + QStringList units = QStringList(tr("KiB")) << tr("MiB") << tr("GiB") << tr("TiB") << tr("PiB"); + for (QStringListIterator iter(units); num >= 1024 && iter.hasNext();) + { + num /= 1024; + unit = iter.next(); + } + return QString::number(num, 'f', 2) + " " + unit; +} diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.h b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.h new file mode 100644 index 0000000..e34c50f --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitor.h @@ -0,0 +1,74 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTNETWORKMONITOR_H +#define LXQTNETWORKMONITOR_H +#include + +class ILxQtPanelPlugin; + +/*! + TODO: How to define cable is not connected? + */ +class LxQtNetworkMonitor: public QFrame +{ + Q_OBJECT +public: + LxQtNetworkMonitor(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~LxQtNetworkMonitor(); + virtual void settingsChanged(); + +protected: + void virtual timerEvent(QTimerEvent *event); + void virtual paintEvent(QPaintEvent * event); + void virtual resizeEvent(QResizeEvent *); + bool virtual event(QEvent *event); + + +private: + static QString convertUnits(double num); + QString iconName(const QString& state) const + { + return QString(":/images/knemo-%1-%2.png") + .arg(m_iconList[m_iconIndex], state); + } + + QWidget m_stuff; + + QStringList m_iconList; + + int m_iconIndex; + + QString m_interface; + QPixmap m_pic; + ILxQtPanelPlugin *mPlugin; +}; + + +#endif // LXQTNETWORKMONITOR_H + + diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.cpp b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.cpp new file mode 100644 index 0000000..a9c83df --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.cpp @@ -0,0 +1,100 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtnetworkmonitorconfiguration.h" +#include "ui_lxqtnetworkmonitorconfiguration.h" + +extern "C" { +#include +} + +#ifdef __sg_public +// since libstatgrab 0.90 this macro is defined, so we use it for version check +#define STATGRAB_NEWER_THAN_0_90 1 +#endif + +LxQtNetworkMonitorConfiguration::LxQtNetworkMonitorConfiguration(QSettings *settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtNetworkMonitorConfiguration), + mSettings(settings), + mOldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("NetworkMonitorConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + connect(ui->iconCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->interfaceCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + + loadSettings(); +} + +LxQtNetworkMonitorConfiguration::~LxQtNetworkMonitorConfiguration() +{ + delete ui; +} + +void LxQtNetworkMonitorConfiguration::saveSettings() +{ + mSettings->setValue("icon", ui->iconCB->currentIndex()); + mSettings->setValue("interface", ui->interfaceCB->currentText()); +} + +void LxQtNetworkMonitorConfiguration::loadSettings() +{ + ui->iconCB->setCurrentIndex(mSettings->value("icon", 1).toInt()); + + int count; +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t ret_count; + sg_network_iface_stats* stats = sg_get_network_iface_stats(&ret_count); + count = (int)ret_count; +#else + sg_network_iface_stats* stats = sg_get_network_iface_stats(&count); +#endif + for (int ix = 0; ix < count; ix++) + ui->interfaceCB->addItem(stats[ix].interface_name); + + QString interface = mSettings->value("interface").toString(); + ui->interfaceCB->setCurrentIndex(qMax(qMin(0, count - 1), ui->interfaceCB->findText(interface))); +} + +void LxQtNetworkMonitorConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.h b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.h new file mode 100644 index 0000000..cc33359 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTNETWORKMONITORCONFIGURATION_H +#define LXQTNETWORKMONITORCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui +{ +class LxQtNetworkMonitorConfiguration; +} + +class LxQtNetworkMonitorConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtNetworkMonitorConfiguration(QSettings *settings, QWidget *parent = 0); + ~LxQtNetworkMonitorConfiguration(); + +private: + Ui::LxQtNetworkMonitorConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + +private slots: + /* + Saves settings in conf file. + */ + void saveSettings(); + void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); +}; + +#endif // LXQTNETWORKMONITORCONFIGURATION_H diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.ui b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.ui new file mode 100644 index 0000000..a8099a9 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorconfiguration.ui @@ -0,0 +1,131 @@ + + + LxQtNetworkMonitorConfiguration + + + + 0 + 0 + 285 + 191 + + + + Network Monitor settings + + + + + + General + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + false + + + + + + Interface + + + + + + + + 0 + 0 + + + + true + + + + + + + + Modem + + + + :/images/knemo-modem-idle.png:/images/knemo-modem-idle.png + + + + + Monitor + + + + :/images/knemo-monitor-idle.png:/images/knemo-monitor-idle.png + + + + + Network + + + + :/images/knemo-network-idle.png:/images/knemo-network-idle.png + + + + + Wireless + + + + :/images/knemo-wireless-idle.png:/images/knemo-wireless-idle.png + + + + + + + + Icon + + + + + + + + + + Qt::Vertical + + + + 20 + 41 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + + diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp new file mode 100644 index 0000000..ef73086 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtnetworkmonitorplugin.h" +#include "lxqtnetworkmonitor.h" +#include "lxqtnetworkmonitorconfiguration.h" + +LxQtNetworkMonitorPlugin::LxQtNetworkMonitorPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mWidget(new LxQtNetworkMonitor(this)) +{ +} + +LxQtNetworkMonitorPlugin::~LxQtNetworkMonitorPlugin() +{ + delete mWidget; +} + +QWidget *LxQtNetworkMonitorPlugin::widget() +{ + return mWidget; +} + +QDialog *LxQtNetworkMonitorPlugin::configureDialog() +{ + return new LxQtNetworkMonitorConfiguration(settings()); +} + +void LxQtNetworkMonitorPlugin::settingsChanged() +{ + mWidget->settingsChanged(); +} diff --git a/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.h b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.h new file mode 100644 index 0000000..3441d60 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/lxqtnetworkmonitorplugin.h @@ -0,0 +1,72 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTNETWORKMONITORPLUGIN_H +#define LXQTNETWORKMONITORPLUGIN_H + + +#include "../panel/ilxqtpanelplugin.h" +#include +class LxQtNetworkMonitor; + +class LxQtNetworkMonitorPlugin: public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + explicit LxQtNetworkMonitorPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtNetworkMonitorPlugin(); + + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } + virtual QWidget *widget(); + virtual QString themeId() const { return "NetworkMonitor"; } + + bool isSeparate() const { return false; } + QDialog *configureDialog(); + +protected: + virtual void settingsChanged(); + +private: + LxQtNetworkMonitor *mWidget; +}; + + +class LxQtNetworkMonitorPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtNetworkMonitorPlugin(startupInfo); + } +}; + + +#endif // LXQTNETWORKMONITORPLUGIN_H diff --git a/lxqt-panel/plugin-networkmonitor/resources.qrc b/lxqt-panel/plugin-networkmonitor/resources.qrc new file mode 100644 index 0000000..4d19407 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/resources.qrc @@ -0,0 +1,28 @@ + + + images/knemo-modem-error.png + images/knemo-modem-idle.png + images/knemo-modem-offline.png + images/knemo-modem-receive.png + images/knemo-modem-transmit-receive.png + images/knemo-modem-transmit.png + images/knemo-monitor-error.png + images/knemo-monitor-idle.png + images/knemo-monitor-offline.png + images/knemo-monitor-receive.png + images/knemo-monitor-transmit-receive.png + images/knemo-monitor-transmit.png + images/knemo-network-error.png + images/knemo-network-idle.png + images/knemo-network-offline.png + images/knemo-network-receive.png + images/knemo-network-transmit-receive.png + images/knemo-network-transmit.png + images/knemo-wireless-error.png + images/knemo-wireless-idle.png + images/knemo-wireless-offline.png + images/knemo-wireless-receive.png + images/knemo-wireless-transmit-receive.png + images/knemo-wireless-transmit.png + + diff --git a/lxqt-panel/plugin-networkmonitor/resources/networkmonitor.desktop.in b/lxqt-panel/plugin-networkmonitor/resources/networkmonitor.desktop.in new file mode 100644 index 0000000..c7c66b8 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/resources/networkmonitor.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Network monitor +Comment=Displays network status and activity. +#Icon=network-transmit-receive +Icon=network-wired + diff --git a/plugin-networkmonitor/translations/networkmonitor_fr_FR.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor.ts similarity index 97% rename from plugin-networkmonitor/translations/networkmonitor_fr_FR.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor.ts index 6df90db..887671c 100644 --- a/plugin-networkmonitor/translations/networkmonitor_fr_FR.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor.ts @@ -1,6 +1,6 @@ - + LxQtNetworkMonitor @@ -59,7 +59,7 @@ General - Généraux + diff --git a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.desktop similarity index 67% rename from plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.desktop index f07fba7..4f23ddf 100644 --- a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[cs_CZ]=Nastavení LxQtu -Name[cs_CZ]=Nastavit moduly LXDE-Qt +Name[cs]=Monitor sítě +Comment[cs]=Zobrazuje stav a aktivity sítě diff --git a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.ts index a5213ba..5ae0a10 100644 --- a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_cs.ts @@ -1,6 +1,6 @@ - + LxQtNetworkMonitor diff --git a/plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_da.desktop similarity index 69% rename from plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_da.desktop index 984118b..2df29fe 100644 --- a/plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_da.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[fr_FR]=Bloc-notes -Name[fr_FR]=Bloc-notes de l'écran +Comment[da]=Netværksovervågning +Name[da]=Netværksovervågning diff --git a/plugin-networkmonitor/translations/networkmonitor_da_DK.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_da.ts similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_da_DK.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_da.ts diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.desktop new file mode 100644 index 0000000..ba549f3 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Netzwerkmonitor +Comment[de]=Informationen zu Status und Aktivität des Netzwerks diff --git a/plugin-networkmonitor/translations/networkmonitor_de_DE.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.ts similarity index 87% rename from plugin-networkmonitor/translations/networkmonitor_de_DE.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.ts index 602c7b3..a128522 100644 --- a/plugin-networkmonitor/translations/networkmonitor_de_DE.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_de.ts @@ -1,12 +1,12 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - Netzwerk Schnittstelle <b>%1</b> + Netzwerkschnittstelle <b>%1</b> @@ -51,14 +51,10 @@ LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - LxQt Netzwerk Monitor Einstellungen - Network Monitor settings - + Netzwerkmonitor-Einstellungen @@ -78,7 +74,7 @@ Monitor - Monitor + Bildschirm @@ -93,7 +89,7 @@ Icon - Icon + Symbol diff --git a/plugin-networkmonitor/translations/networkmonitor_el_GR.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_el.desktop similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_el_GR.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_el.desktop diff --git a/plugin-networkmonitor/translations/networkmonitor_el_GR.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_el.ts similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_el_GR.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_el.ts diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.desktop new file mode 100644 index 0000000..36c540d --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[eo]=Ret-observilo +Comment[eo]=Elmontras ret-staton kaj -aktivecon diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.ts new file mode 100644 index 0000000..a6fc9fa --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eo.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Reta interfaco <b>%1</b> + + + + Transmitted %1 + Sendita %1 + + + + Received %1 + Ricevita %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Agordoj por ret-observilo + + + + General + Ĝenerala + + + + Interface + Interfaco + + + + Modem + Modemo + + + + Monitor + Observilo + + + + Network + Reto + + + + Wireless + Sendrata + + + + Icon + Bildsimbolo + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.desktop new file mode 100644 index 0000000..5352d05 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[es]=Despliega el estado y actividades de la red. +Name[es]=Monitor de redes diff --git a/plugin-networkmonitor/translations/networkmonitor_es_VE.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.ts similarity index 85% rename from plugin-networkmonitor/translations/networkmonitor_es_VE.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.ts index 072a71a..6e06b39 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es_VE.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_es.ts @@ -1,22 +1,22 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - interfaz de red <b>%1</b> + Interfaz de red <b>%1</b> Transmitted %1 - Transmitido %1 + Transmitidos %1 Received %1 - Recivido %1 + Recibidos %1 @@ -53,12 +53,12 @@ LxQtNetworkMonitorConfiguration LxQt Network Monitor settings - Preferencias de LxQt Monitores de red + Configuración del monitor de redes de LxQt Network Monitor settings - + Configuración del monitor de redes @@ -68,12 +68,12 @@ Interface - Interface + Interfaz Modem - Modem + Módem @@ -88,7 +88,7 @@ Wireless - Wireless + Conexión inalámbrica diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.desktop new file mode 100644 index 0000000..d608863 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[eu]=Bistaratu sarearen egoera eta aktibitatea +Name[eu]=Sarearen monitorea diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.ts new file mode 100644 index 0000000..2782b44 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_eu.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + <b>%1</b> sareko interfazea + + + + Transmitted %1 + %1 transmitituta + + + + Received %1 + %1 jasota + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + LxQt sarearen monitorearen ezarpenak + + + + Network Monitor settings + + + + + General + Orokorra + + + + Interface + Interfazea + + + + Modem + Modema + + + + Monitor + Monitorea + + + + Network + Sarea + + + + Wireless + Hari gabekoa + + + + Icon + Ikonoa + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_lt.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.desktop similarity index 72% rename from plugin-networkmonitor/translations/networkmonitor_lt.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.desktop index c04f905..4d98c3a 100644 --- a/plugin-networkmonitor/translations/networkmonitor_lt.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[lt]=Qlipper -Name[lt]="Sveikas pasauli" priedas +Comment[fi]=Verkkoseuranta +Name[fi]=Verkkoseuranta diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.ts new file mode 100644 index 0000000..4ac5f01 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fi.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Verkkoliitäntä <b>%1</b> + + + + Transmitted %1 + Siirretty %1 + + + + Received %1 + Vastaanotettu %1 + + + + B + t + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + LxQtin verkonhallinnan asetukset + + + + Network Monitor settings + + + + + General + Yleiset + + + + Interface + Liitäntä + + + + Modem + Modeemi + + + + Monitor + + + + + Network + Verkko + + + + Wireless + Langaton + + + + Icon + Kuvake + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.desktop new file mode 100644 index 0000000..5d2d242 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.desktop @@ -0,0 +1,3 @@ +# Translations +Name[fr_FR]=Moniteur Réseau +Comment[fr_FR]=Affiche le statut et l'activité du réseau diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.ts new file mode 100644 index 0000000..3171548 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_fr.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interface réseau <b>%1</b> + + + + Transmitted %1 + Transmis %1 + + + + Received %1 + Reçu %1 + + + + B + o + + + + KiB + Ko + + + + MiB + Mo + + + + GiB + Go + + + + TiB + To + + + + PiB + Po + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Paramètres du moniteur réseau + + + + General + Généraux + + + + Interface + Interface + + + + Modem + Modem + + + + Monitor + Moniteur + + + + Network + Réseau + + + + Wireless + Sans-Fil + + + + Icon + Icône + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_ar.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hr.ts similarity index 71% rename from plugin-networkmonitor/translations/networkmonitor_ar.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hr.ts index 89c67af..e0bd49b 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ar.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hr.ts @@ -1,12 +1,12 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - + Mrežno sučelje <b>%1</b> @@ -16,37 +16,37 @@ Received %1 - + Primljeno %1 B - + B KiB - + KiB MiB - + MiB GiB - + GiB TiB - + TiB PiB - + PiB @@ -54,42 +54,42 @@ Network Monitor settings - + Postavke nadzora mreže General - العامّ + Općenito Interface - + Sučelje Modem - + Modem Monitor - + Nadzor Network - + Mreža Wireless - + Bežično Icon - + Ikona diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.desktop new file mode 100644 index 0000000..694cf7f --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[hu]=Alkalmazásindító alapú menü +Comment[hu]=Alkalmazásmenü diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.ts new file mode 100644 index 0000000..b910bf5 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_hu.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Hálózati eszköz <b>%1</b> + + + + Transmitted %1 + Küldött %1 + + + + Received %1 + Fogadott %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + Tib + + + + PiB + Pib + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Hálózatfigyelő beállítás + + + + General + Általános + + + + Interface + Eszköz + + + + Modem + + + + + Monitor + + + + + Network + Hálózat + + + + Wireless + + + + + Icon + Ikon + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.desktop new file mode 100644 index 0000000..d3e6e88 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[it]=Monitor di rete +Comment[it]=Mostra stato e attività della rete diff --git a/plugin-networkmonitor/translations/networkmonitor_it_IT.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_it_IT.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.ts index c4e7ee6..90dfa3a 100644 --- a/plugin-networkmonitor/translations/networkmonitor_it_IT.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_it.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Impostazioni del monitor di rete diff --git a/plugin-networkmonitor/translations/networkmonitor_ar.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.desktop similarity index 56% rename from plugin-networkmonitor/translations/networkmonitor_ar.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.desktop index a601163..014ab5f 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ar.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[ar]=قائمة التطبيقات -Name[ar]=تهيئة وحدة جلسة ريزركيوت +Comment[ja]=ネットワークの状態や動作状況を表示します +Name[ja]=ネットワークモニター diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.ts new file mode 100644 index 0000000..1321b80 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ja.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + ネットワークインターフェース <b>%1</b> + + + + Transmitted %1 + 送信 %1 + + + + Received %1 + 受信 %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + ネットワークモニターの設定 + + + + General + 一般 + + + + Interface + インターフェース + + + + Modem + モデム + + + + Monitor + モニター + + + + Network + ネットワーク + + + + Wireless + 無線 + + + + Icon + アイコン + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.desktop new file mode 100644 index 0000000..a53f431 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[nl]=Netwerkmonitor +Comment[nl]=Toont netwerkstatus en -activiteit diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.ts new file mode 100644 index 0000000..da59450 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_nl.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Netwerkkaart <b>%1</b> + + + + Transmitted %1 + Verstuurd %1 + + + + Received %1 + Ontvangen %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Instellingen voor Netwerkbewaker van LxQt + + + + Network Monitor settings + Netwerkmonitorinstellingen + + + + General + Algemeen + + + + Interface + Netwerkkaart + + + + Modem + Modem + + + + Monitor + Bewaker + + + + Network + Netwerk + + + + Wireless + Draadloos + + + + Icon + Pictogram + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.desktop new file mode 100644 index 0000000..90348bf --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LXQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[pl]=monitor sieci +Comment[pl]=pokazuje stan i aktywność sieci. diff --git a/plugin-networkmonitor/translations/networkmonitor_pl_PL.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_pl_PL.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.ts index 073b64d..e402658 100644 --- a/plugin-networkmonitor/translations/networkmonitor_pl_PL.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pl.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Ustawienia monitora sieci diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.desktop new file mode 100644 index 0000000..be90c44 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Network monitor +Comment=Displays network status and activity. + +# Translations +Name[pt]=Monitor de rede +Comment[pt]=Mostrar estado e atividade da rede diff --git a/plugin-networkmonitor/translations/networkmonitor_sl.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.ts similarity index 83% rename from plugin-networkmonitor/translations/networkmonitor_sl.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.ts index 53a37e1..36ad1dd 100644 --- a/plugin-networkmonitor/translations/networkmonitor_sl.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt.ts @@ -1,22 +1,22 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - Omrežni vmesnik <b>%1</b> + Interface de rede <b>%1</b> Transmitted %1 - Poslano: %1 + Enviados %1 Received %1 - Prejeto: %1 + Recebidos %1 @@ -53,7 +53,7 @@ LxQtNetworkMonitorConfiguration LxQt Network Monitor settings - Nastavitve nadzornika omrežja LXQt + Definições do monitor de rede do LxQt @@ -63,12 +63,12 @@ General - Splošno + Geral Interface - Vmesnik + Interface @@ -78,22 +78,22 @@ Monitor - Zaslon + Monitorizar Network - Omrežje + Rede Wireless - Brezžično + Rede sem fios Icon - Ikona + Ícone diff --git a/plugin-networkmonitor/translations/networkmonitor_da_DK.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.desktop similarity index 65% rename from plugin-networkmonitor/translations/networkmonitor_da_DK.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.desktop index 0ccac82..8b6016a 100644 --- a/plugin-networkmonitor/translations/networkmonitor_da_DK.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[da_DK]=Netværksovervågning -Name[da_DK]=Netværksovervågning +Name[pt_BR]=Monitor de Rede +Comment[pt_BR]=Mostra atividade e estado da rede diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.ts new file mode 100644 index 0000000..973dabd --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_pt_BR.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interface de rede <b>%1</b> + + + + Transmitted %1 + Transmitido %1 + + + + Received %1 + Recebido %1 + + + + B + Byte + + + + KiB + KByte + + + + MiB + MByte + + + + GiB + GByte + + + + TiB + TByte + + + + PiB + PByte + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Configurações de Monitoramento de Rede + + + + Network Monitor settings + + + + + General + Geral + + + + Interface + Interface + + + + Modem + Modem + + + + Monitor + Monitoramento + + + + Network + Rede + + + + Wireless + Sem fio + + + + Icon + Ícone + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop new file mode 100644 index 0000000..d98d904 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[ro_RO]=Afisează starea și activitatea rețelei +Name[ro_RO]=Monitor rețea diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts new file mode 100644 index 0000000..e3d019f --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interfață rețea <b>%1</b> + + + + Transmitted %1 + Transmis %1 + + + + Received %1 + Recepționat %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Setări monitorizare rețea LxQt + + + + Network Monitor settings + Setări monitorizare rețea + + + + General + General + + + + Interface + Interfață + + + + Modem + Modem + + + + Monitor + Monitorizare + + + + Network + Rețea + + + + Wireless + Wireless + + + + Icon + Pictogramă + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.desktop new file mode 100644 index 0000000..d37c566 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[ru]=Отображает сетевой статус и активность. +Name[ru]=Сетевой Монитор \ No newline at end of file diff --git a/plugin-networkmonitor/translations/networkmonitor_ru_RU.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_ru_RU.ts rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.ts index 070c0d0..3afc49d 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ru_RU.ts +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_ru.ts @@ -1,6 +1,6 @@ - + LxQtNetworkMonitor diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_sr@latin.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_sr@latin.desktop new file mode 100644 index 0000000..e0573b1 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_sr@latin.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[sr@latin]=Automatsko suspendovanje +Name[sr@latin]=Meni pokretača programa diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.desktop new file mode 100644 index 0000000..84ef080 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[th_TH]=เฝ้าสังเกตเครือข่าย +Name[th_TH]=เฝ้าสังเกตเครือข่าย diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.ts new file mode 100644 index 0000000..303ed5e --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_th_TH.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + ส่วนติดต่อเครือข่าย <b>%1</b> + + + + Transmitted %1 + ส่ง %1 + + + + Received %1 + รับ %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + ค่าตั้งการเฝ้าสังเกตเครือข่าย LxQt + + + + Network Monitor settings + + + + + General + ทั่วไป + + + + Interface + ส่วนติดต่อ + + + + Modem + โมเด็ม + + + + Monitor + เฝ้าสังเกต + + + + Network + เครือข่าย + + + + Wireless + ไรัสาย + + + + Icon + ไอคอน + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_sl.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.desktop similarity index 68% rename from plugin-networkmonitor/translations/networkmonitor_sl.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.desktop index 510b1b9..db2f801 100644 --- a/plugin-networkmonitor/translations/networkmonitor_sl.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[sl]=Nadzornik omrežja -Name[sl]=Nadzornik omrežja +Name[tr]=Ağ izleme +Comment[tr]=Ağ iletişimi izleme ve yönetme diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.ts new file mode 100644 index 0000000..903d363 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_tr.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Ağ arayüzü <b>%1</b> + + + + Transmitted %1 + Gönderilen %1 + + + + Received %1 + Alınan %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + LxQt Ağ İzleme ayarları + + + + Network Monitor settings + Ağ İzleme Ayarları + + + + General + Genel + + + + Interface + Arayüz + + + + Modem + Modem + + + + Monitor + Ekran + + + + Network + + + + + Wireless + Kablosuz + + + + Icon + Simge + + + diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.desktop new file mode 100644 index 0000000..d6c29ea --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[uk]=Показує стан та активність мережі. +Name[uk]=Монітор мережі diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.ts new file mode 100644 index 0000000..ba0ddb1 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_uk.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Мережевий адаптер <b>%1</b> + + + + Transmitted %1 + Передано %1 + + + + Received %1 + Прийнято %1 + + + + B + Б + + + + KiB + КіБ + + + + MiB + МіБ + + + + GiB + ГіБ + + + + TiB + ТіБ + + + + PiB + ПіБ + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Налаштування монітору мережі LxQt + + + + Network Monitor settings + + + + + General + Загальне + + + + Interface + Адаптер + + + + Modem + Модем + + + + Monitor + Монітор + + + + Network + Мережевий + + + + Wireless + Бездротовий + + + + Icon + Значок + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_es_VE.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.desktop similarity index 71% rename from plugin-networkmonitor/translations/networkmonitor_es_VE.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.desktop index 7fe4c8e..02fa825 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es_VE.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[es_VE]=Monitor de red -Name[es_VE]=Monitor de red +Comment[zh_CN]=qxkb +Name[zh_CN]=屏幕记事本 diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.ts new file mode 100644 index 0000000..5d06789 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_CN.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + 网络接口 <b>%1</b> + + + + Transmitted %1 + 已传输 %1 + + + + Received %1 + 已接收 %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + TiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + LxQt 网络监测器设置 + + + + Network Monitor settings + + + + + General + 常规 + + + + Interface + 接口 + + + + Modem + 调制解调器 + + + + Monitor + 监测器 + + + + Network + 网络 + + + + Wireless + 无线 + + + + Icon + 图标 + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_id_ID.desktop b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.desktop similarity index 66% rename from plugin-networkmonitor/translations/networkmonitor_id_ID.desktop rename to lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.desktop index 9674b64..a15014c 100644 --- a/plugin-networkmonitor/translations/networkmonitor_id_ID.desktop +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.desktop @@ -6,8 +6,6 @@ Name=Network monitor Comment=Displays network status and activity. - - # Translations -Comment[id_ID]=Hell World -Name[id_ID]=Sebuah Plugin "hello world". +Comment[zh_TW]=網路監視器 +Name[zh_TW]=顯示網路狀態和活動 diff --git a/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.ts b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.ts new file mode 100644 index 0000000..4fbb505 --- /dev/null +++ b/lxqt-panel/plugin-networkmonitor/translations/networkmonitor_zh_TW.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + 網路介面 <b>%1</b> + + + + Transmitted %1 + 傳送 %1 + + + + Received %1 + 接收 %1 + + + + B + B + + + + KiB + KB + + + + MiB + MB + + + + GiB + GB + + + + TiB + TB + + + + PiB + PB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + LxQt網路監視器設定 + + + + Network Monitor settings + + + + + General + 一般 + + + + Interface + 介面 + + + + Modem + 數據機 + + + + Monitor + 監視器 + + + + Network + 網路 + + + + Wireless + 無線 + + + + Icon + 圖示 + + + diff --git a/lxqt-panel/plugin-quicklaunch/CMakeLists.txt b/lxqt-panel/plugin-quicklaunch/CMakeLists.txt new file mode 100644 index 0000000..dd48bcf --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/CMakeLists.txt @@ -0,0 +1,26 @@ +set(PLUGIN "quicklaunch") + +set(HEADERS + lxqtquicklaunchplugin.h + lxqtquicklaunch.h + quicklaunchbutton.h + quicklaunchaction.h +) + +set(SOURCES + lxqtquicklaunchplugin.cpp + lxqtquicklaunch.cpp + quicklaunchbutton.cpp + quicklaunchaction.cpp +) + +set(LIBRARIES + Qt5Xdg +) + +include_directories( + ${LXQT_INCLUDE_DIRS} + "${CMAKE_CURRENT_SOURCE_DIR}/../panel" +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.cpp b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.cpp new file mode 100644 index 0000000..9a8c917 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.cpp @@ -0,0 +1,331 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2012 Razor team + * Authors: + * Petr Vanek + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtquicklaunch.h" +#include "quicklaunchbutton.h" +#include "quicklaunchaction.h" +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +LxQtQuickLaunch::LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent) : + QFrame(parent), + mPlugin(plugin), + mPlaceHolder(0) +{ + setAcceptDrops(true); + + mLayout = new LxQt::GridLayout(this); + setLayout(mLayout); + + QSettings *settings = mPlugin->settings(); + int count = settings->beginReadArray("apps"); + + QString desktop; + QString file; + QString execname; + QString exec; + QString icon; + for (int i = 0; i < count; ++i) + { + settings->setArrayIndex(i); + desktop = settings->value("desktop", "").toString(); + file = settings->value("file", "").toString(); + if (! desktop.isEmpty()) + { + XdgDesktopFile xdg; + if (!xdg.load(desktop)) + { + qDebug() << "XdgDesktopFile" << desktop << "is not valid"; + continue; + } + if (!xdg.isSuitable()) + { + qDebug() << "XdgDesktopFile" << desktop << "is not applicable"; + continue; + } + + addButton(new QuickLaunchAction(&xdg, this)); + } + else if (! file.isEmpty()) + { + addButton(new QuickLaunchAction(file, this)); + } + else + { + execname = settings->value("name", "").toString(); + exec = settings->value("exec", "").toString(); + icon = settings->value("icon", "").toString(); + if (icon.isNull()) + { + qDebug() << "Icon" << icon << "is not valid (isNull). Skipped."; + continue; + } + addButton(new QuickLaunchAction(execname, exec, icon, this)); + } + } // for + + settings->endArray(); + + if (mLayout->isEmpty()) + showPlaceHolder(); + + realign(); +} + + +LxQtQuickLaunch::~LxQtQuickLaunch() +{ +} + + +int LxQtQuickLaunch::indexOfButton(QuickLaunchButton* button) const +{ + return mLayout->indexOf(button); +} + + +int LxQtQuickLaunch::countOfButtons() const +{ + return mLayout->count(); +} + + +void LxQtQuickLaunch::realign() +{ + mLayout->setEnabled(false); + ILxQtPanel *panel = mPlugin->panel(); + + if (mPlaceHolder) + { + mLayout->setColumnCount(1); + mLayout->setRowCount(1); + } + else + { + if (panel->isHorizontal()) + { + mLayout->setRowCount(panel->lineCount()); + mLayout->setColumnCount(0); + } + else + { + mLayout->setColumnCount(panel->lineCount()); + mLayout->setRowCount(0); + } + } + mLayout->setEnabled(true); +} + + +void LxQtQuickLaunch::addButton(QuickLaunchAction* action) +{ + mLayout->setEnabled(false); + QuickLaunchButton* btn = new QuickLaunchButton(action, this); + mLayout->addWidget(btn); + + connect(btn, SIGNAL(switchButtons(QuickLaunchButton*,QuickLaunchButton*)), this, SLOT(switchButtons(QuickLaunchButton*,QuickLaunchButton*))); + connect(btn, SIGNAL(buttonDeleted()), this, SLOT(buttonDeleted())); + connect(btn, SIGNAL(movedLeft()), this, SLOT(buttonMoveLeft())); + connect(btn, SIGNAL(movedRight()), this, SLOT(buttonMoveRight())); + + mLayout->removeWidget(mPlaceHolder); + delete mPlaceHolder; + mPlaceHolder = 0; + mLayout->setEnabled(true); + realign(); +} + + +void LxQtQuickLaunch::dragEnterEvent(QDragEnterEvent *e) +{ + // Getting URL from mainmenu... + if (e->mimeData()->hasUrls()) + { + e->acceptProposedAction(); + return; + } + + if (e->source() && e->source()->parent() == this) + { + e->acceptProposedAction(); + } +} + + +void LxQtQuickLaunch::dropEvent(QDropEvent *e) +{ + const QMimeData *mime = e->mimeData(); + + foreach (QUrl url, mime->urls().toSet()) + { + QString fileName(url.isLocalFile() ? url.toLocalFile() : url.url()); + QFileInfo fi(fileName); + XdgDesktopFile xdg; + + if (xdg.load(fileName)) + { + if (xdg.isSuitable()) + addButton(new QuickLaunchAction(&xdg, this)); + } + else if (fi.exists() && fi.isExecutable() && !fi.isDir()) + { + addButton(new QuickLaunchAction(fileName, fileName, "", this)); + } + else if (fi.exists()) + { + addButton(new QuickLaunchAction(fileName, this)); + } + else + { + qWarning() << "XdgDesktopFile" << fileName << "is not valid"; + QMessageBox::information(this, tr("Drop Error"), + tr("File/URL '%1' cannot be embedded into QuickLaunch for now").arg(fileName) + ); + } + } + saveSettings(); +} + +void LxQtQuickLaunch::switchButtons(QuickLaunchButton *button1, QuickLaunchButton *button2) +{ + if (button1 == button2) + return; + + int n1 = mLayout->indexOf(button1); + int n2 = mLayout->indexOf(button2); + + int l = qMin(n1, n2); + int m = qMax(n1, n2); + + mLayout->moveItem(l, m); + mLayout->moveItem(m-1, l); + saveSettings(); +} + + +void LxQtQuickLaunch::buttonDeleted() +{ + QuickLaunchButton *btn = qobject_cast(sender()); + if (!btn) + return; + + mLayout->removeWidget(btn); + btn->deleteLater(); + saveSettings(); + + if (mLayout->isEmpty()) + showPlaceHolder(); + + realign(); +} + + +void LxQtQuickLaunch::buttonMoveLeft() +{ + QuickLaunchButton *btn = qobject_cast(sender()); + if (!btn) + return; + + int index = indexOfButton(btn); + if (index > 0) + { + mLayout->moveItem(index, index - 1); + saveSettings(); + } +} + + +void LxQtQuickLaunch::buttonMoveRight() +{ + QuickLaunchButton *btn1 = qobject_cast(sender()); + if (!btn1) + return; + + int index = indexOfButton(btn1); + if (index < countOfButtons() - 1) + { + mLayout->moveItem(index, index + 1); + saveSettings(); + } +} + + +void LxQtQuickLaunch::saveSettings() +{ + QSettings *settings = mPlugin->settings(); + settings->remove("apps"); + settings->beginWriteArray("apps"); + int i = 0; + + for(int j=0; jcount(); ++j) + { + QuickLaunchButton *b = qobject_cast(mLayout->itemAt(j)->widget()); + if(!b) + continue; + + settings->setArrayIndex(i); + + QHashIterator it(b->settingsMap()); + while (it.hasNext()) + { + it.next(); + settings->setValue(it.key(), it.value()); + } + + ++i; + } + + settings->endArray(); +} + + +void LxQtQuickLaunch::showPlaceHolder() +{ + if (!mPlaceHolder) + { + mPlaceHolder = new QLabel(this); + mPlaceHolder->setAlignment(Qt::AlignCenter); + mPlaceHolder->setObjectName("QuickLaunchPlaceHolder"); + mPlaceHolder->setText(tr("Drop application\nicons here")); + } + + mLayout->addWidget(mPlaceHolder); +} diff --git a/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.h b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.h new file mode 100644 index 0000000..624c428 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunch.h @@ -0,0 +1,85 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2012 Razor team + * Authors: + * Petr Vanek + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTQUICKLAUNCH_H +#define LXQTQUICKLAUNCH_H + +#include "../panel/lxqtpanel.h" +#include +#include + + +class XdgDesktopFile; +class QuickLaunchAction; +class QDragEnterEvent; +class QuickLaunchButton; +class QSettings; +class QLabel; + +namespace LxQt { +class GridLayout; +} + + +/*! \brief Loader for "quick launcher" icons in the panel. +\author Petr Vanek +*/ +class LxQtQuickLaunch : public QFrame +{ + Q_OBJECT + +public: + LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~LxQtQuickLaunch(); + + int indexOfButton(QuickLaunchButton* button) const; + int countOfButtons() const; + + void realign(); + +private: + LxQt::GridLayout *mLayout; + ILxQtPanelPlugin *mPlugin; + QLabel *mPlaceHolder; + + void dragEnterEvent(QDragEnterEvent *e); + void dropEvent(QDropEvent *e); + + void saveSettings(); + void showPlaceHolder(); + +private slots: + void addButton(QuickLaunchAction* action); + void switchButtons(QuickLaunchButton *button1, QuickLaunchButton *button2); + void buttonDeleted(); + void buttonMoveLeft(); + void buttonMoveRight(); +}; + +#endif diff --git a/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.cpp b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.cpp new file mode 100644 index 0000000..2242eec --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.cpp @@ -0,0 +1,52 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtquicklaunchplugin.h" +#include "lxqtquicklaunch.h" + + +LxQtQuickLaunchPlugin::LxQtQuickLaunchPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mWidget(new LxQtQuickLaunch(this)) +{ +} + +LxQtQuickLaunchPlugin::~LxQtQuickLaunchPlugin() +{ + delete mWidget; +} + +QWidget *LxQtQuickLaunchPlugin::widget() +{ + return mWidget; +} + +void LxQtQuickLaunchPlugin::realign() +{ + mWidget->realign(); +} diff --git a/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.h b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.h new file mode 100644 index 0000000..88c7a3b --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/lxqtquicklaunchplugin.h @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTQUICKLAUNCHPLUGIN_H +#define LXQTQUICKLAUNCHPLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class LxQtQuickLaunch; + +class LxQtQuickLaunchPlugin: public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + explicit LxQtQuickLaunchPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtQuickLaunchPlugin(); + + virtual QWidget *widget(); + virtual QString themeId() const { return "QuickLaunch"; } + virtual Flags flags() const { return NeedsHandle; } + + void realign(); + + bool isSeparate() const { return true; } + +private: + LxQtQuickLaunch *mWidget; +}; + + +class LxQtQuickLaunchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtQuickLaunchPlugin(startupInfo); + } +}; +#endif // LXQTQUICKLAUNCHPLUGIN_H diff --git a/lxqt-panel/plugin-quicklaunch/quicklaunchaction.cpp b/lxqt-panel/plugin-quicklaunch/quicklaunchaction.cpp new file mode 100644 index 0000000..3b6e821 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/quicklaunchaction.cpp @@ -0,0 +1,129 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "quicklaunchaction.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +QuickLaunchAction::QuickLaunchAction(const QString & name, + const QString & exec, + const QString & icon, + QWidget * parent) + : QAction(name, parent), + m_valid(true) +{ + m_type = ActionLegacy; + + m_settingsMap["name"] = name; + m_settingsMap["exec"] = exec; + m_settingsMap["icon"] = icon; + + if (icon == "" || icon.isNull()) + setIcon(XdgIcon::defaultApplicationIcon()); + else + setIcon(QIcon(icon)); + + setData(exec); + connect(this, SIGNAL(triggered()), this, SLOT(execAction())); +} + +QuickLaunchAction::QuickLaunchAction(const XdgDesktopFile * xdg, + QWidget * parent) + : QAction(parent), + m_valid(true) +{ + m_type = ActionXdg; + + m_settingsMap["desktop"] = xdg->fileName(); + + QString title(xdg->localizedValue("Name").toString()); + QString gn(xdg->localizedValue("GenericName").toString()); + if (!gn.isEmpty()) + title += " (" + gn + ")"; + setText(title); + + setIcon(xdg->icon(XdgIcon::defaultApplicationIcon())); + + setData(xdg->fileName()); + connect(this, SIGNAL(triggered()), this, SLOT(execAction())); +} + +QuickLaunchAction::QuickLaunchAction(const QString & fileName, QWidget * parent) + : QAction(parent), + m_valid(true) +{ + m_type = ActionFile; + setText(fileName); + setData(fileName); + + m_settingsMap["file"] = fileName; + + QFileInfo fi(fileName); + if (fi.isDir()) + { + QFileIconProvider ip; + setIcon(ip.icon(fi)); + } + else + { + QMimeDatabase db; + XdgMimeType mi(db.mimeTypeForFile(fi)); + setIcon(mi.icon()); + } + + connect(this, SIGNAL(triggered()), this, SLOT(execAction())); +} + +void QuickLaunchAction::execAction() +{ + QString exec(data().toString()); + qDebug() << "execAction" << exec; + switch (m_type) + { + case ActionLegacy: + QProcess::startDetached(exec); + break; + case ActionXdg: + { + XdgDesktopFile xdg; + if(xdg.load(exec)) + xdg.startDetached(); + break; + } + case ActionFile: + QDesktopServices::openUrl(QUrl(exec)); + break; + } +} diff --git a/lxqt-panel/plugin-quicklaunch/quicklaunchaction.h b/lxqt-panel/plugin-quicklaunch/quicklaunchaction.h new file mode 100644 index 0000000..423850c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/quicklaunchaction.h @@ -0,0 +1,80 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef QUICKLAUNCHACTION_H +#define QUICKLAUNCHACTION_H + +#include + + +class XdgDesktopFile; + + +/*! \brief Special action representation for LxQtQuickLaunch plugin. +It supports XDG desktop files or "legacy" launching of specified apps. +All process management is handled internally. +\author Petr Vanek +*/ +class QuickLaunchAction : public QAction +{ + Q_OBJECT + +public: + /*! Constructor for "legacy" launchers. + \warning The XDG way is preferred this is only for older or non-standard apps + \param name a name to display in tooltip + \param exec a executable with path + \param icon a valid QIcon + */ + QuickLaunchAction(const QString & name, + const QString & exec, + const QString & icon, + QWidget * parent); + /*! Constructor for XDG desktop handlers. + */ + QuickLaunchAction(const XdgDesktopFile * xdg, QWidget * parent); + /*! Constructor for regular files + */ + QuickLaunchAction(const QString & fileName, QWidget * parent); + + //! Returns true if the action is valid (contains all required properties). + bool isValid() { return m_valid; } + + QHash settingsMap() { return m_settingsMap; } + +public slots: + void execAction(); + +private: + enum ActionType { ActionLegacy, ActionXdg, ActionFile }; + ActionType m_type; + QString m_data; + bool m_valid; + QHash m_settingsMap; +}; + +#endif diff --git a/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.cpp b/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.cpp new file mode 100644 index 0000000..7ba8055 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.cpp @@ -0,0 +1,177 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "quicklaunchbutton.h" +#include "lxqtquicklaunch.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define MIMETYPE "x-lxqt/quicklaunch-button" + + +QuickLaunchButton::QuickLaunchButton(QuickLaunchAction * act, QWidget * parent) + : QToolButton(parent), + mAct(act) +{ + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setAcceptDrops(true); + + setDefaultAction(mAct); + mAct->setParent(this); + + mMoveLeftAct = new QAction(XdgIcon::fromTheme("go-previous"), tr("Move left"), this); + connect(mMoveLeftAct, SIGNAL(triggered()), this, SIGNAL(movedLeft())); + + mMoveRightAct = new QAction(XdgIcon::fromTheme("go-next"), tr("Move right"), this); + connect(mMoveRightAct, SIGNAL(triggered()), this, SIGNAL(movedRight())); + + + mDeleteAct = new QAction(XdgIcon::fromTheme("dialog-close"), tr("Remove from quicklaunch"), this); + connect(mDeleteAct, SIGNAL(triggered()), this, SLOT(selfRemove())); + addAction(mDeleteAct); + mMenu = new QMenu(this); + mMenu->addAction(mAct); + mMenu->addSeparator(); + mMenu->addAction(mMoveLeftAct); + mMenu->addAction(mMoveRightAct); + mMenu->addSeparator(); + mMenu->addAction(mDeleteAct); + + + setContextMenuPolicy(Qt::CustomContextMenu); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), + this, SLOT(this_customContextMenuRequested(const QPoint&))); +} + + +QuickLaunchButton::~QuickLaunchButton() +{ + //m_act->deleteLater(); +} + + +QHash QuickLaunchButton::settingsMap() +{ + Q_ASSERT(mAct); + return mAct->settingsMap(); +} + + +void QuickLaunchButton::this_customContextMenuRequested(const QPoint & pos) +{ + LxQtQuickLaunch *panel = qobject_cast(parent()); + + mMoveLeftAct->setEnabled( panel && panel->indexOfButton(this) > 0); + mMoveRightAct->setEnabled(panel && panel->indexOfButton(this) < panel->countOfButtons() - 1); + mMenu->popup(mapToGlobal(pos)); +} + + +void QuickLaunchButton::selfRemove() +{ + emit buttonDeleted(); +} + + +void QuickLaunchButton::paintEvent(QPaintEvent *) +{ + // Do not paint that ugly "has menu" arrow + QStylePainter p(this); + QStyleOptionToolButton opt; + initStyleOption(&opt); + opt.features &= (~ QStyleOptionToolButton::HasMenu); + p.drawComplexControl(QStyle::CC_ToolButton, opt); +} + + +void QuickLaunchButton::mousePressEvent(QMouseEvent *e) +{ + if (e->button() == Qt::LeftButton && e->modifiers() == Qt::ControlModifier) + { + mDragStart = e->pos(); + return; + } + + QToolButton::mousePressEvent(e); +} + + +void QuickLaunchButton::mouseMoveEvent(QMouseEvent *e) +{ + if (!(e->buttons() & Qt::LeftButton)) + { + return; + } + + if ((e->pos() - mDragStart).manhattanLength() < QApplication::startDragDistance()) + { + return; + } + + if (e->modifiers() != Qt::ControlModifier) + { + return; + } + + QDrag *drag = new QDrag(this); + ButtonMimeData *mimeData = new ButtonMimeData(); + mimeData->setButton(this); + drag->setMimeData(mimeData); + + drag->exec(Qt::MoveAction); + + // Icon was droped outside the panel, remove button + if (!drag->target()) + { + selfRemove(); + } +} + + +void QuickLaunchButton::dragMoveEvent(QDragMoveEvent * e) +{ + if (e->mimeData()->hasFormat(MIMETYPE)) + e->acceptProposedAction(); + else + e->ignore(); +} + + +void QuickLaunchButton::dragEnterEvent(QDragEnterEvent *e) +{ + const ButtonMimeData *mimeData = qobject_cast(e->mimeData()); + if (mimeData && mimeData->button()) + { + emit switchButtons(mimeData->button(), this); + } +} diff --git a/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.h b/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.h new file mode 100644 index 0000000..cedaf4c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/quicklaunchbutton.h @@ -0,0 +1,92 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2012 Razor team + * Authors: + * Petr Vanek + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTQUICKLAUNCHBUTTON_H +#define LXQTQUICKLAUNCHBUTTON_H + +#include "quicklaunchaction.h" +#include +#include + + +class QuickLaunchButton : public QToolButton +{ + Q_OBJECT + +public: + QuickLaunchButton(QuickLaunchAction * act, QWidget* parent = 0); + ~QuickLaunchButton(); + + QHash settingsMap(); + +signals: + void buttonDeleted(); + void switchButtons(QuickLaunchButton *from, QuickLaunchButton *to); + void movedLeft(); + void movedRight(); + +protected: + //! Disable that annoying small arrow when there is a menu + virtual void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void dragEnterEvent(QDragEnterEvent *e); + void dragMoveEvent(QDragMoveEvent * e); + +private: + QuickLaunchAction *mAct; + QAction *mDeleteAct; + QAction *mMoveLeftAct; + QAction *mMoveRightAct; + QMenu *mMenu; + QPoint mDragStart; + +private slots: + void this_customContextMenuRequested(const QPoint & pos); + void selfRemove(); +}; + + +class ButtonMimeData: public QMimeData +{ + Q_OBJECT +public: + ButtonMimeData(): + QMimeData(), + mButton(0) + { + } + + QuickLaunchButton *button() const { return mButton; } + void setButton(QuickLaunchButton *button) { mButton = button; } +private: + QuickLaunchButton *mButton; +}; + +#endif diff --git a/lxqt-panel/plugin-quicklaunch/resources/quicklaunch.desktop.in b/lxqt-panel/plugin-quicklaunch/resources/quicklaunch.desktop.in new file mode 100644 index 0000000..f673143 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/resources/quicklaunch.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. +Icon=quickopen + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch.ts new file mode 100644 index 0000000..ca203d4 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + + + + + Move right + + + + + Remove from quicklaunch + + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.desktop new file mode 100644 index 0000000..367b8d2 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=إطلاق تطبيقاتك المفضَّلة +Name[ar]=البدء السريع diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.ts new file mode 100644 index 0000000..90f5092 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ar.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + خطاٌ في النَّقل + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + ﻻ يمكن تضمين الملف أو الرَّابط %1 في لوحة البدء السَّريع حاليَّاً + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + إلى اليسار + + + + Move right + إلى اليمين + + + + Remove from quicklaunch + إزالة من لوحة البدء السَّريع + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.desktop new file mode 100644 index 0000000..9534ad1 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs]=Spouštěte své oblíbené programy +Name[cs]=Rychlé spouštění diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.ts new file mode 100644 index 0000000..078d8a8 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Problém s upuštěním + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Soubor/URL '%1' nyní nelze vložit do rychlého spuštění + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Přesunout vlevo + + + + Move right + Přesunout vpravo + + + + Remove from quicklaunch + Odstranit z rychlého spuštění + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.desktop new file mode 100644 index 0000000..242038f --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Spusťte své oblíbené programy +Name[cs_CZ]=Rychlé spuštění diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts new file mode 100644 index 0000000..1041dde --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Problém s upuštěním + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Soubor/URL '%1' nyní nelze vložit do rychlého spuštění + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Přesunout vlevo + + + + Move right + Přesunout vpravo + + + + Remove from quicklaunch + Odstranit z rychlého spuštění + + + diff --git a/plugin-quicklaunch/translations/quicklaunch_de_DE.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.desktop similarity index 70% rename from plugin-quicklaunch/translations/quicklaunch_de_DE.desktop rename to lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.desktop index ea06f5e..e20a452 100644 --- a/plugin-quicklaunch/translations/quicklaunch_de_DE.desktop +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.desktop @@ -8,5 +8,5 @@ Comment=Easy access to your favourite applications. # Translations -Comment[de_DE]=Starte deine Lieblingsanwendungen -Name[de_DE]=Schnellstarter +Comment[da]=Start dine favoritprogrammer +Name[da]=Quicklaunch diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.ts new file mode 100644 index 0000000..1d96f01 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Slipfejl + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Fil/URL '%1' kan ikke indlejres i HurtigStart lige nu + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Flyt mod venstre + + + + Move right + Flyt mod højre + + + + Remove from quicklaunch + Fjern fra Hurtigstart + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.desktop new file mode 100644 index 0000000..4bd52af --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Start dine ynglingsprogrammer +Name[da_DK]=Hurtigstart diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.ts new file mode 100644 index 0000000..a270973 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_da_DK.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Træk og slip fejl + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Fil/URL '%1' kan ikke blive indlejret i QuickLaunch lige nu + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Flyt mod venstre + + + + Move right + Flyt mod højre + + + + Remove from quicklaunch + Fjern fra quicklaunch + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.desktop new file mode 100644 index 0000000..1cfaefd --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Schnellstarter +Comment[de]=Starten Sie Ihre Lieblingsanwendungen diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.ts new file mode 100644 index 0000000..1f15174 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_de.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Fehler beim fallen lassen + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Datei/URL '%1' kann momentan nicht in die Schnellstartleiste eingebettet werden. + + + + Drop application +icons here + Anwendung/Symbol +hier fallen lassen + + + + QuickLaunchButton + + + Move left + Nach links verschieben + + + + Move right + Nach rechts verschieben + + + + Remove from quicklaunch + Aus der Schnellstartleiste entfernen + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.desktop new file mode 100644 index 0000000..5efea66 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Εκκίνηση των αγαπημένων σας εφαρμογών +Name[el_GR]=Γρήγορη εκκίνηση diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.ts new file mode 100644 index 0000000..4501097 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_el_GR.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Σφάλμα εναπόθεσης + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Το αρχείο/η διεύθυνση "%1" δεν μπορεί να ενσωματωθεί για την ώρα στη γρήγορη εκκίνηση + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Μετακίνηση αριστερά + + + + Move right + Μετακίνηση δεξιά + + + + Remove from quicklaunch + Αφαίρεση από τη γρήγορη εκκίνηση + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.desktop new file mode 100644 index 0000000..8bdd345 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Lanĉu viajn preferatajn aplikaĵojn +Name[eo]=Rapidlanĉo diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.ts new file mode 100644 index 0000000..2a148dc --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eo.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Eraro dum forigado + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Dosiero/URL '%1' ne povas esti enkorpigita en rapidlanĉilo nun + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Movi maldekstren + + + + Move right + Movi dekstren + + + + Remove from quicklaunch + Forigi el rapidlanĉilo + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.desktop new file mode 100644 index 0000000..05f859b --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Lanze sus aplicaciones favoritas +Name[es]=Lanzador rápido diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.ts new file mode 100644 index 0000000..48188b3 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Error al soltar + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + El archivo/URL '%1' por el momento no puede incrustarse en QuickLaunch + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mover a la izquierda + + + + Move right + Mover a la derecha + + + + Remove from quicklaunch + Quitar de quicklaunch + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.desktop new file mode 100644 index 0000000..f3f0553 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Iconos lanzadores de tus aplicaciones favoritas +Name[es_VE]=Lanzadores diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.ts new file mode 100644 index 0000000..e6596a5 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_es_VE.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Error al remover + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Archivo/URL '%1' no puede ser empotrado en la barra de lanzadores por ahora + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mover a la izquierda + + + + Move right + Mover a la derecha + + + + Remove from quicklaunch + Remover de la barra de lanzadores + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.desktop new file mode 100644 index 0000000..7462431 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Zure gogoko aplikazioetarako sarbide erraza +Name[eu]=Abio azkarra diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.ts new file mode 100644 index 0000000..a1c8c3b --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_eu.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Errorea jaregitean + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + '%1' fitxategia/URLa ezin da QuickLaunch-en txertatu oraingoz + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mugitu ezkerrera + + + + Move right + Mugitu eskuinera + + + + Remove from quicklaunch + Kendu abio azkarretik + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.desktop new file mode 100644 index 0000000..1f778d6 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Käynnistä suosikkisovelluksesi +Name[fi]=Pikakäynnistys diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.ts new file mode 100644 index 0000000..287c0c2 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fi.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Poistovirhe + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Tiedostoa/osoitetta '%1' ei toistaiseksi voi asettaa pikakäynnistykseen + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Siirrä vasemmalle + + + + Move right + Siirrä oikealle + + + + Remove from quicklaunch + Poista pikakäynnistyksestä + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.desktop new file mode 100644 index 0000000..9550f25 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Lancer votre application favorite +Name[fr_FR]=Lancement rapide diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts new file mode 100644 index 0000000..35c275e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Ne pas tenir compte de l'erreur + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Le fichier/l'URL '%1' ne peut pas être inclus dans le lancement rapide pour l'instant + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Déplacer vers la gauche + + + + Move right + Déplacer vers la droite + + + + Remove from quicklaunch + Enlever du lancement rapide + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.desktop new file mode 100644 index 0000000..4ca808c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=A kedvenc alkalmazásainak indítása +Name[hu]=Gyorsindító diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.ts new file mode 100644 index 0000000..9c7e2fe --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Ejtési hiba + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba + + + + Drop application +icons here + Ejts ide +indító ikont + + + + QuickLaunchButton + + + Move left + Balra + + + + Move right + Jobbra + + + + Remove from quicklaunch + Eltávolítás a gyorsindítóról + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts new file mode 100644 index 0000000..4c85f5b --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Ejtési hiba + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba + + + + Drop application +icons here + Ejts ide +indító ikont + + + + QuickLaunchButton + + + Move left + Balra + + + + Move right + Jobbra + + + + Remove from quicklaunch + Eltávolítás a gyorsindítóról + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.desktop new file mode 100644 index 0000000..a88914a --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quicklaunch +Comment=Launch your favorite Applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.ts new file mode 100644 index 0000000..8bfd4c4 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ia.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + + + + + Move right + + + + + Remove from quicklaunch + + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.desktop new file mode 100644 index 0000000..2058fc6 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[id_ID]=Luncurkan aplikasi favorit anda +Name[id_ID]=Quicklaunch diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.ts new file mode 100644 index 0000000..d22169f --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_id_ID.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + + + + + Move right + + + + + Remove from quicklaunch + + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.desktop new file mode 100644 index 0000000..4be775f --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Avvia le tue applicazioni preferite +Name[it_IT]=Avvio rapido diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.ts new file mode 100644 index 0000000..fa3fabd --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_it_IT.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Errore di spostamento + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Il file/URL '%1' in questo momento non può essere inserito in Avvio rapido + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Sposta a sinistra + + + + Move right + Sposta a destra + + + + Remove from quicklaunch + Rimuovi da Avvio rapido + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.desktop new file mode 100644 index 0000000..92a5201 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=お気に入りのアプリケーションの起動を容易にします +Name[ja]=クイック起動 diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.ts new file mode 100644 index 0000000..29d90a7 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ja.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + ドロップエラー + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + ファイル/URL '%1' は現在、クイック起動に埋め込むことができません + + + + Drop application +icons here + アプリケーションアイコンを +ここへドロップ + + + + QuickLaunchButton + + + Move left + 左に移動 + + + + Move right + 右に移動 + + + + Remove from quicklaunch + クイック起動から削除 + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.desktop new file mode 100644 index 0000000..a88914a --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quicklaunch +Comment=Launch your favorite Applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.ts new file mode 100644 index 0000000..45bb56b --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ko.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + + + + + Move right + + + + + Remove from quicklaunch + + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.desktop new file mode 100644 index 0000000..ae53d39 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Paleiskite savo mėgstamas programas +Name[lt]=Greitasis paleidimas diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.ts new file mode 100644 index 0000000..498cf45 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_lt.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Tempimo klaida + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Failo/URL „%1“ šiuo metu negalima patalpinti greitajame paleidime + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Perkelti į kairę + + + + Move right + Perkelti į dešinę + + + + Remove from quicklaunch + Pašalinti + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.desktop new file mode 100644 index 0000000..3530c59 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Uw favoriete programma's starten +Name[nl]=Snelstarter diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.ts new file mode 100644 index 0000000..41b819a --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_nl.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Neerzetfout + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Bestand/URL '%1' kan vooralsnog niet worden ingebed in de snelstartbalk + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Verplaats naar links + + + + Move right + Verplaats naar rechts + + + + Remove from quicklaunch + Verwijder uit snelstartbalk + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.desktop new file mode 100644 index 0000000..21f4d07 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Uruchamiaj Twoje ulubione aplikacje +Name[pl]=Szybkie uruchamianie diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.ts new file mode 100644 index 0000000..5f441d6 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Przesuń w lewo + + + + Move right + Przesuń w prawo + + + + Remove from quicklaunch + Usuń z szybkiego uruchamiania + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.desktop new file mode 100644 index 0000000..661010c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Uruchom swoje ulubione aplikacje. +Name[pl_PL]=Szybkie uruchamianie diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts new file mode 100644 index 0000000..a455735 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Problem dodawania + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Plik/URL '%1' nie może zostać umiesczony na pasku szybkiego uruchamiania + + + + Drop application +icons here + Upuść ikonę aplikacji tutaj + + + + QuickLaunchButton + + + Move left + Przesuń w lewo + + + + Move right + Przesuń w prawo + + + + Remove from quicklaunch + Usuń z paska szybkiego uruchamiania + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.desktop new file mode 100644 index 0000000..8e438ff --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Inicio rápido +Comment[pt]=Acesso rápido as suas aplicações preferidas. diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.ts new file mode 100644 index 0000000..a880dd4 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Erro ao largar + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Neste momento, não pode incluir o ficheiro/url '%1' no inicio rápido. + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mover para a esquerda + + + + Move right + Mover para a direita + + + + Remove from quicklaunch + Remover do inicio rápido + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.desktop new file mode 100644 index 0000000..d764348 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Lance seus aplicativos favoritos +Name[pt_BR]=Lançador rápido diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts new file mode 100644 index 0000000..35db758 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Erro de queda + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + O arquivo/URL '%1' não pôde ser incorporado ao lançador rápido + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mover para a esquerda + + + + Move right + Mover para a direita + + + + Remove from quicklaunch + Remover do lançador rápido + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.desktop new file mode 100644 index 0000000..5737f73 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Lansează aplicațiile favorite diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts new file mode 100644 index 0000000..209c10a --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Fișierul/URL-ul '%1' nu poate fi inclus în lista de lansare rapidă momentan + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Mută spre stânga + + + + Move right + Mută spre dreapta + + + + Remove from quicklaunch + Îndepărtează din lista pentru lansare rapidă + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.desktop new file mode 100644 index 0000000..57feb59 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Простой доступ к вашим любимым приложениям. +Name[ru]=Быстрый запуск \ No newline at end of file diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.ts new file mode 100644 index 0000000..d263e7e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Ошибка бросания + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас + + + + Drop application +icons here + Бросьте значки +приложений сюда + + + + QuickLaunchButton + + + Move left + Сдвинуть влево + + + + Move right + Сдвинуть вправо + + + + Remove from quicklaunch + Удалить из быстрого запуска + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.desktop new file mode 100644 index 0000000..c2b5628 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Простой доступ к вашим любимым приложениям. +Name[ru_RU]=Быстрый запуск \ No newline at end of file diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts new file mode 100644 index 0000000..5bfb41f --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts @@ -0,0 +1,42 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Ошибка бросания + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас + + + + Drop application +icons here + Бросьте значки +приложений сюда + + + + QuickLaunchButton + + + Move left + Сдвинуть влево + + + + Move right + Сдвинуть вправо + + + + Remove from quicklaunch + Удалить из быстрого запуска + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk.desktop new file mode 100644 index 0000000..1a1ca98 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Spúšťanie vašich obľúbených aplikácií +Name[sk]=Rýchle spustenie diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts new file mode 100644 index 0000000..9db0473 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + CHyba pri pustení + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Súbor/URL „%1“ nateraz nemožno vložiť do rýchleho spustenia + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Presunúť vľavo + + + + Move right + Presunúť vpravo + + + + Remove from quicklaunch + Odstrániť z rýchleho spustenia + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.desktop new file mode 100644 index 0000000..fca8a6e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Zaženite svoje priljubljene programe +Name[sl]=Hitri zagon diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.ts new file mode 100644 index 0000000..0dee705 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sl.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Napaka spusta + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Datoteke/lokacije »%1« trenutno ni bilo moč vstaviti v Hitri zagon + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Premakni levo + + + + Move right + Premakni desno + + + + Remove from quicklaunch + Odstrani iz hitrega zagona + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr.desktop new file mode 100644 index 0000000..328cd4c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Покреће ваше омиљене програме +Name[sr]=Брзо покретање diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavian.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavian.desktop new file mode 100644 index 0000000..b3965db --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Брзо покретање +Comment[sr@ijekavian]=Покреће ваше омиљене програме diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..ec3f6f9 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Brzo pokretanje +Comment[sr@ijekavianlatin]=Pokreće vaše omiljene programe diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.desktop new file mode 100644 index 0000000..87df58e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Pokreće vaše omiljene programe +Name[sr@latin]=Brzo pokretanje diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts new file mode 100644 index 0000000..793429e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + + + + + Move right + + + + + Remove from quicklaunch + + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts new file mode 100644 index 0000000..c067b5e --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Грешка испуштања + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Помјери лијево + + + + Move right + Помјери десно + + + + Remove from quicklaunch + Уклони са брзог покретања + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts new file mode 100644 index 0000000..414e650 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Грешка испуштања + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Помери лево + + + + Move right + Помери десно + + + + Remove from quicklaunch + Уклони са брзог покретања + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.desktop new file mode 100644 index 0000000..7e48f96 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=เรียกใช้งานโปรแกรมที่ชื่นชอบของคุณ +Name[th_TH]=ตัวเรียกโปรแกรมด่วน diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.ts new file mode 100644 index 0000000..8f46cc4 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_th_TH.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + การหย่อนขัดข้อง + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + แฟ้ม/URL '%1' ไม่สามารถฝังตัวไปยังตัวเรียกโปรแกรมด่วนได้ในตอนนี้ + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + ย้ายไปทางซ้าย + + + + Move right + ย้ายไปทางขวา + + + + Remove from quicklaunch + ลบออกจากตัวเรียกโปรแกรมด่วน + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.desktop new file mode 100644 index 0000000..d890a48 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Sık kullanılan uygulamalarınızı çalıştırın +Name[tr]=Hızlı çalıştırıcı diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.ts new file mode 100644 index 0000000..59ab575 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_tr.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Bırakma Hatası + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Şimdilik '%1' dosyası/bağlantısı Hızlı Başlatıcı' ya eklenemiyor + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Sola kaydır + + + + Move right + Sağa kaydır + + + + Remove from quicklaunch + Hızlı başlatıcıdan kaldır + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.desktop new file mode 100644 index 0000000..fe14d3c --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Простіше запускайте улюблені програми +Name[uk]=Швидкий запуск diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.ts new file mode 100644 index 0000000..471e7b2 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_uk.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + Збій при розміщенні + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + Не вдається додати "%1" до швидкого запуску + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + Посунути ліворуч + + + + Move right + Посунути враворуч + + + + Remove from quicklaunch + Вилучити зі швидкого запуску + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.GB2312.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.GB2312.desktop new file mode 100644 index 0000000..a88914a --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quicklaunch +Comment=Launch your favorite Applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.desktop new file mode 100644 index 0000000..06aa195 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=启动常用程序 +Name[zh_CN]=快速启动 diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts new file mode 100644 index 0000000..5006503 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + 出现错误 + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + 文件/URL '%1' 暂时无法被嵌入到快速启动 + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + 左移 + + + + Move right + 右移 + + + + Remove from quicklaunch + 从快速启动删除 + + + diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.desktop b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.desktop new file mode 100644 index 0000000..284b6b8 --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Quick launch +Comment=Easy access to your favourite applications. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=啟動您最愛的應用程式 +Name[zh_TW]=快速啟動 diff --git a/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts new file mode 100644 index 0000000..67b6ace --- /dev/null +++ b/lxqt-panel/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts @@ -0,0 +1,41 @@ + + + + + LxQtQuickLaunch + + + Drop Error + 移入錯誤 + + + + File/URL '%1' cannot be embedded into QuickLaunch for now + 檔案位址'%1'現在無法嵌入至快速啟動 + + + + Drop application +icons here + + + + + QuickLaunchButton + + + Move left + 往左移 + + + + Move right + 往右移 + + + + Remove from quicklaunch + 從快速啟動中移除 + + + diff --git a/lxqt-panel/plugin-screensaver/CMakeLists.txt b/lxqt-panel/plugin-screensaver/CMakeLists.txt new file mode 100644 index 0000000..e687a5d --- /dev/null +++ b/lxqt-panel/plugin-screensaver/CMakeLists.txt @@ -0,0 +1,16 @@ +set(PLUGIN "screensaver") + +set(HEADERS + panelscreensaver.h +) + +set(SOURCES + panelscreensaver.cpp +) + +set(LIBRARIES + ${LIBRARIES} + lxqt-globalkeys +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-screensaver/panelscreensaver.cpp b/lxqt-panel/plugin-screensaver/panelscreensaver.cpp new file mode 100644 index 0000000..f0624ad --- /dev/null +++ b/lxqt-panel/plugin-screensaver/panelscreensaver.cpp @@ -0,0 +1,72 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include +#include +#include +#include +#include +#include + +#include "panelscreensaver.h" + +#define DEFAULT_SHORTCUT "Control+Alt+L" + + +PanelScreenSaver::PanelScreenSaver(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + mSaver = new LxQt::ScreenSaver(this); + + QList actions = mSaver->availableActions(); + if (!actions.empty()) + mButton.setDefaultAction(actions.first()); + //mButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + + mShortcutKey = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/lock").arg(settings()->group()), tr("Lock Screen"), this); + if (mShortcutKey) + { + connect(mShortcutKey, &GlobalKeyShortcut::Action::registrationFinished, this, &PanelScreenSaver::shortcutRegistered); + connect(mShortcutKey, SIGNAL(activated()), mSaver, SLOT(lockScreen())); + } +} + +void PanelScreenSaver::shortcutRegistered() +{ + if (mShortcutKey->shortcut().isEmpty()) + { + mShortcutKey->changeShortcut(DEFAULT_SHORTCUT); + if (mShortcutKey->shortcut().isEmpty()) + { + LxQt::Notification::notify(tr("Panel Screensaver: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); + } + } +} + +#undef DEFAULT_SHORTCUT diff --git a/lxqt-panel/plugin-screensaver/panelscreensaver.h b/lxqt-panel/plugin-screensaver/panelscreensaver.h new file mode 100644 index 0000000..7926755 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/panelscreensaver.h @@ -0,0 +1,75 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef PANELSCREENSAVER_H +#define PANELSCREENSAVER_H + +#include "../panel/ilxqtpanelplugin.h" +#include + +namespace LxQt { +class ScreenSaver; +} +namespace GlobalKeyShortcut +{ +class Action; +} + +class PanelScreenSaver : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + PanelScreenSaver(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "PanelScreenSaver"; } + +private slots: + void shortcutRegistered(); + +private: + QToolButton mButton; + LxQt::ScreenSaver * mSaver; + GlobalKeyShortcut::Action * mShortcutKey; +}; + +class PanelScreenSaverLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new PanelScreenSaver(startupInfo); + } +}; + +#endif + diff --git a/lxqt-panel/plugin-screensaver/resources/screensaver.desktop.in b/lxqt-panel/plugin-screensaver/resources/screensaver.desktop.in new file mode 100644 index 0000000..94e2f74 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/resources/screensaver.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen +Icon=system-lock-screen + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver.ts b/lxqt-panel/plugin-screensaver/translations/screensaver.ts new file mode 100644 index 0000000..a7e5827 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ar.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ar.desktop new file mode 100644 index 0000000..fd9e6e0 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=تفعيل حافظ الشَّاشة و/أو قفل الشَّاشة +Name[ar]=حافظ الشَّاشة diff --git a/plugin-screensaver/translations/screensaver_de_DE.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ar.ts similarity index 71% rename from plugin-screensaver/translations/screensaver_de_DE.ts rename to lxqt-panel/plugin-screensaver/translations/screensaver_ar.ts index 195e5b6..2669739 100644 --- a/plugin-screensaver/translations/screensaver_de_DE.ts +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ar.ts @@ -1,11 +1,11 @@ - + PanelScreenSaver Panel Screensaver Global shortcut: '%1' cannot be registered - Panel Bildschirmschoner globaler Tastenkürzel: '%1' kann nicht registriert wrden + ﻻ يمكن تسجيل الاختصار الشَّامل %1 لحافظ الشَّاشة! @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_de_DE.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_cs.desktop similarity index 63% rename from plugin-screensaver/translations/screensaver_de_DE.desktop rename to lxqt-panel/plugin-screensaver/translations/screensaver_cs.desktop index dd6fd0e..093eec3 100644 --- a/plugin-screensaver/translations/screensaver_de_DE.desktop +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_cs.desktop @@ -8,5 +8,5 @@ Comment=Activate a screensaver and/or lock the screen # Translations -Comment[de_DE]=Bildschirmschoner aktivieren und/oder Bildschirm sperren -Name[de_DE]=Bildschirmschoner starten +Comment[cs]=Zapne šetřič obrazovky a/nebo zamkne obrazovku +Name[cs]=Šetřič obrazovky diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_cs.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_cs.ts new file mode 100644 index 0000000..b2dac8e --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_cs.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Klávesovou zkratku pro modul Šetřič obrazovky '%1' nelze zapsat + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.desktop new file mode 100644 index 0000000..166ae4b --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Zapnout šetřič obrazovky a/nebo zamknout obrazovku +Name[cs_CZ]=Šetřič obrazovky diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.ts new file mode 100644 index 0000000..434b079 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_cs_CZ.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Klávesovou zkratku pro modul "Šetřič obrazovky" '%1' nelze zapsat + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_da.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_da.desktop new file mode 100644 index 0000000..b35194e --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Aktiverer en pauseskærm og/eller låser skærmen +Name[da]=Pauseskærm diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_da.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_da.ts new file mode 100644 index 0000000..ec68690 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_da.ts @@ -0,0 +1,25 @@ + + + + + PanelScreenSaver + + Global keyboard shortcut + Globale tastaturgenveje + + + Panel Screensaver Global shortcut: '%1' cannot be registered + Global genvej for skærmskåner : '%1' kan ikke registreres + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.desktop new file mode 100644 index 0000000..19d8704 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Aktiverer pauseskærm og/eller låser skærmen +Name[da_DK]=Pauseskærm diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.ts new file mode 100644 index 0000000..4259c72 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_da_DK.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Panel Pauseskærm Global genvej: '%1' kan ikke registreres + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_de.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_de.desktop new file mode 100644 index 0000000..72bad46 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Bildschirmschoner +Comment[de]=Bildschirmschoner aktivieren und/oder Bildschirm sperren diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_de.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_de.ts new file mode 100644 index 0000000..0638eda --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_de.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + Bildschirm sperren + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + Für den Bildschirmschoner kann das globale Tastenkürzel '%1' nicht registriert werden + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.desktop new file mode 100644 index 0000000..78719a2 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Ενεργοποίηση προφύλαξης οθόνης και/ή κλειδώματος οθόνης +Name[el_GR]=Προφύλαξη οθόνης diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.ts new file mode 100644 index 0000000..311f26d --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_el_GR.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Καθολική συντόμευση προφύλαξης οθόνης πίνακα: Η '%1' δεν μπορεί να εγγραφεί + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_eo.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_eo.desktop new file mode 100644 index 0000000..2bd5fb2 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Enŝalti ekrankurtenon kaj/aŭ ŝlosi la ekranon +Name[eo]=Ekrankurteno diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_eo.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_eo.ts new file mode 100644 index 0000000..0488b02 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_eo.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Ĉiea klavkombino por ekrankurteno de panelo: '%1' ne registreblas + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_es.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_es.desktop new file mode 100644 index 0000000..b06cdc2 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Activa el salvapantallas y/o bloquea la pantalla +Name[es]=Salvapantallas diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_es.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_es.ts new file mode 100644 index 0000000..35bdb70 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_es.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Atajo global del panel del protector de pantalla: imposible registrar '%1' + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.desktop new file mode 100644 index 0000000..986dad5 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Activar el salvapantallas y/o bloquear la pantalla +Name[es_VE]=SalvaPantallas diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.ts new file mode 100644 index 0000000..5218d96 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_es_VE.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + El acceso de tecla global '%1' del salva pantallas del panel no pudo registrarse + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_eu.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_eu.desktop new file mode 100644 index 0000000..cf078ab --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Aktibatu pantaila-babeslea eta/edo blokeatu pantaila +Name[eu]=Pantaila-babeslea diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_eu.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_eu.ts new file mode 100644 index 0000000..699a6e3 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_eu.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Pantaila-babesle panelaren lasterbide globala: ezin da '%1' erregistratu + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_fi.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_fi.desktop new file mode 100644 index 0000000..d8783a4 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Aktivoi näytönsäästäjä ja/tai lukitse näyttö +Name[fi]=Näytönsäästäjä diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_fi.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_fi.ts new file mode 100644 index 0000000..7306c38 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_fi.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Paneelin näytönsäästäjän pikanäppäintä '%1' ei voi rekisteröidä + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.desktop new file mode 100644 index 0000000..c5a211e --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Activer un économiseur d'écran et/ou verrouiller l'écran +Name[fr_FR]=Économiseur d'écran diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.ts new file mode 100644 index 0000000..0b0e649 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_fr_FR.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Le raccourci clavier global de l'écran de veille : '%1' n'a pas pu être enregistré + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_hu.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_hu.desktop new file mode 100644 index 0000000..1034321 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=A képernyővédő aktiválása és/vagy a képernyő zárolása +Name[hu]=Képernyővédő diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_hu.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_hu.ts new file mode 100644 index 0000000..2f9a870 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_hu.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + + + + Lock Screen + Képernyőzár + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_hu_HU.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_hu_HU.ts new file mode 100644 index 0000000..7f6f9aa --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_hu_HU.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + + + + Lock Screen + Képernyőzár + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ia.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ia.desktop new file mode 100644 index 0000000..79caaeb --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ia.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ia.ts new file mode 100644 index 0000000..e7ca110 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ia.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.desktop new file mode 100644 index 0000000..79caaeb --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.ts new file mode 100644 index 0000000..2cb2530 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_id_ID.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Shortcut global Panel Screensaver: '%1' tidak dapat didaftarkan + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.desktop new file mode 100644 index 0000000..4bd63cd --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Attiva un salvaschermo e/o blocca lo schermo +Name[it_IT]=Salvaschermo diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.ts new file mode 100644 index 0000000..fe44c3d --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_it_IT.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + La scorciatoia globale per lo screensaver: '%1' non può essere registrata + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ja.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ja.desktop new file mode 100644 index 0000000..cd239be --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=スクリーンセーバーを起動したり、スクリーンをロックしたりします +Name[ja]=スクリーンセーバーの起動 diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ja.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ja.ts new file mode 100644 index 0000000..b5852b1 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ja.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + スクリーンをロック + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + スクリーンセーバー: グローバルショートカット '%1' を登録することができません + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ko.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ko.desktop new file mode 100644 index 0000000..79caaeb --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ko.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ko.ts new file mode 100644 index 0000000..55a4faa --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ko.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_lt.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_lt.desktop new file mode 100644 index 0000000..edc82c1 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Aktyvuoja ekrano užsklandą ir/arba užrakina ekraną +Name[lt]=Ekrano užsklanda diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_lt.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_lt.ts new file mode 100644 index 0000000..46f8737 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_lt.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Ekrano užsklandos klavišas: „%1“ negali būti registruojamas + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_nl.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_nl.desktop new file mode 100644 index 0000000..481e536 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Activeer de schermbeveiliging en/of vergrendel het scherm +Name[nl]=Schermbeveiliging diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_nl.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_nl.ts new file mode 100644 index 0000000..ad59586 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_nl.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Schermbeveiliging van paneel: systeembrede sneltoets '%1' kan niet worden geregistreerd + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pl.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_pl.desktop new file mode 100644 index 0000000..5e347c4 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Aktywuje wygaszacz ekranu oraz/albo blokuje ekran +Name[pl]=Wygaszacz ekranu diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pl.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_pl.ts new file mode 100644 index 0000000..02ee63b --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pl.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Ogólny skrót panelu wygaszacza ekranu: „%1” nie może zostać zarejestrowany + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.desktop new file mode 100644 index 0000000..42de2df --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Włącz wygaszacz ekranu i / lub zablokuj ekran. +Name[pl_PL]=Uruchom wygaszacz ekranu diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.ts new file mode 100644 index 0000000..92a3968 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pl_PL.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Plugin "Wygaszacz ekranu": globalny skrót '%1' nie może zostać zarejestrowany + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pt.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_pt.desktop new file mode 100644 index 0000000..d1d0a64 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Proteção de ecrã +Comment[pt]=Ativar uma proteção de ecrã e/ou bloquear o ecrã diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pt.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_pt.ts new file mode 100644 index 0000000..a159d8a --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pt.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Tecla de atalho global: '%1' não pode ser registada + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.desktop new file mode 100644 index 0000000..f8443f0 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Ativar o protetor de tela e/ou bloquear a tela +Name[pt_BR]=Protetor De Tela diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.ts new file mode 100644 index 0000000..3720191 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_pt_BR.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Atalho global do painel do protetor de tela: '%1' não pôde ser registrado + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.desktop new file mode 100644 index 0000000..c99a318 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Activează protecția de ecran și/sau blochează ecranul +Name[ro_RO]=Protecție ecran diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.ts new file mode 100644 index 0000000..4defc9f --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ro_RO.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Global keyboard shortcut + Tastă rapidă globală + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ru.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ru.desktop new file mode 100644 index 0000000..1fd6a69 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Включить хранитель экрана и/или блокировать экран +Name[ru]=Запустить хранитель экрана \ No newline at end of file diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ru.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ru.ts new file mode 100644 index 0000000..dbf9d50 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ru.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + Блокировать экран + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.desktop new file mode 100644 index 0000000..7ad644a --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Включить хранитель экрана и/или блокировать экран +Name[ru_RU]=Запустить хранитель экрана diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.ts new file mode 100644 index 0000000..742e0b7 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_ru_RU.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + Блокировать экран + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sk.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sk.desktop new file mode 100644 index 0000000..908a564 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Aktivovanie šetriča obrazovky alebo zamknutia obrazovky +Name[sk]=Šetrič obrazovky diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sk_SK.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_sk_SK.ts new file mode 100644 index 0000000..3e35ca9 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sk_SK.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Globálna klávesová skratka Panelu šetriča: „%1“ nemožno zaregistrovať + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sl.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sl.desktop new file mode 100644 index 0000000..2f7d450 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Vklopite ohranjevalnik zaslona ali pa zaklenite zaslon. +Name[sl]=Ohranjevalnik zaslona diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sl.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_sl.ts new file mode 100644 index 0000000..c04b712 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sl.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Globalna bližnjica za ohranjevalnik zaslona: »%1« ni moč registrirati + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sr.desktop new file mode 100644 index 0000000..ebd89e8 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Активирајте чувара екрана и/или закључајте екран +Name[sr]=Чувар екрана diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavian.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavian.desktop new file mode 100644 index 0000000..c149dd1 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Чувар екрана +Comment[sr@ijekavian]=Активирајте чувара екрана и/или закључајте екран diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..c78c65f --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Čuvar ekrana +Comment[sr@ijekavianlatin]=Aktivirajte čuvara ekrana i/ili zaključajte ekran diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.desktop new file mode 100644 index 0000000..adccd4a --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Aktivirajte čuvara ekrana i/ili zaključajte ekran +Name[sr@latin]=Čuvar ekrana diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.ts new file mode 100644 index 0000000..061eab1 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr@latin.ts @@ -0,0 +1,17 @@ + + + + + PanelScreenSaver + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr_BA.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_sr_BA.ts new file mode 100644 index 0000000..e32806b --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr_BA.ts @@ -0,0 +1,25 @@ + + + + + PanelScreenSaver + + Global keyboard shortcut + Глобална пречица тастатуре + + + Panel Screensaver Global shortcut: '%1' cannot be registered + Глобална пречица чувара екрана за панел: „%1“ не може бити регистрована + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_sr_RS.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_sr_RS.ts new file mode 100644 index 0000000..c8d4794 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_sr_RS.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Глобална пречица чувара екрана за панел: „%1“ не може бити регистрована + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.desktop new file mode 100644 index 0000000..69255e2 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=เริ่มงานโปรแกรมรักษาหน้าจอ และ/หรือ ล็อคหน้าจอ +Name[th_TH]=โปรแกรมรักษาหน้าจอ diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.ts new file mode 100644 index 0000000..f014b66 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_th_TH.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + โปรแกรมรักษาหน้าจอ: ไม่สารมารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_tr.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_tr.desktop new file mode 100644 index 0000000..6bb67d2 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Bir ekran koruyucu etkinleştir ve/veya ekranı kilitle +Name[tr]=Ekran koruyucu diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_tr.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_tr.ts new file mode 100644 index 0000000..0d1e185 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_tr.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Panel Ekran Koruyucu Genel kısayolu: '%1' kaydedilemiyor + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_uk.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_uk.desktop new file mode 100644 index 0000000..ef1e102 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Активувати зберігач екрану та/чи заблокувати екран +Name[uk]=Зберігач екрану diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_uk.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_uk.ts new file mode 100644 index 0000000..73d977e --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_uk.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + Не вдається встановити '%1' глобальним скороченням зберігача екрану + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.GB2312.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.GB2312.desktop new file mode 100644 index 0000000..79caaeb --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.desktop new file mode 100644 index 0000000..a0e44b3 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=启用屏幕保护并锁定屏幕 +Name[zh_CN]=屏幕保护 diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.ts new file mode 100644 index 0000000..988ad1c --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_CN.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + 面板 屏幕保护程序 全局快捷键 '%1' 无法被注册 + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.desktop b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.desktop new file mode 100644 index 0000000..43a8dd7 --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Launch screensaver +Comment=Activate a screensaver and/or lock the screen + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=啟動螢幕保護程式並/或鎖上螢幕 +Name[zh_TW]=螢幕保護程式 diff --git a/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.ts b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.ts new file mode 100644 index 0000000..b03475a --- /dev/null +++ b/lxqt-panel/plugin-screensaver/translations/screensaver_zh_TW.ts @@ -0,0 +1,21 @@ + + + + + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + 螢幕保護程式面板全域快捷鍵:'%1'無法被寫入 + + + + Lock Screen + + + + + Panel Screensaver: Global shortcut '%1' cannot be registered + + + + diff --git a/lxqt-panel/plugin-sensors/CMakeLists.txt b/lxqt-panel/plugin-sensors/CMakeLists.txt new file mode 100644 index 0000000..a7f7956 --- /dev/null +++ b/lxqt-panel/plugin-sensors/CMakeLists.txt @@ -0,0 +1,27 @@ +set(PLUGIN "sensors") + +set(HEADERS + lxqtsensorsplugin.h + chip.h + feature.h + lxqtsensors.h + lxqtsensorsconfiguration.h + sensors.h +) + +set(SOURCES + lxqtsensorsplugin.cpp + chip.cpp + feature.cpp + lxqtsensors.cpp + lxqtsensorsconfiguration.cpp + sensors.cpp +) + +set(UIS + lxqtsensorsconfiguration.ui +) + +set(LIBRARIES ${SENSORS_LIB}) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-sensors/chip.cpp b/lxqt-panel/plugin-sensors/chip.cpp new file mode 100644 index 0000000..09379f9 --- /dev/null +++ b/lxqt-panel/plugin-sensors/chip.cpp @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "chip.h" +#include + + +Chip::Chip(const sensors_chip_name* sensorsChipName) + : mSensorsChipName(sensorsChipName) +{ + const int BUF_SIZE = 256; + char buf[BUF_SIZE]; + if (sensors_snprintf_chip_name(buf, BUF_SIZE, mSensorsChipName) > 0) + { + mName = QString::fromLatin1(buf); + } + + qDebug() << "Detected chip:" << mName; + + const sensors_feature* feature; + int featureNr = 0; + + while ((feature = sensors_get_features(mSensorsChipName, &featureNr))) + { + mFeatures.push_back(Feature(mSensorsChipName, feature)); + } +} + + +const QString& Chip::getName() const +{ + return mName; +} + + +const QList& Chip::getFeatures() const +{ + return mFeatures; +} diff --git a/lxqt-panel/plugin-sensors/chip.h b/lxqt-panel/plugin-sensors/chip.h new file mode 100644 index 0000000..2993e95 --- /dev/null +++ b/lxqt-panel/plugin-sensors/chip.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CHIP_H +#define CHIP_H + +#include "feature.h" +#include "sensors.h" +#include +#include + + +/** + * @brief Chip class is providing RAII-style for lm_sensors library + */ + +class Chip +{ +public: + Chip(const sensors_chip_name*); + const QString& getName() const; + const QList& getFeatures() const; + +private: + // Do not try to change these chip names, as they point to internal structures of lm_sensors! + const sensors_chip_name* mSensorsChipName; + + // "Printable" chip name + QString mName; + + QList mFeatures; +}; + +#endif // CHIP_H diff --git a/lxqt-panel/plugin-sensors/feature.cpp b/lxqt-panel/plugin-sensors/feature.cpp new file mode 100644 index 0000000..169f253 --- /dev/null +++ b/lxqt-panel/plugin-sensors/feature.cpp @@ -0,0 +1,76 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "feature.h" +#include + + +Feature::Feature(const sensors_chip_name* sensorsChipName, const sensors_feature* sensorsFeature) + : mSensorsChipName(sensorsChipName), + mSensorsFeature(sensorsFeature) +{ + char *featureLabel = NULL; + + if ((featureLabel = sensors_get_label(mSensorsChipName, mSensorsFeature))) + { + mLabel = featureLabel; + free(featureLabel); + } + + qDebug() << "Detected feature:" << QString::fromLatin1(sensorsFeature->name) + << "(" << mLabel << ")"; +} + + +const QString& Feature::getLabel() const +{ + return mLabel; +} + + +double Feature::getValue(sensors_subfeature_type subfeature_type) const +{ + double result = 0; + + const sensors_subfeature *subfeature; + + // Find feature + subfeature = sensors_get_subfeature(mSensorsChipName, mSensorsFeature, subfeature_type); + + if (subfeature) + { + sensors_get_value(mSensorsChipName, subfeature->number, &result); + } + + return result; +} + + +sensors_feature_type Feature::getType() const +{ + return mSensorsFeature->type; +} diff --git a/lxqt-panel/plugin-sensors/feature.h b/lxqt-panel/plugin-sensors/feature.h new file mode 100644 index 0000000..1f6c620 --- /dev/null +++ b/lxqt-panel/plugin-sensors/feature.h @@ -0,0 +1,60 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef FEATURE_H +#define FEATURE_H + +#include +#include +#include + + +/** + * @brief Feature class is providing RAII-style for lm_sensors library + */ + +class Feature +{ +public: + Feature(const sensors_chip_name*, const sensors_feature*); + const QString& getName() const; + const QString& getLabel() const; + double getValue(sensors_subfeature_type) const; + sensors_feature_type getType() const; +private: + // Do not try to change these chip names, as they point to internal structures of lm_sensors! + const sensors_chip_name* mSensorsChipName; + + const sensors_feature* mSensorsFeature; + + // "Printable" feature label + QString mLabel; + + QList mSubFeatures; +}; + +#endif // CHIP_H diff --git a/lxqt-panel/plugin-sensors/lxqtsensors.cpp b/lxqt-panel/plugin-sensors/lxqtsensors.cpp new file mode 100644 index 0000000..78feb04 --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensors.cpp @@ -0,0 +1,454 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtsensors.h" +#include "lxqtsensorsconfiguration.h" +#include "../panel/ilxqtpanelplugin.h" +#include "../panel/ilxqtpanel.h" +#include +#include +#include +#include + + +LxQtSensors::LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent): + QFrame(parent), + mPlugin(plugin), + mSettings(plugin->settings()) +{ + + mDetectedChips = mSensors.getDetectedChips(); + + /** + * We have all needed data to initialize default settings, we have to do it here as later + * we are using them. + */ + initDefaultSettings(); + + // Add GUI elements + ProgressBar* pg = NULL; + + mLayout = new QBoxLayout(QBoxLayout::LeftToRight, this); + mLayout->setSpacing(0); + mLayout->setContentsMargins(0, 0, 0, 0); + + QString chipFeatureLabel; + + mSettings->beginGroup("chips"); + + for (int i = 0; i < mDetectedChips.size(); ++i) + { + mSettings->beginGroup(mDetectedChips[i].getName()); + const QList& features = mDetectedChips[i].getFeatures(); + + for (int j = 0; j < features.size(); ++j) + { + if (features[j].getType() == SENSORS_FEATURE_TEMP) + { + chipFeatureLabel = features[j].getLabel(); + mSettings->beginGroup(chipFeatureLabel); + + pg = new ProgressBar(this); + pg->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + + // Hide progress bar if it is not enabled + if (!mSettings->value("enabled").toBool()) + { + pg->hide(); + } + + pg->setToolTip(chipFeatureLabel); + pg->setTextVisible(false); + + QPalette pal = pg->palette(); + QColor color(mSettings->value("color").toString()); + pal.setColor(QPalette::Active, QPalette::Highlight, color); + pal.setColor(QPalette::Inactive, QPalette::Highlight, color); + pg->setPalette(pal); + + mTemperatureProgressBars.push_back(pg); + mLayout->addWidget(pg); + + mSettings->endGroup(); + } + } + mSettings->endGroup(); + } + + mSettings->endGroup(); + + // Fit plugin to current panel + realign(); + + // Updated sensors readings to display actual values at start + updateSensorReadings(); + + // Run timer that will be updating sensor readings + connect(&mUpdateSensorReadingsTimer, SIGNAL(timeout()), this, SLOT(updateSensorReadings())); + mUpdateSensorReadingsTimer.start(mSettings->value("updateInterval").toInt() * 1000); + + // Run timer that will be showin warning + mWarningAboutHighTemperatureTimer.setInterval(500); + connect(&mWarningAboutHighTemperatureTimer, SIGNAL(timeout()), this, + SLOT(warningAboutHighTemperature())); + if (mSettings->value("warningAboutHighTemperature").toBool()) + { + mWarningAboutHighTemperatureTimer.start(); + } +} + + +LxQtSensors::~LxQtSensors() +{ +} + + +void LxQtSensors::updateSensorReadings() +{ + QString tooltip; + + double critTemp = 0; + double maxTemp = 0; + double minTemp = 0; + double curTemp = 0; + bool highTemperature = false; + + // Iterator for temperature progress bars + QList::iterator temperatureProgressBarsIt = + mTemperatureProgressBars.begin(); + + for (int i = 0; i < mDetectedChips.size(); ++i) + { + const QList& features = mDetectedChips[i].getFeatures(); + + for (int j = 0; j < features.size(); ++j) + { + if (features[j].getType() == SENSORS_FEATURE_TEMP) + { + tooltip = features[j].getLabel() + " (" + QChar(0x00B0); + + if (mSettings->value("useFahrenheitScale").toBool()) + { + critTemp = celsiusToFahrenheit( + features[j].getValue(SENSORS_SUBFEATURE_TEMP_CRIT)); + maxTemp = celsiusToFahrenheit( + features[j].getValue(SENSORS_SUBFEATURE_TEMP_MAX)); + minTemp = celsiusToFahrenheit( + features[j].getValue(SENSORS_SUBFEATURE_TEMP_MIN)); + curTemp = celsiusToFahrenheit( + features[j].getValue(SENSORS_SUBFEATURE_TEMP_INPUT)); + + tooltip += "F)"; + } + else + { + critTemp = features[j].getValue(SENSORS_SUBFEATURE_TEMP_CRIT); + maxTemp = features[j].getValue(SENSORS_SUBFEATURE_TEMP_MAX); + minTemp = features[j].getValue(SENSORS_SUBFEATURE_TEMP_MIN); + curTemp = features[j].getValue(SENSORS_SUBFEATURE_TEMP_INPUT); + + tooltip += "C)"; + } + + + // Check if temperature is too high + if (curTemp >= maxTemp) + { + if (mSettings->value("warningAboutHighTemperature").toBool()) + { + // Add current progress bar to the "warning container" + mHighTemperatureProgressBars.insert(*temperatureProgressBarsIt); + } + + highTemperature = true; + } + else + { + mHighTemperatureProgressBars.remove(*temperatureProgressBarsIt); + + highTemperature = false; + } + + // Set maximum temperature + (*temperatureProgressBarsIt)->setMaximum(critTemp); + // Set minimum temperature + (*temperatureProgressBarsIt)->setMinimum(minTemp); + // Set current temperature + (*temperatureProgressBarsIt)->setValue(curTemp); + + tooltip += "

Crit: "; + tooltip += QString::number((*temperatureProgressBarsIt)->maximum()); + tooltip += "
Max: "; + tooltip += QString::number(int(maxTemp)); + tooltip += "
Cur: "; + + // Mark high temperature in the tooltip + if (highTemperature) + { + tooltip += ""; + tooltip += QString::number((*temperatureProgressBarsIt)->value()); + tooltip += " !"; + } + else + { + tooltip += QString::number((*temperatureProgressBarsIt)->value()); + } + + tooltip += "
Min: "; + tooltip += QString::number((*temperatureProgressBarsIt)->minimum()); + (*temperatureProgressBarsIt)->setToolTip(tooltip); + + // Go to the next temperature progress bar + ++temperatureProgressBarsIt; + } + } + } + + update(); +} + + +void LxQtSensors::warningAboutHighTemperature() +{ + // Iterator for temperature progress bars + QSet::iterator temperatureProgressBarsIt = + mHighTemperatureProgressBars.begin(); + + int curValue; + int maxValue; + + for (; temperatureProgressBarsIt != mHighTemperatureProgressBars.end(); + ++temperatureProgressBarsIt) + { + curValue = (*temperatureProgressBarsIt)->value(); + maxValue = (*temperatureProgressBarsIt)->maximum(); + + if (maxValue > curValue) + { + (*temperatureProgressBarsIt)->setValue(maxValue); + } + else + { + (*temperatureProgressBarsIt)->setValue((*temperatureProgressBarsIt)->minimum()); + } + + } + update(); +} + + +void LxQtSensors::settingsChanged() +{ + mUpdateSensorReadingsTimer.setInterval(mSettings->value("updateInterval").toInt() * 1000); + + // Iterator for temperature progress bars + QList::iterator temperatureProgressBarsIt = + mTemperatureProgressBars.begin(); + + mSettings->beginGroup("chips"); + + for (int i = 0; i < mDetectedChips.size(); ++i) + { + mSettings->beginGroup(mDetectedChips[i].getName()); + const QList& features = mDetectedChips[i].getFeatures(); + + for (int j = 0; j < features.size(); ++j) + { + if (features[j].getType() == SENSORS_FEATURE_TEMP) + { + mSettings->beginGroup(features[j].getLabel()); + + if (mSettings->value("enabled").toBool()) + { + (*temperatureProgressBarsIt)->show(); + } + else + { + (*temperatureProgressBarsIt)->hide(); + } + + QPalette pal = (*temperatureProgressBarsIt)->palette(); + QColor color(mSettings->value("color").toString()); + pal.setColor(QPalette::Active, QPalette::Highlight, color); + pal.setColor(QPalette::Inactive, QPalette::Highlight, color); + (*temperatureProgressBarsIt)->setPalette(pal); + + mSettings->endGroup(); + + // Go to the next temperature progress bar + ++temperatureProgressBarsIt; + } + } + + mSettings->endGroup(); + } + + mSettings->endGroup(); + + + if (mSettings->value("warningAboutHighTemperature").toBool()) + { + // Update sensors readings to get the list of high temperature progress bars + updateSensorReadings(); + + if (!mWarningAboutHighTemperatureTimer.isActive()) + mWarningAboutHighTemperatureTimer.start(); + } + else if (mWarningAboutHighTemperatureTimer.isActive()) + { + mWarningAboutHighTemperatureTimer.stop(); + + // Update sensors readings to set progress bar values to "normal" height + updateSensorReadings(); + } + + realign(); + update(); +} + + +void LxQtSensors::realign() +{ + // Default values for LxQtPanel::PositionBottom or LxQtPanel::PositionTop + Qt::Orientation cur_orient = Qt::Vertical; + Qt::LayoutDirection cur_layout_dir = Qt::LeftToRight; + + if (mPlugin->panel()->isHorizontal()) + { + mLayout->setDirection(QBoxLayout::LeftToRight); + } + else + { + mLayout->setDirection(QBoxLayout::TopToBottom); + } + + switch (mPlugin->panel()->position()) + { + case ILxQtPanel::PositionLeft: + cur_orient = Qt::Horizontal; + break; + + case ILxQtPanel::PositionRight: + cur_orient = Qt::Horizontal; + cur_layout_dir = Qt::RightToLeft; + break; + + default: + break; + } + + for (int i = 0; i < mTemperatureProgressBars.size(); ++i) + { + mTemperatureProgressBars[i]->setOrientation(cur_orient); + mTemperatureProgressBars[i]->setLayoutDirection(cur_layout_dir); + + if (mPlugin->panel()->isHorizontal()) + { + mTemperatureProgressBars[i]->setFixedWidth(mPlugin->settings()->value("tempBarWidth").toInt()); + mTemperatureProgressBars[i]->setFixedHeight(QWIDGETSIZE_MAX); + } + else + { + mTemperatureProgressBars[i]->setFixedHeight(mPlugin->settings()->value("tempBarWidth").toInt()); + mTemperatureProgressBars[i]->setFixedWidth(QWIDGETSIZE_MAX); + } + } +} + + +double LxQtSensors::celsiusToFahrenheit(double celsius) +{ + // Fahrenheit = 32 * (9/5) * Celsius + return 32 + 1.8 * celsius; +} + + +void LxQtSensors::initDefaultSettings() +{ + if (!mSettings->contains("updateInterval")) + { + mSettings->setValue("updateInterval", 1); + } + + if (!mSettings->contains("tempBarWidth")) + { + mSettings->setValue("tempBarWidth", 8); + } + + if (!mSettings->contains("useFahrenheitScale")) + { + mSettings->setValue("useFahrenheitScale", false); + } + + mSettings->beginGroup("chips"); + + // Initialize default sensors settings + for (int i = 0; i < mDetectedChips.size(); ++i) + { + mSettings->beginGroup(mDetectedChips[i].getName()); + const QList& features = mDetectedChips[i].getFeatures(); + + for (int j = 0; j < features.size(); ++j) + { + if (features[j].getType() == SENSORS_FEATURE_TEMP) + { + mSettings->beginGroup(features[j].getLabel()); + if (!mSettings->contains("enabled")) + { + mSettings->setValue("enabled", true); + } + + if (!mSettings->contains("color")) + { + // This is the default from QtDesigner + mSettings->setValue("color", QColor(qRgb(98, 140, 178)).name()); + } + mSettings->endGroup(); + } + } + mSettings->endGroup(); + } + + mSettings->endGroup(); + + if (!mSettings->contains("warningAboutHighTemperature")) + { + mSettings->setValue("warningAboutHighTemperature", true); + } +} + + +ProgressBar::ProgressBar(QWidget *parent): + QProgressBar(parent) +{ +} + + +QSize ProgressBar::sizeHint() const +{ + return QSize(20, 20); +} diff --git a/lxqt-panel/plugin-sensors/lxqtsensors.h b/lxqt-panel/plugin-sensors/lxqtsensors.h new file mode 100644 index 0000000..0769e53 --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensors.h @@ -0,0 +1,81 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTSENSORS_H +#define LXQTSENSORS_H + +#include "sensors.h" +#include +#include +#include +#include + + +class ProgressBar: public QProgressBar +{ + Q_OBJECT +public: + ProgressBar(QWidget *parent = 0); + + QSize sizeHint() const; +}; + + +class QSettings; +class ILxQtPanelPlugin; +class QBoxLayout; + +class LxQtSensors : public QFrame +{ + Q_OBJECT +public: + LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~LxQtSensors(); + + void settingsChanged(); + void realign(); +public slots: + void updateSensorReadings(); + void warningAboutHighTemperature(); + +private: + ILxQtPanelPlugin *mPlugin; + QBoxLayout *mLayout; + QTimer mUpdateSensorReadingsTimer; + QTimer mWarningAboutHighTemperatureTimer; + Sensors mSensors; + QList mDetectedChips; + QList mTemperatureProgressBars; + // With set we can handle updates in very easy way :) + QSet mHighTemperatureProgressBars; + double celsiusToFahrenheit(double celsius); + void initDefaultSettings(); + QSettings *mSettings; +}; + + +#endif // LXQTSENSORS_H diff --git a/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.cpp b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.cpp new file mode 100644 index 0000000..013e894 --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.cpp @@ -0,0 +1,252 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtsensorsconfiguration.h" +#include "ui_lxqtsensorsconfiguration.h" +#include +#include +#include +#include +#include + + +LxQtSensorsConfiguration::LxQtSensorsConfiguration(QSettings *settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtSensorsConfiguration), + mSettings(settings), + oldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("SensorsConfigurationWindow"); + ui->setupUi(this); + + // We load settings here cause we have to set up dynamic widgets + loadSettings(); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + connect(ui->updateIntervalSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->tempBarWidthSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->detectedChipsCB, SIGNAL(activated(int)), this, SLOT(detectedChipSelected(int))); + connect(ui->celsiusTempScaleRB, SIGNAL(toggled(bool)), this, SLOT(saveSettings())); + // We don't need signal from the other radio box as celsiusTempScaleRB will send one + //connect(ui->fahrenheitTempScaleRB, SIGNAL(toggled(bool)), this, SLOT(saveSettings())); + connect(ui->warningAboutHighTemperatureChB, SIGNAL(toggled(bool)), this, SLOT(saveSettings())); + + /** + * Signals for enable/disable and bar color change are set in the loadSettings method because + * we are creating them dynamically. + */ +} + + +LxQtSensorsConfiguration::~LxQtSensorsConfiguration() +{ + delete ui; +} + + +void LxQtSensorsConfiguration::loadSettings() +{ + ui->updateIntervalSB->setValue(mSettings->value("updateInterval").toInt()); + ui->tempBarWidthSB->setValue(mSettings->value("tempBarWidth").toInt()); + + if (mSettings->value("useFahrenheitScale").toBool()) + { + ui->fahrenheitTempScaleRB->setChecked(true); + } + + // In case of reloading settings we have to clear GUI elements + ui->detectedChipsCB->clear(); + + mSettings->beginGroup("chips"); + QStringList chipNames = mSettings->childGroups(); + + for (int i = 0; i < chipNames.size(); ++i) + { + ui->detectedChipsCB->addItem(chipNames[i]); + } + mSettings->endGroup(); + + // Load feature for the first chip if exist + if (chipNames.size() > 0) + { + detectedChipSelected(0); + } + + ui->warningAboutHighTemperatureChB->setChecked( + mSettings->value("warningAboutHighTemperature").toBool()); +} + + +void LxQtSensorsConfiguration::saveSettings() +{ + mSettings->setValue("updateInterval", ui->updateIntervalSB->value()); + mSettings->setValue("tempBarWidth", ui->tempBarWidthSB->value()); + + if (ui->fahrenheitTempScaleRB->isChecked()) + { + mSettings->setValue("useFahrenheitScale", true); + } + else + { + mSettings->setValue("useFahrenheitScale", false); + } + + mSettings->beginGroup("chips"); + QStringList chipNames = mSettings->childGroups(); + + if (chipNames.size()) + { + QStringList chipFeatureLabels; + QPushButton* colorButton = NULL; + QCheckBox* enabledCheckbox = NULL; + + mSettings->beginGroup(chipNames[ui->detectedChipsCB->currentIndex()]); + + chipFeatureLabels = mSettings->childGroups(); + for (int j = 0; j < chipFeatureLabels.size(); ++j) + { + mSettings->beginGroup(chipFeatureLabels[j]); + + enabledCheckbox = qobject_cast(ui->chipFeaturesT->cellWidget(j, 0)); + // We know what we are doing so we don't have to check if enabledCheckbox == 0 + mSettings->setValue("enabled", enabledCheckbox->isChecked()); + + colorButton = qobject_cast(ui->chipFeaturesT->cellWidget(j, 2)); + // We know what we are doing so we don't have to check if colorButton == 0 + mSettings->setValue( + "color", + colorButton->palette().color(QPalette::Normal, QPalette::Button).name()); + + mSettings->endGroup(); + } + mSettings->endGroup(); + + } + mSettings->endGroup(); + + mSettings->setValue("warningAboutHighTemperature", + ui->warningAboutHighTemperatureChB->isChecked()); +} + + +void LxQtSensorsConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + oldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + + +void LxQtSensorsConfiguration::changeProgressBarColor() +{ + QAbstractButton* btn = qobject_cast(sender()); + + if (btn) + { + QPalette pal = btn->palette(); + QColor color = QColorDialog::getColor(pal.color(QPalette::Normal, QPalette::Button), this); + + if (color.isValid()) + { + pal.setColor(QPalette::Normal, QPalette::Button, color); + btn->setPalette(pal); + saveSettings(); + } + } + else + { + qDebug() << "LxQtSensorsConfiguration::changeProgressBarColor():" << "invalid button cast"; + } +} + + +void LxQtSensorsConfiguration::detectedChipSelected(int index) +{ + mSettings->beginGroup("chips"); + QStringList chipNames = mSettings->childGroups(); + QStringList chipFeatureLabels; + QPushButton* colorButton = NULL; + QCheckBox* enabledCheckbox = NULL; + QTableWidgetItem *chipFeatureLabel = NULL; + + if (index < chipNames.size()) + { + qDebug() << "Selected chip: " << ui->detectedChipsCB->currentText(); + + // In case of reloading settings we have to clear GUI elements + ui->chipFeaturesT->setRowCount(0); + + // Add detected chips and features + QStringList chipFeaturesLabels; + chipFeaturesLabels << tr("Enabled") << tr("Label") << tr("Color"); + ui->chipFeaturesT->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + ui->chipFeaturesT->setHorizontalHeaderLabels(chipFeaturesLabels); + + mSettings->beginGroup(chipNames[index]); + chipFeatureLabels = mSettings->childGroups(); + for (int j = 0; j < chipFeatureLabels.size(); ++j) + { + mSettings->beginGroup(chipFeatureLabels[j]); + + ui->chipFeaturesT->insertRow(j); + + enabledCheckbox = new QCheckBox(ui->chipFeaturesT); + enabledCheckbox->setChecked(mSettings->value("enabled").toBool()); + // Connect here after the setChecked call because we don't want to send signal + connect(enabledCheckbox, SIGNAL(stateChanged(int)), this, SLOT(saveSettings())); + ui->chipFeaturesT->setCellWidget(j, 0, enabledCheckbox); + + chipFeatureLabel = new QTableWidgetItem(chipFeatureLabels[j]); + chipFeatureLabel->setFlags(Qt::ItemIsEnabled); + ui->chipFeaturesT->setItem(j, 1, chipFeatureLabel); + + colorButton = new QPushButton(ui->chipFeaturesT); + connect(colorButton, SIGNAL(clicked()), this, SLOT(changeProgressBarColor())); + QPalette pal = colorButton->palette(); + pal.setColor(QPalette::Normal, QPalette::Button, + QColor(mSettings->value("color").toString())); + colorButton->setPalette(pal); + ui->chipFeaturesT->setCellWidget(j, 2, colorButton); + + mSettings->endGroup(); + } + mSettings->endGroup(); + } + else + { + qDebug() << "Invalid chip index: " << index; + } + + mSettings->endGroup(); +} diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.h b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.h similarity index 71% rename from plugin-kbindicator/lxqtkbindicatorconfiguration.h rename to lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.h index bcefc5c..d2823c0 100644 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.h +++ b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.h @@ -4,9 +4,9 @@ * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org * - * Copyright: 2012 Razor team + * Copyright: 2011 Razor team * Authors: - * Kuzma Shapran + * Maciej Płaza * * This program or library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser General Public @@ -25,33 +25,31 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQTSENSORSCONFIGURATION_H +#define LXQTSENSORSCONFIGURATION_H -#ifndef LXQTKBINDICATORCONFIGURATION_H -#define LXQTKBINDICATORCONFIGURATION_H - -#include - -#include #include +#include +#include +#include +#include +#include namespace Ui { - class LxQtKbIndicatorConfiguration; + class LxQtSensorsConfiguration; } -class LxQtKbIndicatorConfiguration : public QDialog +class LxQtSensorsConfiguration : public QDialog { Q_OBJECT public: - explicit LxQtKbIndicatorConfiguration(QSettings *settings, QWidget *parent = 0); - ~LxQtKbIndicatorConfiguration(); - -public slots: - void saveSettings(); + explicit LxQtSensorsConfiguration(QSettings *settings, QWidget *parent = 0); + ~LxQtSensorsConfiguration(); private: - Ui::LxQtKbIndicatorConfiguration *ui; + Ui::LxQtSensorsConfiguration *ui; QSettings *mSettings; LxQt::SettingsCache oldSettings; @@ -64,7 +62,10 @@ private slots: /* Saves settings in conf file. */ + void saveSettings(); void dialogButtonsAction(QAbstractButton *btn); + void changeProgressBarColor(); + void detectedChipSelected(int index); }; -#endif // LXQTKBINDICATORCONFIGURATION_H +#endif // LXQTSENSORSCONFIGURATION_H diff --git a/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.ui b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.ui new file mode 100644 index 0000000..2e9f3c7 --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensorsconfiguration.ui @@ -0,0 +1,240 @@ + + + LxQtSensorsConfiguration + + + + 0 + 0 + 271 + 284 + + + + Sensors Settings + + + + + + QTabWidget::Rounded + + + 0 + + + true + + + + Common + + + + + + + 0 + 0 + + + + Update interval (seconds) + + + + + + + Temperature bar width + + + + + + + true + + + + + + + + + + + + + + + 1 + + + 300 + + + + + + + 1 + + + 8 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Temperature scale + + + + + + Celsius + + + true + + + + + + + Fahrenheit + + + + + fahrenheitTempScaleRB + celsiusTempScaleRB + + + + + + Blink progress bars when the temperature is too high + + + Qt::LeftToRight + + + Warning about high temperature + + + true + + + false + + + + + + + + Sensors + + + + + + -1 + + + true + + + + + + + Detected chips: + + + + + + + Chip features: + + + + + + + 3 + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + LxQtSensorsConfiguration + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttons + rejected() + LxQtSensorsConfiguration + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/lxqt-panel/plugin-sensors/lxqtsensorsplugin.cpp b/lxqt-panel/plugin-sensors/lxqtsensorsplugin.cpp new file mode 100644 index 0000000..f6e4ae6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensorsplugin.cpp @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtsensorsplugin.h" +#include "lxqtsensors.h" +#include "lxqtsensorsconfiguration.h" + + +LxQtSensorsPlugin::LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mWidget(new LxQtSensors(this)) +{ +} + + +LxQtSensorsPlugin::~LxQtSensorsPlugin() +{ + delete mWidget; +} + + +QWidget *LxQtSensorsPlugin::widget() +{ + return mWidget; +} + + +QDialog *LxQtSensorsPlugin::configureDialog() +{ + return new LxQtSensorsConfiguration(settings()); +} + + +void LxQtSensorsPlugin::realign() +{ + mWidget->realign(); +} + + +void LxQtSensorsPlugin::settingsChanged() +{ + mWidget->settingsChanged(); +} diff --git a/lxqt-panel/plugin-sensors/lxqtsensorsplugin.h b/lxqt-panel/plugin-sensors/lxqtsensorsplugin.h new file mode 100644 index 0000000..678bb2e --- /dev/null +++ b/lxqt-panel/plugin-sensors/lxqtsensorsplugin.h @@ -0,0 +1,74 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTSENSORSPLUGIN_H +#define LXQTSENSORSPLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class LxQtSensors; + +class LxQtSensorsPlugin: public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + explicit LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtSensorsPlugin(); + + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } + virtual QWidget *widget(); + virtual QString themeId() const { return "Sensors"; } + + bool isSeparate() const { return true; } + QDialog *configureDialog(); + + void realign(); + +protected: + virtual void settingsChanged(); + +private: + LxQtSensors *mWidget; +}; + + +class LxQtSensorsPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtSensorsPlugin(startupInfo); + } +}; + +#endif // LXQTSENSORSPLUGIN_H diff --git a/lxqt-panel/plugin-sensors/resources/sensors.desktop.in b/lxqt-panel/plugin-sensors/resources/sensors.desktop.in new file mode 100644 index 0000000..8d8e43e --- /dev/null +++ b/lxqt-panel/plugin-sensors/resources/sensors.desktop.in @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. diff --git a/lxqt-panel/plugin-sensors/sensors.cpp b/lxqt-panel/plugin-sensors/sensors.cpp new file mode 100644 index 0000000..a4c0a09 --- /dev/null +++ b/lxqt-panel/plugin-sensors/sensors.cpp @@ -0,0 +1,78 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "sensors.h" +#include + + +QList Sensors::mDetectedChips = QList(); +int Sensors::mInstanceCounter = 0; +bool Sensors::mSensorsInitialized = false; + + +Sensors::Sensors() +{ + // Increase instance counter + ++mInstanceCounter; + + if (!mSensorsInitialized && sensors_init(NULL) == 0) + { + // Sensors initialized + mSensorsInitialized = true; + + sensors_chip_name const * chipName; + int chipNr = 0; + while ((chipName = sensors_get_detected_chips(NULL, &chipNr)) != NULL) + { + mDetectedChips.push_back(chipName); + } + + qDebug() << "lm_sensors library initialized"; + } +} + + +Sensors::~Sensors() +{ + // Decrease instance counter + --mInstanceCounter; + + if (mInstanceCounter == 0 && mSensorsInitialized) + { + mDetectedChips.clear(); + mSensorsInitialized = false; + sensors_cleanup(); + + qDebug() << "lm_sensors library cleanup"; + } +} + + +const QList& Sensors::getDetectedChips() const +{ + return mDetectedChips; +} diff --git a/lxqt-panel/plugin-sensors/sensors.h b/lxqt-panel/plugin-sensors/sensors.h new file mode 100644 index 0000000..43cd502 --- /dev/null +++ b/lxqt-panel/plugin-sensors/sensors.h @@ -0,0 +1,60 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Łukasz Twarduś + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef SENSORS_H +#define SENSORS_H + +#include "chip.h" +#include +#include + + +class Chip; + +/** + * @brief Sensors class is providing RAII-style for lm_sensors library + */ + +class Sensors +{ +public: + Sensors(); + ~Sensors(); + const QList& getDetectedChips() const; + +private: + static QList mDetectedChips; + + /** + * lm_sensors library can be initialized only once so this will tell us when to init + * and when to clean up. + */ + static int mInstanceCounter; + static bool mSensorsInitialized; +}; + +#endif // SENSORS_H diff --git a/lxqt-panel/plugin-sensors/translations/sensors.ts b/lxqt-panel/plugin-sensors/translations/sensors.ts new file mode 100644 index 0000000..0509b2d --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + + + + + Common + + + + + Update interval (seconds) + + + + + Temperature bar width + + + + + Temperature scale + + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + + + + + Warning about high temperature + + + + + Sensors + + + + + Detected chips: + + + + + Chip features: + + + + + Enabled + + + + + Label + + + + + Color + + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ar.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ar.desktop new file mode 100644 index 0000000..53317de --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ar.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[ar]=إستشعار +Comment[ar]=عرض قراءة من إستشعار لأجهزة (حاليا lm_sensors) diff --git a/plugin-sensors/translations/sensors_de_DE.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ca.desktop similarity index 56% rename from plugin-sensors/translations/sensors_de_DE.desktop rename to lxqt-panel/plugin-sensors/translations/sensors_ca.desktop index 34012ef..3a5aa64 100644 --- a/plugin-sensors/translations/sensors_de_DE.desktop +++ b/lxqt-panel/plugin-sensors/translations/sensors_ca.desktop @@ -6,5 +6,5 @@ Comment=View readings from hardware sensors. # Translations -Name[de_DE]=Sensoren -Comment[de_DE]=Zeige die Sensorwerte der Hardware-Sensoren (momentan lm_sensors) +Name[ca]=Sensors +Comment[ca]=Veure dades provinents dels sensors (actualment lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ca.ts b/lxqt-panel/plugin-sensors/translations/sensors_ca.ts new file mode 100644 index 0000000..2be5bef --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ca.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + + + + + Common + + + + + Update interval (seconds) + + + + + Temperature bar width + + + + + Temperature scale + + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + + + + + Warning about high temperature + + + + + Sensors + Sensors + + + + Detected chips: + + + + + Chip features: + + + + + Enabled + + + + + Label + + + + + Color + + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_cs.desktop b/lxqt-panel/plugin-sensors/translations/sensors_cs.desktop new file mode 100644 index 0000000..8a4e3b1 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_cs.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[cs]=Čidla +Comment[cs]=Zobrazit odečty z hardwarových čidel (nyní lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_cs.ts b/lxqt-panel/plugin-sensors/translations/sensors_cs.ts new file mode 100644 index 0000000..1394911 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_cs.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Nastavení čidel + + + + Sensors Settings + + + + + Common + Běžné + + + + Update interval (seconds) + Obnovovací interval (v sekundách) + + + + Temperature bar width + Šířka proužku s teplotou + + + + Temperature scale + Teplotní stupnice + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Blikat proužky ukazujícími nárůst teploty, když je teplota příliš vysoká + + + + Warning about high temperature + Varování při vysoké teplotě + + + + Sensors + Čidla + + + + Detected chips: + Zjištěné čipy: + + + + Chip features: + Vlastnosti čipů: + + + + Enabled + Povoleno + + + + Label + Štítek + + + + Color + Barva + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.desktop b/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.desktop new file mode 100644 index 0000000..0a99921 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[cs_CZ]=Čidla +Comment[cs_CZ]=Zobrazit odečty z hardwarových čidel (nyní lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.ts b/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.ts new file mode 100644 index 0000000..d0cf8e5 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_cs_CZ.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Nastavení čidel + + + + Sensors Settings + + + + + Common + Běžné + + + + Update interval (seconds) + Obnovovací interval (v sekundách) + + + + Temperature bar width + Šířka proužku s teplotou + + + + Temperature scale + Teplotní stupnice + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Blikat proužky ukazujícími nárůst teploty, když je teplota příliš vysoká + + + + Warning about high temperature + Varování při vysoké teplotě + + + + Sensors + Čidla + + + + Detected chips: + Zjištěné čipy: + + + + Chip features: + Vlastnosti čipů: + + + + Enabled + Povoleno + + + + Label + Štítek + + + + Color + Barva + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_da.desktop b/lxqt-panel/plugin-sensors/translations/sensors_da.desktop new file mode 100644 index 0000000..c478888 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_da.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[da]=Sensorer +Comment[da]=Vis målinger fra hardware-sensorer (I øjeblikket lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_da_DK.desktop b/lxqt-panel/plugin-sensors/translations/sensors_da_DK.desktop new file mode 100644 index 0000000..d7f1d6c --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_da_DK.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[da_DK]=Sensorer +Comment[da_DK]=Vis målinger fra hardware-sensorer (I øjeblikket lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_da_DK.ts b/lxqt-panel/plugin-sensors/translations/sensors_da_DK.ts new file mode 100644 index 0000000..5194907 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_da_DK.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Indstillinger for LxQt Sensorer + + + + Sensors Settings + + + + + Common + Fælles + + + + Update interval (seconds) + Opdateringsinterval (sekunder) + + + + Temperature bar width + Temperaturbjælke bredde + + + + Temperature scale + Temperaturskala + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Blink statuslinjer når temperaturen er for høj + + + + Warning about high temperature + Advarsel om høj temperatur + + + + Sensors + Sensorer + + + + Detected chips: + Fundne chipsæt: + + + + Chip features: + Chipsæt funktioner: + + + + Enabled + Aktiveret + + + + Label + Identifikation + + + + Color + Farve + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_de.desktop b/lxqt-panel/plugin-sensors/translations/sensors_de.desktop new file mode 100644 index 0000000..f71d2a6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Sensoren +Comment[de]=Messwerte der Hardware-Sensoren anzeigen. diff --git a/plugin-sensors/translations/sensors_de_DE.ts b/lxqt-panel/plugin-sensors/translations/sensors_de.ts similarity index 82% rename from plugin-sensors/translations/sensors_de_DE.ts rename to lxqt-panel/plugin-sensors/translations/sensors_de.ts index 1a94761..eb1dea4 100644 --- a/plugin-sensors/translations/sensors_de_DE.ts +++ b/lxqt-panel/plugin-sensors/translations/sensors_de.ts @@ -1,16 +1,12 @@ - + LxQtSensorsConfiguration - - LxQt Sensors Settings - LxQt Sensor Einstellungen - Sensors Settings - + Sensor-Einstellungen @@ -20,12 +16,12 @@ Update interval (seconds) - Aktualisierungs Intervall (Sekunden) + Aktualisierungsintervall (Sekunden) Temperature bar width - Temperaturbalken Breite + Temperaturbalkenbreite @@ -50,7 +46,7 @@ Warning about high temperature - Warnung über zu hohe Temperaturen + Warnung bei zu hoher Temperatur @@ -60,25 +56,25 @@ Detected chips: - Erkannte Chips: + Erkannte Bausteine: Chip features: - Chip Eigenschaften: + Bausteineigenschaften: - + Enabled Aktiviert - + Label Bezeichnung - + Color Farbe diff --git a/lxqt-panel/plugin-sensors/translations/sensors_el_GR.desktop b/lxqt-panel/plugin-sensors/translations/sensors_el_GR.desktop new file mode 100644 index 0000000..974d432 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_el_GR.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[el_GR]=Αισθητήρες +Comment[el_GR]=Προβολή ενδείξεων αισθητήρων υλικού (τρέχον lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_el_GR.ts b/lxqt-panel/plugin-sensors/translations/sensors_el_GR.ts new file mode 100644 index 0000000..9ab37bd --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_el_GR.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Ρυθμίσεις αισθητήρων LxQt + + + + Sensors Settings + + + + + Common + Κοινές επιλογές + + + + Update interval (seconds) + Διάστημα ανανέωσης (δευτερόλεπτα) + + + + Temperature bar width + Πλάτος γραμμής θερμοκρασίας + + + + Temperature scale + Κλίμακα θερμοκρασίας + + + + Celsius + Κελσίου + + + + Fahrenheit + Φαρενάιτ + + + + Blink progress bars when the temperature is too high + Αναβόσβημα γραμμών προόδου, ​​όταν η θερμοκρασία είναι πολύ υψηλή + + + + Warning about high temperature + Προειδοποίηση υψηλής θερμοκρασίας + + + + Sensors + Αισθητήρες + + + + Detected chips: + Ανιχνευμένα + + + + Chip features: + Χαρακτηριστικά κυκλώματος + + + + Enabled + Ενεργοποιημένο + + + + Label + Ετικέτα + + + + Color + Χρώμα + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_eo.desktop b/lxqt-panel/plugin-sensors/translations/sensors_eo.desktop new file mode 100644 index 0000000..03c33d9 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_eo.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[eo]=Sentiloj +Comment[eo]=Vidi legojn de sentiloj (aktuale lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_es.desktop b/lxqt-panel/plugin-sensors/translations/sensors_es.desktop new file mode 100644 index 0000000..e584923 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_es.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[es]=Sensores +Comment[es]=Ver las lecturas de los sensores de harware (Actualmente lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_es.ts b/lxqt-panel/plugin-sensors/translations/sensors_es.ts new file mode 100644 index 0000000..6b4036d --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_es.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Opciones de Sensores de LxQt + + + + Sensors Settings + + + + + Common + Común + + + + Update interval (seconds) + Intervalo de actualización (segundos) + + + + Temperature bar width + Ancho de la barra de temperatura + + + + Temperature scale + Escala de temperatura + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Parpadeo en las barras de progreso cuando la temperatura es demasiado alta + + + + Warning about high temperature + Advertencia cuando la temperatura sea alta + + + + Sensors + Sensores + + + + Detected chips: + Chips detectado: + + + + Chip features: + Características del chip: + + + + Enabled + Habilitado + + + + Label + Etiqueta + + + + Color + Color + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_es_VE.desktop b/lxqt-panel/plugin-sensors/translations/sensors_es_VE.desktop new file mode 100644 index 0000000..6eef263 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_es_VE.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[es_VE]=Sensores +Comment[es_VE]=Ver las lecturas desde los sensores (actualmente lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_es_VE.ts b/lxqt-panel/plugin-sensors/translations/sensors_es_VE.ts new file mode 100644 index 0000000..46578b1 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_es_VE.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + preferencias de sensor LxQt + + + + Sensors Settings + + + + + Common + Comunes + + + + Update interval (seconds) + Intervalo de actualizacion (segundos) + + + + Temperature bar width + Ancho de la barra indicadora + + + + Temperature scale + Escala de temperatura + + + + Celsius + Celcios + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + parpadear la barra de indicacion cuando la temperatura es alta + + + + Warning about high temperature + Advertir acerca de altas temperaturas + + + + Sensors + Sensores + + + + Detected chips: + Chips detectados + + + + Chip features: + Chips caracteristicas: + + + + Enabled + Habilitado + + + + Label + Etiqueta + + + + Color + Color + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_eu.desktop b/lxqt-panel/plugin-sensors/translations/sensors_eu.desktop new file mode 100644 index 0000000..ff100cd --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_eu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[eu]=Sentsoreak +Comment[eu]=Ikusi hardware-sentsoreen irakurketak (unean lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_eu.ts b/lxqt-panel/plugin-sensors/translations/sensors_eu.ts new file mode 100644 index 0000000..e247486 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_eu.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + LxQt sentsoreen ezarpenak + + + + Sensors Settings + + + + + Common + Komuna + + + + Update interval (seconds) + Eguneraketa tartea (segundoak) + + + + Temperature bar width + Tenperatura-barraren zabalera + + + + Temperature scale + Tenperaturaren eskala + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Kliskatu aurrerapen-barrak tenperatura altuegia denean + + + + Warning about high temperature + Tenperatura altuari buruzko abisua + + + + Sensors + Sentsoreak + + + + Detected chips: + Detektatutako txipak + + + + Chip features: + Txiparen ezaugarriak: + + + + Enabled + Gaituta + + + + Label + Etiketa + + + + Color + Kolorea + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_fi.desktop b/lxqt-panel/plugin-sensors/translations/sensors_fi.desktop new file mode 100644 index 0000000..f71dad5 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_fi.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[fi]=Sensorit +Comment[fi]=Katso laitteistosensorien tuottamia lukuja (tällä hetkellä lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_fi.ts b/lxqt-panel/plugin-sensors/translations/sensors_fi.ts new file mode 100644 index 0000000..483bf94 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_fi.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + + + + + Common + + + + + Update interval (seconds) + Päivitysväli (sekunneissa) + + + + Temperature bar width + + + + + Temperature scale + + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + + + + + Warning about high temperature + Varoitus korkeasta lämpötilasta + + + + Sensors + + + + + Detected chips: + + + + + Chip features: + + + + + Enabled + Käytössä + + + + Label + Nimike + + + + Color + Väri + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.desktop b/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.desktop new file mode 100644 index 0000000..8c8bb4a --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[fr_FR]=Capteurs +Comment[fr_FR]=Voir les mesures effectuées par les capteurs (actuellement lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.ts b/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.ts new file mode 100644 index 0000000..e10e395 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_fr_FR.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + + + + + Common + + + + + Update interval (seconds) + + + + + Temperature bar width + + + + + Temperature scale + + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + + + + + Warning about high temperature + + + + + Sensors + Capteurs + + + + Detected chips: + + + + + Chip features: + + + + + Enabled + + + + + Label + + + + + Color + + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_hu.desktop b/lxqt-panel/plugin-sensors/translations/sensors_hu.desktop new file mode 100644 index 0000000..0a041a6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_hu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[hu]=Érzékelők +Comment[hu]=Megjeleníti a gépbe épített érzékelők értékeit. diff --git a/lxqt-panel/plugin-sensors/translations/sensors_hu.ts b/lxqt-panel/plugin-sensors/translations/sensors_hu.ts new file mode 100644 index 0000000..610033c --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_hu.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_hu_HU.ts b/lxqt-panel/plugin-sensors/translations/sensors_hu_HU.ts new file mode 100644 index 0000000..e0deadc --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_hu_HU.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_it_IT.desktop b/lxqt-panel/plugin-sensors/translations/sensors_it_IT.desktop new file mode 100644 index 0000000..928c30a --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_it_IT.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[it_IT]=Sensori +Comment[it_IT]=Visualizza i valori rilevati dai sensori hardware (attualmente lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_it_IT.ts b/lxqt-panel/plugin-sensors/translations/sensors_it_IT.ts new file mode 100644 index 0000000..180f6be --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_it_IT.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Impostazioni dei sensori di LxQt + + + + Sensors Settings + + + + + Common + Comune + + + + Update interval (seconds) + Intervallo di aggiornamento (secondi) + + + + Temperature bar width + Larghezza della barra della temperatura + + + + Temperature scale + Scala della temperatura + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Barre di avanzamento lampeggianti quando la temperatura è troppo elevata + + + + Warning about high temperature + Avvertimento per la temperatura elevata + + + + Sensors + Sensori + + + + Detected chips: + Chip rilevati: + + + + Chip features: + Caratteristiche del chip: + + + + Enabled + Attivato + + + + Label + Etichetta + + + + Color + Colore + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ja.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ja.desktop new file mode 100644 index 0000000..f9471f6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ja.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[ja]=センサー +Comment[ja]=ハードウェアセンサからの測定値を表示します diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ja.ts b/lxqt-panel/plugin-sensors/translations/sensors_ja.ts new file mode 100644 index 0000000..4ede2b0 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ja.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + センサーウィジェットの設定 + + + + Common + 共通 + + + + Update interval (seconds) + 更新頻度(秒) + + + + Temperature bar width + 温度バーの幅 + + + + Temperature scale + 温度の単位 + + + + Celsius + 摂氏 + + + + Fahrenheit + 華氏 + + + + Blink progress bars when the temperature is too high + 高温時にバーを点滅 + + + + Warning about high temperature + 高温時に警告 + + + + Sensors + センサー + + + + Detected chips: + 検出されたチップ + + + + Chip features: + チップの機能: + + + + Enabled + 有効 + + + + Label + ラベル + + + + Color + + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_lt.desktop b/lxqt-panel/plugin-sensors/translations/sensors_lt.desktop new file mode 100644 index 0000000..87d5565 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_lt.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[lt]=Jutikliai +Comment[lt]=Rodo nuskaitymus iš jutiklių (lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_nl.desktop b/lxqt-panel/plugin-sensors/translations/sensors_nl.desktop new file mode 100644 index 0000000..dd33760 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_nl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[nl]=Sensoren +Comment[nl]=Bekijk metingen van hardware sensoren (op dit moment lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.desktop b/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.desktop new file mode 100644 index 0000000..42bf567 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[pl_PL]=Czujniki +Comment[pl_PL]=Pokaż wskazania z czujników (aktualnie lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.ts b/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.ts new file mode 100644 index 0000000..1d616ca --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pl_PL.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Ustawienia LxQt Sensors + + + + Sensors Settings + + + + + Common + Ogólne + + + + Update interval (seconds) + Częstotliwość odświeżania (sekundy) + + + + Temperature bar width + Szerokość paska stanu temperatury + + + + Temperature scale + Skala temperatury + + + + Celsius + Celsjusz + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Mruganie pasków stanu kiedy temperatura jest za wysoka + + + + Warning about high temperature + Ostrzeżenie o wysokiej temperaturze + + + + Sensors + Sensory + + + + Detected chips: + Wykryte chipy: + + + + Chip features: + Cechy chipu: + + + + Enabled + Włączone + + + + Label + Etykieta + + + + Color + Kolor + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pt.desktop b/lxqt-panel/plugin-sensors/translations/sensors_pt.desktop new file mode 100644 index 0000000..88a4ae2 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pt.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + +# Translations +Name[pt]=Sensores +Comment[pt]=Consultar as leituras dos sensores. diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pt.ts b/lxqt-panel/plugin-sensors/translations/sensors_pt.ts new file mode 100644 index 0000000..e16dcf6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pt.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Definições dos sensores do LxQt + + + + Sensors Settings + + + + + Common + Geral + + + + Update interval (seconds) + Intervalo de atualização (segundos) + + + + Temperature bar width + Largura da barra de temperatura + + + + Temperature scale + Unidade de medida + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Barras de evolução intermitentes se a temperatura for elevada + + + + Warning about high temperature + Avisar sobre a temperatura elevada + + + + Sensors + Sensores + + + + Detected chips: + Circuitos detetados: + + + + Chip features: + Funcionalidades do circuito: + + + + Enabled + Ativo + + + + Label + Texto + + + + Color + Cor + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.desktop b/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.desktop new file mode 100644 index 0000000..7e68f5d --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[pt_BR]=Sensores +Comment[pt_BR]=Visualizar as leituras dos sensores de hardware (atualmente do lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.ts b/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.ts new file mode 100644 index 0000000..355723a --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_pt_BR.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Configuraçoes Dos Sensores + + + + Sensors Settings + + + + + Common + Comum + + + + Update interval (seconds) + Intervalo de atualização (segundos) + + + + Temperature bar width + Temperatura em barra com + + + + Temperature scale + Temperatura em escala + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Piscar a barra de progresso quando a temperatura está muito alta + + + + Warning about high temperature + Alertar sobre a alta temperatura + + + + Sensors + Sensores + + + + Detected chips: + Chips detectados: + + + + Chip features: + Características do chips: + + + + Enabled + Habilitado + + + + Label + Rótulo + + + + Color + Cor + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.desktop new file mode 100644 index 0000000..e2338d9 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[ro_RO]=Senzori +Comment[ro_RO]=Vizualizează citirile senzorilor hardware (momentan lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.ts b/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.ts new file mode 100644 index 0000000..c15eb19 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ro_RO.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + + + + + Common + + + + + Update interval (seconds) + Interval de actualizare (secunde) + + + + Temperature bar width + + + + + Temperature scale + + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + + + + + Warning about high temperature + + + + + Sensors + Senzori + + + + Detected chips: + + + + + Chip features: + + + + + Enabled + + + + + Label + Etichetă + + + + Color + Culoare + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ru.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ru.desktop new file mode 100644 index 0000000..7318586 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ru.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[ru]=Сенсоры +Comment[ru]=Посмотреть данные с аппаратных сенсоров. \ No newline at end of file diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ru.ts b/lxqt-panel/plugin-sensors/translations/sensors_ru.ts new file mode 100644 index 0000000..292f093 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ru.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Настройки сенсоров + + + + Common + Общие + + + + Update interval (seconds) + Интервал обновления (секунды) + + + + Temperature bar width + Ширина температурной шкалы + + + + Temperature scale + Температурная шкала + + + + Celsius + По Цельсию + + + + Fahrenheit + По Фаренгейту + + + + Blink progress bars when the temperature is too high + Мигать индикатором состояния когда температура слишком высока + + + + Warning about high temperature + Предупреждать о высокой температуре + + + + Sensors + Сенсоры + + + + Detected chips: + Обнаруженые чипы: + + + + Chip features: + Возможности чипов: + + + + Enabled + Включён + + + + Label + Метка + + + + Color + Цвет + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.desktop b/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.desktop new file mode 100644 index 0000000..d87797a --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[ru_RU]=Сенсоры +Comment[ru_RU]=Посмотреть данные с аппаратных сенсоров. \ No newline at end of file diff --git a/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.ts b/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.ts new file mode 100644 index 0000000..e71a227 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_ru_RU.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Настройки сенсоров + + + + Common + Общие + + + + Update interval (seconds) + Интервал обновления (секунды) + + + + Temperature bar width + Ширина температурной шкалы + + + + Temperature scale + Температурная шкала + + + + Celsius + По Цельсию + + + + Fahrenheit + По Фаренгейту + + + + Blink progress bars when the temperature is too high + Мигать индикатором состояния когда температура слишком высока + + + + Warning about high temperature + Предупреждать о высокой температуре + + + + Sensors + Сенсоры + + + + Detected chips: + Обнаруженые чипы: + + + + Chip features: + Возможности чипов: + + + + Enabled + Включён + + + + Label + Метка + + + + Color + Цвет + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_sl.desktop b/lxqt-panel/plugin-sensors/translations/sensors_sl.desktop new file mode 100644 index 0000000..8f19cd7 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_sl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[sl]=Senzorji +Comment[sl]=Oglejte si meritve senzorjev za strojno opremo (trenutno lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_th_TH.desktop b/lxqt-panel/plugin-sensors/translations/sensors_th_TH.desktop new file mode 100644 index 0000000..08619d6 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_th_TH.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[th_TH]=ตัวตรวจจับ +Comment[th_TH]=ดูข้อมูลที่ตัวตรวจจับฮาร์ดแวร์อ่านได้ (lm_sensors โดยปัจจุบัน) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_th_TH.ts b/lxqt-panel/plugin-sensors/translations/sensors_th_TH.ts new file mode 100644 index 0000000..8e97b20 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_th_TH.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + ค่าตั้งตัวตรวจจับ LxQt + + + + Sensors Settings + + + + + Common + ทั่วไป + + + + Update interval (seconds) + ทิ้งระยะการปรับข้อมูล (วินาที) + + + + Temperature bar width + ความกว้างแถบแสดงอุณหภูมิ + + + + Temperature scale + หน่วยของอุณหภูมิ + + + + Celsius + เซลเซียส + + + + Fahrenheit + ฟาห์เรนไฮต์ + + + + Blink progress bars when the temperature is too high + กระพริบตรงแถบเมื่ออุณหภูมิสูงเกินไป + + + + Warning about high temperature + การเตือนเกี่ยวกับอุณภูมิที่สูงเกินไป + + + + Sensors + ตัวตรวจจับ + + + + Detected chips: + ชิปที่พบ: + + + + Chip features: + คุณสมบัติชิป: + + + + Enabled + เปิดใช้ + + + + Label + ป้าย + + + + Color + สี + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_tr.desktop b/lxqt-panel/plugin-sensors/translations/sensors_tr.desktop new file mode 100644 index 0000000..1a7aad7 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_tr.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[tr]=Algılayıcılar +Comment[tr]=Donanım algılayıcılarının okudukları değerleri görüntüleyin (şimdilik lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_uk.desktop b/lxqt-panel/plugin-sensors/translations/sensors_uk.desktop new file mode 100644 index 0000000..761bef9 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_uk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[uk]=Сенсори +Comment[uk]=Показати дані апаратних сенсорів (lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_uk.ts b/lxqt-panel/plugin-sensors/translations/sensors_uk.ts new file mode 100644 index 0000000..30d6a98 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_uk.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + Налаштування сенсорів LxQt + + + + Sensors Settings + + + + + Common + Загальне + + + + Update interval (seconds) + Період поновлення (в секундах) + + + + Temperature bar width + Ширина планки температури + + + + Temperature scale + Шкала температури + + + + Celsius + Цельсія + + + + Fahrenheit + Фаренгейта + + + + Blink progress bars when the temperature is too high + Блимати планками прогресу при занадто високій температурі + + + + Warning about high temperature + Попереджати про високу температуру + + + + Sensors + Сенсори + + + + Detected chips: + Виявлені мікросхеми: + + + + Chip features: + Особливості мікросхеми: + + + + Enabled + Включено + + + + Label + Позначка + + + + Color + Колір + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.desktop b/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.desktop new file mode 100644 index 0000000..4c5edfc --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[zh_CN]=传感器 +Comment[zh_CN]=查看硬件传感器数据(当前是 lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.ts b/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.ts new file mode 100644 index 0000000..e3b8010 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_zh_CN.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + LxQt 监测器设置 + + + + Sensors Settings + + + + + Common + 常规 + + + + Update interval (seconds) + 更新间隔(秒) + + + + Temperature bar width + 温度条宽度 + + + + Temperature scale + 温标 + + + + Celsius + 摄氏度 + + + + Fahrenheit + 华氏度 + + + + Blink progress bars when the temperature is too high + 温度过高时闪动进度条 + + + + Warning about high temperature + 高温警告 + + + + Sensors + 监测器 + + + + Detected chips: + 已测芯片: + + + + Chip features: + 芯片功能: + + + + Enabled + 已启用 + + + + Label + 标注 + + + + Color + 颜色 + + + diff --git a/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.desktop b/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.desktop new file mode 100644 index 0000000..d132394 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Sensors +Comment=View readings from hardware sensors. + + +# Translations +Name[zh_TW]=感應器 +Comment[zh_TW]=從硬體感應器中檢視(現在為 lm_sensors) diff --git a/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.ts b/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.ts new file mode 100644 index 0000000..428d7c2 --- /dev/null +++ b/lxqt-panel/plugin-sensors/translations/sensors_zh_TW.ts @@ -0,0 +1,86 @@ + + + + + LxQtSensorsConfiguration + + LxQt Sensors Settings + LxQt溫度感應設定 + + + + Sensors Settings + + + + + Common + 一般 + + + + Update interval (seconds) + 更新間隔(秒) + + + + Temperature bar width + 溫度計寬度 + + + + Temperature scale + 溫標 + + + + Celsius + 攝氏 + + + + Fahrenheit + 華式 + + + + Blink progress bars when the temperature is too high + 當溫度太高時溫度計閃爍 + + + + Warning about high temperature + 高溫警告 + + + + Sensors + 感應器 + + + + Detected chips: + 偵測晶片: + + + + Chip features: + 晶片資訊 + + + + Enabled + 允許 + + + + Label + 標籤 + + + + Color + 顏色 + + + diff --git a/lxqt-panel/plugin-showdesktop/CMakeLists.txt b/lxqt-panel/plugin-showdesktop/CMakeLists.txt new file mode 100644 index 0000000..8913718 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/CMakeLists.txt @@ -0,0 +1,18 @@ +set(PLUGIN "showdesktop") + +set(HEADERS + showdesktop.h +) + +set(SOURCES + showdesktop.cpp +) + +set(LIBRARIES + ${LIBRARIES} + lxqt-globalkeys + Qt5Xdg + ${XCB_LIBRARIES} +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-showdesktop/resources/showdesktop.desktop.in b/lxqt-panel/plugin-showdesktop/resources/showdesktop.desktop.in new file mode 100644 index 0000000..3c69e51 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/resources/showdesktop.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop +Icon=user-desktop + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-showdesktop/showdesktop.cpp b/lxqt-panel/plugin-showdesktop/showdesktop.cpp new file mode 100644 index 0000000..aa76831 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/showdesktop.cpp @@ -0,0 +1,79 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "showdesktop.h" + +// Still needed for lxde/lxqt#338 +#include +#include + +#define DEFAULT_SHORTCUT "Control+Alt+D" + +ShowDesktop::ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + m_key = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/show_hide").arg(settings()->group()), tr("Show desktop"), this); + if (m_key) + { + connect(m_key, &GlobalKeyShortcut::Action::registrationFinished, this, &ShowDesktop::shortcutRegistered); + connect(m_key, SIGNAL(activated()), this, SLOT(toggleShowingDesktop())); + } + + QAction * act = new QAction(XdgIcon::fromTheme("user-desktop"), tr("Show Desktop"), this); + connect(act, SIGNAL(triggered()), this, SLOT(toggleShowingDesktop())); + + mButton.setDefaultAction(act); + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +} + +void ShowDesktop::shortcutRegistered() +{ + if (m_key->shortcut().isEmpty()) + { + m_key->changeShortcut(DEFAULT_SHORTCUT); + if (m_key->shortcut().isEmpty()) + { + LxQt::Notification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); + } + } +} + +void ShowDesktop::toggleShowingDesktop() +{ + KWindowSystem::setShowingDesktop(!KWindowSystem::showingDesktop()); +} + +#undef DEFAULT_SHORTCUT diff --git a/lxqt-panel/plugin-showdesktop/showdesktop.h b/lxqt-panel/plugin-showdesktop/showdesktop.h new file mode 100644 index 0000000..4e1e9a1 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/showdesktop.h @@ -0,0 +1,75 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SHOWDESKTOP_H +#define SHOWDESKTOP_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +namespace GlobalKeyShortcut +{ +class Action; +} + +class ShowDesktop : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "ShowDesktop"; } +private: + GlobalKeyShortcut::Action * m_key; + +private slots: + void toggleShowingDesktop(); + void shortcutRegistered(); + +private: + QToolButton mButton; +}; + +class ShowDesktopLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new ShowDesktop(startupInfo); + } +}; + + +#endif + diff --git a/plugin-showdesktop/translations/showdesktop_de_DE.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop.ts similarity index 59% rename from plugin-showdesktop/translations/showdesktop_de_DE.ts rename to lxqt-panel/plugin-showdesktop/translations/showdesktop.ts index 19ac187..a6c2691 100644 --- a/plugin-showdesktop/translations/showdesktop_de_DE.ts +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop.ts @@ -1,6 +1,6 @@ - + ShowDesktop @@ -9,14 +9,14 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - Zeige Desktop: Globales Tastenkürzel '%1' kann nicht vergeben werden + - + Show Desktop - Zeige Desktop + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.desktop new file mode 100644 index 0000000..a69d729 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=تصغير كافَّة النَّوافذ وإظهار سطح المكتب +Name[ar]=إظهار سطح المكتب diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.ts new file mode 100644 index 0000000..e2b1e08 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ar.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` + + + + Show Desktop + إظهار سطح المكتب + + + diff --git a/plugin-showdesktop/translations/showdesktop_de_DE.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.desktop similarity index 66% rename from plugin-showdesktop/translations/showdesktop_de_DE.desktop rename to lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.desktop index dbcc5c5..0293bb5 100644 --- a/plugin-showdesktop/translations/showdesktop_de_DE.desktop +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.desktop @@ -8,5 +8,5 @@ Comment=Minimize all windows and show the desktop # Translations -Comment[de_DE]=Alle Fenster minimieren und Desktop anzeigen -Name[de_DE]=Desktop anzeigen +Comment[cs]=Zmenšit všechna okna a ukázat plochu +Name[cs]=Ukázat plochu diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.ts new file mode 100644 index 0000000..8093964 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Ukázat plochu: Celkovou zkratku '%1' nelze zapsat + + + + Show Desktop + Ukázat pracovní plochu + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.desktop new file mode 100644 index 0000000..5bd303e --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Zmenšit všechna okna a ukázat pracovní plochu +Name[cs_CZ]=Ukázat pracovní plochu diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.ts new file mode 100644 index 0000000..cdaae29 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_cs_CZ.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Ukázat plochu: Celkovou zkratku '%1' nelze zapsat + + + + Show Desktop + Ukázat pracovní plochu + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.desktop new file mode 100644 index 0000000..20cfdf6 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Minimerer alle programmer og viser skrivebord +Name[da]=Vis Skrivebord diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.ts new file mode 100644 index 0000000..ab2af5c --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da.ts @@ -0,0 +1,30 @@ + + + + + ShowDesktop + + Global keyboard shortcut + Global tastaturgenvej + + + Panel Show Desktop Global shortcut: '%1' cannot be registered + Global genvej for Vis Skrivebord : '%1' kan ikke registreres + + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Vis skrivebord + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.desktop new file mode 100644 index 0000000..a344476 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Minimer alle vinduer og vis skrivebord +Name[da_DK]=Vis Skrivebord diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.ts new file mode 100644 index 0000000..158a56f --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_da_DK.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Vis Skrivebord: Global genvej '%1' kan ikke registreres + + + + Show Desktop + Vis Skrivebord + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.desktop new file mode 100644 index 0000000..b79fdc3 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Arbeitsfläche anzeigen +Comment[de]=Alle Fenster minimieren und die Arbeitsfläche anzeigen diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.ts new file mode 100644 index 0000000..f00c7af --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_de.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + Arbeitsfläche anzeigen + + + + Show Desktop + Arbeitsfläche anzeigen + + + + Show Desktop: Global shortcut '%1' cannot be registered + Das globale Tastaturkürzel zum Arbeitsfläche anzeigen '%1' kann nicht registriert werden + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.desktop new file mode 100644 index 0000000..d0db21b --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Ελαχιστοποίηση όλων των παραθύρων και εμφάνιση της επιφάνειας εργασίας +Name[el_GR]=Εμφάνιση επιφάνειας εργασίας diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.ts new file mode 100644 index 0000000..27c2144 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_el_GR.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" + + + + Show Desktop + Εμφάνιση επιφάνειας εργασίας + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.desktop new file mode 100644 index 0000000..6e5cccd --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Malmaksimigi ĉiujn fenestrojn kaj montri la labortablon +Name[eo]=Montri labortablon diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.ts new file mode 100644 index 0000000..c4bfe66 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eo.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Montri labortablon: ĉiea klavkombino '%1' ne registreblas + + + + Show Desktop + Montri labortablon + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.desktop new file mode 100644 index 0000000..69340c4 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Minimiza todas las ventanas y muestra el escritorio +Name[es]=Mostrar escritorio diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.ts new file mode 100644 index 0000000..d947a16 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar Escritorio: Atajo global '%1' no puede ser registrado + + + + Show Desktop + Mostrar Escritorio + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.desktop new file mode 100644 index 0000000..431d545 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Minimiza todas las ventanas de todos los escritorios +Name[es_VE]=Mostrar Escritorio diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.ts new file mode 100644 index 0000000..d310ccc --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_es_VE.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse + + + + Show Desktop + Mostrar Escritorio + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.desktop new file mode 100644 index 0000000..5cd784d --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Minimizatu leiho guztiak eta erakutsi mahaigaina +Name[eu]=Erakutsi mahaigaina diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.ts new file mode 100644 index 0000000..65f79ca --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_eu.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu + + + + Show Desktop + Erakutsi mahaigaina + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.desktop new file mode 100644 index 0000000..7aea315 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Pienennä kaikki ikkunat ja näytä työpöytä +Name[fi]=Näytä työpöytä diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.ts new file mode 100644 index 0000000..24025ec --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fi.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä + + + + Show Desktop + Näytä työpöytä + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.desktop new file mode 100644 index 0000000..83710dd --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Minimiser toutes les fenêtres et montrer le bureau +Name[fr_FR]=Montrer le bureau diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.ts new file mode 100644 index 0000000..ebf9d2d --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_fr_FR.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Montrer le bureau : le raccourci global '%1' ne peut pas être défini + + + + Show Desktop + Montrer le bureau + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.desktop new file mode 100644 index 0000000..c52c3ff --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Minimalizálja az összes ablakot és megjeleníti az asztalt +Name[hu]=Az asztal megjelenítése diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.ts new file mode 100644 index 0000000..8975255 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + Asztalmegjelenítés + + + + Show Desktop: Global shortcut '%1' cannot be registered + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható + + + + Show Desktop + Asztalmegjelenítés + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu_HU.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu_HU.ts new file mode 100644 index 0000000..a3dfb55 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_hu_HU.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + Asztalmegjelenítés + + + + Show Desktop: Global shortcut '%1' cannot be registered + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható + + + + Show Desktop + Asztalmegjelenítés + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.desktop new file mode 100644 index 0000000..6b0d1ac --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show Desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.ts new file mode 100644 index 0000000..e6ab8cb --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ia.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.desktop new file mode 100644 index 0000000..9287947 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[id_ID]=Kecilkan seluruh jendela dan tampilkan desktop +Name[id_ID]=Tampilkan Desktop diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.ts new file mode 100644 index 0000000..2b356d5 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_id_ID.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Tampilkan Desktop + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.desktop new file mode 100644 index 0000000..1b6bd6e --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Minimizza tutte le finestre e mostra il desktop +Name[it_IT]=Mostra desktop diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.ts new file mode 100644 index 0000000..f879db9 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_it_IT.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Mostra desktop: la scorciatoia globale '%1' non può essere registrata + + + + Show Desktop + Mostra desktop + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.desktop new file mode 100644 index 0000000..04c5c2f --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=全ウィンドウ最小化やデスクトップ表示を可能にします +Name[ja]=デスクトップ表示 diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.ts new file mode 100644 index 0000000..19d0152 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ja.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + デスクトップの表示: グローバルなショートカット '%1' は登録できません + + + + Show Desktop + デスクトップを表示 + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.desktop new file mode 100644 index 0000000..6b0d1ac --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show Desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.ts new file mode 100644 index 0000000..bc35785 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ko.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.desktop new file mode 100644 index 0000000..aab7a00 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Sumažina visus langus ir rodo darbalaukį +Name[lt]=Darbalaukio rodymas diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.ts new file mode 100644 index 0000000..e15e2b0 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_lt.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas + + + + Show Desktop + Rodyti darbalaukį + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.desktop new file mode 100644 index 0000000..d6e909f --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Minimaliseer alle vensters en toon het bureaublad +Name[nl]=Toon Bureaublad diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.ts new file mode 100644 index 0000000..bdaf9c0 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_nl.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd + + + + Show Desktop + Toon bureaublad + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl.desktop new file mode 100644 index 0000000..ac0fbc9 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Minimalizuje wszystkie okna i pokazuje pulpit +Name[pl]=Pokaż pulpit diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.desktop new file mode 100644 index 0000000..c99a9b3 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Minimalizuj wszystkie okna i pokaż pulpit +Name[pl_PL]=Pokaż pulpit diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.ts new file mode 100644 index 0000000..9793ae5 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pl_PL.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany + + + + Show Desktop + Pokaż pulpit + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.desktop new file mode 100644 index 0000000..accd4e7 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Mostrar área de trabalho +Comment[pt]=Minimizar janelas e mostrar a área de trabalho diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.ts new file mode 100644 index 0000000..1ae73d2 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Tecla de atalho global: '%1' não pode ser registada + + + + Show Desktop + Mostrar área de trabalho + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.desktop new file mode 100644 index 0000000..6026f06 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Minimizar todas as janelas e exibir a área de trabalho +Name[pt_BR]=Exibir a área de trabalho diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.ts new file mode 100644 index 0000000..777d91f --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_pt_BR.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado + + + + Show Desktop + Exibir a área de trabalho + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.desktop new file mode 100644 index 0000000..233de18 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Minimizează toate ferestrele și arată desktopul +Name[ro_RO]=Arată desktopul diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.ts new file mode 100644 index 0000000..9deca7c --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ro_RO.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Afișează desktopul + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.desktop new file mode 100644 index 0000000..531038e --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Свернуть все окна и показать рабочий стол. +Name[ru]=Показать рабочий стол \ No newline at end of file diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.ts new file mode 100644 index 0000000..10a1e7b --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + Показать рабочий стол + + + + Show Desktop: Global shortcut '%1' cannot be registered + Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано + + + + Show Desktop + Показать рабочий стол + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.desktop new file mode 100644 index 0000000..1568456 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Свернуть все окна и показать рабочий стол. +Name[ru_RU]=Показать рабочий стол diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.ts new file mode 100644 index 0000000..c6d4427 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_ru_RU.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + Показать рабочий стол + + + + Show Desktop: Global shortcut '%1' cannot be registered + Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано + + + + Show Desktop + Показать рабочий стол + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk.desktop new file mode 100644 index 0000000..8ca0f81 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Minimalizuje všetky okná a zobrazí plochu +Name[sk]=Zobraziť plochu diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk_SK.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk_SK.ts new file mode 100644 index 0000000..9d31aa4 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sk_SK.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Zobraziť plochu + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.desktop new file mode 100644 index 0000000..3c81888 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Pomanjšajte vsa okna, da se pokaže namizje +Name[sl]=Pokaži namizje diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.ts new file mode 100644 index 0000000..eb9b10a --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sl.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Prikaz namizja: globalne bližnjice »%1« ni moč registrirati + + + + Show Desktop + Pokaži namizje + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr.desktop new file mode 100644 index 0000000..78f7d5a --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Минимизуј све прозоре и прикажи радну површ +Name[sr]=Приказ површи diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavian.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavian.desktop new file mode 100644 index 0000000..d54cd34 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Приказ површи +Comment[sr@ijekavian]=Минимизуј све прозоре и прикажи радну површ diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..35b79e0 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Prikaz površi +Comment[sr@ijekavianlatin]=Minimizuj sve prozore i prikaži radnu površ diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.desktop new file mode 100644 index 0000000..3a76132 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Minimizuj sve prozore i prikaži radnu površ +Name[sr@latin]=Prikaz površi diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.ts new file mode 100644 index 0000000..6a772ca --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr@latin.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_BA.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_BA.ts new file mode 100644 index 0000000..46543f8 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_BA.ts @@ -0,0 +1,30 @@ + + + + + ShowDesktop + + Global keyboard shortcut + Глобална пречица тастатуре + + + Panel Show Desktop Global shortcut: '%1' cannot be registered + Глобална пречица приказа површи за панел: „%1“ не може бити регистрована + + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Прикажи радну површ + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_RS.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_RS.ts new file mode 100644 index 0000000..c5e55e3 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_sr_RS.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + + + + + Show Desktop + Прикажи радну површ + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.desktop new file mode 100644 index 0000000..6a6a97d --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=ย่อเก็บหน้าต่างทั้งหมดและแสดงพื้นโต๊ะ +Name[th_TH]=แสดงพื้นโต๊ะ diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.ts new file mode 100644 index 0000000..ca8ab32 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_th_TH.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ + + + + Show Desktop + แสดงพื้นโต๊ะ + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.desktop new file mode 100644 index 0000000..e54558f --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Tüm pencereleri küçült ve masaüstünü göster +Name[tr]=Masaüstünü Göster diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.ts new file mode 100644 index 0000000..ed70e01 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_tr.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Masaüstünü Göster: '%1' genel kısayolu kaydedilemiyor + + + + Show Desktop + Masaüstünü Göster + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.desktop new file mode 100644 index 0000000..dbe032e --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Згорнути всі вікна та показати стільницю +Name[uk]=Показати стільницю diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.ts new file mode 100644 index 0000000..0229e03 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_uk.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' + + + + Show Desktop + Показати стільницю + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.GB2312.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.GB2312.desktop new file mode 100644 index 0000000..6b0d1ac --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show Desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.desktop new file mode 100644 index 0000000..405e95e --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=最小化所有窗口并显示桌面 +Name[zh_CN]=显示桌面 diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.ts new file mode 100644 index 0000000..33da8b3 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_CN.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + 显示桌面:无法注册全局快捷键'%1' + + + + Show Desktop + 显示桌面 + + + diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.desktop b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.desktop new file mode 100644 index 0000000..e3bc0e3 --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Show desktop +Comment=Minimize all windows and show the desktop + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=將所有視窗縮到最小並顯示桌面 +Name[zh_TW]=顯示桌面 diff --git a/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.ts b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.ts new file mode 100644 index 0000000..4190d5a --- /dev/null +++ b/lxqt-panel/plugin-showdesktop/translations/showdesktop_zh_TW.ts @@ -0,0 +1,22 @@ + + + + + ShowDesktop + + + Show desktop + + + + + Show Desktop: Global shortcut '%1' cannot be registered + 顯示桌面:全域快捷鍵'%1'無法被註冊 + + + + Show Desktop + 顯示桌面 + + + diff --git a/lxqt-panel/plugin-spacer/CMakeLists.txt b/lxqt-panel/plugin-spacer/CMakeLists.txt new file mode 100644 index 0000000..27cf663 --- /dev/null +++ b/lxqt-panel/plugin-spacer/CMakeLists.txt @@ -0,0 +1,17 @@ +set(PLUGIN "spacer") + +set(HEADERS + spacer.h + spacerconfiguration.h +) + +set(SOURCES + spacer.cpp + spacerconfiguration.cpp +) + +set(UIS + spacerconfiguration.ui +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-spacer/resources/spacer.desktop.in b/lxqt-panel/plugin-spacer/resources/spacer.desktop.in new file mode 100644 index 0000000..6654498 --- /dev/null +++ b/lxqt-panel/plugin-spacer/resources/spacer.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Spacer +Comment=Space between widgets +Icon=bookmark-new + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-spacer/spacer.cpp b/lxqt-panel/plugin-spacer/spacer.cpp new file mode 100644 index 0000000..49ebad7 --- /dev/null +++ b/lxqt-panel/plugin-spacer/spacer.cpp @@ -0,0 +1,109 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacer.h" +#include "spacerconfiguration.h" +#include + +void SpacerWidget::setType(QString const & type) +{ + if (type != mType) + { + mType = type; + style()->unpolish(this); + style()->polish(this); + } +} + +void SpacerWidget::setOrientation(QString const & orientation) +{ + if (orientation != mOrientation) + { + mOrientation = orientation; + style()->unpolish(this); + style()->polish(this); + } +} + +/************************************************ + + ************************************************/ +Spacer::Spacer(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject() + , ILxQtPanelPlugin(startupInfo) + , mSize(8) +{ + settingsChanged(); +} + +/************************************************ + + ************************************************/ +void Spacer::settingsChanged() +{ + mSize = settings()->value("size", 8).toInt(); + mSpacer.setType(settings()->value("spaceType", SpacerConfiguration::msTypes[0]).toString()); + setSizes(); +} + +/************************************************ + + ************************************************/ +QDialog *Spacer::configureDialog() +{ + return new SpacerConfiguration(settings()); +} + +/************************************************ + + ************************************************/ +void Spacer::setSizes() +{ + if (panel()->isHorizontal()) + { + mSpacer.setOrientation("horizontal"); + mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + mSpacer.setFixedWidth(mSize); + mSpacer.setMinimumHeight(0); + mSpacer.setMaximumHeight(QWIDGETSIZE_MAX); + } + else + { + mSpacer.setOrientation("vertical"); + mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + mSpacer.setFixedHeight(mSize); + mSpacer.setMinimumWidth(0); + mSpacer.setMaximumWidth(QWIDGETSIZE_MAX); + } +} + +/************************************************ + + ************************************************/ +void Spacer::realign() +{ + setSizes(); +} diff --git a/lxqt-panel/plugin-spacer/spacer.h b/lxqt-panel/plugin-spacer/spacer.h new file mode 100644 index 0000000..9fec1e0 --- /dev/null +++ b/lxqt-panel/plugin-spacer/spacer.h @@ -0,0 +1,91 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACER_H +#define SPACER_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class SpacerWidget : public QFrame +{ + Q_OBJECT + + Q_PROPERTY(QString type READ getType) + Q_PROPERTY(QString orientation READ getOrientation) + +public: + const QString& getType() const throw () { return mType; } + void setType(QString const & type); + const QString& getOrientation() const throw () { return mOrientation; } + void setOrientation(QString const & orientation); + +private: + QString mType; + QString mOrientation; +}; + +class Spacer : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + Spacer(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mSpacer; } + virtual QString themeId() const { return "Spacer"; } + + bool isSeparate() const { return true; } + + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + + virtual void realign(); + +private slots: + virtual void settingsChanged(); + +private: + void setSizes(); + +private: + SpacerWidget mSpacer; + int mSize; +}; + +class SpacerPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new Spacer(startupInfo);} +}; + +#endif + diff --git a/lxqt-panel/plugin-spacer/spacerconfiguration.cpp b/lxqt-panel/plugin-spacer/spacerconfiguration.cpp new file mode 100644 index 0000000..60002ae --- /dev/null +++ b/lxqt-panel/plugin-spacer/spacerconfiguration.cpp @@ -0,0 +1,77 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacerconfiguration.h" +#include "ui_spacerconfiguration.h" + + +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList SpacerConfiguration::msTypes = { + QStringLiteral(QT_TR_NOOP("lined")) + , QStringLiteral(QT_TR_NOOP("dotted")) + , QStringLiteral(QT_TR_NOOP("invisible")) +}; + +SpacerConfiguration::SpacerConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::SpacerConfiguration) + , mSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("SpacerConfigurationWindow"); + ui->setupUi(this); + + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msTypes) + ui->typeCB->addItem(tr(type.toStdString().c_str()), type); + + loadSettings(); + + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &SpacerConfiguration::sizeChanged); + connect(ui->typeCB, static_cast(&QComboBox::currentIndexChanged), this, &SpacerConfiguration::typeChanged); +} + +SpacerConfiguration::~SpacerConfiguration() +{ + delete ui; +} + +void SpacerConfiguration::loadSettings() +{ + ui->sizeSB->setValue(mSettings->value("size", 8).toInt()); + ui->typeCB->setCurrentIndex(ui->typeCB->findData(mSettings->value("spaceType", msTypes[0]).toString())); +} + +void SpacerConfiguration::sizeChanged(int value) +{ + mSettings->setValue("size", value); +} + +void SpacerConfiguration::typeChanged(int index) +{ + mSettings->setValue("spaceType", ui->typeCB->itemData(index, Qt::UserRole)); +} diff --git a/lxqt-panel/plugin-spacer/spacerconfiguration.h b/lxqt-panel/plugin-spacer/spacerconfiguration.h new file mode 100644 index 0000000..def3410 --- /dev/null +++ b/lxqt-panel/plugin-spacer/spacerconfiguration.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACERCONFIGURATION_H +#define SPACERCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class SpacerConfiguration; +} + +class SpacerConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit SpacerConfiguration(QSettings *settings, QWidget *parent = 0); + ~SpacerConfiguration(); + +public: + static const QStringList msTypes; + +private: + Ui::SpacerConfiguration *ui; + QSettings *mSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void sizeChanged(int value); + void typeChanged(int index); +}; + +#endif // SPACERCONFIGURATION_H diff --git a/lxqt-panel/plugin-spacer/spacerconfiguration.ui b/lxqt-panel/plugin-spacer/spacerconfiguration.ui new file mode 100644 index 0000000..1ed809f --- /dev/null +++ b/lxqt-panel/plugin-spacer/spacerconfiguration.ui @@ -0,0 +1,70 @@ + + + SpacerConfiguration + + + + 0 + 0 + + + + Spacer Settings + + + + + + Space width: + + + + + + + 4 + + + 2048 + + + 8 + + + + + + + Space type: + + + + + + + false + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttons + clicked(QAbstractButton*) + SpacerConfiguration + close() + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer.ts b/lxqt-panel/plugin-spacer/translations/spacer.ts new file mode 100644 index 0000000..2f4886e --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + + + + + Space width: + + + + + Space type: + + + + + lined + + + + + dotted + + + + + invisible + + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_de.desktop b/lxqt-panel/plugin-spacer/translations/spacer_de.desktop new file mode 100644 index 0000000..c58ea1e --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Spacer +Comment[de]=Stellt den Abstand zwischen den Widgets ein diff --git a/lxqt-panel/plugin-spacer/translations/spacer_de.ts b/lxqt-panel/plugin-spacer/translations/spacer_de.ts new file mode 100644 index 0000000..bea2914 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_de.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Leerraum Einstellungen + + + + Space width: + Leerraumbreite: + + + + Space type: + Leerraumtyp: + + + + lined + liniert + + + + dotted + punktiert + + + + invisible + unsichtbar + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_hu.desktop b/lxqt-panel/plugin-spacer/translations/spacer_hu.desktop new file mode 100644 index 0000000..0f5d07a --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_hu.desktop @@ -0,0 +1,2 @@ +Name[hu]=Távtartó +Comment[hu]=Elemek közötti távolságtartó diff --git a/lxqt-panel/plugin-spacer/translations/spacer_hu.ts b/lxqt-panel/plugin-spacer/translations/spacer_hu.ts new file mode 100644 index 0000000..9ee4d68 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_hu.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_hu_HU.ts b/lxqt-panel/plugin-spacer/translations/spacer_hu_HU.ts new file mode 100644 index 0000000..9394c6c --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_hu_HU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_ru.desktop b/lxqt-panel/plugin-spacer/translations/spacer_ru.desktop new file mode 100644 index 0000000..966c4d8 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Разделитель +Comment[ru]=Промежуток между виджетами diff --git a/lxqt-panel/plugin-spacer/translations/spacer_ru.ts b/lxqt-panel/plugin-spacer/translations/spacer_ru.ts new file mode 100644 index 0000000..23b35f2 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_ru.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.desktop b/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.desktop new file mode 100644 index 0000000..b8c65bf --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Разделитель +Comment[ru_RU]=Промежуток между виджетами diff --git a/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.ts b/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.ts new file mode 100644 index 0000000..2730852 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_ru_RU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/lxqt-panel/plugin-spacer/translations/spacer_sk.ts b/lxqt-panel/plugin-spacer/translations/spacer_sk.ts new file mode 100644 index 0000000..4845e69 --- /dev/null +++ b/lxqt-panel/plugin-spacer/translations/spacer_sk.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Nastavenia medzery + + + + Space width: + Šírka medzery: + + + + Space type: + Typ medzery: + + + + lined + plná čiara + + + + dotted + bodkovaná čiara + + + + invisible + neviditeľná + + + diff --git a/lxqt-panel/plugin-statusnotifier/CMakeLists.txt b/lxqt-panel/plugin-statusnotifier/CMakeLists.txt new file mode 100644 index 0000000..42ea321 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/CMakeLists.txt @@ -0,0 +1,35 @@ +set(PLUGIN "statusnotifier") + + +find_package(dbusmenu-qt5 REQUIRED QUIET) + +set(HEADERS + statusnotifier.h + dbustypes.h + statusnotifierbutton.h + statusnotifieriteminterface.h + statusnotifierwatcher.h + statusnotifierwidget.h +) + +set(SOURCES + statusnotifier.cpp + dbustypes.cpp + statusnotifierbutton.cpp + statusnotifieriteminterface.cpp + statusnotifierwatcher.cpp + statusnotifierwidget.cpp +) + +qt5_add_dbus_adaptor(SOURCES + org.kde.StatusNotifierItem.xml + statusnotifieriteminterface.h + StatusNotifierItemInterface +) + +set(LIBRARIES + lxqt + dbusmenu-qt5 +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-statusnotifier/dbustypes.cpp b/lxqt-panel/plugin-statusnotifier/dbustypes.cpp new file mode 100644 index 0000000..f4b345d --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/dbustypes.cpp @@ -0,0 +1,75 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "dbustypes.h" + +// Marshall the IconPixmap data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon) +{ + argument.beginStructure(); + argument << icon.width; + argument << icon.height; + argument << icon.bytes; + argument.endStructure(); + return argument; +} + +// Retrieve the ImageStruct data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon) +{ + argument.beginStructure(); + argument >> icon.width; + argument >> icon.height; + argument >> icon.bytes; + argument.endStructure(); + return argument; +} + +// Marshall the ToolTip data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip) +{ + argument.beginStructure(); + argument << toolTip.iconName; + argument << toolTip.iconPixmap; + argument << toolTip.title; + argument << toolTip.description; + argument.endStructure(); + return argument; +} + +// Retrieve the ToolTip data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip) +{ + argument.beginStructure(); + argument >> toolTip.iconName; + argument >> toolTip.iconPixmap; + argument >> toolTip.title; + argument >> toolTip.description; + argument.endStructure(); + return argument; +} diff --git a/lxqt-panel/plugin-statusnotifier/dbustypes.h b/lxqt-panel/plugin-statusnotifier/dbustypes.h new file mode 100644 index 0000000..ecdb220 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/dbustypes.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#ifndef DBUSTYPES_H +#define DBUSTYPES_H + +struct IconPixmap { + int width; + int height; + QByteArray bytes; +}; + +typedef QList IconPixmapList; + +struct ToolTip { + QString iconName; + QList iconPixmap; + QString title; + QString description; +}; + +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon); +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon); + +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip); +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip); + +Q_DECLARE_METATYPE(IconPixmap) +Q_DECLARE_METATYPE(ToolTip) + +#endif // DBUSTYPES_H diff --git a/lxqt-panel/plugin-statusnotifier/org.kde.StatusNotifierItem.xml b/lxqt-panel/plugin-statusnotifier/org.kde.StatusNotifierItem.xml new file mode 100644 index 0000000..0a563c5 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/org.kde.StatusNotifierItem.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lxqt-panel/plugin-statusnotifier/resources/statusnotifier.desktop.in b/lxqt-panel/plugin-statusnotifier/resources/statusnotifier.desktop.in new file mode 100644 index 0000000..66a4bc0 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/resources/statusnotifier.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Status Notifier Plugin +Comment=Status Notifier Plugin +Icon=go-bottom diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifier.cpp b/lxqt-panel/plugin-statusnotifier/statusnotifier.cpp new file mode 100644 index 0000000..0d80484 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifier.cpp @@ -0,0 +1,41 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifier.h" + +StatusNotifier::StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + m_widget = new StatusNotifierWidget(this); +} + +void StatusNotifier::realign() +{ + m_widget->realign(); +} diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifier.h b/lxqt-panel/plugin-statusnotifier/statusnotifier.h new file mode 100644 index 0000000..93aed9e --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifier.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIER_PLUGIN_H +#define STATUSNOTIFIER_PLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include "statusnotifierwidget.h" + +class StatusNotifier : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo); + + bool isSeparate() const { return true; } + void realign(); + QString themeId() const { return "StatusNotifier"; } + virtual Flags flags() const { return SingleInstance | NeedsHandle; } + QWidget *widget() { return m_widget; } + +private: + StatusNotifierWidget *m_widget; +}; + +class StatusNotifierLibrary : public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT +// Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new StatusNotifier(startupInfo); + } +}; + +#endif // STATUSNOTIFIER_PLUGIN_H diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.cpp b/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.cpp new file mode 100644 index 0000000..525b043 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.cpp @@ -0,0 +1,248 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierbutton.h" + +#include +#include +#include +#include "../panel/ilxqtpanelplugin.h" + + +StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent) + : QToolButton(parent), + mMenu(NULL), + mStatus(Passive), + mValid(true), + mFallbackIcon(QIcon::fromTheme("application-x-executable")), + mPlugin(plugin) +{ + interface = new org::kde::StatusNotifierItem(service, objectPath, QDBusConnection::sessionBus(), this); + + QString menuPath = interface->menu().path(); + if (!menuPath.isEmpty()) + { + mMenu = (new DBusMenuImporter(service, interface->menu().path(), this))->menu(); + dynamic_cast(*mMenu).setParent(this); + mMenu->setObjectName(QStringLiteral("StatusNotifierMenu")); + } + + // HACK: sni-qt creates some invalid items (like one for konversarion 1.5) + if (interface->title().isEmpty() && interface->id().isEmpty()) + mValid = false; + + if (mValid) + { + newToolTip(); + refetchIcon(Active); + refetchIcon(Passive); + refetchIcon(NeedsAttention); + newStatus(interface->status()); + resetIcon(); + + connect(interface, SIGNAL(NewIcon()), this, SLOT(newIcon())); + connect(interface, SIGNAL(NewOverlayIcon()), this, SLOT(newOverlayIcon())); + connect(interface, SIGNAL(NewAttentionIcon()), this, SLOT(newAttentionIcon())); + connect(interface, SIGNAL(NewToolTip()), this, SLOT(newToolTip())); + connect(interface, SIGNAL(NewStatus(QString)), this, SLOT(newStatus(QString))); + } +} + +StatusNotifierButton::~StatusNotifierButton() +{ +} + +void StatusNotifierButton::newIcon() +{ + refetchIcon(Passive); + resetIcon(); +} + +void StatusNotifierButton::newOverlayIcon() +{ + refetchIcon(Active); + resetIcon(); +} + +void StatusNotifierButton::newAttentionIcon() +{ + refetchIcon(NeedsAttention); + resetIcon(); +} + +void StatusNotifierButton::refetchIcon(Status status) +{ + QString iconName; + switch (status) + { + case Active: + iconName = interface->overlayIconName(); + break; + case NeedsAttention: + iconName = interface->attentionIconName(); + break; + case Passive: + iconName = interface->iconName(); + break; + } + + QIcon nextIcon; + if (!iconName.isEmpty()) + { + if (QIcon::hasThemeIcon(iconName)) + nextIcon = QIcon::fromTheme(iconName); + else + { + QDir themeDir(interface->iconThemePath()); + if (themeDir.exists()) + { + if (themeDir.exists(iconName + ".png")) + nextIcon.addFile(themeDir.filePath(iconName + ".png")); + + if (themeDir.cd("hicolor") || (themeDir.cd("icons") && themeDir.cd("hicolor"))) + { + QStringList sizes = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString dir, sizes) + { + QStringList dirs = QDir(themeDir.filePath(dir)).entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString innerDir, dirs) + { + QString file = themeDir.absolutePath() + "/" + dir + "/" + innerDir + "/" + iconName + ".png"; + if (QFile::exists(file)) + nextIcon.addFile(file); + } + } + } + } + } + } + else + { + IconPixmapList iconPixmaps; + switch (status) + { + case Active: + iconPixmaps = interface->overlayIconPixmap(); + break; + case NeedsAttention: + iconPixmaps = interface->attentionIconPixmap(); + break; + case Passive: + iconPixmaps = interface->iconPixmap(); + break; + } + + + if (!iconPixmaps.empty() && !iconPixmaps.first().bytes.isNull()) + { + IconPixmap iconPixmap = iconPixmaps.first(); + QImage image((uchar*) iconPixmap.bytes.data(), iconPixmap.width, iconPixmap.height, QImage::Format_ARGB32); + const uchar *end = image.constBits() + image.byteCount(); + uchar *dest = reinterpret_cast(iconPixmap.bytes.data()); + for (const uchar *src = image.constBits(); src < end; src += 4, dest += 4) + qToUnaligned(qToBigEndian(qFromUnaligned(src)), dest); + + QPixmap pixmap = QPixmap::fromImage(image); + nextIcon = QIcon(pixmap); + } + } + + switch (status) + { + case Active: + mOverlayIcon = nextIcon; + break; + case NeedsAttention: + mAttentionIcon = nextIcon; + break; + case Passive: + mIcon = nextIcon; + break; + } +} + +void StatusNotifierButton::newToolTip() +{ + QString toolTipTitle = interface->toolTip().title; + setToolTip(toolTipTitle.isEmpty() ? interface->title() : toolTipTitle); +} + +void StatusNotifierButton::newStatus(QString status) +{ + Status newStatus; + if (status == QStringLiteral("Passive")) + newStatus = Passive; + else if (status == QStringLiteral("Active")) + newStatus = Active; + else + newStatus = NeedsAttention; + + if (mStatus == newStatus) + return; + + mStatus = newStatus; + resetIcon(); +} + +void StatusNotifierButton::contextMenuEvent(QContextMenuEvent* event) +{ + //XXX: avoid showing of parent's context menu, we are (optionaly) providing context menu on mouseReleaseEvent + //QWidget::contextMenuEvent(event); +} + +void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + interface->Activate(QCursor::pos().x(), QCursor::pos().y()); + else if (event->button() == Qt::MidButton) + interface->SecondaryActivate(QCursor::pos().x(), QCursor::pos().y()); + else if (Qt::RightButton == event->button()) + mMenu->popup(mPlugin->calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); + QToolButton::mouseReleaseEvent(event); +} + +void StatusNotifierButton::wheelEvent(QWheelEvent *event) +{ + interface->Scroll(event->delta(), "vertical"); +} + +void StatusNotifierButton::resetIcon() +{ + if (mStatus == Active && !mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (mStatus == NeedsAttention && !mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else if (!mIcon.isNull()) // mStatus == Passive + setIcon(mIcon); + else if (!mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (!mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else + setIcon(mFallbackIcon); +} diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.h b/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.h new file mode 100644 index 0000000..ea0da60 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierbutton.h @@ -0,0 +1,95 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERBUTTON_H +#define STATUSNOTIFIERBUTTON_H + +#include +#include +#include +#include +#include +#include +#include + +#include "statusnotifieriteminterface.h" + +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +template inline T qFromUnaligned(const uchar *src) +{ + T dest; + const size_t size = sizeof(T); + memcpy(&dest, src, size); + return dest; +} +#endif + +class ILxQtPanelPlugin; + +class StatusNotifierButton : public QToolButton +{ + Q_OBJECT + +public: + StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent = 0); + ~StatusNotifierButton(); + + bool isValid() const { return mValid; } + + enum Status + { + Passive, Active, NeedsAttention + }; + +public slots: + void newIcon(); + void newAttentionIcon(); + void newOverlayIcon(); + void newToolTip(); + void newStatus(QString status); + +private: + org::kde::StatusNotifierItem *interface; + QMenu *mMenu; + Status mStatus; + bool mValid; + + QIcon mIcon, mOverlayIcon, mAttentionIcon, mFallbackIcon; + + ILxQtPanelPlugin* mPlugin; + +protected: + void contextMenuEvent(QContextMenuEvent * event); + void mouseReleaseEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent *event); + + void refetchIcon(Status status); + void resetIcon(); +}; + +#endif // STATUSNOTIFIERBUTTON_H diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.cpp b/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.cpp new file mode 100644 index 0000000..ad8fbda --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.cpp @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "statusnotifieriteminterface.h" + +/* + * Implementation of interface class StatusNotifierItemInterface + */ + +StatusNotifierItemInterface::StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +StatusNotifierItemInterface::~StatusNotifierItemInterface() +{ +} + diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.h b/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.h new file mode 100644 index 0000000..a1417b1 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifieriteminterface.h @@ -0,0 +1,174 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef STATUSNOTIFIERITEMINTERFACE_H +#define STATUSNOTIFIERITEMINTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "dbustypes.h" + +/* + * Proxy class for interface org.kde.StatusNotifierItem + */ +class StatusNotifierItemInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.kde.StatusNotifierItem"; } + +public: + StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~StatusNotifierItemInterface(); + + Q_PROPERTY(QString AttentionIconName READ attentionIconName) + inline QString attentionIconName() const + { return qvariant_cast< QString >(property("AttentionIconName")); } + + Q_PROPERTY(IconPixmapList AttentionIconPixmap READ attentionIconPixmap) + inline IconPixmapList attentionIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("AttentionIconPixmap")); } + + Q_PROPERTY(QString AttentionMovieName READ attentionMovieName) + inline QString attentionMovieName() const + { return qvariant_cast< QString >(property("AttentionMovieName")); } + + Q_PROPERTY(QString Category READ category) + inline QString category() const + { return qvariant_cast< QString >(property("Category")); } + + Q_PROPERTY(QString IconName READ iconName) + inline QString iconName() const + { return qvariant_cast< QString >(property("IconName")); } + + Q_PROPERTY(IconPixmapList IconPixmap READ iconPixmap) + inline IconPixmapList iconPixmap() const + { return qvariant_cast< IconPixmapList >(property("IconPixmap")); } + + Q_PROPERTY(QString IconThemePath READ iconThemePath) + inline QString iconThemePath() const + { return qvariant_cast< QString >(property("IconThemePath")); } + + Q_PROPERTY(QString Id READ id) + inline QString id() const + { return qvariant_cast< QString >(property("Id")); } + + Q_PROPERTY(bool ItemIsMenu READ itemIsMenu) + inline bool itemIsMenu() const + { return qvariant_cast< bool >(property("ItemIsMenu")); } + + Q_PROPERTY(QDBusObjectPath Menu READ menu) + inline QDBusObjectPath menu() const + { return qvariant_cast< QDBusObjectPath >(property("Menu")); } + + Q_PROPERTY(QString OverlayIconName READ overlayIconName) + inline QString overlayIconName() const + { return qvariant_cast< QString >(property("OverlayIconName")); } + + Q_PROPERTY(IconPixmapList OverlayIconPixmap READ overlayIconPixmap) + inline IconPixmapList overlayIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("OverlayIconPixmap")); } + + Q_PROPERTY(QString Status READ status) + inline QString status() const + { return qvariant_cast< QString >(property("Status")); } + + Q_PROPERTY(QString Title READ title) + inline QString title() const + { return qvariant_cast< QString >(property("Title")); } + + Q_PROPERTY(ToolTip ToolTip READ toolTip) + inline ToolTip toolTip() const + { return qvariant_cast< ToolTip >(property("ToolTip")); } + + Q_PROPERTY(int WindowId READ windowId) + inline int windowId() const + { return qvariant_cast< int >(property("WindowId")); } + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> Activate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList); + } + + inline QDBusPendingReply<> ContextMenu(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("ContextMenu"), argumentList); + } + + inline QDBusPendingReply<> Scroll(int delta, const QString &orientation) + { + QList argumentList; + argumentList << QVariant::fromValue(delta) << QVariant::fromValue(orientation); + return asyncCallWithArgumentList(QStringLiteral("Scroll"), argumentList); + } + + inline QDBusPendingReply<> SecondaryActivate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("SecondaryActivate"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void NewAttentionIcon(); + void NewIcon(); + void NewOverlayIcon(); + void NewStatus(const QString &status); + void NewTitle(); + void NewToolTip(); +}; + +namespace org { + namespace kde { + typedef ::StatusNotifierItemInterface StatusNotifierItem; + } +} +#endif diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.cpp b/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.cpp new file mode 100644 index 0000000..4fcfa2e --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.cpp @@ -0,0 +1,117 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwatcher.h" +#include +#include + +StatusNotifierWatcher::StatusNotifierWatcher(QObject *parent) : QObject(parent) +{ + qRegisterMetaType("IconPixmap"); + qDBusRegisterMetaType(); + qRegisterMetaType("IconPixmapList"); + qDBusRegisterMetaType(); + qRegisterMetaType("ToolTip"); + qDBusRegisterMetaType(); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + if (!dbus.registerService("org.kde.StatusNotifierWatcher")) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + if (!dbus.registerObject("/StatusNotifierWatcher", this, QDBusConnection::ExportScriptableContents)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new QDBusServiceWatcher(this); + mWatcher->setConnection(dbus); + mWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration); + + connect(mWatcher, &QDBusServiceWatcher::serviceUnregistered, this, &StatusNotifierWatcher::serviceUnregistered); +} + +StatusNotifierWatcher::~StatusNotifierWatcher() +{ + QDBusConnection::sessionBus().unregisterService("org.kde.StatusNotifierWatcher"); +} + +void StatusNotifierWatcher::RegisterStatusNotifierItem(const QString &serviceOrPath) +{ + QString service = serviceOrPath; + QString path = "/StatusNotifierItem"; + + // workaround for sni-qt + if (service.startsWith('/')) + { + path = service; + service = message().service(); + } + + QString notifierItemId = service + path; + + if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value() + && !mServices.contains(notifierItemId)) + { + mServices << notifierItemId; + mWatcher->addWatchedService(service); + emit StatusNotifierItemRegistered(notifierItemId); + } +} + +void StatusNotifierWatcher::RegisterStatusNotifierHost(const QString &service) +{ + if (!mHosts.contains(service)) + { + mHosts.append(service); + mWatcher->addWatchedService(service); + } +} + +void StatusNotifierWatcher::serviceUnregistered(const QString &service) +{ + qDebug() << "Service" << service << "unregistered"; + + mWatcher->removeWatchedService(service); + + if (mHosts.contains(service)) + { + mHosts.removeAll(service); + return; + } + + QString match = service + '/'; + QStringList::Iterator it = mServices.begin(); + while (it != mServices.end()) + { + if (it->startsWith(match)) + { + QString name = *it; + it = mServices.erase(it); + emit StatusNotifierItemUnregistered(name); + } + else + ++it; + } +} diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.h b/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.h new file mode 100644 index 0000000..0c2be8a --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierwatcher.h @@ -0,0 +1,73 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWATCHER_H +#define STATUSNOTIFIERWATCHER_H + +#include +#include +#include +#include +#include + +#include "dbustypes.h" + +class StatusNotifierWatcher : public QObject, protected QDBusContext +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.StatusNotifierWatcher") + Q_SCRIPTABLE Q_PROPERTY(bool IsStatusNotifierHostRegistered READ isStatusNotifierHostRegistered) + Q_SCRIPTABLE Q_PROPERTY(int ProtocolVersion READ protocolVersion) + Q_SCRIPTABLE Q_PROPERTY(QStringList RegisteredStatusNotifierItems READ RegisteredStatusNotifierItems) + +public: + explicit StatusNotifierWatcher(QObject *parent = 0); + ~StatusNotifierWatcher(); + + bool isStatusNotifierHostRegistered() { return mHosts.count() > 0; } + int protocolVersion() const { return 0; } + QStringList RegisteredStatusNotifierItems() const { return mServices; } + +signals: + Q_SCRIPTABLE void StatusNotifierItemRegistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierItemUnregistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierHostRegistered(); + +public slots: + Q_SCRIPTABLE void RegisterStatusNotifierItem(const QString &serviceOrPath); + Q_SCRIPTABLE void RegisterStatusNotifierHost(const QString &service); + + void serviceUnregistered(const QString &service); + +private: + QStringList mServices; + QStringList mHosts; + QDBusServiceWatcher *mWatcher; +}; + +#endif // STATUSNOTIFIERWATCHER_H diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.cpp b/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.cpp new file mode 100644 index 0000000..8a569ee --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwidget.h" +#include +#include "../panel/ilxqtpanelplugin.h" + +StatusNotifierWidget::StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent) : + QWidget(parent), + mPlugin(plugin) +{ + QString dbusName = QString("org.kde.StatusNotifierHost-%1-%2").arg(QApplication::applicationPid()).arg(1); + if (!QDBusConnection::sessionBus().registerService(dbusName)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new StatusNotifierWatcher; + mWatcher->RegisterStatusNotifierHost(dbusName); + + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemRegistered, + this, &StatusNotifierWidget::itemAdded); + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemUnregistered, + this, &StatusNotifierWidget::itemRemoved); + + setLayout(new LxQt::GridLayout(this)); + realign(); + + qDebug() << mWatcher->RegisteredStatusNotifierItems(); + +} + +void StatusNotifierWidget::itemAdded(QString serviceAndPath) +{ + int slash = serviceAndPath.indexOf('/'); + QString serv = serviceAndPath.left(slash); + QString path = serviceAndPath.mid(slash); + StatusNotifierButton *button = new StatusNotifierButton(serv, path, mPlugin, this); + + if (!button->isValid()) + delete button; + else + { + mServices.insert(serviceAndPath, button); + layout()->addWidget(button); + layout()->setAlignment(button, Qt::AlignCenter); + button->show(); + } +} + +void StatusNotifierWidget::itemRemoved(const QString &serviceAndPath) +{ + StatusNotifierButton *button = mServices.value(serviceAndPath, NULL); + if (button) + { + button->deleteLater(); + layout()->removeWidget(button); + } +} + +void StatusNotifierWidget::realign() +{ + LxQt::GridLayout *layout = qobject_cast(this->layout()); + layout->setEnabled(false); + + ILxQtPanel *panel = mPlugin->panel(); + if (panel->isHorizontal()) + { + layout->setRowCount(panel->lineCount()); + layout->setColumnCount(0); + } + else + { + layout->setColumnCount(panel->lineCount()); + layout->setRowCount(0); + } + + layout->setEnabled(true); +} diff --git a/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.h b/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.h new file mode 100644 index 0000000..35e303a --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/statusnotifierwidget.h @@ -0,0 +1,61 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWIDGET_H +#define STATUSNOTIFIERWIDGET_H + +#include + +#include + +#include "statusnotifierbutton.h" +#include "statusnotifierwatcher.h" + +class StatusNotifierWidget : public QWidget +{ + Q_OBJECT + +public: + StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent = 0); + +signals: + +public slots: + void itemAdded(QString serviceAndPath); + void itemRemoved(const QString &serviceAndPath); + + void realign(); + +private: + ILxQtPanelPlugin *mPlugin; + StatusNotifierWatcher *mWatcher; + + QHash mServices; +}; + +#endif // STATUSNOTIFIERWIDGET_H diff --git a/lxqt-panel/plugin-statusnotifier/translations/statusnotifier.ts b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier.ts @@ -0,0 +1,4 @@ + + + + diff --git a/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_de.desktop b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_de.desktop new file mode 100644 index 0000000..6f367a0 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Statusbenachrichtigungen +Comment[de]=Plugin für Statusbenachrichtigungen diff --git a/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru.desktop b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru.desktop new file mode 100644 index 0000000..3b3766b --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Плагин уведомлений +Comment[ru]=Плагин уведомлений diff --git a/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop new file mode 100644 index 0000000..5c5fc79 --- /dev/null +++ b/lxqt-panel/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Плагин уведомлений +Comment[ru_RU]=Плагин уведомлений diff --git a/lxqt-panel/plugin-sysstat/CMakeLists.txt b/lxqt-panel/plugin-sysstat/CMakeLists.txt new file mode 100644 index 0000000..6cb28e6 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/CMakeLists.txt @@ -0,0 +1,26 @@ +set(PLUGIN "sysstat") + +find_package(SysStat-Qt5 REQUIRED) + +set(HEADERS + lxqtsysstat.h + lxqtsysstatconfiguration.h + lxqtsysstatcolours.h + lxqtsysstatutils.h +) + +set(SOURCES + lxqtsysstat.cpp + lxqtsysstatconfiguration.cpp + lxqtsysstatcolours.cpp + lxqtsysstatutils.cpp +) + +set(UIS + lxqtsysstatconfiguration.ui + lxqtsysstatcolours.ui +) + +set(LIBRARIES sysstat-qt5) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstat.cpp b/lxqt-panel/plugin-sysstat/lxqtsysstat.cpp new file mode 100644 index 0000000..ee6c020 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstat.cpp @@ -0,0 +1,627 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtsysstat.h" +#include "lxqtsysstatutils.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +LxQtSysStat::LxQtSysStat(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mWidget(new QWidget()), + mFakeTitle(new LxQtSysStatTitle(mWidget)), + mContent(new LxQtSysStatContent(this, mWidget)) +{ + QVBoxLayout *borderLayout = new QVBoxLayout(mWidget); + borderLayout->setContentsMargins(0, 0, 0, 0); + borderLayout->setSpacing(0); + borderLayout->addWidget(mContent); + borderLayout->setStretchFactor(mContent, 1); + + mContent->setMinimumSize(2, 2); + + // qproperty of font type doesn't work with qss, so fake QLabel is used instead + connect(mFakeTitle, SIGNAL(fontChanged(QFont)), mContent, SLOT(setTitleFont(QFont))); + + // has to be postponed to update the size first + QTimer::singleShot(0, this, SLOT(lateInit())); +} + +LxQtSysStat::~LxQtSysStat() +{ + delete mWidget; +} + +void LxQtSysStat::lateInit() +{ + settingsChanged(); + mContent->setTitleFont(mFakeTitle->font()); + mSize = mContent->size(); +} + +QDialog *LxQtSysStat::configureDialog() +{ + return new LxQtSysStatConfiguration(settings(), mWidget); +} + +void LxQtSysStat::realign() +{ + QSize newSize = mContent->size(); + if (mSize != newSize) + { + mContent->reset(); + mSize = newSize; + } +} + +void LxQtSysStat::settingsChanged() +{ + mContent->updateSettings(settings()); +} + +LxQtSysStatTitle::LxQtSysStatTitle(QWidget *parent): + QLabel(parent) +{ + +} + +LxQtSysStatTitle::~LxQtSysStatTitle() +{ + +} + +bool LxQtSysStatTitle::event(QEvent *e) +{ + if (e->type() == QEvent::FontChange) + emit fontChanged(font()); + + return QLabel::event(e); +} + +LxQtSysStatContent::LxQtSysStatContent(ILxQtPanelPlugin *plugin, QWidget *parent): + QWidget(parent), + mPlugin(plugin), + mStat(NULL), + mUpdateInterval(0), + mMinimalSize(0), + mTitleFontPixelHeight(0), + mUseThemeColours(true), + mHistoryOffset(0) +{ + setObjectName("SysStat_Graph"); +} + +LxQtSysStatContent::~LxQtSysStatContent() +{ +} + + +// I don't like macros very much, but writing dozen similar functions is much much worse. + +#undef QSS_GET_COLOUR +#define QSS_GET_COLOUR(GETNAME) \ +QColor LxQtSysStatContent::GETNAME##Colour() const \ +{ \ + return mThemeColours.GETNAME##Colour; \ +} + +#undef QSS_COLOUR +#define QSS_COLOUR(GETNAME, SETNAME) \ +QSS_GET_COLOUR(GETNAME) \ +void LxQtSysStatContent::SETNAME##Colour(QColor value) \ +{ \ + mThemeColours.GETNAME##Colour = value; \ + if (mUseThemeColours) \ + mColours.GETNAME##Colour = mThemeColours.GETNAME##Colour; \ +} + +#undef QSS_NET_COLOUR +#define QSS_NET_COLOUR(GETNAME, SETNAME) \ +QSS_GET_COLOUR(GETNAME) \ +void LxQtSysStatContent::SETNAME##Colour(QColor value) \ +{ \ + mThemeColours.GETNAME##Colour = value; \ + if (mUseThemeColours) \ + { \ + mColours.GETNAME##Colour = mThemeColours.GETNAME##Colour; \ + mixNetColours(); \ + } \ +} + +QSS_COLOUR(grid, setGrid) +QSS_COLOUR(title, setTitle) +QSS_COLOUR(cpuSystem, setCpuSystem) +QSS_COLOUR(cpuUser, setCpuUser) +QSS_COLOUR(cpuNice, setCpuNice) +QSS_COLOUR(cpuOther, setCpuOther) +QSS_COLOUR(frequency, setFrequency) +QSS_COLOUR(memApps, setMemApps) +QSS_COLOUR(memBuffers,setMemBuffers) +QSS_COLOUR(memCached, setMemCached) +QSS_COLOUR(swapUsed, setSwapUsed) + +QSS_NET_COLOUR(netReceived, setNetReceived) +QSS_NET_COLOUR(netTransmitted, setNetTransmitted) + +#undef QSS_NET_COLOUR +#undef QSS_COLOUR +#undef QSS_GET_COLOUR + +void LxQtSysStatContent::mixNetColours() +{ + QColor netReceivedColour_hsv = mColours.netReceivedColour.toHsv(); + QColor netTransmittedColour_hsv = mColours.netTransmittedColour.toHsv(); + qreal hue = (netReceivedColour_hsv.hueF() + netTransmittedColour_hsv.hueF()) / 2; + if (qAbs(netReceivedColour_hsv.hueF() - netTransmittedColour_hsv.hueF()) > 0.5) + hue += 0.5; + mNetBothColour.setHsvF( + hue, + (netReceivedColour_hsv.saturationF() + netTransmittedColour_hsv.saturationF()) / 2, + (netReceivedColour_hsv.valueF() + netTransmittedColour_hsv.valueF() ) / 2 ); +} + +void LxQtSysStatContent::setTitleFont(QFont value) +{ + mTitleFont = value; + updateTitleFontPixelHeight(); + + update(); +} + +void LxQtSysStatContent::updateTitleFontPixelHeight() +{ + if (mTitleLabel.isEmpty()) + mTitleFontPixelHeight = 0; + else + { + QFontMetrics fm(mTitleFont); + mTitleFontPixelHeight = fm.height() - 1; + } +} + +void LxQtSysStatContent::updateSettings(const QSettings *settings) +{ + double old_updateInterval = mUpdateInterval; + int old_minimalSize = mMinimalSize; + QString old_dataType = mDataType; + QString old_dataSource = mDataSource; + bool old_useFrequency = mUseFrequency; + bool old_logarithmicScale = mLogarithmicScale; + int old_logScaleSteps = mLogScaleSteps; + + mUseThemeColours = settings->value("graph/useThemeColours", true).toBool(); + mUpdateInterval = settings->value("graph/updateInterval", 1.0).toDouble(); + mMinimalSize = settings->value("graph/minimalSize", 30).toInt(); + + mGridLines = settings->value("grid/lines", 1).toInt(); + + mTitleLabel = settings->value("title/label", QString()).toString(); + + // default to CPU monitoring + mDataType = settings->value("data/type", LxQtSysStatConfiguration::msStatTypes[0]).toString(); + + mDataSource = settings->value("data/source", QString("cpu")).toString(); + + mUseFrequency = settings->value("cpu/useFrequency", true).toBool(); + + mNetMaximumSpeed = PluginSysStat::netSpeedFromString(settings->value("net/maximumSpeed", "1 MB/s").toString()); + mLogarithmicScale = settings->value("net/logarithmicScale", true).toBool(); + + mLogScaleSteps = settings->value("net/logarithmicScaleSteps", 4).toInt(); + mLogScaleMax = static_cast(static_cast(1) << mLogScaleSteps); + + mNetRealMaximumSpeed = static_cast(static_cast(1) << mNetMaximumSpeed); + + + mSettingsColours.gridColour = QColor(settings->value("grid/colour", "#c0c0c0").toString()); + + mSettingsColours.titleColour = QColor(settings->value("title/colour", "#ffffff").toString()); + + mSettingsColours.cpuSystemColour = QColor(settings->value("cpu/systemColour", "#800000").toString()); + mSettingsColours.cpuUserColour = QColor(settings->value("cpu/userColour", "#000080").toString()); + mSettingsColours.cpuNiceColour = QColor(settings->value("cpu/niceColour", "#008000").toString()); + mSettingsColours.cpuOtherColour = QColor(settings->value("cpu/otherColour", "#808000").toString()); + mSettingsColours.frequencyColour = QColor(settings->value("cpu/frequencyColour", "#808080").toString()); + + mSettingsColours.memAppsColour = QColor(settings->value("mem/appsColour", "#000080").toString()); + mSettingsColours.memBuffersColour = QColor(settings->value("mem/buffersColour", "#008000").toString()); + mSettingsColours.memCachedColour = QColor(settings->value("mem/cachedColour", "#808000").toString()); + mSettingsColours.swapUsedColour = QColor(settings->value("mem/swapColour", "#800000").toString()); + + mSettingsColours.netReceivedColour = QColor(settings->value("net/receivedColour", "#000080").toString()); + mSettingsColours.netTransmittedColour = QColor(settings->value("net/transmittedColour", "#808000").toString()); + + + if (mUseThemeColours) + mColours = mThemeColours; + else + mColours = mSettingsColours; + + mixNetColours(); + + updateTitleFontPixelHeight(); + + + bool minimalSizeChanged = old_minimalSize != mMinimalSize; + bool updateIntervalChanged = old_updateInterval != mUpdateInterval; + bool dataTypeChanged = old_dataType != mDataType; + bool dataSourceChanged = old_dataSource != mDataSource; + bool useFrequencyChanged = old_useFrequency != mUseFrequency; + bool logScaleStepsChanged = old_logScaleSteps != mLogScaleSteps; + bool logarithmicScaleChanged = old_logarithmicScale != mLogarithmicScale; + + bool needReconnecting = dataTypeChanged || dataSourceChanged || useFrequencyChanged; + bool needTimerRestarting = needReconnecting || updateIntervalChanged; + bool needFullReset = needTimerRestarting || minimalSizeChanged || logScaleStepsChanged || logarithmicScaleChanged; + + + if (mStat) + { + if (needTimerRestarting) + mStat->stopUpdating(); + + if (needReconnecting) + mStat->disconnect(this); + } + + if (dataTypeChanged) + { + if (mStat) + { + mStat->deleteLater(); + mStat = nullptr; + } + + if (mDataType == "CPU") + mStat = new SysStat::CpuStat(this); + else if (mDataType == "Memory") + mStat = new SysStat::MemStat(this); + else if (mDataType == "Network") + mStat = new SysStat::NetStat(this); + } + + if (mStat) + { + if (needReconnecting) + { + if (mDataType == "CPU") + { + if (mUseFrequency) + { + qobject_cast(mStat)->setMonitoring(SysStat::CpuStat::LoadAndFrequency); + connect(qobject_cast(mStat), SIGNAL(update(float, float, float, float, float, uint)), this, SLOT(cpuUpdate(float, float, float, float, float, uint))); + } + else + { + qobject_cast(mStat)->setMonitoring(SysStat::CpuStat::LoadOnly); + connect(qobject_cast(mStat), SIGNAL(update(float, float, float, float)), this, SLOT(cpuUpdate(float, float, float, float))); + } + } + else if (mDataType == "Memory") + { + if (mDataSource == "memory") + connect(qobject_cast(mStat), SIGNAL(memoryUpdate(float, float, float)), this, SLOT(memoryUpdate(float, float, float))); + else + connect(qobject_cast(mStat), SIGNAL(swapUpdate(float)), this, SLOT(swapUpdate(float))); + } + else if (mDataType == "Network") + { + connect(qobject_cast(mStat), SIGNAL(update(unsigned, unsigned)), this, SLOT(networkUpdate(unsigned, unsigned))); + } + + mStat->setMonitoredSource(mDataSource); + } + + if (needTimerRestarting) + mStat->setUpdateInterval(static_cast(mUpdateInterval * 1000.0)); + } + + if (needFullReset) + reset(); + else + update(); +} + +void LxQtSysStatContent::resizeEvent(QResizeEvent * /*event*/) +{ + reset(); +} + +void LxQtSysStatContent::reset() +{ + setMinimumSize(mPlugin->panel()->isHorizontal() ? mMinimalSize : 2, + mPlugin->panel()->isHorizontal() ? 2 : mMinimalSize); + + mHistoryOffset = 0; + mHistoryImage = QImage(width(), 100, QImage::Format_ARGB32); + mHistoryImage.fill(Qt::transparent); + update(); +} + +template +T clamp(const T &value, const T &min, const T &max) +{ + return qMin(qMax(value, min), max); +} + +// QPainter.drawLine with pen set to Qt::transparent doesn't clear anything +void LxQtSysStatContent::clearLine() +{ + QRgb bg = QColor(Qt::transparent).rgba(); + for (int i = 0; i < 100; ++i) + reinterpret_cast(mHistoryImage.scanLine(i))[mHistoryOffset] = bg; +} + +void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other, float frequencyRate, uint) +{ + int y_system = static_cast(system * 100.0 * frequencyRate); + int y_user = static_cast(user * 100.0 * frequencyRate); + int y_nice = static_cast(nice * 100.0 * frequencyRate); + int y_other = static_cast(other * 100.0 * frequencyRate); + int y_freq = static_cast( 100.0 * frequencyRate); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: %5%", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other).arg(y_freq)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user , 0, 99); + y_other = clamp(y_other, 0, 99); + y_freq = clamp(y_freq, 0, 99); + + clearLine(); + QPainter painter(&mHistoryImage); + if (y_system != 0) + { + painter.setPen(mColours.cpuSystemColour); + painter.drawLine(mHistoryOffset, y_system, mHistoryOffset, 0); + } + if (y_user != y_system) + { + painter.setPen(mColours.cpuUserColour); + painter.drawLine(mHistoryOffset, y_user, mHistoryOffset, y_system); + } + if (y_nice != y_user) + { + painter.setPen(mColours.cpuNiceColour); + painter.drawLine(mHistoryOffset, y_nice, mHistoryOffset, y_user); + } + if (y_other != y_nice) + { + painter.setPen(mColours.cpuOtherColour); + painter.drawLine(mHistoryOffset, y_other, mHistoryOffset, y_nice); + } + if (y_freq != y_other) + { + painter.setPen(mColours.frequencyColour); + painter.drawLine(mHistoryOffset, y_freq, mHistoryOffset, y_other); + } + + mHistoryOffset = (mHistoryOffset + 1) % width(); + + update(0, mTitleFontPixelHeight, width(), height() - mTitleFontPixelHeight); +} + +void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other) +{ + int y_system = static_cast(system * 100.0); + int y_user = static_cast(user * 100.0); + int y_nice = static_cast(nice * 100.0); + int y_other = static_cast(other * 100.0); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: n/a", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user, 0, 99); + y_other = clamp(y_other + y_nice, 0, 99); + + clearLine(); + QPainter painter(&mHistoryImage); + if (y_system != 0) + { + painter.setPen(mColours.cpuSystemColour); + painter.drawLine(mHistoryOffset, y_system, mHistoryOffset, 0); + } + if (y_user != y_system) + { + painter.setPen(mColours.cpuUserColour); + painter.drawLine(mHistoryOffset, y_user, mHistoryOffset, y_system); + } + if (y_nice != y_user) + { + painter.setPen(mColours.cpuNiceColour); + painter.drawLine(mHistoryOffset, y_nice, mHistoryOffset, y_user); + } + if (y_other != y_nice) + { + painter.setPen(mColours.cpuOtherColour); + painter.drawLine(mHistoryOffset, y_other, mHistoryOffset, y_nice); + } + + mHistoryOffset = (mHistoryOffset + 1) % width(); + + update(0, mTitleFontPixelHeight, width(), height() - mTitleFontPixelHeight); +} + +void LxQtSysStatContent::memoryUpdate(float apps, float buffers, float cached) +{ + int y_apps = static_cast(apps * 100.0); + int y_buffers = static_cast(buffers * 100.0); + int y_cached = static_cast(cached * 100.0); + + toolTipInfo(tr("apps: %1%
buffers: %2%
cached: %3%", "Memory tooltip information") + .arg(y_apps).arg(y_buffers).arg(y_cached)); + + y_apps = clamp(y_apps, 0, 99); + y_buffers = clamp(y_buffers + y_apps, 0, 99); + y_cached = clamp(y_cached + y_buffers, 0, 99); + + clearLine(); + QPainter painter(&mHistoryImage); + if (y_apps != 0) + { + painter.setPen(mColours.memAppsColour); + painter.drawLine(mHistoryOffset, y_apps, mHistoryOffset, 0); + } + if (y_buffers != y_apps) + { + painter.setPen(mColours.memBuffersColour); + painter.drawLine(mHistoryOffset, y_buffers, mHistoryOffset, y_apps); + } + if (y_cached != y_buffers) + { + painter.setPen(mColours.memCachedColour); + painter.drawLine(mHistoryOffset, y_cached, mHistoryOffset, y_buffers); + } + + mHistoryOffset = (mHistoryOffset + 1) % width(); + + update(0, mTitleFontPixelHeight, width(), height() - mTitleFontPixelHeight); +} + +void LxQtSysStatContent::swapUpdate(float used) +{ + int y_used = static_cast(used * 100.0); + + toolTipInfo(tr("used: %1%", "Swap tooltip information").arg(y_used)); + + y_used = clamp(y_used, 0, 99); + + clearLine(); + QPainter painter(&mHistoryImage); + if (y_used != 0) + { + painter.setPen(mColours.swapUsedColour); + painter.drawLine(mHistoryOffset, y_used, mHistoryOffset, 0); + } + + mHistoryOffset = (mHistoryOffset + 1) % width(); + + update(0, mTitleFontPixelHeight, width(), height() - mTitleFontPixelHeight); +} + +void LxQtSysStatContent::networkUpdate(unsigned received, unsigned transmitted) +{ + qreal min_value = qMin(qMax(static_cast(qMin(received, transmitted)) / mNetRealMaximumSpeed, static_cast(0.0)), static_cast(1.0)); + qreal max_value = qMin(qMax(static_cast(qMax(received, transmitted)) / mNetRealMaximumSpeed, static_cast(0.0)), static_cast(1.0)); + if (mLogarithmicScale) + { + min_value = qLn(min_value * (mLogScaleMax - 1.0) + 1.0) / qLn(2.0) / static_cast(mLogScaleSteps); + max_value = qLn(max_value * (mLogScaleMax - 1.0) + 1.0) / qLn(2.0) / static_cast(mLogScaleSteps); + } + + int y_min_value = static_cast(min_value * 100.0); + int y_max_value = static_cast(max_value * 100.0); + + toolTipInfo(tr("min: %1%
max: %2%", "Network tooltip information").arg(y_min_value).arg(y_max_value)); + + y_min_value = clamp(y_min_value, 0, 99); + y_max_value = clamp(y_max_value + y_min_value, 0, 99); + + clearLine(); + QPainter painter(&mHistoryImage); + if (y_min_value != 0) + { + painter.setPen(mNetBothColour); + painter.drawLine(mHistoryOffset, y_min_value, mHistoryOffset, 0); + } + if (y_max_value != y_min_value) + { + painter.setPen((received > transmitted) ? mColours.netReceivedColour : mColours.netTransmittedColour); + painter.drawLine(mHistoryOffset, y_max_value, mHistoryOffset, y_min_value); + } + + mHistoryOffset = (mHistoryOffset + 1) % width(); + + update(0, mTitleFontPixelHeight, width(), height() - mTitleFontPixelHeight); +} + +void LxQtSysStatContent::paintEvent(QPaintEvent *event) +{ + QPainter p(this); + + qreal graphTop = 0; + qreal graphHeight = height(); + + bool hasTitle = !mTitleLabel.isEmpty(); + + if (hasTitle) + { + graphTop = mTitleFontPixelHeight; + graphHeight -= graphTop; + + if (event->region().intersects(QRect(0, 0, width(), graphTop))) + { + p.setPen(mColours.titleColour); + p.setFont(mTitleFont); + p.drawText(QRectF(0, 0, width(), graphTop), Qt::AlignHCenter | Qt::AlignVCenter, mTitleLabel); + } + } + + if (graphHeight < 1) + graphHeight = 1; + + p.scale(1.0, -1.0); + + p.drawImage(QRect(0, -height(), width() - mHistoryOffset, graphHeight), mHistoryImage, QRect(mHistoryOffset, 0, width() - mHistoryOffset, 100)); + if (mHistoryOffset) + p.drawImage(QRect(width() - mHistoryOffset, -height(), mHistoryOffset, graphHeight), mHistoryImage, QRect(0, 0, mHistoryOffset, 100)); + + p.resetTransform(); + + p.setRenderHint(QPainter::Antialiasing); + + p.setPen(mColours.gridColour); + qreal w = static_cast(width()); + if (hasTitle) + p.drawLine(QPointF(0.0, graphTop + 0.5), QPointF(w, graphTop + 0.5)); // 0.5 looks better with antialiasing + for (int l = 0; l < mGridLines; ++l) + { + qreal y = graphTop + static_cast(l + 1) * graphHeight / (static_cast(mGridLines + 1)); + p.drawLine(QPointF(0.0, y), QPointF(w, y)); + } +} + +void LxQtSysStatContent::toolTipInfo(QString const & tooltip) +{ + setToolTip(QStringLiteral("%1(%2)
%3") + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataType.toStdString().c_str())) + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataSource.toStdString().c_str())) + .arg(tooltip)); +} diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstat.h b/lxqt-panel/plugin-sysstat/lxqtsysstat.h new file mode 100644 index 0000000..6737fdb --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstat.h @@ -0,0 +1,227 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTPANELSYSSTAT_H +#define LXQTPANELSYSSTAT_H + +#include "../panel/ilxqtpanelplugin.h" +#include "lxqtsysstatconfiguration.h" + +#include + + +class LxQtSysStatTitle; +class LxQtSysStatContent; +class LxQtPanel; + +namespace SysStat { + class BaseStat; +} + +class LxQtSysStat : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtSysStat(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtSysStat(); + + virtual QWidget *widget() { return mWidget; } + virtual QString themeId() const { return "SysStat"; } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } + virtual bool isSeparate() const { return true; } + + QDialog *configureDialog(); + + void realign(); + +protected slots: + virtual void lateInit(); + virtual void settingsChanged(); + +private: + QWidget *mWidget; + LxQtSysStatTitle *mFakeTitle; + LxQtSysStatContent *mContent; + QSize mSize; +}; + +class LxQtSysStatTitle : public QLabel +{ + Q_OBJECT +public: + LxQtSysStatTitle(QWidget *parent = NULL); + ~LxQtSysStatTitle(); + +protected: + bool event(QEvent *e); + +signals: + void fontChanged(QFont); +}; + +class LxQtSysStatContent : public QWidget +{ + Q_OBJECT + + Q_PROPERTY(QColor gridColor READ gridColour WRITE setGridColour) + Q_PROPERTY(QColor titleColor READ titleColour WRITE setTitleColour) + Q_PROPERTY(QColor cpuSystemColor READ cpuSystemColour WRITE setCpuSystemColour) + Q_PROPERTY(QColor cpuUserColor READ cpuUserColour WRITE setCpuUserColour) + Q_PROPERTY(QColor cpuNiceColor READ cpuNiceColour WRITE setCpuNiceColour) + Q_PROPERTY(QColor cpuOtherColor READ cpuOtherColour WRITE setCpuOtherColour) + Q_PROPERTY(QColor frequencyColor READ frequencyColour WRITE setFrequencyColour) + Q_PROPERTY(QColor memAppsColor READ memAppsColour WRITE setMemAppsColour) + Q_PROPERTY(QColor memBuffersColor READ memBuffersColour WRITE setMemBuffersColour) + Q_PROPERTY(QColor memCachedColor READ memCachedColour WRITE setMemCachedColour) + Q_PROPERTY(QColor swapUsedColor READ swapUsedColour WRITE setSwapUsedColour) + Q_PROPERTY(QColor netReceivedColor READ netReceivedColour WRITE setNetReceivedColour) + Q_PROPERTY(QColor netTransmittedColor READ netTransmittedColour WRITE setNetTransmittedColour) + +public: + LxQtSysStatContent(ILxQtPanelPlugin *plugin, QWidget *parent = NULL); + ~LxQtSysStatContent(); + + void updateSettings(const QSettings *); + +#undef QSS_COLOUR +#define QSS_COLOUR(GETNAME, SETNAME) \ + QColor GETNAME##Colour() const; \ + void SETNAME##Colour(QColor value); + + QSS_COLOUR(grid, setGrid) + QSS_COLOUR(title, setTitle) + QSS_COLOUR(cpuSystem, setCpuSystem) + QSS_COLOUR(cpuUser, setCpuUser) + QSS_COLOUR(cpuNice, setCpuNice) + QSS_COLOUR(cpuOther, setCpuOther) + QSS_COLOUR(frequency, setFrequency) + QSS_COLOUR(memApps, setMemApps) + QSS_COLOUR(memBuffers, setMemBuffers) + QSS_COLOUR(memCached, setMemCached) + QSS_COLOUR(swapUsed, setSwapUsed) + QSS_COLOUR(netReceived, setNetReceived) + QSS_COLOUR(netTransmitted, setNetTransmitted) + +#undef QSS_COLOUR + +public slots: + void setTitleFont(QFont value); + void reset(); + +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + +protected slots: + void cpuUpdate(float user, float nice, float system, float other, float frequencyRate, uint frequency); + void cpuUpdate(float user, float nice, float system, float other); + void memoryUpdate(float apps, float buffers, float cached); + void swapUpdate(float used); + void networkUpdate(unsigned received, unsigned transmitted); + +private: + void toolTipInfo(QString const & tooltip); + +private: + ILxQtPanelPlugin *mPlugin; + + SysStat::BaseStat *mStat; + + typedef struct ColourPalette + { + QColor gridColour; + + QColor titleColour; + + QColor cpuSystemColour; + QColor cpuUserColour; + QColor cpuNiceColour; + QColor cpuOtherColour; + QColor frequencyColour; + + QColor memAppsColour; + QColor memBuffersColour; + QColor memCachedColour; + QColor swapUsedColour; + + QColor netReceivedColour; + QColor netTransmittedColour; + } ColourPalette; + + double mUpdateInterval; + int mMinimalSize; + + int mGridLines; + + QString mTitleLabel; + QFont mTitleFont; + int mTitleFontPixelHeight; + + QString mDataType; + + QString mDataSource; + + bool mUseFrequency; + + int mNetMaximumSpeed; + qreal mNetRealMaximumSpeed; + bool mLogarithmicScale; + int mLogScaleSteps; + qreal mLogScaleMax; + + + bool mUseThemeColours; + ColourPalette mThemeColours; + ColourPalette mSettingsColours; + ColourPalette mColours; + QColor mNetBothColour; + + + int mHistoryOffset; + QImage mHistoryImage; + + + void clearLine(); + + void mixNetColours(); + void updateTitleFontPixelHeight(); +}; + + +class LxQtSysStatLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtSysStat(startupInfo); + } +}; + +#endif // LXQTPANELSYSSTAT_H diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.cpp b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.cpp new file mode 100644 index 0000000..ce7cfbf --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.cpp @@ -0,0 +1,188 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtsysstatcolours.h" +#include "ui_lxqtsysstatcolours.h" + +#include +#include + + +LxQtSysStatColours::LxQtSysStatColours(QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtSysStatColours), + mSelectColourMapper(new QSignalMapper(this)) +{ + setWindowModality(Qt::WindowModal); + ui->setupUi(this); + + mDefaultColours["grid"] = QColor("#808080"); + mDefaultColours["title"] = QColor("#000000"); + + mDefaultColours["cpuSystem"] = QColor("#800000"); + mDefaultColours["cpuUser"] = QColor("#000080"); + mDefaultColours["cpuNice"] = QColor("#008000"); + mDefaultColours["cpuOther"] = QColor("#808000"); + mDefaultColours["cpuFrequency"] = QColor("#808080"); + + mDefaultColours["memApps"] = QColor("#000080"); + mDefaultColours["memBuffers"] = QColor("#008000"); + mDefaultColours["memCached"] = QColor("#808000"); + mDefaultColours["memSwap"] = QColor("#800000"); + + mDefaultColours["netReceived"] = QColor("#000080"); + mDefaultColours["netTransmitted"] = QColor("#808000"); + + +#undef CONNECT_SELECT_COLOUR +#define CONNECT_SELECT_COLOUR(VAR) \ + connect(ui-> VAR ## B, SIGNAL(clicked()), mSelectColourMapper, SLOT(map())); \ + mSelectColourMapper->setMapping(ui-> VAR ## B, QString( #VAR )); \ + mShowColourMap[QString( #VAR )] = ui-> VAR ## B; + + CONNECT_SELECT_COLOUR(grid) + CONNECT_SELECT_COLOUR(title) + CONNECT_SELECT_COLOUR(cpuSystem) + CONNECT_SELECT_COLOUR(cpuUser) + CONNECT_SELECT_COLOUR(cpuNice) + CONNECT_SELECT_COLOUR(cpuOther) + CONNECT_SELECT_COLOUR(cpuFrequency) + CONNECT_SELECT_COLOUR(memApps) + CONNECT_SELECT_COLOUR(memBuffers) + CONNECT_SELECT_COLOUR(memCached) + CONNECT_SELECT_COLOUR(memSwap) + CONNECT_SELECT_COLOUR(netReceived) + CONNECT_SELECT_COLOUR(netTransmitted) + +#undef CONNECT_SELECT_COLOUR + + connect(mSelectColourMapper, SIGNAL(mapped(const QString &)), SLOT(selectColour(const QString &))); +} + +LxQtSysStatColours::~LxQtSysStatColours() +{ + delete ui; +} + +void LxQtSysStatColours::selectColour(const QString &name) +{ + QColor color = QColorDialog::getColor(mColours[name], this); + if (color.isValid()) + { + mColours[name] = color; + mShowColourMap[name]->setStyleSheet(QString("background-color: %1;\ncolor: %2;").arg(color.name()).arg((color.toHsl().lightnessF() > 0.5) ? "black" : "white")); + + ui->buttons->button(QDialogButtonBox::Apply)->setEnabled(true); + } +} + +void LxQtSysStatColours::setColours(const Colours &colours) +{ + mInitialColours = colours; + mColours = colours; + applyColoursToButtons(); + + ui->buttons->button(QDialogButtonBox::Apply)->setEnabled(false); +} + +void LxQtSysStatColours::applyColoursToButtons() +{ + Colours::ConstIterator M = mColours.constEnd(); + for (Colours::ConstIterator I = mColours.constBegin(); I != M; ++I) + { + const QColor &color = I.value(); + mShowColourMap[I.key()]->setStyleSheet(QString("background-color: %1;\ncolor: %2;").arg(color.name()).arg((color.toHsl().lightnessF() > 0.5) ? "black" : "white")); + } +} + +void LxQtSysStatColours::on_buttons_clicked(QAbstractButton *button) +{ + switch (ui->buttons->standardButton(button)) + { + case QDialogButtonBox::RestoreDefaults: + restoreDefaults(); + break; + + case QDialogButtonBox::Reset: + reset(); + break; + + case QDialogButtonBox::Ok: + apply(); + accept(); + break; + + case QDialogButtonBox::Apply: + apply(); + break; + + case QDialogButtonBox::Cancel: + reset(); + reject(); + break; + + default:; + } +} + +void LxQtSysStatColours::restoreDefaults() +{ + bool wereTheSame = mColours == mDefaultColours; + + mColours = mDefaultColours; + applyColoursToButtons(); + + ui->buttons->button(QDialogButtonBox::Apply)->setEnabled(!wereTheSame); +} + +void LxQtSysStatColours::reset() +{ + bool wereTheSame = mColours == mInitialColours; + + mColours = mInitialColours; + applyColoursToButtons(); + + ui->buttons->button(QDialogButtonBox::Apply)->setEnabled(!wereTheSame); +} + +void LxQtSysStatColours::apply() +{ + emit coloursChanged(); + + ui->buttons->button(QDialogButtonBox::Apply)->setEnabled(false); +} + +LxQtSysStatColours::Colours LxQtSysStatColours::colours() const +{ + return mColours; +} + +LxQtSysStatColours::Colours LxQtSysStatColours::defaultColours() const +{ + return mDefaultColours; +} diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.h b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.h new file mode 100644 index 0000000..91f08c0 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.h @@ -0,0 +1,88 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTSYSSTATCOLOURS_HPP +#define LXQTSYSSTATCOLOURS_HPP + +#include + +#include +#include +#include + + +namespace Ui { + class LxQtSysStatColours; +} + +class QSignalMapper; +class QAbstractButton; +class QPushButton; + +class LxQtSysStatColours : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtSysStatColours(QWidget *parent = NULL); + ~LxQtSysStatColours(); + + typedef QMap Colours; + + void setColours(const Colours&); + + Colours colours() const; + + Colours defaultColours() const; + +signals: + void coloursChanged(); + +public slots: + void on_buttons_clicked(QAbstractButton*); + + void selectColour(const QString &); + + void restoreDefaults(); + void reset(); + void apply(); + +private: + Ui::LxQtSysStatColours *ui; + + QSignalMapper *mSelectColourMapper; + QMap mShowColourMap; + + Colours mDefaultColours; + Colours mInitialColours; + Colours mColours; + + void applyColoursToButtons(); +}; + +#endif // LXQTSYSSTATCOLOURS_HPP diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.ui b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.ui new file mode 100644 index 0000000..0035a98 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatcolours.ui @@ -0,0 +1,340 @@ + + + LxQtSysStatColours + + + + 0 + 0 + 519 + 328 + + + + System Statistics Colors + + + + + + + + + + Graph + + + + + + &Grid + + + gridB + + + + + + + Change ... + + + + + + + T&itle + + + titleB + + + + + + + Change ... + + + + + + + + + + CPU + + + + + + Change ... + + + + + + + &Nice + + + cpuNiceB + + + + + + + Change ... + + + + + + + Ot&her + + + cpuOtherB + + + + + + + &Frequency + + + cpuFrequencyB + + + + + + + Change ... + + + + + + + S&ystem + + + cpuSystemB + + + + + + + &User + + + cpuUserB + + + + + + + Change ... + + + + + + + Change ... + + + + + + + + + + Qt::Vertical + + + + + + + + + + + Memory + + + + + + Change ... + + + + + + + Cache&d + + + memCachedB + + + + + + + S&wap + + + memSwapB + + + + + + + Change ... + + + + + + + &Applications + + + memAppsB + + + + + + + &Buffers + + + memBuffersB + + + + + + + Change ... + + + + + + + Change ... + + + + + + + + + + Network + + + + + + &Received + + + netReceivedB + + + + + + + Change ... + + + + + + + &Transmitted + + + netTransmittedB + + + + + + + Change ... + + + + + + + + + + Qt::Vertical + + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset|QDialogButtonBox::RestoreDefaults + + + + + + + gridB + titleB + cpuSystemB + cpuUserB + cpuNiceB + cpuOtherB + cpuFrequencyB + memAppsB + memBuffersB + memCachedB + memSwapB + netReceivedB + netTransmittedB + buttons + + + + + on_buttons_clicked(QAbstractButton*) + + diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.cpp b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.cpp new file mode 100644 index 0000000..1723725 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.cpp @@ -0,0 +1,268 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtsysstatconfiguration.h" +#include "ui_lxqtsysstatconfiguration.h" +#include "lxqtsysstatutils.h" +#include "lxqtsysstatcolours.h" + +#include +#include +#include + +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList LxQtSysStatConfiguration::msStatTypes = { + QStringLiteral(QT_TR_NOOP("CPU")) + , QStringLiteral(QT_TR_NOOP("Memory")) + , QStringLiteral(QT_TR_NOOP("Network")) +}; + +namespace +{ + //Note: workaround for making source strings translatable + // (no need to ever call this function) + void localizationWorkaround(); + auto t = localizationWorkaround;//avoid unused function warning + void localizationWorkaround() + { + const char * loc; + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu1"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu2"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu3"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu4"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu5"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu6"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu7"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu8"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu9"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu11"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu12"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu13"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu14"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu15"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu16"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu17"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu18"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu19"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu20"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu21"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu22"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu23"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu24"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "memory"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "swap"); + static_cast(t);//avoid unused variable warning + } +} + +LxQtSysStatConfiguration::LxQtSysStatConfiguration(QSettings *settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtSysStatConfiguration), + mSettings(settings), + oldSettings(settings), + mStat(NULL), + mColoursDialog(NULL) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("SysStatConfigurationWindow"); + ui->setupUi(this); + + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msStatTypes) + ui->typeCOB->addItem(tr(type.toStdString().c_str()), type); + + loadSettings(); + + connect(ui->typeCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->intervalSB, static_cast(&QDoubleSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->linesSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->titleLE, &QLineEdit::editingFinished, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useFrequencyCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->logarithmicCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sourceCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useThemeColoursRB, &QRadioButton::toggled, this, &LxQtSysStatConfiguration::saveSettings); +} + +LxQtSysStatConfiguration::~LxQtSysStatConfiguration() +{ + delete ui; +} + +void LxQtSysStatConfiguration::loadSettings() +{ + ui->intervalSB->setValue(mSettings->value("graph/updateInterval", 1.0).toDouble()); + ui->sizeSB->setValue(mSettings->value("graph/minimalSize", 30).toInt()); + + ui->linesSB->setValue(mSettings->value("grid/lines", 1).toInt()); + + ui->titleLE->setText(mSettings->value("title/label", QString()).toString()); + + int typeIndex = ui->typeCOB->findData(mSettings->value("data/type", msStatTypes[0])); + ui->typeCOB->setCurrentIndex((typeIndex >= 0) ? typeIndex : 0); + on_typeCOB_currentIndexChanged(ui->typeCOB->currentIndex()); + + int sourceIndex = ui->sourceCOB->findData(mSettings->value("data/source", QString())); + ui->sourceCOB->setCurrentIndex((sourceIndex >= 0) ? sourceIndex : 0); + + ui->useFrequencyCB->setChecked(mSettings->value("cpu/useFrequency", true).toBool()); + ui->maximumHS->setValue(PluginSysStat::netSpeedFromString(mSettings->value("net/maximumSpeed", "1 MB/s").toString())); + on_maximumHS_valueChanged(ui->maximumHS->value()); + ui->logarithmicCB->setChecked(mSettings->value("net/logarithmicScale", true).toBool()); + ui->logScaleSB->setValue(mSettings->value("net/logarithmicScaleSteps", 4).toInt()); + + bool useThemeColours = mSettings->value("graph/useThemeColours", true).toBool(); + ui->useThemeColoursRB->setChecked(useThemeColours); + ui->useCustomColoursRB->setChecked(!useThemeColours); + ui->customColoursB->setEnabled(!useThemeColours); +} + +void LxQtSysStatConfiguration::saveSettings() +{ + mSettings->setValue("graph/useThemeColours", ui->useThemeColoursRB->isChecked()); + mSettings->setValue("graph/updateInterval", ui->intervalSB->value()); + mSettings->setValue("graph/minimalSize", ui->sizeSB->value()); + + mSettings->setValue("grid/lines", ui->linesSB->value()); + + mSettings->setValue("title/label", ui->titleLE->text()); + + //Note: + // need to make a realy deep copy of the msStatTypes[x] because of SEGFAULTs + // occuring in static finalization time (don't know the real reason...maybe ordering of static finalizers/destructors) + QString type = ui->typeCOB->itemData(ui->typeCOB->currentIndex(), Qt::UserRole).toString().toStdString().c_str(); + mSettings->setValue("data/type", type); + mSettings->setValue("data/source", ui->sourceCOB->itemData(ui->sourceCOB->currentIndex(), Qt::UserRole)); + + mSettings->setValue("cpu/useFrequency", ui->useFrequencyCB->isChecked()); + + mSettings->setValue("net/maximumSpeed", PluginSysStat::netSpeedToString(ui->maximumHS->value())); + mSettings->setValue("net/logarithmicScale", ui->logarithmicCB->isChecked()); + mSettings->setValue("net/logarithmicScaleSteps", ui->logScaleSB->value()); +} + +void LxQtSysStatConfiguration::on_buttons_clicked(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + oldSettings.loadToSettings(); + loadSettings(); + } + else + close(); +} + +void LxQtSysStatConfiguration::on_typeCOB_currentIndexChanged(int index) +{ + if (mStat) + mStat->deleteLater(); + switch (index) + { + case 0: + mStat = new SysStat::CpuStat(this); + break; + + case 1: + mStat = new SysStat::MemStat(this); + break; + + case 2: + mStat = new SysStat::NetStat(this); + break; + } + + ui->sourceCOB->blockSignals(true); + ui->sourceCOB->clear(); + for (auto const & s : mStat->sources()) + ui->sourceCOB->addItem(tr(s.toStdString().c_str()), s); + ui->sourceCOB->blockSignals(false); + ui->sourceCOB->setCurrentIndex(0); +} + +void LxQtSysStatConfiguration::on_maximumHS_valueChanged(int value) +{ + ui->maximumValueL->setText(PluginSysStat::netSpeedToString(value)); +} + +void LxQtSysStatConfiguration::coloursChanged() +{ + const LxQtSysStatColours::Colours &colours = mColoursDialog->colours(); + + mSettings->setValue("grid/colour", colours["grid"].name()); + mSettings->setValue("title/colour", colours["title"].name()); + + mSettings->setValue("cpu/systemColour", colours["cpuSystem"].name()); + mSettings->setValue("cpu/userColour", colours["cpuUser"].name()); + mSettings->setValue("cpu/niceColour", colours["cpuNice"].name()); + mSettings->setValue("cpu/otherColour", colours["cpuOther"].name()); + mSettings->setValue("cpu/frequencyColour", colours["cpuFrequency"].name()); + + mSettings->setValue("mem/appsColour", colours["memApps"].name()); + mSettings->setValue("mem/buffersColour", colours["memBuffers"].name()); + mSettings->setValue("mem/cachedColour", colours["memCached"].name()); + mSettings->setValue("mem/swapColour", colours["memSwap"].name()); + + mSettings->setValue("net/receivedColour", colours["netReceived"].name()); + mSettings->setValue("net/transmittedColour", colours["netTransmitted"].name()); +} + +void LxQtSysStatConfiguration::on_customColoursB_clicked() +{ + if (!mColoursDialog) + { + mColoursDialog = new LxQtSysStatColours(this); + connect(mColoursDialog, SIGNAL(coloursChanged()), SLOT(coloursChanged())); + } + + LxQtSysStatColours::Colours colours; + + const LxQtSysStatColours::Colours &defaultColours = mColoursDialog->defaultColours(); + + colours["grid"] = QColor(mSettings->value("grid/colour", defaultColours["grid"] .name()).toString()); + colours["title"] = QColor(mSettings->value("title/colour", defaultColours["title"].name()).toString()); + + colours["cpuSystem"] = QColor(mSettings->value("cpu/systemColour", defaultColours["cpuSystem"] .name()).toString()); + colours["cpuUser"] = QColor(mSettings->value("cpu/userColour", defaultColours["cpuUser"] .name()).toString()); + colours["cpuNice"] = QColor(mSettings->value("cpu/niceColour", defaultColours["cpuNice"] .name()).toString()); + colours["cpuOther"] = QColor(mSettings->value("cpu/otherColour", defaultColours["cpuOther"] .name()).toString()); + colours["cpuFrequency"] = QColor(mSettings->value("cpu/frequencyColour", defaultColours["cpuFrequency"].name()).toString()); + + colours["memApps"] = QColor(mSettings->value("mem/appsColour", defaultColours["memApps"] .name()).toString()); + colours["memBuffers"] = QColor(mSettings->value("mem/buffersColour", defaultColours["memBuffers"].name()).toString()); + colours["memCached"] = QColor(mSettings->value("mem/cachedColour", defaultColours["memCached"] .name()).toString()); + colours["memSwap"] = QColor(mSettings->value("mem/swapColour", defaultColours["memSwap"] .name()).toString()); + + colours["netReceived"] = QColor(mSettings->value("net/receivedColour", defaultColours["netReceived"] .name()).toString()); + colours["netTransmitted"] = QColor(mSettings->value("net/transmittedColour", defaultColours["netTransmitted"].name()).toString()); + + mColoursDialog->setColours(colours); + + mColoursDialog->exec(); +} diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.h b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.h new file mode 100644 index 0000000..e804bfc --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.h @@ -0,0 +1,85 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTSYSSTATCONFIGURATION_H +#define LXQTSYSSTATCONFIGURATION_H + +#include + +#include +#include +#include + + +namespace Ui { + class LxQtSysStatConfiguration; +} + +namespace SysStat { + class BaseStat; +} + +class LxQtSysStatColours; + +class LxQtSysStatConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtSysStatConfiguration(QSettings *settings, QWidget *parent = 0); + ~LxQtSysStatConfiguration(); + +public slots: + void saveSettings(); + + void on_typeCOB_currentIndexChanged(int); + void on_maximumHS_valueChanged(int); + void on_customColoursB_clicked(); + void on_buttons_clicked(QAbstractButton *); + + void coloursChanged(); + +public: + static const QStringList msStatTypes; + +signals: + void maximumNetSpeedChanged(QString); + +private: + Ui::LxQtSysStatConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache oldSettings; + + void loadSettings(); + + SysStat::BaseStat *mStat; + + LxQtSysStatColours *mColoursDialog; +}; + +#endif // LXQTSYSSTATCONFIGURATION_H diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.ui b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.ui new file mode 100644 index 0000000..346872f --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatconfiguration.ui @@ -0,0 +1,461 @@ + + + LxQtSysStatConfiguration + + + + 0 + 0 + 399 + 438 + + + + System Statistics Settings + + + + + + + + Graph + + + + 4 + + + 4 + + + + + &Minimal size + + + sizeSB + + + + + + + Update &interval + + + intervalSB + + + + + + + &Title + + + titleLE + + + + + + + &Grid lines + + + linesSB + + + + + + + + + + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + + + px + + + 2 + + + 500 + + + 30 + + + + + + + s + + + 1 + + + 0.100000000000000 + + + 60.000000000000000 + + + 0.250000000000000 + + + 1.000000000000000 + + + + + + + + + + Data + + + + 4 + + + 4 + + + + + 0 + + + + + 0 + + + 0 + + + + + Use &frequency + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + 0 + + + 0 + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + 0 + + + 0 + + + + + 4 + + + + + Ma&ximum + + + maximumHS + + + + + + + 4 + + + + + XXX KBs + + + + + + + 39 + + + Qt::Horizontal + + + + + + + + + Lo&garithmic scale + + + + + + + steps + + + 1 + + + 64 + + + 4 + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + + + + + + &Source + + + sourceCOB + + + + + + + T&ype + + + typeCOB + + + + + + + + + + + + + Colours + + + + 4 + + + 5 + + + 4 + + + + + Use t&heme colours + + + true + + + + + + + Use c&ustom colours + + + + + + + Custom colour ... + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + intervalSB + sizeSB + linesSB + titleLE + typeCOB + sourceCOB + useFrequencyCB + maximumHS + logarithmicCB + logScaleSB + useThemeColoursRB + useCustomColoursRB + customColoursB + buttons + + + + + buttons + accepted() + LxQtSysStatConfiguration + accept() + + + 95 + 433 + + + 97 + 295 + + + + + buttons + rejected() + LxQtSysStatConfiguration + reject() + + + 76 + 433 + + + 62 + 296 + + + + + typeCOB + currentIndexChanged(int) + dataSW + setCurrentIndex(int) + + + 386 + 203 + + + 342 + 264 + + + + + useCustomColoursRB + toggled(bool) + customColoursB + setEnabled(bool) + + + 132 + 366 + + + 240 + 365 + + + + + diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatutils.cpp b/lxqt-panel/plugin-sysstat/lxqtsysstatutils.cpp new file mode 100644 index 0000000..2c7cd1c --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatutils.cpp @@ -0,0 +1,74 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include +#include + +#include "lxqtsysstatutils.h" + + +namespace PluginSysStat +{ + +QString netSpeedToString(int value) +{ + QString prefix; + static const char prefixes[] = "kMG"; + if (value / 10) + prefix = QChar(prefixes[value / 10 - 1]); + + return QString("%1 %2B/s").arg(1 << (value % 10)).arg(prefix); +} + +int netSpeedFromString(QString value) +{ + QRegExp re("^(\\d+) ([kMG])B/s$"); + if (re.exactMatch(value)) + { + int shift = 0; + switch (re.cap(2)[0].toLatin1()) + { + case 'k': + shift = 10; + break; + + case 'M': + shift = 20; + break; + + case 'G': + shift = 30; + break; + } + + return qCeil(qLn(re.cap(1).toInt()) / qLn(2.)) + shift; + } + + return 0; +} + +} diff --git a/lxqt-panel/plugin-sysstat/lxqtsysstatutils.h b/lxqt-panel/plugin-sysstat/lxqtsysstatutils.h new file mode 100644 index 0000000..889b696 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/lxqtsysstatutils.h @@ -0,0 +1,41 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTSYSSTATUTILS_HPP +#define LXQTSYSSTATUTILS_HPP + +#include + +namespace PluginSysStat +{ + +QString netSpeedToString(int value); +int netSpeedFromString(QString value); + +} + +#endif // LXQTSYSSTATUTILS_HPP diff --git a/lxqt-panel/plugin-sysstat/resources/sysstat.desktop.in b/lxqt-panel/plugin-sysstat/resources/sysstat.desktop.in new file mode 100644 index 0000000..2e51835 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/resources/sysstat.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System Statistics +Comment=System Statistics plugin. +Icon=utilities-system-monitor + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat.ts b/lxqt-panel/plugin-sysstat/translations/sysstat.ts new file mode 100644 index 0000000..309f514 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + + + + + Graph + + + + + &Grid + + + + + + + + + + + + + + + + + Change ... + + + + + T&itle + + + + + CPU + + + + + &Nice + + + + + Ot&her + + + + + &Frequency + + + + + S&ystem + + + + + &User + + + + + Memory + + + + + Cache&d + + + + + S&wap + + + + + &Applications + + + + + &Buffers + + + + + Network + + + + + &Received + + + + + &Transmitted + + + + + LxQtSysStatConfiguration + + + Graph + + + + + px + + + + + s + + + + + Data + + + + + System Statistics Settings + + + + + &Minimal size + + + + + Update &interval + + + + + &Title + + + + + &Grid lines + + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + + + + + Use &frequency + + + + + Ma&ximum + + + + + Lo&garithmic scale + + + + + CPU + + + + + Memory + + + + + Network + + + + + &Source + + + + + T&ype + + + + + Colours + + + + + Use t&heme colours + + + + + Use c&ustom colours + + + + + Custom colour ... + + + + + XXX KBs + + + + + steps + + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_de.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_de.desktop new file mode 100644 index 0000000..b11a9a4 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Systemstatistiken +Comment[de]=Plugin zum Anzeigen von Systemstatistiken diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_de.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_de.ts new file mode 100644 index 0000000..31ec36a --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_de.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Systemstatistik-Farben + + + + Graph + Graph + + + + &Grid + &Raster + + + + + + + + + + + + + + + + Change ... + ändern... + + + + T&itle + T&itel + + + + CPU + Prozessor + + + + &Nice + &Priorität + + + + Ot&her + A&ndere + + + + &Frequency + &Frequenz + + + + S&ystem + S&ystem + + + + &User + Ben&utzer + + + + Memory + Speicher + + + + Cache&d + Zwischenspei&cher + + + + S&wap + Ausge&lagert + + + + &Applications + &Anwendungen + + + + &Buffers + Puff&er + + + + Network + Netzwerk + + + + &Received + E&mpfangen + + + + &Transmitted + &Gesendet + + + + LxQtSysStatConfiguration + + + System Statistics Settings + Systemstatistik - Einstellungen + + + + Graph + Graph + + + + &Minimal size + &Mindestgröße + + + + Update &interval + Aktualisierungs&intervall + + + + &Title + &Titel + + + + &Grid lines + &Rasterlinien + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Mindestbreite bei horizontalem Panel.</p><p>Mindesthöhe bei vertikalem Panel.</p></body></html> + + + + px + px + + + + s + s + + + + Data + Daten + + + + Use &frequency + &Frequenz nutzen + + + + Ma&ximum + Ma&ximum + + + + XXX KBs + XXX KB/s + + + + Lo&garithmic scale + Lo&garithmische Skala + + + + steps + Schritte + + + + CPU + Prozessor + + + + Memory + Speicher + + + + Network + Netzwerk + + + + &Source + &Quelle + + + + T&ype + T&yp + + + + Colours + Farben + + + + Use t&heme colours + Farben des Farbsc&hemas + + + + Use c&ustom colours + &Eigene Farben + + + + Custom colour ... + auswählen... + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_hu.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_hu.desktop new file mode 100644 index 0000000..d5211b8 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Rendszerstatisztika +Comment[pt]=Infó a rendszerállapotról diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_hu.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_hu.ts new file mode 100644 index 0000000..1d07a6b --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_hu.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_hu_HU.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_hu_HU.ts new file mode 100644 index 0000000..49bf4d9 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_hu_HU.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ja.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_ja.desktop new file mode 100644 index 0000000..212b82d --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ja.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ja]=システム統計 +Comment[ja]=システム統計のプラグイン + +#TRANSLATIONS_DIR=../translations + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ja.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_ja.ts new file mode 100644 index 0000000..a7baee1 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ja.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + システム統計の色 + + + + Graph + グラフ + + + + &Grid + グリッド(&G) + + + + + + + + + + + + + + + + Change ... + 変更する + + + + T&itle + タイトル(&T) + + + + CPU + CPU + + + + &Nice + Nice(&N) + + + + Ot&her + その他(&H) + + + + &Frequency + 周波数(&F) + + + + S&ystem + システム(&Y) + + + + &User + ユーザー(&U) + + + + Memory + メモリー + + + + Cache&d + キャッシュ(&D) + + + + S&wap + スワップ(&W) + + + + &Applications + アプリケーション(&A) + + + + &Buffers + バッファー(&B) + + + + Network + ネットワーク + + + + &Received + 受信(&R) + + + + &Transmitted + 送信(&T) + + + + LxQtSysStatConfiguration + + + Graph + グラフ + + + + px + ピクセル + + + + s + + + + + Data + データー + + + + System Statistics Settings + システム統計の設定 + + + + &Minimal size + サイズの最小値(&M) + + + + Update &interval + 更新頻度(&I) + + + + &Title + タイトル(&T) + + + + &Grid lines + グリッド線の数(&G) + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>水平なパネルでは幅の最小値、</p><p>垂直なパネルでは高さの最小値です</p></body></html> + + + + Use &frequency + 周波数をグラフ表示(&F) + + + + Ma&ximum + 最大(&X) + + + + Lo&garithmic scale + 対数スケール(&G) + + + + CPU + CPU + + + + Memory + メモリー + + + + Network + ネットワーク + + + + &Source + 情報元(&S) + + + + T&ype + 種類(&Y) + + + + Colours + + + + + Use t&heme colours + テーマの色を使用(&H) + + + + Use c&ustom colours + 色を指定(&U) + + + + Custom colour ... + 色を指定する + + + + XXX KBs + XXX KB + + + + steps + ステップ + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_pt.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_pt.desktop new file mode 100644 index 0000000..e78968e --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_pt.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[pt]=Estatísticas do sistema +Comment[pt]=Mostra as estatísticas do sistema diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_pt.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_pt.ts new file mode 100644 index 0000000..ae23b37 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_pt.ts @@ -0,0 +1,369 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Cores das estatísticas do sistema + + + + Graph + Gráfico + + + + &Grid + &Grelha + + + + + + + + + + + + + + + + Change ... + Mudar... + + + + T&itle + Tí&tulo + + + + CPU + CPU + + + + &Nice + A&ceitável + + + + Ot&her + O&utras + + + + &Frequency + &Frequência + + + + S&ystem + S&istema + + + + &User + &Utilizador + + + + Memory + Memória + + + + Cache&d + Cac&he + + + + S&wap + S&wap + + + + &Applications + &Aplicações + + + + &Buffers + &Buffers + + + + Network + Rede + + + + &Received + &Recebido + + + + &Transmitted + &Enviado + + + + LxQtSysStatConfiguration + + LxQt SysStat Settings + Definições do LxQt SysStat + + + + Graph + Gráfico + + + Update interval + Intervalo de atualização + + + Minimal size + Tamanho mínimo + + + + px + px + + + + s + s + + + Grid + Grelha + + + Lines + Linhas + + + Colour + Cor + + + Change ... + Mudar... + + + Title + Título + + + Label + Etiqueta + + + Font + Tipo de letra + + + + Data + Dados + + + Type + Tipo + + + + System Statistics Settings + Defiições das estatísticas do sistema + + + + &Minimal size + Tamanho &mínimo + + + + Update &interval + &Intervalo de atualização + + + + &Title + &Título + + + + &Grid lines + Linhas da &grelha + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Lagura mínima se o painelestiver na horizontal.</p><p>Altura mínima se o painel estiver na vertical.</p></body></html> + + + + Use &frequency + Utilizar &frequência + + + + Ma&ximum + Má&ximo + + + + Lo&garithmic scale + Escala lo&garítmica + + + + CPU + CPU + + + + Memory + Memória + + + + Network + Rede + + + + &Source + &Fonte + + + + T&ype + T&ipo + + + + Colours + Cores + + + + Use t&heme colours + Utili&zar cores do tema + + + + Use c&ustom colours + &Utilizar cores personalizadas + + + + Custom colour ... + Cor personalizada... + + + Source + Fonte + + + System + Sistema + + + User + Utilizador + + + Nice + Aceitável + + + Other + Outras + + + Use Frequency + Utilizar frequência + + + Frequency + Frequência + + + Applications + Aplicações + + + Buffers + Buffers + + + Cached + Cache + + + Used + Utilizado + + + Received + Recebido + + + Transmitted + Enviado + + + Maximum + Máximo + + + + XXX KBs + XXX KBs + + + Logarithmic scale + Escala logarítmica + + + + steps + etapas + + + Ultra light + Ultra claro + + + Light + Claro + + + Ultra black + Ultra escuro + + + Black + Escuro + + + Bold + Negrito + + + Demi bold + Semi-negrito + + + Italic + Itálico + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ru.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_ru.desktop new file mode 100644 index 0000000..b738aec --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ru.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru]=Системная статистика +Comment[ru]=Плагин системной статистики. + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ru.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_ru.ts new file mode 100644 index 0000000..4708e0d --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ru.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Цвета статистических данных системы + + + + Graph + График + + + + &Grid + &Сетка + + + + + + + + + + + + + + + + Change ... + Изменить… + + + + T&itle + &Название + + + + CPU + ЦПУ + + + + &Nice + + + + + Ot&her + &Прочее + + + + &Frequency + &Частота + + + + S&ystem + &Система + + + + &User + &Пользователь + + + + Memory + Память + + + + Cache&d + &Кэшировано + + + + S&wap + &Подкачка + + + + &Applications + &Приложения + + + + &Buffers + &Буферы + + + + Network + Сеть + + + + &Received + &Получено + + + + &Transmitted + &Передано + + + + LxQtSysStatConfiguration + + + System Statistics Settings + Настройки статистических данных системы + + + + Graph + График + + + + &Minimal size + &Минимальный размер + + + + Update &interval + И&нтервал обновления + + + + &Title + &Название + + + + &Grid lines + &Линий сетки + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Минимальная ширина для горизонтальной панели.</p><p>Минимальная высота для вертикальной панели.</p></body></html> + + + + px + пикс + + + + s + с + + + + Data + Данные + + + + Use &frequency + Использовать &частоту + + + + Ma&ximum + Ма&ксимум + + + + XXX KBs + XXX Кб + + + + Lo&garithmic scale + Ло&гарифмическая шкала + + + + steps + шаги + + + + CPU + ЦПУ + + + + Memory + Память + + + + Network + Сеть + + + + &Source + &Источник + + + + T&ype + &Тип + + + + Colours + Цвета + + + + Use t&heme colours + Использовать цвета &темы + + + + Use c&ustom colours + Использовать с&вои цвета + + + + Custom colour ... + Свои цвета… + + + diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.desktop b/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.desktop new file mode 100644 index 0000000..0ef8cb0 --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru_RU]=Системная статистика +Comment[ru_RU]=Плагин системной статистики. + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.ts b/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.ts new file mode 100644 index 0000000..329baab --- /dev/null +++ b/lxqt-panel/plugin-sysstat/translations/sysstat_ru_RU.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Цвета статистических данных системы + + + + Graph + График + + + + &Grid + &Сетка + + + + + + + + + + + + + + + + Change ... + Изменить… + + + + T&itle + &Название + + + + CPU + ЦПУ + + + + &Nice + + + + + Ot&her + &Прочее + + + + &Frequency + &Частота + + + + S&ystem + &Система + + + + &User + &Пользователь + + + + Memory + Память + + + + Cache&d + &Кэшировано + + + + S&wap + &Подкачка + + + + &Applications + &Приложения + + + + &Buffers + &Буферы + + + + Network + Сеть + + + + &Received + &Получено + + + + &Transmitted + &Передано + + + + LxQtSysStatConfiguration + + + System Statistics Settings + Настройки статистических данных системы + + + + Graph + График + + + + &Minimal size + &Минимальный размер + + + + Update &interval + И&нтервал обновления + + + + &Title + &Название + + + + &Grid lines + &Линий сетки + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Минимальная ширина для горизонтальной панели.</p><p>Минимальная высота для вертикальной панели.</p></body></html> + + + + px + пикс + + + + s + с + + + + Data + Данные + + + + Use &frequency + Использовать &частоту + + + + Ma&ximum + Ма&ксимум + + + + XXX KBs + XXX Кб + + + + Lo&garithmic scale + Ло&гарифмическая шкала + + + + steps + шаги + + + + CPU + ЦПУ + + + + Memory + Память + + + + Network + Сеть + + + + &Source + &Источник + + + + T&ype + &Тип + + + + Colours + Цвета + + + + Use t&heme colours + Использовать цвета &темы + + + + Use c&ustom colours + Использовать с&вои цвета + + + + Custom colour ... + Свои цвета… + + + diff --git a/lxqt-panel/plugin-taskbar/CMakeLists.txt b/lxqt-panel/plugin-taskbar/CMakeLists.txt new file mode 100644 index 0000000..3e646cc --- /dev/null +++ b/lxqt-panel/plugin-taskbar/CMakeLists.txt @@ -0,0 +1,30 @@ +set(PLUGIN "taskbar") + +set(HEADERS + lxqttaskbar.h + lxqttaskbutton.h + lxqttaskbarconfiguration.h + lxqttaskbarplugin.h + lxqttaskgroup.h + lxqtgrouppopup.h +) + +set(SOURCES + lxqttaskbar.cpp + lxqttaskbutton.cpp + lxqttaskbarconfiguration.cpp + lxqttaskbarplugin.cpp + lxqttaskgroup.cpp + lxqtgrouppopup.cpp +) + +set(UIS + lxqttaskbarconfiguration.ui +) + +set(LIBRARIES + lxqt + Qt5Xdg +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-taskbar/lxqtgrouppopup.cpp b/lxqt-panel/plugin-taskbar/lxqtgrouppopup.cpp new file mode 100644 index 0000000..55eda7a --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqtgrouppopup.cpp @@ -0,0 +1,171 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtgrouppopup.h" +#include +#include +#include +#include +#include + +/************************************************ + this class is just a container of window buttons + the main purpose is showing window buttons in + vertical layout and drag&drop feature inside + group + ************************************************/ +LxQtGroupPopup::LxQtGroupPopup(LxQtTaskGroup *group): + QFrame(group), + mGroup(group) +{ + Q_ASSERT(group); + setAcceptDrops(true); + setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); + setAttribute(Qt::WA_AlwaysShowToolTips); + + setLayout(new QVBoxLayout); + layout()->setSpacing(3); + layout()->setMargin(3); + + connect(&mCloseTimer, &QTimer::timeout, this, &LxQtGroupPopup::closeTimerSlot); + mCloseTimer.setSingleShot(true); + mCloseTimer.setInterval(400); +} + +LxQtGroupPopup::~LxQtGroupPopup() +{ +} + +void LxQtGroupPopup::dropEvent(QDropEvent *event) +{ + qlonglong temp; + WId window; + QDataStream stream(event->mimeData()->data(LxQtTaskButton::mimeDataFormat())); + stream >> temp; + window = (WId) temp; + + LxQtTaskButton *button; + int oldIndex(0); + // get current position of the button being dragged + for (int i = 0; i < layout()->count(); i++) + { + LxQtTaskButton *b = qobject_cast(layout()->itemAt(i)->widget()); + if (b && b->windowId() == window) + { + button = b; + oldIndex = i; + break; + } + } + + int newIndex = -1; + // find the new position to place it in + for (int i = 0; i < oldIndex && newIndex == -1; i++) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 > event->pos().y()) + newIndex = i; + } + const int size = layout()->count(); + for (int i = size - 1; i > oldIndex && newIndex == -1; i--) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 < event->pos().y()) + newIndex = i; + } + + if (newIndex == -1 || newIndex == oldIndex) + return; + + QVBoxLayout * l = qobject_cast(layout()); + l->takeAt(oldIndex); + l->insertWidget(newIndex, button); + l->invalidate(); +} + +void LxQtGroupPopup::dragEnterEvent(QDragEnterEvent *event) +{ + event->accept(); + QWidget::dragEnterEvent(event); +} + +void LxQtGroupPopup::dragLeaveEvent(QDragLeaveEvent *event) +{ + hide(false/*not fast*/); + QFrame::dragLeaveEvent(event); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::leaveEvent(QEvent *event) +{ + mCloseTimer.start(); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::enterEvent(QEvent *event) +{ + mCloseTimer.stop(); +} + +void LxQtGroupPopup::hide(bool fast) +{ + if (fast) + close(); + else + mCloseTimer.start(); +} + +void LxQtGroupPopup::show() +{ + mCloseTimer.stop(); + QFrame::show(); +} + +void LxQtGroupPopup::closeTimerSlot() +{ + bool button_has_dnd_hover = false; + QLayout* l = layout(); + for (int i = 0; l->count() > i; ++i) + { + LxQtTaskButton const * const button = dynamic_cast(l->itemAt(i)->widget()); + if (0 != button && button->hasDragAndDropHover()) + { + button_has_dnd_hover = true; + break; + } + } + if (!button_has_dnd_hover) + close(); +} diff --git a/lxqt-panel/plugin-taskbar/lxqtgrouppopup.h b/lxqt-panel/plugin-taskbar/lxqtgrouppopup.h new file mode 100644 index 0000000..67f2d7d --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqtgrouppopup.h @@ -0,0 +1,78 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKPOPUP_H +#define LXQTTASKPOPUP_H + +#include +#include +#include +#include +#include + +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +class LxQtGroupPopup: public QFrame +{ + Q_OBJECT + +public: + LxQtGroupPopup(LxQtTaskGroup *group); + ~LxQtGroupPopup(); + + void hide(bool fast = false); + void show(); + + // Layout + int indexOf(LxQtTaskButton *button) { return layout()->indexOf(button); } + int count() { return layout()->count(); } + QLayoutItem * itemAt(int i) { return layout()->itemAt(i); } + int spacing() { return layout()->spacing(); } + void addButton(LxQtTaskButton* button) { layout()->addWidget(button); } + void removeWidget(QWidget *button) { layout()->removeWidget(button); } + +protected: + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent *event); + void dropEvent(QDropEvent * event); + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + + void closeTimerSlot(); + +private: + LxQtTaskGroup *mGroup; + QTimer mCloseTimer; +}; + +#endif // LXQTTASKPOPUP_H diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbar.cpp b/lxqt-panel/plugin-taskbar/lxqttaskbar.cpp new file mode 100644 index 0000000..06cd032 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbar.cpp @@ -0,0 +1,541 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "lxqttaskbar.h" +#include "lxqttaskgroup.h" + +using namespace LxQt; + +/************************************************ + +************************************************/ +LxQtTaskBar::LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget *parent) : + QFrame(parent), + mButtonStyle(Qt::ToolButtonTextBesideIcon), + mCloseOnMiddleClick(true), + mRaiseOnCurrentDesktop(true), + mShowOnlyOneDesktopTasks(false), + mShowDesktopNum(0), + mShowOnlyCurrentScreenTasks(false), + mShowOnlyMinimizedTasks(false), + mAutoRotate(true), + mShowGroupOnHover(true), + mPlugin(plugin), + mPlaceHolder(new QWidget(this)), + mStyle(new LeftAlignedTextStyle()) +{ + setStyle(mStyle); + mLayout = new LxQt::GridLayout(this); + setLayout(mLayout); + mLayout->setMargin(0); + mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); + realign(); + + mPlaceHolder->setMinimumSize(1, 1); + mPlaceHolder->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + mPlaceHolder->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + mLayout->addWidget(mPlaceHolder); + + QTimer::singleShot(0, this, SLOT(settingsChanged())); + setAcceptDrops(true); + + connect(KWindowSystem::self(), SIGNAL(stackingOrderChanged()), SLOT(refreshTaskList())); + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged) + , this, &LxQtTaskBar::onWindowChanged); +} + +/************************************************ + + ************************************************/ +LxQtTaskBar::~LxQtTaskBar() +{ + delete mStyle; +} + +/************************************************ + + ************************************************/ +bool LxQtTaskBar::acceptWindow(WId window) const +{ + QFlags ignoreList; + ignoreList |= NET::DesktopMask; + ignoreList |= NET::DockMask; + ignoreList |= NET::SplashMask; + ignoreList |= NET::ToolbarMask; + ignoreList |= NET::MenuMask; + ignoreList |= NET::PopupMenuMask; + ignoreList |= NET::NotificationMask; + + KWindowInfo info(window, NET::WMWindowType | NET::WMState, NET::WM2TransientFor); + if (!info.valid()) + return false; + + if (NET::typeMatchesMask(info.windowType(NET::AllTypesMask), ignoreList)) + return false; + + if (info.state() & NET::SkipTaskbar) + return false; + + // WM_TRANSIENT_FOR hint not set - normal window + WId transFor = info.transientFor(); + if (transFor == 0 || transFor == window || transFor == (WId) QX11Info::appRootWindow()) + return true; + + info = KWindowInfo(transFor, NET::WMWindowType); + + QFlags normalFlag; + normalFlag |= NET::NormalMask; + normalFlag |= NET::DialogMask; + normalFlag |= NET::UtilityMask; + + return !NET::typeMatchesMask(info.windowType(NET::AllTypesMask), normalFlag); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::dragEnterEvent(QDragEnterEvent* event) +{ + if (event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) + event->acceptProposedAction(); + else + event->ignore(); + QWidget::dragEnterEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::dropEvent(QDropEvent* event) +{ + if (!event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) + { + event->ignore(); + return; + } + + QString data; + QDataStream stream(event->mimeData()->data(LxQtTaskGroup::mimeDataFormat())); + stream >> data; + + LxQtTaskGroup *group = mGroupsHash.value(data, NULL); + if (!group) + { + qDebug() << "Dropped invalid"; + return; + } + + int droppedIndex = mLayout->indexOf(group); + int newPos = -1; + const int size = mLayout->count(); + if (mPlugin->panel()->isHorizontal()) + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) + newPos = i; + + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x()) + newPos = i; + } + else + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 > event->pos().y()) + newPos = i; + + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 < event->pos().y()) + newPos = i; + } + + if (newPos == -1 || droppedIndex == newPos) + return; + + mLayout->moveItem(droppedIndex, newPos); + mLayout->invalidate(); + + QWidget::dropEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::groupBecomeEmptySlot() +{ + //group now contains no buttons - clean up in hash and delete the group + LxQtTaskGroup *group = qobject_cast(sender()); + Q_ASSERT(group); + + mGroupsHash.erase(mGroupsHash.find(group->groupName())); + group->deleteLater(); +} + +/************************************************ + + ************************************************/ + +void LxQtTaskBar::addWindow(WId window, QString const & groupId) +{ + LxQtTaskGroup *group = mGroupsHash.value(groupId); + + if (!group) + { + group = new LxQtTaskGroup(groupId, KWindowSystem::icon(window), mPlugin, this); + connect(group, SIGNAL(groupBecomeEmpty(QString)), this, SLOT(groupBecomeEmptySlot())); + connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility())); + connect(group, &LxQtTaskGroup::popupShown, this, &LxQtTaskBar::groupPopupShown); + connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList())); + + mLayout->addWidget(group); + mGroupsHash.insert(groupId, group); + group->setToolButtonsStyle(mButtonStyle); + } + group->addWindow(window); +} +/************************************************ + + ************************************************/ + +void LxQtTaskBar::refreshTaskList() +{ + // Just add new windows to groups, deleting is up to the groups + QList tmp = KWindowSystem::stackingOrder(); + + Q_FOREACH (WId wnd, tmp) + { + if (acceptWindow(wnd)) + { + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(wnd, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(wnd); + addWindow(wnd, id); + } + } + + refreshPlaceholderVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(window, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(window); + LxQtTaskGroup *group = mGroupsHash.value(id); + + bool consumed{false}; + if (nullptr != group) + { + consumed = group->onWindowChanged(window, prop, prop2); + + } + + if (!consumed && acceptWindow(window)) + addWindow(window, id); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::refreshButtonRotation() +{ + bool autoRotate = mAutoRotate && (mButtonStyle != Qt::ToolButtonIconOnly); + + ILxQtPanel::Position panelPosition = mPlugin->panel()->position(); + QHashIterator j(mGroupsHash); + while(j.hasNext()) + { + j.next(); + j.value()->setAutoRotation(autoRotate,panelPosition); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::refreshPlaceholderVisibility() +{ + // if no visible group button show placeholder widget + bool haveVisibleWindow = false; + QHashIterator j(mGroupsHash); + while (j.hasNext()) + { + j.next(); + if (j.value()->isVisible()) + haveVisibleWindow = true; + } + mPlaceHolder->setVisible(!haveVisibleWindow); + if (haveVisibleWindow) + mPlaceHolder->setFixedSize(0, 0); + else + { + mPlaceHolder->setMinimumSize(1, 1); + mPlaceHolder->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + } + +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::refreshIconGeometry() +{ + QHashIterator i(mGroupsHash); + while (i.hasNext()) + { + i.next(); + i.value()->refreshIconsGeometry(); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::setButtonStyle(Qt::ToolButtonStyle buttonStyle) +{ + mButtonStyle = buttonStyle; + + QHashIterator i(mGroupsHash); + while (i.hasNext()) + { + i.next(); + i.value()->setToolButtonsStyle(buttonStyle); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::settingsChanged() +{ + bool groupingEnabledOld = mGroupingEnabled; + bool showOnlyOneDesktopTasksOld = mShowOnlyOneDesktopTasks; + const int showDesktopNumOld = mShowDesktopNum; + bool showOnlyCurrentScreenTasksOld = mShowOnlyCurrentScreenTasks; + bool showOnlyMinimizedTasksOld = mShowOnlyMinimizedTasks; + + mButtonWidth = mPlugin->settings()->value("buttonWidth", 400).toInt(); + mButtonHeight = mPlugin->settings()->value("buttonHeight", 100).toInt(); + QString s = mPlugin->settings()->value("buttonStyle").toString().toUpper(); + + if (s == "ICON") + setButtonStyle(Qt::ToolButtonIconOnly); + else if (s == "TEXT") + setButtonStyle(Qt::ToolButtonTextOnly); + else + setButtonStyle(Qt::ToolButtonTextBesideIcon); + + mShowOnlyOneDesktopTasks = mPlugin->settings()->value("showOnlyOneDesktopTasks", mShowOnlyOneDesktopTasks).toBool(); + mShowDesktopNum = mPlugin->settings()->value("showDesktopNum", mShowDesktopNum).toInt(); + mShowOnlyCurrentScreenTasks = mPlugin->settings()->value("showOnlyCurrentScreenTasks", mShowOnlyCurrentScreenTasks).toBool(); + mShowOnlyMinimizedTasks = mPlugin->settings()->value("showOnlyMinimizedTasks", mShowOnlyMinimizedTasks).toBool(); + mAutoRotate = mPlugin->settings()->value("autoRotate", true).toBool(); + mCloseOnMiddleClick = mPlugin->settings()->value("closeOnMiddleClick", true).toBool(); + mRaiseOnCurrentDesktop = mPlugin->settings()->value("raiseOnCurrentDesktop", false).toBool(); + mGroupingEnabled = mPlugin->settings()->value("groupingEnabled",true).toBool(); + mShowGroupOnHover = mPlugin->settings()->value("showGroupOnHover",true).toBool(); + + // Delete all groups if grouping feature toggled and start over + if (groupingEnabledOld != mGroupingEnabled) + { + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash.values()) + { + mLayout->removeWidget(group); + group->deleteLater(); + } + mGroupsHash.clear(); + } + + if (showOnlyOneDesktopTasksOld != mShowOnlyOneDesktopTasks + || (mShowOnlyOneDesktopTasks && showDesktopNumOld != mShowDesktopNum) + || showOnlyCurrentScreenTasksOld != mShowOnlyCurrentScreenTasks + || showOnlyMinimizedTasksOld != mShowOnlyMinimizedTasks + ) + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); + + refreshTaskList(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::realign() +{ + mLayout->setEnabled(false); + refreshButtonRotation(); + + ILxQtPanel *panel = mPlugin->panel(); + QSize maxSize = QSize(mButtonWidth, mButtonHeight); + QSize minSize = QSize(0, 0); + + bool rotated = false; + + if (panel->isHorizontal()) + { + mLayout->setRowCount(panel->lineCount()); + mLayout->setColumnCount(0); + } + else + { + mLayout->setRowCount(0); + + if (mButtonStyle == Qt::ToolButtonIconOnly) + { + // Vertical + Icons + mLayout->setColumnCount(panel->lineCount()); + } + else + { + rotated = mAutoRotate && (panel->position() == ILxQtPanel::PositionLeft || panel->position() == ILxQtPanel::PositionRight); + + // Vertical + Text + if (rotated) + { + maxSize.rwidth() = mButtonHeight; + maxSize.rheight() = mButtonWidth; + + mLayout->setColumnCount(panel->lineCount()); + } + else + { + mLayout->setColumnCount(1); + } + } + } + + mLayout->setCellMinimumSize(minSize); + mLayout->setCellMaximumSize(maxSize); + mLayout->setDirection(rotated ? LxQt::GridLayout::TopToBottom : LxQt::GridLayout::LeftToRight); + mLayout->setEnabled(true); + + //our placement on screen could have been changed + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); + refreshIconGeometry(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::wheelEvent(QWheelEvent* event) +{ + static int threshold = 0; + threshold += abs(event->delta()); + if (threshold < 300) + return; + else + threshold = 0; + + int delta = event->delta() < 0 ? 1 : -1; + + // create temporary list of visible groups in the same order like on the layout + QList list; + LxQtTaskGroup *group = NULL; + for (int i = 0; i < mLayout->count(); i++) + { + QWidget * o = mLayout->itemAt(i)->widget(); + LxQtTaskGroup * g = qobject_cast(o); + if (!g) + continue; + + if (g->isVisible()) + list.append(g); + if (g->isChecked()) + group = g; + } + + if (list.isEmpty()) + return; + + if (!group) + group = list.at(0); + + LxQtTaskButton *button = NULL; + + // switching between groups from temporary list in modulo addressing + while (!button) + { + button = group->getNextPrevChildButton(delta == 1, !(list.count() - 1)); + if (button) + button->raiseApplication(); + int idx = (list.indexOf(group) + delta + list.count()) % list.count(); + group = list.at(idx); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::resizeEvent(QResizeEvent* event) +{ + refreshIconGeometry(); + return QWidget::resizeEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::changeEvent(QEvent* event) +{ + // if current style is changed, reset the base style of the proxy style + // so we can apply the new style correctly to task buttons. + if(event->type() == QEvent::StyleChange) + mStyle->setBaseStyle(NULL); + + QFrame::changeEvent(event); +} + +void LxQtTaskBar::groupPopupShown(LxQtTaskGroup * const sender) +{ + //close all popups (should they be visible because of close delay) + for (auto group : mGroupsHash) + { + if (group->isVisible() && sender != group) + group->setPopupVisible(false, true/*fast*/); + } +} diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbar.h b/lxqt-panel/plugin-taskbar/lxqttaskbar.h new file mode 100644 index 0000000..e672051 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbar.h @@ -0,0 +1,129 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTTASKBAR_H +#define LXQTTASKBAR_H + +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskbarconfiguration.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbutton.h" + +#include +#include +#include +#include "../panel/ilxqtpanel.h" +#include +#include +#include + +class LxQtTaskButton; +class ElidedButtonStyle; + +namespace LxQt { +class GridLayout; +} + +class LxQtTaskBar : public QFrame +{ + Q_OBJECT + +public: + explicit LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + virtual ~LxQtTaskBar(); + + void realign(); + + Qt::ToolButtonStyle buttonStyle() const { return mButtonStyle; } + int buttonWidth() const { return mButtonWidth; } + bool closeOnMiddleClick() const { return mCloseOnMiddleClick; } + bool raiseOnCurrentDesktop() const { return mRaiseOnCurrentDesktop; } + bool isShowOnlyOneDesktopTasks() const { return mShowOnlyOneDesktopTasks; } + int showDesktopNum() const { return mShowDesktopNum; } + bool isShowOnlyCurrentScreenTasks() const { return mShowOnlyCurrentScreenTasks; } + bool isShowOnlyMinimizedTasks() const { return mShowOnlyMinimizedTasks; } + bool isAutoRotate() const { return mAutoRotate; } + bool isGroupingEnabled() const { return mGroupingEnabled; } + bool isShowGroupOnHover() const { return mShowGroupOnHover; } + ILxQtPanel * panel() const { return mPlugin->panel(); } + +public slots: + void settingsChanged(); + +protected: + virtual void dragEnterEvent(QDragEnterEvent * event); + virtual void dropEvent(QDropEvent * event); + +private slots: + void refreshIconGeometry(); + void refreshTaskList(); + void refreshButtonRotation(); + void refreshPlaceholderVisibility(); + void groupBecomeEmptySlot(); + void groupPopupShown(LxQtTaskGroup * const sender); + void onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + +private: + void addWindow(WId window, QString const & groupId); + +private: + QHash mGroupsHash; + LxQt::GridLayout *mLayout; + + // Settings + Qt::ToolButtonStyle mButtonStyle; + int mButtonWidth; + int mButtonHeight; + bool mCloseOnMiddleClick; + bool mRaiseOnCurrentDesktop; + bool mShowOnlyOneDesktopTasks; + int mShowDesktopNum; + bool mShowOnlyCurrentScreenTasks; + bool mShowOnlyMinimizedTasks; + bool mAutoRotate; + bool mGroupingEnabled; + bool mShowGroupOnHover; + + bool acceptWindow(WId window) const; + void setButtonStyle(Qt::ToolButtonStyle buttonStyle); + + void wheelEvent(QWheelEvent* event); + void changeEvent(QEvent* event); + void resizeEvent(QResizeEvent *event); + + ILxQtPanelPlugin *mPlugin; + QWidget *mPlaceHolder; + LeftAlignedTextStyle *mStyle; +}; + +#endif // LXQTTASKBAR_H diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.cpp b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.cpp new file mode 100644 index 0000000..23f90af --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.cpp @@ -0,0 +1,131 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqttaskbarconfiguration.h" +#include "ui_lxqttaskbarconfiguration.h" +#include + +LxQtTaskbarConfiguration::LxQtTaskbarConfiguration(QSettings &settings, QWidget *parent): + QDialog(parent), + ui(new Ui::LxQtTaskbarConfiguration), + mSettings(settings), + oldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("TaskbarConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + ui->buttonStyleCB->addItem(tr("Icon and text"), "IconText"); + ui->buttonStyleCB->addItem(tr("Only icon"), "Icon"); + ui->buttonStyleCB->addItem(tr("Only text"), "Text"); + + ui->showDesktopNumCB->addItem(tr("Current"), 0); + //Note: in KWindowSystem desktops are numbered from 1..N + const int desk_cnt = KWindowSystem::numberOfDesktops(); + for (int i = 1; desk_cnt >= i; ++i) + ui->showDesktopNumCB->addItem(QStringLiteral("%1 - %2").arg(i).arg(KWindowSystem::desktopName(i)), i); + + loadSettings(); + + /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly + change of state */ + connect(ui->limitByDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByDesktopCB, &QCheckBox::stateChanged, ui->showDesktopNumCB, &QWidget::setEnabled); + connect(ui->showDesktopNumCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); + connect(ui->limitByScreenCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByMinimizedCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->raiseOnCurrentDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->buttonStyleCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); + connect(ui->buttonWidthSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->buttonHeightSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->autoRotateCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->middleClickCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->groupingGB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->showGroupOnHoverCB, SIGNAL(clicked()), this, SLOT(saveSettings())); +} + +LxQtTaskbarConfiguration::~LxQtTaskbarConfiguration() +{ + delete ui; +} + +void LxQtTaskbarConfiguration::loadSettings() +{ + const bool showOnlyOneDesktopTasks = mSettings.value("showOnlyOneDesktopTasks", false).toBool(); + ui->limitByDesktopCB->setChecked(showOnlyOneDesktopTasks); + ui->showDesktopNumCB->setCurrentIndex(ui->showDesktopNumCB->findData(mSettings.value("showDesktopNum", 0).toInt())); + ui->showDesktopNumCB->setEnabled(showOnlyOneDesktopTasks); + ui->limitByScreenCB->setChecked(mSettings.value("showOnlyCurrentScreenTasks", false).toBool()); + ui->limitByMinimizedCB->setChecked(mSettings.value("showOnlyMinimizedTasks", false).toBool()); + + ui->autoRotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); + ui->middleClickCB->setChecked(mSettings.value("closeOnMiddleClick", true).toBool()); + ui->raiseOnCurrentDesktopCB->setChecked(mSettings.value("raiseOnCurrentDesktop", false).toBool()); + ui->buttonStyleCB->setCurrentIndex(ui->buttonStyleCB->findData(mSettings.value("buttonStyle", "IconText"))); + ui->buttonWidthSB->setValue(mSettings.value("buttonWidth", 400).toInt()); + ui->buttonHeightSB->setValue(mSettings.value("buttonHeight", 100).toInt()); + ui->groupingGB->setChecked(mSettings.value("groupingEnabled",true).toBool()); + ui->showGroupOnHoverCB->setChecked(mSettings.value("showGroupOnHover",true).toBool()); +} + +void LxQtTaskbarConfiguration::saveSettings() +{ + mSettings.setValue("showOnlyOneDesktopTasks", ui->limitByDesktopCB->isChecked()); + mSettings.setValue("showDesktopNum", ui->showDesktopNumCB->itemData(ui->showDesktopNumCB->currentIndex())); + mSettings.setValue("showOnlyCurrentScreenTasks", ui->limitByScreenCB->isChecked()); + mSettings.setValue("showOnlyMinimizedTasks", ui->limitByMinimizedCB->isChecked()); + mSettings.setValue("buttonStyle", ui->buttonStyleCB->itemData(ui->buttonStyleCB->currentIndex())); + mSettings.setValue("buttonWidth", ui->buttonWidthSB->value()); + mSettings.setValue("buttonHeight", ui->buttonHeightSB->value()); + mSettings.setValue("autoRotate", ui->autoRotateCB->isChecked()); + mSettings.setValue("closeOnMiddleClick", ui->middleClickCB->isChecked()); + mSettings.setValue("raiseOnCurrentDesktop", ui->raiseOnCurrentDesktopCB->isChecked()); + mSettings.setValue("groupingEnabled",ui->groupingGB->isChecked()); + mSettings.setValue("showGroupOnHover",ui->showGroupOnHoverCB->isChecked()); +} + +void LxQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + /* We have to disable signals for buttonWidthSB to prevent errors. Otherwise not all data + could be restored */ + ui->buttonWidthSB->blockSignals(true); + ui->buttonHeightSB->blockSignals(true); + oldSettings.loadToSettings(); + loadSettings(); + ui->buttonWidthSB->blockSignals(false); + ui->buttonHeightSB->blockSignals(false); + } + else + close(); +} diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.h b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.h new file mode 100644 index 0000000..4ee8de6 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Maciej Płaza + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKBARCONFIGURATION_H +#define LXQTTASKBARCONFIGURATION_H + +#include +#include + +#include + +namespace Ui { + class LxQtTaskbarConfiguration; +} + +class LxQtTaskbarConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtTaskbarConfiguration(QSettings &settings, QWidget *parent = 0); + ~LxQtTaskbarConfiguration(); + +private: + Ui::LxQtTaskbarConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache oldSettings; + + /* + Read settings from conf file and put data into controls. + */ + void loadSettings(); + +private slots: + void saveSettings(); + void dialogButtonsAction(QAbstractButton *btn); +}; + +#endif // LXQTTASKBARCONFIGURATION_H diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.ui b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.ui new file mode 100644 index 0000000..a18fce4 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbarconfiguration.ui @@ -0,0 +1,234 @@ + + + LxQtTaskbarConfiguration + + + + 0 + 0 + 401 + 484 + + + + Task Manager Settings + + + + + + General + + + + + + 0 + + + 0 + + + + + Show only windows from desktop + + + + + + + + + + + + Show only windows from &panel's screen + + + + + + + Show only minimized windows + + + + + + + Raise minimized windows on current desktop + + + + + + + Close on middle-click + + + + + + + + + + Window &grouping + + + true + + + + + + Show popup on mouse hover + + + + + + + + + + Appearance + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Button style + + + + + + + + + + Maximum button width + + + + + + + + 0 + 0 + + + + px + + + 1 + + + 500 + + + + + + + Maximum button height + + + + + + + + 0 + 0 + + + + px + + + 1 + + + 500 + + + + + + + Auto&rotate buttons when the panel is vertical + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + LxQtTaskbarConfiguration + accept() + + + 262 + 496 + + + 157 + 274 + + + + + buttons + rejected() + LxQtTaskbarConfiguration + reject() + + + 330 + 496 + + + 286 + 274 + + + + + diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.cpp b/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.cpp new file mode 100644 index 0000000..90e3d35 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.cpp @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqttaskbarplugin.h" + +LxQtTaskBarPlugin::LxQtTaskBarPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo) + +{ + mTaskBar = new LxQtTaskBar(this); + +} + + +LxQtTaskBarPlugin::~LxQtTaskBarPlugin() +{ + delete mTaskBar; +} + +QDialog *LxQtTaskBarPlugin::configureDialog() +{ + return new LxQtTaskbarConfiguration(*(settings())); +} + +void LxQtTaskBarPlugin::realign() +{ + mTaskBar->realign(); +} diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h b/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h new file mode 100644 index 0000000..4778175 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h @@ -0,0 +1,69 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTTASKBARPLUGIN_H +#define LXQTTASKBARPLUGIN_H + +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskbar.h" +#include +class LxQtTaskBar; + +class LxQtTaskBarPlugin : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtTaskBarPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtTaskBarPlugin(); + + QString themeId() const { return "TaskBar"; } + virtual Flags flags() const { return HaveConfigDialog | NeedsHandle; } + + QWidget *widget() { return mTaskBar; } + QDialog *configureDialog(); + + void settingsChanged() { mTaskBar->settingsChanged(); } + void realign(); + + bool isSeparate() const { return true; } + bool isExpandable() const { return true; } +private: + LxQtTaskBar *mTaskBar; +}; + +class LxQtTaskBarPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtTaskBarPlugin(startupInfo);} +}; + +#endif // LXQTTASKBARPLUGIN_H diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbutton.cpp b/lxqt-panel/plugin-taskbar/lxqttaskbutton.cpp new file mode 100644 index 0000000..be30600 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbutton.cpp @@ -0,0 +1,726 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +#include +// Necessary for closeApplication() +#include +#include + +bool LxQtTaskButton::sDraggging = false; + +/************************************************ + +************************************************/ +void LeftAlignedTextStyle::drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole) const +{ + return QProxyStyle::drawItemText(painter, rect, (flags & ~Qt::AlignHCenter) | Qt::AlignLeft, pal, enabled, text, textRole); +} + + +/************************************************ + +************************************************/ +LxQtTaskButton::LxQtTaskButton(const WId window, LxQtTaskBar * taskbar, QWidget *parent) : + QToolButton(parent), + mWindow(window), + mUrgencyHint(false), + mOrigin(Qt::TopLeftCorner), + mDrawPixmap(false), + mParentTaskBar(taskbar), + mDNDTimer(new QTimer(this)) +{ + Q_ASSERT(taskbar); + + setCheckable(true); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + setMinimumWidth(1); + setMinimumHeight(1); + setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + setAcceptDrops(true); + + updateText(); + updateIcon(); + + mDNDTimer->setSingleShot(true); + mDNDTimer->setInterval(700); + connect(mDNDTimer, SIGNAL(timeout()), this, SLOT(activateWithDraggable())); +} + +/************************************************ + +************************************************/ +LxQtTaskButton::~LxQtTaskButton() +{ +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::updateText() +{ + KWindowInfo info(mWindow, NET::WMVisibleName | NET::WMName); + QString title = info.visibleName().isEmpty() ? info.name() : info.visibleName(); + setText(title.replace("&", "&&")); + setToolTip(title); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::updateIcon() +{ + QIcon ico; + QPixmap pix = KWindowSystem::icon(mWindow); + ico.addPixmap(pix); + setIcon(!pix.isNull() ? ico : XdgIcon::defaultApplicationIcon()); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::refreshIconGeometry(QRect const & geom) +{ + NETWinInfo info(QX11Info::connection(), + windowId(), + (WId) QX11Info::appRootWindow(), + NET::WMIconGeometry, + 0); + NETRect const curr = info.iconGeometry(); + if (curr.pos.x != geom.x() || curr.pos.y != geom.y() + || curr.size.width != geom.width() || curr.size.height != geom.height()) + { + NETRect nrect; + nrect.pos.x = geom.x(); + nrect.pos.y = geom.y(); + nrect.size.height = geom.height(); + nrect.size.width = geom.width(); + info.setIconGeometry(nrect); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::dragEnterEvent(QDragEnterEvent *event) +{ + if (event->mimeData()->hasFormat(mimeDataFormat())) + { + event->ignore(); + return; + } + + mDNDTimer->start(); + + // It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called + // on the other hand drop and dragmove events of parent widget won't be called + event->accept(); + QToolButton::dragEnterEvent(event); +} + +void LxQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) +{ + mDNDTimer->stop(); + event->ignore(); + QToolButton::dragLeaveEvent(event); +} + +void LxQtTaskButton::dropEvent(QDropEvent *event) +{ + mDNDTimer->stop(); + event->ignore(); + QToolButton::dropEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::mousePressEvent(QMouseEvent* event) +{ + const Qt::MouseButton b = event->button(); + + if (Qt::LeftButton == b) + mDragStartPosition = event->pos(); + else if (Qt::MidButton == b && parentTaskBar()->closeOnMiddleClick()) + closeApplication(); + + QToolButton::mousePressEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::mouseReleaseEvent(QMouseEvent* event) +{ + if (event->button() == Qt::LeftButton) + { + if (isChecked()) + minimizeApplication(); + else + raiseApplication(); + } + QToolButton::mouseReleaseEvent(event); +} + +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskButton::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray ba; + QDataStream stream(&ba,QIODevice::WriteOnly); + stream << (qlonglong)(mWindow); + mimedata->setData(mimeDataFormat(), ba); + return mimedata; +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::mouseMoveEvent(QMouseEvent* event) +{ + if (!(event->buttons() & Qt::LeftButton)) + return; + + if ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance()) + return; + + QDrag *drag = new QDrag(this); + drag->setMimeData(mimeData()); + + //fixme when vertical panel, pixmap is empty + QPixmap pixmap = grab(); + drag->setPixmap(pixmap); + drag->setHotSpot(QPoint(mapTo(this, event->pos()))); + + sDraggging = true; + drag->exec(); + + // if button is dropped out of panel (e.g. on desktop) + // it is not deleted automatically by Qt + drag->deleteLater(); + sDraggging = false; + + QAbstractButton::mouseMoveEvent(event); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskButton::isApplicationHidden() const +{ + KWindowInfo info(mWindow, NET::WMState); + return (info.state() & NET::Hidden); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskButton::isApplicationActive() const +{ + return KWindowSystem::activeWindow() == mWindow; +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::activateWithDraggable() +{ + // raise app in any time when there is a drag + // in progress to allow drop it into an app + raiseApplication(); + KWindowSystem::forceActiveWindow(mWindow); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::raiseApplication() +{ + KWindowInfo info(mWindow, NET::WMDesktop | NET::WMState | NET::XAWMState); + if (parentTaskBar()->raiseOnCurrentDesktop() && info.isMinimized()) + { + KWindowSystem::setOnDesktop(mWindow, KWindowSystem::currentDesktop()); + } + else + { + int winDesktop = info.desktop(); + if (KWindowSystem::currentDesktop() != winDesktop) + KWindowSystem::setCurrentDesktop(winDesktop); + } + KWindowSystem::activateWindow(mWindow); + + setUrgencyHint(false); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::minimizeApplication() +{ + KWindowSystem::minimizeWindow(mWindow); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::maximizeApplication() +{ + QAction* act = qobject_cast(sender()); + if (!act) + return; + + int state = act->data().toInt(); + switch (state) + { + case NET::MaxHoriz: + KWindowSystem::setState(mWindow, NET::MaxHoriz); + break; + + case NET::MaxVert: + KWindowSystem::setState(mWindow, NET::MaxVert); + break; + + default: + KWindowSystem::setState(mWindow, NET::Max); + break; + } + + if (!isApplicationActive()) + raiseApplication(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::deMaximizeApplication() +{ + KWindowSystem::clearState(mWindow, NET::Max); + + if (!isApplicationActive()) + raiseApplication(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::shadeApplication() +{ + KWindowSystem::setState(mWindow, NET::Shaded); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::unShadeApplication() +{ + KWindowSystem::clearState(mWindow, NET::Shaded); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::closeApplication() +{ + // FIXME: Why there is no such thing in KWindowSystem?? + NETRootInfo(QX11Info::connection(), NET::CloseWindow).closeWindowRequest(mWindow); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::setApplicationLayer() +{ + QAction* act = qobject_cast(sender()); + if (!act) + return; + + int layer = act->data().toInt(); + switch(layer) + { + case NET::KeepAbove: + KWindowSystem::clearState(mWindow, NET::KeepBelow); + KWindowSystem::setState(mWindow, NET::KeepAbove); + break; + + case NET::KeepBelow: + KWindowSystem::clearState(mWindow, NET::KeepAbove); + KWindowSystem::setState(mWindow, NET::KeepBelow); + break; + + default: + KWindowSystem::clearState(mWindow, NET::KeepBelow); + KWindowSystem::clearState(mWindow, NET::KeepAbove); + break; + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::moveApplicationToDesktop() +{ + QAction* act = qobject_cast(sender()); + if (!act) + return; + + bool ok; + int desk = act->data().toInt(&ok); + + if (!ok) + return; + + KWindowSystem::setOnDesktop(mWindow, desk); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) +{ + if (event->modifiers().testFlag(Qt::ControlModifier)) + { + event->ignore(); + return; + } + + KWindowInfo info(mWindow, 0, NET::WM2AllowedActions); + unsigned long state = KWindowInfo(mWindow, NET::WMState).state(); + + QMenu * menu = new QMenu(tr("Application")); + menu->setAttribute(Qt::WA_DeleteOnClose); + QAction* a; + + /* KDE menu ******* + + + To &Desktop > + + &All Desktops + + --- + + &1 Desktop 1 + + &2 Desktop 2 + + &To Current Desktop + &Move + Re&size + + Mi&nimize + + Ma&ximize + + &Shade + Ad&vanced > + Keep &Above Others + Keep &Below Others + Fill screen + &Layer > + Always on &top + &Normal + Always on &bottom + --- + + &Close + */ + + /********** Desktop menu **********/ + int deskNum = KWindowSystem::numberOfDesktops(); + if (deskNum > 1) + { + int winDesk = KWindowInfo(mWindow, NET::WMDesktop).desktop(); + QMenu* deskMenu = menu->addMenu(tr("To &Desktop")); + + a = deskMenu->addAction(tr("&All Desktops")); + a->setData(NET::OnAllDesktops); + a->setEnabled(winDesk != NET::OnAllDesktops); + connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop())); + deskMenu->addSeparator(); + + for (int i = 0; i < deskNum; ++i) + { + a = deskMenu->addAction(tr("Desktop &%1").arg(i + 1)); + a->setData(i + 1); + a->setEnabled(i + 1 != winDesk); + connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop())); + } + + int curDesk = KWindowSystem::currentDesktop(); + a = menu->addAction(tr("&To Current Desktop")); + a->setData(curDesk); + a->setEnabled(curDesk != winDesk); + connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop())); + } + + /********** State menu **********/ + menu->addSeparator(); + + a = menu->addAction(tr("Ma&ximize")); + a->setEnabled(info.actionSupported(NET::ActionMax) && (!(state & NET::Max) || (state & NET::Hidden))); + a->setData(NET::Max); + connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); + + if (event->modifiers() & Qt::ShiftModifier) + { + a = menu->addAction(tr("Maximize vertically")); + a->setEnabled(info.actionSupported(NET::ActionMaxVert) && !((state & NET::MaxVert) || (state & NET::Hidden))); + a->setData(NET::MaxVert); + connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); + + a = menu->addAction(tr("Maximize horizontally")); + a->setEnabled(info.actionSupported(NET::ActionMaxHoriz) && !((state & NET::MaxHoriz) || (state & NET::Hidden))); + a->setData(NET::MaxHoriz); + connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); + } + + a = menu->addAction(tr("&Restore")); + a->setEnabled((state & NET::Hidden) || (state & NET::Max) || (state & NET::MaxHoriz) || (state & NET::MaxVert)); + connect(a, SIGNAL(triggered(bool)), this, SLOT(deMaximizeApplication())); + + a = menu->addAction(tr("Mi&nimize")); + a->setEnabled(info.actionSupported(NET::ActionMinimize) && !(state & NET::Hidden)); + connect(a, SIGNAL(triggered(bool)), this, SLOT(minimizeApplication())); + + if (state & NET::Shaded) + { + a = menu->addAction(tr("Roll down")); + a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); + connect(a, SIGNAL(triggered(bool)), this, SLOT(unShadeApplication())); + } + else + { + a = menu->addAction(tr("Roll up")); + a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); + connect(a, SIGNAL(triggered(bool)), this, SLOT(shadeApplication())); + } + + /********** Layer menu **********/ + menu->addSeparator(); + + QMenu* layerMenu = menu->addMenu(tr("&Layer")); + + a = layerMenu->addAction(tr("Always on &top")); + // FIXME: There is no info.actionSupported(NET::ActionKeepAbove) + a->setEnabled(!(state & NET::KeepAbove)); + a->setData(NET::KeepAbove); + connect(a, SIGNAL(triggered(bool)), this, SLOT(setApplicationLayer())); + + a = layerMenu->addAction(tr("&Normal")); + a->setEnabled((state & NET::KeepAbove) || (state & NET::KeepBelow)); + // FIXME: There is no NET::KeepNormal, so passing 0 + a->setData(0); + connect(a, SIGNAL(triggered(bool)), this, SLOT(setApplicationLayer())); + + a = layerMenu->addAction(tr("Always on &bottom")); + // FIXME: There is no info.actionSupported(NET::ActionKeepBelow) + a->setEnabled(!(state & NET::KeepBelow)); + a->setData(NET::KeepBelow); + connect(a, SIGNAL(triggered(bool)), this, SLOT(setApplicationLayer())); + + /********** Kill menu **********/ + menu->addSeparator(); + a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("&Close")); + connect(a, SIGNAL(triggered(bool)), this, SLOT(closeApplication())); + menu->setGeometry(mParentTaskBar->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::setUrgencyHint(bool set) +{ + if (mUrgencyHint == set) + return; + + if (!set) + KWindowSystem::demandAttention(mWindow, false); + + mUrgencyHint = set; + setProperty("urgent", set); + style()->unpolish(this); + style()->polish(this); + update(); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskButton::isOnDesktop(int desktop) const +{ + return KWindowInfo(mWindow, NET::WMDesktop).isOnDesktop(desktop); +} + +bool LxQtTaskButton::isOnCurrentScreen() const +{ + return QApplication::desktop()->screenGeometry(parentTaskBar()).intersects(KWindowInfo(mWindow, NET::WMFrameExtents).frameGeometry()); +} + +bool LxQtTaskButton::isMinimized() const +{ + return KWindowInfo(mWindow,NET::WMState | NET::XAWMState).isMinimized(); +} + +Qt::Corner LxQtTaskButton::origin() const +{ + return mOrigin; +} + +void LxQtTaskButton::setOrigin(Qt::Corner newOrigin) +{ + if (mOrigin != newOrigin) + { + mOrigin = newOrigin; + update(); + } +} + +void LxQtTaskButton::setAutoRotation(bool value, ILxQtPanel::Position position) +{ + if (value) + { + switch (position) + { + case ILxQtPanel::PositionTop: + case ILxQtPanel::PositionBottom: + setOrigin(Qt::TopLeftCorner); + break; + + case ILxQtPanel::PositionLeft: + setOrigin(Qt::BottomLeftCorner); + break; + + case ILxQtPanel::PositionRight: + setOrigin(Qt::TopRightCorner); + break; + } + } + else + setOrigin(Qt::TopLeftCorner); +} + +void LxQtTaskButton::paintEvent(QPaintEvent *event) +{ + if (mOrigin == Qt::TopLeftCorner) + { + QToolButton::paintEvent(event); + return; + } + + QSize sz = size(); + QSize adjSz = sz; + QTransform transform; + QPoint originPoint; + + switch (mOrigin) + { + case Qt::TopLeftCorner: + transform.rotate(0.0); + originPoint = QPoint(0.0, 0.0); + break; + + case Qt::TopRightCorner: + transform.rotate(90.0); + originPoint = QPoint(0.0, -sz.width()); + adjSz.transpose(); + break; + + case Qt::BottomRightCorner: + transform.rotate(180.0); + originPoint = QPoint(-sz.width(), -sz.height()); + break; + + case Qt::BottomLeftCorner: + transform.rotate(270.0); + originPoint = QPoint(-sz.height(), 0.0); + adjSz.transpose(); + break; + } + + bool drawPixmapNextTime = false; + + if (!mDrawPixmap) + { + mPixmap = QPixmap(adjSz); + mPixmap.fill(QColor(0, 0, 0, 0)); + + if (adjSz != sz) + resize(adjSz); // this causes paint event to be repeated - next time we'll paint the pixmap to the widget surface. + + // copied from QToolButton::paintEvent { + QStylePainter painter(&mPixmap, this); + QStyleOptionToolButton opt; + initStyleOption(&opt); + painter.drawComplexControl(QStyle::CC_ToolButton, opt); + // } + + if (adjSz != sz) + { + resize(sz); + drawPixmapNextTime = true; + } + else + mDrawPixmap = true; // transfer the pixmap to the widget now! + } + if (mDrawPixmap) + { + QPainter painter(this); + painter.setTransform(transform); + painter.drawPixmap(originPoint, mPixmap); + + drawPixmapNextTime = false; + } + + mDrawPixmap = drawPixmapNextTime; +} + +bool LxQtTaskButton::hasDragAndDropHover() const +{ + return mDNDTimer->isActive(); +} diff --git a/lxqt-panel/plugin-taskbar/lxqttaskbutton.h b/lxqt-panel/plugin-taskbar/lxqttaskbutton.h new file mode 100644 index 0000000..419212a --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskbutton.h @@ -0,0 +1,143 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTTASKBUTTON_H +#define LXQTTASKBUTTON_H + +#include +#include +#include "../panel/ilxqtpanel.h" + +class QPainter; +class QPalette; +class QMimeData; +class LxQtTaskGroup; +class LxQtTaskBar; + +class LeftAlignedTextStyle : public QProxyStyle +{ + using QProxyStyle::QProxyStyle; +public: + + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override; +}; + + +class LxQtTaskButton : public QToolButton +{ + Q_OBJECT + + Q_PROPERTY(Qt::Corner origin READ origin WRITE setOrigin) + +public: + explicit LxQtTaskButton(const WId window, LxQtTaskBar * taskBar, QWidget *parent = 0); + virtual ~LxQtTaskButton(); + + bool isApplicationHidden() const; + bool isApplicationActive() const; + WId windowId() const { return mWindow; } + + bool hasUrgencyHint() const { return mUrgencyHint; } + void setUrgencyHint(bool set); + + bool isOnDesktop(int desktop) const; + bool isOnCurrentScreen() const; + bool isMinimized() const; + void updateText(); + void updateIcon(); + + Qt::Corner origin() const; + virtual void setAutoRotation(bool value, ILxQtPanel::Position position); + + LxQtTaskGroup * parentGroup(void) const {return mParentGroup;} + void setParentGroup(LxQtTaskGroup * group) {mParentGroup = group;} + LxQtTaskBar * parentTaskBar() const {return mParentTaskBar;} + + void refreshIconGeometry(QRect const & geom); + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); } + /*! \return true if this buttom received DragEnter event (and no DragLeave event yet) + * */ + bool hasDragAndDropHover() const; + +public slots: + void raiseApplication(); + void minimizeApplication(); + void maximizeApplication(); + void deMaximizeApplication(); + void shadeApplication(); + void unShadeApplication(); + void closeApplication(); + void moveApplicationToDesktop(); + void setApplicationLayer(); + + void setOrigin(Qt::Corner); + +protected: + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dragLeaveEvent(QDragLeaveEvent *event); + virtual void dropEvent(QDropEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *event); + void paintEvent(QPaintEvent *); + + void setWindowId(WId wid) {mWindow = wid;} + virtual QMimeData * mimeData(); + static bool sDraggging; + +private: + WId mWindow; + bool mUrgencyHint; + QPoint mDragStartPosition; + Qt::Corner mOrigin; + QPixmap mPixmap; + bool mDrawPixmap; + LxQtTaskGroup * mParentGroup; + LxQtTaskBar * mParentTaskBar; + + // Timer for when draggind something into a button (the button's window + // must be activated so that the use can continue dragging to the window + QTimer * mDNDTimer; + +private slots: + void activateWithDraggable(); + +signals: + void dropped(QDropEvent * event); + void dragging(bool executing = false); +}; + +typedef QHash LxQtTaskButtonHash; + +#endif // LXQTTASKBUTTON_H diff --git a/lxqt-panel/plugin-taskbar/lxqttaskgroup.cpp b/lxqt-panel/plugin-taskbar/lxqttaskgroup.cpp new file mode 100644 index 0000000..9be7a5d --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskgroup.cpp @@ -0,0 +1,657 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/************************************************ + + ************************************************/ +LxQtTaskGroup::LxQtTaskGroup(const QString &groupName, QIcon icon, ILxQtPanelPlugin * plugin, LxQtTaskBar *parent) + : LxQtTaskButton(0, parent, parent), + mGroupName(groupName), + mPopup(new LxQtGroupPopup(this)), + mPlugin(plugin), + mPreventPopup(false) +{ + Q_ASSERT(parent); + + setObjectName(groupName); + setText(groupName); + setIcon(icon); + + connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool))); + connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(onDesktopChanged(int))); + connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(onWindowRemoved(WId))); + connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId))); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::contextMenuEvent(QContextMenuEvent *event) +{ + setPopupVisible(false, true); + mPreventPopup = true; + if (windowId()) + { + LxQtTaskButton::contextMenuEvent(event); + return; + } + + QMenu * menu = new QMenu(tr("Group")); + menu->setAttribute(Qt::WA_DeleteOnClose); + QAction *a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("Close group")); + connect(a, SIGNAL(triggered()), this, SLOT(closeGroup())); + connect(menu, &QMenu::aboutToHide, [this] { + mPreventPopup = false; + }); + menu->setGeometry(mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::closeGroup() +{ + foreach (LxQtTaskButton * button, mButtonHash.values()) + if (button->isOnDesktop(KWindowSystem::currentDesktop())) + button->closeApplication(); +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::addWindow(WId id) +{ + if (mButtonHash.contains(id)) + return mButtonHash.value(id); + + LxQtTaskButton *btn = new LxQtTaskButton(id, parentTaskBar(), mPopup); + btn->setToolButtonStyle(toolButtonStyle()); + + if (btn->isApplicationActive()) + { + btn->setChecked(true); + setChecked(true); + } + + btn->setParentGroup(this); + + mButtonHash.insert(id, btn); + mPopup->addButton(btn); + + connect(btn, SIGNAL(clicked()), this, SLOT(onChildButtonClicked())); + refreshVisibility(); + + return btn; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::checkedButton() const +{ + foreach (LxQtTaskButton* button, mButtonHash.values()) + if (button->isChecked()) + return button; + + return NULL; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::getNextPrevChildButton(bool next, bool circular) +{ + LxQtTaskButton *button = checkedButton(); + int idx = mPopup->indexOf(button); + int inc = next ? 1 : -1; + idx += inc; + + // if there is no cheked button, get the first one if next equals true + // or the last one if not + if (!button) + { + idx = -1; + if (next) + { + for (int i = 0; i < mPopup->count() && idx == -1; i++) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + else + { + for (int i = mPopup->count() - 1; i >= 0 && idx == -1; i--) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + } + + if (circular) + idx = (idx + mButtonHash.count()) % mButtonHash.count(); + else if (mPopup->count() <= idx || idx < 0) + return NULL; + + // return the next or the previous child + QLayoutItem *item = mPopup->itemAt(idx); + if (item) + { + button = qobject_cast(item->widget()); + if (button->isVisibleTo(mPopup)) + return button; + } + + return NULL; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onActiveWindowChanged(WId window) +{ + LxQtTaskButton *button = mButtonHash.value(window, nullptr); + foreach (LxQtTaskButton *btn, mButtonHash.values()) + btn->setChecked(false); + + if (button) + { + button->setChecked(true); + if (button->hasUrgencyHint()) + button->setUrgencyHint(false); + } + setChecked(nullptr != button); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onDesktopChanged(int number) +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onWindowRemoved(WId window) +{ + if (mButtonHash.contains(window)) + { + LxQtTaskButton *button = mButtonHash.value(window); + mButtonHash.remove(window); + mPopup->removeWidget(button); + button->deleteLater(); + + if (mButtonHash.count()) + regroup(); + else + { + if (isVisible()) + emit visibilityChanged(false); + hide(); + emit groupBecomeEmpty(groupName()); + + } + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onChildButtonClicked() +{ + setPopupVisible(false, true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setToolButtonsStyle(Qt::ToolButtonStyle style) +{ + setToolButtonStyle(style); + for (auto & button : mButtonHash) + { + button->setToolButtonStyle(style); + } +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::buttonsCount() const +{ + return mButtonHash.count(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::visibleButtonsCount() const +{ + int i = 0; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + if (btn->isVisibleTo(mPopup)) + i++; + return i; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::draggingTimerTimeout() +{ + if (windowId()) + setPopupVisible(false); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onClicked(bool) +{ + if (visibleButtonsCount() > 1) + { + setChecked(mButtonHash.contains(KWindowSystem::activeWindow())); + setPopupVisible(true); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::regroup() +{ + int cont = visibleButtonsCount(); + recalculateFrameIfVisible(); + + if (cont == 1) + { + // Get first visible button + LxQtTaskButton * button = NULL; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + { + if (btn->isVisibleTo(mPopup)) + { + button = btn; + break; + } + } + + if (button) + { + setText(button->text()); + setToolTip(button->toolTip()); + setWindowId(button->windowId()); + } + } + else if (cont == 0) + hide(); + else + { + QString t = QString("%1 - %2 windows").arg(mGroupName).arg(cont); + setText(t); + setToolTip(parentTaskBar()->isShowGroupOnHover() ? QStringLiteral() : t); + setWindowId(0); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::showOnlySettingChanged() +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::recalculateFrameIfVisible() +{ + if (mPopup->isVisible()) + { + recalculateFrameSize(); + if (mPlugin->panel()->position() == ILxQtPanel::PositionBottom) + recalculateFramePosition(); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setAutoRotation(bool value, ILxQtPanel::Position position) +{ + foreach (LxQtTaskButton *button, mButtonHash.values()) + button->setAutoRotation(false, position); + + LxQtTaskButton::setAutoRotation(value, position); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshVisibility() +{ + bool will = false; + LxQtTaskBar const * taskbar = parentTaskBar(); + const int showDesktop = taskbar->showDesktopNum(); + foreach(LxQtTaskButton * btn, mButtonHash.values()) + { + bool visible = taskbar->isShowOnlyOneDesktopTasks() ? btn->isOnDesktop(0 == showDesktop ? KWindowSystem::currentDesktop() : showDesktop) : true; + visible &= taskbar->isShowOnlyCurrentScreenTasks() ? btn->isOnCurrentScreen() : true; + visible &= taskbar->isShowOnlyMinimizedTasks() ? btn->isMinimized() : true; + btn->setVisible(visible); + will |= visible; + } + + bool is = isVisible(); + setVisible(will); + regroup(); + + if (is != will) + emit visibilityChanged(will); +} + +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskGroup::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray byteArray; + QDataStream stream(&byteArray, QIODevice::WriteOnly); + stream << groupName(); + mimedata->setData(mimeDataFormat(), byteArray); + return mimedata; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setPopupVisible(bool visible, bool fast) +{ + if (visible && !mPreventPopup && 0 == windowId()) + { + if (!mPopup->isVisible()) + { + // setup geometry + recalculateFrameSize(); + recalculateFramePosition(); + } + + mPopup->show(); + emit popupShown(this); + } + else + mPopup->hide(fast); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshIconsGeometry() +{ + QRect rect = geometry(); + rect.moveTo(mapToGlobal(QPoint(0, 0))); + + if (windowId()) + { + refreshIconGeometry(rect); + return; + } + + foreach(LxQtTaskButton *but, mButtonHash.values()) + { + but->refreshIconGeometry(rect); + but->setIconSize(QSize(mPlugin->panel()->iconSize(), mPlugin->panel()->iconSize())); + } +} + +/************************************************ + + ************************************************/ +QSize LxQtTaskGroup::recalculateFrameSize() +{ + int height = recalculateFrameHeight(); + mPopup->setMaximumHeight(1000); + mPopup->setMinimumHeight(0); + + int hh = recalculateFrameWidth(); + mPopup->setMaximumWidth(hh); + mPopup->setMinimumWidth(0); + + QSize newSize(hh, height); + mPopup->resize(newSize); + + return newSize; +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameHeight() const +{ + int cont = visibleButtonsCount(); + int h = !mPlugin->panel()->isHorizontal() && parentTaskBar()->isAutoRotate() ? width() : height(); + return cont * h + (cont + 1) * mPopup->spacing(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameWidth() const +{ + // FIXME: 300? + int minimum = 300; + int hh = width(); + + if (!mPlugin->panel()->isHorizontal() && !parentTaskBar()->isAutoRotate()) + hh = height(); + + if (hh < minimum) + hh = minimum; + + return hh; +} + +/************************************************ + + ************************************************/ +QPoint LxQtTaskGroup::recalculateFramePosition() +{ + // Set position + int x_offset = 0, y_offset = 0; + switch (mPlugin->panel()->position()) + { + case ILxQtPanel::PositionTop: + y_offset += height(); + break; + case ILxQtPanel::PositionBottom: + y_offset = -recalculateFrameHeight(); + break; + case ILxQtPanel::PositionLeft: + x_offset += width(); + break; + case ILxQtPanel::PositionRight: + x_offset = -recalculateFrameWidth(); + break; + } + + QPoint pos = mapToGlobal(QPoint(x_offset, y_offset)); + mPopup->move(pos); + + return pos; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::leaveEvent(QEvent *event) +{ + setPopupVisible(false); + QToolButton::leaveEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::enterEvent(QEvent *event) +{ + QToolButton::enterEvent(event); + + if (sDraggging) + return; + + if (parentTaskBar()->isShowGroupOnHover()) + setPopupVisible(true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragEnterEvent(QDragEnterEvent *event) +{ + sDraggging = true; + // only show the popup if we aren't dragging a taskgroup + if (!event->mimeData()->hasFormat(mimeDataFormat())) + { + setPopupVisible(true); + LxQtTaskButton::dragEnterEvent(event); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragLeaveEvent(QDragLeaveEvent *event) +{ + // if draggind something into the taskgroup or the taskgroups' popup, + // do not close the popup + if (!sDraggging) + setPopupVisible(false); + else + sDraggging = false; + LxQtTaskButton::dragLeaveEvent(event); +} + +void LxQtTaskGroup::mouseMoveEvent(QMouseEvent* event) +{ + // if dragging the taskgroup, do not show the popup + setPopupVisible(false, true); + LxQtTaskButton::mouseMoveEvent(event); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + bool consumed{false}; + bool needsRefreshVisibility{false}; + QVector buttons; + if (mButtonHash.contains(window)) + buttons.append(mButtonHash.value(window)); + + // If group contains only one window properties must be changed also on button group + if (window == windowId()) + buttons.append(this); + + foreach (LxQtTaskButton * button, buttons) + { + consumed = true; + // if class is changed the window won't belong to our group any more + if (parentTaskBar()->isGroupingEnabled() && prop2.testFlag(NET::WM2WindowClass) && this != button) + { + KWindowInfo info(window, 0, NET::WM2WindowClass); + if (info.windowClassClass() != mGroupName) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + } + // window changed virtual desktop + if (prop.testFlag(NET::WMDesktop) || prop.testFlag(NET::WMGeometry)) + { + if (parentTaskBar()->isShowOnlyOneDesktopTasks() + || parentTaskBar()->isShowOnlyCurrentScreenTasks()) + { + needsRefreshVisibility = true; + } + } + + if (prop.testFlag(NET::WMVisibleName) || prop.testFlag(NET::WMName)) + button->updateText(); + + // XXX: we are setting window icon geometry -> don't need to handle NET::WMIconGeometry + if (prop.testFlag(NET::WMIcon)) + button->updateIcon(); + + if (prop.testFlag(NET::WMState)) + { + KWindowInfo info{window, NET::WMState}; + if (info.hasState(NET::SkipTaskbar) && this != button) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + button->setUrgencyHint(info.hasState(NET::DemandsAttention)); + + if (parentTaskBar()->isShowOnlyMinimizedTasks()) + { + needsRefreshVisibility = true; + } + } + } + + if (needsRefreshVisibility) + refreshVisibility(); + + return consumed; +} diff --git a/lxqt-panel/plugin-taskbar/lxqttaskgroup.h b/lxqt-panel/plugin-taskbar/lxqttaskgroup.h new file mode 100644 index 0000000..040bd1a --- /dev/null +++ b/lxqt-panel/plugin-taskbar/lxqttaskgroup.h @@ -0,0 +1,121 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKGROUP_H +#define LXQTTASKGROUP_H + +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskbar.h" +#include "lxqtgrouppopup.h" +#include "lxqttaskbutton.h" +#include + +class QVBoxLayout; +class ILxQtPanelPlugin; + +class LxQtGroupPopup; +class LxQtMasterPopup; + +class LxQtTaskGroup: public LxQtTaskButton +{ + Q_OBJECT + +public: + LxQtTaskGroup(const QString & groupName, QIcon icon ,ILxQtPanelPlugin * plugin, LxQtTaskBar * parent); + + QString groupName() const { return mGroupName; } + + void removeButton(WId window); + int buttonsCount() const; + int visibleButtonsCount() const; + + LxQtTaskButton * addWindow(WId id); + LxQtTaskButton * checkedButton() const; + + // Returns the next or the previous button in the popup + // if circular is true, then it will go around the list of buttons + LxQtTaskButton * getNextPrevChildButton(bool next, bool circular); + + bool onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + void refreshIconsGeometry(); + void showOnlySettingChanged(); + void setAutoRotation(bool value, ILxQtPanel::Position position); + void setToolButtonsStyle(Qt::ToolButtonStyle style); + + void setPopupVisible(bool visible = true, bool fast = false); + + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskgroup"); } + +protected: + QMimeData * mimeData(); + + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent * event); + void contextMenuEvent(QContextMenuEvent * event); + void mouseMoveEvent(QMouseEvent * event); + int recalculateFrameHeight() const; + int recalculateFrameWidth() const; + + void draggingTimerTimeout(); + +private slots: + void onClicked(bool checked); + void onChildButtonClicked(); + void onActiveWindowChanged(WId window); + void onWindowRemoved(WId window); + void onDesktopChanged(int number); + + void closeGroup(); + +signals: + void groupBecomeEmpty(QString name); + void visibilityChanged(bool visible); + void popupShown(LxQtTaskGroup* sender); + void windowDisowned(WId window); + +private: + QString mGroupName; + LxQtGroupPopup * mPopup; + LxQtTaskButtonHash mButtonHash; + ILxQtPanelPlugin * mPlugin; + bool mPreventPopup; + + QSize recalculateFrameSize(); + QPoint recalculateFramePosition(); + void recalculateFrameIfVisible(); + void refreshVisibility(); + void regroup(); +}; + +#endif // LXQTTASKGROUP_H diff --git a/lxqt-panel/plugin-taskbar/resources/taskbar.desktop.in b/lxqt-panel/plugin-taskbar/resources/taskbar.desktop.in new file mode 100644 index 0000000..48840b0 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/resources/taskbar.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications +Icon=window-duplicate + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar.ts b/lxqt-panel/plugin-taskbar/translations/taskbar.ts new file mode 100644 index 0000000..62d8e35 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar.ts @@ -0,0 +1,199 @@ + + + + + LxQtTaskButton + + + Application + + + + + To &Desktop + + + + + &All Desktops + + + + + Desktop &%1 + + + + + &To Current Desktop + + + + + Ma&ximize + + + + + Maximize vertically + + + + + Maximize horizontally + + + + + &Restore + + + + + Mi&nimize + + + + + Roll down + + + + + Roll up + + + + + &Layer + + + + + Always on &top + + + + + &Normal + + + + + Always on &bottom + + + + + &Close + + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + + + + + General + + + + + Show only windows from c&urrent desktop + + + + + Show only windows from &panel's screen + + + + + Show only minimized windows + + + + + Raise minimized windows on current desktop + + + + + Close on middle-click + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Button style + + + + + Maximum button width + + + + + + px + + + + + Maximum button height + + + + + Auto&rotate buttons when the panel is vertical + + + + + Icon and text + + + + + Only icon + + + + + Only text + + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ar.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ar.desktop new file mode 100644 index 0000000..bcf2a28 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=التبديل بين التطبيقات الجارية +Name[ar]=مدير المهامّ diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ar.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ar.ts new file mode 100644 index 0000000..1cde641 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ar.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + التطبيق + + + + To &Desktop + إلى س&طح المكتب + + + + &All Desktops + كا&فَّة أسطح المكتب + + + + Desktop &%1 + سطح المكتب &%1 + + + + &To Current Desktop + إلى سطح المكتب ال&حالي + + + + Ma&ximize + ت&كبير + + + + Maximize vertically + تكبيرٌ عموديٌّ + + + + Maximize horizontally + تكبيرٌ أفقيٌّ + + + + &Restore + استر&جاع + + + + Mi&nimize + ت&صغير + + + + Roll down + لفٌّ نحو اﻷسفل + + + + Roll up + لفٌّ نحو اﻷعلى + + + + &Layer + طب&قة + + + + Always on &top + دوماً في اﻷ&على + + + + &Normal + عا&دي + + + + Always on &bottom + دوماً في اﻷس&فل + + + + &Close + إ&غلاق + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + إعدادات مدير مهام ريزر + + + Window List Content + محتوى قائمة النَّوافذ + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + إظهار نوافذ سطح المكتب الحاليّ + + + Show windows from all desktops + إظهار نوافذ كافَّة اﻷسطح المكتبيَّة + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + مظهر قائمة النَّوافذ + + + + Button style + شكل الزُّرّ + + + Max button width + عرض زرِّ التكبير + + + + Close on middle-click + إغلاق عند الضغط على زرّ الفأرة اﻷوسط + + + + Icon and text + أيقونةٌ ونصٌّ + + + + Only icon + أيقونةٌ فقط + + + + Only text + نصٌّ فقط + + + diff --git a/plugin-taskbar/translations/taskbar_de_DE.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_cs.desktop similarity index 67% rename from plugin-taskbar/translations/taskbar_de_DE.desktop rename to lxqt-panel/plugin-taskbar/translations/taskbar_cs.desktop index 02c6590..4ad2449 100644 --- a/plugin-taskbar/translations/taskbar_de_DE.desktop +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_cs.desktop @@ -8,5 +8,5 @@ Comment=Switch between running applications # Translations -Comment[de_DE]=Zwischen laufenden Applikationen umschalten -Name[de_DE]=Task Manager +Comment[cs]=Přepínání mezi běžícími programy +Name[cs]=Správce úkolů diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_cs.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_cs.ts new file mode 100644 index 0000000..6605eb1 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_cs.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Program + + + + To &Desktop + Na &plochu + + + + &All Desktops + &Všechny plochy + + + + Desktop &%1 + Plocha &%1 + + + + &To Current Desktop + &Na nynější plochu + + + + Ma&ximize + Zvě&tšit + + + + Maximize vertically + Zvětšit svisle + + + + Maximize horizontally + Zvětšit vodorovně + + + + &Restore + &Obnovit + + + + Mi&nimize + &Zmenšit + + + + Roll down + Sbalit + + + + Roll up + Rozbalit + + + + &Layer + &Vrstva + + + + Always on &top + Vždy &nahoře + + + + &Normal + &Obvyklé + + + + Always on &bottom + Vždy &dole + + + + &Close + &Zavřít + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Nastavení správce úkolů + + + Window List Content + Obsah seznamu oken + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Vzhled seznamu oken + + + + Button style + Styl tlačítek + + + Max button width + Největší šířka tlačítka + + + + Close on middle-click + Zavřít klepnutím prostředním tlačítkem + + + + Icon and text + Ikona a text + + + + Only icon + Pouze ikona + + + + Only text + Pouze text + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.desktop new file mode 100644 index 0000000..bde7a03 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Přepínat mezi běžícími programy +Name[cs_CZ]=Správce úkolů diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.ts new file mode 100644 index 0000000..c80ae3b --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_cs_CZ.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Program + + + + To &Desktop + Na &plochu + + + + &All Desktops + &Všechny plochy + + + + Desktop &%1 + Plocha &%1 + + + + &To Current Desktop + &Na nynější plochu + + + + Ma&ximize + Zvě&tšit + + + + Maximize vertically + Zvětšit svisle + + + + Maximize horizontally + Zvětšit vodorovně + + + + &Restore + &Obnovit + + + + Mi&nimize + &Zmenšit + + + + Roll down + Sbalit + + + + Roll up + Rozbalit + + + + &Layer + &Vrstva + + + + Always on &top + Vždy &nahoře + + + + &Normal + &Obvyklé + + + + Always on &bottom + Vždy &dole + + + + &Close + &Zavřít + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Nastavení správce úkolů + + + Window List Content + Obsah seznamu oken + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Vzhled seznamu oken + + + + Button style + Styl tlačítek + + + Max button width + Největší šířka tlačítka + + + + Close on middle-click + Zavřít klepnutím prostředním tlačítkem + + + + Icon and text + Ikona a text + + + + Only icon + Pouze ikona + + + + Only text + Pouze text + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_da.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_da.desktop new file mode 100644 index 0000000..c3d5310 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_da.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da]=Skifter imellem kørende programmer +Name[da]=Programadministrator diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_da.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_da.ts new file mode 100644 index 0000000..c805b8d --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_da.ts @@ -0,0 +1,211 @@ + + + + + LxQtTaskButton + + + Application + Program + + + + To &Desktop + Til skrivebor&d + + + + &All Desktops + &Alle skriveborde + + + + Desktop &%1 + Skrivebord &%1 + + + + &To Current Desktop + &Til aktuelt skrivebord + + + + Ma&ximize + Ma&ksimer + + + + Maximize vertically + Maksimer vertikalt + + + + Maximize horizontally + Maksimer horisontalt + + + + &Restore + &Gendan + + + + Mi&nimize + Mi&nimer + + + + Roll down + Rul ned + + + + Roll up + Rul op + + + + &Layer + &Lag + + + + Always on &top + Al&tid øverst + + + + &Normal + &Normal + + + + Always on &bottom + Altid &nederst + + + + &Close + &Luk + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LXQt Opgavehåndtering Indstillinger + + + Window List Content + Indhold af vinduesliste + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra aktuelle skrivebord + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + wlcB + wlcB + + + Show windows from all desktops + Vis vinduer fra alle skriveborde + + + Window List Appearance + Udseende af Vinduesliste + + + + Button style + Knapstil + + + Max button width + Maks knapbredde + + + + Icon and text + Ikon og tekst + + + + Only icon + Kun ikon + + + + Only text + Kun tekst + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.desktop new file mode 100644 index 0000000..fc3d830 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Skift imellem kørende programmer +Name[da_DK]=Jobliste diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.ts new file mode 100644 index 0000000..adc69ba --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_da_DK.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Program + + + + To &Desktop + Til &Skrivebord + + + + &All Desktops + A&lle Skriveborde + + + + Desktop &%1 + Skrivebord &%1 + + + + &To Current Desktop + Til Nuværende Skrivebor&d + + + + Ma&ximize + Ma&ksimer + + + + Maximize vertically + Maksimer vertikalt + + + + Maximize horizontally + Maksimer horisontalt + + + + &Restore + &Gendan + + + + Mi&nimize + Mi&nimer + + + + Roll down + Rul ned + + + + Roll up + Rul op + + + + &Layer + &Lag + + + + Always on &top + Altid &Ovenpå + + + + &Normal + &Normal + + + + Always on &bottom + Altid Ned&erst + + + + &Close + &Afslut + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt Jobliste Indstillinger + + + Window List Content + Indhold Af Vinduesliste + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra nuværende skrivebord + + + Show windows from all desktops + Vis vinduer fra alle skriveborde + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Udseende af vinduesliste + + + + Button style + Knap stil + + + Max button width + Maks. knapbredde + + + + Close on middle-click + Luk ved midterklik + + + + Icon and text + Ikon og tekst + + + + Only icon + Kun ikoner + + + + Only text + Kun tekst + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_de.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_de.desktop new file mode 100644 index 0000000..f57f1a2 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Anwendungsverwalter +Comment[de]=Wechsel zwischen laufenden Anwendungen diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_de.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_de.ts new file mode 100644 index 0000000..834a0de --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_de.ts @@ -0,0 +1,204 @@ + + + + + LxQtTaskButton + + + Application + Anwendung + + + + To &Desktop + Zur Arb&eitsfläche + + + + &All Desktops + &Alle Arbeitsflächen + + + + Desktop &%1 + Arbeitsfläche &%1 + + + + &To Current Desktop + Zur ak&tuellen Arbeitsfläche + + + + Ma&ximize + Ma&ximieren + + + + Maximize vertically + Vertikal maximieren + + + + Maximize horizontally + Horizontal maximieren + + + + &Restore + &Wiederherstellen + + + + Mi&nimize + Mi&nimieren + + + + Roll down + Herunterrollen + + + + Roll up + Hochrollen + + + + &Layer + &Ebene + + + + Always on &top + Immer &oben + + + + &Normal + &Normal + + + + Always on &bottom + Immer &unten + + + + &Close + &Schließen + + + + LxQtTaskGroup + + + Group + Gruppe + + + + Close group + Gruppe schließen + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + Anwendungsverwalter - Einstellungen + + + + General + Allgemein + + + + Show only windows from desktop + Nur Fenster der Arbeitsfläche anzeigen + + + + Show only windows from &panel's screen + Nur Fenster aus der &Taskleiste anzeigen + + + + Show only minimized windows + Nur minimierte Fenster anzeigen + + + + Raise minimized windows on current desktop + Minimierte Fenster auf aktuelle Arbeitsfläche heben + + + + Close on middle-click + Fenster bei Mittelklick schließen + + + + Window &grouping + Fensteranordnun&g + + + + Show popup on mouse hover + Popup beim Überfahren mit dem Mauszeiger + + + + Appearance + Erscheinungsbild + + + + Button style + Schaltflächenstil + + + + Maximum button width + Max. Schaltflächenbreite + + + + + px + px + + + + Maximum button height + Max. Schaltflächenhöhe + + + + Auto&rotate buttons when the panel is vertical + Schaltflächen automatisch d&rehen bei vertikaler Leiste + + + + Icon and text + Symbol und Text + + + + Only icon + Nur Symbol + + + + Only text + Nur Text + + + + Current + Aktuell + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.desktop new file mode 100644 index 0000000..ae9fb20 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Εναλλαγή μεταξύ εκτελούμενων εφαρμογών +Name[el_GR]=Διαχειριστής εργασιών diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.ts new file mode 100644 index 0000000..c7b06a1 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_el_GR.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Εφαρμογή + + + + To &Desktop + Στην επι&φάνεια εργασίας + + + + &All Desktops + Ό&λες οι επιφάνειες εργασίας + + + + Desktop &%1 + Επιφάνεια εργασίας &%1 + + + + &To Current Desktop + Στ&ην τρέχουσα επιφάνεια εργασίας + + + + Ma&ximize + &Μεγιστοποίηση + + + + Maximize vertically + Μεγιστοποίηση κάθετα + + + + Maximize horizontally + Μεγιστοποίηση οριζόντια + + + + &Restore + &Επαναφορά + + + + Mi&nimize + Ελα&χιστοποίηση + + + + Roll down + Κύλιση κάτω + + + + Roll up + Κύλιση επάνω + + + + &Layer + Στ&ρώμα + + + + Always on &top + Πάντα ε&πάνω + + + + &Normal + Κα&νονικό + + + + Always on &bottom + Πάντα &κάτω + + + + &Close + Κλεί&σιμο + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Ρυθμίσεις διαχειριστή εργασιών LxQt + + + Window List Content + Περιεχόμενο λίστας παραθύρου + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Εμφάνιση παραθύρων από την τρέχουσα επιφάνεια εργασίας + + + Show windows from all desktops + Εμφάνιση παραθύρων από όλες τις επιφάνειες εργασίας + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Εμφάνιση λίστας παραθύρων + + + + Button style + Στυλ πλήκτρου + + + Max button width + Μέγιστο πλάτος πλήκτρου + + + + Close on middle-click + Κλείσιμο με μεσαίο κλικ + + + + Icon and text + Εικόνα και κείμενο + + + + Only icon + Μόνο εικόνα + + + + Only text + Μόνο κείμενο + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_eo.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_eo.desktop new file mode 100644 index 0000000..3e6685b --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Ŝalti inter rulantaj aplikaĵoj +Name[eo]=Taskmastrumilo diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_eo.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_eo.ts new file mode 100644 index 0000000..61663db --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_eo.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplikaĵo + + + + To &Desktop + &Al labortablo + + + + &All Desktops + Ĉiuj l&abortabloj + + + + Desktop &%1 + Labortablo &%1 + + + + &To Current Desktop + Al ak&tuala labortablo + + + + Ma&ximize + Ma&ksimumigi + + + + Maximize vertically + Vertikale maksimumigi + + + + Maximize horizontally + Horizontale maksimumigi + + + + &Restore + &Restaŭri + + + + Mi&nimize + &Malmaksimumigi + + + + Roll down + Malsupren rulumi + + + + Roll up + Supren rulumi + + + + &Layer + Tavo&lo + + + + Always on &top + Ĉiam &supre + + + + &Normal + &Normale + + + + Always on &bottom + Ĉiam &malsupre + + + + &Close + &Fermi + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Agordoj de taskmastrumilo de LxQto + + + Window List Content + Enhavo de listo de fenestroj + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montri fenestrojn el aktuala labortablo + + + Show windows from all desktops + Montri fenestrojn el ĉiuj labortabloj + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Apero de listo de fenestroj + + + + Button style + Stilo de butonoj + + + Max button width + Maksimuma grando de butonoj + + + + Close on middle-click + + + + + Icon and text + Piktogramo kaj teksto + + + + Only icon + Nur piktogramoj + + + + Only text + Nur teksto + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_es.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_es.desktop new file mode 100644 index 0000000..f9db5a4 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Cambia entre aplicaciones activas +Name[es]=Administrador de tareas diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_es.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_es.ts new file mode 100644 index 0000000..8789602 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_es.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplicación + + + + To &Desktop + Al &escritorio + + + + &All Desktops + &Todos los escritorios + + + + Desktop &%1 + Escritorio &%1 + + + + &To Current Desktop + &Al escritorio actual + + + + Ma&ximize + Ma&ximizar + + + + Maximize vertically + Maximizar verticalmente + + + + Maximize horizontally + Maximizar horizontalmente + + + + &Restore + &Restauar + + + + Mi&nimize + Mi&nimizar + + + + Roll down + Desplegar + + + + Roll up + Enrollar + + + + &Layer + &Capa + + + + Always on &top + Siempre &encima + + + + &Normal + &Normal + + + + Always on &bottom + Siempre al &fondo + + + + &Close + &Cerrar + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Opciones del administrador de tareas de LxQt + + + Window List Content + Contenido del listado de ventanas + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio actual + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Apariencia de la lista de ventanas + + + + Button style + Estilo del botón + + + Max button width + Ancho máximo del botón + + + + Close on middle-click + Cerrar con el boton central + + + + Icon and text + Icono y texto + + + + Only icon + Solo icono + + + + Only text + Solo texto + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.desktop new file mode 100644 index 0000000..2c3841d --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Cambia entre aplicaciones o programas abiertos +Name[es_VE]=Manejador de ventanas diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.ts new file mode 100644 index 0000000..d1d9baa --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_es_VE.ts @@ -0,0 +1,208 @@ + + + + + LxQtTaskButton + + + Application + Aplicación + + + + To &Desktop + Al &Escritorio + + + + &All Desktops + &Todos los escritorios + + + + Desktop &%1 + Escritorio &%1 + + + + &To Current Desktop + &Al escritorio actual + + + + Ma&ximize + Ma&ximizar + + + + Maximize vertically + Maximizar verticalmente + + + + Maximize horizontally + Maximizar Orizzontalmente + + + + &Restore + &Restaurar + + + + Mi&nimize + Mi&nimizar + + + + Roll down + DesEnrolar + + + + Roll up + Enrolar + + + + &Layer + Ca&pa + + + + Always on &top + Siempre &encima + + + + &Normal + &Normal + + + + Always on &bottom + Siempre por de&bajo + + + + &Close + &Cerrar + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Configuaracion de lista de tareas LxQt + + + Window List Content + Lista de ventanas + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio activo + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Apariencia de la lista de ventanas + + + + Button style + Estilo de boton + + + Max button width + Ancho maximo + + + + Close on middle-click + Cerrar en click medio + + + + Icon and text + Icono y texto + + + + Only icon + Solo iconos + + + + Only text + +Solo texto + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_eu.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_eu.desktop new file mode 100644 index 0000000..b585e0b --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Aldatu martxan dauden aplikazioen artean +Name[eu]=Ataza-kudeatzailea diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_eu.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_eu.ts new file mode 100644 index 0000000..dee7fdc --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_eu.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplikazioa + + + + To &Desktop + &Mahaigainera + + + + &All Desktops + Mahaigain &guztiak + + + + Desktop &%1 + &%1 mahaigaina + + + + &To Current Desktop + &Uneko mahaigainera + + + + Ma&ximize + Maximizatu + + + + Maximize vertically + Maximizatu bertikalki + + + + Maximize horizontally + Maximizatu horizontalki + + + + &Restore + &Leheneratu + + + + Mi&nimize + Minimizatu + + + + Roll down + Zabaldu + + + + Roll up + Bildu + + + + &Layer + &Geruza + + + + Always on &top + Beti &goian + + + + &Normal + &Normala + + + + Always on &bottom + Beti &behean + + + + &Close + &Itxi + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt ataza-kudeatzailearen ezarpenak + + + Window List Content + Leiho-zerrendaren edukia + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Erakutsi uneko mahaigaineko leihoak + + + Show windows from all desktops + Erakutsi mahaigain guztietako leihoak + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Leiho-zerrendaren itxura + + + + Button style + Botoi-estiloa + + + Max button width + Botoien zabalera maximoa + + + + Close on middle-click + Itxi erdiko botoia klikatzean + + + + Icon and text + Ikonoa eta testua + + + + Only icon + Ikonoa soilik + + + + Only text + Testua soilik + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_fi.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_fi.desktop new file mode 100644 index 0000000..6485070 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Vaihda käynnissä olevien sovellusten välillä +Name[fi]=Tehtävähallinta diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_fi.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_fi.ts new file mode 100644 index 0000000..3a74d08 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_fi.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Sovellus + + + + To &Desktop + Työ&pöydälle + + + + &All Desktops + &Kaikille työpöydille + + + + Desktop &%1 + Työpöytä &%1 + + + + &To Current Desktop + &Nykyiselle työpöydälle + + + + Ma&ximize + Suu&renna + + + + Maximize vertically + Suurenna pystysuunnassa + + + + Maximize horizontally + Suurenna vaakasuunnassa + + + + &Restore + &Palauta + + + + Mi&nimize + Pie&nennä + + + + Roll down + Rullaa alas + + + + Roll up + Rullaa ylös + + + + &Layer + Tas&o + + + + Always on &top + Aina &ylimpänä + + + + &Normal + &Tavallinen + + + + Always on &bottom + Aina &alimpana + + + + &Close + &Sulje + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt:n tehtävienhallinnan asetukset + + + Window List Content + Ikkunaluettelon sisältö + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Näytä ikkunat nykyiseltä työpöydältä + + + Show windows from all desktops + Näytä ikkunat kaikilta työpöydiltä + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Ikkunaluettelon ulkoasu + + + + Button style + Painiketyyli + + + Max button width + Painikkeen enimmäisleveys + + + + Close on middle-click + Sulje hiiren keskimmäisen painikkeen painalluksella + + + + Icon and text + Kuvake ja teksti + + + + Only icon + Pelkkä kuvake + + + + Only text + Pelkkä teksti + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.desktop new file mode 100644 index 0000000..528a962 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Basculer entre des applications actives +Name[fr_FR]=Gestionnaire des tâches diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.ts new file mode 100644 index 0000000..dec8095 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_fr_FR.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Application + + + + To &Desktop + Vers &le bureau + + + + &All Desktops + &Tous les bureaux + + + + Desktop &%1 + Bureau &%1 + + + + &To Current Desktop + &Vers le bureau courant + + + + Ma&ximize + Maximiser + + + + Maximize vertically + Maximiser verticalement + + + + Maximize horizontally + Maximiser horizontalement + + + + &Restore + &Restaurer + + + + Mi&nimize + Mi&nimiser + + + + Roll down + Enrouler vers le bas + + + + Roll up + Enrouler vers le haut + + + + &Layer + &Calque + + + + Always on &top + Toujours au &dessus + + + + &Normal + &Normal + + + + Always on &bottom + Toujours en &bas + + + + &Close + &Fermer + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Paramètres du gestionnaire des tâches de LxQt + + + Window List Content + Contenu de la liste des fenêtres + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montrer les fenêtres du bureau actuel + + + Show windows from all desktops + Montrer les fenêtres de tous les bureaux + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Apparence de la liste des fenêtres + + + + Button style + Style de boutons + + + Max button width + Largeur maximale du bouton + + + + Close on middle-click + Fermer d'un clic du milieu + + + + Icon and text + Icone et texte + + + + Only icon + Icone seule + + + + Only text + Texte seul + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_hu.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_hu.desktop new file mode 100644 index 0000000..22f402c --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Váltás a futó alkalmazások között +Name[hu]=Feladatkezelő diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_hu.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_hu.ts new file mode 100644 index 0000000..7a812d1 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_hu.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Alkalmazás + + + + To &Desktop + Erre az asztal&ra + + + + &All Desktops + &Az összes asztalra + + + + Desktop &%1 + &%1. asztal + + + + &To Current Desktop + Az ak&tuális asztalra + + + + Ma&ximize + Ma&ximalizálás + + + + Maximize vertically + Maximalizálás függőlegesen + + + + Maximize horizontally + Maximalizálás vízszintesen + + + + &Restore + &Visszaállítás + + + + Mi&nimize + Mi&nimalizálás + + + + Roll down + Legördítés + + + + Roll up + Felgördítés + + + + &Layer + Réte&g + + + + Always on &top + Mindig &felül + + + + &Normal + &Normál + + + + Always on &bottom + Min&dig alul + + + + &Close + &Bezárás + + + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + A LxQt feladatkezelő beállításai + + + Window List Content + Az ablaklista tartalma + + + + Task Manager Settings + Feladatkezelő beállítása + + + + General + Általános + + + + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak + + + + Show windows from all des&ktops + Az összes asztal ablakai létszanak + + + + Window &grouping + &Ablakcsoportok + + + + Show popup on mouse hover + Egérre felbukkanó jelzés + + + + Appearance + Megjelenés + + + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai + + + Show windows from all desktops + Az összes asztal ablakai + + + + Auto&rotate buttons when the panel is vertical + Gombok függőleges panelnál gördülnek + + + Window List Appearance + Az ablaklista megjelenése + + + + Button style + Gombstílus: + + + Max button width + Max. gombszélesség + + + + Close on middle-click + Középkattintásra bezárul + + + + Icon and text + Ikon és szöveg + + + + Only icon + Csak ikon + + + + Only text + Csak szöveg + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_hu_HU.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_hu_HU.ts new file mode 100644 index 0000000..f6c594a --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_hu_HU.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Alkalmazás + + + + To &Desktop + Erre az asztal&ra + + + + &All Desktops + &Az összes asztalra + + + + Desktop &%1 + &%1. asztal + + + + &To Current Desktop + Az ak&tuális asztalra + + + + Ma&ximize + Ma&ximalizálás + + + + Maximize vertically + Maximalizálás függőlegesen + + + + Maximize horizontally + Maximalizálás vízszintesen + + + + &Restore + &Visszaállítás + + + + Mi&nimize + Mi&nimalizálás + + + + Roll down + Legördítés + + + + Roll up + Felgördítés + + + + &Layer + Réte&g + + + + Always on &top + Mindig &felül + + + + &Normal + &Normál + + + + Always on &bottom + Min&dig alul + + + + &Close + &Bezárás + + + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + A LxQt feladatkezelő beállításai + + + Window List Content + Az ablaklista tartalma + + + + Task Manager Settings + Feladatkezelő beállítása + + + + General + Általános + + + + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak + + + + Show windows from all des&ktops + Az összes asztal ablakai létszanak + + + + Window &grouping + &Ablakcsoportok + + + + Show popup on mouse hover + Egérre felbukkanó jelzés + + + + Appearance + Megjelenés + + + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai + + + Show windows from all desktops + Az összes asztal ablakai + + + + Auto&rotate buttons when the panel is vertical + Gombok függőleges panelnál gördülnek + + + Window List Appearance + Az ablaklista megjelenése + + + + Button style + Gombstílus: + + + Max button width + Max. gombszélesség + + + + Close on middle-click + Középkattintásra bezárul + + + + Icon and text + Ikon és szöveg + + + + Only icon + Csak ikon + + + + Only text + Csak szöveg + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ia.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ia.desktop new file mode 100644 index 0000000..796c9bb --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task Manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ia.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ia.ts new file mode 100644 index 0000000..95354c3 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ia.ts @@ -0,0 +1,183 @@ + + + + + LxQtTaskButton + + + Application + + + + + To &Desktop + + + + + &All Desktops + + + + + Desktop &%1 + + + + + &To Current Desktop + + + + + Ma&ximize + + + + + Maximize vertically + + + + + Maximize horizontally + + + + + &Restore + + + + + Mi&nimize + + + + + Roll down + + + + + Roll up + + + + + &Layer + + + + + Always on &top + + + + + &Normal + + + + + Always on &bottom + + + + + &Close + + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + + Button style + + + + + Icon and text + + + + + Only icon + + + + + Only text + + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.desktop new file mode 100644 index 0000000..796c9bb --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task Manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.ts new file mode 100644 index 0000000..959e2d1 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_id_ID.ts @@ -0,0 +1,183 @@ + + + + + LxQtTaskButton + + + Application + + + + + To &Desktop + + + + + &All Desktops + + + + + Desktop &%1 + + + + + &To Current Desktop + + + + + Ma&ximize + + + + + Maximize vertically + + + + + Maximize horizontally + + + + + &Restore + + + + + Mi&nimize + + + + + Roll down + + + + + Roll up + + + + + &Layer + + + + + Always on &top + + + + + &Normal + + + + + Always on &bottom + + + + + &Close + + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + + Button style + + + + + Icon and text + + + + + Only icon + + + + + Only text + + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.desktop new file mode 100644 index 0000000..2788eb9 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Permette di accedere alle applicazioni in esecuzione +Name[it_IT]=Gestore dei processi diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.ts new file mode 100644 index 0000000..f6498a8 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_it_IT.ts @@ -0,0 +1,219 @@ + + + + + LxQtTaskButton + + + Application + Applicazione + + + + To &Desktop + Al &desktop + + + + &All Desktops + &Tutti i desktop + + + + Desktop &%1 + Desktop &%1 + + + + &To Current Desktop + &Al desktop corrente + + + + Ma&ximize + Ma&ssimizza + + + + Maximize vertically + Massimizza verticalmente + + + + Maximize horizontally + Massimizza orizzontalmente + + + + &Restore + &Ripristina + + + + Mi&nimize + Mi&nimizza + + + + Roll down + &Srotola + + + + Roll up + &Arrotola + + + + &Layer + &Livello + + + + Always on &top + Sempre in &primo piano + + + + &Normal + &Normale + + + + Always on &bottom + Sempre in &secondo piano + + + + &Close + &Chiudi + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Impostazioni del Task Manager di LXQt + + + Window List Content + Mostra finestre + + + + Task Manager Settings + Impostazioni della barra applicazioni + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Taskbar Contents + Contenuti della barra + + + Show windows from current desktop + Mostra finestre del desktop corrente + + + Show windows from all desktops + Mostra finestre da tutti i desktop + + + Taskbar Appearance + Aspetto + + + Minimum button width + Larghezza minima dei pulsanti + + + + Auto&rotate buttons when the panel is vertical + Ruota &automaticamente se il panello è verticale + + + Window List Appearance + Aspetto delle finestre + + + + Button style + Stile dei pulsanti + + + Max button width + Larghezza massima dei pulsanti + + + + Close on middle-click + Chiudi con un clic del tasto centrale + + + + Icon and text + Icone e testo + + + + Only icon + Solo icone + + + + Only text + Solo testo + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ja.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ja.desktop new file mode 100644 index 0000000..af8e794 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=実行中のアプリケーションを切り替えます +Name[ja]=タスク管理 diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ja.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ja.ts new file mode 100644 index 0000000..b81a168 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ja.ts @@ -0,0 +1,203 @@ + + + + + LxQtTaskButton + + + Application + アプリケーション + + + + To &Desktop + デスクトップへ(&D) + + + + &All Desktops + すべてのデスクトップ(&A) + + + + Desktop &%1 + デスクトップ &%1 + + + + &To Current Desktop + 現在のデスクトップへ(&T) + + + + Ma&ximize + 最大化(&x) + + + + Maximize vertically + 縦方向の最大化 + + + + Maximize horizontally + 横方向の最大化 + + + + &Restore + 復元(&R) + + + + Mi&nimize + 最小化(&N) + + + + Roll down + 広げる + + + + Roll up + たたむ + + + + &Layer + レイヤー(&L) + + + + Always on &top + 常に手前に表示(&T) + + + + &Normal + 通常(&N) + + + + Always on &bottom + 常に奥に表示(&B) + + + + &Close + 閉じる(&C) + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + タスクマネージャーの設定 + + + Taskbar Contents + タスクバーの内容 + + + Show windows from current desktop + 現在のデスクトップのウィンドウを表示 + + + Show windows from all desktops + 全てのデスクトップのウィンドウを表示 + + + Taskbar Appearance + タスクバーの見た目 + + + Minimum button width + ボタン幅の最小値 + + + + Auto&rotate buttons when the panel is vertical + パネルが垂直なときにはボタンを回転(&R) + + + + Button style + ボタンのスタイル + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Close on middle-click + 中ボタンのクリックで閉じる + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + + Icon and text + アイコンとテキスト + + + + Only icon + アイコンのみ + + + + Only text + テキストのみ + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ko.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ko.desktop new file mode 100644 index 0000000..796c9bb --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task Manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ko.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ko.ts new file mode 100644 index 0000000..2b1d173 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ko.ts @@ -0,0 +1,183 @@ + + + + + LxQtTaskButton + + + Application + + + + + To &Desktop + + + + + &All Desktops + + + + + Desktop &%1 + + + + + &To Current Desktop + + + + + Ma&ximize + + + + + Maximize vertically + + + + + Maximize horizontally + + + + + &Restore + + + + + Mi&nimize + + + + + Roll down + + + + + Roll up + + + + + &Layer + + + + + Always on &top + + + + + &Normal + + + + + Always on &bottom + + + + + &Close + + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + + Button style + + + + + Icon and text + + + + + Only icon + + + + + Only text + + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_lt.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_lt.desktop new file mode 100644 index 0000000..09b4c1b --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Persijungimas tarp programų +Name[lt]=Užduočių tvarkytuvė diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_lt.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_lt.ts new file mode 100644 index 0000000..81bcf69 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_lt.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Programa + + + + To &Desktop + Į &darbalaukį + + + + &All Desktops + &visus darbalaukius + + + + Desktop &%1 + &%1 darbalaukį + + + + &To Current Desktop + &Į dabartinį darbalaukį + + + + Ma&ximize + &Išdidinti + + + + Maximize vertically + Išdidinti vertikaliai + + + + Maximize horizontally + Išdidinti horizontaliai + + + + &Restore + &Atstatyti + + + + Mi&nimize + &Nuleisti + + + + Roll down + Išvynioti + + + + Roll up + Suvynioti + + + + &Layer + S&luoksnis + + + + Always on &top + Visada &viršuje + + + + &Normal + Įpras&tas + + + + Always on &bottom + Visada vi&ršuje + + + + &Close + &Užverti + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt užduočių tvarkutyvės nuostatos + + + Window List Content + Langų sąrašo turinys + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Rodyti tik šio darbalaukio langus + + + Show windows from all desktops + Rodyti visų darbalaukių langus + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Langų sąrašo išvaizda + + + + Button style + Mygtuko stilius + + + Max button width + Didžiausias leidžiamas plotis + + + + Close on middle-click + + + + + Icon and text + Ženkliukas ir tekstas + + + + Only icon + Tik ženkliukas + + + + Only text + Tik tekstas + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_nl.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_nl.desktop new file mode 100644 index 0000000..cce1496 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Wissel tussen draaiende applicaties +Name[nl]=taak-manager diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_nl.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_nl.ts new file mode 100644 index 0000000..2e5a87b --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_nl.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Toepassing + + + + To &Desktop + Naar &bureaublad + + + + &All Desktops + &Alle bureaubladen + + + + Desktop &%1 + Bureaublad &%1 + + + + &To Current Desktop + &Naar huidig bureaublad + + + + Ma&ximize + Ma&ximaliseren + + + + Maximize vertically + Verticaal maximaliseren + + + + Maximize horizontally + Horizontaal maximaliseren + + + + &Restore + &Herstellen + + + + Mi&nimize + Mi&nimaliseren + + + + Roll down + Uitrollen + + + + Roll up + Oprollen + + + + &Layer + &Laag + + + + Always on &top + Altijd bovenop + + + + &Normal + &Normaal + + + + Always on &bottom + Altijd onderop + + + + &Close + &Sluiten + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Instellingen voor taakbeheerder van LxQt + + + Window List Content + Inhoud van vensterlijst + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Toon vensters van huidig bureaublad + + + Show windows from all desktops + Toon vensters van alle bureaubladen + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Uiterlijk van vensterlijst + + + + Button style + Stijl van knoppen + + + Max button width + Maximale knopbreedte + + + + Close on middle-click + Sluiten bij middelklik + + + + Icon and text + Pictogram en tekst + + + + Only icon + Alleen pictogram + + + + Only text + Alleen tekst + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pl.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_pl.desktop new file mode 100644 index 0000000..251074c --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Przełączaj się pomiędzy otwartymi aplikacjami +Name[pl]=Pasek zadań diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.desktop new file mode 100644 index 0000000..ae01ac8 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Przełączaj między uruchomionymi aplikacjami +Name[pl_PL]=Pasek zadań diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.ts new file mode 100644 index 0000000..c14f3dd --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pl_PL.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplikacja + + + + To &Desktop + Na &pulpit + + + + &All Desktops + &Wszystkie pulpity + + + + Desktop &%1 + Pulpit &%1 + + + + &To Current Desktop + &Na obecny pulpit + + + + Ma&ximize + Zma&ksymalizuj + + + + Maximize vertically + Zmaksymalizuj pionowo + + + + Maximize horizontally + Zmaksymalizuj poziomo + + + + &Restore + &Odzyskaj + + + + Mi&nimize + Zmi&nimalizuj + + + + Roll down + Zwiń + + + + Roll up + Rozwiń + + + + &Layer + &Warstwa + + + + Always on &top + Zawsze na &wierzchu + + + + &Normal + &Normalnie + + + + Always on &bottom + Zawsze pod &spodem + + + + &Close + &Zamknij + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Ustawienia listy zadań LxQt + + + Window List Content + Zawartość listy zadań + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokazuj okna z obecnego pulpitu + + + Show windows from all desktops + Pokazuj okna ze wszystkich pulpitów + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Wygląd listy zadań + + + + Button style + Styl przycisku + + + Max button width + Maksymalna szerokość + + + + Close on middle-click + Zamknij środkowym klawiszem + + + + Icon and text + Ikona i tekst + + + + Only icon + Tylko ikona + + + + Only text + Tylko tekst + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pt.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_pt.desktop new file mode 100644 index 0000000..2c03a41 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Gestor de tarefas +Comment[pt]=Permite trocar entre as aplicações em execução diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pt.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_pt.ts new file mode 100644 index 0000000..e121959 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pt.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplicação + + + + To &Desktop + Na área &de trabalho + + + + &All Desktops + Tod&as as áreas de trabalho + + + + Desktop &%1 + Área de trabalho &%1 + + + + &To Current Desktop + Na área de &trabalho atual + + + + Ma&ximize + Ma&ximizar + + + + Maximize vertically + Maximizar na vertical + + + + Maximize horizontally + Maximizar na horizontal + + + + &Restore + &Restaurar + + + + Mi&nimize + Mi&nimizar + + + + Roll down + Enrolar para baixo + + + + Roll up + Enrolar para cima + + + + &Layer + Ca&mada + + + + Always on &top + Sempre na &frente + + + + &Normal + &Normal + + + + Always on &bottom + Sempre a&trás + + + + &Close + Fe&char + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Definições do gestor de tarefas LxQt + + + Window List Content + Conteúdo da lista de janelas + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar janelas da área de trabalho atual + + + Show windows from all desktops + Mostrar janelas de todas as áreas de trabalho + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Aparência da lista de janelas + + + + Button style + Estilo dos botões + + + Max button width + Largura máxima do botão + + + + Close on middle-click + Fechar com a roda do rato + + + + Icon and text + Ícones e texto + + + + Only icon + Ícones + + + + Only text + Texto + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.desktop new file mode 100644 index 0000000..9ea13e3 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Alterne entre aplicativos em execução +Name[pt_BR]=Gerenciador de tarefas diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.ts new file mode 100644 index 0000000..cb6db4e --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_pt_BR.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplicativo + + + + To &Desktop + Para a área &de trabalho + + + + &All Desktops + Todas &as áreas de trabalho + + + + Desktop &%1 + Área de trabalho &%1 + + + + &To Current Desktop + Para a área de &trabalho atual + + + + Ma&ximize + Ma&ximizar + + + + Maximize vertically + Maximizar verticalmente + + + + Maximize horizontally + Maximizar horizontalmente + + + + &Restore + &Restaurar + + + + Mi&nimize + Mi&nimizar + + + + Roll down + Rolar para baixo + + + + Roll up + Rolar para cima + + + + &Layer + &Camada + + + + Always on &top + Sempre em &cima + + + + &Normal + &Normal + + + + Always on &bottom + Sempre em &baixo + + + + &Close + &Fechar + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Configurações do gerenciador de tarefas do LxQt + + + Window List Content + Conteúdo da lista de janelas + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Exibir as janelas da área de trabalho atual + + + Show windows from all desktops + Exibir as janelas de todas as áreas de trabalho + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Aparência da lista de janelas + + + + Button style + Estilo dos botões + + + Max button width + Largura máxima do botão + + + + Close on middle-click + Fechar em meio clique + + + + Icon and text + Ícone e texto + + + + Only icon + Apenas ícone + + + + Only text + Apenas texto + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.desktop new file mode 100644 index 0000000..005309c --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Comută între aplcațiile active diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.ts new file mode 100644 index 0000000..a0ad0d3 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ro_RO.ts @@ -0,0 +1,203 @@ + + + + + LxQtTaskButton + + + Application + Aplicație + + + + To &Desktop + Către &desktop + + + + &All Desktops + Toate ecr&anele + + + + Desktop &%1 + Ecranul &%1 + + + + &To Current Desktop + Că&tre ecranul virtual curent + + + + Ma&ximize + Ma&ximizează + + + + Maximize vertically + Maximizează pe verticală + + + + Maximize horizontally + Maximizează pe orizontală + + + + &Restore + &Restaurează + + + + Mi&nimize + Mi&nimizează + + + + Roll down + Derulează în jos + + + + Roll up + Derulează în sus + + + + &Layer + &Strat + + + + Always on &top + Întotdeauna de&asupra + + + + &Normal + &Normal + + + + Always on &bottom + Întotdeauna de&desubt + + + + &Close + În&chide + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + Window List Content + Conținut listă ferestre + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Afișează ferestrele de pe ecranul virtual curent + + + Show windows from all desktops + Afișează ferestrele din toate ecranele virtuale + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Aspect listă ferestre + + + + Button style + Stil butoane + + + Max button width + Lățime maximă butoane + + + + Close on middle-click + Închide prin clic pe butonul din mijloc + + + + Icon and text + Pictograme și text + + + + Only icon + Doar pictograme + + + + Only text + Doar text + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ru.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ru.desktop new file mode 100644 index 0000000..e049334 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Переключиться между запущенными приложениями +Name[ru]=Панель задач \ No newline at end of file diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ru.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ru.ts new file mode 100644 index 0000000..5e9cda9 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ru.ts @@ -0,0 +1,204 @@ + + + + + LxQtTaskButton + + + Application + Приложение + + + + To &Desktop + &На рабочий стол + + + + &All Desktops + &Все рабочие столы + + + + Desktop &%1 + Рабочий стол &%1 + + + + &To Current Desktop + На &текущий рабочий стол + + + + Ma&ximize + Р&аспахнуть + + + + Maximize vertically + Распахнуть по вертикали + + + + Maximize horizontally + Распахнуть по горизонтали + + + + &Restore + &Восстановить + + + + Mi&nimize + &Свернуть + + + + Roll down + Развернуть из заголовока + + + + Roll up + Свернуть в заголовок + + + + &Layer + &Положение + + + + Always on &top + Всегда на &верху + + + + &Normal + &Обычное + + + + Always on &bottom + Всегда в&низу + + + + &Close + &Закрыть + + + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + Настройки панели задач + + + + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид + + + + Maximum button width + Максимальная ширина кнопки + + + + + px + пикс + + + + Maximum button height + Максимальная высота кнопки + + + + Button style + Стиль кнопок + + + + Show only windows from desktop + Показывать окна только с рабочего стола + + + + Auto&rotate buttons when the panel is vertical + Авто&поворот кнопок, когда панель вертикальна + + + + Close on middle-click + Закрыть по щелчку средней кнопки мыши + + + + Icon and text + Значок и текст + + + + Only icon + Только значок + + + + Only text + Только текст + + + + Current + Текущий + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.desktop new file mode 100644 index 0000000..d58c7bf --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Переключиться между запущенными приложениями +Name[ru_RU]=Панель задач \ No newline at end of file diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.ts new file mode 100644 index 0000000..02202d0 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_ru_RU.ts @@ -0,0 +1,204 @@ + + + + + LxQtTaskButton + + + Application + Приложение + + + + To &Desktop + &На рабочий стол + + + + &All Desktops + &Все рабочие столы + + + + Desktop &%1 + Рабочий стол &%1 + + + + &To Current Desktop + На &текущий рабочий стол + + + + Ma&ximize + Р&аспахнуть + + + + Maximize vertically + Распахнуть по вертикали + + + + Maximize horizontally + Распахнуть по горизонтали + + + + &Restore + &Восстановить + + + + Mi&nimize + &Свернуть + + + + Roll down + Развернуть из заголовока + + + + Roll up + Свернуть в заголовок + + + + &Layer + &Положение + + + + Always on &top + Всегда на &верху + + + + &Normal + &Обычное + + + + Always on &bottom + Всегда в&низу + + + + &Close + &Закрыть + + + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + Настройки панели задач + + + + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид + + + + Maximum button width + Максимальная ширина кнопки + + + + + px + пикс + + + + Maximum button height + Максимальная высота кнопки + + + + Button style + Стиль кнопок + + + + Show only windows from desktop + Показывать окна только с рабочего стола + + + + Auto&rotate buttons when the panel is vertical + Авто&поворот кнопок, когда панель вертикальна + + + + Close on middle-click + Закрыть по щелчку средней кнопки мыши + + + + Icon and text + Значок и текст + + + + Only icon + Только значок + + + + Only text + Только текст + + + + Current + Текущий + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sk.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sk.desktop new file mode 100644 index 0000000..ed38f45 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Prepínanie medzi bežiacimi aplikáciami +Name[sk]=Správca úloh diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sk_SK.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_sk_SK.ts new file mode 100644 index 0000000..ba7c83c --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sk_SK.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Aplikácia + + + + To &Desktop + Na &plochu + + + + &All Desktops + &Všetky plochy + + + + Desktop &%1 + Plocha &%1 + + + + &To Current Desktop + &Na aktuálnu plochu + + + + Ma&ximize + Ma&ximalizovať + + + + Maximize vertically + Maximalizovať zvisle + + + + Maximize horizontally + Maximalizovať vodorovne + + + + &Restore + &Obnoviť + + + + Mi&nimize + Mi&nimalizovať + + + + Roll down + Zrolovať nahor + + + + Roll up + Zrolovať dolu + + + + &Layer + &Vrstva + + + + Always on &top + Vždy &navrchu + + + + &Normal + &Normálne + + + + Always on &bottom + Vždy na&spodku + + + + &Close + &Zatvoriť + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Nastavenia správcu úloh prostredia LxQt + + + Window List Content + Obsah zoznamu okien + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Zobraziť okná z aktuálnej plochy + + + Show windows from all desktops + Zobraziť okná z každej plochy + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Vzhľad zoznamu okien + + + + Button style + Štýl tlačidiel + + + Max button width + Maximálna šírka tlačidla + + + + Close on middle-click + + + + + Icon and text + Ikona a text + + + + Only icon + Iba ikona + + + + Only text + Iba text + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sl.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sl.desktop new file mode 100644 index 0000000..808db85 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Preklapljajte med zagnanimi programi +Name[sl]=Upravljalnik opravil diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sl.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_sl.ts new file mode 100644 index 0000000..155fda5 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sl.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Program + + + + To &Desktop + &Na namizje + + + + &All Desktops + &Vsa namizja + + + + Desktop &%1 + Namizje &%1 + + + + &To Current Desktop + Na &trenutno namizje + + + + Ma&ximize + &Razpni + + + + Maximize vertically + Razpni navpično + + + + Maximize horizontally + Razpni vodoravno + + + + &Restore + &Obnovi + + + + Mi&nimize + Po&manjšaj + + + + Roll down + Razvij + + + + Roll up + Zvij + + + + &Layer + &Plast + + + + Always on &top + Vedno na &vrhu + + + + &Normal + &Običajno + + + + Always on &bottom + Vedno na &dnu + + + + &Close + &Zapri + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Nastavitve upravitelja opravil za LxQt + + + Window List Content + Vsebina seznama oken + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokaži okna s trenutnega namizja + + + Show windows from all desktops + Pokaži okna z vseh namizij + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Videz seznama oken + + + + Button style + Slog z gumbi + + + Max button width + Največja širina gumbov + + + + Close on middle-click + + + + + Icon and text + Ikona in besedilo + + + + Only icon + Samo ikona + + + + Only text + Samo besedilo + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sr.desktop new file mode 100644 index 0000000..947c212 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Пребацујте између програма у раду +Name[sr]=Менаџер задатака diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavian.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavian.desktop new file mode 100644 index 0000000..f350dc6 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Менаџер задатака +Comment[sr@ijekavian]=Пребацујте између програма у раду diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..0f165ed --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Menadžer zadataka +Comment[sr@ijekavianlatin]=Prebacujte između programa u radu diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.desktop new file mode 100644 index 0000000..a392965 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Prebacujte između programa u radu +Name[sr@latin]=Menadžer zadataka diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.ts new file mode 100644 index 0000000..fbde286 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr@latin.ts @@ -0,0 +1,183 @@ + + + + + LxQtTaskButton + + + Application + + + + + To &Desktop + + + + + &All Desktops + + + + + Desktop &%1 + + + + + &To Current Desktop + + + + + Ma&ximize + + + + + Maximize vertically + + + + + Maximize horizontally + + + + + &Restore + + + + + Mi&nimize + + + + + Roll down + + + + + Roll up + + + + + &Layer + + + + + Always on &top + + + + + &Normal + + + + + Always on &bottom + + + + + &Close + + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + + Button style + + + + + Icon and text + + + + + Only icon + + + + + Only text + + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr_BA.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_sr_BA.ts new file mode 100644 index 0000000..82ab86e --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr_BA.ts @@ -0,0 +1,211 @@ + + + + + LxQtTaskButton + + + Application + Програм + + + + To &Desktop + На &површ + + + + &All Desktops + &све површи + + + + Desktop &%1 + површ &%1 + + + + &To Current Desktop + &На тренутну површ + + + + Ma&ximize + Ма&ксимизуј + + + + Maximize vertically + Максимизуј вертикално + + + + Maximize horizontally + Максимизуј хоризонтално + + + + &Restore + &Обнови + + + + Mi&nimize + &Минимизуј + + + + Roll down + Одмотај + + + + Roll up + Намотај + + + + &Layer + &Слој + + + + Always on &top + увијек &изнад + + + + &Normal + &нормално + + + + Always on &bottom + увијек испо&д + + + + &Close + &Затвори + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Подешавања менаџера задатака + + + Window List Content + Садржај листе прозора + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click + + + + wlcB + wlcB + + + Show windows from all desktops + Прикажи прозоре са свих површи + + + Window List Appearance + Изглед листе прозора + + + + Button style + Стил тастера + + + Max button width + Макс. ширина тастера + + + + Icon and text + икона и текст + + + + Only icon + само икона + + + + Only text + само текст + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_sr_RS.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_sr_RS.ts new file mode 100644 index 0000000..2409003 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_sr_RS.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Програм + + + + To &Desktop + На &површ + + + + &All Desktops + &све површи + + + + Desktop &%1 + површ &%1 + + + + &To Current Desktop + &На тренутну површ + + + + Ma&ximize + Ма&ксимизуј + + + + Maximize vertically + Максимизуј вертикално + + + + Maximize horizontally + Максимизуј хоризонтално + + + + &Restore + &Обнови + + + + Mi&nimize + &Минимизуј + + + + Roll down + Одмотај + + + + Roll up + Намотај + + + + &Layer + &Слој + + + + Always on &top + увек &изнад + + + + &Normal + &нормално + + + + Always on &bottom + увек испо&д + + + + &Close + &Затвори + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Подешавања менаџера задатака + + + Window List Content + Садржај листе прозора + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + Show windows from all desktops + Прикажи прозоре са свих површи + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Изглед листе прозора + + + + Button style + Стил тастера + + + Max button width + Макс. ширина тастера + + + + Close on middle-click + + + + + Icon and text + икона и текст + + + + Only icon + само икона + + + + Only text + само текст + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.desktop new file mode 100644 index 0000000..0acbbb5 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=สลับใช้งานระหว่างโปรแกรมที่เปิดอยู่ +Name[th_TH]=ตัวจัดการงาน diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.ts new file mode 100644 index 0000000..0ca915e --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_th_TH.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + โปรแกรม + + + + To &Desktop + ไปยัง &พ&ื&้นโต๊ะ + + + + &All Desktops + &ท&ุกพื้นโต๊ะ + + + + Desktop &%1 + พื้นโต๊ะ &%1 + + + + &To Current Desktop + &ไปยังพื้นโต๊ะปัจจุบัน + + + + Ma&ximize + &ขยายแผ่ + + + + Maximize vertically + ขยายแผ่ทางแนวตั้ง + + + + Maximize horizontally + ขยายแผ่ทางแนวนอน + + + + &Restore + &ค&ืนสภาพ + + + + Mi&nimize + &ย&่อเก็บ + + + + Roll down + ม้วนลง + + + + Roll up + ม้วนขึ้น + + + + &Layer + &ลำดับชั้น + + + + Always on &top + ด้าน&หน้าเสมอ + + + + &Normal + &ปกติ + + + + Always on &bottom + ด้านหลัง&งเสมอ + + + + &Close + ปิ&ด + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + ค่าตั้งตัวจัดการงาน LxQt + + + Window List Content + การแสดงรายการหน้าต่าง + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + แสดงหน้าต่างเฉพาะพื้นโต๊ะปัจจุบัน + + + Show windows from all desktops + แสดงหน้าต่างจากทุกพื้นโต๊ะ + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + ลักษณะรายการหน้าต่าง + + + + Button style + รูปแบบปุ่ม + + + Max button width + ความกว้างปุ่มขนาดสูงสุด + + + + Close on middle-click + ปิดด้วยการคลิกปุ่มกลาง + + + + Icon and text + ไอคอนและข้อความ + + + + Only icon + ไอคอนเท่านั้น + + + + Only text + ข้อความเท่านั้น + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_tr.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_tr.desktop new file mode 100644 index 0000000..fdbbc97 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Çalışan uygulamalar arasında geçiş yapın +Name[tr]=Görev Yöneticisi diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_tr.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_tr.ts new file mode 100644 index 0000000..862ae07 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_tr.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Uygulama + + + + To &Desktop + &Masaüstüne + + + + &All Desktops + &Tüm Masaüstlerine + + + + Desktop &%1 + Masaüstü &%1 + + + + &To Current Desktop + &Şimdiki Masaüstüne + + + + Ma&ximize + Bü&yüt + + + + Maximize vertically + Dikey büyüt + + + + Maximize horizontally + Yatay büyüt + + + + &Restore + &Geri getir + + + + Mi&nimize + Kü&çült + + + + Roll down + Aşağı indir + + + + Roll up + Yukarı çıkar + + + + &Layer + &Katman + + + + Always on &top + Her zaman &üstte + + + + &Normal + &Normal + + + + Always on &bottom + Her zaman &altta + + + + &Close + &Kapat + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt Görev Yöneticisi Ayarları + + + Window List Content + Pencere Listesi İçeriği + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Şimdiki masaüstündeki pencereleri göster + + + Show windows from all desktops + Tüm masaüstlerindeki pencereleri göster + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Pencere Listesi Görünümü + + + + Button style + Düğme biçimi + + + Max button width + En fazla düğme genişliği + + + + Close on middle-click + Orta tıklama ile kapat + + + + Icon and text + Simge ve metin + + + + Only icon + Sadece simge + + + + Only text + Sadece metin + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_uk.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_uk.desktop new file mode 100644 index 0000000..1219f40 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Перемкнутися між запущеними вікнами +Name[uk]=Менеджер завдань diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_uk.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_uk.ts new file mode 100644 index 0000000..5752841 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_uk.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + Програма + + + + To &Desktop + На &стільницю + + + + &All Desktops + На &всі стільниці + + + + Desktop &%1 + Стільниця &%1 + + + + &To Current Desktop + На &поточну стільницю + + + + Ma&ximize + Ма&ксимізувати + + + + Maximize vertically + Максимізувати вертикально + + + + Maximize horizontally + Максимізувати горизонтально + + + + &Restore + &Розгорнути + + + + Mi&nimize + &Згорнути + + + + Roll down + Посунути вниз + + + + Roll up + Посунути вгору + + + + &Layer + &Шар + + + + Always on &top + Завжди з&гори + + + + &Normal + &Типово + + + + Always on &bottom + Завжди з&низу + + + + &Close + З&акрити + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + Налаштування списку вікон + + + Window List Content + Вміст списку вікон + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Показувати вікна поточної стільниці + + + Show windows from all desktops + Показувати вікна всіх стільниць + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + Вигляд списку вікон + + + + Button style + Стиль кнопок + + + Max button width + Макс. довжина кнопки + + + + Close on middle-click + Закривати по середній кнопці миші + + + + Icon and text + Значок та текст + + + + Only icon + Лише значок + + + + Only text + Лише текст + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.GB2312.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.GB2312.desktop new file mode 100644 index 0000000..796c9bb --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task Manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.desktop new file mode 100644 index 0000000..0afacc1 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=在运行的程序间切换 +Name[zh_CN]=任务管理器 diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.ts new file mode 100644 index 0000000..15b1eb9 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_CN.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + 应用程序 + + + + To &Desktop + 到&桌面 + + + + &All Desktops + &全部桌面 + + + + Desktop &%1 + 桌面 &%1 + + + + &To Current Desktop + &到当前桌面 + + + + Ma&ximize + 最&大化 + + + + Maximize vertically + 垂直最大化 + + + + Maximize horizontally + 水平最大化 + + + + &Restore + &恢复 + + + + Mi&nimize + 最&小化 + + + + Roll down + 卷下 + + + + Roll up + 卷上 + + + + &Layer + &层 + + + + Always on &top + 总在&顶层 + + + + &Normal + &正常 + + + + Always on &bottom + 总在&底层 + + + + &Close + &关闭 + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt任务管理器设置 + + + Window List Content + 窗口列表内容 + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 显示当前桌面的窗口 + + + Show windows from all desktops + 显示所有桌面的窗口 + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + 窗口列表外观 + + + + Button style + 按钮样式 + + + Max button width + 最大按钮宽度 + + + + Close on middle-click + 鼠标中击时关闭 + + + + Icon and text + 图标和文字 + + + + Only icon + 仅图标 + + + + Only text + 仅文字 + + + diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.desktop b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.desktop new file mode 100644 index 0000000..dc5d003 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Task manager +Comment=Switch between running applications + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=在正在運行程式中切換 +Name[zh_TW]=工作管理員 diff --git a/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.ts b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.ts new file mode 100644 index 0000000..99f0b23 --- /dev/null +++ b/lxqt-panel/plugin-taskbar/translations/taskbar_zh_TW.ts @@ -0,0 +1,207 @@ + + + + + LxQtTaskButton + + + Application + 應用程式 + + + + To &Desktop + 傳送到桌面(&D) + + + + &All Desktops + 傳送到全部桌面(&A) + + + + Desktop &%1 + 桌面 &%1 + + + + &To Current Desktop + 傳送到當前桌面(&T) + + + + Ma&ximize + 最大化(&x) + + + + Maximize vertically + 垂直最大化 + + + + Maximize horizontally + 水平最大化 + + + + &Restore + 恢復(&R) + + + + Mi&nimize + 最小化(&n) + + + + Roll down + 放下視窗 + + + + Roll up + 捲起視窗 + + + + &Layer + 層(&L) + + + + Always on &top + 總是在最上層(&t) + + + + &Normal + 正常(&N) + + + + Always on &bottom + 總是在最底層(&b) + + + + &Close + 關閉(&C) + + + + LxQtTaskGroup + + + Group + + + + + Close group + + + + + LxQtTaskbarConfiguration + + LxQt Task Manager Settings + LxQt工作管理員設定 + + + Window List Content + 視窗清單內容 + + + + Task Manager Settings + + + + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 顯示當前桌面視窗 + + + Show windows from all desktops + 顯示所有桌面視窗 + + + + Auto&rotate buttons when the panel is vertical + + + + Window List Appearance + 視窗清單外觀 + + + + Button style + 按鈕樣式 + + + Max button width + 最大按鈕寬度 + + + + Close on middle-click + 按滑鼠中鍵關閉 + + + + Icon and text + 圖示與文字 + + + + Only icon + 僅圖示 + + + + Only text + 僅文字 + + + diff --git a/lxqt-panel/plugin-tray/CMakeLists.txt b/lxqt-panel/plugin-tray/CMakeLists.txt new file mode 100644 index 0000000..184c92a --- /dev/null +++ b/lxqt-panel/plugin-tray/CMakeLists.txt @@ -0,0 +1,38 @@ +set(PLUGIN "tray") + +include(CheckLibraryExists) + +find_package(PkgConfig) +pkg_check_modules(XCB REQUIRED xcb) +pkg_check_modules(XCB_UTIL REQUIRED xcb-util) +pkg_check_modules(XCB_DAMAGE REQUIRED xcb-damage) + +find_package(X11 REQUIRED) +pkg_check_modules(XCOMPOSITE REQUIRED xcomposite) +pkg_check_modules(XDAMAGE REQUIRED xdamage) +pkg_check_modules(XRENDER REQUIRED xrender) + +set(HEADERS + lxqttrayplugin.h + lxqttray.h + trayicon.h + xfitman.h +) + +set(SOURCES + lxqttrayplugin.cpp + lxqttray.cpp + trayicon.cpp + xfitman.cpp +) + +set(LIBRARIES + ${X11_LIBRARIES} + ${XCOMPOSITE_LIBRARIES} + ${XDAMAGE_LIBRARIES} + ${XRENDER_LIBRARIES} + ${XCB_LIBRARIES} + ${XCB_DAMAGE_LIBRARIES} +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-tray/lxqttray.cpp b/lxqt-panel/plugin-tray/lxqttray.cpp new file mode 100644 index 0000000..83736d4 --- /dev/null +++ b/lxqt-panel/plugin-tray/lxqttray.cpp @@ -0,0 +1,387 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/******************************************************************** + Inspired by freedesktops tint2 ;) + +*********************************************************************/ + +#include +#include +#include +#include +#include "trayicon.h" +#include "../panel/ilxqtpanel.h" +#include +#include "lxqttray.h" +#include "xfitman.h" + +#include +#include +#include +#include +#include +#include +#include + +#undef Bool // defined as int in X11/Xlib.h + +#include "../panel/ilxqtpanelplugin.h" + +#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 +#define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1 + +#define SYSTEM_TRAY_REQUEST_DOCK 0 +#define SYSTEM_TRAY_BEGIN_MESSAGE 1 +#define SYSTEM_TRAY_CANCEL_MESSAGE 2 + +#define XEMBED_EMBEDDED_NOTIFY 0 +#define XEMBED_MAPPED (1 << 0) + + +/************************************************ + + ************************************************/ +LxQtTray::LxQtTray(ILxQtPanelPlugin *plugin, QWidget *parent): + QFrame(parent), + mValid(false), + mTrayId(0), + mDamageEvent(0), + mDamageError(0), + mIconSize(TRAY_ICON_SIZE_DEFAULT, TRAY_ICON_SIZE_DEFAULT), + mPlugin(plugin), + mDisplay(QX11Info::display()) +{ + mLayout = new LxQt::GridLayout(this); + realign(); + _NET_SYSTEM_TRAY_OPCODE = XfitMan::atom("_NET_SYSTEM_TRAY_OPCODE"); + // Init the selection later just to ensure that no signals are sent until + // after construction is done and the creating object has a chance to connect. + QTimer::singleShot(0, this, SLOT(startTray())); +} + + +/************************************************ + + ************************************************/ +LxQtTray::~LxQtTray() +{ + stopTray(); +} + + +/************************************************ + + ************************************************/ +bool LxQtTray::nativeEventFilter(const QByteArray &eventType, void *message, long *) +{ + if (eventType != "xcb_generic_event_t") + return false; + + xcb_generic_event_t* event = static_cast(message); + + TrayIcon* icon; + int event_type = event->response_type & ~0x80; + + switch (event_type) + { + case ClientMessage: + clientMessageEvent(event); + break; + +// case ConfigureNotify: +// icon = findIcon(event->xconfigure.window); +// if (icon) +// icon->configureEvent(&(event->xconfigure)); +// break; + + case DestroyNotify: { + unsigned long event_window; + event_window = reinterpret_cast(event)->window; + icon = findIcon(event_window); + if (icon) + { + mIcons.removeAll(icon); + delete icon; + } + break; + } + default: + if (event_type == mDamageEvent + XDamageNotify) + { + xcb_damage_notify_event_t* dmg = reinterpret_cast(event); + icon = findIcon(dmg->drawable); + if (icon) + icon->update(); + } + break; + } + + return false; +} + + +/************************************************ + + ************************************************/ +void LxQtTray::realign() +{ + mLayout->setEnabled(false); + ILxQtPanel *panel = mPlugin->panel(); + + if (panel->isHorizontal()) + { + mLayout->setRowCount(panel->lineCount()); + mLayout->setColumnCount(0); + } + else + { + mLayout->setColumnCount(panel->lineCount()); + mLayout->setRowCount(0); + } + mLayout->setEnabled(true); +} + + +/************************************************ + + ************************************************/ +void LxQtTray::clientMessageEvent(xcb_generic_event_t *e) +{ + unsigned long opcode; + unsigned long message_type; + Window id; + xcb_client_message_event_t* event = reinterpret_cast(e); + uint32_t* data32 = event->data.data32; + message_type = event->type; + opcode = data32[1]; + if(message_type != _NET_SYSTEM_TRAY_OPCODE) + return; + + switch (opcode) + { + case SYSTEM_TRAY_REQUEST_DOCK: + id = data32[2]; + if (id) + addIcon(id); + break; + + + case SYSTEM_TRAY_BEGIN_MESSAGE: + case SYSTEM_TRAY_CANCEL_MESSAGE: + qDebug() << "we don't show balloon messages."; + break; + + + default: +// if (opcode == xfitMan().atom("_NET_SYSTEM_TRAY_MESSAGE_DATA")) +// qDebug() << "message from dockapp:" << e->data.b; +// else +// qDebug() << "SYSTEM_TRAY : unknown message type" << opcode; + break; + } +} + +/************************************************ + + ************************************************/ +TrayIcon* LxQtTray::findIcon(Window id) +{ + foreach(TrayIcon* icon, mIcons) + { + if (icon->iconId() == id || icon->windowId() == id) + return icon; + } + return 0; +} + + +/************************************************ + +************************************************/ +void LxQtTray::setIconSize(QSize iconSize) +{ + mIconSize = iconSize; + unsigned long size = qMin(mIconSize.width(), mIconSize.height()); + XChangeProperty(mDisplay, + mTrayId, + XfitMan::atom("_NET_SYSTEM_TRAY_ICON_SIZE"), + XA_CARDINAL, + 32, + PropModeReplace, + (unsigned char*)&size, + 1); +} + + +/************************************************ + +************************************************/ +VisualID LxQtTray::getVisual() +{ + VisualID visualId = 0; + Display* dsp = mDisplay; + + XVisualInfo templ; + templ.screen=QX11Info::appScreen(); + templ.depth=32; + templ.c_class=TrueColor; + + int nvi; + XVisualInfo* xvi = XGetVisualInfo(dsp, VisualScreenMask|VisualDepthMask|VisualClassMask, &templ, &nvi); + + if (xvi) + { + int i; + XRenderPictFormat* format; + for (i = 0; i < nvi; i++) + { + format = XRenderFindVisualFormat(dsp, xvi[i].visual); + if (format && + format->type == PictTypeDirect && + format->direct.alphaMask) + { + visualId = xvi[i].visualid; + break; + } + } + XFree(xvi); + } + + return visualId; +} + + +/************************************************ + freedesktop systray specification + ************************************************/ +void LxQtTray::startTray() +{ + Display* dsp = mDisplay; + Window root = QX11Info::appRootWindow(); + + QString s = QString("_NET_SYSTEM_TRAY_S%1").arg(DefaultScreen(dsp)); + Atom _NET_SYSTEM_TRAY_S = XfitMan::atom(s.toLatin1()); + + if (XGetSelectionOwner(dsp, _NET_SYSTEM_TRAY_S) != None) + { + qWarning() << "Another systray is running"; + mValid = false; + return; + } + + // init systray protocol + mTrayId = XCreateSimpleWindow(dsp, root, -1, -1, 1, 1, 0, 0, 0); + + XSetSelectionOwner(dsp, _NET_SYSTEM_TRAY_S, mTrayId, CurrentTime); + if (XGetSelectionOwner(dsp, _NET_SYSTEM_TRAY_S) != mTrayId) + { + qWarning() << "Can't get systray manager"; + stopTray(); + mValid = false; + return; + } + + int orientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ; + XChangeProperty(dsp, + mTrayId, + XfitMan::atom("_NET_SYSTEM_TRAY_ORIENTATION"), + XA_CARDINAL, + 32, + PropModeReplace, + (unsigned char *) &orientation, + 1); + + // ** Visual ******************************** + VisualID visualId = getVisual(); + if (visualId) + { + XChangeProperty(mDisplay, + mTrayId, + XfitMan::atom("_NET_SYSTEM_TRAY_VISUAL"), + XA_VISUALID, + 32, + PropModeReplace, + (unsigned char*)&visualId, + 1); + } + // ****************************************** + + setIconSize(mIconSize); + + XClientMessageEvent ev; + ev.type = ClientMessage; + ev.window = root; + ev.message_type = XfitMan::atom("MANAGER"); + ev.format = 32; + ev.data.l[0] = CurrentTime; + ev.data.l[1] = _NET_SYSTEM_TRAY_S; + ev.data.l[2] = mTrayId; + ev.data.l[3] = 0; + ev.data.l[4] = 0; + XSendEvent(dsp, root, False, StructureNotifyMask, (XEvent*)&ev); + + XDamageQueryExtension(mDisplay, &mDamageEvent, &mDamageError); + + qDebug() << "Systray started"; + mValid = true; + + qApp->installNativeEventFilter(this); +} + + +/************************************************ + + ************************************************/ +void LxQtTray::stopTray() +{ + qDeleteAll(mIcons); + if (mTrayId) + { + XDestroyWindow(mDisplay, mTrayId); + mTrayId = 0; + } + mValid = false; +} + + +/************************************************ + + ************************************************/ +void LxQtTray::addIcon(Window winId) +{ + TrayIcon* icon = new TrayIcon(winId, this); + if (!icon->isValid()) + { + delete icon; + return; + } + + mIcons.append(icon); + mLayout->addWidget(icon); +} + diff --git a/lxqt-panel/plugin-tray/lxqttray.h b/lxqt-panel/plugin-tray/lxqttray.h new file mode 100644 index 0000000..20ab76b --- /dev/null +++ b/lxqt-panel/plugin-tray/lxqttray.h @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTRAY_H +#define LXQTTRAY_H + +#include +#include +#include "../panel/ilxqtpanel.h" +#include +#include +#include +#include "fixx11h.h" + +class TrayIcon; +class QSize; + +namespace LxQt { +class GridLayout; +} + +/** + * @brief This makes our trayplugin + */ +class ILxQtPanelPlugin; + +class LxQtTray: public QFrame, QAbstractNativeEventFilter +{ + Q_OBJECT + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) +public: + LxQtTray(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~LxQtTray(); + + + QSize iconSize() const { return mIconSize; } + void setIconSize(QSize iconSize); + + bool nativeEventFilter(const QByteArray &eventType, void *message, long *); + + void realign(); + +signals: + void iconSizeChanged(int iconSize); + +private slots: + void startTray(); + void stopTray(); + +private: + VisualID getVisual(); + + void clientMessageEvent(xcb_generic_event_t *e); + + int clientMessage(WId _wid, Atom _msg, + long unsigned int data0, + long unsigned int data1 = 0, + long unsigned int data2 = 0, + long unsigned int data3 = 0, + long unsigned int data4 = 0) const; + + void addIcon(Window id); + TrayIcon* findIcon(Window trayId); + + bool mValid; + Window mTrayId; + QList mIcons; + int mDamageEvent; + int mDamageError; + QSize mIconSize; + LxQt::GridLayout *mLayout; + ILxQtPanelPlugin *mPlugin; + Atom _NET_SYSTEM_TRAY_OPCODE; + Display* mDisplay; +}; + + +#endif diff --git a/lxqt-panel/plugin-tray/lxqttrayplugin.cpp b/lxqt-panel/plugin-tray/lxqttrayplugin.cpp new file mode 100644 index 0000000..f7c8a09 --- /dev/null +++ b/lxqt-panel/plugin-tray/lxqttrayplugin.cpp @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqttrayplugin.h" +#include "lxqttray.h" + +LxQtTrayPlugin::LxQtTrayPlugin(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo), + mWidget(new LxQtTray(this)) +{ +} + +LxQtTrayPlugin::~LxQtTrayPlugin() +{ + delete mWidget; +} + +QWidget *LxQtTrayPlugin::widget() +{ + return mWidget; +} + +void LxQtTrayPlugin::realign() +{ + mWidget->realign(); +} + + diff --git a/lxqt-panel/plugin-tray/lxqttrayplugin.h b/lxqt-panel/plugin-tray/lxqttrayplugin.h new file mode 100644 index 0000000..fafc610 --- /dev/null +++ b/lxqt-panel/plugin-tray/lxqttrayplugin.h @@ -0,0 +1,67 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2013 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQTTRAYPLUGIN_H +#define LXQTTRAYPLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include + +class LxQtTray; +class LxQtTrayPlugin : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + explicit LxQtTrayPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtTrayPlugin(); + + virtual QWidget *widget(); + virtual QString themeId() const { return "Tray"; } + virtual Flags flags() const { return PreferRightAlignment | SingleInstance | NeedsHandle; } + void realign(); + + bool isSeparate() const { return true; } + +private: + LxQtTray *mWidget; + +}; + +class LxQtTrayPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtTrayPlugin(startupInfo); + } +}; + +#endif // LXQTTRAYPLUGIN_H diff --git a/lxqt-panel/plugin-tray/resources/tray.desktop.in b/lxqt-panel/plugin-tray/resources/tray.desktop.in new file mode 100644 index 0000000..7225961 --- /dev/null +++ b/lxqt-panel/plugin-tray/resources/tray.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. +Icon=go-bottom + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-tray/translations/tray.ts b/lxqt-panel/plugin-tray/translations/tray.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray.ts @@ -0,0 +1,4 @@ + + + + diff --git a/lxqt-panel/plugin-tray/translations/tray_ar.desktop b/lxqt-panel/plugin-tray/translations/tray_ar.desktop new file mode 100644 index 0000000..544a1e8 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ar.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ar]=الوصول إلى التطبيقات المخفيَّة المصغَّرة في دفَّة النّظام +Name[ar]=دفَّة النِّظام diff --git a/lxqt-panel/plugin-tray/translations/tray_cs.desktop b/lxqt-panel/plugin-tray/translations/tray_cs.desktop new file mode 100644 index 0000000..a09379a --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_cs.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs]=Přístup ke skrytým programům zmenšeným v oznamovací oblasti panelu +Name[cs]=Oznamovací oblast panelu diff --git a/lxqt-panel/plugin-tray/translations/tray_cs_CZ.desktop b/lxqt-panel/plugin-tray/translations/tray_cs_CZ.desktop new file mode 100644 index 0000000..5a00e70 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Přistoupit k programům zmenšeným v oznamovací oblasti panelu +Name[cs_CZ]=Oznamovací oblast diff --git a/plugin-tray/translations/tray_de_DE.desktop b/lxqt-panel/plugin-tray/translations/tray_da.desktop similarity index 64% rename from plugin-tray/translations/tray_de_DE.desktop rename to lxqt-panel/plugin-tray/translations/tray_da.desktop index fff3edc..cfeb5c0 100644 --- a/plugin-tray/translations/tray_de_DE.desktop +++ b/lxqt-panel/plugin-tray/translations/tray_da.desktop @@ -8,5 +8,5 @@ Comment=Display applications minimized to the system tray. # Translations -Comment[de_DE]=Auf versteckte, minimierte Anwendungen im System Tray zugreifen -Name[de_DE]=System Tray +Comment[da]=Adgang til skjulte programmer der er minimeret til systembakken +Name[da]=Systembakke diff --git a/lxqt-panel/plugin-tray/translations/tray_da_DK.desktop b/lxqt-panel/plugin-tray/translations/tray_da_DK.desktop new file mode 100644 index 0000000..2bca7ae --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Giver adgang til skjulte programmer, minimeret til systembakken +Name[da_DK]=Systembakke diff --git a/lxqt-panel/plugin-tray/translations/tray_de.desktop b/lxqt-panel/plugin-tray/translations/tray_de.desktop new file mode 100644 index 0000000..30e2af1 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_de.desktop @@ -0,0 +1,3 @@ +# Translations +Name[de]=Benachrichtigungsfläche +Comment[de]=Benachrichtigungen von Anwendungen gem. System Tray Protocol diff --git a/lxqt-panel/plugin-tray/translations/tray_el_GR.desktop b/lxqt-panel/plugin-tray/translations/tray_el_GR.desktop new file mode 100644 index 0000000..c327815 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Πρόσβαση στις κρυφές εφαρμογές που ελαχιστοποιήθηκαν στο πλαίσιο συστήματος +Name[el_GR]=Πλαίσιο συστήματος diff --git a/lxqt-panel/plugin-tray/translations/tray_eo.desktop b/lxqt-panel/plugin-tray/translations/tray_eo.desktop new file mode 100644 index 0000000..536d196 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_eo.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eo]=Akiri kaŝitajn aplikaĵojn malmaksimigitajn en la sistempleto +Name[eo]=Sistempleto diff --git a/lxqt-panel/plugin-tray/translations/tray_es.desktop b/lxqt-panel/plugin-tray/translations/tray_es.desktop new file mode 100644 index 0000000..a0dee4d --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Accede a aplicaciones ocultas minimizadas en la bandeja del sistema +Name[es]=Bandeja del sistema diff --git a/lxqt-panel/plugin-tray/translations/tray_es_VE.desktop b/lxqt-panel/plugin-tray/translations/tray_es_VE.desktop new file mode 100644 index 0000000..7717aa0 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Acceder aplicaciones minimizadas en la barra de iconos de sistema +Name[es_VE]=Barra de sistema diff --git a/lxqt-panel/plugin-tray/translations/tray_eu.desktop b/lxqt-panel/plugin-tray/translations/tray_eu.desktop new file mode 100644 index 0000000..cdb1700 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Bistaratu aplikazioak minimizatuta ataza-barran. +Name[eu]=Ataza-barra diff --git a/lxqt-panel/plugin-tray/translations/tray_fi.desktop b/lxqt-panel/plugin-tray/translations/tray_fi.desktop new file mode 100644 index 0000000..d829580 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Käytä ilmoitusalueelle pienennettyjä sovelluksia +Name[fi]=Ilmoitusalue diff --git a/lxqt-panel/plugin-tray/translations/tray_fr_FR.desktop b/lxqt-panel/plugin-tray/translations/tray_fr_FR.desktop new file mode 100644 index 0000000..3befb02 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_fr_FR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fr_FR]=Accéder aux applications cachées minimisées dans la zone de notification +Name[fr_FR]=Zone de notification diff --git a/lxqt-panel/plugin-tray/translations/tray_hu.desktop b/lxqt-panel/plugin-tray/translations/tray_hu.desktop new file mode 100644 index 0000000..8f180da --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=A paneltálcára minimalizált, rejtett alkalmazások elérése +Name[hu]=Paneltálca diff --git a/lxqt-panel/plugin-tray/translations/tray_ia.desktop b/lxqt-panel/plugin-tray/translations/tray_ia.desktop new file mode 100644 index 0000000..4863c5c --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ia.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Access hidden applications minimized in the system tray + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-tray/translations/tray_id_ID.desktop b/lxqt-panel/plugin-tray/translations/tray_id_ID.desktop new file mode 100644 index 0000000..4863c5c --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_id_ID.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Access hidden applications minimized in the system tray + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-tray/translations/tray_it_IT.desktop b/lxqt-panel/plugin-tray/translations/tray_it_IT.desktop new file mode 100644 index 0000000..2e2d81f --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Accedi alle applicazioni nascoste minimizzate nel vassoio di sistema +Name[it_IT]=Vassoio di sistema diff --git a/lxqt-panel/plugin-tray/translations/tray_ja.desktop b/lxqt-panel/plugin-tray/translations/tray_ja.desktop new file mode 100644 index 0000000..686b3f6 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ja.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ja]=システムトレイに最小化されたアプリケーションを表示します +Name[ja]=システムトレイ diff --git a/lxqt-panel/plugin-tray/translations/tray_ko.desktop b/lxqt-panel/plugin-tray/translations/tray_ko.desktop new file mode 100644 index 0000000..4863c5c --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ko.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Access hidden applications minimized in the system tray + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-tray/translations/tray_lt.desktop b/lxqt-panel/plugin-tray/translations/tray_lt.desktop new file mode 100644 index 0000000..ca5a573 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_lt.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[lt]=Leidžia pasiekti į sistemos dėklą nuleistas programas +Name[lt]=Sistemos dėklas diff --git a/lxqt-panel/plugin-tray/translations/tray_nl.desktop b/lxqt-panel/plugin-tray/translations/tray_nl.desktop new file mode 100644 index 0000000..330c634 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_nl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[nl]=Verborgen pictogrammen tonen +Name[nl]=Systeem vak diff --git a/lxqt-panel/plugin-tray/translations/tray_pl.desktop b/lxqt-panel/plugin-tray/translations/tray_pl.desktop new file mode 100644 index 0000000..476e525 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_pl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl]=Udostępnia ukryte aplikacje +Name[pl]=Tacka systemowa diff --git a/lxqt-panel/plugin-tray/translations/tray_pl_PL.desktop b/lxqt-panel/plugin-tray/translations/tray_pl_PL.desktop new file mode 100644 index 0000000..7318e67 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Dostęp do aplikacji zminimalizowanych do tacki systemowej. +Name[pl_PL]=Tacka systemowa diff --git a/lxqt-panel/plugin-tray/translations/tray_pt.desktop b/lxqt-panel/plugin-tray/translations/tray_pt.desktop new file mode 100644 index 0000000..f323312 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Bandeja do sistema +Comment[pt]=Aceder às aplicações minimizadas na bandeja do sistema diff --git a/lxqt-panel/plugin-tray/translations/tray_pt_BR.desktop b/lxqt-panel/plugin-tray/translations/tray_pt_BR.desktop new file mode 100644 index 0000000..4433563 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Acesse aplicativos ocultos minimizados na área de notificação +Name[pt_BR]=Área de notificação diff --git a/lxqt-panel/plugin-tray/translations/tray_ro_RO.desktop b/lxqt-panel/plugin-tray/translations/tray_ro_RO.desktop new file mode 100644 index 0000000..385751d --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Acceasți aplicații ascunse minimizate în tava sistem +Name[ro_RO]=Zonă de notificare diff --git a/lxqt-panel/plugin-tray/translations/tray_ru.desktop b/lxqt-panel/plugin-tray/translations/tray_ru.desktop new file mode 100644 index 0000000..a33a7a8 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Значки программ, свернутых в системный лоток. +Name[ru]=Системный лоток \ No newline at end of file diff --git a/lxqt-panel/plugin-tray/translations/tray_ru_RU.desktop b/lxqt-panel/plugin-tray/translations/tray_ru_RU.desktop new file mode 100644 index 0000000..a01f6d3 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Значки программ, свернутых в системный лоток. +Name[ru_RU]=Системный лоток \ No newline at end of file diff --git a/lxqt-panel/plugin-tray/translations/tray_sk.desktop b/lxqt-panel/plugin-tray/translations/tray_sk.desktop new file mode 100644 index 0000000..93483bf --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sk]=Prístup k skrytým aplikáciám minimalizovaným v oznamovacej oblasti +Name[sk]=Oznamovacia oblasť diff --git a/lxqt-panel/plugin-tray/translations/tray_sl.desktop b/lxqt-panel/plugin-tray/translations/tray_sl.desktop new file mode 100644 index 0000000..3ac7521 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sl.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sl]=Dostopajte do programov pomanjšanih v sistemsko vrstico +Name[sl]=Sistemska vrstica diff --git a/lxqt-panel/plugin-tray/translations/tray_sr.desktop b/lxqt-panel/plugin-tray/translations/tray_sr.desktop new file mode 100644 index 0000000..58bc455 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr]=Приступ скривеним програмима минимизованим у системску касету +Name[sr]=Системска касета diff --git a/lxqt-panel/plugin-tray/translations/tray_sr@ijekavian.desktop b/lxqt-panel/plugin-tray/translations/tray_sr@ijekavian.desktop new file mode 100644 index 0000000..1dc3a5c --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sr@ijekavian.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavian]=Системска касета +Comment[sr@ijekavian]=Приступ скривеним програмима минимизованим у системску касету diff --git a/lxqt-panel/plugin-tray/translations/tray_sr@ijekavianlatin.desktop b/lxqt-panel/plugin-tray/translations/tray_sr@ijekavianlatin.desktop new file mode 100644 index 0000000..cad4967 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sr@ijekavianlatin.desktop @@ -0,0 +1,2 @@ +Name[sr@ijekavianlatin]=Sistemska kaseta +Comment[sr@ijekavianlatin]=Pristup skrivenim programima minimizovanim u sistemsku kasetu diff --git a/lxqt-panel/plugin-tray/translations/tray_sr@latin.desktop b/lxqt-panel/plugin-tray/translations/tray_sr@latin.desktop new file mode 100644 index 0000000..ffe4618 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_sr@latin.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[sr@latin]=Pristup skrivenim programima minimizovanim u sistemsku kasetu +Name[sr@latin]=Sistemska kaseta diff --git a/lxqt-panel/plugin-tray/translations/tray_th_TH.desktop b/lxqt-panel/plugin-tray/translations/tray_th_TH.desktop new file mode 100644 index 0000000..af63f22 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=เข้าใช้งานโปรแกรมที่ย่อเก็บอยู่ในถาดระบบ +Name[th_TH]=ถาดระบบ diff --git a/lxqt-panel/plugin-tray/translations/tray_tr.desktop b/lxqt-panel/plugin-tray/translations/tray_tr.desktop new file mode 100644 index 0000000..b4f8019 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_tr.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[tr]=Sistem çekmecesinde gizli uygulamalara erişin +Name[tr]=Sistem çekmecesi diff --git a/lxqt-panel/plugin-tray/translations/tray_uk.desktop b/lxqt-panel/plugin-tray/translations/tray_uk.desktop new file mode 100644 index 0000000..9eff55f --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Показує програми, згорнуті до системного лотка. +Name[uk]=Системний лоток diff --git a/lxqt-panel/plugin-tray/translations/tray_zh_CN.GB2312.desktop b/lxqt-panel/plugin-tray/translations/tray_zh_CN.GB2312.desktop new file mode 100644 index 0000000..4863c5c --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_zh_CN.GB2312.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Access hidden applications minimized in the system tray + +#TRANSLATIONS_DIR=../translations + + +# Translations diff --git a/lxqt-panel/plugin-tray/translations/tray_zh_CN.desktop b/lxqt-panel/plugin-tray/translations/tray_zh_CN.desktop new file mode 100644 index 0000000..e4158b3 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=访问最小化到系统托盘的隐藏程序 +Name[zh_CN]=系统托盘 diff --git a/lxqt-panel/plugin-tray/translations/tray_zh_TW.desktop b/lxqt-panel/plugin-tray/translations/tray_zh_TW.desktop new file mode 100644 index 0000000..c8d5a76 --- /dev/null +++ b/lxqt-panel/plugin-tray/translations/tray_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=System tray +Comment=Display applications minimized to the system tray. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=讀取縮小在系統列的隱藏程式 +Name[zh_TW]=系統列 diff --git a/lxqt-panel/plugin-tray/trayicon.cpp b/lxqt-panel/plugin-tray/trayicon.cpp new file mode 100644 index 0000000..157fc17 --- /dev/null +++ b/lxqt-panel/plugin-tray/trayicon.cpp @@ -0,0 +1,365 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +// Warning: order of those include is important. +#include +#include +#include +#include +#include +#include + +#include "../panel/lxqtpanel.h" +#include "trayicon.h" +#include "xfitman.h" + +#include +#include +#include +#include +#include + +#define XEMBED_EMBEDDED_NOTIFY 0 + + +static bool xError; + +/************************************************ + +************************************************/ +int windowErrorHandler(Display *d, XErrorEvent *e) +{ + xError = true; + if (e->error_code != BadWindow) { + char str[1024]; + XGetErrorText(d, e->error_code, str, 1024); + qWarning() << "Error handler" << e->error_code + << str; + } + return 0; +} + + +/************************************************ + + ************************************************/ +TrayIcon::TrayIcon(Window iconId, QWidget* parent): + QFrame(parent), + mIconId(iconId), + mWindowId(0), + mIconSize(TRAY_ICON_SIZE_DEFAULT, TRAY_ICON_SIZE_DEFAULT), + mDamage(0), + mDisplay(QX11Info::display()) +{ + // NOTE: + // it's a good idea to save the return value of QX11Info::display(). + // In Qt 5, this API is slower and has some limitations which can trigger crashes. + // The XDisplay value is actally stored in QScreen object of the primary screen rather than + // in a global variable. So when the parimary QScreen is being deleted and becomes invalid, + // QX11Info::display() will fail and cause crash. Storing this value improves the efficiency and + // also prevent potential crashes caused by this bug. + + setObjectName("TrayIcon"); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mValid = init(); +} + + + +/************************************************ + + ************************************************/ +bool TrayIcon::init() +{ + Display* dsp = mDisplay; + + XWindowAttributes attr; + if (! XGetWindowAttributes(dsp, mIconId, &attr)) return false; + +// qDebug() << "New tray icon ***********************************"; +// qDebug() << " * window id: " << hex << mIconId; +// qDebug() << " * window name:" << xfitMan().getName(mIconId); +// qDebug() << " * size (WxH): " << attr.width << "x" << attr.height; +// qDebug() << " * color depth:" << attr.depth; + + unsigned long mask = 0; + XSetWindowAttributes set_attr; + + Visual* visual = attr.visual; + set_attr.colormap = attr.colormap; + set_attr.background_pixel = 0; + set_attr.border_pixel = 0; + mask = CWColormap|CWBackPixel|CWBorderPixel; + + mWindowId = XCreateWindow(dsp, this->winId(), 0, 0, mIconSize.width(), mIconSize.height(), + 0, attr.depth, InputOutput, visual, mask, &set_attr); + + + xError = false; + XErrorHandler old; + old = XSetErrorHandler(windowErrorHandler); + XReparentWindow(dsp, mIconId, mWindowId, 0, 0); + XSync(dsp, false); + XSetErrorHandler(old); + + if (xError) + { + qWarning() << "****************************************"; + qWarning() << "* Not icon_swallow *"; + qWarning() << "****************************************"; + XDestroyWindow(dsp, mWindowId); + return false; + } + + + { + Atom acttype; + int actfmt; + unsigned long nbitem, bytes; + unsigned char *data = 0; + int ret; + + ret = XGetWindowProperty(dsp, mIconId, xfitMan().atom("_XEMBED_INFO"), + 0, 2, false, xfitMan().atom("_XEMBED_INFO"), + &acttype, &actfmt, &nbitem, &bytes, &data); + if (ret == Success) + { + if (data) + XFree(data); + } + else + { + qWarning() << "TrayIcon: xembed error"; + XDestroyWindow(dsp, mWindowId); + return false; + } + } + + { + XEvent e; + e.xclient.type = ClientMessage; + e.xclient.serial = 0; + e.xclient.send_event = True; + e.xclient.message_type = xfitMan().atom("_XEMBED"); + e.xclient.window = mIconId; + e.xclient.format = 32; + e.xclient.data.l[0] = CurrentTime; + e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY; + e.xclient.data.l[2] = 0; + e.xclient.data.l[3] = mWindowId; + e.xclient.data.l[4] = 0; + XSendEvent(dsp, mIconId, false, 0xFFFFFF, &e); + } + + XSelectInput(dsp, mIconId, StructureNotifyMask); + mDamage = XDamageCreate(dsp, mIconId, XDamageReportRawRectangles); + XCompositeRedirectWindow(dsp, mWindowId, CompositeRedirectManual); + + XMapWindow(dsp, mIconId); + XMapRaised(dsp, mWindowId); + + XResizeWindow(dsp, mWindowId, mIconSize.width(), mIconSize.height()); + XResizeWindow(dsp, mIconId, mIconSize.width(), mIconSize.height()); + + return true; +} + + +/************************************************ + + ************************************************/ +TrayIcon::~TrayIcon() +{ + Display* dsp = mDisplay; + XSelectInput(dsp, mIconId, NoEventMask); + + if (mDamage) + XDamageDestroy(dsp, mDamage); + + // reparent to root + xError = false; + XErrorHandler old = XSetErrorHandler(windowErrorHandler); + + XUnmapWindow(dsp, mIconId); + XReparentWindow(dsp, mIconId, QX11Info::appRootWindow(), 0, 0); + + XDestroyWindow(dsp, mWindowId); + XSync(dsp, False); + XSetErrorHandler(old); +} + + +/************************************************ + + ************************************************/ +QSize TrayIcon::sizeHint() const +{ + QMargins margins = contentsMargins(); + return QSize(margins.left() + mIconSize.width() + margins.right(), + margins.top() + mIconSize.height() + margins.bottom() + ); +} + + +/************************************************ + + ************************************************/ +void TrayIcon::setIconSize(QSize iconSize) +{ + mIconSize = iconSize; + + if (mWindowId) + xfitMan().resizeWindow(mWindowId, mIconSize.width(), mIconSize.height()); + + if (mIconId) + xfitMan().resizeWindow(mIconId, mIconSize.width(), mIconSize.height()); +} + + +/************************************************ + + ************************************************/ +bool TrayIcon::event(QEvent *event) +{ + switch (event->type()) + { + case QEvent::Paint: + draw(static_cast(event)); + break; + + case QEvent::Resize: + { + QRect rect = iconGeometry(); + xfitMan().moveWindow(mWindowId, rect.left(), rect.top()); + } + break; + + case QEvent::MouseButtonPress: + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonDblClick: + event->accept(); + break; + + default: + break; + } + + return QFrame::event(event); +} + + +/************************************************ + + ************************************************/ +QRect TrayIcon::iconGeometry() +{ + QRect res = QRect(QPoint(0, 0), mIconSize); + + res.moveCenter(QRect(0, 0, width(), height()).center()); + return res; +} + + +/************************************************ + + ************************************************/ +void TrayIcon::draw(QPaintEvent* /*event*/) +{ + Display* dsp = mDisplay; + + XWindowAttributes attr; + if (!XGetWindowAttributes(dsp, mIconId, &attr)) + { + qWarning() << "Paint error"; + return; + } + + QImage image; + XImage* ximage = XGetImage(dsp, mIconId, 0, 0, attr.width, attr.height, AllPlanes, ZPixmap); + if(ximage) + { + image = QImage((const uchar*) ximage->data, ximage->width, ximage->height, ximage->bytes_per_line, QImage::Format_ARGB32_Premultiplied); + } + else + { + qWarning() << " * Error image is NULL"; + + XClearArea(mDisplay, (Window)winId(), 0, 0, attr.width, attr.height, False); + // for some unknown reason, XGetImage failed. try another less efficient method. + // QPixmap::grabWindow uses XCopyArea() internally. + image = QPixmap::grabWindow(mIconId).toImage(); + } + +// qDebug() << "Paint icon **************************************"; +// qDebug() << " * XComposite: " << isXCompositeAvailable(); +// qDebug() << " * Icon geometry:" << iconGeometry(); +// qDebug() << " Icon"; +// qDebug() << " * window id: " << hex << mIconId; +// qDebug() << " * window name:" << xfitMan().getName(mIconId); +// qDebug() << " * size (WxH): " << attr.width << "x" << attr.height; +// qDebug() << " * pos (XxY): " << attr.x << attr.y; +// qDebug() << " * color depth:" << attr.depth; +// qDebug() << " XImage"; +// qDebug() << " * size (WxH): " << ximage->width << "x" << ximage->height; +// switch (ximage->format) +// { +// case XYBitmap: qDebug() << " * format: XYBitmap"; break; +// case XYPixmap: qDebug() << " * format: XYPixmap"; break; +// case ZPixmap: qDebug() << " * format: ZPixmap"; break; +// } +// qDebug() << " * color depth: " << ximage->depth; +// qDebug() << " * bits per pixel:" << ximage->bits_per_pixel; + + // Draw QImage ........................... + QPainter painter(this); + QRect iconRect = iconGeometry(); + if (image.size() != iconRect.size()) + { + image = image.scaled(iconRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + QRect r = image.rect(); + r.moveCenter(iconRect.center()); + iconRect = r; + } +// qDebug() << " Draw rect:" << iconRect; + + painter.drawImage(iconRect, image); + + if(ximage) + XDestroyImage(ximage); +// debug << "End paint icon **********************************"; +} + + +/************************************************ + + ************************************************/ +bool TrayIcon::isXCompositeAvailable() +{ + int eventBase, errorBase; + return XCompositeQueryExtension(QX11Info::display(), &eventBase, &errorBase ); +} diff --git a/lxqt-panel/plugin-tray/trayicon.h b/lxqt-panel/plugin-tray/trayicon.h new file mode 100644 index 0000000..7e8c413 --- /dev/null +++ b/lxqt-panel/plugin-tray/trayicon.h @@ -0,0 +1,80 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef TRAYICON_H +#define TRAYICON_H + +#include +#include +#include + +#include +#include + +#define TRAY_ICON_SIZE_DEFAULT 24 + +class QWidget; +class LxQtPanel; + +class TrayIcon: public QFrame +{ + Q_OBJECT + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) + +public: + TrayIcon(Window iconId, QWidget* parent); + virtual ~TrayIcon(); + + Window iconId() { return mIconId; } + Window windowId() { return mWindowId; } + + bool isValid() const { return mValid; } + + QSize iconSize() const { return mIconSize; } + void setIconSize(QSize iconSize); + + QSize sizeHint() const; + +protected: + bool event(QEvent *event); + void draw(QPaintEvent* event); + +private: + bool init(); + QRect iconGeometry(); + Window mIconId; + Window mWindowId; + bool mValid; + QSize mIconSize; + Damage mDamage; + Display* mDisplay; + + static bool isXCompositeAvailable(); +}; + +#endif // TRAYICON_H diff --git a/lxqt-panel/plugin-tray/xfitman.cpp b/lxqt-panel/plugin-tray/xfitman.cpp new file mode 100644 index 0000000..af66264 --- /dev/null +++ b/lxqt-panel/plugin-tray/xfitman.cpp @@ -0,0 +1,334 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Christopher "VdoP" Regali + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +// #include +// #include +// #include +// #include + +#include +#include + +#include "xfitman.h" +#include +#include +#include + +/** + * @file xfitman.cpp + * @brief implements class Xfitman + * @author Christopher "VdoP" Regali + */ + +/* + S ome requests from Cli*ents include type of the Client, for example the _NET_ACTIVE_WINDOW + message. Currently the types can be 1 for normal applications, and 2 for pagers. + See http://standards.freedesktop.org/wm-spec/latest/ar01s09.html#sourceindication + */ +#define SOURCE_NORMAL 1 +#define SOURCE_PAGER 2 + +const XfitMan& xfitMan() +{ + static XfitMan instance; + return instance; +} + +/** + * @brief constructor: gets Display vars and registers us + */ +XfitMan::XfitMan() +{ + root = (Window)QX11Info::appRootWindow(); +} + +Atom XfitMan::atom(const char* atomName) +{ + static QHash hash; + if (hash.contains(atomName)) + return hash.value(atomName); + Atom atom = XInternAtom(QX11Info::display(), atomName, false); + hash[atomName] = atom; + return atom; +} + +/** + * @brief moves a window to a new position + */ + +void XfitMan::moveWindow(Window _win, int _x, int _y) const +{ + XMoveWindow(QX11Info::display(), _win, _x, _y); +} + +/************************************************ + + ************************************************/ +bool XfitMan::getWindowProperty(Window window, + Atom atom, // property + Atom reqType, // req_type + unsigned long* resultLen,// nitems_return + unsigned char** result // prop_return + ) const +{ + int format; + unsigned long type, rest; + return XGetWindowProperty(QX11Info::display(), window, atom, 0, 4096, false, + reqType, &type, &format, resultLen, &rest, + result) == Success; +} + + +/************************************************ + + ************************************************/ +bool XfitMan::getRootWindowProperty(Atom atom, // property + Atom reqType, // req_type + unsigned long* resultLen,// nitems_return + unsigned char** result // prop_return + ) const +{ + return getWindowProperty(root, atom, reqType, resultLen, result); +} + +/** + * @brief resizes a window to the given dimensions + */ +void XfitMan::resizeWindow(Window _wid, int _width, int _height) const +{ + XResizeWindow(QX11Info::display(), _wid, _width, _height); +} + +/** + * @brief gets a windowpixmap from a window + */ +bool XfitMan::getClientIcon(Window _wid, QPixmap& _pixreturn) const +{ + int format; + ulong type, nitems, extra; + ulong* data = 0; + + XGetWindowProperty(QX11Info::display(), _wid, atom("_NET_WM_ICON"), + 0, LONG_MAX, False, AnyPropertyType, + &type, &format, &nitems, &extra, + (uchar**)&data); + if (!data) + { + return false; + } + + QImage img (data[0], data[1], QImage::Format_ARGB32); + for (int i=0; iaddPixmap(QPixmap::fromImage(img)); + } + + XFree(data); + return true; +} + +/** + * @brief destructor + */ +XfitMan::~XfitMan() +{ +} + +/** + * @brief returns a windowname and sets _nameSource to the finally used Atom + */ +// i got the idea for this from taskbar-plugin of LXPanel - so credits fly out :) +QString XfitMan::getWindowTitle(Window _wid) const +{ + QString name = ""; + //first try the modern net-wm ones + unsigned long length; + unsigned char *data = NULL; + Atom utf8Atom = atom("UTF8_STRING"); + + if (getWindowProperty(_wid, atom("_NET_WM_VISIBLE_NAME"), utf8Atom, &length, &data)) + { + name = QString::fromUtf8((char*) data); + XFree(data); + + } + + if (name.isEmpty()) + { + if (getWindowProperty(_wid, atom("_NET_WM_NAME"), utf8Atom, &length, &data)) + { + name = QString::fromUtf8((char*) data); + XFree(data); + } + } + + if (name.isEmpty()) + { + if (getWindowProperty(_wid, atom("XA_WM_NAME"), XA_STRING, &length, &data)) + { + name = (char*) data; + XFree(data); + } + } + + if (name.isEmpty()) + { + Status ok = XFetchName(QX11Info::display(), _wid, (char**) &data); + name = QString((char*) data); + if (0 != ok) XFree(data); + } + + if (name.isEmpty()) + { + XTextProperty prop; + if (XGetWMName(QX11Info::display(), _wid, &prop)) + { + name = QString::fromUtf8((char*) prop.value); + XFree(prop.value); + } + } + + return name; +} + +QString XfitMan::getApplicationName(Window _wid) const +{ + XClassHint hint; + QString ret; + + if (XGetClassHint(QX11Info::display(), _wid, &hint)) + { + if (hint.res_name) + { + ret = hint.res_name; + XFree(hint.res_name); + } + if (hint.res_class) + { + XFree(hint.res_class); + } + } + + return ret; +} + +/** + * @brief sends a clientmessage to a window + */ +int XfitMan::clientMessage(Window _wid, Atom _msg, + unsigned long data0, + unsigned long data1, + unsigned long data2, + unsigned long data3, + unsigned long data4) const +{ + XClientMessageEvent msg; + msg.window = _wid; + msg.type = ClientMessage; + msg.message_type = _msg; + msg.send_event = true; + msg.display = QX11Info::display(); + msg.format = 32; + msg.data.l[0] = data0; + msg.data.l[1] = data1; + msg.data.l[2] = data2; + msg.data.l[3] = data3; + msg.data.l[4] = data4; + if (XSendEvent(QX11Info::display(), root, false, (SubstructureRedirectMask | SubstructureNotifyMask) , (XEvent *) &msg) == Success) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +} + +/** + * @brief raises windows _wid + */ +void XfitMan::raiseWindow(Window _wid) const +{ + clientMessage(_wid, atom("_NET_ACTIVE_WINDOW"), + SOURCE_PAGER); +} + +/************************************************ + + ************************************************/ +void XfitMan::closeWindow(Window _wid) const +{ + clientMessage(_wid, atom("_NET_CLOSE_WINDOW"), + 0, // Timestamp + SOURCE_PAGER); +} + +void XfitMan::setIconGeometry(Window _wid, QRect* rect) const +{ + Atom net_wm_icon_geometry = atom("_NET_WM_ICON_GEOMETRY"); + if(!rect) + XDeleteProperty(QX11Info::display(), _wid, net_wm_icon_geometry); + else + { + long data[4]; + data[0] = rect->x(); + data[1] = rect->y(); + data[2] = rect->width(); + data[3] = rect->height(); + XChangeProperty(QX11Info::display(), _wid, net_wm_icon_geometry, + XA_CARDINAL, 32, PropModeReplace, (unsigned char*)data, 4); + } +} diff --git a/lxqt-panel/plugin-tray/xfitman.h b/lxqt-panel/plugin-tray/xfitman.h new file mode 100644 index 0000000..4b837d1 --- /dev/null +++ b/lxqt-panel/plugin-tray/xfitman.h @@ -0,0 +1,96 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Christopher "VdoP" Regali + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTXFITMAN_H +#define LXQTXFITMAN_H + +#include + +/** + * @file xfitman.h + * @author Christopher "VdoP" Regali + * @brief handles all of our xlib-calls. + */ + +/** + * @brief manages the Xlib apicalls + */ +class XfitMan +{ +public: + XfitMan(); + ~XfitMan(); + + static Atom atom(const char* atomName); + + void moveWindow(Window _win, int _x, int _y) const; + void raiseWindow(Window _wid) const; + void resizeWindow(Window _wid, int _width, int _height) const; + void closeWindow(Window _wid) const; + + bool getClientIcon(Window _wid, QPixmap& _pixreturn) const; + bool getClientIcon(Window _wid, QIcon *icon) const; + void setIconGeometry(Window _wid, QRect* rect = 0) const; + + QString getWindowTitle(Window _wid) const; + QString getApplicationName(Window _wid) const; + + int clientMessage(Window _wid, Atom _msg, + long unsigned int data0, + long unsigned int data1 = 0, + long unsigned int data2 = 0, + long unsigned int data3 = 0, + long unsigned int data4 = 0) const; + +private: + + /** \warning Do not forget to XFree(result) after data are processed! + */ + bool getWindowProperty(Window window, + Atom atom, // property + Atom reqType, // req_type + unsigned long* resultLen,// nitems_return + unsigned char** result // prop_return + ) const; + + /** \warning Do not forget to XFree(result) after data are processed! + */ + bool getRootWindowProperty(Atom atom, // property + Atom reqType, // req_type + unsigned long* resultLen,// nitems_return + unsigned char** result // prop_return + ) const; + + + Window root; //the actual root window on the used screen +}; + + +const XfitMan& xfitMan(); + +#endif // LXQTXFITMAN_H diff --git a/lxqt-panel/plugin-volume/CMakeLists.txt b/lxqt-panel/plugin-volume/CMakeLists.txt new file mode 100644 index 0000000..55457b1 --- /dev/null +++ b/lxqt-panel/plugin-volume/CMakeLists.txt @@ -0,0 +1,50 @@ +set(PLUGIN "volume") + +set(HEADERS + lxqtvolume.h + volumebutton.h + volumepopup.h + audiodevice.h + lxqtvolumeconfiguration.h + audioengine.h +) + +set(SOURCES + ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.cpp + lxqtvolume.cpp + volumebutton.cpp + volumepopup.cpp + audiodevice.cpp + lxqtvolumeconfiguration.cpp + audioengine.cpp + ossengine.cpp +) + +set(UIS + lxqtvolumeconfiguration.ui +) + +set(LIBRARIES + ${LIBRARIES} + lxqt-globalkeys + Qt5Xdg +) + +if(PULSEAUDIO_FOUND) + add_definitions(-DUSE_PULSEAUDIO) + include_directories(${PULSEAUDIO_INCLUDE_DIR}) + set(HEADERS ${HEADERS} pulseaudioengine.h) + set(SOURCES ${SOURCES} pulseaudioengine.cpp) + set(MOCS ${MOCS} pulseaudioengine.h) + set(LIBRARIES ${LIBRARIES} ${PULSEAUDIO_LIBRARY}) +endif() + +if(ALSA_FOUND) + add_definitions(-DUSE_ALSA) + set(HEADERS ${HEADERS} alsaengine.h alsadevice.h) + set(SOURCES ${SOURCES} alsaengine.cpp alsadevice.cpp) + set(MOCS ${MOCS} alsaengine.h alsadevice.h) + set(LIBRARIES ${LIBRARIES} ${ALSA_LIBRARIES}) +endif() + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-volume/alsadevice.cpp b/lxqt-panel/plugin-volume/alsadevice.cpp new file mode 100644 index 0000000..3e049a9 --- /dev/null +++ b/lxqt-panel/plugin-volume/alsadevice.cpp @@ -0,0 +1,62 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "alsadevice.h" + +AlsaDevice::AlsaDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent) : + AudioDevice(t, engine, parent), + m_mixer(0), + m_elem(0) +{ +} + +void AlsaDevice::setMixer(snd_mixer_t *mixer) +{ + if (m_mixer == mixer) + return; + + m_mixer = mixer; + emit mixerChanged(); +} + +void AlsaDevice::setElement(snd_mixer_elem_t *elem) +{ + if (m_elem == elem) + return; + + m_elem = elem; + emit elementChanged(); +} + +void AlsaDevice::setCardName(const QString &cardName) +{ + if (m_cardName == cardName) + return; + + m_cardName = cardName; + emit cardNameChanged(); +} diff --git a/lxqt-panel/plugin-volume/alsadevice.h b/lxqt-panel/plugin-volume/alsadevice.h new file mode 100644 index 0000000..c2a9440 --- /dev/null +++ b/lxqt-panel/plugin-volume/alsadevice.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef ALSADEVICE_H +#define ALSADEVICE_H + +#include "audiodevice.h" + +#include + +#include +#include + +class AlsaDevice : public AudioDevice +{ + Q_OBJECT + +public: + AlsaDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent = 0); + + snd_mixer_t *mixer() const { return m_mixer; } + snd_mixer_elem_t *element() const { return m_elem; } + const QString &cardName() const { return m_cardName; } + + void setMixer(snd_mixer_t *mixer); + void setElement(snd_mixer_elem_t *elem); + void setCardName(const QString &cardName); + +signals: + void mixerChanged(); + void elementChanged(); + void cardNameChanged(); + +private: + snd_mixer_t *m_mixer; + snd_mixer_elem_t *m_elem; + QString m_cardName; +}; + +#endif // ALSADEVICE_H diff --git a/lxqt-panel/plugin-volume/alsaengine.cpp b/lxqt-panel/plugin-volume/alsaengine.cpp new file mode 100644 index 0000000..026479f --- /dev/null +++ b/lxqt-panel/plugin-volume/alsaengine.cpp @@ -0,0 +1,220 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "alsaengine.h" + +#include "alsadevice.h" + +#include +#include +#include + +AlsaEngine *AlsaEngine::m_instance = 0; + +static int alsa_elem_event_callback(snd_mixer_elem_t *elem, unsigned int mask) +{ + AlsaEngine *engine = AlsaEngine::instance(); + if (engine) + engine->updateDevice(engine->getDeviceByAlsaElem(elem)); + + return 0; +} + +static int alsa_mixer_event_callback(snd_mixer_t *mixer, unsigned int mask, snd_mixer_elem_t *elem) +{ + return 0; +} + +AlsaEngine::AlsaEngine(QObject *parent) : + AudioEngine(parent) +{ + discoverDevices(); + m_instance = this; +} + +AlsaEngine *AlsaEngine::instance() +{ + return m_instance; +} + +int AlsaEngine::volumeMax(AudioDevice *device) const +{ + // We already did snd_mixer_selem_set_playback_volume_range(mixerElem, 0, 100); + // during initialization. So we can return 100 directly here. + return 100; +} + +AlsaDevice *AlsaEngine::getDeviceByAlsaElem(snd_mixer_elem_t *elem) const +{ + foreach (AudioDevice *device, m_sinks) { + AlsaDevice *dev = qobject_cast(device); + if (!dev || !dev->element()) + continue; + + if (dev->element() == elem) + return dev; + } + + return 0; +} + +void AlsaEngine::commitDeviceVolume(AudioDevice *device) +{ + AlsaDevice *dev = qobject_cast(device); + if (!dev || !dev->element()) + return; + + long value = dev->volume(); + snd_mixer_selem_set_playback_volume_all(dev->element(), value); +} + +void AlsaEngine::setMute(AudioDevice *device, bool state) +{ + AlsaDevice *dev = qobject_cast(device); + if (!dev || !dev->element()) + return; + + if (snd_mixer_selem_has_playback_switch(dev->element())) + snd_mixer_selem_set_playback_switch_all(dev->element(), (int)!state); + else if (state) + dev->setVolume(0); +} + +void AlsaEngine::updateDevice(AlsaDevice *device) +{ + if (!device) + return; + + long value; + snd_mixer_selem_get_playback_volume(device->element(), (snd_mixer_selem_channel_id_t)0, &value); + // qDebug() << "updateDevice:" << device->name() << value; + device->setVolumeNoCommit(value); + + if (snd_mixer_selem_has_playback_switch(device->element())) { + int mute; + snd_mixer_selem_get_playback_switch(device->element(), (snd_mixer_selem_channel_id_t)0, &mute); + device->setMuteNoCommit(!(bool)mute); + } +} + +void AlsaEngine::driveAlsaEventHandling(int fd) +{ + snd_mixer_handle_events(m_mixerMap.value(fd)); +} + +void AlsaEngine::discoverDevices() +{ + int error; + int cardNum = -1; + + while (1) { + error = snd_card_next(&cardNum); + + if (cardNum < 0) + break; + + char str[64]; + sprintf(str, "hw:%i", cardNum); + + snd_ctl_t *cardHandle; + if ((error = snd_ctl_open(&cardHandle, str, 0)) < 0) { + qWarning("Can't open card %i: %s\n", cardNum, snd_strerror(error)); + continue; + } + + snd_ctl_card_info_t *cardInfo; + snd_ctl_card_info_alloca(&cardInfo); + + QString cardName = QString::fromLatin1(snd_ctl_card_info_get_name(cardInfo)); + if (cardName.isEmpty()) + cardName = QString::fromLatin1(str); + + if ((error = snd_ctl_card_info(cardHandle, cardInfo)) < 0) { + qWarning("Can't get info for card %i: %s\n", cardNum, snd_strerror(error)); + } else { + // setup mixer and iterate over channels + snd_mixer_t *mixer = 0; + snd_mixer_open(&mixer, 0); + snd_mixer_attach(mixer, str); + snd_mixer_selem_register(mixer, NULL, NULL); + snd_mixer_load(mixer); + + // setup event handler for mixer + snd_mixer_set_callback(mixer, alsa_mixer_event_callback); + + // setup eventloop handling + struct pollfd pfd; + if (snd_mixer_poll_descriptors(mixer, &pfd, 1)) { + QSocketNotifier *notifier = new QSocketNotifier(pfd.fd, QSocketNotifier::Read, this); + connect(notifier, SIGNAL(activated(int)), this, SLOT(driveAlsaEventHandling(int))); + m_mixerMap.insert(pfd.fd, mixer); + } + + snd_mixer_elem_t *mixerElem = 0; + mixerElem = snd_mixer_first_elem(mixer); + + while (mixerElem) { + // check if we have a Sink or Source + if (snd_mixer_selem_has_playback_volume(mixerElem)) { + AlsaDevice *dev = new AlsaDevice(Sink, this, this); + dev->setName(QString::fromLatin1(snd_mixer_selem_get_name(mixerElem))); + dev->setIndex(cardNum); + dev->setDescription(cardName + " - " + dev->name()); + + // set alsa specific members + dev->setCardName(QString::fromLatin1(str)); + dev->setMixer(mixer); + dev->setElement(mixerElem); + + // set the range of volume to 0-100 + snd_mixer_selem_set_playback_volume_range(mixerElem, 0, 100); + long value; + snd_mixer_selem_get_playback_volume(mixerElem, (snd_mixer_selem_channel_id_t)0, &value); + // qDebug() << dev->name() << "initial volume" << value; + dev->setVolumeNoCommit(value); + + if (snd_mixer_selem_has_playback_switch(mixerElem)) { + int mute; + snd_mixer_selem_get_playback_switch(mixerElem, (snd_mixer_selem_channel_id_t)0, &mute); + dev->setMuteNoCommit(!(bool)mute); + } + + // register event callback + snd_mixer_elem_set_callback(mixerElem, alsa_elem_event_callback); + + m_sinks.append(dev); + } + + mixerElem = snd_mixer_elem_next(mixerElem); + } + } + + snd_ctl_close(cardHandle); + } + + snd_config_update_free_global(); +} diff --git a/lxqt-panel/plugin-volume/alsaengine.h b/lxqt-panel/plugin-volume/alsaengine.h new file mode 100644 index 0000000..0bfeb79 --- /dev/null +++ b/lxqt-panel/plugin-volume/alsaengine.h @@ -0,0 +1,70 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef ALSAENGINE_H +#define ALSAENGINE_H + +#include "audioengine.h" + +#include +#include +#include +#include + +#include + +class AlsaDevice; +class QSocketNotifier; + +class AlsaEngine : public AudioEngine +{ + Q_OBJECT + +public: + AlsaEngine(QObject *parent = 0); + static AlsaEngine *instance(); + + virtual const QString backendName() const { return QLatin1String("Alsa"); } + + int volumeMax(AudioDevice *device) const; + AlsaDevice *getDeviceByAlsaElem(snd_mixer_elem_t *elem) const; + +public slots: + void commitDeviceVolume(AudioDevice *device); + void setMute(AudioDevice *device, bool state); + void updateDevice(AlsaDevice *device); + +private slots: + void driveAlsaEventHandling(int fd); + +private: + void discoverDevices(); + QMap m_mixerMap; + static AlsaEngine *m_instance; +}; + +#endif // ALSAENGINE_H diff --git a/lxqt-panel/plugin-volume/audiodevice.cpp b/lxqt-panel/plugin-volume/audiodevice.cpp new file mode 100644 index 0000000..1882426 --- /dev/null +++ b/lxqt-panel/plugin-volume/audiodevice.cpp @@ -0,0 +1,121 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "audiodevice.h" +#include "audioengine.h" + +AudioDevice::AudioDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent) : + QObject(parent), + m_engine(engine), + m_volume(0), + m_mute(false), + m_type(t), + m_index(0) +{ +} + +AudioDevice::~AudioDevice() +{ +} + +void AudioDevice::setName(const QString &name) +{ + if (m_name == name) + return; + + m_name = name; + emit nameChanged(m_name); +} + +void AudioDevice::setDescription(const QString &description) +{ + if (m_description == description) + return; + + m_description = description; + emit descriptionChanged(m_description); +} + +void AudioDevice::setIndex(uint index) +{ + if (m_index == index) + return; + + m_index = index; + emit indexChanged(index); +} + +// this is just for setting the internal volume +void AudioDevice::setVolumeNoCommit(int volume) +{ + if (m_engine) + volume = m_engine->volumeBounded(volume, this); + + if (m_volume == volume) + return; + + m_volume = volume; + emit volumeChanged(m_volume); +} + +void AudioDevice::toggleMute() +{ + setMute(!m_mute); +} + +void AudioDevice::setMute(bool state) +{ + if (m_mute == state) + return; + + setMuteNoCommit(state); + + if (m_engine) + m_engine->setMute(this, state); +} + +void AudioDevice::setMuteNoCommit(bool state) +{ + if (m_mute == state) + return; + + m_mute = state; + emit muteChanged(m_mute); +} + +// this performs a volume change on the device +void AudioDevice::setVolume(int volume) +{ + if (m_volume == volume) + return; + + setVolumeNoCommit(volume); + setMute(false); + + if (m_engine) + m_engine->commitDeviceVolume(this); +} diff --git a/lxqt-panel/plugin-volume/audiodevice.h b/lxqt-panel/plugin-volume/audiodevice.h new file mode 100644 index 0000000..8b854ae --- /dev/null +++ b/lxqt-panel/plugin-volume/audiodevice.h @@ -0,0 +1,90 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef AUDIODEVICE_H +#define AUDIODEVICE_H + +#include + +class AudioEngine; + +typedef enum AudioDeviceType { + Sink = 0, + Source = 1, + PulseAudioDeviceTypeLength +} AudioDeviceType; + +class AudioDevice : public QObject +{ + Q_OBJECT + Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) + Q_PROPERTY(AudioDeviceType type READ type CONSTANT) + +public: + AudioDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent = 0); + ~AudioDevice(); + + // the volume can range from 0 to 100. + int volume() const { return m_volume; } + bool mute() const { return m_mute; } + AudioDeviceType type() const { return m_type; } + const QString &name() const { return m_name; } + const QString &description() const { return m_description; } + uint index() const { return m_index; } + + void setName(const QString &name); + void setDescription(const QString &description); + void setIndex(uint index); + + AudioEngine* engine() { return m_engine; } + +public slots: + // the volume can range from 0 to 100. + void setVolume(int volume); + void setVolumeNoCommit(int volume); + void toggleMute(); + void setMute(bool state); + void setMuteNoCommit(bool state); + +signals: + void volumeChanged(int volume); + void muteChanged(bool state); + void nameChanged(const QString &name); + void descriptionChanged(const QString &description); + void indexChanged(uint index); + +private: + AudioEngine *m_engine; + int m_volume; // the volume can range from 0 to 100. + bool m_mute; + AudioDeviceType m_type; + QString m_name; + uint m_index; + QString m_description; +}; + +#endif // AUDIODEVICE_H diff --git a/lxqt-panel/plugin-volume/audioengine.cpp b/lxqt-panel/plugin-volume/audioengine.cpp new file mode 100644 index 0000000..6cef716 --- /dev/null +++ b/lxqt-panel/plugin-volume/audioengine.cpp @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "audioengine.h" + +#include "audiodevice.h" + +#include +#include + +AudioEngine::AudioEngine(QObject *parent) : + QObject(parent) +{ +} + +AudioEngine::~AudioEngine() +{ + qDeleteAll(m_sinks); + m_sinks.clear(); +} + +int AudioEngine::volumeBounded(int volume, AudioDevice* device) const +{ + int maximum = volumeMax(device); + double v = ((double) volume / 100.0) * maximum; + double bounded = qBound(0, v, maximum); + return qRound((bounded / maximum) * 100); +} + + +void AudioEngine::mute(AudioDevice *device) +{ + setMute(device, true); +} + +void AudioEngine::unmute(AudioDevice *device) +{ + setMute(device, false); +} + +void AudioEngine::setIgnoreMaxVolume(bool ignore) +{ + Q_UNUSED(ignore) +} diff --git a/lxqt-panel/plugin-volume/audioengine.h b/lxqt-panel/plugin-volume/audioengine.h new file mode 100644 index 0000000..5fb9ea7 --- /dev/null +++ b/lxqt-panel/plugin-volume/audioengine.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef AUDIOENGINE_H +#define AUDIOENGINE_H + +#include +#include +#include + +class AudioDevice; + +class AudioEngine : public QObject +{ + Q_OBJECT + +public: + AudioEngine(QObject *parent = 0); + ~AudioEngine(); + + const QList &sinks() const { return m_sinks; } + virtual int volumeMax(AudioDevice *device) const = 0; + virtual int volumeBounded(int volume, AudioDevice *device) const; + virtual const QString backendName() const = 0; + +public slots: + virtual void commitDeviceVolume(AudioDevice *device) = 0; + virtual void setMute(AudioDevice *device, bool state) = 0; + void mute(AudioDevice *device); + void unmute(AudioDevice *device); + virtual void setIgnoreMaxVolume(bool ignore); + +signals: + void sinkListChanged(); + +protected: + QList m_sinks; +}; + +#endif // AUDIOENGINE_H diff --git a/lxqt-panel/plugin-volume/lxqtvolume.cpp b/lxqt-panel/plugin-volume/lxqtvolume.cpp new file mode 100644 index 0000000..0476c81 --- /dev/null +++ b/lxqt-panel/plugin-volume/lxqtvolume.cpp @@ -0,0 +1,264 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtvolume.h" + +#include "volumebutton.h" +#include "volumepopup.h" +#include "lxqtvolumeconfiguration.h" +#include "audiodevice.h" +#ifdef USE_PULSEAUDIO +#include "pulseaudioengine.h" +#endif +#ifdef USE_ALSA +#include "alsaengine.h" +#endif +#include "ossengine.h" + +#include +#include +#include +#include +#include + +#define DEFAULT_UP_SHORTCUT "XF86AudioRaiseVolume" +#define DEFAULT_DOWN_SHORTCUT "XF86AudioLowerVolume" +#define DEFAULT_MUTE_SHORTCUT "XF86AudioMute" + +LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + m_engine(0), + m_defaultSinkIndex(0), + m_defaultSink(0) +{ + m_volumeButton = new VolumeButton(this); + + m_notification = new LxQt::Notification("", this); + + m_keyVolumeUp = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/up").arg(settings()->group()), tr("Increase sound volume"), this); + if (m_keyVolumeUp) + { + connect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyVolumeUp, SIGNAL(activated()), this, SLOT(handleShortcutVolumeUp())); + } + m_keyVolumeDown = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/down").arg(settings()->group()), tr("Decrease sound volume"), this); + if (m_keyVolumeDown) + { + connect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown())); + } + m_keyMuteToggle = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/mute").arg(settings()->group()), tr("Mute/unmute sound volume"), this); + if (m_keyMuteToggle) + { + connect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute())); + } + + settingsChanged(); +} + +LxQtVolume::~LxQtVolume() +{ + delete m_volumeButton; +} + +void LxQtVolume::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + QString shortcutNotRegistered; + + if (shortcut == m_keyVolumeUp) + { + disconnect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + + if (m_keyVolumeUp->shortcut().isEmpty()) + { + m_keyVolumeUp->changeShortcut(DEFAULT_UP_SHORTCUT); + if (m_keyVolumeUp->shortcut().isEmpty()) + { + shortcutNotRegistered = " '" DEFAULT_UP_SHORTCUT "'"; + } + } + } else if (shortcut == m_keyVolumeDown) + { + disconnect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + + if (m_keyVolumeDown->shortcut().isEmpty()) + { + m_keyVolumeDown->changeShortcut(DEFAULT_DOWN_SHORTCUT); + if (m_keyVolumeDown->shortcut().isEmpty()) + { + shortcutNotRegistered += " '" DEFAULT_DOWN_SHORTCUT "'"; + } + } + } else if (shortcut == m_keyMuteToggle) + { + disconnect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + + if (m_keyMuteToggle->shortcut().isEmpty()) + { + m_keyMuteToggle->changeShortcut(DEFAULT_MUTE_SHORTCUT); + if (m_keyMuteToggle->shortcut().isEmpty()) + { + shortcutNotRegistered += " '" DEFAULT_MUTE_SHORTCUT "'"; + } + } + } + + if(!shortcutNotRegistered.isEmpty()) + { + m_notification->setSummary(tr("Volume Control: The following shortcuts can not be registered: %1").arg(shortcutNotRegistered)); + m_notification->update(); + } + + m_notification->setTimeout(1000); + m_notification->setUrgencyHint(LxQt::Notification::UrgencyLow); +} + +void LxQtVolume::setAudioEngine(AudioEngine *engine) +{ + if (m_engine) { + if (m_engine->backendName() == engine->backendName()) + return; + + m_volumeButton->volumePopup()->setDevice(0); + + disconnect(m_engine, 0, 0, 0); + delete m_engine; + m_engine = 0; + } + + m_engine = engine; + connect(m_engine, SIGNAL(sinkListChanged()), this, SLOT(updateConfigurationSinkList())); + + updateConfigurationSinkList(); +} + + +void LxQtVolume::settingsChanged() +{ + QString engineName = settings()->value(SETTINGS_AUDIO_ENGINE, SETTINGS_DEFAULT_AUDIO_ENGINE).toString(); + qDebug() << "settingsChanged" << engineName; + if (!m_engine || m_engine->backendName() != engineName) { +#if defined(USE_PULSEAUDIO) && defined(USE_ALSA) + if (engineName == QLatin1String("PulseAudio")) + setAudioEngine(new PulseAudioEngine(this)); + else if (engineName == QLatin1String("Alsa")) + setAudioEngine(new AlsaEngine(this)); + else // fallback to OSS + setAudioEngine(new OssEngine(this)); +#elif defined(USE_PULSEAUDIO) + if (engineName == QLatin1String("PulseAudio")) + setAudioEngine(new PulseAudioEngine(this)); + else // fallback to OSS + setAudioEngine(new OssEngine(this)); +#elif defined(USE_ALSA) + if (engineName == QLatin1String("Alsa")) + setAudioEngine(new AlsaEngine(this)); + else // fallback to OSS + setAudioEngine(new OssEngine(this)); +#else + // No other backends are available, fallback to OSS + setAudioEngine(new OssEngine(this)); +#endif + } + + m_volumeButton->setShowOnClicked(settings()->value(SETTINGS_SHOW_ON_LEFTCLICK, SETTINGS_DEFAULT_SHOW_ON_LEFTCLICK).toBool()); + m_volumeButton->setMuteOnMiddleClick(settings()->value(SETTINGS_MUTE_ON_MIDDLECLICK, SETTINGS_DEFAULT_MUTE_ON_MIDDLECLICK).toBool()); + m_volumeButton->setMixerCommand(settings()->value(SETTINGS_MIXER_COMMAND, SETTINGS_DEFAULT_MIXER_COMMAND).toString()); + m_volumeButton->volumePopup()->setSliderStep(settings()->value(SETTINGS_STEP, SETTINGS_DEFAULT_STEP).toInt()); + + m_defaultSinkIndex = settings()->value(SETTINGS_DEVICE, SETTINGS_DEFAULT_DEVICE).toInt(); + if (m_engine && m_engine->sinks().count() > 0) { + m_defaultSinkIndex = qBound(0, m_defaultSinkIndex, m_engine->sinks().count()-1); + + m_defaultSink = m_engine->sinks().at(m_defaultSinkIndex); + m_volumeButton->volumePopup()->setDevice(m_defaultSink); + + m_engine->setIgnoreMaxVolume(settings()->value(SETTINGS_IGNORE_MAX_VOLUME, SETTINGS_DEFAULT_IGNORE_MAX_VOLUME).toBool()); + } +} + +void LxQtVolume::updateConfigurationSinkList() +{ + if (m_engine && m_configDialog) + m_configDialog->setSinkList(m_engine->sinks()); +} + +void LxQtVolume::handleShortcutVolumeUp() +{ + if (m_defaultSink) + { + m_defaultSink->setVolume(m_defaultSink->volume() + settings()->value(SETTINGS_STEP, SETTINGS_DEFAULT_STEP).toInt()); + m_notification->setSummary(tr("Volume: %1").arg(QString::number(m_defaultSink->volume()))); + m_notification->update(); + } +} + +void LxQtVolume::handleShortcutVolumeDown() +{ + if (m_defaultSink) + { + m_defaultSink->setVolume(m_defaultSink->volume() - settings()->value(SETTINGS_STEP, SETTINGS_DEFAULT_STEP).toInt()); + m_notification->setSummary(tr("Volume: %1").arg(QString::number(m_defaultSink->volume()))); + m_notification->update(); + } +} + +void LxQtVolume::handleShortcutVolumeMute() +{ + if (m_defaultSink) + m_defaultSink->toggleMute(); +} + +QWidget *LxQtVolume::widget() +{ + return m_volumeButton; +} + +void LxQtVolume::realign() +{ +} + +QDialog *LxQtVolume::configureDialog() +{ + if(!m_configDialog) + { + m_configDialog = new LxQtVolumeConfiguration(*settings()); + m_configDialog->setAttribute(Qt::WA_DeleteOnClose, true); + + if (m_engine) + m_configDialog->setSinkList(m_engine->sinks()); + } + return m_configDialog; +} + +#undef DEFAULT_UP_SHORTCUT +#undef DEFAULT_DOWN_SHORTCUT +#undef DEFAULT_MUTE_SHORTCUT diff --git a/lxqt-panel/plugin-volume/lxqtvolume.h b/lxqt-panel/plugin-volume/lxqtvolume.h new file mode 100644 index 0000000..56fd869 --- /dev/null +++ b/lxqt-panel/plugin-volume/lxqtvolume.h @@ -0,0 +1,96 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTVOLUME_H +#define LXQTVOLUME_H + +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include + +class VolumeButton; +class AudioEngine; +class AudioDevice; +namespace LxQt { +class Notification; +} +namespace GlobalKeyShortcut +{ +class Action; +} + +class LxQtVolumeConfiguration; + +class LxQtVolume : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtVolume(); + + virtual QWidget *widget(); + virtual QString themeId() const { return "Volume"; } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } + void realign(); + QDialog *configureDialog(); + + void setAudioEngine(AudioEngine *engine); +protected slots: + virtual void settingsChanged(); + void updateConfigurationSinkList(); + void handleShortcutVolumeUp(); + void handleShortcutVolumeDown(); + void handleShortcutVolumeMute(); + void shortcutRegistered(); + +private: + AudioEngine *m_engine; + VolumeButton *m_volumeButton; + int m_defaultSinkIndex; + AudioDevice *m_defaultSink; + GlobalKeyShortcut::Action *m_keyVolumeUp; + GlobalKeyShortcut::Action *m_keyVolumeDown; + GlobalKeyShortcut::Action *m_keyMuteToggle; + LxQt::Notification *m_notification; + QPointer m_configDialog; +}; + + +class LxQtVolumePluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtVolume(startupInfo); + } +}; + +#endif // LXQTVOLUME_H diff --git a/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.cpp b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.cpp new file mode 100644 index 0000000..43120f7 --- /dev/null +++ b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.cpp @@ -0,0 +1,153 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtvolumeconfiguration.h" +#include "ui_lxqtvolumeconfiguration.h" + +#include "audiodevice.h" + +#include +#include + +LxQtVolumeConfiguration::LxQtVolumeConfiguration(QSettings &settings, QWidget *parent) : + LxQtPanelPluginConfigDialog(settings, parent), + ui(new Ui::LxQtVolumeConfiguration) +{ + ui->setupUi(this); + + loadSettings(); + connect(ui->ossRadioButton, SIGNAL(toggled(bool)), this, SLOT(audioEngineChanged(bool))); + connect(ui->devAddedCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(sinkSelectionChanged(int))); + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + connect(ui->showOnClickCheckBox, SIGNAL(toggled(bool)), this, SLOT(showOnClickedChanged(bool))); + connect(ui->muteOnMiddleClickCheckBox, SIGNAL(toggled(bool)), this, SLOT(muteOnMiddleClickChanged(bool))); + connect(ui->mixerLineEdit, SIGNAL(textChanged(QString)), this, SLOT(mixerLineEditChanged(QString))); + connect(ui->stepSpinBox, SIGNAL(valueChanged(int)), this, SLOT(stepSpinBoxChanged(int))); + connect(ui->ignoreMaxVolumeCheckBox, SIGNAL(toggled(bool)), this, SLOT(ignoreMaxVolumeCheckBoxChanged(bool))); + + // currently, this option is only supported by the pulse audio backend + if(!ui->pulseAudioRadioButton->isChecked()) + ui->ignoreMaxVolumeCheckBox->setEnabled(false); + +#ifdef USE_PULSEAUDIO + connect(ui->pulseAudioRadioButton, SIGNAL(toggled(bool)), this, SLOT(audioEngineChanged(bool))); +#else + ui->pulseAudioRadioButton->setVisible(false); +#endif + +#ifdef USE_ALSA + connect(ui->alsaRadioButton, SIGNAL(toggled(bool)), this, SLOT(audioEngineChanged(bool))); +#else + ui->alsaRadioButton->setVisible(false); +#endif +} + +LxQtVolumeConfiguration::~LxQtVolumeConfiguration() +{ + delete ui; +} + +void LxQtVolumeConfiguration::setSinkList(const QList sinks) +{ + // preserve the current index, as we change the list + int tmp_index = settings().value(SETTINGS_DEVICE, SETTINGS_DEFAULT_DEVICE).toInt(); + + ui->devAddedCombo->clear(); + + foreach (const AudioDevice *dev, sinks) { + ui->devAddedCombo->addItem(dev->description(), dev->index()); + } + + ui->devAddedCombo->setCurrentIndex(tmp_index); +} + +void LxQtVolumeConfiguration::audioEngineChanged(bool checked) +{ + if (!checked) + return; + + bool canIgnoreMaxVolume = false; + if (ui->pulseAudioRadioButton->isChecked()) + { + settings().setValue(SETTINGS_AUDIO_ENGINE, "PulseAudio"); + canIgnoreMaxVolume = true; + } + else if(ui->alsaRadioButton->isChecked()) + settings().setValue(SETTINGS_AUDIO_ENGINE, "Alsa"); + else + settings().setValue(SETTINGS_AUDIO_ENGINE, "Oss"); + ui->ignoreMaxVolumeCheckBox->setEnabled(canIgnoreMaxVolume); +} + +void LxQtVolumeConfiguration::sinkSelectionChanged(int index) +{ + settings().setValue(SETTINGS_DEVICE, index >= 0 ? index : 0); +} + +void LxQtVolumeConfiguration::showOnClickedChanged(bool state) +{ + settings().setValue(SETTINGS_SHOW_ON_LEFTCLICK, state); +} + +void LxQtVolumeConfiguration::muteOnMiddleClickChanged(bool state) +{ + settings().setValue(SETTINGS_MUTE_ON_MIDDLECLICK, state); +} + +void LxQtVolumeConfiguration::mixerLineEditChanged(const QString &command) +{ + settings().setValue(SETTINGS_MIXER_COMMAND, command); +} + +void LxQtVolumeConfiguration::stepSpinBoxChanged(int step) +{ + settings().setValue(SETTINGS_STEP, step); +} + +void LxQtVolumeConfiguration::ignoreMaxVolumeCheckBoxChanged(bool state) +{ + settings().setValue(SETTINGS_IGNORE_MAX_VOLUME, state); +} + +void LxQtVolumeConfiguration::loadSettings() +{ + QString engine = settings().value(SETTINGS_AUDIO_ENGINE, SETTINGS_DEFAULT_AUDIO_ENGINE).toString().toLower(); + if (engine == "pulseaudio") + ui->pulseAudioRadioButton->setChecked(true); + else if (engine == "alsa") + ui->alsaRadioButton->setChecked(true); + else + ui->ossRadioButton->setChecked(true); + + setComboboxIndexByData(ui->devAddedCombo, settings().value(SETTINGS_DEVICE, SETTINGS_DEFAULT_DEVICE), 1); + ui->showOnClickCheckBox->setChecked(settings().value(SETTINGS_SHOW_ON_LEFTCLICK, SETTINGS_DEFAULT_SHOW_ON_LEFTCLICK).toBool()); + ui->muteOnMiddleClickCheckBox->setChecked(settings().value(SETTINGS_MUTE_ON_MIDDLECLICK, SETTINGS_DEFAULT_MUTE_ON_MIDDLECLICK).toBool()); + ui->mixerLineEdit->setText(settings().value(SETTINGS_MIXER_COMMAND, SETTINGS_DEFAULT_MIXER_COMMAND).toString()); + ui->stepSpinBox->setValue(settings().value(SETTINGS_STEP, SETTINGS_DEFAULT_STEP).toInt()); + ui->ignoreMaxVolumeCheckBox->setChecked(settings().value(SETTINGS_IGNORE_MAX_VOLUME, SETTINGS_DEFAULT_IGNORE_MAX_VOLUME).toBool()); +} + diff --git a/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.h b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.h new file mode 100644 index 0000000..ab04866 --- /dev/null +++ b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.h @@ -0,0 +1,90 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTVOLUMECONFIGURATION_H +#define LXQTVOLUMECONFIGURATION_H + +#include "../panel/lxqtpanelpluginconfigdialog.h" + +#include + +#define SETTINGS_MIXER_COMMAND "mixerCommand" +#define SETTINGS_SHOW_ON_LEFTCLICK "showOnLeftClick" +#define SETTINGS_MUTE_ON_MIDDLECLICK "showOnMiddleClick" +#define SETTINGS_DEVICE "device" +#define SETTINGS_STEP "volumeAdjustStep" +#define SETTINGS_IGNORE_MAX_VOLUME "ignoreMaxVolume" +#define SETTINGS_AUDIO_ENGINE "audioEngine" + +#define SETTINGS_DEFAULT_SHOW_ON_LEFTCLICK true +#define SETTINGS_DEFAULT_MUTE_ON_MIDDLECLICK true +#define SETTINGS_DEFAULT_DEVICE 0 +#define SETTINGS_DEFAULT_STEP 3 +#ifdef USE_PULSEAUDIO + #define SETTINGS_DEFAULT_MIXER_COMMAND "pavucontrol" + #define SETTINGS_DEFAULT_AUDIO_ENGINE "PulseAudio" +#elif defined(USE_ALSA) + #define SETTINGS_DEFAULT_MIXER_COMMAND "qasmixer" + #define SETTINGS_DEFAULT_AUDIO_ENGINE "Alsa" +#else + #define SETTINGS_DEFAULT_MIXER_COMMAND "" + #define SETTINGS_DEFAULT_AUDIO_ENGINE "Oss" +#endif +#define SETTINGS_DEFAULT_IGNORE_MAX_VOLUME false + +class AudioDevice; + +namespace Ui { + class LxQtVolumeConfiguration; +} + +class LxQtVolumeConfiguration : public LxQtPanelPluginConfigDialog +{ + Q_OBJECT + +public: + explicit LxQtVolumeConfiguration(QSettings &settings, QWidget *parent = 0); + ~LxQtVolumeConfiguration(); + +public slots: + void setSinkList(const QList sinks); + void audioEngineChanged(bool checked); + void sinkSelectionChanged(int index); + void showOnClickedChanged(bool state); + void muteOnMiddleClickChanged(bool state); + void mixerLineEditChanged(const QString &command); + void stepSpinBoxChanged(int step); + void ignoreMaxVolumeCheckBoxChanged(bool state); + +protected slots: + virtual void loadSettings(); + +private: + Ui::LxQtVolumeConfiguration *ui; +}; + +#endif // LXQTVOLUMECONFIGURATION_H diff --git a/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.ui b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.ui new file mode 100644 index 0000000..2c6591b --- /dev/null +++ b/lxqt-panel/plugin-volume/lxqtvolumeconfiguration.ui @@ -0,0 +1,167 @@ + + + LxQtVolumeConfiguration + + + + 0 + 0 + 306 + 407 + + + + Volume Control Settings + + + + + + Device to control + + + + + + + + Alsa + + + + + + + PulseAudio + + + + + + + OSS + + + + + + + + + + + + + + + Behavior + + + + + + Mute on middle click + + + + + + + Show on mouse click + + + + + + + Allow volume beyond 100% (0dB) + + + + + + + + + + 0 + 0 + + + + Volume adjust step + + + + + + + 1 + + + + + + + + + + + + External Mixer + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + LxQtVolumeConfiguration + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttons + rejected() + LxQtVolumeConfiguration + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/lxqt-panel/plugin-volume/ossengine.cpp b/lxqt-panel/plugin-volume/ossengine.cpp new file mode 100644 index 0000000..13b6b9c --- /dev/null +++ b/lxqt-panel/plugin-volume/ossengine.cpp @@ -0,0 +1,127 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2014 LXQt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "ossengine.h" +#include "audiodevice.h" +#include + +#include +#include +#include +#include +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) +#include +#elif defined(__linux__) || defined(__Linux__) +#include +#else +#error "Not supported platform" +#endif + +OssEngine::OssEngine(QObject *parent) : + AudioEngine(parent), + m_mixer(-1), + m_device(NULL), + m_leftVolume(0), + m_rightVolume(0) +{ + qDebug() << "OssEngine"; + initMixer(); +} + +OssEngine::~OssEngine() +{ + if(m_mixer >= 0) + close(m_mixer); +} + +void OssEngine::initMixer() { + m_mixer = open ("/dev/mixer", O_RDWR, 0); + if (m_mixer < 0) { + qDebug() << "/dev/mixer cannot be opened"; + return; + } + qDebug() << "InitMixer:" << m_mixer; + + m_device = new AudioDevice(Sink, this); + m_device->setName("Master"); + m_device->setIndex(0); + m_device->setDescription("Master Volume"); + m_device->setMuteNoCommit(false); + updateVolume(); + + m_sinks.append(m_device); + emit sinkListChanged(); +} + +void OssEngine::updateVolume() { + if(m_mixer < 0 || !m_device) + return; + int volumes; + if(ioctl(m_mixer, MIXER_READ(SOUND_MIXER_VOLUME), &volumes) < 0) { + qDebug() << "updateVolume() failed" << errno; + } + m_leftVolume = volumes & 0xff; // left + m_rightVolume = (volumes >> 8) & 0xff; // right + qDebug() << "volume:" << m_leftVolume << m_rightVolume; + + m_device->setVolumeNoCommit(m_leftVolume); +} + +void OssEngine::setVolume(int volume) { + if(m_mixer < 0) + return; + int volumes = (volume << 8) + volume; + if(ioctl(m_mixer, MIXER_WRITE(SOUND_MIXER_VOLUME), &volumes) < 0) { + qDebug() << "setVolume() failed" << errno; + } + else { + qDebug() << "setVolume()" << volume; + } +} + +void OssEngine::commitDeviceVolume(AudioDevice *device) +{ + if (!device) + return; + setVolume(device->volume()); +} + +void OssEngine::setMute(AudioDevice *device, bool state) +{ + if(state) + setVolume(0); + else + setVolume(m_leftVolume); +} + +void OssEngine::setIgnoreMaxVolume(bool ignore) +{ + // TODO +} diff --git a/lxqt-panel/plugin-volume/ossengine.h b/lxqt-panel/plugin-volume/ossengine.h new file mode 100644 index 0000000..d13c836 --- /dev/null +++ b/lxqt-panel/plugin-volume/ossengine.h @@ -0,0 +1,70 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef OSSENGINE_H +#define OSSENGINE_H + +#include "audioengine.h" + +#include +#include +#include + +class AudioDevice; + +class OssEngine : public AudioEngine +{ + Q_OBJECT + +public: + OssEngine(QObject *parent = 0); + ~OssEngine(); + + virtual const QString backendName() const { return QLatin1String("Oss"); } + virtual int volumeMax(AudioDevice */*device*/) const { return 100; } + + virtual void commitDeviceVolume(AudioDevice *device); + virtual void setMute(AudioDevice *device, bool state); + virtual void setIgnoreMaxVolume(bool ignore); + +signals: + void sinkInfoChanged(AudioDevice *device); + void readyChanged(bool ready); + +private: + void initMixer(); + void updateVolume(); + void setVolume(int volume); + +private: + int m_mixer; // oss mixer fd + AudioDevice* m_device; + int m_leftVolume; + int m_rightVolume; +}; + +#endif // OSSENGINE_H diff --git a/lxqt-panel/plugin-volume/pulseaudioengine.cpp b/lxqt-panel/plugin-volume/pulseaudioengine.cpp new file mode 100644 index 0000000..406e94b --- /dev/null +++ b/lxqt-panel/plugin-volume/pulseaudioengine.cpp @@ -0,0 +1,410 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "pulseaudioengine.h" + +#include "audiodevice.h" + +#include +#include + +//#define PULSEAUDIO_ENGINE_DEBUG + +static void sinkInfoCallback(pa_context *context, const pa_sink_info *info, int isLast, void *userdata) +{ + PulseAudioEngine *pulseEngine = static_cast(userdata); + QMap stateMap; + stateMap[PA_SINK_INVALID_STATE] = "n/a"; + stateMap[PA_SINK_RUNNING] = "RUNNING"; + stateMap[PA_SINK_IDLE] = "IDLE"; + stateMap[PA_SINK_SUSPENDED] = "SUSPENDED"; + + if (isLast < 0) { + pa_threaded_mainloop_signal(pulseEngine->mainloop(), 0); + qWarning() << QString("Failed to get sink information: %1").arg(pa_strerror(pa_context_errno(context))); + return; + } + + if (isLast) { + pa_threaded_mainloop_signal(pulseEngine->mainloop(), 0); + return; + } + + pulseEngine->addOrUpdateSink(info); +} + +static void contextEventCallback(pa_context *context, const char *name, pa_proplist *p, void *userdata) +{ +#ifdef PULSEAUDIO_ENGINE_DEBUG + qWarning("event received %s", name); +#endif +} + +static void contextStateCallback(pa_context *context, void *userdata) +{ + PulseAudioEngine *pulseEngine = reinterpret_cast(userdata); + + // update internal state + pa_context_state_t state = pa_context_get_state(context); + pulseEngine->setContextState(state); + +#ifdef PULSEAUDIO_ENGINE_DEBUG + switch (state) { + case PA_CONTEXT_UNCONNECTED: + qWarning("context unconnected"); + break; + case PA_CONTEXT_CONNECTING: + qWarning("context connecting"); + break; + case PA_CONTEXT_AUTHORIZING: + qWarning("context authorizing"); + break; + case PA_CONTEXT_SETTING_NAME: + qWarning("context setting name"); + break; + case PA_CONTEXT_READY: + qWarning("context ready"); + break; + case PA_CONTEXT_FAILED: + qWarning("context failed"); + break; + case PA_CONTEXT_TERMINATED: + qWarning("context terminated"); + break; + default: + qWarning("we should never hit this state"); + } +#endif + + pa_threaded_mainloop_signal(pulseEngine->mainloop(), 0); +} + +static void contextSuccessCallback(pa_context *context, int success, void *userdata) +{ + Q_UNUSED(context); + Q_UNUSED(success); + Q_UNUSED(userdata); + + PulseAudioEngine *pulseEngine = reinterpret_cast(userdata); + pa_threaded_mainloop_signal(pulseEngine->mainloop(), 0); +} + +static void contextSubscriptionCallback(pa_context *context, pa_subscription_event_type_t t, uint32_t idx, void *userdata) +{ + PulseAudioEngine *pulseEngine = reinterpret_cast(userdata); + foreach (AudioDevice *dev, pulseEngine->sinks()) { + if (dev->index() == idx) { + pulseEngine->requestSinkInfoUpdate(dev); + break; + } + } +} + + +PulseAudioEngine::PulseAudioEngine(QObject *parent) : + AudioEngine(parent), + m_context(0), + m_contextState(PA_CONTEXT_UNCONNECTED), + m_ready(false), + m_maximumVolume(PA_VOLUME_UI_MAX) +{ + qRegisterMetaType("pa_context_state_t"); + + m_reconnectionTimer.setSingleShot(true); + m_reconnectionTimer.setInterval(100); + connect(&m_reconnectionTimer, SIGNAL(timeout()), this, SLOT(connectContext())); + + m_mainLoop = pa_threaded_mainloop_new(); + if (m_mainLoop == 0) { + qWarning("Unable to create pulseaudio mainloop"); + return; + } + + if (pa_threaded_mainloop_start(m_mainLoop) != 0) { + qWarning("Unable to start pulseaudio mainloop"); + pa_threaded_mainloop_free(m_mainLoop); + m_mainLoop = 0; + return; + } + + m_mainLoopApi = pa_threaded_mainloop_get_api(m_mainLoop); + + connect(this, SIGNAL(contextStateChanged(pa_context_state_t)), this, SLOT(handleContextStateChanged())); + + connectContext(); +} + +PulseAudioEngine::~PulseAudioEngine() +{ + if (m_context) { + pa_context_unref(m_context); + m_context = 0; + } + + if (m_mainLoop) { + pa_threaded_mainloop_free(m_mainLoop); + m_mainLoop = 0; + } +} + +void PulseAudioEngine::addOrUpdateSink(const pa_sink_info *info) +{ + AudioDevice *dev = 0; + bool newSink = false; + QString name = QString::fromUtf8(info->name); + + foreach (AudioDevice *device, m_sinks) { + if (device->name() == name) { + dev = device; + break; + } + } + + if (!dev) { + dev = new AudioDevice(Sink, this); + newSink = true; + } + + dev->setName(name); + dev->setIndex(info->index); + dev->setDescription(QString::fromUtf8(info->description)); + dev->setMuteNoCommit(info->mute); + + // TODO: save separately? alsa does not have it + m_cVolumeMap.insert(dev, info->volume); + + pa_volume_t v = pa_cvolume_avg(&(info->volume)); + // convert real volume to percentage + dev->setVolumeNoCommit(((double)v * 100.0) / m_maximumVolume); + + if (newSink) { + m_sinks.append(dev); + emit sinkListChanged(); + } +} + +void PulseAudioEngine::requestSinkInfoUpdate(AudioDevice *device) +{ + emit sinkInfoChanged(device); +} + +void PulseAudioEngine::commitDeviceVolume(AudioDevice *device) +{ + if (!device || !m_ready) + return; + + // convert from percentage to real volume value + pa_volume_t v = ((double)device->volume() / 100.0) * m_maximumVolume; + pa_cvolume tmpVolume = m_cVolumeMap.value(device); + pa_cvolume *volume = pa_cvolume_set(&tmpVolume, tmpVolume.channels, v); + // qDebug() << "PulseAudioEngine::commitDeviceVolume" << v; + pa_threaded_mainloop_lock(m_mainLoop); + + pa_operation *operation; + if (device->type() == Sink) + operation = pa_context_set_sink_volume_by_index(m_context, device->index(), volume, contextSuccessCallback, this); + else + operation = pa_context_set_source_volume_by_index(m_context, device->index(), volume, contextSuccessCallback, this); + + while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(m_mainLoop); + pa_operation_unref(operation); + + pa_threaded_mainloop_unlock(m_mainLoop); +} + +void PulseAudioEngine::retrieveSinks() +{ + if (!m_ready) + return; + + pa_threaded_mainloop_lock(m_mainLoop); + + pa_operation *operation; + operation = pa_context_get_sink_info_list(m_context, sinkInfoCallback, this); + while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(m_mainLoop); + pa_operation_unref(operation); + + pa_threaded_mainloop_unlock(m_mainLoop); +} + +void PulseAudioEngine::setupSubscription() +{ + if (!m_ready) + return; + + connect(this, SIGNAL(sinkInfoChanged(AudioDevice*)), this, SLOT(retrieveSinkInfo(AudioDevice*)), Qt::QueuedConnection); + pa_context_set_subscribe_callback(m_context, contextSubscriptionCallback, this); + + pa_threaded_mainloop_lock(m_mainLoop); + + pa_operation *operation; + operation = pa_context_subscribe(m_context, PA_SUBSCRIPTION_MASK_SINK, contextSuccessCallback, this); + while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(m_mainLoop); + pa_operation_unref(operation); + + pa_threaded_mainloop_unlock(m_mainLoop); +} + +void PulseAudioEngine::handleContextStateChanged() +{ + if (m_contextState == PA_CONTEXT_FAILED || m_contextState == PA_CONTEXT_TERMINATED) { + qWarning("LxQt-Volume: Context connection failed or terminated lets try to reconnect"); + m_reconnectionTimer.start(); + } +} + +void PulseAudioEngine::connectContext() +{ + bool keepGoing = true; + bool ok = false; + + m_reconnectionTimer.stop(); + + if (!m_mainLoop) + return; + + pa_threaded_mainloop_lock(m_mainLoop); + + if (m_context) { + pa_context_unref(m_context); + m_context = 0; + } + + m_context = pa_context_new(m_mainLoopApi, "lxqt-volume"); + pa_context_set_state_callback(m_context, contextStateCallback, this); + pa_context_set_event_callback(m_context, contextEventCallback, this); + + if (!m_context) { + pa_threaded_mainloop_unlock(m_mainLoop); + m_reconnectionTimer.start(); + return; + } + + if (pa_context_connect(m_context, NULL, (pa_context_flags_t)0, NULL) < 0) { + pa_threaded_mainloop_unlock(m_mainLoop); + m_reconnectionTimer.start(); + return; + } + + while (keepGoing) { + switch (m_contextState) { + case PA_CONTEXT_CONNECTING: + case PA_CONTEXT_AUTHORIZING: + case PA_CONTEXT_SETTING_NAME: + break; + + case PA_CONTEXT_READY: + keepGoing = false; + ok = true; + break; + + case PA_CONTEXT_TERMINATED: + keepGoing = false; + break; + + case PA_CONTEXT_FAILED: + default: + qWarning() << QString("Connection failure: %1").arg(pa_strerror(pa_context_errno(m_context))); + keepGoing = false; + } + + if (keepGoing) + pa_threaded_mainloop_wait(m_mainLoop); + } + + pa_threaded_mainloop_unlock(m_mainLoop); + + if (ok) { + retrieveSinks(); + setupSubscription(); + } else { + m_reconnectionTimer.start(); + } +} + +void PulseAudioEngine::retrieveSinkInfo(AudioDevice *device) +{ + if (!m_ready) + return; + + pa_threaded_mainloop_lock(m_mainLoop); + + pa_operation *operation; + operation = pa_context_get_sink_info_by_index(m_context, device->index(), sinkInfoCallback, this); + while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(m_mainLoop); + pa_operation_unref(operation); + + pa_threaded_mainloop_unlock(m_mainLoop); +} + +void PulseAudioEngine::setMute(AudioDevice *device, bool state) +{ + if (!m_ready) + return; + + pa_threaded_mainloop_lock(m_mainLoop); + + pa_operation *operation; + operation = pa_context_set_sink_mute_by_index(m_context, device->index(), state, contextSuccessCallback, this); + while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(m_mainLoop); + pa_operation_unref(operation); + + pa_threaded_mainloop_unlock(m_mainLoop); +} + +void PulseAudioEngine::setContextState(pa_context_state_t state) +{ + if (m_contextState == state) + return; + + m_contextState = state; + + // update ready member as it depends on state + if (m_ready == (m_contextState == PA_CONTEXT_READY)) + return; + + m_ready = (m_contextState == PA_CONTEXT_READY); + + emit contextStateChanged(m_contextState); + emit readyChanged(m_ready); +} + +void PulseAudioEngine::setIgnoreMaxVolume(bool ignore) +{ + if (ignore) + m_maximumVolume = PA_VOLUME_UI_MAX; + else + m_maximumVolume = pa_sw_volume_from_dB(0); +} + + + diff --git a/lxqt-panel/plugin-volume/pulseaudioengine.h b/lxqt-panel/plugin-volume/pulseaudioengine.h new file mode 100644 index 0000000..bd7591a --- /dev/null +++ b/lxqt-panel/plugin-volume/pulseaudioengine.h @@ -0,0 +1,98 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef PULSEAUDIOENGINE_H +#define PULSEAUDIOENGINE_H + +#include "audioengine.h" + +#include +#include +#include +#include + +#include + +// PA_VOLUME_UI_MAX is only supported since pulseaudio 0.9.23 +#ifndef PA_VOLUME_UI_MAX +#define PA_VOLUME_UI_MAX (pa_sw_volume_from_dB(+11.0)) +#endif + +class AudioDevice; + +class PulseAudioEngine : public AudioEngine +{ + Q_OBJECT + +public: + PulseAudioEngine(QObject *parent = 0); + ~PulseAudioEngine(); + + virtual const QString backendName() const { return QLatin1String("PulseAudio"); } + + int volumeMax(AudioDevice */*device*/) const { return m_maximumVolume; } + + void requestSinkInfoUpdate(AudioDevice *device); + void addOrUpdateSink(const pa_sink_info *info); + + pa_context_state_t contextState() const { return m_contextState; } + bool ready() const { return m_ready; } + pa_threaded_mainloop *mainloop() const { return m_mainLoop; } + +public slots: + void commitDeviceVolume(AudioDevice *device); + void retrieveSinkInfo(AudioDevice *device); + void setMute(AudioDevice *device, bool state); + void setContextState(pa_context_state_t state); + void setIgnoreMaxVolume(bool ignore); + +signals: + void sinkInfoChanged(AudioDevice *device); + void contextStateChanged(pa_context_state_t state); + void readyChanged(bool ready); + +private slots: + void handleContextStateChanged(); + void connectContext(); + +private: + void retrieveSinks(); + void setupSubscription(); + + pa_mainloop_api *m_mainLoopApi; + pa_threaded_mainloop *m_mainLoop; + pa_context *m_context; + + pa_context_state_t m_contextState; + bool m_ready; + QTimer m_reconnectionTimer; + int m_maximumVolume; + + QMap m_cVolumeMap; +}; + +#endif // PULSEAUDIOENGINE_H diff --git a/lxqt-panel/plugin-volume/resources/volume.desktop.in b/lxqt-panel/plugin-volume/resources/volume.desktop.in new file mode 100644 index 0000000..a519581 --- /dev/null +++ b/lxqt-panel/plugin-volume/resources/volume.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. +Icon=multimedia-volume-control + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-volume/translations/volume.ts b/lxqt-panel/plugin-volume/translations/volume.ts new file mode 100644 index 0000000..9c9af62 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + + Volume Control Settings + + + + + Device to control + + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + + + + + Mute on middle click + + + + + Show on mouse click + + + + + Allow volume beyond 100% (0dB) + + + + + Volume adjust step + + + + + External Mixer + + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_ar.ts b/lxqt-panel/plugin-volume/translations/volume_ar.ts new file mode 100644 index 0000000..493c95a --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ar.ts @@ -0,0 +1,108 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + + Volume Control Settings + + + + + Device to control + + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + + + + + Mute on middle click + + + + + Show on mouse click + + + + + Allow volume beyond 100% (0dB) + + + + + Volume adjust step + + + + + External Mixer + + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_cs.desktop b/lxqt-panel/plugin-volume/translations/volume_cs.desktop new file mode 100644 index 0000000..e8f34f5 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_cs.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs]=Ovládejte hlasitost systému a spusťte svůj upřednostňovaný směšovač. +Name[cs]=Ovládání hlasitosti diff --git a/lxqt-panel/plugin-volume/translations/volume_cs.ts b/lxqt-panel/plugin-volume/translations/volume_cs.ts new file mode 100644 index 0000000..1230b30 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_cs.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Ukázat plochu: Celkovou zkratku '%1' nelze zapsat + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Nastavení ovládání hlasitosti + + + + Volume Control Settings + + + + + Device to control + Zařízení k ovládání + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Chování + + + + Mute on middle click + Ztlumit při klepnutí prostředním tlačítkem + + + + Show on mouse click + Ukázat při klepnutí myší + + + + Allow volume beyond 100% (0dB) + Povolit hlasitost přes 100% (0dB) + + + + Volume adjust step + Krok úpravy hlasitosti + + + + External Mixer + Vnější směšovač + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_cs_CZ.desktop b/lxqt-panel/plugin-volume/translations/volume_cs_CZ.desktop new file mode 100644 index 0000000..7833031 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_cs_CZ.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[cs_CZ]=Ovládejte hlasitost systému a spusťte svůj upřednostňovaný směšovač. +Name[cs_CZ]=Ovládání hlasitosti diff --git a/lxqt-panel/plugin-volume/translations/volume_cs_CZ.ts b/lxqt-panel/plugin-volume/translations/volume_cs_CZ.ts new file mode 100644 index 0000000..815ac1f --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_cs_CZ.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Ukázat plochu: Celkovou zkratku '%1' nelze zapsat + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Nastavení ovládání hlasitosti + + + + Volume Control Settings + + + + + Device to control + Zařízení k ovládání + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Chování + + + + Mute on middle click + Ztlumit při klepnutí prostředním tlačítkem + + + + Show on mouse click + Ukázat při klepnutí myší + + + + Allow volume beyond 100% (0dB) + Povolit hlasitost přes 100% (0dB) + + + + Volume adjust step + Krok úpravy hlasitosti + + + + External Mixer + Vnější směšovač + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/plugin-volume/translations/volume_de_DE.desktop b/lxqt-panel/plugin-volume/translations/volume_da.desktop similarity index 64% rename from plugin-volume/translations/volume_de_DE.desktop rename to lxqt-panel/plugin-volume/translations/volume_da.desktop index fab0912..8638826 100644 --- a/plugin-volume/translations/volume_de_DE.desktop +++ b/lxqt-panel/plugin-volume/translations/volume_da.desktop @@ -8,5 +8,5 @@ Comment=Control the system's volume and launch your preferred mixer. # Translations -Comment[de_DE]=Regele die Systemlautstärke und starte bevorzugten Mixer. -Name[de_DE]=Lautstärken Regelung +Comment[da]=Kontroller systemets lydstyrke og start din foretrukne mixer. +Name[da]=Lydstyrkekontrol diff --git a/lxqt-panel/plugin-volume/translations/volume_da_DK.desktop b/lxqt-panel/plugin-volume/translations/volume_da_DK.desktop new file mode 100644 index 0000000..6958179 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_da_DK.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[da_DK]=Kontroller systemets lydstyrke og start din foretrukne mixer. +Name[da_DK]=Lydstyrkekontrol diff --git a/lxqt-panel/plugin-volume/translations/volume_da_DK.ts b/lxqt-panel/plugin-volume/translations/volume_da_DK.ts new file mode 100644 index 0000000..0df3bcd --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_da_DK.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Vis Skrivebord: Global genvej '%1' kan ikke registreres + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Indstillinger for LxQt Lydstyrkekontrol + + + + Volume Control Settings + + + + + Device to control + Enhed som styres + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Adfærd + + + + Mute on middle click + Lydløs ved midterklik + + + + Show on mouse click + Vis ved museklik + + + + Allow volume beyond 100% (0dB) + Tillad lydstyrke over 100% (0dB) + + + + Volume adjust step + Trin for lydstyrkejustering + + + + External Mixer + Ekstern mixer + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_de.desktop b/lxqt-panel/plugin-volume/translations/volume_de.desktop new file mode 100644 index 0000000..32df5d6 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Lautstärkeeinstellung +Comment[de]=Systemlautstärke einstellen und den bevorzugten Mischer starten. diff --git a/lxqt-panel/plugin-volume/translations/volume_de.ts b/lxqt-panel/plugin-volume/translations/volume_de.ts new file mode 100644 index 0000000..4f32770 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_de.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Lautstärke erhöhen + + + + Decrease sound volume + Lautstärke verringern + + + + Mute/unmute sound volume + Lautstärke stummschalten/wiederherstellen + + + + Volume Control: The following shortcuts can not be registered: %1 + Lautstärkeeinstellung: Die folgenden Tastaturkürzel konnten nicht registriert werden: %1 + + + + + Volume: %1 + Lautstärke: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Lautstärkeeinstellungen + + + + Device to control + Zu steuerndes Gerät + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + OSS + + + + Behavior + Verhalten + + + + Mute on middle click + Stummschaltung per Mittelklick + + + + Show on mouse click + Bei Mausklick anzeigen + + + + Allow volume beyond 100% (0dB) + Lautstärke über 100% (0dB) erlauben + + + + Volume adjust step + Lautstärkeschrittweite + + + + External Mixer + Externer Mischer + + + + VolumePopup + + + Launch mixer + Mischer starten + + + + Mi&xer + &Mischer + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_el_GR.desktop b/lxqt-panel/plugin-volume/translations/volume_el_GR.desktop new file mode 100644 index 0000000..206426c --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_el_GR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[el_GR]=Ελέγξτε την ένταση ήχου του συστήματος και ξεκινήστε τον προτιμώμενο μίκτη. +Name[el_GR]=Έλεγχος έντασης ήχου diff --git a/lxqt-panel/plugin-volume/translations/volume_el_GR.ts b/lxqt-panel/plugin-volume/translations/volume_el_GR.ts new file mode 100644 index 0000000..98563c6 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_el_GR.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Ρυθμίσεις ελέγχου έντασης ήχου LxQt + + + + Volume Control Settings + + + + + Device to control + Συσκευή για έλεγχο + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Συμπεριφορά + + + + Mute on middle click + Σίγαση με μεσαίο κλικ + + + + Show on mouse click + Εμφάνιση με κλικ + + + + Allow volume beyond 100% (0dB) + Να επιτρέπεται ένταση πάνω από 100% (0dB) + + + + Volume adjust step + Βήμα προσαρμογής έντασης + + + + External Mixer + Εξωτερικός μίκτης + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_eo.ts b/lxqt-panel/plugin-volume/translations/volume_eo.ts new file mode 100644 index 0000000..38b4f41 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_eo.ts @@ -0,0 +1,108 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Montri labortablon: ĉiea klavkombino '%1' ne registreblas + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + + Volume Control Settings + + + + + Device to control + + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + + + + + Mute on middle click + + + + + Show on mouse click + + + + + Allow volume beyond 100% (0dB) + + + + + Volume adjust step + + + + + External Mixer + + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_es.desktop b/lxqt-panel/plugin-volume/translations/volume_es.desktop new file mode 100644 index 0000000..333136d --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_es.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es]=Controla el volumen del sistema y lanza su mezclador preferido +Name[es]=Control de volumen diff --git a/lxqt-panel/plugin-volume/translations/volume_es.ts b/lxqt-panel/plugin-volume/translations/volume_es.ts new file mode 100644 index 0000000..14fc080 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_es.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar Escritorio: Atajo global '%1' no puede ser registrado + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Opciones del Control de Volumen de LxQt + + + + Volume Control Settings + + + + + Device to control + Dispositivo de control + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportamiento + + + + Mute on middle click + Silenciar con click central + + + + Show on mouse click + Mostrar con un click + + + + Allow volume beyond 100% (0dB) + Permitir que el volumen sobrepase el 100% (0dB) + + + + Volume adjust step + Tamaño del ajuste de volumen + + + + External Mixer + Mezclador externo + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_es_VE.desktop b/lxqt-panel/plugin-volume/translations/volume_es_VE.desktop new file mode 100644 index 0000000..aea4eeb --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_es_VE.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[es_VE]=Controla el volumen del sistema y lanza el mezclador escogido referido +Name[es_VE]=Control de volumen diff --git a/lxqt-panel/plugin-volume/translations/volume_es_VE.ts b/lxqt-panel/plugin-volume/translations/volume_es_VE.ts new file mode 100644 index 0000000..d2a4f76 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_es_VE.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Preferencias de control de volumen de LxQt + + + + Volume Control Settings + + + + + Device to control + Disositivo + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportamiento + + + + Mute on middle click + Silenciar en clic medio + + + + Show on mouse click + Mostrar en clic de raton + + + + Allow volume beyond 100% (0dB) + permitir volumen mas alla de 100% (0db) + + + + Volume adjust step + paso de ajuste de volumen + + + + External Mixer + Mexclador + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_eu.desktop b/lxqt-panel/plugin-volume/translations/volume_eu.desktop new file mode 100644 index 0000000..6ebf4c0 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_eu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[eu]=Kontrolatu sistemaren bolumena eta abiarazi zure gogoko nahasgailua. +Name[eu]=Bolumen-kontrola diff --git a/lxqt-panel/plugin-volume/translations/volume_eu.ts b/lxqt-panel/plugin-volume/translations/volume_eu.ts new file mode 100644 index 0000000..b35dd73 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_eu.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + LxQt bolumen-kontrolaren ezarpenak + + + + Volume Control Settings + + + + + Device to control + Kontrolatu beharreko gailua + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Portaera + + + + Mute on middle click + Mututu erdiko botoiarekin klikatzean + + + + Show on mouse click + Erakutsi saguarekin klikatzean + + + + Allow volume beyond 100% (0dB) + Baimendu % 100etik (0dB) gorako bolumena + + + + Volume adjust step + Bolumen-doikuntzaren pausoa + + + + External Mixer + Kanpoko nahastailea + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_fi.desktop b/lxqt-panel/plugin-volume/translations/volume_fi.desktop new file mode 100644 index 0000000..121baa7 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_fi.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[fi]=Hallitse järjestelmän äänenvoimakkuutta, ja käynnistä suosimasi mikseri. +Name[fi]=Äänenvoimakkuuden hallinta diff --git a/lxqt-panel/plugin-volume/translations/volume_fi.ts b/lxqt-panel/plugin-volume/translations/volume_fi.ts new file mode 100644 index 0000000..50c300c --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_fi.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + LxQtin äänenhallinnan asetukset + + + + Volume Control Settings + + + + + Device to control + Hallittava laite + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Toiminta + + + + Mute on middle click + Vaimenna hiiren keskimmäisen painikkeen painalluksella + + + + Show on mouse click + Näytä hiiren painalluksella + + + + Allow volume beyond 100% (0dB) + Salli yli 100 %:n äänenvoimakkuus (0 dB) + + + + Volume adjust step + Äänenvoimakkuuden säätöväli + + + + External Mixer + Ulkoinen mikseri + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_fr_FR.ts b/lxqt-panel/plugin-volume/translations/volume_fr_FR.ts new file mode 100644 index 0000000..842d3d2 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_fr_FR.ts @@ -0,0 +1,108 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Montrer le bureau : le raccourci global '%1' ne peut pas être défini + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + + Volume Control Settings + + + + + Device to control + + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + + + + + Mute on middle click + + + + + Show on mouse click + + + + + Allow volume beyond 100% (0dB) + + + + + Volume adjust step + + + + + External Mixer + + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_hu.desktop b/lxqt-panel/plugin-volume/translations/volume_hu.desktop new file mode 100644 index 0000000..1f90583 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=A rendszer hangerejének beállítása +Name[hu]=Hangerőszabályzó diff --git a/lxqt-panel/plugin-volume/translations/volume_hu.ts b/lxqt-panel/plugin-volume/translations/volume_hu.ts new file mode 100644 index 0000000..5a59b05 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_hu.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_hu_HU.ts b/lxqt-panel/plugin-volume/translations/volume_hu_HU.ts new file mode 100644 index 0000000..8901b59 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_hu_HU.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_it_IT.desktop b/lxqt-panel/plugin-volume/translations/volume_it_IT.desktop new file mode 100644 index 0000000..353e2eb --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_it_IT.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[it_IT]=Controlla il volume del sistema e avvia il tuo mixer preferito. +Name[it_IT]=Controllo del volume diff --git a/lxqt-panel/plugin-volume/translations/volume_it_IT.ts b/lxqt-panel/plugin-volume/translations/volume_it_IT.ts new file mode 100644 index 0000000..3a36662 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_it_IT.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Mostra desktop: la scorciatoia globale '%1' non può essere registrata + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Impostazioni del controllo del volume di LxQt + + + + Volume Control Settings + + + + + Device to control + Dispositivo da controllare + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportamento + + + + Mute on middle click + Muto al clic centrale del mouse + + + + Show on mouse click + Mostra al clic del mouse + + + + Allow volume beyond 100% (0dB) + Permetti volume oltre il 100% (0dB) + + + + Volume adjust step + Valore di regolazione del volume + + + + External Mixer + Mixer esterno + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_ja.desktop b/lxqt-panel/plugin-volume/translations/volume_ja.desktop new file mode 100644 index 0000000..d1d547e --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ja.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ja]=音量調節 +Comment[ja]=システムの音量を制御したり、ミキサーを起動したりします + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-volume/translations/volume_ja.ts b/lxqt-panel/plugin-volume/translations/volume_ja.ts new file mode 100644 index 0000000..829e408 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ja.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + 音量を上げる + + + + Decrease sound volume + 音量を下げる + + + + Mute/unmute sound volume + ミュート/解除 + + + + Volume Control: The following shortcuts can not be registered: %1 + 音量制御: このショートカットは登録することができません: %1 + + + + + Volume: %1 + 音量: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + 音量制御の設定 + + + + Device to control + 制御するデバイス + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + OSS + + + + Behavior + 挙動 + + + + Mute on middle click + 中ボタンのクリックでミュート + + + + Show on mouse click + マウスのクリックで表示 + + + + Allow volume beyond 100% (0dB) + 100% (0dB)を超える音量を許可 + + + + Volume adjust step + 音量変更のステップ幅 + + + + External Mixer + 外部ミキサー + + + + VolumePopup + + + Launch mixer + ミキサーを起動 + + + + Mixer + ミキサー + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_lt.ts b/lxqt-panel/plugin-volume/translations/volume_lt.ts new file mode 100644 index 0000000..de1b083 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_lt.ts @@ -0,0 +1,108 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + + Volume Control Settings + + + + + Device to control + + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + + + + + Mute on middle click + + + + + Show on mouse click + + + + + Allow volume beyond 100% (0dB) + + + + + Volume adjust step + + + + + External Mixer + + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_nl.ts b/lxqt-panel/plugin-volume/translations/volume_nl.ts new file mode 100644 index 0000000..8268eae --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_nl.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Instellingen voor volumebeheer van LxQt + + + + Volume Control Settings + + + + + Device to control + Apparaat om te beheren + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Gedrag + + + + Mute on middle click + Dempen bij middelklik + + + + Show on mouse click + Tonen bij muisklik + + + + Allow volume beyond 100% (0dB) + Volume hoger dan 100% toestaan (0dB) + + + + Volume adjust step + Trap voor bijstellen van volume + + + + External Mixer + Extern mengpaneel + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_pl_PL.desktop b/lxqt-panel/plugin-volume/translations/volume_pl_PL.desktop new file mode 100644 index 0000000..6e3a462 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pl_PL.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pl_PL]=Dopasuj poziom dźwięku i włącz preferowany mikser. +Name[pl_PL]=Regulacja poziomu dźwięku diff --git a/lxqt-panel/plugin-volume/translations/volume_pl_PL.ts b/lxqt-panel/plugin-volume/translations/volume_pl_PL.ts new file mode 100644 index 0000000..5b78505 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pl_PL.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Ustawienia regulacji poziomu dźwięku LxQt + + + + Volume Control Settings + + + + + Device to control + Używane urządzenie + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Zachowanie + + + + Mute on middle click + Wycisz na klikniecie środkowym przyciskiem myszy + + + + Show on mouse click + Pokaż na kliknięcie myszką + + + + Allow volume beyond 100% (0dB) + Pozwól poziom dźwięku powyżej 100% (0db) + + + + Volume adjust step + Stopień regulowania poziomu dźwięku + + + + External Mixer + Zewnętrzny mikser + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_pt.desktop b/lxqt-panel/plugin-volume/translations/volume_pt.desktop new file mode 100644 index 0000000..85fb03e --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + +# Translations +Name[pt]=Controlo de volume +Comment[pt]=Controlar o volume do sistema e abrir o gestor de som diff --git a/lxqt-panel/plugin-volume/translations/volume_pt.ts b/lxqt-panel/plugin-volume/translations/volume_pt.ts new file mode 100644 index 0000000..3ec8efa --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pt.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Tecla de atalho global: "%1" não pode ser registada + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Definições do controlo de volume do LxQt + + + + Volume Control Settings + + + + + Device to control + Dispositivo a controlar + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportamento + + + + Mute on middle click + Silenciar com a roda do rato + + + + Show on mouse click + Mostrar ao clicar com o rato + + + + Allow volume beyond 100% (0dB) + Permitir volume abaixo de 100% (0dB) + + + + Volume adjust step + Nível de ajuste do volume + + + + External Mixer + Gestor de som externo + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_pt_BR.desktop b/lxqt-panel/plugin-volume/translations/volume_pt_BR.desktop new file mode 100644 index 0000000..d03cdbd --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pt_BR.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[pt_BR]=Controla o volume do sistema e lança seu mixer preferido. +Name[pt_BR]=Controle de Volume diff --git a/lxqt-panel/plugin-volume/translations/volume_pt_BR.ts b/lxqt-panel/plugin-volume/translations/volume_pt_BR.ts new file mode 100644 index 0000000..52874e5 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_pt_BR.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Configurações Do Controle De Volume + + + + Volume Control Settings + + + + + Device to control + Dispositivo para controlar + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportamento + + + + Mute on middle click + Mudo no clique do meio + + + + Show on mouse click + Mostrar no clique do mouse + + + + Allow volume beyond 100% (0dB) + Permitir o volume além de 100% (0dB) + + + + Volume adjust step + Ajustar passo do volume + + + + External Mixer + Mixer Externo + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_ro_RO.desktop b/lxqt-panel/plugin-volume/translations/volume_ro_RO.desktop new file mode 100644 index 0000000..373ecb6 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ro_RO.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ro_RO]=Controlează volumul sistem și lansează mixerul dvs preferat +Name[ro_RO]=Control volum diff --git a/lxqt-panel/plugin-volume/translations/volume_ro_RO.ts b/lxqt-panel/plugin-volume/translations/volume_ro_RO.ts new file mode 100644 index 0000000..0b368b3 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ro_RO.ts @@ -0,0 +1,108 @@ + + + + + LxQtVolume + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Setări control volum LxQt + + + + Volume Control Settings + + + + + Device to control + Dispozitiv de controlat + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Comportament + + + + Mute on middle click + + + + + Show on mouse click + Afișează la clic de maus + + + + Allow volume beyond 100% (0dB) + Permite volum dincolo de 100% (0dB) + + + + Volume adjust step + + + + + External Mixer + Mixer extern + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_ru.desktop b/lxqt-panel/plugin-volume/translations/volume_ru.desktop new file mode 100644 index 0000000..21165b3 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ru.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru]=Контролировать громкость звука в системе и запустить предпочтитаемый микшер. +Name[ru]=Регулятор громкости \ No newline at end of file diff --git a/lxqt-panel/plugin-volume/translations/volume_ru.ts b/lxqt-panel/plugin-volume/translations/volume_ru.ts new file mode 100644 index 0000000..beb9ab1 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ru.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Увеличить громкость звука + + + + Decrease sound volume + Уменьшить громкость звука + + + + Mute/unmute sound volume + Выкл/вкл звук + + + + Volume Control: The following shortcuts can not be registered: %1 + Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 + + + + + Volume: %1 + Громкость: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Настройки контроля громкости + + + + Device to control + Контролируемое устройство + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + OSS + + + + Behavior + Поведение + + + + Mute on middle click + Отключать звук при щелчке средней кнопкой мыши + + + + Show on mouse click + Показать по щелчку мыши + + + + Allow volume beyond 100% (0dB) + Разрешить громкость выше 100% (0Дб) + + + + Volume adjust step + Шаг регулировки громкости + + + + External Mixer + Внешний микшер + + + + VolumePopup + + + Launch mixer + Запустить микшер + + + + Mixer + Микшер + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_ru_RU.desktop b/lxqt-panel/plugin-volume/translations/volume_ru_RU.desktop new file mode 100644 index 0000000..eb99000 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ru_RU.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[ru_RU]=Контролировать громкость звука в системе и запустить предпочтитаемый микшер. +Name[ru_RU]=Регулятор громкости \ No newline at end of file diff --git a/lxqt-panel/plugin-volume/translations/volume_ru_RU.ts b/lxqt-panel/plugin-volume/translations/volume_ru_RU.ts new file mode 100644 index 0000000..93a7e7f --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_ru_RU.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Увеличить громкость звука + + + + Decrease sound volume + Уменьшить громкость звука + + + + Mute/unmute sound volume + Выкл/вкл звук + + + + Volume Control: The following shortcuts can not be registered: %1 + Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 + + + + + Volume: %1 + Громкость: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Настройки контроля громкости + + + + Device to control + Контролируемое устройство + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + OSS + + + + Behavior + Поведение + + + + Mute on middle click + Отключать звук при щелчке средней кнопкой мыши + + + + Show on mouse click + Показать по щелчку мыши + + + + Allow volume beyond 100% (0dB) + Разрешить громкость выше 100% (0Дб) + + + + Volume adjust step + Шаг регулировки громкости + + + + External Mixer + Внешний микшер + + + + VolumePopup + + + Launch mixer + Запустить микшер + + + + Mixer + Микшер + + + diff --git a/plugin-volume/translations/volume_de_DE.ts b/lxqt-panel/plugin-volume/translations/volume_sl.ts similarity index 76% rename from plugin-volume/translations/volume_de_DE.ts rename to lxqt-panel/plugin-volume/translations/volume_sl.ts index 4174f9c..5ff9d41 100644 --- a/plugin-volume/translations/volume_de_DE.ts +++ b/lxqt-panel/plugin-volume/translations/volume_sl.ts @@ -1,35 +1,35 @@ - + LxQtVolume Show Desktop: Global shortcut '%1' cannot be registered - Zeige Desktop: Globales Tastenkürzel '%1' kann nicht vergeben werden + Prikaz namizja: globalne bližnjice »%1« ni moč registrirati - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 @@ -38,7 +38,7 @@ LxQtVolumeConfiguration LxQt Volume Control Settings - LxQt Lautstärkeregelung + Nastavitve upravljalnika glasnosti LXQt @@ -48,7 +48,7 @@ Device to control - Zu regelndes Gerät + Naprava @@ -68,32 +68,32 @@ Behavior - Verhalten + Obnašanje Mute on middle click - Stummschaltung per Mittelklick + Utišaj s srednjim klikom Show on mouse click - Bei Mausklick anzeigen + Pokaži z miškinim klikom Allow volume beyond 100% (0dB) - Lautstärken über 100% (0dB) erlauben + Dovoli glasnost, večjo od 100% (0 dB) Volume adjust step - Lautstärken Schrittweite + Velikost koraka External Mixer - Externer Mixer + Zunanji mešalnik diff --git a/lxqt-panel/plugin-volume/translations/volume_th_TH.desktop b/lxqt-panel/plugin-volume/translations/volume_th_TH.desktop new file mode 100644 index 0000000..9ae62c8 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_th_TH.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[th_TH]=ควบคุมระดับเสียงของระบบและเรียกใช้ตัวผสมที่คุณต้องการ +Name[th_TH]=ควบคุมระดับเสียง diff --git a/lxqt-panel/plugin-volume/translations/volume_th_TH.ts b/lxqt-panel/plugin-volume/translations/volume_th_TH.ts new file mode 100644 index 0000000..f2422fd --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_th_TH.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + ค่าตั้งควบคุมระดับเสียง LxQt + + + + Volume Control Settings + + + + + Device to control + อุปกรณ์ที่จะควบคุม + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + พฤติกรรม + + + + Mute on middle click + ปิดเสียงด้วยการคลิกปุ่มกลาง + + + + Show on mouse click + แสดงขึ้นมาเมื่อถูกคลิก + + + + Allow volume beyond 100% (0dB) + อนุญาตให้ใช้ระดับเสียงเกินกว่า 100% (0dB) + + + + Volume adjust step + ช่วงการปรับระดับเสียง + + + + External Mixer + ตัวผสมภายนอก + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_uk.desktop b/lxqt-panel/plugin-volume/translations/volume_uk.desktop new file mode 100644 index 0000000..6730561 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_uk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[uk]=Регулює системну гучність та запускає ваш улюблений мікшер +Name[uk]=Регулятор гучності diff --git a/lxqt-panel/plugin-volume/translations/volume_uk.ts b/lxqt-panel/plugin-volume/translations/volume_uk.ts new file mode 100644 index 0000000..b9598a9 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_uk.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + Налаштування регулятора гучності LxQt + + + + Volume Control Settings + + + + + Device to control + Контролювати пристрій + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + Поведінка + + + + Mute on middle click + Приглушити по середній кнопці + + + + Show on mouse click + Показати по кнопці миші + + + + Allow volume beyond 100% (0dB) + Дозволяти гучність вище 100% (0 дБ) + + + + Volume adjust step + Крок регулювання гучності + + + + External Mixer + Зовнішній мікшер + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_zh_CN.desktop b/lxqt-panel/plugin-volume/translations/volume_zh_CN.desktop new file mode 100644 index 0000000..396fca5 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_zh_CN.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_CN]=控制系统音量并启动您喜欢的混音器。 +Name[zh_CN]=音量控制 diff --git a/lxqt-panel/plugin-volume/translations/volume_zh_CN.ts b/lxqt-panel/plugin-volume/translations/volume_zh_CN.ts new file mode 100644 index 0000000..94dfc34 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_zh_CN.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + 显示桌面:无法注册全局快捷键'%1' + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + LxQt 声音控制设置 + + + + Volume Control Settings + + + + + Device to control + 控制设备 + + + + Alsa + Alsa + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + 行为 + + + + Mute on middle click + 鼠标中击时静音 + + + + Show on mouse click + 显示鼠标点击 + + + + Allow volume beyond 100% (0dB) + 允许声音超过 100%(0分贝) + + + + Volume adjust step + 声音调整幅度 + + + + External Mixer + 外部混音器 + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/translations/volume_zh_TW.desktop b/lxqt-panel/plugin-volume/translations/volume_zh_TW.desktop new file mode 100644 index 0000000..16d426a --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_zh_TW.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[zh_TW]=控制系統音量並啟動您喜愛的音量控制器 +Name[zh_TW]=音量控制 diff --git a/lxqt-panel/plugin-volume/translations/volume_zh_TW.ts b/lxqt-panel/plugin-volume/translations/volume_zh_TW.ts new file mode 100644 index 0000000..1c09ef6 --- /dev/null +++ b/lxqt-panel/plugin-volume/translations/volume_zh_TW.ts @@ -0,0 +1,112 @@ + + + + + LxQtVolume + + Show Desktop: Global shortcut '%1' cannot be registered + 顯示桌面:全域快捷鍵'%1'無法被註冊 + + + + Increase sound volume + + + + + Decrease sound volume + + + + + Mute/unmute sound volume + + + + + Volume Control: The following shortcuts can not be registered: %1 + + + + + + Volume: %1 + + + + + LxQtVolumeConfiguration + + LxQt Volume Control Settings + LxQt音量調整設定 + + + + Volume Control Settings + + + + + Device to control + 設置裝置 + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + + + + + Behavior + 行為 + + + + Mute on middle click + 按滑鼠中鍵時靜音 + + + + Show on mouse click + 滑鼠點擊時顯示 + + + + Allow volume beyond 100% (0dB) + 允許音量超過 100% (0dB) + + + + Volume adjust step + 音量調整步驟 + + + + External Mixer + 外掛音量調整程式 + + + + VolumePopup + + + Launch mixer + + + + + Mixer + + + + diff --git a/lxqt-panel/plugin-volume/volumebutton.cpp b/lxqt-panel/plugin-volume/volumebutton.cpp new file mode 100644 index 0000000..4b90a9a --- /dev/null +++ b/lxqt-panel/plugin-volume/volumebutton.cpp @@ -0,0 +1,155 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "volumebutton.h" + +#include "volumepopup.h" +#include "audiodevice.h" + +#include +#include +#include + +#include +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" + +VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent): + QToolButton(parent), + mPlugin(plugin), + m_panel(plugin->panel()), + m_showOnClick(true), + m_muteOnMiddleClick(true) +{ + // initial icon for button. It will be replaced after devices scan. + // In the worst case - no soundcard/pulse - is found it remains + // in the button but at least the button is not blank ("invisible") + handleStockIconChanged("dialog-error"); + m_volumePopup = new VolumePopup(this); + + m_popupHideTimer.setInterval(1000); + connect(this, SIGNAL(clicked()), this, SLOT(toggleVolumeSlider())); + connect(&m_popupHideTimer, SIGNAL(timeout()), this, SLOT(hideVolumeSlider())); + + connect(m_volumePopup, SIGNAL(mouseEntered()), &m_popupHideTimer, SLOT(stop())); + connect(m_volumePopup, SIGNAL(mouseLeft()), &m_popupHideTimer, SLOT(start())); + + connect(m_volumePopup, SIGNAL(launchMixer()), this, SLOT(handleMixerLaunch())); + connect(m_volumePopup, SIGNAL(stockIconChanged(QString)), this, SLOT(handleStockIconChanged(QString))); +} + +VolumeButton::~VolumeButton() +{ +} + +void VolumeButton::setShowOnClicked(bool state) +{ + if (m_showOnClick == state) + return; + + m_showOnClick = state; +} + +void VolumeButton::setMuteOnMiddleClick(bool state) +{ + m_muteOnMiddleClick = state; +} + +void VolumeButton::setMixerCommand(const QString &command) +{ + m_mixerCommand = command; +} + +void VolumeButton::enterEvent(QEvent *event) +{ + if (!m_showOnClick) + showVolumeSlider(); + + m_popupHideTimer.stop(); +} + +void VolumeButton::leaveEvent(QEvent *event) +{ + m_popupHideTimer.start(); +} + +void VolumeButton::wheelEvent(QWheelEvent *event) +{ + m_volumePopup->handleWheelEvent(event); +} + +void VolumeButton::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::MidButton && m_muteOnMiddleClick) { + if (m_volumePopup->device()) { + m_volumePopup->device()->toggleMute(); + return; + } + } + + QToolButton::mouseReleaseEvent(event); +} + +void VolumeButton::toggleVolumeSlider() +{ + if (m_volumePopup->isVisible()) { + hideVolumeSlider(); + } else { + showVolumeSlider(); + } +} + +void VolumeButton::showVolumeSlider() +{ + + if (m_volumePopup->isVisible()) + return; + + m_popupHideTimer.stop(); + m_volumePopup->updateGeometry(); + m_volumePopup->adjustSize(); + QRect pos = mPlugin->calculatePopupWindowPos(m_volumePopup->size()); + m_volumePopup->openAt(pos.topLeft(), Qt::TopLeftCorner); + m_volumePopup->activateWindow(); +} + +void VolumeButton::hideVolumeSlider() +{ + // qDebug() << "hideVolumeSlider"; + m_popupHideTimer.stop(); + m_volumePopup->hide(); +} + +void VolumeButton::handleMixerLaunch() +{ + QProcess::startDetached(m_mixerCommand); +} + +void VolumeButton::handleStockIconChanged(const QString &iconName) +{ + setIcon(XdgIcon::fromTheme(iconName)); +} diff --git a/lxqt-panel/plugin-volume/volumebutton.h b/lxqt-panel/plugin-volume/volumebutton.h new file mode 100644 index 0000000..7d5cb7f --- /dev/null +++ b/lxqt-panel/plugin-volume/volumebutton.h @@ -0,0 +1,77 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef VOLUMEBUTTON_H +#define VOLUMEBUTTON_H + +#include +#include + +class VolumePopup; +class ILxQtPanel; +class LxQtVolume; +class ILxQtPanelPlugin; + +class VolumeButton : public QToolButton +{ + Q_OBJECT +public: + VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent = 0); + ~VolumeButton(); + + void setShowOnClicked(bool state); + void setMuteOnMiddleClick(bool state); + void setMixerCommand(const QString &command); + + VolumePopup *volumePopup() const { return m_volumePopup; } + +public slots: + void hideVolumeSlider(); + void showVolumeSlider(); + +protected: + void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + void wheelEvent(QWheelEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + +private slots: + void toggleVolumeSlider(); + void handleMixerLaunch(); + void handleStockIconChanged(const QString &iconName); + +private: + VolumePopup *m_volumePopup; + ILxQtPanelPlugin *mPlugin; + ILxQtPanel *m_panel; + QTimer m_popupHideTimer; + bool m_showOnClick; + bool m_muteOnMiddleClick; + QString m_mixerCommand; +}; + +#endif // VOLUMEBUTTON_H diff --git a/lxqt-panel/plugin-volume/volumepopup.cpp b/lxqt-panel/plugin-volume/volumepopup.cpp new file mode 100644 index 0000000..59cf84c --- /dev/null +++ b/lxqt-panel/plugin-volume/volumepopup.cpp @@ -0,0 +1,244 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "volumepopup.h" + +#include "audiodevice.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include "audioengine.h" +#include + +VolumePopup::VolumePopup(QWidget* parent): + QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint), + m_pos(0,0), + m_anchor(Qt::TopLeftCorner), + m_device(0) +{ + m_mixerButton = new QPushButton(this); + m_mixerButton->setObjectName("MixerLink"); + m_mixerButton->setMinimumWidth(1); + m_mixerButton->setToolTip(tr("Launch mixer")); + m_mixerButton->setText(tr("Mi&xer")); + m_mixerButton->setAutoDefault(false); + + m_volumeSlider = new QSlider(Qt::Vertical, this); + m_volumeSlider->setTickPosition(QSlider::TicksBothSides); + m_volumeSlider->setTickInterval(10); + // the volume slider shows 0-100 and volumes of all devices + // should be converted to percentages. + m_volumeSlider->setRange(0, 100); + + m_muteToggleButton = new QPushButton(this); + m_muteToggleButton->setIcon(XdgIcon::fromTheme(QStringList() << "audio-volume-muted")); + m_muteToggleButton->setCheckable(true); + m_muteToggleButton->setAutoDefault(false); + + QVBoxLayout *l = new QVBoxLayout(this); + l->setSpacing(0); + l->setMargin(0); + + l->addWidget(m_mixerButton, 0, Qt::AlignHCenter); + l->addWidget(m_volumeSlider, 0, Qt::AlignHCenter); + l->addWidget(m_muteToggleButton, 0, Qt::AlignHCenter); + + connect(m_mixerButton, SIGNAL(released()), this, SIGNAL(launchMixer())); + connect(m_volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(handleSliderValueChanged(int))); + connect(m_muteToggleButton, SIGNAL(clicked()), this, SLOT(handleMuteToggleClicked())); +} + +bool VolumePopup::event(QEvent *event) +{ + if(event->type() == QEvent::WindowDeactivate) + { + // qDebug("QEvent::WindowDeactivate"); + hide(); + } + return QDialog::event(event); +} + +void VolumePopup::enterEvent(QEvent *event) +{ + emit mouseEntered(); +} + +void VolumePopup::leaveEvent(QEvent *event) +{ + // qDebug("leaveEvent"); + emit mouseLeft(); +} + +void VolumePopup::handleSliderValueChanged(int value) +{ + if (!m_device) + return; + // qDebug("VolumePopup::handleSliderValueChanged: %d\n", value); + m_device->setVolume(value); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(value)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel + QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip(), m_volumeSlider); +} + +void VolumePopup::handleMuteToggleClicked() +{ + if (!m_device) + return; + + m_device->toggleMute(); +} + +void VolumePopup::handleDeviceVolumeChanged(int volume) +{ + // qDebug() << "handleDeviceVolumeChanged" << "volume" << volume << "max" << max; + // calling m_volumeSlider->setValue will trigger + // handleSliderValueChanged(), which set the device volume + // again, so we have to block the signals to avoid recursive + // signal emission. + m_volumeSlider->blockSignals(true); + m_volumeSlider->setValue(volume); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(volume)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel + m_volumeSlider->blockSignals(false); + + // emit volumeChanged(percent); + updateStockIcon(); +} + +void VolumePopup::handleDeviceMuteChanged(bool mute) +{ + m_muteToggleButton->setChecked(mute); + updateStockIcon(); +} + +void VolumePopup::updateStockIcon() +{ + if (!m_device) + return; + + QString iconName; + if (m_device->volume() <= 0 || m_device->mute()) + iconName = "audio-volume-muted"; + else if (m_device->volume() <= 33) + iconName = "audio-volume-low"; + else if (m_device->volume() <= 66) + iconName = "audio-volume-medium"; + else + iconName = "audio-volume-high"; + + m_muteToggleButton->setIcon(XdgIcon::fromTheme(iconName)); + emit stockIconChanged(iconName); +} + +void VolumePopup::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + realign(); +} + +void VolumePopup::openAt(QPoint pos, Qt::Corner anchor) +{ + m_pos = pos; + m_anchor = anchor; + realign(); + show(); +} + +void VolumePopup::handleWheelEvent(QWheelEvent *event) +{ + m_volumeSlider->event(reinterpret_cast(event)); +} + +void VolumePopup::setDevice(AudioDevice *device) +{ + if (device == m_device) + return; + + // disconnect old device + if (m_device) + disconnect(m_device); + + m_device = device; + + if (m_device) { + m_muteToggleButton->setChecked(m_device->mute()); + handleDeviceVolumeChanged(m_device->volume()); + connect(m_device, SIGNAL(volumeChanged(int)), this, SLOT(handleDeviceVolumeChanged(int))); + connect(m_device, SIGNAL(muteChanged(bool)), this, SLOT(handleDeviceMuteChanged(bool))); + } + else + updateStockIcon(); + emit deviceChanged(); +} + +void VolumePopup::setSliderStep(int step) +{ + m_volumeSlider->setSingleStep(step); + m_volumeSlider->setPageStep(step * 10); +} + +void VolumePopup::realign() +{ + QRect rect; + rect.setSize(sizeHint()); + switch (m_anchor) + { + case Qt::TopLeftCorner: + rect.moveTopLeft(m_pos); + break; + + case Qt::TopRightCorner: + rect.moveTopRight(m_pos); + break; + + case Qt::BottomLeftCorner: + rect.moveBottomLeft(m_pos); + break; + + case Qt::BottomRightCorner: + rect.moveBottomRight(m_pos); + break; + + } + + QRect screen = QApplication::desktop()->availableGeometry(m_pos); + + if (rect.right() > screen.right()) + rect.moveRight(screen.right()); + + if (rect.bottom() > screen.bottom()) + rect.moveBottom(screen.bottom()); + + move(rect.topLeft()); +} diff --git a/lxqt-panel/plugin-volume/volumepopup.h b/lxqt-panel/plugin-volume/volumepopup.h new file mode 100644 index 0000000..f02b9c0 --- /dev/null +++ b/lxqt-panel/plugin-volume/volumepopup.h @@ -0,0 +1,85 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Johannes Zellner + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef VOLUMEPOPUP_H +#define VOLUMEPOPUP_H + +#include + +class QSlider; +class QPushButton; +class AudioDevice; + +class VolumePopup : public QDialog +{ + Q_OBJECT +public: + VolumePopup(QWidget* parent = 0); + + void openAt(QPoint pos, Qt::Corner anchor); + void handleWheelEvent(QWheelEvent *event); + + QSlider *volumeSlider() const { return m_volumeSlider; } + + AudioDevice *device() const { return m_device; } + void setDevice(AudioDevice *device); + void setSliderStep(int step); + +signals: + void mouseEntered(); + void mouseLeft(); + + // void volumeChanged(int value); + void deviceChanged(); + void launchMixer(); + void stockIconChanged(const QString &iconName); + +protected: + void resizeEvent(QResizeEvent *event); + void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + bool event(QEvent * event); + +private slots: + void handleSliderValueChanged(int value); + void handleMuteToggleClicked(); + void handleDeviceVolumeChanged(int volume); + void handleDeviceMuteChanged(bool mute); + +private: + void realign(); + void updateStockIcon(); + + QSlider *m_volumeSlider; + QPushButton *m_mixerButton; + QPushButton *m_muteToggleButton; + QPoint m_pos; + Qt::Corner m_anchor; + AudioDevice *m_device; +}; + +#endif // VOLUMEPOPUP_H diff --git a/lxqt-panel/plugin-worldclock/CMakeLists.txt b/lxqt-panel/plugin-worldclock/CMakeLists.txt new file mode 100644 index 0000000..90d10c2 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/CMakeLists.txt @@ -0,0 +1,23 @@ +set(PLUGIN "worldclock") + +set(HEADERS + lxqtworldclock.h + lxqtworldclockconfiguration.h + lxqtworldclockconfigurationtimezones.h + lxqtworldclockconfigurationmanualformat.h +) + +set(SOURCES + lxqtworldclock.cpp + lxqtworldclockconfiguration.cpp + lxqtworldclockconfigurationtimezones.cpp + lxqtworldclockconfigurationmanualformat.cpp +) + +set(UIS + lxqtworldclockconfiguration.ui + lxqtworldclockconfigurationtimezones.ui + lxqtworldclockconfigurationmanualformat.ui +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclock.cpp b/lxqt-panel/plugin-worldclock/lxqtworldclock.cpp new file mode 100644 index 0000000..d37384a --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclock.cpp @@ -0,0 +1,563 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012-2013 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtworldclock.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +LxQtWorldClock::LxQtWorldClock(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + mPopup(NULL), + mTimer(new QTimer(this)), + mUpdateInterval(1), + mLastUpdate(0), + mAutoRotate(true), + mPopupContent(NULL) +{ + mMainWidget = new QWidget(); + mContent = new ActiveLabel(); + mRotatedWidget = new LxQt::RotatedWidget(*mContent, mMainWidget); + + mRotatedWidget->setTransferWheelEvent(true); + + QVBoxLayout *borderLayout = new QVBoxLayout(mMainWidget); + borderLayout->setContentsMargins(0, 0, 0, 0); + borderLayout->setSpacing(0); + borderLayout->addWidget(mRotatedWidget, 0, Qt::AlignCenter); + + mContent->setObjectName(QLatin1String("WorldClockContent")); + + mContent->setAlignment(Qt::AlignCenter); + + settingsChanged(); + + connect(mTimer, SIGNAL(timeout()), SLOT(timeout())); + + connect(mContent, SIGNAL(wheelScrolled(int)), SLOT(wheelScrolled(int))); +} + +LxQtWorldClock::~LxQtWorldClock() +{ + delete mMainWidget; +} + +void LxQtWorldClock::timeout() +{ + QDateTime now = QDateTime::currentDateTime(); + qint64 nowMsec = now.toMSecsSinceEpoch(); + if ((mLastUpdate / mUpdateInterval) == (nowMsec / mUpdateInterval)) + return; + + mLastUpdate = nowMsec; + + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + + mContent->setText(formatDateTime(now, timeZoneName)); + + mRotatedWidget->update(); + + updatePopupContent(); +} + +void LxQtWorldClock::restartTimer(int updateInterval) +{ + mUpdateInterval = updateInterval; + mTimer->start(qMin(100, updateInterval)); +} + +void LxQtWorldClock::settingsChanged() +{ + QSettings *_settings = settings(); + + QString oldFormat = mFormat; + + mTimeZones.clear(); + + int size = _settings->beginReadArray(QLatin1String("timeZones")); + for (int i = 0; i < size; ++i) + { + _settings->setArrayIndex(i); + QString timeZoneName = _settings->value(QLatin1String("timeZone"), QString()).toString(); + mTimeZones.append(timeZoneName); + mTimeZoneCustomNames[timeZoneName] = _settings->value(QLatin1String("customName"), QString()).toString(); + } + _settings->endArray(); + if (mTimeZones.isEmpty()) + mTimeZones.append(QLatin1String("local")); + + mDefaultTimeZone = _settings->value(QLatin1String("defaultTimeZone"), QString()).toString(); + if (mDefaultTimeZone.isEmpty()) + mDefaultTimeZone = mTimeZones[0]; + mActiveTimeZone = mDefaultTimeZone; + + + bool longTimeFormatSelected = false; + + QString formatType = _settings->value(QLatin1String("formatType"), QString()).toString(); + QString dateFormatType = _settings->value(QLatin1String("dateFormatType"), QString()).toString(); + bool advancedManual = _settings->value(QLatin1String("useAdvancedManualFormat"), false).toBool(); + + // backward compatibility + if (formatType == QLatin1String("custom")) + { + formatType = QLatin1String("short-timeonly"); + dateFormatType = QLatin1String("short"); + advancedManual = true; + } + else if (formatType == QLatin1String("short")) + { + formatType = QLatin1String("short-timeonly"); + dateFormatType = QLatin1String("short"); + advancedManual = false; + } + else if ((formatType == QLatin1String("full")) || + (formatType == QLatin1String("long")) || + (formatType == QLatin1String("medium"))) + { + formatType = QLatin1String("long-timeonly"); + dateFormatType = QLatin1String("long"); + advancedManual = false; + } + + if (formatType == QLatin1String("long-timeonly")) + longTimeFormatSelected = true; + + bool timeShowSeconds = _settings->value(QLatin1String("timeShowSeconds"), false).toBool(); + bool timePadHour = _settings->value(QLatin1String("timePadHour"), false).toBool(); + bool timeAMPM = _settings->value(QLatin1String("timeAMPM"), false).toBool(); + + // timezone + bool showTimezone = _settings->value(QLatin1String("showTimezone"), false).toBool() && !longTimeFormatSelected; + + QString timezonePosition = _settings->value(QLatin1String("timezonePosition"), QString()).toString(); + QString timezoneFormatType = _settings->value(QLatin1String("timezoneFormatType"), QString()).toString(); + + // date + bool showDate = _settings->value(QLatin1String("showDate"), false).toBool(); + + QString datePosition = _settings->value(QLatin1String("datePosition"), QString()).toString(); + + bool dateShowYear = _settings->value(QLatin1String("dateShowYear"), false).toBool(); + bool dateShowDoW = _settings->value(QLatin1String("dateShowDoW"), false).toBool(); + bool datePadDay = _settings->value(QLatin1String("datePadDay"), false).toBool(); + bool dateLongNames = _settings->value(QLatin1String("dateLongNames"), false).toBool(); + + // advanced + QString customFormat = _settings->value(QLatin1String("customFormat"), tr("''HH:mm:ss'
'ddd, d MMM yyyy'
'TT'
'")).toString(); + + if (advancedManual) + mFormat = customFormat; + else + { + QLocale locale = QLocale(QLocale::AnyLanguage, QLocale().country()); + + if (formatType == QLatin1String("short-timeonly")) + mFormat = locale.timeFormat(QLocale::ShortFormat); + else if (formatType == QLatin1String("long-timeonly")) + mFormat = locale.timeFormat(QLocale::LongFormat); + else // if (formatType == QLatin1String("custom-timeonly")) + mFormat = QString(QLatin1String("%1:mm%2%3")).arg(timePadHour ? QLatin1String("hh") : QLatin1String("h")).arg(timeShowSeconds ? QLatin1String(":ss") : QLatin1String("")).arg(timeAMPM ? QLatin1String(" A") : QLatin1String("")); + + if (showTimezone) + { + QString timezonePortion; + if (timezoneFormatType == QLatin1String("short")) + timezonePortion = QLatin1String("TTTT"); + else if (timezoneFormatType == QLatin1String("long")) + timezonePortion = QLatin1String("TTTTT"); + else if (timezoneFormatType == QLatin1String("offset")) + timezonePortion = QLatin1String("T"); + else if (timezoneFormatType == QLatin1String("abbreviation")) + timezonePortion = QLatin1String("TTT"); + else if (timezoneFormatType == QLatin1String("iana")) + timezonePortion = QLatin1String("TT"); + else // if (timezoneFormatType == QLatin1String("custom")) + timezonePortion = QLatin1String("TTTTTT"); + + if (timezonePosition == QLatin1String("below")) + mFormat = mFormat + QLatin1String("'
'") + timezonePortion; + else if (timezonePosition == QLatin1String("above")) + mFormat = timezonePortion + QLatin1String("'
'") + mFormat; + else if (timezonePosition == QLatin1String("before")) + mFormat = timezonePortion + QLatin1String(" ") + mFormat; + else // if (timezonePosition == QLatin1String("after")) + mFormat = mFormat + QLatin1String(" ") + timezonePortion; + } + + if (showDate) + { + QString datePortion; + if (dateFormatType == QLatin1String("short")) + datePortion = locale.dateFormat(QLocale::ShortFormat); + else if (dateFormatType == QLatin1String("long")) + datePortion = locale.dateFormat(QLocale::LongFormat); + else if (dateFormatType == QLatin1String("iso")) + datePortion = QLatin1String("yyyy-MM-dd"); + else // if (dateFormatType == QLatin1String("custom")) + { + QString datePortionOrder; + QString dateLocale = locale.dateFormat(QLocale::ShortFormat).toLower(); + int yearIndex = dateLocale.indexOf("y"); + int monthIndex = dateLocale.indexOf("m"); + int dayIndex = dateLocale.indexOf("d"); + if (yearIndex < dayIndex) + // Big-endian (year, month, day) (yyyy MMMM dd, dddd) -> in some Asia countires like China or Japan + datePortionOrder = QLatin1String("%1%2%3 %4%5%6"); + else if (monthIndex < dayIndex) + // Middle-endian (month, day, year) (dddd, MMMM dd yyyy) -> USA + datePortionOrder = QLatin1String("%6%5%3 %4%2%1"); + else + // Little-endian (day, month, year) (dddd, dd MMMM yyyy) -> most of Europe + datePortionOrder = QLatin1String("%6%5%4 %3%2%1"); + datePortion = datePortionOrder.arg(dateShowYear ? QLatin1String("yyyy") : QLatin1String("")).arg(dateShowYear ? QLatin1String(" ") : QLatin1String("")).arg(dateLongNames ? QLatin1String("MMMM") : QLatin1String("MMM")).arg(datePadDay ? QLatin1String("dd") : QLatin1String("d")).arg(dateShowDoW ? QLatin1String(", ") : QLatin1String("")).arg(dateShowDoW ? (dateLongNames ? QLatin1String("dddd") : QLatin1String("ddd")) : QLatin1String("")); + } + + if (datePosition == QLatin1String("below")) + mFormat = mFormat + QLatin1String("'
'") + datePortion; + else if (datePosition == QLatin1String("above")) + mFormat = datePortion + QLatin1String("'
'") + mFormat; + else if (datePosition == QLatin1String("before")) + mFormat = datePortion + QLatin1String(" ") + mFormat; + else // if (datePosition == QLatin1String("after")) + mFormat = mFormat + QLatin1String(" ") + datePortion; + } + } + + + if ((oldFormat != mFormat)) + { + int updateInterval = 0; + + QString format = mFormat; + format.replace(QRegExp(QLatin1String("'[^']*'")), QString()); + if (format.contains(QLatin1String("z"))) + updateInterval = 1; + else if (format.contains(QLatin1String("s"))) + updateInterval = 1000; + else + updateInterval = 60000; + + restartTimer(updateInterval); + } + + bool autoRotate = settings()->value(QLatin1String("autoRotate"), true).toBool(); + if (autoRotate != mAutoRotate) + { + mAutoRotate = autoRotate; + realign(); + } + + if (mPopup) + { + updatePopupContent(); + mPopup->adjustSize(); + mPopup->setGeometry(calculatePopupWindowPos(mPopup->size())); + } + + timeout(); +} + +QDialog *LxQtWorldClock::configureDialog() +{ + return new LxQtWorldClockConfiguration(settings()); +} + +void LxQtWorldClock::wheelScrolled(int delta) +{ + if (mTimeZones.count() > 1) + { + mActiveTimeZone = mTimeZones[(mTimeZones.indexOf(mActiveTimeZone) + ((delta > 0) ? -1 : 1) + mTimeZones.size()) % mTimeZones.size()]; + timeout(); + } +} + +void LxQtWorldClock::activated(ActivationReason reason) +{ + switch (reason) + { + case ILxQtPanelPlugin::Trigger: + case ILxQtPanelPlugin::MiddleClick: + break; + + default: + return; + } + + if (!mPopup) + { + mPopup = new LxQtWorldClockPopup(mContent); + connect(mPopup, SIGNAL(deactivated()), SLOT(deletePopup())); + + if (reason == ILxQtPanelPlugin::Trigger) + { + mPopup->setObjectName(QLatin1String("WorldClockCalendar")); + + mPopup->layout()->setContentsMargins(0, 0, 0, 0); + QCalendarWidget *calendarWidget = new QCalendarWidget(mPopup); + mPopup->layout()->addWidget(calendarWidget); + + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + + QTimeZone timeZone(timeZoneName.toLatin1()); + calendarWidget->setFirstDayOfWeek(QLocale(QLocale::AnyLanguage, timeZone.country()).firstDayOfWeek()); + calendarWidget->setSelectedDate(QDateTime::currentDateTime().toTimeZone(timeZone).date()); + } + else + { + mPopup->setObjectName(QLatin1String("WorldClockPopup")); + + mPopupContent = new QLabel(mPopup); + mPopup->layout()->addWidget(mPopupContent); + mPopupContent->setAlignment(mContent->alignment()); + + updatePopupContent(); + } + + mPopup->adjustSize(); + mPopup->setGeometry(calculatePopupWindowPos(mPopup->size())); + + mPopup->show(); + } + else + { + deletePopup(); + } +} + +void LxQtWorldClock::deletePopup() +{ + mPopupContent = NULL; + mPopup->deleteLater(); + mPopup = NULL; +} + +QString LxQtWorldClock::formatDateTime(const QDateTime &datetime, const QString &timeZoneName) +{ + QTimeZone timeZone(timeZoneName.toLatin1()); + QDateTime tzNow = datetime.toTimeZone(timeZone); + return tzNow.toString(preformat(mFormat, timeZone, tzNow)); +} + +void LxQtWorldClock::updatePopupContent() +{ + if (mPopupContent) + { + QDateTime now = QDateTime::currentDateTime(); + QStringList allTimeZones; + bool hasTimeZone = formatHasTimeZone(mFormat); + + foreach (QString timeZoneName, mTimeZones) + { + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + + QString formatted = formatDateTime(now, timeZoneName); + + if (!hasTimeZone) + formatted += QLatin1String("
") + QString::fromLatin1(QTimeZone(timeZoneName.toLatin1()).id()); + + allTimeZones.append(formatted); + } + + mPopupContent->setText(allTimeZones.join(QLatin1String("
"))); + } +} + +bool LxQtWorldClock::formatHasTimeZone(QString format) +{ + format.replace(QRegExp(QLatin1String("'[^']*'")), QString()); + return format.toLower().contains(QLatin1String("t")); +} + +QString LxQtWorldClock::preformat(const QString &format, const QTimeZone &timeZone, const QDateTime &dateTime) +{ + QString result = format; + int from = 0; + for (;;) + { + int apos = result.indexOf(QLatin1Char('\''), from); + int tz = result.indexOf(QLatin1Char('T'), from); + if ((apos != -1) && (tz != -1)) + { + if (apos > tz) + apos = -1; + else + tz = -1; + } + if (apos != -1) + { + from = apos + 1; + apos = result.indexOf(QLatin1Char('\''), from); + if (apos == -1) // misformat + break; + from = apos + 1; + } + else if (tz != -1) + { + int length = 1; + for (; result[tz + length] == QLatin1Char('T'); ++length); + if (length > 6) + length = 6; + QString replacement; + switch (length) + { + case 1: + replacement = timeZone.displayName(dateTime, QTimeZone::OffsetName); + if (replacement.startsWith(QLatin1String("UTC"))) + replacement = replacement.mid(3); + break; + + case 2: + replacement = QString::fromLatin1(timeZone.id()); + break; + + case 3: + replacement = timeZone.abbreviation(dateTime); + break; + + case 4: + replacement = timeZone.displayName(dateTime, QTimeZone::ShortName); + break; + + case 5: + replacement = timeZone.displayName(dateTime, QTimeZone::LongName); + break; + + case 6: + replacement = mTimeZoneCustomNames[QString::fromLatin1(timeZone.id())]; + } + + if ((tz > 0) && (result[tz - 1] == QLatin1Char('\''))) + { + --tz; + ++length; + } + else + replacement.prepend(QLatin1Char('\'')); + + if (result[tz + length] == QLatin1Char('\'')) + ++length; + else + replacement.append(QLatin1Char('\'')); + + result.replace(tz, length, replacement); + from = tz + replacement.length(); + } + else + break; + } + return result; +} + +void LxQtWorldClock::realign() +{ + if (mAutoRotate) + switch (panel()->position()) + { + case ILxQtPanel::PositionTop: + case ILxQtPanel::PositionBottom: + mRotatedWidget->setOrigin(Qt::TopLeftCorner); + break; + + case ILxQtPanel::PositionLeft: + mRotatedWidget->setOrigin(Qt::BottomLeftCorner); + break; + + case ILxQtPanel::PositionRight: + mRotatedWidget->setOrigin(Qt::TopRightCorner); + break; + } + else + mRotatedWidget->setOrigin(Qt::TopLeftCorner); +} + +ActiveLabel::ActiveLabel(QWidget *parent) : + QLabel(parent) +{ +} + +void ActiveLabel::wheelEvent(QWheelEvent *event) +{ + emit wheelScrolled(event->delta()); + + QLabel::wheelEvent(event); +} + +void ActiveLabel::mouseReleaseEvent(QMouseEvent* event) +{ + switch (event->button()) + { + case Qt::LeftButton: + emit leftMouseButtonClicked(); + break; + + case Qt::MidButton: + emit middleMouseButtonClicked(); + break; + + default:; + } + + QLabel::mouseReleaseEvent(event); +} + +LxQtWorldClockPopup::LxQtWorldClockPopup(QWidget *parent) : + QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) +{ + setLayout(new QHBoxLayout(this)); + layout()->setMargin(1); +} + +void LxQtWorldClockPopup::show() +{ + QDialog::show(); + activateWindow(); +} + +bool LxQtWorldClockPopup::event(QEvent *event) +{ + if (event->type() == QEvent::WindowDeactivate) + emit deactivated(); + + return QDialog::event(event); +} diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclock.h b/lxqt-panel/plugin-worldclock/lxqtworldclock.h new file mode 100644 index 0000000..ee9206b --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclock.h @@ -0,0 +1,144 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012-2013 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PANEL_WORLDCLOCK_H +#define LXQT_PANEL_WORLDCLOCK_H + +#include + +#include +#include + +#include + +#include "../panel/ilxqtpanelplugin.h" +#include "lxqtworldclockconfiguration.h" + + +class ActiveLabel; +class QTimer; +class LxQtWorldClockPopup; + + +class LxQtWorldClock : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + LxQtWorldClock(const ILxQtPanelPluginStartupInfo &startupInfo); + ~LxQtWorldClock(); + + virtual QWidget *widget() { return mMainWidget; } + virtual QString themeId() const { return QLatin1String("WorldClock"); } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } + bool isSeparate() const { return true; } + void activated(ActivationReason reason); + + virtual void settingsChanged(); + virtual void realign(); + QDialog *configureDialog(); + +private slots: + void timeout(); + void wheelScrolled(int); + void deletePopup(); + +private: + QWidget *mMainWidget; + LxQt::RotatedWidget* mRotatedWidget; + ActiveLabel *mContent; + LxQtWorldClockPopup* mPopup; + + QTimer *mTimer; + int mUpdateInterval; + qint64 mLastUpdate; + + QStringList mTimeZones; + QMap mTimeZoneCustomNames; + QString mDefaultTimeZone; + QString mActiveTimeZone; + QString mFormat; + + bool mAutoRotate; + QLabel *mPopupContent; + + void restartTimer(int); + + QString formatDateTime(const QDateTime &datetime, const QString &timeZoneName); + void updatePopupContent(); + bool formatHasTimeZone(QString format); + QString preformat(const QString &format, const QTimeZone &timeZone, const QDateTime& dateTime); +}; + + +class ActiveLabel : public QLabel +{ +Q_OBJECT + +public: + explicit ActiveLabel(QWidget * = NULL); + +signals: + void wheelScrolled(int); + void leftMouseButtonClicked(); + void middleMouseButtonClicked(); + +protected: + void wheelEvent(QWheelEvent *); + void mouseReleaseEvent(QMouseEvent* event); +}; + +class LxQtWorldClockPopup : public QDialog +{ + Q_OBJECT + +public: + LxQtWorldClockPopup(QWidget *parent = 0); + + void show(); + +signals: + void deactivated(); + +protected: + virtual bool event(QEvent* ); + +}; + +class LxQtWorldClockLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new LxQtWorldClock(startupInfo); + } +}; + +#endif // LXQT_PANEL_WORLDCLOCK_H diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.cpp b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.cpp new file mode 100644 index 0000000..7e215aa --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.cpp @@ -0,0 +1,670 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "lxqtworldclockconfiguration.h" + +#include "ui_lxqtworldclockconfiguration.h" + +#include "lxqtworldclockconfigurationtimezones.h" +#include "lxqtworldclockconfigurationmanualformat.h" + +#include + + +LxQtWorldClockConfiguration::LxQtWorldClockConfiguration(QSettings *settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtWorldClockConfiguration), + mSettings(settings), + mOldSettings(settings), + mLockCascadeSettingChanges(false), + mConfigurationTimeZones(NULL), + mConfigurationManualFormat(NULL) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName(QLatin1String("WorldClockConfigurationWindow")); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + connect(ui->timeFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->timeShowSecondsCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->timePadHourCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->timeAMPMCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->timezoneGB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->timezonePositionCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->timezoneFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->dateGB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->datePositionCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->dateFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(saveSettings())); + connect(ui->dateShowYearCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->dateShowDoWCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->datePadDayCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->dateLongNamesCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->advancedManualGB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->customisePB, SIGNAL(clicked()), SLOT(customiseManualFormatClicked())); + + + connect(ui->timeFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(timeFormatChanged(int))); + connect(ui->dateGB, SIGNAL(toggled(bool)), SLOT(dateGroupToggled(bool))); + connect(ui->dateFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(dateFormatChanged(int))); + connect(ui->advancedManualGB, SIGNAL(toggled(bool)), SLOT(advancedFormatToggled(bool))); + + connect(ui->timeZonesTW, SIGNAL(itemSelectionChanged()), SLOT(updateTimeZoneButtons())); + connect(ui->addPB, SIGNAL(clicked()), SLOT(addTimeZone())); + connect(ui->removePB, SIGNAL(clicked()), SLOT(removeTimeZone())); + connect(ui->setAsDefaultPB, SIGNAL(clicked()), SLOT(setTimeZoneAsDefault())); + connect(ui->editCustomNamePB, SIGNAL(clicked()), SLOT(editTimeZoneCustomName())); + connect(ui->moveUpPB, SIGNAL(clicked()), SLOT(moveTimeZoneUp())); + connect(ui->moveDownPB, SIGNAL(clicked()), SLOT(moveTimeZoneDown())); + + connect(ui->autorotateCB, SIGNAL(clicked()), SLOT(saveSettings())); + + loadSettings(); +} + +LxQtWorldClockConfiguration::~LxQtWorldClockConfiguration() +{ + delete ui; +} + +void LxQtWorldClockConfiguration::loadSettings() +{ + mLockCascadeSettingChanges = true; + + bool longTimeFormatSelected = false; + + QString formatType = mSettings->value(QLatin1String("formatType"), QString()).toString(); + QString dateFormatType = mSettings->value(QLatin1String("dateFormatType"), QString()).toString(); + bool advancedManual = mSettings->value(QLatin1String("useAdvancedManualFormat"), false).toBool(); + mManualFormat = mSettings->value(QLatin1String("customFormat"), tr("''HH:mm:ss'
'ddd, d MMM yyyy'
'TT'
'")).toString(); + + // backward compatibility + if (formatType == QLatin1String("custom")) + { + formatType = QLatin1String("short-timeonly"); + dateFormatType = QLatin1String("short"); + advancedManual = true; + } + else if (formatType == QLatin1String("short")) + { + formatType = QLatin1String("short-timeonly"); + dateFormatType = QLatin1String("short"); + advancedManual = false; + } + else if ((formatType == QLatin1String("full")) || + (formatType == QLatin1String("long")) || + (formatType == QLatin1String("medium"))) + { + formatType = QLatin1String("long-timeonly"); + dateFormatType = QLatin1String("long"); + advancedManual = false; + } + + + if (formatType == QLatin1String("short-timeonly")) + ui->timeFormatCB->setCurrentIndex(0); + else if (formatType == QLatin1String("long-timeonly")) + { + ui->timeFormatCB->setCurrentIndex(1); + longTimeFormatSelected = true; + } + else // if (formatType == QLatin1String("custom-timeonly")) + ui->timeFormatCB->setCurrentIndex(2); + + ui->timeShowSecondsCB->setChecked(mSettings->value(QLatin1String("timeShowSeconds"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + ui->timePadHourCB->setChecked(mSettings->value(QLatin1String("timePadHour"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + ui->timeAMPMCB->setChecked(mSettings->value(QLatin1String("timeAMPM"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + + bool customTimeFormatSelected = ui->timeFormatCB->currentIndex() == ui->timeFormatCB->count() - 1; + ui->timeCustomW->setEnabled(customTimeFormatSelected); + + ui->timezoneGB->setEnabled(!longTimeFormatSelected); + + // timezone + ui->timezoneGB->setChecked(mSettings->value(QLatin1String("showTimezone"), false).toBool() && !longTimeFormatSelected); + + QString timezonePosition = mSettings->value(QLatin1String("timezonePosition"), QString()).toString(); + if (timezonePosition == QLatin1String("above")) + ui->timezonePositionCB->setCurrentIndex(1); + else if (timezonePosition == QLatin1String("before")) + ui->timezonePositionCB->setCurrentIndex(2); + else if (timezonePosition == QLatin1String("after")) + ui->timezonePositionCB->setCurrentIndex(3); + else // if (timezonePosition == QLatin1String("below")) + ui->timezonePositionCB->setCurrentIndex(0); + + QString timezoneFormatType = mSettings->value(QLatin1String("timezoneFormatType"), QString()).toString(); + if (timezoneFormatType == QLatin1String("short")) + ui->timezoneFormatCB->setCurrentIndex(0); + else if (timezoneFormatType == QLatin1String("long")) + ui->timezoneFormatCB->setCurrentIndex(1); + else if (timezoneFormatType == QLatin1String("offset")) + ui->timezoneFormatCB->setCurrentIndex(2); + else if (timezoneFormatType == QLatin1String("abbreviation")) + ui->timezoneFormatCB->setCurrentIndex(3); + else // if (timezoneFormatType == QLatin1String("iana")) + ui->timezoneFormatCB->setCurrentIndex(4); + + // date + bool dateIsChecked = mSettings->value(QLatin1String("showDate"), false).toBool(); + ui->dateGB->setChecked(dateIsChecked); + + QString datePosition = mSettings->value(QLatin1String("datePosition"), QString()).toString(); + if (datePosition == QLatin1String("above")) + ui->datePositionCB->setCurrentIndex(1); + else if (datePosition == QLatin1String("before")) + ui->datePositionCB->setCurrentIndex(2); + else if (datePosition == QLatin1String("after")) + ui->datePositionCB->setCurrentIndex(3); + else // if (datePosition == QLatin1String("below")) + ui->datePositionCB->setCurrentIndex(0); + + if (dateFormatType == QLatin1String("short")) + ui->dateFormatCB->setCurrentIndex(0); + else if (dateFormatType == QLatin1String("long")) + ui->dateFormatCB->setCurrentIndex(1); + else if (dateFormatType == QLatin1String("iso")) + ui->dateFormatCB->setCurrentIndex(2); + else // if (dateFormatType == QLatin1String("custom")) + ui->dateFormatCB->setCurrentIndex(3); + + ui->dateShowYearCB->setChecked(mSettings->value(QLatin1String("dateShowYear"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + ui->dateShowDoWCB->setChecked(mSettings->value(QLatin1String("dateShowDoW"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + ui->datePadDayCB->setChecked(mSettings->value(QLatin1String("datePadDay"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + ui->dateLongNamesCB->setChecked(mSettings->value(QLatin1String("dateLongNames"), false).toBool() ? Qt::Checked : Qt:: Unchecked); + + bool customDateFormatSelected = ui->dateFormatCB->currentIndex() == ui->dateFormatCB->count() - 1; + ui->dateCustomW->setEnabled(dateIsChecked && customDateFormatSelected); + + + ui->advancedManualGB->setChecked(advancedManual); + + + mDefaultTimeZone = mSettings->value("defaultTimeZone", QString()).toString(); + + ui->timeZonesTW->setRowCount(0); + + int size = mSettings->beginReadArray(QLatin1String("timeZones")); + for (int i = 0; i < size; ++i) + { + mSettings->setArrayIndex(i); + ui->timeZonesTW->setRowCount(ui->timeZonesTW->rowCount() + 1); + + QString timeZoneName = mSettings->value(QLatin1String("timeZone"), QString()).toString(); + if (mDefaultTimeZone.isEmpty()) + mDefaultTimeZone = timeZoneName; + + ui->timeZonesTW->setItem(i, 0, new QTableWidgetItem(timeZoneName)); + ui->timeZonesTW->setItem(i, 1, new QTableWidgetItem(mSettings->value(QLatin1String("customName"), QString()).toString())); + + setBold(i, mDefaultTimeZone == timeZoneName); + } + mSettings->endArray(); + + ui->timeZonesTW->resizeColumnsToContents(); + + + ui->autorotateCB->setChecked(mSettings->value("autoRotate", true).toBool()); + + + mLockCascadeSettingChanges = false; +} + +void LxQtWorldClockConfiguration::saveSettings() +{ + if (mLockCascadeSettingChanges) + return; + + QString formatType; + switch (ui->timeFormatCB->currentIndex()) + { + case 0: + formatType = QLatin1String("short-timeonly"); + break; + + case 1: + formatType = QLatin1String("long-timeonly"); + break; + + case 2: + formatType = QLatin1String("custom-timeonly"); + break; + } + mSettings->setValue(QLatin1String("formatType"), formatType); + + mSettings->setValue(QLatin1String("timeShowSeconds"), ui->timeShowSecondsCB->isChecked()); + mSettings->setValue(QLatin1String("timePadHour"), ui->timePadHourCB->isChecked()); + mSettings->setValue(QLatin1String("timeAMPM"), ui->timeAMPMCB->isChecked()); + + mSettings->setValue(QLatin1String("showTimezone"), ui->timezoneGB->isChecked()); + + QString timezonePosition; + switch (ui->timezonePositionCB->currentIndex()) + { + case 0: + timezonePosition = QLatin1String("below"); + break; + + case 1: + timezonePosition = QLatin1String("above"); + break; + + case 2: + timezonePosition = QLatin1String("before"); + break; + + case 3: + timezonePosition = QLatin1String("after"); + break; + } + mSettings->setValue(QLatin1String("timezonePosition"), timezonePosition); + + QString timezoneFormatType; + switch (ui->timezoneFormatCB->currentIndex()) + { + case 0: + timezoneFormatType = QLatin1String("short"); + break; + + case 1: + timezoneFormatType = QLatin1String("long"); + break; + + case 2: + timezoneFormatType = QLatin1String("offset"); + break; + + case 3: + timezoneFormatType = QLatin1String("abbreviation"); + break; + + case 4: + timezoneFormatType = QLatin1String("iana"); + break; + } + mSettings->setValue(QLatin1String("timezoneFormatType"), timezoneFormatType); + + mSettings->setValue(QLatin1String("showDate"), ui->dateGB->isChecked()); + + QString datePosition; + switch (ui->datePositionCB->currentIndex()) + { + case 0: + datePosition = QLatin1String("below"); + break; + + case 1: + datePosition = QLatin1String("above"); + break; + + case 2: + datePosition = QLatin1String("before"); + break; + + case 3: + datePosition = QLatin1String("after"); + break; + } + mSettings->setValue(QLatin1String("datePosition"), datePosition); + + QString dateFormatType; + switch (ui->dateFormatCB->currentIndex()) + { + case 0: + dateFormatType = QLatin1String("short"); + break; + + case 1: + dateFormatType = QLatin1String("long"); + break; + + case 2: + dateFormatType = QLatin1String("iso"); + break; + + case 3: + dateFormatType = QLatin1String("custom"); + break; + } + mSettings->setValue(QLatin1String("dateFormatType"), dateFormatType); + + mSettings->setValue(QLatin1String("dateShowYear"), ui->dateShowYearCB->isChecked()); + mSettings->setValue(QLatin1String("dateShowDoW"), ui->dateShowDoWCB->isChecked()); + mSettings->setValue(QLatin1String("datePadDay"), ui->datePadDayCB->isChecked()); + mSettings->setValue(QLatin1String("dateLongNames"), ui->dateLongNamesCB->isChecked()); + + mSettings->setValue(QLatin1String("customFormat"), mManualFormat); + + + mSettings->remove(QLatin1String("timeZones")); + + int size = ui->timeZonesTW->rowCount(); + mSettings->beginWriteArray(QLatin1String("timeZones"), size); + for (int i = 0; i < size; ++i) + { + mSettings->setArrayIndex(i); + mSettings->setValue(QLatin1String("timeZone"), ui->timeZonesTW->item(i, 0)->text()); + mSettings->setValue(QLatin1String("customName"), ui->timeZonesTW->item(i, 1)->text()); + } + mSettings->endArray(); + + mSettings->setValue(QLatin1String("defaultTimeZone"), mDefaultTimeZone); + + + mSettings->setValue(QLatin1String("useAdvancedManualFormat"), ui->advancedManualGB->isChecked()); + + + mSettings->setValue(QLatin1String("autoRotate"), ui->autorotateCB->isChecked()); +} + +void LxQtWorldClockConfiguration::dialogButtonsAction(QAbstractButton *button) +{ + if (ui->buttons->buttonRole(button) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + close(); +} + +void LxQtWorldClockConfiguration::timeFormatChanged(int index) +{ + bool longTimeFormatSelected = index == 1; + bool customTimeFormatSelected = index == 2; + ui->timeCustomW->setEnabled(customTimeFormatSelected); + ui->timezoneGB->setEnabled(!longTimeFormatSelected); +} + +void LxQtWorldClockConfiguration::dateGroupToggled(bool dateIsChecked) +{ + bool customDateFormatSelected = ui->dateFormatCB->currentIndex() == ui->dateFormatCB->count() - 1; + ui->dateCustomW->setEnabled(dateIsChecked && customDateFormatSelected); +} + +void LxQtWorldClockConfiguration::dateFormatChanged(int index) +{ + bool customDateFormatSelected = index == ui->dateFormatCB->count() - 1; + bool dateIsChecked = ui->dateGB->isChecked(); + ui->dateCustomW->setEnabled(dateIsChecked && customDateFormatSelected); +} + +void LxQtWorldClockConfiguration::advancedFormatToggled(bool on) +{ + bool longTimeFormatSelected = ui->timeFormatCB->currentIndex() == 1; + ui->timeGB->setEnabled(!on); + ui->timezoneGB->setEnabled(!on && !longTimeFormatSelected); + ui->dateGB->setEnabled(!on); +} + +void LxQtWorldClockConfiguration::customiseManualFormatClicked() +{ + if (!mConfigurationManualFormat) + { + mConfigurationManualFormat = new LxQtWorldClockConfigurationManualFormat(this); + connect(mConfigurationManualFormat, SIGNAL(manualFormatChanged()), this, SLOT(manualFormatChanged())); + } + + mConfigurationManualFormat->setManualFormat(mManualFormat); + + QString oldManualFormat = mManualFormat; + + mManualFormat = (mConfigurationManualFormat->exec() == QDialog::Accepted) ? mConfigurationManualFormat->manualFormat() : oldManualFormat; + + saveSettings(); +} + +void LxQtWorldClockConfiguration::manualFormatChanged() +{ + mManualFormat = mConfigurationManualFormat->manualFormat(); + saveSettings(); +} + +void LxQtWorldClockConfiguration::updateTimeZoneButtons() +{ + QList selectedItems = ui->timeZonesTW->selectedItems(); + int selectedCount = selectedItems.count() / 2; + int allCount = ui->timeZonesTW->rowCount(); + + ui->removePB->setEnabled(selectedCount != 0); + bool canSetAsDefault = (selectedCount == 1); + if (canSetAsDefault) + { + if (selectedItems[0]->column() == 0) + canSetAsDefault = (selectedItems[0]->text() != mDefaultTimeZone); + else + canSetAsDefault = (selectedItems[1]->text() != mDefaultTimeZone); + } + + bool canMoveUp = false; + bool canMoveDown = false; + if ((selectedCount != 0) && (selectedCount != allCount)) + { + bool skipBottom = true; + for (int i = allCount - 1; i >= 0; --i) + { + if (ui->timeZonesTW->item(i, 0)->isSelected()) + { + if (!skipBottom) + { + canMoveDown = true; + break; + } + } + else + skipBottom = false; + } + + bool skipTop = true; + for (int i = 0; i < allCount; ++i) + { + if (ui->timeZonesTW->item(i, 0)->isSelected()) + { + if (!skipTop) + { + canMoveUp = true; + break; + } + } + else + skipTop = false; + } + } + ui->setAsDefaultPB->setEnabled(canSetAsDefault); + ui->editCustomNamePB->setEnabled(selectedCount == 1); + ui->moveUpPB->setEnabled(canMoveUp); + ui->moveDownPB->setEnabled(canMoveDown); +} + +int LxQtWorldClockConfiguration::findTimeZone(const QString& timeZone) +{ + QList items = ui->timeZonesTW->findItems(timeZone, Qt::MatchExactly); + foreach (QTableWidgetItem* item, items) + if (item->column() == 0) + return item->row(); + return -1; +} + +void LxQtWorldClockConfiguration::addTimeZone() +{ + if (!mConfigurationTimeZones) + mConfigurationTimeZones = new LxQtWorldClockConfigurationTimeZones(this); + + if (mConfigurationTimeZones->updateAndExec() == QDialog::Accepted) + { + QString timeZone = mConfigurationTimeZones->timeZone(); + if (timeZone != QString()) + { + if (findTimeZone(timeZone) == -1) + { + int row = ui->timeZonesTW->rowCount(); + ui->timeZonesTW->setRowCount(row + 1); + QTableWidgetItem *item = new QTableWidgetItem(timeZone); + ui->timeZonesTW->setItem(row, 0, item); + ui->timeZonesTW->setItem(row, 1, new QTableWidgetItem(QString())); + if (mDefaultTimeZone.isEmpty()) + setDefault(row); + } + } + } + + saveSettings(); +} + +void LxQtWorldClockConfiguration::removeTimeZone() +{ + foreach (QTableWidgetItem *item, ui->timeZonesTW->selectedItems()) + if (item->column() == 0) + { + if (item->text() == mDefaultTimeZone) + mDefaultTimeZone.clear(); + ui->timeZonesTW->removeRow(item->row()); + } + + if ((mDefaultTimeZone.isEmpty()) && ui->timeZonesTW->rowCount()) + setDefault(0); + + saveSettings(); +} + +void LxQtWorldClockConfiguration::setBold(QTableWidgetItem *item, bool value) +{ + if (item) + { + QFont font = item->font(); + font.setBold(value); + item->setFont(font); + } +} + +void LxQtWorldClockConfiguration::setBold(int row, bool value) +{ + setBold(ui->timeZonesTW->item(row, 0), value); + setBold(ui->timeZonesTW->item(row, 1), value); +} + +void LxQtWorldClockConfiguration::setDefault(int row) +{ + setBold(row, true); + mDefaultTimeZone = ui->timeZonesTW->item(row, 0)->text(); +} + +void LxQtWorldClockConfiguration::setTimeZoneAsDefault() +{ + setBold(findTimeZone(mDefaultTimeZone), false); + + setDefault(ui->timeZonesTW->selectedItems()[0]->row()); + + saveSettings(); +} + +void LxQtWorldClockConfiguration::editTimeZoneCustomName() +{ + int row = ui->timeZonesTW->selectedItems()[0]->row(); + + QString oldName = ui->timeZonesTW->item(row, 1)->text(); + + QInputDialog d(this); + d.setWindowTitle(tr("Input custom time zone name")); + d.setLabelText(tr("Custom name")); + d.setTextValue(oldName); + d.setWindowModality(Qt::WindowModal); + if (d.exec()) + { + ui->timeZonesTW->item(row, 1)->setText(d.textValue()); + + saveSettings(); + } +} + +void LxQtWorldClockConfiguration::moveTimeZoneUp() +{ + int m = ui->timeZonesTW->rowCount(); + bool skipTop = true; + for (int i = 0; i < m; ++i) + { + if (ui->timeZonesTW->item(i, 0)->isSelected()) + { + if (!skipTop) + { + QTableWidgetItem *itemP0 = ui->timeZonesTW->takeItem(i - 1, 0); + QTableWidgetItem *itemP1 = ui->timeZonesTW->takeItem(i - 1, 1); + QTableWidgetItem *itemT0 = ui->timeZonesTW->takeItem(i, 0); + QTableWidgetItem *itemT1 = ui->timeZonesTW->takeItem(i, 1); + + ui->timeZonesTW->setItem(i - 1, 0, itemT0); + ui->timeZonesTW->setItem(i - 1, 1, itemT1); + ui->timeZonesTW->setItem(i, 0, itemP0); + ui->timeZonesTW->setItem(i, 1, itemP1); + + itemT0->setSelected(true); + itemT1->setSelected(true); + itemP0->setSelected(false); + itemP1->setSelected(false); + } + } + else + skipTop = false; + } + + saveSettings(); +} + +void LxQtWorldClockConfiguration::moveTimeZoneDown() +{ + int m = ui->timeZonesTW->rowCount(); + bool skipBottom = true; + for (int i = m - 1; i >= 0; --i) + { + if (ui->timeZonesTW->item(i, 0)->isSelected()) + { + if (!skipBottom) + { + QTableWidgetItem *itemN0 = ui->timeZonesTW->takeItem(i + 1, 0); + QTableWidgetItem *itemN1 = ui->timeZonesTW->takeItem(i + 1, 1); + QTableWidgetItem *itemT0 = ui->timeZonesTW->takeItem(i, 0); + QTableWidgetItem *itemT1 = ui->timeZonesTW->takeItem(i, 1); + + ui->timeZonesTW->setItem(i + 1, 0, itemT0); + ui->timeZonesTW->setItem(i + 1, 1, itemT1); + ui->timeZonesTW->setItem(i, 0, itemN0); + ui->timeZonesTW->setItem(i, 1, itemN1); + + itemT0->setSelected(true); + itemT1->setSelected(true); + itemN0->setSelected(false); + itemN1->setSelected(false); + } + } + else + skipBottom = false; + } + + saveSettings(); +} diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.h b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.h new file mode 100644 index 0000000..69e5428 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.h @@ -0,0 +1,106 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H +#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H + +#include + +#include +#include +#include +#include + + +namespace Ui { + class LxQtWorldClockConfiguration; +} + +class LxQtWorldClockConfigurationTimeZones; +class LxQtWorldClockConfigurationManualFormat; +class QTableWidgetItem; + +class LxQtWorldClockConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtWorldClockConfiguration(QSettings *settings, QWidget *parent = NULL); + ~LxQtWorldClockConfiguration(); + +public slots: + void saveSettings(); + +private: + Ui::LxQtWorldClockConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + + /* + Read settings from conf file and put data into controls. + */ + void loadSettings(); + +private slots: + /* + Saves settings in conf file. + */ + void dialogButtonsAction(QAbstractButton *); + + void timeFormatChanged(int); + void dateGroupToggled(bool); + void dateFormatChanged(int); + void advancedFormatToggled(bool); + void customiseManualFormatClicked(); + void manualFormatChanged(); + + void updateTimeZoneButtons(); + void addTimeZone(); + void removeTimeZone(); + void setTimeZoneAsDefault(); + void editTimeZoneCustomName(); + void moveTimeZoneUp(); + void moveTimeZoneDown(); + +private: + QString mDefaultTimeZone; + + bool mLockCascadeSettingChanges; + + LxQtWorldClockConfigurationTimeZones *mConfigurationTimeZones; + LxQtWorldClockConfigurationManualFormat *mConfigurationManualFormat; + + QString mManualFormat; + + void setDefault(int); + void setBold(QTableWidgetItem*, bool); + void setBold(int row, bool value); + int findTimeZone(const QString& timeZone); +}; + +#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.ui b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.ui new file mode 100644 index 0000000..e9994c9 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfiguration.ui @@ -0,0 +1,631 @@ + + + LxQtWorldClockConfiguration + + + + 0 + 0 + 600 + 686 + + + + World Clock Settings + + + + + + 0 + + + + Display &format + + + + + + &Time + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + F&ormat: + + + timeFormatCB + + + + + + + + Short + + + + + Long + + + + + Custom + + + + + + + + + + + false + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Sho&w seconds + + + + + + + Pad &hour with zero + + + + + + + &Use 12-hour format + + + + + + + + + + + + + T&ime zone + + + true + + + false + + + + + + &Position: + + + timezonePositionCB + + + + + + + For&mat: + + + timezoneFormatCB + + + + + + + + Below + + + + + Above + + + + + Before + + + + + After + + + + + + + + 0 + + + + Short + + + + + Long + + + + + Offset from UTC + + + + + Abbreviation + + + + + Location identifier + + + + + Custom name + + + + + + + + + + + &Date + + + true + + + false + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Po&sition: + + + datePositionCB + + + + + + + + Below + + + + + Above + + + + + Before + + + + + After + + + + + + + + Fo&rmat: + + + dateFormatCB + + + + + + + + Short + + + + + Long + + + + + ISO 8601 + + + + + Custom + + + + + + + + + + + false + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Show &year + + + + + + + Show day of wee&k + + + + + + + Pad d&ay with zero + + + + + + + &Long month and day of week names + + + + + + + + + + + + + Ad&vanced manual format + + + true + + + false + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Customise ... + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Time &zones + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + 2 + + + true + + + false + + + + IANA id + + + + + Custom name + + + + + + + + + + &Add ... + + + + + + + false + + + &Remove + + + + + + + false + + + Set as &default + + + + + + + false + + + &Edit custom name ... + + + + + + + false + + + Move &up + + + + + + + false + + + Move do&wn + + + + + + + Qt::Vertical + + + + 1 + 0 + + + + + + + + + + + &General + + + + + + Auto&rotate when the panel is vertical + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + tabWidget + timeFormatCB + timeShowSecondsCB + timePadHourCB + timeAMPMCB + timezoneGB + timezonePositionCB + timezoneFormatCB + dateGB + datePositionCB + dateFormatCB + dateShowYearCB + dateShowDoWCB + datePadDayCB + dateLongNamesCB + advancedManualGB + customisePB + timeZonesTW + addPB + removePB + setAsDefaultPB + editCustomNamePB + moveUpPB + moveDownPB + autorotateCB + buttons + + + + + buttons + accepted() + LxQtWorldClockConfiguration + accept() + + + 104 + 438 + + + 97 + 253 + + + + + buttons + rejected() + LxQtWorldClockConfiguration + reject() + + + 85 + 438 + + + 62 + 253 + + + + + + maximumNetSpeedChanged(QString) + on_typeCOB_currentIndexChanged(int) + on_sourceCOB_currentIndexChanged(int) + on_maximumHS_valueChanged(int) + saveSettings() + + diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp new file mode 100644 index 0000000..774920e --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp @@ -0,0 +1,61 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include + +#include "lxqtworldclockconfigurationmanualformat.h" + +#include "ui_lxqtworldclockconfigurationmanualformat.h" + + +LxQtWorldClockConfigurationManualFormat::LxQtWorldClockConfigurationManualFormat(QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtWorldClockConfigurationManualFormat) +{ + setObjectName("WorldClockConfigurationManualFormatWindow"); + setWindowModality(Qt::WindowModal); + ui->setupUi(this); + + connect(ui->manualFormatPTE, SIGNAL(textChanged()), this, SIGNAL(manualFormatChanged())); +} + +LxQtWorldClockConfigurationManualFormat::~LxQtWorldClockConfigurationManualFormat() +{ + delete ui; +} + +void LxQtWorldClockConfigurationManualFormat::setManualFormat(const QString& text) +{ + ui->manualFormatPTE->setPlainText(text); +} + +QString LxQtWorldClockConfigurationManualFormat::manualFormat() const +{ + return ui->manualFormatPTE->toPlainText(); +} diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.h b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.h new file mode 100644 index 0000000..62572ee --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.h @@ -0,0 +1,62 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H +#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H + +#include +#include + + +namespace Ui { + class LxQtWorldClockConfigurationManualFormat; +} + +class QTreeWidgetItem; + +class LxQtWorldClockConfigurationManualFormat : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtWorldClockConfigurationManualFormat(QWidget *parent = NULL); + ~LxQtWorldClockConfigurationManualFormat(); + + void setManualFormat(const QString&); + + QString manualFormat() const; + +signals: + void manualFormatChanged(); + +private: + Ui::LxQtWorldClockConfigurationManualFormat *ui; +}; + +#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.ui b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.ui new file mode 100644 index 0000000..c95c4c7 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationmanualformat.ui @@ -0,0 +1,190 @@ + + + LxQtWorldClockConfigurationManualFormat + + + + 0 + 0 + 800 + 500 + + + + World Clock Time Zones + + + + + + Qt::Vertical + + + false + + + + + 0 + 1 + + + + + 0 + 100 + + + + + + + 0 + 100 + + + + + 0 + 100 + + + + Qt::ScrollBarAlwaysOff + + + true + + + + + 0 + 0 + 766 + 1050 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + Qt::RichText + + + true + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + manualFormatPTE + scrollArea + buttons + + + + + buttons + accepted() + LxQtWorldClockConfigurationManualFormat + accept() + + + 95 + 490 + + + 97 + 253 + + + + + buttons + rejected() + LxQtWorldClockConfigurationManualFormat + reject() + + + 76 + 490 + + + 62 + 253 + + + + + + maximumNetSpeedChanged(QString) + on_typeCOB_currentIndexChanged(int) + on_sourceCOB_currentIndexChanged(int) + on_maximumHS_valueChanged(int) + saveSettings() + + diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp new file mode 100644 index 0000000..bbf9eb3 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp @@ -0,0 +1,135 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include + +#include "lxqtworldclockconfigurationtimezones.h" + +#include "ui_lxqtworldclockconfigurationtimezones.h" + + +LxQtWorldClockConfigurationTimeZones::LxQtWorldClockConfigurationTimeZones(QWidget *parent) : + QDialog(parent), + ui(new Ui::LxQtWorldClockConfigurationTimeZones) +{ + setObjectName("WorldClockConfigurationTimeZonesWindow"); + setWindowModality(Qt::WindowModal); + ui->setupUi(this); + + connect(ui->timeZonesTW, SIGNAL(itemSelectionChanged()), SLOT(itemSelectionChanged())); + connect(ui->timeZonesTW, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemDoubleClicked(QTreeWidgetItem*,int))); +} + +LxQtWorldClockConfigurationTimeZones::~LxQtWorldClockConfigurationTimeZones() +{ + delete ui; +} + +QString LxQtWorldClockConfigurationTimeZones::timeZone() +{ + return mTimeZone; +} + +void LxQtWorldClockConfigurationTimeZones::itemSelectionChanged() +{ + QList items = ui->timeZonesTW->selectedItems(); + if (!items.empty()) + mTimeZone = items[0]->data(0, Qt::UserRole).toString(); + else + mTimeZone.clear(); +} + +void LxQtWorldClockConfigurationTimeZones::itemDoubleClicked(QTreeWidgetItem* /*item*/, int /*column*/) +{ + if (!mTimeZone.isEmpty()) + accept(); +} + +QTreeWidgetItem* LxQtWorldClockConfigurationTimeZones::makeSureParentsExist(const QStringList &parts, QMap &parentItems) +{ + if (parts.length() == 1) + return 0; + + QStringList parentParts = parts.mid(0, parts.length() - 1); + + QString parentPath = parentParts.join(QLatin1String("/")); + + QMap::Iterator I = parentItems.find(parentPath); + if (I != parentItems.end()) + return I.value(); + + QTreeWidgetItem* newItem = new QTreeWidgetItem(QStringList() << parts[parts.length() - 2]); + + QTreeWidgetItem* parentItem = makeSureParentsExist(parentParts, parentItems); + + if (!parentItem) + ui->timeZonesTW->addTopLevelItem(newItem); + else + parentItem->addChild(newItem); + + parentItems[parentPath] = newItem; + + return newItem; +} + +int LxQtWorldClockConfigurationTimeZones::updateAndExec() +{ + QDateTime now = QDateTime::currentDateTime(); + + ui->timeZonesTW->clear(); + + QMap parentItems; + + foreach(QByteArray ba, QTimeZone::availableTimeZoneIds()) + { + QTimeZone timeZone(ba); + QString ianaId(ba); + QStringList qStrings(QString(ba).split(QLatin1Char('/'))); + + if ((qStrings.size() == 1) && (qStrings[0].startsWith(QLatin1String("UTC")))) + qStrings.prepend(tr("UTC")); + + if (qStrings.size() == 1) + qStrings.prepend(tr("Other")); + + QTreeWidgetItem *tzItem = new QTreeWidgetItem(QStringList() << qStrings[qStrings.length() - 1] << timeZone.displayName(now) << timeZone.comment() << QLocale::countryToString(timeZone.country())); + tzItem->setData(0, Qt::UserRole, ianaId); + + makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); + } + + QStringList qStrings = QStringList() << tr("Other") << QLatin1String("local"); + QTreeWidgetItem *tzItem = new QTreeWidgetItem(QStringList() << qStrings[qStrings.length() - 1] << QString() << tr("Local timezone") << QString()); + tzItem->setData(0, Qt::UserRole, qStrings[qStrings.length() - 1]); + makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); + + ui->timeZonesTW->sortByColumn(0, Qt::AscendingOrder); + + return exec(); +} diff --git a/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.h b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.h new file mode 100644 index 0000000..d3f1677 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.h @@ -0,0 +1,67 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2012 Razor team + * 2014 LXQt team + * Authors: + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H +#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H + +#include +#include + + +namespace Ui { + class LxQtWorldClockConfigurationTimeZones; +} + +class QTreeWidgetItem; + +class LxQtWorldClockConfigurationTimeZones : public QDialog +{ + Q_OBJECT + +public: + explicit LxQtWorldClockConfigurationTimeZones(QWidget *parent = NULL); + ~LxQtWorldClockConfigurationTimeZones(); + + int updateAndExec(); + + QString timeZone(); + +public slots: + void itemSelectionChanged(); + void itemDoubleClicked(QTreeWidgetItem*,int); + +private: + Ui::LxQtWorldClockConfigurationTimeZones *ui; + + QString mTimeZone; + + QTreeWidgetItem* makeSureParentsExist(const QStringList &parts, QMap &parentItems); +}; + +#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.ui b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.ui similarity index 51% rename from plugin-kbindicator/lxqtkbindicatorconfiguration.ui rename to lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.ui index b68ba35..017c5cd 100644 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.ui +++ b/lxqt-panel/plugin-worldclock/lxqtworldclockconfigurationtimezones.ui @@ -1,66 +1,69 @@ - LxQtKbIndicatorConfiguration - + LxQtWorldClockConfigurationTimeZones + 0 0 - 178 - 126 + 718 + 280 - Keyboard Indicator Settings + World Clock Time Zones - + - - - Caps Lock + + + QAbstractItemView::NoEditTriggers - - - - - - Num Lock - - - - - - - Scroll Lock + + true - - - - - - Qt::Vertical + + true - - - 1 - 1 - + + 4 - + + 150 + + + + Time zone + + + + + Name + + + + + Comment + + + + + Country + + +
- - Qt::Horizontal - - QDialogButtonBox::Close|QDialogButtonBox::Reset + QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+ timeZonesTW buttons @@ -68,7 +71,7 @@ buttons accepted() - LxQtKbIndicatorConfiguration + LxQtWorldClockConfigurationTimeZones accept() @@ -84,7 +87,7 @@ buttons rejected() - LxQtKbIndicatorConfiguration + LxQtWorldClockConfigurationTimeZones reject() diff --git a/lxqt-panel/plugin-worldclock/resources/worldclock.desktop.in b/lxqt-panel/plugin-worldclock/resources/worldclock.desktop.in new file mode 100644 index 0000000..f0aecd0 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/resources/worldclock.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=World clock +Comment=World clock plugin. +Icon=clock + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock.ts b/lxqt-panel/plugin-worldclock/translations/worldclock.ts new file mode 100644 index 0000000..846c397 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + + + + + Display &format + + + + + &Time + + + + + F&ormat: + + + + + + + Short + + + + + + + Long + + + + + + Custom + + + + + Sho&w seconds + + + + + Pad &hour with zero + + + + + T&ime zone + + + + + &Position: + + + + + For&mat: + + + + + + Below + + + + + + Above + + + + + + Before + + + + + + After + + + + + Offset from UTC + + + + + Abbreviation + + + + + IANA id + + + + + + + Custom name + + + + + &Use 12-hour format + + + + + Location identifier + + + + + &Date + + + + + Po&sition: + + + + + Fo&rmat: + + + + + ISO 8601 + + + + + Show &year + + + + + Show day of wee&k + + + + + Pad d&ay with zero + + + + + &Long month and day of week names + + + + + Ad&vanced manual format + + + + + &Customise ... + + + + + Time &zones + + + + + &Add ... + + + + + &Remove + + + + + Set as &default + + + + + &Edit custom name ... + + + + + Move &up + + + + + Move do&wn + + + + + &General + + + + + Auto&rotate when the panel is vertical + + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + + + + + Time zone + + + + + Name + + + + + Comment + + + + + Country + + + + + UTC + + + + + + Other + + + + + Local timezone + + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_de.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_de.desktop new file mode 100644 index 0000000..c4e8a1b --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Weltzeituhr +Comment[de]=Weltzeituhr diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_de.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_de.ts new file mode 100644 index 0000000..c51cf08 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_de.ts @@ -0,0 +1,370 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Weltzeituhr - Einstellungen + + + + Display &format + Anzeige&format + + + + &Time + &Zeit + + + + F&ormat: + F&ormat: + + + + + + Short + Kurz + + + + + + Long + Lang + + + + + Custom + Eigenes + + + + Sho&w seconds + Se&kunden anzeigen + + + + Pad &hour with zero + Stunden mit fü&hrender Null + + + + &Use 12-hour format + 12-St&undenformat benutzen + + + + T&ime zone + Ze&itzone + + + + &Position: + &Position: + + + + For&mat: + For&mat: + + + + + Below + Unter + + + + + Above + Über + + + + + Before + Vor + + + + + After + Nach + + + + Offset from UTC + Versatz zu UTC + + + + Abbreviation + Abkürzung + + + + Location identifier + Ortsbezeichnung + + + + + + Custom name + Eigener Name + + + + &Date + &Datum + + + + Po&sition: + &Position: + + + + Fo&rmat: + Fo&rmat: + + + + ISO 8601 + ISO 8601 + + + + Show &year + &Jahr anzeigen + + + + Show day of wee&k + &Wochentag anzeigen + + + + Pad d&ay with zero + T&ag mit führender Null + + + + &Long month and day of week names + &Lange Monats- und Wochentagsbezeichnungen + + + + Ad&vanced manual format + &Erweitertes manuelles Format + + + + &Customise ... + &Ändern... + + + + Time &zones + &Zeitzonen + + + + IANA id + IANA-ID + + + + &Add ... + &Hinzufügen ... + + + + &Remove + &Entfernen + + + + Set as &default + Als &Default setzen + + + + &Edit custom name ... + &Eigenen Namen bearbeiten... + + + + Move &up + Nach &oben + + + + Move do&wn + Nach &unten + + + + &General + All&gemein + + + + Auto&rotate when the panel is vertical + &Bei senkrechter Leiste automatisch drehen + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + Input custom time zone name + Eigenen Zeitzonennamen eingeben + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Syntax für eigenes Datums-/Zeitformat </h1> +<p>Ein Datumsmuster ist eine Zeichenkette, in der bestimmte Zeichenfolgen durch Datums- und Zeitangaben eines Kalenders ersetzt werden.</p> +<p>In der unten angegebenen Tabelle sind die Zeichenfolgen angegeben, für die eine Ersetzung vorgenommen wird. Dabei können einzelne Zeichen mehrfach angegeben werden, um die Bedeutung zu verändern. Beispielsweise wird y zur Darstellung des Jahres benutzt. Dabei produziert 'yy' z.B. '99', und 'yyyy' produziert dann '1999'. Bei den meisten numerischen Feldern bestimmt die Anzahl der Zeichen die Feldbreite. Beispielsweise bei h, das zur Darstellung der Stunden dient, könnte 'h' eine '5' produzieren, aber 'hh' ergäbe '05'. Bei einigen Zeichen wird durch die Anzahl bestimmt, ob die abgekürzte oder ausgeschriebene Form benutzt werden soll.</p> +<p>Zwei Hochkommas werden durch ein einzelnes Hochkomma ersetzt, sowohl innerhalb als auch außerhalb Hochkommas. Text innerhalb einfacher Hochkommas wird nicht ersetzt (abgesehen von zwei aufeinander folgenden Hochkommas). Ansonsten sind alle ASCII-Zeichen von a bis z und A bis Z reservierte Zeichen und müssen in Hochkommas stehen, wenn sie für sich selbst stehen sollen. Außerdem könnten bestimmte Satzzeichen zukünftig als Variablen aufgefasst werden (z.B. könnte ":" als Trennzeichen zwischen Zeitbestandteilen und '/' als Datumstrenner interpretiert werden, welche durch entsprechende lokale Zeichen in der Anzeige ersetzt werden).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Bedeutung</th></tr> +<tr><td>d</td><td>Tag als Zahl ohne führende Null (1 bis 31)</td></tr> +<tr><td>dd</td><td>Tag als Zahl mit führender Null (01 bis 31)</td></tr> +<tr><td>ddd</td><td>Abgekürzter lokalisierter Tagesname (z.B. 'Mon' bis 'Son').</td></tr> +<tr><td>dddd</td><td>Ausgeschriebener lokalisierter Tagesname (z.B. 'Montag' bis 'Sonntag</td></tr> +<tr><td>M</td><td>Monat als Zahl ohne führende Null (1-12)</td></tr> +<tr><td>MM</td><td>Monat als Zahl mit führender Null (01-12)</td></tr> +<tr><td>MMM</td><td>Abgekürzter lokalisierter Monatsname (z.B. 'Jan' bis 'Dez').</td></tr> +<tr><td>MMMM</td><td>Ausgeschriebener lokalisierter Monatsname (z.B. 'Januar' bis 'Dezember').</td></tr> +<tr><td>yy</td><td>Jahr als zweistellige Zahl (00-99)</td></tr> +<tr><td>yyyy</td><td>Jahr als vierstellige Zahl</td></tr> +<tr><td>h</td><td>Stunde ohne führende Null (0 bis 23 oder 1 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>hh</td><td>Stunde mit führender Null (00 bis 23 oder 01 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>H</td><td>Stunde ohne führende Null (0 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>HH</td><td>Stunde mit führender Null (00 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>m</td><td>Minute ohne führende Null (0 bis 59)</td></tr> +<tr><td>mm</td><td>Minute mit führender Null (00 bis 59)</td></tr> +<tr><td>s</td><td>Sekunde ohne führende Null (0 bis 59)</td></tr> +<tr><td>ss</td><td>Sekunde mit führender Null (00 bis 59)</td></tr> +<tr><td>z</td><td>Millisekunden ohne führende Nullen (0 bis 999)</td></tr> +<tr><td>zzz</td><td>Millisekunden mit führenden Nullen (000 bis 999)</td></tr> +<tr><td>AP <i>oder</i> A</td><td>AM/PM-Anzeige nutzen. <b>A/AP</b> wird durch "AM" oder "PM" ersetzt.<</td></tr> +<tr><td>ap <i>oder</i> a</td><td>am/pm-Anzeige nutzen. <b>a/ap</b> wird durch "am" oder "pm" ersetzt.<</td></tr> +<tr><td>t</td><td>Zeitzone (z.B. "CEST")</td></tr> +<tr><td>T</td><td>Offset zu UTC</td></tr> +<tr><td>TT</td><td>Zeitzone IANA-ID</td></tr> +<tr><td>TTT</td><td>Zeitzone abgekürzt</td></tr> +<tr><td>TTTT</td><td>Zeitzone kurz</td></tr> +<tr><td>TTTTT</td><td>Zeitzone lang</td></tr> +<tr><td>TTTTTT</td><td>Eigener Name für die Zeitzone. Dieser kann im Reiter 'Zeitzonen' gesetzt werden.</td></tr></table> +<p><br /><b>Hinweis:</b> Jedes Zeichen, das nicht in den Bereichen ['a'..'z'] und ['A'..'Z'] liegt, wird als in Hochkommas eingeschlossener Text behandelt. Zeichen wie ':', '.', ' ', '#' und '@' erscheinen im resultierenden Text auch wenn sie nicht in Hochkommas eingeschlossen sind. Das Hochkomma wird als Fluchtzeichen verwendet. Zwei aufeinander folgende Hochkommas repräsentieren ein 'echtes' Hochkomma.</p> + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + Time zone + Zeitzone + + + + Name + Name + + + + Comment + Kommentar + + + + Country + Land + + + + UTC + UTC + + + + + Other + Andere + + + + Local timezone + Lokale Zeitzone + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_hu.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_hu.desktop new file mode 100644 index 0000000..36fd874 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Világóra +Comment[hu]=Világóra bővítmény diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_hu.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_hu.ts new file mode 100644 index 0000000..e77c109 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_hu.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_hu_HU.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_hu_HU.ts new file mode 100644 index 0000000..c281ad3 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_hu_HU.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ja.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_ja.desktop new file mode 100644 index 0000000..b9b6f8e --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ja.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ja]=世界時計 +Comment[ja]=世界時計のウィジェットです + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ja.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_ja.ts new file mode 100644 index 0000000..08a506a --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ja.ts @@ -0,0 +1,370 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + LxQtWorldClockConfiguration + + + World Clock Settings + 世界時計の設定 + + + + Display &format + 表示形式 (&F) + + + + &Time + 時刻(&T) + + + + F&ormat: + 形式(&O): + + + + + + Short + 短い + + + + + + Long + 長い + + + + + Custom + 指定する + + + + Sho&w seconds + 秒も表示(&W) + + + + Pad &hour with zero + 時が一桁のときゼロで埋める(&H) + + + + &Use 12-hour format + 12時間制で表示(&U) + + + + T&ime zone + タイムゾーン(&I) + + + + &Position: + 位置(&P): + + + + For&mat: + 形式(&M) + + + + + Below + + + + + + Above + + + + + + Before + + + + + + After + + + + + Offset from UTC + UTCからの時差 + + + + Abbreviation + 短縮形 + + + + Location identifier + 場所 + + + + IANA id + IANAのID + + + + + + Custom name + 指定した名前 + + + + &Date + 日時(&D) + + + + Po&sition: + 位置(&S): + + + + Fo&rmat: + 形式(&R): + + + + ISO 8601 + ISO 8601 + + + + Show &year + 年を表示(&Y) + + + + Show day of wee&k + 曜日を表示(&K) + + + + Pad d&ay with zero + 日が一桁のときゼロで埋める(&A) + + + + &Long month and day of week names + 月や曜日を長い名前で表示(&L) + + + + Ad&vanced manual format + 形式を詳しく指定する(&V) + + + + &Customise ... + 指定する(&C) + + + + Time &zones + タイムゾーン(&Z) + + + + &Add ... + 追加(&A) + + + + &Remove + 削除(&R) + + + + Set as &default + デフォルトにする(&D) + + + + &Edit custom name ... + 名前を付ける(&E) + + + + Move &up + 上へ(&U) + + + + Move do&wn + 下へ(&W) + + + + &General + 一般(&G) + + + + Auto&rotate when the panel is vertical + パネルが垂直なときには回転する(&R) + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + Input custom time zone name + タイムゾーンの名前を入力 + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + 世界時計のタイムゾーン + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>日時形式の指定方法</h1> +<p>日時の表現パターンは文字列で表記します。特定の文字列は生成処理時に解釈され、カレンダー上の日時の情報に置き換えられます。</p> +<p>以下の日付フィールドのシンボル表は、例えば yyyy が年を意味するといったように、設定されているロケールに合わせた形式で表示されるパターン文字列を示しています。また、同じ文字を並べるものがあり、例えば y は年を示すために用い、'yy' なら '99'、'yyyy' なら '1999' といったように生成されます。数字を示す多くのフィールドは、文字長を表しています。例えば、時を示す h は、'h' は '5'、'hh' は '05' を生成します。繰り返す回数により短縮名かフルネームかを区別するものもあります。そのほか下表に示す通りです。</p> +<p>引用符内か否かに関わらず、シングルクオーテーションを2つ続けると、シングルクオーテーション文字1つを表します。シングルクオーテーション内の文字列は、(2つ連続している場合を除いて、)解釈されません。a から Z および A から Z までの ASCII 文字は、この記法のための予約文字で、文字そのものを表したいときには引用符で括る必要があります。しかも、いくつかの ASCII 記号も、将来は変数に指定される可能性があります。(例えば、":" は時刻のセパレータとして、'/' は日付のセパレータとして、ロケールに合わせた別の文字に差し替えられることになるかもしれません。)<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">文字列</th><th>意味</th></tr> +<tr><td>d</td><td>日(ゼロ埋めしない) (1-31)</td></tr> +<tr><td>dd</td><td>日(ゼロ埋めする) (01-31)</td></tr> +<tr><td>ddd</td><td>ロケールに合わせた曜日(短縮名) ('月'-'日').</td></tr> +<tr><td>dddd</td><td>ロケールに合わせた曜日(フルネーム) ('月曜日'-'日曜日')</td></tr> +<tr><td>M</td><td>月(ゼロ埋めしない) (1-12)</td></tr> +<tr><td>MM</td><td>月(ゼロ埋めする) (01-12)</td></tr> +<tr><td>MMM</td><td>月(短縮名) ('1月'-'12月'、※英語ならJan...).</td></tr> +<tr><td>MMMM</td><td>月(フルネーム) ('1月'-'12月'、※英語ならJanuary...).</td></tr> +<tr><td>yy</td><td>西暦の二桁 (00-99)</td></tr> +<tr><td>yyyy</td><td>西暦の四桁</td></tr> +<tr><td>h</td><td>時(ゼロ埋めしない) (0-23、午前/午後表示時は 1-12)</td></tr> +<tr><td>hh</td><td>時(ゼロ埋めする) (00-23、午前/午後表示時は 01-12)</td></tr> +<tr><td>H</td><td>時(ゼロ埋めしない) (0-23、常に24時間制)</td></tr> +<tr><td>HH</td><td>時(ゼロ埋めする) (00-23、常に24時間制)</td></tr> +<tr><td>m</td><td>分(ゼロ埋めしない) (0-59)</td></tr> +<tr><td>mm</td><td>分(ゼロ埋めする) (00-59)</td></tr> +<tr><td>s</td><td>秒(ゼロ埋めしない) (0-59)</td></tr> +<tr><td>ss</td><td>秒(ゼロ埋めする) (00-59)</td></tr> +<tr><td>z</td><td>ミリ秒(ゼロ埋めしない) (0-999)</td></tr> +<tr><td>zzz</td><td>ミリ秒(ゼロ埋めする) (000-999)</td></tr> +<tr><td>AP <i>または</i> A</td><td>午前/午後。<b>A や AP</b> は "午前"または"午後"に置き換えられる(※英語ならAM/PM)<</td></tr> +<tr><td>ap <i>または</i> a</td><td>午前/午後。<b>a や ap</b> は "午前"または"午後"に置き換えられる(※英語ならam/pm)<</td></tr> +<tr><td>t</td><td>タイムゾーン(例えば"JST")</td></tr> +<tr><td>T</td><td>UTC(世界標準時)からの時差</td></tr> +<tr><td>TT</td><td>IANA で定める ID</td></tr> +<tr><td>TTT</td><td>タイムゾーンの短縮名</td></tr> +<tr><td>TTTT</td><td>タイムゾーン名(短い)</td></tr> +<tr><td>TTTTT</td><td>タイムゾーン名(長い)</td></tr> +<tr><td>TTTTTT</td><td>設定ウィンドウの'タイムゾーン'タブで付けた名前</td></tr></table> +<p><br /><b>Note:</b> ['a'..'z'] および ['A'..'Z'] 以外の文字は解釈されません。例えば ':' や '.'、' '、'#'、'@'のような文字は、引用符で括らなくとも、そのまま表示されます。シングルクオーテーションは、'エスケープ文字'として使用します。連続するシングルクオーテーションは、'本物の' 1個のシングルクオーテーションを表します。</p> + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + 世界時計のタイムゾーン + + + + Time zone + 都市 + + + + Name + タイムゾーン + + + + Comment + 備考 + + + + Country + 国名 + + + + UTC + UTC + + + + + Other + その他 + + + + Local timezone + + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_pt.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_pt.desktop new file mode 100644 index 0000000..de26cac --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_pt.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[pt]=Relógio mundial +Comment[pt]=Extra para mostrar um relógio mundial diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_pt.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_pt.ts new file mode 100644 index 0000000..7a76d26 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_pt.ts @@ -0,0 +1,393 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Definições do relógio mundial + + + &Short, time only + &Curto, apenas horas + + + &Long, time only + &Longo, apenas horas + + + S&hort, date && time + C&urto, hora e data + + + L&ong, date && time + L&ongo, hora e data + + + &Custom + &Personalizar + + + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Sintaxe do formato de data/hora personalizado</span></p><p>Um formato de data é uma cadeia de caracteres em que os caracteres são substituidos pelos dados de data e hora de um calendário ou que são utilizados para gerar os dados do calendário.</p><p>A tabela de símbolos para campos de data abaixo contém os caracteres utilizados em padrões para mostrar os devidos formatos de uma região. Os caracteres podem ser utilizados diversas vezes. Por exemplo, se utilizar y para o anor, yy devolve 99 e yyyy devolve 1999. Para a maioria dos campo numéricos, o número de caracteres especifica o tamanho do campo. Por exemplo, se utilizar h para a hora, h devolve 5 mas hh devolve 05. Para alguns caracteres, o número de letras especifica o formato utilizado (pode ser abreviado ou completo), conforme explicado abaixo.</p><p>Duas aspas simples representam uma aspa simples literal, seja dentro ou fora das aspas simples. O texto entre aspas simples não é interpretado de qualquer forma (exceto para duas aspas simples adjacentes). Doutra forma, todas as letras ASCII , de "a" a "z" e "A" a "Z" estão reservadas para caracteres de sintaxe e são necessárias aspas para representarem caracteres literais. Adicionalmente, alguns símbolos de pontuação ASCII podem ser tornados variáveis no futuro (ex: &quot;:&quot; é interpretado como separador de hora e '/' como separador de data e são substituidos pelos separadores normalmente utilizados na região).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Significado</span></p></td></tr><tr><td><p>d</p></td><td><p>o dia como número sem o zero inicial (1 a 31)</p></td></tr><tr><td><p>dd</p></td><td><p>o dia como número mas com zero inicial (01 a 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>o nome do dia abreviado (Seg a Dom).</p></td></tr><tr><td><p>dddd</p></td><td><p>o nome do dia completo (Segunda a Domingo</p></td></tr><tr><td><p>M</p></td><td><p>o mês como número sem o zero inicial (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>o mês como número mas com zero inicial (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>o nome abreviado do mês (Jan a Dez).</p></td></tr><tr><td><p>MMMM</p></td><td><p>o nome completo do mês (Janeiro a Dezembro).</p></td></tr><tr><td><p>yy</p></td><td><p>o ano como número de 2 dígitos (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>o ano como número de 4 dígitos</p></td></tr><tr><td><p>h</p></td><td><p>a hora sem o zero inicial (0 a 23 ou 1 a 12 se AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>a hora mas com o zero inicial (00 a 23 ou 01 a 12 se AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>a hora sem o zero inicial (0 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>a hora mas com o zero inicial (00 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>m</p></td><td><p>os minutos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>mm</p></td><td><p>os minutos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>s</p></td><td><p>os segundos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>ss</p></td><td><p>os segundos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>z</p></td><td><p>os milissegundos sem o zero inicial (0 a 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>os milissegundos mas com zero inicial (000 a 999)</p></td></tr><tr><td><p>AP ou A</p></td><td><p>para mostrar AM/PM <span style=" font-weight:600;">A/AP</span> será substituido por &quot;AM&quot; ou &quot;PM&quot;.</p></td></tr><tr><td><p>ap ou a</p></td><td><p>para mostrar am/pm <span style=" font-weight:600;">a/ap</span> será substituido por &quot;am&quot; ou &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>o fuso horário (por exemplo: &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>o desvio da UTC</p></td></tr><tr><td><p>TT</p></td><td><p>a ID IANA do fuso horário</p></td></tr><tr><td><p>TTT</p></td><td><p>a abreviatura do fuso horário</p></td></tr><tr><td><p>TTTT</p></td><td><p>o nome abreviado do fuso horário</p></td></tr><tr><td><p>TTTTT</p></td><td><p>o nome completo do fuso horário</p></td></tr></table><p><br/><span style=" font-weight:600;">Nota:</span> quaisquer caracteres no padrão que não estejam no intervalo [a...z] e [A...Z] serão tratados como texto. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão no texto mesmo se não tiverem aspas.As aspas simples são utilizadas para 'escape' de letras. As aspas duplas, dentro ou fora da sequência entre aspas, representa uma aspa simples 'real.</p></body></html> + + + + Time &zones + Fusos &horários + + + + &Add ... + &Adicionar... + + + + &Remove + &Remover + + + + Set as &default + Utilizar como pré-&definido + + + + Move &up + Mover para &cima + + + + Move do&wn + Mover para &baixo + + + + Display &format + &Formato de exibição + + + + &Time + &Hora + + + + F&ormat: + F&ormato: + + + + + + Short + Curto + + + + + + Long + Longo + + + + + Custom + Personalizado + + + + Sho&w seconds + Mo&strar segundos + + + + Pad &hour with zero + Mostrar zero inicial nas &horas + + + + &Use 12-hour format + &Utilizar formato AM/PM + + + + T&ime zone + Fuso horár&io + + + + &Position: + &Posição: + + + + For&mat: + F&ormato: + + + + + Below + Abaixo + + + + + Above + Acima + + + + + Before + Antes + + + + + After + Depois + + + + Offset from UTC + Desvio da UTC + + + + Abbreviation + Abreviatura + + + + Location identifier + Identificador da localização + + + + + + Custom name + Nome personalizado + + + + &Date + &Data + + + + Po&sition: + Pos&ição: + + + + Fo&rmat: + Fo&rmato: + + + + ISO 8601 + ISO 8601 + + + + Show &year + Mostrar &ano + + + + Show day of wee&k + Mostrar dia da se&mana + + + + Pad d&ay with zero + Mostrar zero inicial nos di&as + + + + &Long month and day of week names + Mês &longo e nome do dia da semana + + + + Ad&vanced manual format + Formato a&vançado + + + + &Customise ... + &Personalizar... + + + + IANA id + ID IANA + + + + &Edit custom name ... + &Editar nome personalizado... + + + + &General + &Geral + + + + Auto&rotate when the panel is vertical + &Rodar automaticamente se o painel estiver na vertical + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + Input custom time zone name + Escreva o nome do fuso horário personalizado + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Fusos horários do relógio mundial + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Sintaxe personalizada para datas e horas</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Código</th><th>Significado</th></tr> +<tr><td>d</td><td>o número do dia sem o zero inicial (1 a 31)</td></tr> +<tr><td>dd</td><td>o número do dia com o zero inicial (01 a 31)</td></tr> +<tr><td>ddd</td><td>o nome abrevidado do dia (Seg a Dom).</td></tr> +<tr><td>dddd</td><td>o nome completo do dia (Segunda a Domingo)</td></tr> +<tr><td>M</td><td>o número do mês sem o zero inicial (1 a 12)</td></tr> +<tr><td>MM</td><td>o número do mês com o zero inicial (01 a 12)</td></tr> +<tr><td>MMM</td><td>o nome abreviado do mês (Jan a Dez)</td></tr> +<tr><td>MMMM</td><td>o nome completo do mês (Janeiro a Dezembro)</td></tr> +<tr><td>yy</td><td>o ano na forma de dois dígitos (00 a 99)</td></tr> +<tr><td>yyyy</td><td>o ano na forma de quatro dígitos</td></tr> +<tr><td>h</td><td>a hora sem o zero inicial (0 a 23 ou 1 a 12 com AM/PM)</td></tr> +<tr><td>hh</td><td>a hora com o zero inicial (00 a 23 ou 01 a 12 com AM/PM)</td></tr> +<tr><td>H</td><td>a hora sem o zero inicial (0 a 23 mesmo se com AM/PM)</td></tr> +<tr><td>HH</td><td>a hora sem o zero inicial (00 a 23 mesmo se com AM/PM)</td></tr> +<tr><td>m</td><td>os minutos sem o zero inicial (0 a 59)</td></tr> +<tr><td>mm</td><td>os minutos com o zero inicial (00 a 59)</td></tr> +<tr><td>s</td><td>os segundos sem o zero inicial (0 a 59)</td></tr> +<tr><td>ss</td><td>os segundos com o zero inicial (00 a 59)</td></tr> +<tr><td>z</td><td>os milissegundos sem o zero inicial (0 a 999)</td></tr> +<tr><td>zzz</td><td>os milissegundos com o zero inicial (0 a 999)</td></tr> +<tr><td>AP <i>ou</i> A</td><td>para mostrar AM/PM. <b>A/AP</b> será substituido por "AM" ou "PM"<</td></tr> +<tr><td>ap <i>ou</i> a</td><td>para mostrar am/pm. <b>a/ap</b> será substituido por "am" ou "pm"<</td></tr> +<tr><td>t</td><td>o fuso horário (por exemplo: "CEST")</td></tr> +<tr><td>T</td><td>o desvio da UTC</td></tr> +<tr><td>TT</td><td>o identificador IANA do fuso horário</td></tr> +<tr><td>TTT</td><td>a abreviatura do fuso horário</td></tr> +<tr><td>TTTT</td><td>o nome abreviado do fuso horário</td></tr> +<tr><td>TTTTT</td><td>o nome completo do fuso horário</td></tr> +<tr><td>TTTTTT</td><td>o nome personalizado do fuso horario. Pode mudar o nome no separador 'Fusos horários' da janela de configurações</td></tr></table> +<p><br /><b>Nota:</b> quaisquer caracteres do padrão que não estejam no intervalo ['a'..'z'] e ['A'..'Z'] serão tratados como texto entre aspas. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão na hora resultante do padrão mesmo se não estiverem entre aspas. A plica é utilizada para fazer o 'escape' das letras. Duas plicas seguidas numa linha, dentro ou fora de uma frase entre aspas representa uma plica 'real'.</p + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Fusos horários do relógio mundial + + + + Time zone + Fuso horário + + + + Name + Nome + + + + Comment + Comentário + + + + Country + País + + + + UTC + UTC + + + + + Other + Outro + + + + Local timezone + + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ru.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_ru.desktop new file mode 100644 index 0000000..34bfbcd --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ru.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru]=Мировое время +Comment[ru]=Плагин мирового времени. + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ru.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_ru.ts new file mode 100644 index 0000000..e16c1c0 --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ru.ts @@ -0,0 +1,393 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Настройки мирового времени + + + &Short, time only + &Короткий, только время + + + &Long, time only + &Длинный, только время + + + S&hort, date && time + К&ороткий, дата и время + + + L&ong, date && time + Д&линный, дата и время + + + &Custom + &Свой + + + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + + + + Time &zones + Часовые &пояса + + + + &Add ... + &Добавить… + + + + &Remove + &Удалить + + + + Set as &default + Установить &по-умолчанию + + + + Move &up + &Выше + + + + Move do&wn + &Ниже + + + + Display &format + Формат &отображения + + + + &Time + &Время + + + + F&ormat: + Ф&ормат: + + + + + + Short + Короткий + + + + + + Long + Длинный + + + + + Custom + Свой + + + + Sho&w seconds + П&оказывать секунды + + + + Pad &hour with zero + Дополнить &час нулём + + + + T&ime zone + Ч&асовой пояс + + + + &Position: + &Расположение: + + + + For&mat: + Ф&ормат: + + + + + Below + Ниже + + + + + Above + Выше + + + + + Before + До + + + + + After + После + + + + Offset from UTC + Сдвиг относительно UTC + + + + Abbreviation + Сокращение + + + + IANA id + + + + + + + Custom name + Своё имя + + + + &Use 12-hour format + &Использовать 12 часовой формат + + + + Location identifier + Идентификатор местоположения + + + + &Date + &Дата + + + + Po&sition: + &Расположение: + + + + Fo&rmat: + Ф&ормат: + + + + ISO 8601 + + + + + Show &year + П&оказывать год + + + + Show day of wee&k + Показывать день &недели + + + + Pad d&ay with zero + Дополнить &день нулём + + + + &Long month and day of week names + &Длинные названия месяцев и дней недели + + + + Ad&vanced manual format + &Продвинутый ручной формат + + + + &Customise ... + &Настроить ... + + + + &Edit custom name ... + &Изменить своё имя ... + + + + &General + &Общие + + + + Auto&rotate when the panel is vertical + Авто&поворот для вертикальной панели + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Введите своё имя для часового пояса + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Часовые пояса мирового времени + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Синтаксис своего формата даты/времени</h1> +<p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p> +<p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p> +<p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Код</th><th>Обозначения</th></tr> +<tr><td>d</td></td><td>день как число без первого нуля (от 1 до 31)</td></tr> +<tr><td>dd</td><td>день как число с первым нулём (от 01 до 31)</td></tr> +<tr><td>ddd</p></td><td>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</td></tr> +<tr><td>dddd</td><td>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</td></tr> +<tr><td>M</td><td>месяц как число без первого нуля (1-12)</td></tr> +<tr><td>MM</td><td>месяц как число с первым нулём (01-12)</td></tr> +<tr><td>MMM</td><td>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</td></tr> +<tr><td>MMMM</td><td>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</td></tr> +<tr><td>yy</td><td><p>год как двухразрядное число (00-99</td></tr> +<tr><td>yyyy</td><td>год как четырёхразрядное число</td></tr> +<tr><td>h</td><td>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</td></tr> +<tr><td>hh</td><td>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</td></tr> +<tr><td>H</td><td>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</td></tr> +<tr><td>HH</td><td>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</td></tr> +<tr><td>m</td><td>минута без нуля впереди (от 0 до 59)</td></tr> +<tr><td>mm</td><td>минута с нулём впереди (от 00 до 59)</td></tr> +<tr><td>s</td><td>секунда без нуля впереди (от 0 до 59)</td></tr> +<tr><td>ss</td><td>секунда с нулём впереди (от 00 до 59)</td></tr> +<tr><td>z</td><td>миллисекунда без нуля впереди (от 0 до 999)</td></tr> +<tr><td>zzz</td><td>миллисекунда с нулём впереди (от 000 до 999)</td></tr> +<tr><td>AP <i>или</i> A</td><td>использовать отображение AM/PM. <b>A/AP</b> будет замещено на "AM" или "PM".<</td></tr> +<tr><td>ap <i>или</i> a</td><td>использовать отображение am/pm. <b>a/ap</b> будет замещено на "am" или "pm".<</td></tr> +<tr><td>t</td><td>часовой пояс (например "CEST")</td></tr> +<tr><td>T</td><td>сдвиг времени относительно UTC</td></tr> +<tr><td>TT</td><td>id часового пояса IANA</td></tr> +<tr><td>TTT</td><td>аббревиатура часового пояса</td></tr> +<tr><td>TTTT</td><td>короткое имя часового пояса</td></tr> +<tr><td>TTTTT</p></td><td><p>длинное имя часового пояса</td></tr> +<tr><td>TTTTTT</td><td>своё имя часового пояса. Вы можете изменить его во вкладке «Часовые пояса» окна настройки</td></tr></table> +<p><br /><b>Замечание:</b> Любые символы в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будут обработаны как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p> + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Часовые пояса мирового времени + + + + Time zone + Часовой пояс + + + + Name + Название + + + + Comment + Коментарий + + + + Country + Страна + + + + UTC + UTC + + + + + Other + Другое + + + + Local timezone + + + + diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.desktop b/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.desktop new file mode 100644 index 0000000..75090eb --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name[ru_RU]=Мировое время +Comment[ru_RU]=Плагин мирового времени. + +#TRANSLATIONS_DIR=../translations diff --git a/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.ts b/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.ts new file mode 100644 index 0000000..31c2b4b --- /dev/null +++ b/lxqt-panel/plugin-worldclock/translations/worldclock_ru_RU.ts @@ -0,0 +1,393 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Настройки мирового времени + + + &Short, time only + &Короткий, только время + + + &Long, time only + &Длинный, только время + + + S&hort, date && time + К&ороткий, дата и время + + + L&ong, date && time + Д&линный, дата и время + + + &Custom + &Свой + + + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + + + + Time &zones + Часовые &пояса + + + + &Add ... + &Добавить… + + + + &Remove + &Удалить + + + + Set as &default + Установить &по-умолчанию + + + + Move &up + &Выше + + + + Move do&wn + &Ниже + + + + Display &format + Формат &отображения + + + + &Time + &Время + + + + F&ormat: + Ф&ормат: + + + + + + Short + Короткий + + + + + + Long + Длинный + + + + + Custom + Свой + + + + Sho&w seconds + П&оказывать секунды + + + + Pad &hour with zero + Дополнить &час нулём + + + + T&ime zone + Ч&асовой пояс + + + + &Position: + &Расположение: + + + + For&mat: + Ф&ормат: + + + + + Below + Ниже + + + + + Above + Выше + + + + + Before + До + + + + + After + После + + + + Offset from UTC + Сдвиг относительно UTC + + + + Abbreviation + Сокращение + + + + IANA id + + + + + + + Custom name + Своё имя + + + + &Use 12-hour format + &Использовать 12 часовой формат + + + + Location identifier + Идентификатор местоположения + + + + &Date + &Дата + + + + Po&sition: + &Расположение: + + + + Fo&rmat: + Ф&ормат: + + + + ISO 8601 + + + + + Show &year + П&оказывать год + + + + Show day of wee&k + Показывать день &недели + + + + Pad d&ay with zero + Дополнить &день нулём + + + + &Long month and day of week names + &Длинные названия месяцев и дней недели + + + + Ad&vanced manual format + &Продвинутый ручной формат + + + + &Customise ... + &Настроить ... + + + + &Edit custom name ... + &Изменить своё имя ... + + + + &General + &Общие + + + + Auto&rotate when the panel is vertical + Авто&поворот для вертикальной панели + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Введите своё имя для часового пояса + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Часовые пояса мирового времени + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Синтаксис своего формата даты/времени</h1> +<p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p> +<p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p> +<p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Код</th><th>Обозначения</th></tr> +<tr><td>d</td></td><td>день как число без первого нуля (от 1 до 31)</td></tr> +<tr><td>dd</td><td>день как число с первым нулём (от 01 до 31)</td></tr> +<tr><td>ddd</p></td><td>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</td></tr> +<tr><td>dddd</td><td>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</td></tr> +<tr><td>M</td><td>месяц как число без первого нуля (1-12)</td></tr> +<tr><td>MM</td><td>месяц как число с первым нулём (01-12)</td></tr> +<tr><td>MMM</td><td>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</td></tr> +<tr><td>MMMM</td><td>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</td></tr> +<tr><td>yy</td><td><p>год как двухразрядное число (00-99</td></tr> +<tr><td>yyyy</td><td>год как четырёхразрядное число</td></tr> +<tr><td>h</td><td>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</td></tr> +<tr><td>hh</td><td>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</td></tr> +<tr><td>H</td><td>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</td></tr> +<tr><td>HH</td><td>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</td></tr> +<tr><td>m</td><td>минута без нуля впереди (от 0 до 59)</td></tr> +<tr><td>mm</td><td>минута с нулём впереди (от 00 до 59)</td></tr> +<tr><td>s</td><td>секунда без нуля впереди (от 0 до 59)</td></tr> +<tr><td>ss</td><td>секунда с нулём впереди (от 00 до 59)</td></tr> +<tr><td>z</td><td>миллисекунда без нуля впереди (от 0 до 999)</td></tr> +<tr><td>zzz</td><td>миллисекунда с нулём впереди (от 000 до 999)</td></tr> +<tr><td>AP <i>или</i> A</td><td>использовать отображение AM/PM. <b>A/AP</b> будет замещено на "AM" или "PM".<</td></tr> +<tr><td>ap <i>или</i> a</td><td>использовать отображение am/pm. <b>a/ap</b> будет замещено на "am" или "pm".<</td></tr> +<tr><td>t</td><td>часовой пояс (например "CEST")</td></tr> +<tr><td>T</td><td>сдвиг времени относительно UTC</td></tr> +<tr><td>TT</td><td>id часового пояса IANA</td></tr> +<tr><td>TTT</td><td>аббревиатура часового пояса</td></tr> +<tr><td>TTTT</td><td>короткое имя часового пояса</td></tr> +<tr><td>TTTTT</p></td><td><p>длинное имя часового пояса</td></tr> +<tr><td>TTTTTT</td><td>своё имя часового пояса. Вы можете изменить его во вкладке «Часовые пояса» окна настройки</td></tr></table> +<p><br /><b>Замечание:</b> Любые символы в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будут обработаны как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p> + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Часовые пояса мирового времени + + + + Time zone + Часовой пояс + + + + Name + Название + + + + Comment + Коментарий + + + + Country + Страна + + + + UTC + UTC + + + + + Other + Другое + + + + Local timezone + + + + diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt index 1ef3a32..4e23b53 100644 --- a/panel/CMakeLists.txt +++ b/panel/CMakeLists.txt @@ -1,59 +1,54 @@ set(PROJECT lxqt-panel) -set(lxqt-panel_PRIV_H_FILES +set(PRIV_HEADERS + panelpluginsmodel.h lxqtpanel.h lxqtpanelapplication.h lxqtpanellayout.h - lxqtpanelpluginconfigdialog.h - config/configpaneldialog.h plugin.h lxqtpanellimits.h popupmenu.h pluginmoveprocessor.h + lxqtpanelpluginconfigdialog.h + config/configpaneldialog.h + config/configpanelwidget.h + config/configpluginswidget.h + config/addplugindialog.h ) # using LXQt namespace in the public headers. -set(lxqt-panel_PUB_H_FILES +set(PUB_HEADERS lxqtpanelglobals.h ilxqtpanelplugin.h ilxqtpanel.h ) -set(lxqt-panel_CPP_FILES +set(SOURCES main.cpp + panelpluginsmodel.cpp lxqtpanel.cpp lxqtpanelapplication.cpp lxqtpanellayout.cpp - lxqtpanelpluginconfigdialog.cpp - config/configpaneldialog.cpp plugin.cpp popupmenu.cpp pluginmoveprocessor.cpp + lxqtpanelpluginconfigdialog.cpp + config/configpaneldialog.cpp + config/configpanelwidget.cpp + config/configpluginswidget.cpp + config/addplugindialog.cpp ) -set(MOCS - lxqtpanel.h - lxqtpanelapplication.h - lxqtpanellayout.h - lxqtpanelpluginconfigdialog.h - config/configpaneldialog.h - plugin.h - pluginmoveprocessor.h +set(UI + config/configpanelwidget.ui + config/configpluginswidget.ui + config/addplugindialog.ui ) set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} -) - -set(RESOURCES "") - -set(lxqt-panel_UI_FILES - config/configpaneldialog.ui + lxqt ) -qt5_wrap_ui(UI_HEADERS ${lxqt-panel_UI_FILES}) - file(GLOB CONFIG_FILES resources/*.conf) ############################################ @@ -65,36 +60,38 @@ add_definitions(-DPLUGIN_DESKTOPS_DIR=\"${PLUGIN_DESKTOPS_DIR}\") project(${PROJECT}) -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${LXQT_INCLUDE_DIRS} - ${LXQT_INCLUDE_DIRS}/LXQt # FIXME: liblxqt seems to be broken, workaround it. -) - -qt5_wrap_cpp(MOC_SOURCES ${MOCS}) -qt5_wrap_ui(UI_HEADERS ${FORMS}) -qt5_add_resources(QRC_SOURCES ${RESOURCES}) set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus) # Translations -lxqt_translate_ts(lxqt-runner_QM_FILES SOURCES +lxqt_translate_ts(QM_FILES SOURCES UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} SOURCES - ${lxqt-panel_PUB_H_FILES} - ${lxqt-panel_PRIV_H_FILES} - ${lxqt-panel_CPP_FILES} - ${lxqt-panel_UI_FILES} + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${SOURCES} + ${UI} INSTALL_DIR "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" ) -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) +lxqt_app_translation_loader(SOURCES ${PROJECT_NAME}) +add_executable(${PROJECT} + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${QM_FILES} + ${SOURCES} + ${UI} +) -add_executable(${PROJECT} ${lxqt-panel_PUB_H_FILES} ${lxqt-panel_PRIV_H_FILES} ${lxqt-panel_CPP_FILES} ${MOC_SOURCES} ${lxqt-runner_QM_FILES} ${QRC_SOURCES} ${UI_HEADERS} ${QM_LOADER}) -target_link_libraries(${PROJECT} ${LIBRARIES} ${QTX_LIBRARIES} KF5::WindowSystem) +target_link_libraries(${PROJECT} + ${LIBRARIES} + ${QTX_LIBRARIES} + KF5::WindowSystem + ${STATIC_PLUGINS} +) install(TARGETS ${PROJECT} RUNTIME DESTINATION bin) install(FILES ${CONFIG_FILES} DESTINATION ${LXQT_ETC_XDG_DIR}/lxqt) -install(FILES ${lxqt-panel_PUB_H_FILES} DESTINATION include/lxqt) +install(FILES ${PUB_HEADERS} DESTINATION include/lxqt) diff --git a/panel/config/addplugindialog.cpp b/panel/config/addplugindialog.cpp new file mode 100644 index 0000000..a604601 --- /dev/null +++ b/panel/config/addplugindialog.cpp @@ -0,0 +1,134 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "ui_addplugindialog.h" +#include "addplugindialog.h" +#include "plugin.h" +#include "../lxqtpanelapplication.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define SEARCH_ROLE Qt::UserRole +#define INDEX_ROLE SEARCH_ROLE+1 + +AddPluginDialog::AddPluginDialog(QWidget *parent): + QDialog(parent), + ui(new Ui::AddPluginDialog) +{ + ui->setupUi(this); + + QStringList desktopFilesDirs; + desktopFilesDirs << QString(getenv("LXQT_PANEL_PLUGINS_DIR")).split(':', QString::SkipEmptyParts); + desktopFilesDirs << QString("%1/%2").arg(XdgDirs::dataHome(), "/lxqt/lxqt-panel"); + desktopFilesDirs << PLUGIN_DESKTOPS_DIR; + + mPlugins = LxQt::PluginInfo::search(desktopFilesDirs, QStringLiteral("LxQtPanel/Plugin"), QStringLiteral("*")); + std::sort(mPlugins.begin(), mPlugins.end(), [](const LxQt::PluginInfo &p1, const LxQt::PluginInfo &p2) { + return p1.name() < p2.name() || (p1.name() == p2.name() && p1.comment() < p2.comment()); + }); + + ui->pluginList->setItemDelegate(new LxQt::HtmlDelegate(QSize(32, 32), ui->pluginList)); + ui->pluginList->setContextMenuPolicy(Qt::CustomContextMenu); + + filter(); + + // search + mSearchTimer.setInterval(300); + mSearchTimer.setSingleShot(true); + connect(ui->searchEdit, &QLineEdit::textEdited, + &mSearchTimer, static_cast(&QTimer::start)); + connect(&mSearchTimer, &QTimer::timeout, this, &AddPluginDialog::filter); + connect(ui->pluginList, &QListWidget::doubleClicked, this, &AddPluginDialog::emitPluginSelected); + connect(ui->addButton, &QPushButton::clicked, this, &AddPluginDialog::emitPluginSelected); + + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginAdded + , this, &AddPluginDialog::filter); + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginRemoved + , this, &AddPluginDialog::filter); +} + +AddPluginDialog::~AddPluginDialog() +{ + delete ui; +} + +void AddPluginDialog::filter() +{ + QListWidget* pluginList = ui->pluginList; + + const int curr_item = 0 < pluginList->count() ? pluginList->currentRow() : 0; + pluginList->clear(); + + static QIcon fallIco = XdgIcon::fromTheme("preferences-plugin"); + + int pluginCount = mPlugins.length(); + for (int i = 0; i < pluginCount; ++i) + { + const LxQt::PluginInfo &plugin = mPlugins.at(i); + + QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(), + plugin.comment(), + plugin.value("Name").toString(), + plugin.value("Comment").toString()); + if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive)) + continue; + + QListWidgetItem* item = new QListWidgetItem(ui->pluginList); + // disable single-instances plugins already in use + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(plugin.id())) + { + item->setFlags(item->flags() & ~Qt::ItemIsEnabled); + item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text)); + item->setText(QStringLiteral("%1
%2
%3") + .arg(plugin.name(), plugin.comment(), tr("(only one instance can run at a time)"))); + } else + item->setText(QStringLiteral("%1
%2").arg(plugin.name(), plugin.comment())); + item->setIcon(plugin.icon(fallIco)); + item->setData(INDEX_ROLE, i); + } + + if (pluginCount > 0) + ui->pluginList->setCurrentRow(curr_item < pluginCount ? curr_item : pluginCount - 1); +} + +void AddPluginDialog::emitPluginSelected() +{ + QListWidget* pluginList = ui->pluginList; + if (pluginList->currentItem() && pluginList->currentItem()->isSelected()) + { + LxQt::PluginInfo plugin = mPlugins.at(pluginList->currentItem()->data(INDEX_ROLE).toInt()); + emit pluginSelected(plugin); + } +} + diff --git a/panel/config/addplugindialog.h b/panel/config/addplugindialog.h new file mode 100644 index 0000000..16f2ba2 --- /dev/null +++ b/panel/config/addplugindialog.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_ADDPLUGINDIALOG_H +#define LXQT_ADDPLUGINDIALOG_H + +#include +#include +#include + +#define SEARCH_DELAY 125 + +namespace Ui { + class AddPluginDialog; +} + +class AddPluginDialog : public QDialog +{ + Q_OBJECT + +public: + AddPluginDialog(QWidget *parent = 0); + ~AddPluginDialog(); + +signals: + void pluginSelected(const LxQt::PluginInfo &plugin); + +private: + Ui::AddPluginDialog *ui; + LxQt::PluginInfoList mPlugins; + QTimer mSearchTimer; + +private slots: + void filter(); + void emitPluginSelected(); +}; + +#endif // LXQT_ADDPLUGINDIALOG_H diff --git a/panel/config/addplugindialog.ui b/panel/config/addplugindialog.ui new file mode 100644 index 0000000..57ab441 --- /dev/null +++ b/panel/config/addplugindialog.ui @@ -0,0 +1,144 @@ + + + AddPluginDialog + + + + 0 + 0 + 400 + 359 + + + + Add Plugins + + + + + + + + Search: + + + + + + + + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::Static + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + 0 + + + false + + + true + + + -1 + + + false + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add Widget + + + + + + + Close + + + false + + + true + + + + + + + + + pluginList + addButton + closeButton + searchEdit + + + + + closeButton + clicked() + AddPluginDialog + close() + + + 380 + 279 + + + 118 + 270 + + + + + diff --git a/panel/config/configpaneldialog.cpp b/panel/config/configpaneldialog.cpp index cb34770..32556b2 100644 --- a/panel/config/configpaneldialog.cpp +++ b/panel/config/configpaneldialog.cpp @@ -26,402 +26,33 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "configpaneldialog.h" -#include "ui_configpaneldialog.h" -#include "../lxqtpanel.h" -#include "../lxqtpanellimits.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace LxQt; - -struct ScreenPosition -{ - int screen; - ILxQtPanel::Position position; -}; -Q_DECLARE_METATYPE(ScreenPosition) - - - -/************************************************ - - ************************************************/ -ConfigPanelDialog *ConfigPanelDialog::exec(LxQtPanel *panel) -{ - ConfigPanelDialog *dialog = - panel->findChild(); - - if (!dialog) - { - dialog = new ConfigPanelDialog(panel, panel); - } - - dialog->show(); - dialog->raise(); - dialog->activateWindow(); - WId wid = dialog->windowHandle()->winId(); - - KWindowSystem::activateWindow(wid); - KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); - return dialog; -} - - -/************************************************ - - ************************************************/ ConfigPanelDialog::ConfigPanelDialog(LxQtPanel *panel, QWidget *parent): - LxQt::ConfigDialog(tr("Configure Panel"), panel->settings(), parent) + LxQt::ConfigDialog(tr("Configure Panel"), panel->settings(), parent), + mPanelPage(nullptr), + mPluginsPage(nullptr) { - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_DeleteOnClose); - ConfigPanelWidget* page = new ConfigPanelWidget(panel, this); - addPage(page, tr("Configure Panel")); - connect(this, SIGNAL(reset()), page, SLOT(reset())); - connect(this, SIGNAL(accepted()), panel, SLOT(saveSettings())); -} - - -/************************************************ - - ************************************************/ -ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) : - QWidget(parent), - ui(new Ui::ConfigPanelWidget), - mPanel(panel) -{ - ui->setupUi(this); - - fillComboBox_position(); - fillComboBox_alignment(); - - mOldPanelSize = mPanel->panelSize(); - mOldIconSize = mPanel->iconSize(); - mOldLineCount = mPanel->lineCount(); - - mOldLength = mPanel->length(); - mOldLengthInPercents = mPanel->lengthInPercents(); - - mOldAlignment = mPanel->alignment(); - - mOldScreenNum = mPanel->screenNum(); - mScreenNum = mOldScreenNum; - - mOldPosition = mPanel->position(); - mPosition = mOldPosition; - - ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE); - ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE); - - mOldFontColor = mPanel->fontColor(); - mFontColor = mOldFontColor; - mOldBackgroundColor = mPanel->backgroundColor(); - mBackgroundColor = mOldBackgroundColor; - mOldBackgroundImage = mPanel->backgroundImage(); - mOldOpacity = mPanel->opacity(); + mPanelPage = new ConfigPanelWidget(panel, this); + addPage(mPanelPage, tr("Panel"), QStringLiteral("configure")); + connect(this, &ConfigPanelDialog::reset, mPanelPage, &ConfigPanelWidget::reset); - reset(); + mPluginsPage = new ConfigPluginsWidget(panel, this); + addPage(mPluginsPage, tr("Widgets"), QStringLiteral("preferences-plugin")); + connect(this, &ConfigPanelDialog::reset, mPluginsPage, &ConfigPluginsWidget::reset); - connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - - connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged())); - - connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged())); - connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged())); - - connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor())); - connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor())); - connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged())); - connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage())); - connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged())); + connect(this, &ConfigPanelDialog::accepted, [panel] { + panel->saveSettings(); + }); } - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::reset() +void ConfigPanelDialog::showConfigPanelPage() { - ui->spinBox_panelSize->setValue(mOldPanelSize); - ui->spinBox_iconSize->setValue(mOldIconSize); - ui->spinBox_lineCount->setValue(mOldLineCount); - - ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition)); - - fillComboBox_alignment(); - ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1); - - ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1); - widthTypeChanged(); - ui->spinBox_length->setValue(mOldLength); - - mFontColor.setNamedColor(mOldFontColor.name()); - ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name())); - mBackgroundColor.setNamedColor(mOldBackgroundColor.name()); - ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name())); - ui->lineEdit_customBgImage->setText(mOldBackgroundImage); - ui->slider_opacity->setValue(mOldOpacity); - - ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid()); - ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid()); - ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists()); - - // update position - positionChanged(); + showPage(mPanelPage); } - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::fillComboBox_position() +void ConfigPanelDialog::showConfigPluginsPage() { - int screenCount = QApplication::desktop()->screenCount(); - if (screenCount == 1) - { - addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop); - addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft); - addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight); - addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom); - } - else - { - for (int screenNum = 0; screenNum < screenCount; screenNum++) - { - if (screenNum) - ui->comboBox_position->insertSeparator(9999); - - addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop); - addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft); - addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight); - addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom); - } - } -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::fillComboBox_alignment() -{ - ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft)); - ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter)); - ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight)); - - - if (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom) - { - ui->comboBox_alignment->setItemText(0, tr("Left")); - ui->comboBox_alignment->setItemText(1, tr("Center")); - ui->comboBox_alignment->setItemText(2, tr("Right")); - } - else - { - ui->comboBox_alignment->setItemText(0, tr("Top")); - ui->comboBox_alignment->setItemText(1, tr("Center")); - ui->comboBox_alignment->setItemText(2, tr("Bottom")); - }; -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position) -{ - if (LxQtPanel::canPlacedOn(screen, position)) - ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position})); -} - - -/************************************************ - - ************************************************/ -int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position) -{ - for (int i = 0; i < ui->comboBox_position->count(); i++) - { - ScreenPosition sp = ui->comboBox_position->itemData(i).value(); - if (screen == sp.screen && position == sp.position) - return i; - } - return -1; -} - - -/************************************************ - - ************************************************/ -ConfigPanelWidget::~ConfigPanelWidget() -{ - delete ui; -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::editChanged() -{ - mPanel->setPanelSize(ui->spinBox_panelSize->value(), true); - mPanel->setIconSize(ui->spinBox_iconSize->value(), true); - mPanel->setLineCount(ui->spinBox_lineCount->value(), true); - - mPanel->setLength(ui->spinBox_length->value(), - ui->comboBox_lenghtType->currentIndex() == 0, - true); - - LxQtPanel::Alignment align = LxQtPanel::Alignment( - ui->comboBox_alignment->itemData( - ui->comboBox_alignment->currentIndex() - ).toInt()); - - mPanel->setAlignment(align, true); - mPanel->setPosition(mScreenNum, mPosition, true); - - mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true); - if (ui->checkBox_customBgColor->isChecked()) - { - mPanel->setBackgroundColor(mBackgroundColor, true); - mPanel->setOpacity(ui->slider_opacity->value(), true); - } - else - { - mPanel->setBackgroundColor(QColor(), true); - mPanel->setOpacity(-1, true); - } - - QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); - mPanel->setBackgroundImage(image, true); -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::widthTypeChanged() -{ - int max = getMaxLength(); - - if (ui->comboBox_lenghtType->currentIndex() == 0) - { - // Percents ............................. - int v = ui->spinBox_length->value() * 100.0 / max; - ui->spinBox_length->setRange(1, 100); - ui->spinBox_length->setValue(v); - } - else - { - // Pixels ............................... - int v = max / 100.0 * ui->spinBox_length->value(); - ui->spinBox_length->setRange(-max, max); - ui->spinBox_length->setValue(v); - } -} - - -/************************************************ - - ************************************************/ -int ConfigPanelWidget::getMaxLength() -{ - QDesktopWidget* dw = QApplication::desktop(); - - if (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom) - return dw->screenGeometry(mScreenNum).width(); - else - return dw->screenGeometry(mScreenNum).height(); -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::positionChanged() -{ - ScreenPosition sp = ui->comboBox_position->itemData( - ui->comboBox_position->currentIndex()).value(); - - bool updateAlig = (sp.position == ILxQtPanel::PositionTop || - sp.position == ILxQtPanel::PositionBottom) != - (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom); - - int oldMax = getMaxLength(); - mPosition = sp.position; - mScreenNum = sp.screen; - int newMax = getMaxLength(); - - if (ui->comboBox_lenghtType->currentIndex() == 1 && - oldMax != newMax) - { - // Pixels ............................... - int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; - ui->spinBox_length->setMaximum(newMax); - ui->spinBox_length->setValue(v); - } - - if (updateAlig) - fillComboBox_alignment(); - - editChanged(); -} - -/************************************************ - * - ************************************************/ -void ConfigPanelWidget::pickFontColor() -{ - QColor newColor = QColorDialog::getColor(QColor(mFontColor.name()), this, tr("Pick color")); - if (newColor.isValid()) - { - mFontColor.setNamedColor(newColor.name()); - ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name())); - editChanged(); - } -} - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::pickBackgroundColor() -{ - QColor newColor = QColorDialog::getColor(QColor(mBackgroundColor.name()), this, tr("Pick color")); - if (newColor.isValid()) - { - mBackgroundColor.setNamedColor(newColor.name()); - ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name())); - editChanged(); - } -} - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::pickBackgroundImage() -{ - QString picturesLocation; - picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); - - QString file = QFileDialog::getOpenFileName(this, - "Pick image", - picturesLocation, - tr("Images (*.png *.gif *.jpg)")); - ui->lineEdit_customBgImage->setText(file); + showPage(mPluginsPage); } diff --git a/panel/config/configpaneldialog.h b/panel/config/configpaneldialog.h index 605e005..52b51a6 100644 --- a/panel/config/configpaneldialog.h +++ b/panel/config/configpaneldialog.h @@ -28,82 +28,25 @@ #ifndef CONFIGPANELDIALOG_H #define CONFIGPANELDIALOG_H +#include "configpanelwidget.h" +#include "configpluginswidget.h" #include "../lxqtpanel.h" -#include -#include -#include - -class LxQtPanel; +#include class ConfigPanelDialog : public LxQt::ConfigDialog -{ - Q_OBJECT -public: - static ConfigPanelDialog *exec(LxQtPanel *panel); - - ConfigPanelDialog(LxQtPanel *panel, QWidget *parent = 0); -}; - -namespace Ui { -class ConfigPanelWidget; -} - -class ConfigPanelWidget : public QWidget { Q_OBJECT public: - explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0); - ~ConfigPanelWidget(); - - int screenNum() const { return mScreenNum; } - ILxQtPanel::Position position() const { return mPosition; } - - -signals: - void changed(); - -public slots: - void reset(); + ConfigPanelDialog(LxQtPanel *panel, QWidget *parent = 0); -private slots: - void editChanged(); - void widthTypeChanged(); - void positionChanged(); - void pickFontColor(); - void pickBackgroundColor(); - void pickBackgroundImage(); + void showConfigPanelPage(); + void showConfigPluginsPage(); private: - Ui::ConfigPanelWidget *ui; - LxQtPanel *mPanel; - int mScreenNum; - ILxQtPanel::Position mPosition; - - void addPosition(const QString& name, int screen, LxQtPanel::Position position); - void fillComboBox_position(); - void fillComboBox_alignment(); - int indexForPosition(int screen, ILxQtPanel::Position position); - int getMaxLength(); - - // new values - QColor mFontColor; - QColor mBackgroundColor; - - // For reset function - int mOldPanelSize; - int mOldIconSize; - int mOldLineCount; - int mOldLength; - bool mOldLengthInPercents; - LxQtPanel::Alignment mOldAlignment; - ILxQtPanel::Position mOldPosition; - int mOldScreenNum; - QColor mOldFontColor; - QColor mOldBackgroundColor; - QString mOldBackgroundImage; - int mOldOpacity; + ConfigPanelWidget *mPanelPage; + ConfigPluginsWidget *mPluginsPage; }; #endif // CONFIGPANELDIALOG_H diff --git a/panel/config/configpaneldialog.ui b/panel/config/configpaneldialog.ui deleted file mode 100644 index f72ca29..0000000 --- a/panel/config/configpaneldialog.ui +++ /dev/null @@ -1,474 +0,0 @@ - - - ConfigPanelWidget - - - - 0 - 0 - 365 - 462 - - - - - 0 - 0 - - - - Configure panel - - - - - - - 0 - 0 - - - - Size - - - false - - - - - - Size: - - - - - - - px - - - 24 - - - - - - - Icon size: - - - - - - - Length: - - - - - - - 1 - - - 20 - - - - - - - px - - - 10 - - - 128 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - - - 1 - - - 100 - - - - - - - - % - - - - - px - - - - - - - - - - - Rows count: - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 20 - - - - - - - - - - - - 0 - 0 - - - - Alignment && position - - - - - - 1 - - - - Left - - - - - Center - - - - - Right - - - - - - - - Alignment: - - - - - - - - - - Position: - - - - - - - - - - - 0 - 0 - - - - Styling - - - - - - Custom font color: - - - - - - - Custom background image: - - - - - - - false - - - - - - - Custom background color: - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 6 - - - 0 - - - - - false - - - Opacity - - - - - - - false - - - 100 - - - 5 - - - 100 - - - Qt::Horizontal - - - - - - - - - - - - - - - checkBox_customBgColor - toggled(bool) - pushButton_customBgColor - setEnabled(bool) - - - 144 - 332 - - - 350 - 350 - - - - - checkBox_customBgImage - toggled(bool) - lineEdit_customBgImage - setEnabled(bool) - - - 137 - 403 - - - 149 - 440 - - - - - checkBox_customBgImage - toggled(bool) - pushButton_customBgImage - setEnabled(bool) - - - 125 - 403 - - - 350 - 441 - - - - - checkBox_customFontColor - toggled(bool) - pushButton_customFontColor - setEnabled(bool) - - - 190 - 294 - - - 350 - 312 - - - - - checkBox_customBgColor - toggled(bool) - slider_opacity - setEnabled(bool) - - - 99 - 333 - - - 114 - 367 - - - - - checkBox_customBgColor - toggled(bool) - label_2 - setEnabled(bool) - - - 34 - 341 - - - 32 - 362 - - - - - diff --git a/panel/config/configpanelwidget.cpp b/panel/config/configpanelwidget.cpp new file mode 100644 index 0000000..e3797e7 --- /dev/null +++ b/panel/config/configpanelwidget.cpp @@ -0,0 +1,394 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpanelwidget.h" +#include "ui_configpanelwidget.h" + +#include "../lxqtpanellimits.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace LxQt; + +struct ScreenPosition +{ + int screen; + ILxQtPanel::Position position; +}; +Q_DECLARE_METATYPE(ScreenPosition) + +ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) : + QWidget(parent), + ui(new Ui::ConfigPanelWidget), + mPanel(panel) +{ + ui->setupUi(this); + + fillComboBox_position(); + fillComboBox_alignment(); + + mOldPanelSize = mPanel->panelSize(); + mOldIconSize = mPanel->iconSize(); + mOldLineCount = mPanel->lineCount(); + + mOldLength = mPanel->length(); + mOldLengthInPercents = mPanel->lengthInPercents(); + + mOldAlignment = mPanel->alignment(); + + mOldScreenNum = mPanel->screenNum(); + mScreenNum = mOldScreenNum; + + mOldPosition = mPanel->position(); + mPosition = mOldPosition; + + mOldHidable = mPanel->hidable(); + + ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE); + ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE); + + mOldFontColor = mPanel->fontColor(); + mFontColor = mOldFontColor; + mOldBackgroundColor = mPanel->backgroundColor(); + mBackgroundColor = mOldBackgroundColor; + mOldBackgroundImage = mPanel->backgroundImage(); + mOldOpacity = mPanel->opacity(); + + // reset configurations from file + reset(); + + connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + + connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged())); + + connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged())); + connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged())); + connect(ui->checkBox_hidable, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + + connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor())); + connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor())); + connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage())); + connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged())); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::reset() +{ + ui->spinBox_panelSize->setValue(mOldPanelSize); + ui->spinBox_iconSize->setValue(mOldIconSize); + ui->spinBox_lineCount->setValue(mOldLineCount); + + ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition)); + + ui->checkBox_hidable->setChecked(mOldHidable); + + fillComboBox_alignment(); + ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1); + + ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1); + widthTypeChanged(); + ui->spinBox_length->setValue(mOldLength); + + mFontColor.setNamedColor(mOldFontColor.name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name())); + mBackgroundColor.setNamedColor(mOldBackgroundColor.name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name())); + ui->lineEdit_customBgImage->setText(mOldBackgroundImage); + ui->slider_opacity->setValue(mOldOpacity); + + ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid()); + ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid()); + ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists()); + + // update position + positionChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_position() +{ + int screenCount = QApplication::desktop()->screenCount(); + if (screenCount == 1) + { + addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom); + } + else + { + for (int screenNum = 0; screenNum < screenCount; screenNum++) + { + if (screenNum) + ui->comboBox_position->insertSeparator(9999); + + addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom); + } + } +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_alignment() +{ + ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft)); + ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter)); + ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight)); + + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + { + ui->comboBox_alignment->setItemText(0, tr("Left")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Right")); + } + else + { + ui->comboBox_alignment->setItemText(0, tr("Top")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Bottom")); + }; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position) +{ + if (LxQtPanel::canPlacedOn(screen, position)) + ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position})); +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position) +{ + for (int i = 0; i < ui->comboBox_position->count(); i++) + { + ScreenPosition sp = ui->comboBox_position->itemData(i).value(); + if (screen == sp.screen && position == sp.position) + return i; + } + return -1; +} + + +/************************************************ + * + ************************************************/ +ConfigPanelWidget::~ConfigPanelWidget() +{ + delete ui; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::editChanged() +{ + mPanel->setPanelSize(ui->spinBox_panelSize->value(), true); + mPanel->setIconSize(ui->spinBox_iconSize->value(), true); + mPanel->setLineCount(ui->spinBox_lineCount->value(), true); + + mPanel->setLength(ui->spinBox_length->value(), + ui->comboBox_lenghtType->currentIndex() == 0, + true); + + LxQtPanel::Alignment align = LxQtPanel::Alignment( + ui->comboBox_alignment->itemData( + ui->comboBox_alignment->currentIndex() + ).toInt()); + + mPanel->setAlignment(align, true); + mPanel->setPosition(mScreenNum, mPosition, true); + mPanel->setHidable(ui->checkBox_hidable->isChecked(), true); + + mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true); + if (ui->checkBox_customBgColor->isChecked()) + { + mPanel->setBackgroundColor(mBackgroundColor, true); + mPanel->setOpacity(ui->slider_opacity->value(), true); + } + else + { + mPanel->setBackgroundColor(QColor(), true); + mPanel->setOpacity(100, true); + } + + QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); + mPanel->setBackgroundImage(image, true); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::widthTypeChanged() +{ + int max = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 0) + { + // Percents ............................. + int v = ui->spinBox_length->value() * 100.0 / max; + ui->spinBox_length->setRange(1, 100); + ui->spinBox_length->setValue(v); + } + else + { + // Pixels ............................... + int v = max / 100.0 * ui->spinBox_length->value(); + ui->spinBox_length->setRange(-max, max); + ui->spinBox_length->setValue(v); + } +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::getMaxLength() +{ + QDesktopWidget* dw = QApplication::desktop(); + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + return dw->screenGeometry(mScreenNum).width(); + else + return dw->screenGeometry(mScreenNum).height(); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::positionChanged() +{ + ScreenPosition sp = ui->comboBox_position->itemData( + ui->comboBox_position->currentIndex()).value(); + + bool updateAlig = (sp.position == ILxQtPanel::PositionTop || + sp.position == ILxQtPanel::PositionBottom) != + (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom); + + int oldMax = getMaxLength(); + mPosition = sp.position; + mScreenNum = sp.screen; + int newMax = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 1 && + oldMax != newMax) + { + // Pixels ............................... + int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; + ui->spinBox_length->setMaximum(newMax); + ui->spinBox_length->setValue(v); + } + + if (updateAlig) + fillComboBox_alignment(); + + editChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickFontColor() +{ + QColorDialog d(QColor(mFontColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mFontColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundColor() +{ + QColorDialog d(QColor(mBackgroundColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mBackgroundColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundImage() +{ + QString picturesLocation; + picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + + QFileDialog* d = new QFileDialog(this, tr("Pick image"), picturesLocation, tr("Images (*.png *.gif *.jpg)")); + d->setAttribute(Qt::WA_DeleteOnClose); + d->setWindowModality(Qt::WindowModal); + connect(d, &QFileDialog::fileSelected, ui->lineEdit_customBgImage, &QLineEdit::setText); + d->show(); +} + diff --git a/panel/config/configpanelwidget.h b/panel/config/configpanelwidget.h new file mode 100644 index 0000000..3849a86 --- /dev/null +++ b/panel/config/configpanelwidget.h @@ -0,0 +1,99 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPANELWIDGET_H +#define CONFIGPANELWIDGET_H + +#include "../lxqtpanel.h" +#include +#include +#include + +class LxQtPanel; + +namespace Ui { + class ConfigPanelWidget; +} + +class ConfigPanelWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0); + ~ConfigPanelWidget(); + + int screenNum() const { return mScreenNum; } + ILxQtPanel::Position position() const { return mPosition; } + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void editChanged(); + void widthTypeChanged(); + void positionChanged(); + void pickFontColor(); + void pickBackgroundColor(); + void pickBackgroundImage(); + +private: + Ui::ConfigPanelWidget *ui; + LxQtPanel *mPanel; + int mScreenNum; + ILxQtPanel::Position mPosition; + + void addPosition(const QString& name, int screen, LxQtPanel::Position position); + void fillComboBox_position(); + void fillComboBox_alignment(); + int indexForPosition(int screen, ILxQtPanel::Position position); + int getMaxLength(); + + // new values + QColor mFontColor; + QColor mBackgroundColor; + + // old values for reset + int mOldPanelSize; + int mOldIconSize; + int mOldLineCount; + int mOldLength; + bool mOldLengthInPercents; + LxQtPanel::Alignment mOldAlignment; + ILxQtPanel::Position mOldPosition; + bool mOldHidable; + int mOldScreenNum; + QColor mOldFontColor; + QColor mOldBackgroundColor; + QString mOldBackgroundImage; + int mOldOpacity; +}; + +#endif diff --git a/panel/config/configpanelwidget.ui b/panel/config/configpanelwidget.ui new file mode 100644 index 0000000..f9abbcf --- /dev/null +++ b/panel/config/configpanelwidget.ui @@ -0,0 +1,619 @@ + + + ConfigPanelWidget + + + + 0 + 0 + 372 + 397 + + + + + 0 + 0 + + + + Configure panel + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Size + + + false + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + 1 + + + 100 + + + + + + + Size: + + + + + + + Length: + + + + + + + + % + + + + + px + + + + + + + + px + + + 24 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + px + + + 10 + + + 128 + + + + + + + Icon size: + + + + + + + Rows count: + + + + + + + 1 + + + 20 + + + + + + + + + + + + + + 0 + 0 + + + + Alignment && position + + + + + + Position: + + + + + + + + + + Alignment: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + + Left + + + + + Center + + + + + Right + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 15 + 20 + + + + + + + + + 0 + 0 + + + + Auto-hide + + + + + + + + + + + + + + 0 + 0 + + + + Custom styling + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Font color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + Background color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + 6 + + + 6 + + + + + false + + + Background opacity: + + + + + + + false + + + 100 + + + 5 + + + 100 + + + Qt::Horizontal + + + + + + + + + + false + + + <small>Compositing is required for panel transparency.</small> + + + Qt::AlignCenter + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Background image: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + + + + + checkBox_customBgColor + toggled(bool) + pushButton_customBgColor + setEnabled(bool) + + + 144 + 332 + + + 350 + 350 + + + + + checkBox_customBgImage + toggled(bool) + lineEdit_customBgImage + setEnabled(bool) + + + 137 + 403 + + + 149 + 440 + + + + + checkBox_customBgImage + toggled(bool) + pushButton_customBgImage + setEnabled(bool) + + + 125 + 403 + + + 350 + 441 + + + + + checkBox_customFontColor + toggled(bool) + pushButton_customFontColor + setEnabled(bool) + + + 190 + 294 + + + 350 + 312 + + + + + checkBox_customBgColor + toggled(bool) + slider_opacity + setEnabled(bool) + + + 99 + 333 + + + 114 + 367 + + + + + checkBox_customBgColor + toggled(bool) + label_2 + setEnabled(bool) + + + 34 + 341 + + + 32 + 362 + + + + + checkBox_customBgColor + toggled(bool) + compositingL + setEnabled(bool) + + + diff --git a/panel/config/configpluginswidget.cpp b/panel/config/configpluginswidget.cpp new file mode 100644 index 0000000..cdae414 --- /dev/null +++ b/panel/config/configpluginswidget.cpp @@ -0,0 +1,119 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpluginswidget.h" +#include "ui_configpluginswidget.h" +#include "addplugindialog.h" +#include "panelpluginsmodel.h" +#include "../plugin.h" +#include "../ilxqtpanelplugin.h" + +#include +#include +#include + +ConfigPluginsWidget::ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent) : + QWidget(parent), + ui(new Ui::ConfigPluginsWidget), + mPanel(panel) +{ + ui->setupUi(this); + + PanelPluginsModel * plugins = mPanel->mPlugins.data(); + { + QScopedPointer m(ui->listView_plugins->selectionModel()); + ui->listView_plugins->setModel(plugins); + } + { + QScopedPointer d(ui->listView_plugins->itemDelegate()); + ui->listView_plugins->setItemDelegate(new LxQt::HtmlDelegate(QSize(16, 16), ui->listView_plugins)); + } + + resetButtons(); + + connect(ui->listView_plugins, &QListView::activated, plugins, &PanelPluginsModel::onActivatedIndex); + connect(ui->listView_plugins->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &ConfigPluginsWidget::resetButtons); + + connect(ui->pushButton_moveUp, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginUp); + connect(ui->pushButton_moveDown, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginDown); + + connect(ui->pushButton_addPlugin, &QPushButton::clicked, this, &ConfigPluginsWidget::showAddPluginDialog); + connect(ui->pushButton_removePlugin, &QToolButton::clicked, plugins, &PanelPluginsModel::onRemovePlugin); + + connect(ui->pushButton_pluginConfig, &QToolButton::clicked, plugins, &PanelPluginsModel::onConfigurePlugin); + + connect(plugins, &PanelPluginsModel::pluginAdded, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginRemoved, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginMoved, this, &ConfigPluginsWidget::resetButtons); +} + +ConfigPluginsWidget::~ConfigPluginsWidget() +{ + delete ui; +} + +void ConfigPluginsWidget::reset() +{ + +} + +void ConfigPluginsWidget::showAddPluginDialog() +{ + if (mAddPluginDialog.isNull()) + { + mAddPluginDialog.reset(new AddPluginDialog); + connect(mAddPluginDialog.data(), &AddPluginDialog::pluginSelected, + mPanel->mPlugins.data(), &PanelPluginsModel::addPlugin); + } + mAddPluginDialog->show(); + mAddPluginDialog->raise(); + mAddPluginDialog->activateWindow(); +} + +void ConfigPluginsWidget::resetButtons() +{ + PanelPluginsModel *model = mPanel->mPlugins.data(); + QItemSelectionModel *selectionModel = ui->listView_plugins->selectionModel(); + bool hasSelection = selectionModel->hasSelection(); + bool isFirstSelected = selectionModel->isSelected(model->index(0)); + bool isLastSelected = selectionModel->isSelected(model->index(model->rowCount() - 1)); + + bool hasConfigDialog = false; + if (hasSelection) + { + Plugin const * plugin + = ui->listView_plugins->model()->data(selectionModel->currentIndex(), Qt::UserRole).value(); + if (nullptr != plugin) + hasConfigDialog = plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::HaveConfigDialog); + } + + ui->pushButton_removePlugin->setEnabled(hasSelection); + ui->pushButton_moveUp->setEnabled(hasSelection && !isFirstSelected); + ui->pushButton_moveDown->setEnabled(hasSelection && !isLastSelected); + ui->pushButton_pluginConfig->setEnabled(hasSelection && hasConfigDialog); +} diff --git a/panel/config/configpluginswidget.h b/panel/config/configpluginswidget.h new file mode 100644 index 0000000..344169f --- /dev/null +++ b/panel/config/configpluginswidget.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPLUGINSWIDGET_H +#define CONFIGPLUGINSWIDGET_H + +#include "../lxqtpanel.h" + +#include + +namespace Ui { + class ConfigPluginsWidget; +} +class AddPluginDialog; + +class ConfigPluginsWidget : public QWidget +{ + Q_OBJECT + +public: + ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent = 0); + ~ConfigPluginsWidget(); + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void showAddPluginDialog(); + void resetButtons(); + +private: + Ui::ConfigPluginsWidget *ui; + QScopedPointer mAddPluginDialog; + LxQtPanel *mPanel; +}; + +#endif diff --git a/panel/config/configpluginswidget.ui b/panel/config/configpluginswidget.ui new file mode 100644 index 0000000..413584c --- /dev/null +++ b/panel/config/configpluginswidget.ui @@ -0,0 +1,213 @@ + + + ConfigPluginsWidget + + + + 0 + 0 + 339 + 220 + + + + Configure Plugins + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + false + + + true + + + + + + + Note: changes made in this page cannot be reset. + + + true + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Move up + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Move down + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Add + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Remove + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Configure + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + diff --git a/panel/ilxqtpanel.h b/panel/ilxqtpanel.h index 39c3e07..a64cb69 100644 --- a/panel/ilxqtpanel.h +++ b/panel/ilxqtpanel.h @@ -72,6 +72,7 @@ public: Helper functions for calculating global screen position of some popup window with windowSize size. If you need to show some popup window, you can use it, to get global screen position for the new window. **/ + virtual QRect calculatePopupWindowPos(const QPoint &absolutePos, const QSize &windowSize) const = 0; virtual QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const = 0; }; diff --git a/panel/ilxqtpanelplugin.h b/panel/ilxqtpanelplugin.h index 683d2a0..cefcf53 100644 --- a/panel/ilxqtpanelplugin.h +++ b/panel/ilxqtpanelplugin.h @@ -81,7 +81,9 @@ public: otherwise plugin prefer left (like main menu). This flag is used only at the first start, later positions of all plugins saved in a config, and this saved information is used. */ - HaveConfigDialog = 2 ///< The plugin have a configuration dialog. + HaveConfigDialog = 2, ///< The plugin have a configuration dialog. + SingleInstance = 4, ///< The plugin allows only one instance to run. + NeedsHandle = 8 ///< The plugin needs a handle for the context menu }; Q_DECLARE_FLAGS(Flags, Flag) @@ -220,7 +222,7 @@ public: /** Returns the root component object of the plugin. When the library is finally unloaded, the root component will automatically be deleted. **/ - virtual ILxQtPanelPlugin* instance(const ILxQtPanelPluginStartupInfo &startupInfo) = 0; + virtual ILxQtPanelPlugin* instance(const ILxQtPanelPluginStartupInfo &startupInfo) const = 0; }; diff --git a/panel/lxqtpanel.cpp b/panel/lxqtpanel.cpp index 9115d12..9b66994 100644 --- a/panel/lxqtpanel.cpp +++ b/panel/lxqtpanel.cpp @@ -34,7 +34,7 @@ #include "config/configpaneldialog.h" #include "popupmenu.h" #include "plugin.h" -#include +#include "panelpluginsmodel.h" #include #include @@ -48,8 +48,14 @@ #include #include -#include -#include +#include +#include + +// Turn on this to show the time required to load each plugin during startup +// #define DEBUG_PLUGIN_LOADTIME +#ifdef DEBUG_PLUGIN_LOADTIME +#include +#endif // Config keys and groups #define CFG_KEY_SCREENNUM "desktop" @@ -65,6 +71,7 @@ #define CFG_KEY_BACKGROUNDIMAGE "background-image" #define CFG_KEY_OPACITY "opacity" #define CFG_KEY_PLUGINS "plugins" +#define CFG_KEY_HIDABLE "hidable" /************************************************ Returns the Position by the string. @@ -108,12 +115,16 @@ QString LxQtPanel::positionToStr(ILxQtPanel::Position position) LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : QFrame(parent), mConfigGroup(configGroup), + mPlugins{nullptr}, mPanelSize(0), mIconSize(0), mLineCount(0), mLength(0), mAlignment(AlignmentLeft), - mPosition(ILxQtPanel::PositionBottom) + mPosition(ILxQtPanel::PositionBottom), + mScreenNum(0), //whatever (avoid conditional on uninitialized value) + mHidable(false), + mHidden(false) { Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; @@ -133,6 +144,7 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : setAttribute(Qt::WA_X11NetWmWindowTypeDock); setAttribute(Qt::WA_AlwaysShowToolTips); setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_AcceptDrops); setWindowTitle("LxQt Panel"); setObjectName(QString("LxQtPanel %1").arg(configGroup)); @@ -140,12 +152,12 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : LxQtPanelWidget = new QFrame(this); LxQtPanelWidget->setObjectName("BackgroundWidget"); QGridLayout* lav = new QGridLayout(); - lav->setContentsMargins(QMargins(0,0,0,0)); + lav->setMargin(0); setLayout(lav); this->layout()->addWidget(LxQtPanelWidget); mLayout = new LxQtPanelLayout(LxQtPanelWidget); - connect(mLayout, SIGNAL(pluginMoved()), this, SLOT(pluginMoved())); + connect(mLayout, &LxQtPanelLayout::pluginMoved, this, &LxQtPanel::pluginMoved); LxQtPanelWidget->setLayout(mLayout); mLayout->setLineCount(mLineCount); @@ -153,7 +165,11 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : mDelaySave.setInterval(SETTINGS_SAVE_DELAY); connect(&mDelaySave, SIGNAL(timeout()), this, SLOT(saveSettings())); - connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(realign())); + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(PANEL_HIDE_DELAY); + connect(&mHideTimer, SIGNAL(timeout()), this, SLOT(hidePanelWork())); + + connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(realign())); connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(ensureVisible())); connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update())); connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign())); @@ -166,8 +182,14 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : loadPlugins(); show(); -} + // show it the first first time, despite setting + if (mHidable) + { + showPanel(); + QTimer::singleShot(PANEL_HIDE_FIRST_TIME, this, SLOT(hidePanel())); + } +} /************************************************ @@ -177,6 +199,11 @@ void LxQtPanel::readSettings() // Read settings ...................................... mSettings->beginGroup(mConfigGroup); + // Let Hidability be the first thing we read + // so that every call to realign() is without side-effect + mHidable = mSettings->value(CFG_KEY_HIDABLE, mHidable).toBool(); + mHidden = mHidable; + // By default we are using size & count from theme. setPanelSize(mSettings->value(CFG_KEY_PANELSIZE, PANEL_DEFAULT_SIZE).toInt(), false); setIconSize(mSettings->value(CFG_KEY_ICONSIZE, PANEL_DEFAULT_ICON_SIZE).toInt(), false); @@ -205,7 +232,6 @@ void LxQtPanel::readSettings() if (!image.isEmpty()) setBackgroundImage(image, false); - mSettings->endGroup(); } @@ -222,14 +248,10 @@ void LxQtPanel::saveSettings(bool later) return; } - QStringList pluginsList; - mSettings->beginGroup(mConfigGroup); - foreach (const Plugin *plugin, mPlugins) - pluginsList << plugin->settingsGroup(); - - mSettings->setValue(CFG_KEY_PLUGINS, (pluginsList.isEmpty() ? "" : QVariant(pluginsList))); + //Note: save/load of plugin names is completely handled by mPlugins object + //mSettings->setValue(CFG_KEY_PLUGINS, mPlugins->pluginNames()); mSettings->setValue(CFG_KEY_PANELSIZE, mPanelSize); mSettings->setValue(CFG_KEY_ICONSIZE, mIconSize); @@ -248,6 +270,8 @@ void LxQtPanel::saveSettings(bool later) mSettings->setValue(CFG_KEY_BACKGROUNDIMAGE, QFileInfo(mBackgroundImage).exists() ? mBackgroundImage : QString()); mSettings->setValue(CFG_KEY_OPACITY, mOpacity); + mSettings->setValue(CFG_KEY_HIDABLE, mHidable); + mSettings->endGroup(); } @@ -272,7 +296,6 @@ LxQtPanel::~LxQtPanel() { mLayout->setEnabled(false); // do not save settings because of "user deleted panel" functionality saveSettings(); - qDeleteAll(mPlugins); } @@ -304,82 +327,38 @@ QStringList pluginDesktopDirs() ************************************************/ void LxQtPanel::loadPlugins() { - QStringList desktopDirs = pluginDesktopDirs(); - mSettings->beginGroup(mConfigGroup); - QStringList sections = mSettings->value(CFG_KEY_PLUGINS).toStringList(); - mSettings->endGroup(); - - foreach (QString sect, sections) - { - QString type = mSettings->value(sect+"/type").toString(); - if (type.isEmpty()) - { - qWarning() << QString("Section \"%1\" not found in %2.").arg(sect, mSettings->fileName()); - continue; - } - - LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type)); - if( !list.count()) - { - qWarning() << QString("Plugin \"%1\" not found.").arg(type); - continue; - } - - loadPlugin(list.first(), sect); - } + QString names_key(mConfigGroup); + names_key += '/'; + names_key += QLatin1String(CFG_KEY_PLUGINS); + mPlugins.reset(new PanelPluginsModel(this, names_key, pluginDesktopDirs())); + + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, mLayout, &LxQtPanelLayout::addPlugin); + connect(mPlugins.data(), &PanelPluginsModel::pluginMovedUp, mLayout, &LxQtPanelLayout::moveUpPlugin); + //reemit signals + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, this, &LxQtPanel::pluginAdded); + connect(mPlugins.data(), &PanelPluginsModel::pluginRemoved, this, &LxQtPanel::pluginRemoved); + + for (auto const & plugin : mPlugins->plugins()) + mLayout->addPlugin(plugin); } - /************************************************ ************************************************/ -Plugin *LxQtPanel::loadPlugin(const LxQt::PluginInfo &desktopFile, const QString &settingsGroup) +int LxQtPanel::getReserveDimension() { - Plugin *plugin = new Plugin(desktopFile, mSettings->fileName(), settingsGroup, this); - if (plugin->isLoaded()) - { - mPlugins.append(plugin); - connect(plugin, SIGNAL(startMove()), mLayout, SLOT(startMovePlugin())); - connect(plugin, SIGNAL(remove()), this, SLOT(removePlugin())); - connect(this, SIGNAL(realigned()), plugin, SLOT(realign())); - mLayout->addWidget(plugin); - return plugin; - } - - delete plugin; - return 0; + return mHidable ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize); } - -/************************************************ - - ************************************************/ -void LxQtPanel::realign() +void LxQtPanel::setPanelGeometry() { - if (!isVisible()) - return; -#if 0 - qDebug() << "** Realign *********************"; - qDebug() << "PanelSize: " << mPanelSize; - qDebug() << "IconSize: " << mIconSize; - qDebug() << "LineCount: " << mLineCount; - qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px"); - qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right")); - qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum; - qDebug() << "Plugins count: " << mPlugins.count(); -#endif - const QRect currentScreen = QApplication::desktop()->screenGeometry(mScreenNum); - QSize size = sizeHint(); QRect rect; if (isHorizontal()) { // Horiz panel *************************** - size.setHeight(mPanelSize); - - // Size ....................... - rect.setHeight(qMax(PANEL_MINIMUM_SIZE, size.height())); + rect.setHeight(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); if (mLengthInPercents) rect.setWidth(currentScreen.width() * mLength / 100.0); else @@ -417,10 +396,7 @@ void LxQtPanel::realign() else { // Vert panel *************************** - size.setWidth(mPanelSize); - - // Size ....................... - rect.setWidth(qMax(PANEL_MINIMUM_SIZE, size.width())); + rect.setWidth(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); if (mLengthInPercents) rect.setHeight(currentScreen.height() * mLength / 100.0); else @@ -455,11 +431,31 @@ void LxQtPanel::realign() else rect.moveRight(currentScreen.right()); } + mLayout->setMargin(mHidden ? PANEL_HIDE_MARGIN : 0); if (rect != geometry()) { setGeometry(rect); setFixedSize(rect.size()); } +} + +void LxQtPanel::realign() +{ + if (!isVisible()) + return; +#if 0 + qDebug() << "** Realign *********************"; + qDebug() << "PanelSize: " << mPanelSize; + qDebug() << "IconSize: " << mIconSize; + qDebug() << "LineCount: " << mLineCount; + qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px"); + qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right")); + qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum; + qDebug() << "Plugins count: " << mPlugins.count(); +#endif + + setPanelGeometry(); + // Reserve our space on the screen .......... // It's possible that our geometry is not changed, but screen resolution is changed, // so resetting WM_STRUT is still needed. To make it simple, we always do it. @@ -474,8 +470,6 @@ void LxQtPanel::updateWmStrut() if(wid == 0 || !isVisible()) return; - const QRect wholeScreen = QApplication::desktop()->geometry(); - // qDebug() << "wholeScreen" << wholeScreen; const QRect rect = geometry(); // NOTE: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html // Quote from the EWMH spec: " Note that the strut is relative to the screen edge, and not the edge of the xinerama monitor." @@ -488,7 +482,7 @@ void LxQtPanel::updateWmStrut() KWindowSystem::setExtendedStrut(wid, /* Left */ 0, 0, 0, /* Right */ 0, 0, 0, - /* Top */ height(), rect.left(), rect.right(), + /* Top */ getReserveDimension(), rect.left(), rect.right(), /* Bottom */ 0, 0, 0 ); break; @@ -498,13 +492,13 @@ void LxQtPanel::updateWmStrut() /* Left */ 0, 0, 0, /* Right */ 0, 0, 0, /* Top */ 0, 0, 0, - /* Bottom */ wholeScreen.bottom() - rect.y(), rect.left(), rect.right() + /* Bottom */ getReserveDimension(), rect.left(), rect.right() ); break; case LxQtPanel::PositionLeft: KWindowSystem::setExtendedStrut(wid, - /* Left */ width(), rect.top(), rect.bottom(), + /* Left */ getReserveDimension(), rect.top(), rect.bottom(), /* Right */ 0, 0, 0, /* Top */ 0, 0, 0, /* Bottom */ 0, 0, 0 @@ -515,7 +509,7 @@ void LxQtPanel::updateWmStrut() case LxQtPanel::PositionRight: KWindowSystem::setExtendedStrut(wid, /* Left */ 0, 0, 0, - /* Right */ wholeScreen.right() - rect.x(), rect.top(), rect.bottom(), + /* Right */ getReserveDimension(), rect.top(), rect.bottom(), /* Top */ 0, 0, 0, /* Bottom */ 0, 0, 0 ); @@ -588,50 +582,36 @@ int LxQtPanel::findAvailableScreen(LxQtPanel::Position position) ************************************************/ void LxQtPanel::showConfigDialog() { - ConfigPanelDialog::exec(this); -} - - -/************************************************ - - ************************************************/ -void LxQtPanel::showAddPluginDialog() -{ - LxQt::AddPluginDialog *dialog = findChild(); - - if (!dialog) - { - dialog = new LxQt::AddPluginDialog(pluginDesktopDirs(), "LxQtPanel/Plugin", "*", this); - dialog->setWindowTitle(tr("Add Panel Widgets")); - dialog->setAttribute(Qt::WA_DeleteOnClose); - connect(dialog, SIGNAL(pluginSelected(const LxQt::PluginInfo&)), this, SLOT(addPlugin(const LxQt::PluginInfo&))); - connect(this, SIGNAL(pluginAdded(QString)), dialog, SLOT(pluginAdded(const QString &))); - connect(this, SIGNAL(pluginRemoved(QString)), dialog, SLOT(pluginRemoved(const QString &))); - } + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); - QStringList pluginsInUseIDs; - foreach (Plugin *i, mPlugins) - pluginsInUseIDs << i->desktopFile().id(); - dialog->setPluginsInUse(pluginsInUseIDs); + mConfigDialog->showConfigPanelPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); - dialog->show(); - KWindowSystem::setOnDesktop(dialog->effectiveWinId(), KWindowSystem::currentDesktop()); + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); } /************************************************ ************************************************/ -void LxQtPanel::addPlugin(const LxQt::PluginInfo &desktopFile) +void LxQtPanel::showAddPluginDialog() { - QString settingsGroup = findNewPluginSettingsGroup(desktopFile.id()); - loadPlugin(desktopFile, settingsGroup); - saveSettings(true); + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); - realign(); - emit realigned(); + mConfigDialog->showConfigPluginsPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); - emit pluginAdded(desktopFile.id()); + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); } @@ -641,8 +621,8 @@ void LxQtPanel::addPlugin(const LxQt::PluginInfo &desktopFile) void LxQtPanel::updateStyleSheet() { QStringList sheet; - sheet << QString("Plugin > * { qproperty-iconSize: %1px %1px; }").arg(mIconSize); - sheet << QString("Plugin > * > * { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + sheet << QString("Plugin > QAbstractButton, LxQtTray { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + sheet << QString("Plugin > * > QAbstractButton, TrayIcon { qproperty-iconSize: %1px %1px; }").arg(mIconSize); if (mFontColor.isValid()) sheet << QString("Plugin * { color: " + mFontColor.name() + "; }"); @@ -676,7 +656,6 @@ void LxQtPanel::setPanelSize(int value, bool save) { mPanelSize = value; realign(); - emit realigned(); if (save) saveSettings(true); @@ -700,7 +679,6 @@ void LxQtPanel::setIconSize(int value, bool save) saveSettings(true); realign(); - emit realigned(); } } @@ -721,7 +699,6 @@ void LxQtPanel::setLineCount(int value, bool save) saveSettings(true); realign(); - emit realigned(); } } @@ -742,7 +719,6 @@ void LxQtPanel::setLength(int length, bool inPercents, bool save) saveSettings(true); realign(); - emit realigned(); } @@ -785,7 +761,6 @@ void LxQtPanel::setPosition(int screen, ILxQtPanel::Position position, bool save } realign(); - emit realigned(); } /************************************************ @@ -802,7 +777,6 @@ void LxQtPanel::setAlignment(Alignment value, bool save) saveSettings(true); realign(); - emit realigned(); } /************************************************ @@ -876,7 +850,6 @@ bool LxQtPanel::event(QEvent *event) break; case QEvent::LayoutRequest: - realign(); emit realigned(); break; @@ -893,14 +866,25 @@ bool LxQtPanel::event(QEvent *event) // Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5 // See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887 - // Let's do it manually - NETWinInfo info(QX11Info::connection(), effectiveWinId(), QX11Info::appRootWindow(), NET::WMWindowType, 0); - info.setWindowType(NET::Dock); + // Let's use KWindowSystem for that + KWindowSystem::setType(effectiveWinId(), NET::Dock); updateWmStrut(); // reserve screen space for the panel KWindowSystem::setOnAllDesktops(effectiveWinId(), true); break; } + case QEvent::DragEnter: + event->ignore(); + //no break intentionally + case QEvent::Enter: + showPanel(); + break; + + case QEvent::Leave: + case QEvent::DragLeave: + hidePanel(); + break; + default: break; } @@ -916,7 +900,6 @@ void LxQtPanel::showEvent(QShowEvent *event) { QFrame::showEvent(event); realign(); - emit realigned(); } @@ -925,10 +908,10 @@ void LxQtPanel::showEvent(QShowEvent *event) ************************************************/ void LxQtPanel::showPopupMenu(Plugin *plugin) { - QList pluginsMenus; - PopupMenu menu(tr("Panel")); + PopupMenu * menu = new PopupMenu(tr("Panel"), this); + menu->setAttribute(Qt::WA_DeleteOnClose); - menu.setIcon(XdgIcon::fromTheme("configure-toolbars")); + menu->setIcon(XdgIcon::fromTheme("configure-toolbars")); // Plugin Menu .............................. if (plugin) @@ -937,96 +920,85 @@ void LxQtPanel::showPopupMenu(Plugin *plugin) if (m) { - menu.addTitle(plugin->windowTitle()); - menu.addActions(m->actions()); - pluginsMenus << m; + menu->addTitle(plugin->windowTitle()); + menu->addActions(m->actions()); + qobject_cast(m)->setParent(menu); } } // Panel menu ............................... - menu.addTitle(QIcon(), tr("Panel")); + menu->addTitle(QIcon(), tr("Panel")); - menu.addAction(XdgIcon::fromTheme(QStringLiteral("configure")), - tr("Configure Panel..."), + menu->addAction(XdgIcon::fromTheme(QStringLiteral("configure")), + tr("Configure Panel"), this, SLOT(showConfigDialog()) ); - menu.addAction(XdgIcon::fromTheme("preferences-plugin"), - tr("Add Panel Widgets..."), + menu->addAction(XdgIcon::fromTheme("preferences-plugin"), + tr("Manage Widgets"), this, SLOT(showAddPluginDialog()) ); LxQtPanelApplication *a = reinterpret_cast(qApp); - menu.addAction(XdgIcon::fromTheme(QLatin1String("list-add")), + menu->addAction(XdgIcon::fromTheme(QLatin1String("list-add")), tr("Add Panel"), a, SLOT(addNewPanel()) ); if (a->count() > 1) { - menu.addAction(XdgIcon::fromTheme(QStringLiteral("list-remove")), + menu->addAction(XdgIcon::fromTheme(QStringLiteral("list-remove")), tr("Remove Panel"), this, SLOT(userRequestForDeletion()) ); } #ifdef DEBUG - menu.addSeparator(); - menu.addAction("Exit (debug only)", qApp, SLOT(quit())); + menu->addSeparator(); + menu->addAction("Exit (debug only)", qApp, SLOT(quit())); #endif - menu.exec(QCursor::pos()); - qDeleteAll(pluginsMenus); + /* Note: in multihead & multipanel setup the QMenu::popup/exec places the window + * sometimes wrongly (it seems that this bug is somehow connected to misinterpretation + * of QDesktopWidget::availableGeometry) + */ + menu->setGeometry(calculatePopupWindowPos(QCursor::pos(), menu->sizeHint())); + menu->show(); } - -/************************************************ - - ************************************************/ -Plugin *LxQtPanel::findPlugin(const ILxQtPanelPlugin *iPlugin) const +Plugin* LxQtPanel::findPlugin(const ILxQtPanelPlugin* iPlugin) const { - foreach(Plugin *plugin, mPlugins) - { - if (plugin->iPlugin() == iPlugin) - return plugin; - } - - return 0; + Plugin *plugin = nullptr; + for (Plugin *plug : mPlugins->plugins()) + if (plug->iPlugin() == iPlugin) + plugin = plug; + return plugin; } - /************************************************ ************************************************/ -QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const +QRect LxQtPanel::calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const { - Plugin *panelPlugin = findPlugin(plugin); - if (!plugin) - return QRect(); - - int x=0, y=0; + int x = absolutePos.x(), y = absolutePos.y(); switch (position()) { case ILxQtPanel::PositionTop: - x = panelPlugin->mapToGlobal(QPoint(0, 0)).x(); y = globalGometry().bottom(); break; case ILxQtPanel::PositionBottom: - x = panelPlugin->mapToGlobal(QPoint(0, 0)).x(); y = globalGometry().top() - windowSize.height(); break; case ILxQtPanel::PositionLeft: x = globalGometry().right(); - y = panelPlugin->mapToGlobal(QPoint(0, 0)).y(); break; case ILxQtPanel::PositionRight: x = globalGometry().left() - windowSize.width(); - y = panelPlugin->mapToGlobal(QPoint(0, 0)).y(); break; } @@ -1052,62 +1024,50 @@ QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const Q return res; } - /************************************************ ************************************************/ -QString LxQtPanel::qssPosition() const -{ - return positionToStr(position()); -} - - -/************************************************ - - ************************************************/ -QString LxQtPanel::findNewPluginSettingsGroup(const QString &pluginType) const +QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const { - QStringList groups = mSettings->childGroups(); - groups.sort(); + Plugin *panel_plugin = findPlugin(plugin); + if (nullptr == panel_plugin) + return QRect(); - // Generate new section name - for (int i = 2; true; ++i) - if (!groups.contains(QString("%1%2").arg(pluginType).arg(i))) - return QString("%1%2").arg(pluginType).arg(i); + return calculatePopupWindowPos(panel_plugin->mapToGlobal(QPoint(0, 0)), windowSize); } /************************************************ ************************************************/ -void LxQtPanel::removePlugin() +QString LxQtPanel::qssPosition() const { - Plugin *plugin = qobject_cast(sender()); - QString id; - if (plugin) - { - mSettings->remove(plugin->settingsGroup()); - id = mPlugins.takeAt(mPlugins.indexOf(plugin))->desktopFile().id(); - } - - saveSettings(); - emit pluginRemoved(id); + return positionToStr(position()); } - /************************************************ ************************************************/ -void LxQtPanel::pluginMoved() +void LxQtPanel::pluginMoved(Plugin * plug) { - mPlugins.clear(); + //get new position of the moved plugin + bool found{false}; + QString plug_is_before; for (int i=0; icount(); ++i) { Plugin *plugin = qobject_cast(mLayout->itemAt(i)->widget()); if (plugin) - mPlugins << plugin; + { + if (found) + { + //we found our plugin in previous cycle -> is before this (or empty as last) + plug_is_before = plugin->settingsGroup(); + break; + } else + found = (plug == plugin); + } } - saveSettings(); + mPlugins->movePlugin(plug, plug_is_before); } @@ -1128,3 +1088,56 @@ void LxQtPanel::userRequestForDeletion() emit deletedByUser(this); } + +void LxQtPanel::showPanel() +{ + if (mHidable) + { + mHideTimer.stop(); + if (mHidden) + { + mHidden = false; + setPanelGeometry(); + } + } +} + +void LxQtPanel::hidePanel() +{ + if (mHidable && !mHidden) + mHideTimer.start(); +} + +void LxQtPanel::hidePanelWork() +{ + if (mHidable && !mHidden && !geometry().contains(QCursor::pos())) + { + mHidden = true; + setPanelGeometry(); + } else + { + mHideTimer.start(); + } +} + +void LxQtPanel::setHidable(bool hidable, bool save) +{ + if (mHidable == hidable) + return; + + mHidable = mHidden = hidable; + + if (save) + saveSettings(true); + + realign(); +} + +bool LxQtPanel::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + Plugin const * plugin = mPlugins->pluginByID(pluginId); + if (nullptr == plugin) + return false; + else + return plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::SingleInstance); +} diff --git a/panel/lxqtpanel.h b/panel/lxqtpanel.h index f1b2123..06aa608 100644 --- a/panel/lxqtpanel.h +++ b/panel/lxqtpanel.h @@ -32,17 +32,21 @@ #include #include #include +#include #include "ilxqtpanel.h" #include "lxqtpanelglobals.h" class QMenu; class Plugin; +class QAbstractItemModel; namespace LxQt { class Settings; class PluginInfo; } class LxQtPanelLayout; +class ConfigPanelDialog; +class PanelPluginsModel; /*! \brief The LxQtPanel class provides a single lxqt-panel. */ @@ -52,6 +56,10 @@ class LXQT_PANEL_API LxQtPanel : public QFrame, public ILxQtPanel Q_PROPERTY(QString position READ qssPosition) + // for configuration dialog + friend class ConfigPanelWidget; + friend class ConfigPluginsWidget; + public: enum Alignment { AlignmentLeft = -1, @@ -71,6 +79,8 @@ public: // ILxQtPanel ......................... ILxQtPanel::Position position() const { return mPosition; } QRect globalGometry() const; + Plugin *findPlugin(const ILxQtPanelPlugin *iPlugin) const; + QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const; QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const; // For QSS properties .................. @@ -92,11 +102,17 @@ public: QColor backgroundColor() const { return mBackgroundColor; }; QString backgroundImage() const { return mBackgroundImage; }; int opacity() const { return mOpacity; }; + bool hidable() const { return mHidable; } LxQt::Settings *settings() const { return mSettings; } + bool isPluginSingletonAndRunnig(QString const & pluginId) const; + public slots: void show(); + void showPanel(); + void hidePanel(); + void hidePanelWork(); // Settings void setPanelSize(int value, bool save); @@ -109,6 +125,7 @@ public slots: void setBackgroundColor(QColor color, bool save); void setBackgroundImage(QString path, bool save); void setOpacity(int opacity, bool save); + void setHidable(bool hidable, bool save); void saveSettings(bool later=false); void ensureVisible(); @@ -116,21 +133,19 @@ public slots: signals: void realigned(); void deletedByUser(LxQtPanel *self); - - void pluginAdded(QString id); - void pluginRemoved(QString id); + void pluginAdded(); + void pluginRemoved(); protected: bool event(QEvent *event); void showEvent(QShowEvent *event); -private slots: - void addPlugin(const LxQt::PluginInfo &desktopFile); +public slots: void showConfigDialog(); +private slots: void showAddPluginDialog(); void realign(); - void removePlugin(); - void pluginMoved(); + void pluginMoved(Plugin * plug); void userRequestForDeletion(); private: @@ -138,16 +153,15 @@ private: LxQt::Settings *mSettings; QFrame *LxQtPanelWidget; QString mConfigGroup; - QList mPlugins; + QScopedPointer mPlugins; int findAvailableScreen(LxQtPanel::Position position); void updateWmStrut(); void loadPlugins(); - Plugin *loadPlugin(const LxQt::PluginInfo &desktopFile, const QString &settingsGroup); - Plugin *findPlugin(const ILxQtPanelPlugin *iPlugin) const; - QString findNewPluginSettingsGroup(const QString &pluginType) const; + void setPanelGeometry(); + int getReserveDimension(); int mPanelSize; int mIconSize; @@ -161,12 +175,16 @@ private: ILxQtPanel::Position mPosition; int mScreenNum; QTimer mDelaySave; + bool mHidable; + bool mHidden; + QTimer mHideTimer; QColor mFontColor; QColor mBackgroundColor; QString mBackgroundImage; // 0 to 100 int mOpacity; + QPointer mConfigDialog; void updateStyleSheet(); }; diff --git a/panel/lxqtpanelapplication.cpp b/panel/lxqtpanelapplication.cpp index 4e0fa14..d5c140a 100644 --- a/panel/lxqtpanelapplication.cpp +++ b/panel/lxqtpanelapplication.cpp @@ -34,12 +34,31 @@ #include #include #include +#include -LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString &configFile) - : LxQt::Application(argc, argv) +LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv) + : LxQt::Application(argc, argv, true) { + QCoreApplication::setApplicationName(QStringLiteral("lxqt-panel")); + QCoreApplication::setApplicationVersion(LXQT_VERSION); + + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt panel")); + parser.addHelpOption(); + parser.addVersionOption(); + + QCommandLineOption configFileOption(QStringList() + << QStringLiteral("c") << QStringLiteral("config") << QStringLiteral("configfile"), + QCoreApplication::translate("main", "Use alternate configuration file."), + QCoreApplication::translate("main", "Configuration file")); + parser.addOption(configFileOption); + + parser.process(*this); + + const QString configFile = parser.value(configFileOption); + if (configFile.isEmpty()) - mSettings = new LxQt::Settings("panel", this); + mSettings = new LxQt::Settings(QStringLiteral("panel"), this); else mSettings = new LxQt::Settings(configFile, QSettings::IniFormat, this); @@ -49,6 +68,8 @@ LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString connect(screen, &QScreen::destroyed, this, &LxQtPanelApplication::screenDestroyed); } connect(this, &QGuiApplication::screenAdded, this, &LxQtPanelApplication::handleScreenAdded); + connect(this, &QCoreApplication::aboutToQuit, this, &LxQtPanelApplication::cleanup); + QStringList panels = mSettings->value("panels").toStringList(); @@ -64,6 +85,10 @@ LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString } LxQtPanelApplication::~LxQtPanelApplication() +{ +} + +void LxQtPanelApplication::cleanup() { qDeleteAll(mPanels); } @@ -77,7 +102,7 @@ void LxQtPanelApplication::addNewPanel() mSettings->setValue("panels", panels); // Poupup the configuration dialog to allow user configuration right away - ConfigPanelDialog::exec(p); + p->showConfigDialog(); } LxQtPanel* LxQtPanelApplication::addPanel(const QString& name) @@ -86,6 +111,10 @@ LxQtPanel* LxQtPanelApplication::addPanel(const QString& name) mPanels << panel; connect(panel, SIGNAL(deletedByUser(LxQtPanel*)), this, SLOT(removePanel(LxQtPanel*))); + //reemit signals + connect(panel, &LxQtPanel::pluginAdded, this, &LxQtPanelApplication::pluginAdded); + connect(panel, &LxQtPanel::pluginRemoved, this, &LxQtPanelApplication::pluginRemoved); + return panel; } @@ -186,3 +215,12 @@ void LxQtPanelApplication::removePanel(LxQtPanel* panel) panel->deleteLater(); } + +bool LxQtPanelApplication::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + for (auto const & panel : mPanels) + if (panel->isPluginSingletonAndRunnig(pluginId)) + return true; + + return false; +} diff --git a/panel/lxqtpanelapplication.h b/panel/lxqtpanelapplication.h index 0b5f258..55d13ca 100644 --- a/panel/lxqtpanelapplication.h +++ b/panel/lxqtpanelapplication.h @@ -43,15 +43,20 @@ class LxQtPanelApplication : public LxQt::Application { Q_OBJECT public: - explicit LxQtPanelApplication(int& argc, char** argv, const QString &configFile); + explicit LxQtPanelApplication(int& argc, char** argv); ~LxQtPanelApplication(); int count() { return mPanels.count(); } LxQt::Settings *settings() { return mSettings; } + bool isPluginSingletonAndRunnig(QString const & pluginId) const; public slots: void addNewPanel(); +signals: + void pluginAdded(); + void pluginRemoved(); + private: QList mPanels; @@ -63,6 +68,7 @@ private slots: void handleScreenAdded(QScreen* newScreen); void screenDestroyed(QObject* screenObj); void reloadPanelsAsNeeded(); + void cleanup(); private: LxQt::Settings *mSettings; diff --git a/panel/lxqtpanelglobals.h b/panel/lxqtpanelglobals.h index b3550d8..36da6a7 100644 --- a/panel/lxqtpanelglobals.h +++ b/panel/lxqtpanelglobals.h @@ -24,7 +24,7 @@ * Boston, MA 02110-1301 USA * * END_COMMON_COPYRIGHT_HEADER */ - + #ifndef __LXQT_PANEL_GLOBALS_H__ #define __LXQT_PANEL_GLOBALS_H__ diff --git a/panel/lxqtpanellayout.cpp b/panel/lxqtpanellayout.cpp index 4cabdb1..6416bca 100644 --- a/panel/lxqtpanellayout.cpp +++ b/panel/lxqtpanellayout.cpp @@ -542,7 +542,11 @@ void LxQtPanelLayout::moveItem(int from, int to, bool withAnimation) { QLayoutItem *item = fromGrid->takeAt(fromIdx); toGrid->addItem(item); - toGrid->moveItem(toGrid->count()-1, toIdx); + //recalculate position because we removed from one and put to another grid + LayoutItemGrid *toGridAux=0; + globalIndexToLocal(to, &toGridAux, &toIdx); + Q_ASSERT(toGrid == toGridAux); //grid must be the same (if not something is wrong with our logic) + toGrid->moveItem(toGridAux->count()-1, toIdx); } } @@ -589,16 +593,18 @@ void LxQtPanelLayout::setGeometry(const QRect &geometry) if (!mRightGrid->isValid()) mRightGrid->update(); + QRect my_geometry{geometry}; + my_geometry -= contentsMargins(); if (count()) { if (isHorizontal()) - setGeometryHoriz(geometry); + setGeometryHoriz(my_geometry); else - setGeometryVert(geometry); + setGeometryVert(my_geometry); } mAnimate = false; - QLayout::setGeometry(geometry); + QLayout::setGeometry(my_geometry); } @@ -639,9 +645,12 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) // Calc baselines for plugins like button. QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); { - int bh = (geometry.height() / baseLines.count()) / 2; - for (int i=0; i> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bh) + { + *i = base; + } } #if 0 @@ -682,7 +691,8 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(0, baseLines[c])); rect.moveLeft(left); } @@ -719,7 +729,8 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(0, baseLines[c])); rect.moveRight(right); } @@ -750,9 +761,12 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) // Calc baselines for plugins like button. QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); { - int bw = (geometry.width() / baseLines.count()) / 2; - for (int i=0; i> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bw) + { + *i = base; + } } #if 0 @@ -792,7 +806,8 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(baseLines[c], 0)); rect.moveTop(top); } @@ -829,7 +844,8 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(baseLines[c], 0)); rect.moveBottom(bottom); } @@ -960,6 +976,32 @@ void LxQtPanelLayout::finishMovePlugin() Plugin *plugin = moveProcessor->plugin(); int n = indexOf(plugin); plugin->setAlignment(ncount() ? Plugin::AlignLeft : Plugin::AlignRight); - emit pluginMoved(); + emit pluginMoved(plugin); } } + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::moveUpPlugin(Plugin * plugin) +{ + const int i = indexOf(plugin); + if (0 < i) + moveItem(i, i - 1, true); +} + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::addPlugin(Plugin * plugin) +{ + connect(plugin, &Plugin::startMove, this, &LxQtPanelLayout::startMovePlugin); + + const int prev_count = count(); + addWidget(plugin); + + //check actual position + const int pos = indexOf(plugin); + if (prev_count > pos) + moveItem(pos, prev_count, false); +} diff --git a/panel/lxqtpanellayout.h b/panel/lxqtpanellayout.h index e3b950b..c833647 100644 --- a/panel/lxqtpanellayout.h +++ b/panel/lxqtpanellayout.h @@ -75,11 +75,13 @@ public: static bool itemIsSeparate(QLayoutItem *item); signals: - void pluginMoved(); + void pluginMoved(Plugin * plugin); public slots: void startMovePlugin(); void finishMovePlugin(); + void moveUpPlugin(Plugin * plugin); + void addPlugin(Plugin * plugin); private: mutable QSize mMinPluginSize; diff --git a/panel/lxqtpanellimits.h b/panel/lxqtpanellimits.h index ffc7dea..0dfff4f 100644 --- a/panel/lxqtpanellimits.h +++ b/panel/lxqtpanellimits.h @@ -31,11 +31,16 @@ #define PANEL_DEFAULT_SIZE 32 #define PANEL_MINIMUM_SIZE 16 #define PANEL_MAXIMUM_SIZE 200 +#define PANEL_HIDE_SIZE 4 +#define PANEL_HIDE_MARGIN (PANEL_HIDE_SIZE / 2) #define PANEL_DEFAULT_ICON_SIZE 22 #define PANEL_DEFAULT_LINE_COUNT 1 #define PANEL_DEFAULT_BACKGROUND_COLOR "#CCCCCC" +#define PANEL_HIDE_DELAY 500 +#define PANEL_HIDE_FIRST_TIME (5000 - PANEL_HIDE_DELAY) + #define SETTINGS_SAVE_DELAY 3000 #endif // LXQTPANELLIMITS_H diff --git a/panel/main.cpp b/panel/main.cpp index c5ec668..53d6921 100644 --- a/panel/main.cpp +++ b/panel/main.cpp @@ -26,15 +26,7 @@ * END_COMMON_COPYRIGHT_HEADER */ -#include -#include -#include -#include -#include -#include - #include "lxqtpanelapplication.h" -#include "lxqtpanel.h" /*! The lxqt-panel is the panel of LXDE-Qt. Usage: lxqt-panel [CONFIG_ID] @@ -42,74 +34,9 @@ (default main) */ -void termSignalHandler(int) -{ - qApp->quit(); -} - - -void printHelp() -{ - QTextStream out(stdout); - out << "Usage: lxqt-panel [options]" << endl; - out << endl; - out << "Start lxde-qt panel and its plugins" << endl; - out << endl; - out << "Options:" << endl; - out << " -h, --help Show help about options" << endl; - out << " --version Show version information" << endl; - out << " -c, --configfile=CONFIGFILE Use alternate configuration file" << endl; -} - - -void printVersion() -{ - QTextStream out(stdout); - out << "lxqt-panel " << LXQT_VERSION << endl; -} - - int main(int argc, char *argv[]) { - QString configFile; - for (int i=1; i < argc; ++i) - { - QString arg = QString::fromLocal8Bit(argv[i]); - - if (arg == "--help" || arg == "-h") - { - printHelp(); - return 0; - } - - if (arg == "--version") - { - printVersion(); - return 0; - } - - if (arg == "-c" || arg.startsWith("--conf")) - { - if (i+1 < argc) - { - configFile = QString::fromLocal8Bit(argv[i+1]); - } - } - } - - LxQtPanelApplication *app = new LxQtPanelApplication(argc, argv, configFile); - - - //Setup Unix signal handlers - struct sigaction term; - term.sa_handler = termSignalHandler; - sigemptyset(&term.sa_mask); - term.sa_flags |= SA_RESTART; - sigaction(SIGTERM, &term, 0); - sigaction(SIGINT, &term, 0); - - bool res = app->exec(); + LxQtPanelApplication app(argc, argv); - app->deleteLater(); - return res; + return app.exec(); } diff --git a/panel/man/lxqt-panel.1 b/panel/man/lxqt-panel.1 index 1eb6416..c3eb14a 100644 --- a/panel/man/lxqt-panel.1 +++ b/panel/man/lxqt-panel.1 @@ -1,6 +1,6 @@ -.TH lxqt-panel "1" "September 2012" "LxQt\-qt\ 0.5.0" "LxQt\-qt\ Module" +.TH lxqt-panel "1" "September 2012" "LXQt\ 0.5.0" "LXQt\ Module" .SH NAME -lxqt-panel \- Panel of \fBLXDE-Qt\fR: the faster and lighter QT Desktop Environment +lxqt-panel \- Panel of \fBLXQt\fR: the faster and lighter QT Desktop Environment .SH SYNOPSIS .B lxqt-panel .br @@ -8,10 +8,10 @@ lxqt-panel \- Panel of \fBLXDE-Qt\fR: the faster and lighter QT Desktop Environm This module adds a panel to the desktop. .P .P -The \fBLXDE-Qt modules\fR are desktop independent tools, +The \fBLXQt modules\fR are desktop independent tools, and operate as daemons for the local user for desktop specific operations. .P -\fBLXDE-Qt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt +\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt technologies, ships several core desktop components, all of which are optional: .P * Panel \fI(this)\fR @@ -25,7 +25,7 @@ technologies, ships several core desktop components, all of which are optional: .P These components perform similar actions to those available in other desktop environments, and their name is self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLxQt\-qt\fR session in the Display +by hand but automatically, when choosing a \fBLXQt\fR session in the Display Manager. .SH BEHAVIOR The module can be run standard alone, and also autostarted at logon. Show a bar panel @@ -37,21 +37,21 @@ Several plugins are loaded by default, the desktop menu and windows workspaces c .SH CONFIGURATIONS By right clickin over there show config setting options for each plugins and also panel itsefl. .SH AUTOSTART -The module only are showed on \fBLXDE-Qt\fR desktop environment, but you can create an autostart action +The module only are showed on \fBLXQt\fR desktop environment, but you can create an autostart action for you prefered desktop environment. .SH "REPORTING BUGS" -Report bugs to https://github.com/LXDE-Qt/LXDE-Qt/issues +Report bugs to https://github.com/LXDE/LXQt/issues .SH "SEE ALSO" -\fBLXDE-Qt\fR it has been tailored for users who value simplicity, speed, and +\fBLXQt\fR it has been tailored for users who value simplicity, speed, and an intuitive interface, also intended for less powerful machines. See: .\" any module must refers to session app, for more info on start it .P -\fBlxqt-session.1\fR LXDE-Qt for manage LXDE-Qt complete environment +\fBlxqt-session.1\fR LXQt for manage LXQt complete environment .P -\fBstart-lxqt.1\fR LXDE-Qt display management independient starup. +\fBstart-lxqt.1\fR LXQt display management independient starup. .P -\fBlxqt-config.1\fR LXDE-Qt config center application for performing settings +\fBlxqt-config.1\fR LXQt config center application for performing settings .P .SH AUTHOR This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR -for \fBLXDE-Qt\fR project and VENENUX GNU/Linux but can be used by others. +for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/panel/panelpluginsmodel.cpp b/panel/panelpluginsmodel.cpp new file mode 100644 index 0000000..9e87f34 --- /dev/null +++ b/panel/panelpluginsmodel.cpp @@ -0,0 +1,331 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "panelpluginsmodel.h" +#include "plugin.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanel.h" +#include "lxqtpanelapplication.h" +#include +#include +#include + +#include + +PanelPluginsModel::PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent/* = nullptr*/) + : QAbstractListModel{parent}, + mNamesKey(namesKey), + mPanel(panel) +{ + loadPlugins(desktopDirs); +} + +PanelPluginsModel::~PanelPluginsModel() +{ + qDeleteAll(plugins()); +} + +int PanelPluginsModel::rowCount(const QModelIndex & parent/* = QModelIndex()*/) const +{ + return QModelIndex() == parent ? mPlugins.size() : 0; +} + + +QVariant PanelPluginsModel::data(const QModelIndex & index, int role/* = Qt::DisplayRole*/) const +{ + Q_ASSERT(QModelIndex() == index.parent() + && 0 == index.column() + && mPlugins.size() > index.row() + ); + + pluginslist_t::const_reference plugin = mPlugins[index.row()]; + QVariant ret; + switch (role) + { + case Qt::DisplayRole: + if (plugin.second.isNull()) + ret = QStringLiteral("Unknown (%1)").arg(plugin.first); + else + ret = QStringLiteral("%1 (%2)").arg(plugin.second->name(), plugin.first); + break; + case Qt::DecorationRole: + if (plugin.second.isNull()) + ret = XdgIcon::fromTheme("preferences-plugin"); + else + ret = plugin.second->desktopFile().icon(XdgIcon::fromTheme("preferences-plugin")); + break; + case Qt::UserRole: + ret = QVariant::fromValue(const_cast(plugin.second.data())); + break; + } + return ret; +} + +Qt::ItemFlags PanelPluginsModel::flags(const QModelIndex & index) const +{ + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemNeverHasChildren; +} + +QStringList PanelPluginsModel::pluginNames() const +{ + QStringList names; + for (auto const & p : mPlugins) + names.append(p.first); + return std::move(names); +} + +QList PanelPluginsModel::plugins() const +{ + QList plugins; + for (auto const & p : mPlugins) + if (!p.second.isNull()) + plugins.append(p.second.data()); + return std::move(plugins); +} + +Plugin* PanelPluginsModel::pluginByName(QString name) const +{ + for (auto const & p : mPlugins) + if (p.first == name) + return p.second.data(); + return nullptr; +} + +Plugin const * PanelPluginsModel::pluginByID(QString id) const +{ + for (auto const & p : mPlugins) + { + Plugin *plugin = p.second.data(); + if (plugin && plugin->desktopFile().id() == id) + return plugin; + } + return nullptr; +} + +void PanelPluginsModel::addPlugin(const LxQt::PluginInfo &desktopFile) +{ + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(desktopFile.id())) + return; + + QString name = findNewPluginSettingsGroup(desktopFile.id()); + + QPointer plugin = loadPlugin(desktopFile, name); + if (plugin.isNull()) + return; + + beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size()); + mPlugins.append({name, plugin}); + endInsertRows(); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + emit pluginAdded(plugin.data()); +} + +void PanelPluginsModel::removePlugin(pluginslist_t::iterator plugin) +{ + if (mPlugins.end() != plugin) + { + mPanel->settings()->remove(plugin->first); + Plugin * p = plugin->second.data(); + const int row = plugin - mPlugins.begin(); + beginRemoveRows(QModelIndex(), row, row); + mPlugins.erase(plugin); + endRemoveRows(); + mActive = mPlugins.isEmpty() ? QModelIndex() : createIndex(mPlugins.size() > row ? row : row - 1, 0); + emit pluginRemoved(p); // p can be nullptr + mPanel->settings()->setValue(mNamesKey, pluginNames()); + if (nullptr != p) + p->deleteLater(); + } +} + +void PanelPluginsModel::removePlugin() +{ + Plugin * p = qobject_cast(sender()); + auto plugin = std::find_if(mPlugins.begin(), mPlugins.end(), + [p] (pluginslist_t::const_reference obj) { return p == obj.second; }); + removePlugin(std::move(plugin)); +} + +void PanelPluginsModel::movePlugin(Plugin * plugin, QString const & nameAfter) +{ + //merge list of plugins (try to preserve original position) + const int from = + std::find_if(mPlugins.begin(), mPlugins.end(), [plugin] (pluginslist_t::const_reference obj) { return plugin == obj.second.data(); }) + - mPlugins.begin(); + const int to = + std::find_if(mPlugins.begin(), mPlugins.end(), [nameAfter] (pluginslist_t::const_reference obj) { return nameAfter == obj.first; }) + - mPlugins.begin(); + const int to_plugins = from < to ? to - 1 : to; + + if (from != to && from != to_plugins) + { + beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + mPlugins.move(from, to_plugins); + endMoveRows(); + emit pluginMoved(plugin); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + } +} + +void PanelPluginsModel::loadPlugins(QStringList const & desktopDirs) +{ + QStringList plugin_names = mPanel->settings()->value(mNamesKey).toStringList(); + +#ifdef DEBUG_PLUGIN_LOADTIME + QElapsedTimer timer; + timer.start(); + qint64 lastTime = 0; +#endif + for (auto const & name : plugin_names) + { + pluginslist_t::iterator i = mPlugins.insert(mPlugins.end(), {name, nullptr}); + QString type = mPanel->settings()->value(name + "/type").toString(); + if (type.isEmpty()) + { + qWarning() << QString("Section \"%1\" not found in %2.").arg(name, mPanel->settings()->fileName()); + continue; + } + + LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type)); + if( !list.count()) + { + qWarning() << QString("Plugin \"%1\" not found.").arg(type); + continue; + } + + i->second = loadPlugin(list.first(), name); +#ifdef DEBUG_PLUGIN_LOADTIME + qDebug() << "load plugin" << type << "takes" << (timer.elapsed() - lastTime) << "ms"; + lastTime = timer.elapsed(); +#endif + } +} + +QPointer PanelPluginsModel::loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup) +{ + std::unique_ptr plugin(new Plugin(desktopFile, mPanel->settings()->fileName(), settingsGroup, mPanel)); + if (plugin->isLoaded()) + { + connect(mPanel, &LxQtPanel::realigned, plugin.get(), &Plugin::realign); + connect(plugin.get(), &Plugin::remove, + this, static_cast(&PanelPluginsModel::removePlugin)); + return plugin.release(); + } + + return nullptr; +} + +QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType) const +{ + QStringList groups = mPanel->settings()->childGroups(); + groups.sort(); + + // Generate new section name + for (int i = 2; true; ++i) + if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i))) + return QStringLiteral("%1%2").arg(pluginType).arg(i); +} + +void PanelPluginsModel::onActivatedIndex(QModelIndex const & index) +{ + mActive = index; +} + +bool PanelPluginsModel::isActiveIndexValid() const +{ + return mActive.isValid() && QModelIndex() == mActive.parent() + && 0 == mActive.column() && mPlugins.size() > mActive.row(); +} + +void PanelPluginsModel::onMovePluginUp() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (0 >= row) + return; //can't move up + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1); + mPlugins.swap(row - 1, row); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row - 1]; + pluginslist_t::const_reference prev_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !prev_plugin.second.isNull()) + emit pluginMovedUp(moved_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onMovePluginDown() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (mPlugins.size() <= row + 1) + return; //can't move down + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2); + mPlugins.swap(row, row + 1); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row + 1]; + pluginslist_t::const_reference next_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !next_plugin.second.isNull()) + emit pluginMovedUp(next_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onConfigurePlugin() +{ + if (!isActiveIndexValid()) + return; + + Plugin * const plugin = mPlugins[mActive.row()].second.data(); + if (nullptr != plugin && (ILxQtPanelPlugin::HaveConfigDialog & plugin->iPlugin()->flags())) + plugin->showConfigureDialog(); +} + +void PanelPluginsModel::onRemovePlugin() +{ + if (!isActiveIndexValid()) + return; + + auto plugin = mPlugins.begin() + mActive.row(); + if (plugin->second.isNull()) + removePlugin(std::move(plugin)); + else + plugin->second->requestRemove(); +} diff --git a/panel/panelpluginsmodel.h b/panel/panelpluginsmodel.h new file mode 100644 index 0000000..ed9a8a3 --- /dev/null +++ b/panel/panelpluginsmodel.h @@ -0,0 +1,104 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef PANELPLUGINSMODEL_H +#define PANELPLUGINSMODEL_H + +#include +#include + +namespace LxQt +{ + class PluginInfo; + struct PluginData; +} + +class LxQtPanel; +class Plugin; + +class PanelPluginsModel : public QAbstractListModel +{ + Q_OBJECT +public: + PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent = nullptr); + ~PanelPluginsModel(); + + virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override; + virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; + virtual Qt::ItemFlags flags(const QModelIndex & index) const override; + + QStringList pluginNames() const; + QList plugins() const; + Plugin *pluginByName(QString name) const; + Plugin const *pluginByID(QString id) const; + + /*! + * \param plugin plugin that has been moved + * \param nameAfter name of plugin that is right after moved plugin + */ + void movePlugin(Plugin * plugin, QString const & nameAfter); + +signals: + void pluginAdded(Plugin * plugin); + void pluginRemoved(Plugin * plugin); + void pluginMoved(Plugin * plugin); //plugin can be nullptr in case of move of not loaded plugin + /*! + * Emiting only move-up for simplification of using (and problematic layout/list move) + */ + void pluginMovedUp(Plugin * plugin); + +public slots: + void addPlugin(const LxQt::PluginInfo &desktopFile); + void removePlugin(); + + // slots for configuration dialog + void onActivatedIndex(QModelIndex const & index); + void onMovePluginUp(); + void onMovePluginDown(); + void onConfigurePlugin(); + void onRemovePlugin(); + +private: + typedef QList > > pluginslist_t; + +private: + void loadPlugins(QStringList const & desktopDirs); + QPointer loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup); + QString findNewPluginSettingsGroup(const QString &pluginType) const; + bool isActiveIndexValid() const; + void removePlugin(pluginslist_t::iterator plugin); + + const QString mNamesKey; + pluginslist_t mPlugins; + LxQtPanel * mPanel; + QPersistentModelIndex mActive; +}; + +Q_DECLARE_METATYPE(Plugin const *) + +#endif // PANELPLUGINSMODEL_H diff --git a/panel/plugin.cpp b/panel/plugin.cpp index e561c5b..b6f930b 100644 --- a/panel/plugin.cpp +++ b/panel/plugin.cpp @@ -42,11 +42,24 @@ #include #include #include +#include #include #include #include +// statically linked built-in plugins +#include "../plugin-clock/lxqtclock.h" // clock +#include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch +#include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu +#include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch +#include "../plugin-showdesktop/showdesktop.h" // showdesktop +#include "../plugin-spacer/spacer.h" // spacer +#include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier +#include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar +#include "../plugin-tray/lxqttrayplugin.h" // tray +#include "../plugin-worldclock/lxqtworldclock.h" // worldclock + QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255); /************************************************ @@ -76,24 +89,32 @@ Plugin::Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, dirs << QProcessEnvironment::systemEnvironment().value("LXQTPANEL_PLUGIN_PATH").split(":"); dirs << PLUGIN_DIR; - QString baseName = QString("lib%1.so").arg(desktopFile.id()); bool found = false; - foreach(QString dirName, dirs) + if(ILxQtPanelPluginLibrary const * pluginLib = findStaticPlugin(desktopFile.id())) { - QFileInfo fi(QDir(dirName), baseName); - - if (fi.exists()) + // this is a static plugin + found = true; + loadLib(pluginLib); + } + else { + // this plugin is a dynamically loadable module + QString baseName = QString("lib%1.so").arg(desktopFile.id()); + foreach(QString dirName, dirs) { - found = true; - if (loadLib(fi.absoluteFilePath())) - break; + QFileInfo fi(QDir(dirName), baseName); + if (fi.exists()) + { + found = true; + if (loadModule(fi.absoluteFilePath())) + break; + } } } if (!isLoaded()) { if (!found) - qWarning() << QString("Plugin %1 not found in the").arg(baseName) << dirs; + qWarning() << QString("Plugin %1 not found in the").arg(desktopFile.id()) << dirs; return; } @@ -102,6 +123,10 @@ Plugin::Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, LxQt::Translator::translatePlugin(desktopFile.id(), QLatin1String("lxqt-panel")); setObjectName(mPlugin->themeId() + "Plugin"); + + // plugin handle for easy context menu + setProperty("NeedsHandle", mPlugin->flags().testFlag(ILxQtPanelPlugin::NeedsHandle)); + QString s = mSettings->value("alignment").toString(); // Retrun default value @@ -156,31 +181,72 @@ void Plugin::setAlignment(Plugin::Alignment alignment) /************************************************ ************************************************/ -bool Plugin::loadLib(const QString &libraryName) +namespace { - mPluginLoader = new QPluginLoader(libraryName); - - if (!mPluginLoader->load()) - { - qWarning() << mPluginLoader->errorString(); - return false; - } - - QObject *obj = mPluginLoader->instance(); - if (!obj) + //helper types for static plugins storage & binary search + typedef std::unique_ptr plugin_ptr_t; + typedef std::pair plugin_pair_t; + + //NOTE: Please keep the plugins sorted by name while adding new plugins. + static plugin_pair_t const static_plugins[] = { +#if defined(WITH_CLOCK_PLUGIN) + { QStringLiteral("clock"), plugin_ptr_t{new LxQtClockPluginLibrary} },// clock +#endif +#if defined(WITH_DESKTOPSWITCH_PLUGIN) + { QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary} },// desktopswitch +#endif +#if defined(WITH_MAINMENU_PLUGIN) + { QStringLiteral("mainmenu"), plugin_ptr_t{new LxQtMainMenuPluginLibrary} },// mainmenu +#endif +#if defined(WITH_QUICKLAUNCH_PLUGIN) + { QStringLiteral("quicklaunch"), plugin_ptr_t{new LxQtQuickLaunchPluginLibrary} },// quicklaunch +#endif +#if defined(WITH_SHOWDESKTOP_PLUGIN) + { QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary} },// showdesktop +#endif +#if defined(WITH_SPACER_PLUGIN) + { QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary} },// spacer +#endif +#if defined(WITH_STATUSNOTIFIER_PLUGIN) + { QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary} },// statusnotifier +#endif +#if defined(WITH_TASKBAR_PLUGIN) + { QStringLiteral("taskbar"), plugin_ptr_t{new LxQtTaskBarPluginLibrary} },// taskbar +#endif +#if defined(WITH_TRAY_PLUGIN) + { QStringLiteral("tray"), plugin_ptr_t{new LxQtTrayPluginLibrary} },// tray +#endif +#if defined(WITH_WORLDCLOCK_PLUGIN) + { QStringLiteral("worldclock"), plugin_ptr_t{new LxQtWorldClockLibrary} },// worldclock +#endif + }; + static constexpr plugin_pair_t const * const plugins_begin = static_plugins; + static constexpr plugin_pair_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]); + + struct assert_helper { - qWarning() << mPluginLoader->errorString(); - return false; - } + assert_helper() + { + Q_ASSERT(std::is_sorted(plugins_begin, plugins_end + , [] (plugin_pair_t const & p1, plugin_pair_t const & p2) -> bool { return p1.first < p2.first; })); + } + }; + static assert_helper h; +} - ILxQtPanelPluginLibrary* pluginLib= qobject_cast(obj); - if (!pluginLib) - { - qWarning() << QString("Can't load plugin \"%1\". Plugin is not a ILxQtPanelPluginLibrary.").arg(mPluginLoader->fileName()); - delete obj; - return false; - } +ILxQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName) +{ + // find a static plugin library by name -> binary search + plugin_pair_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName + , [] (plugin_pair_t const & plugin, QString const & name) -> bool { return plugin.first < name; }); + if (plugins_end != plugin && libraryName == plugin->first) + return plugin->second.get(); + return nullptr; +} +// load a plugin from a library +bool Plugin::loadLib(ILxQtPanelPluginLibrary const * pluginLib) +{ ILxQtPanelPluginStartupInfo startupInfo; startupInfo.settings = mSettings; startupInfo.desktopFile = &mDesktopFile; @@ -190,7 +256,6 @@ bool Plugin::loadLib(const QString &libraryName) if (!mPlugin) { qWarning() << QString("Can't load plugin \"%1\". Plugin can't build ILxQtPanelPlugin.").arg(mPluginLoader->fileName()); - delete obj; return false; } @@ -200,10 +265,37 @@ bool Plugin::loadLib(const QString &libraryName) mPluginWidget->setObjectName(mPlugin->themeId()); } this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - return true; } +// load dynamic plugin from a *.so module +bool Plugin::loadModule(const QString &libraryName) +{ + mPluginLoader = new QPluginLoader(libraryName); + + if (!mPluginLoader->load()) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + QObject *obj = mPluginLoader->instance(); + if (!obj) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + ILxQtPanelPluginLibrary* pluginLib= qobject_cast(obj); + if (!pluginLib) + { + qWarning() << QString("Can't load plugin \"%1\". Plugin is not a ILxQtPanelPluginLibrary.").arg(mPluginLoader->fileName()); + delete obj; + return false; + } + return loadLib(pluginLib); +} + /************************************************ diff --git a/panel/plugin.h b/panel/plugin.h index ca47c1f..d8eff78 100644 --- a/panel/plugin.h +++ b/panel/plugin.h @@ -67,9 +67,9 @@ public: void saveSettings(); QMenu* popupMenu() const; - ILxQtPanelPlugin * iPlugin() const { return mPlugin; } + const ILxQtPanelPlugin * iPlugin() const { return mPlugin; } - const LxQt::PluginInfo desktopFile() { return mDesktopFile; } + const LxQt::PluginInfo desktopFile() const { return mDesktopFile; } bool isSeparate() const; bool isExpandable() const; @@ -84,6 +84,8 @@ public: public slots: void realign(); + void showConfigureDialog(); + void requestRemove(); signals: void startMove(); @@ -96,7 +98,9 @@ protected: void showEvent(QShowEvent *event); private: - bool loadLib(const QString &libraryName); + bool loadLib(ILxQtPanelPluginLibrary const * pluginLib); + bool loadModule(const QString &libraryName); + ILxQtPanelPluginLibrary const * findStaticPlugin(const QString &libraryName); const LxQt::PluginInfo mDesktopFile; QByteArray calcSettingsHash(); @@ -113,8 +117,6 @@ private: private slots: void settingsChanged(); - void showConfigureDialog(); - void requestRemove(); }; diff --git a/panel/resources/panel.conf b/panel/resources/panel.conf index a423df9..59653f4 100644 --- a/panel/resources/panel.conf +++ b/panel/resources/panel.conf @@ -1,7 +1,7 @@ panels=panel1 [panel1] -plugins=mainmenu,desktopswitch,quicklaunch,taskbar,tray,mount,panelvolume,clock +plugins=mainmenu,desktopswitch,quicklaunch,taskbar,tray,statusnotifier,mount,volume,clock,showdesktop position=Bottom desktop=0 @@ -17,7 +17,6 @@ apps/size=5 apps/1/desktop=firefox.desktop apps/2/desktop=chromium-browser.desktop apps/3/desktop=pcmanfm-qt.desktop -apps/4/desktop=KMail.desktop apps/5/desktop=lxqt-config.desktop [taskbar] @@ -32,6 +31,14 @@ type=mount [clock] type=clock -[panelvolume] +[volume] device=0 -type=panelvolume +type=volume + +[showdesktop] +alignment=Right +type=showdesktop + +[statusnotifier] +alignment=Right +type=statusnotifier diff --git a/panel/translations/lxqt-panel.ts b/panel/translations/lxqt-panel.ts index 581fe61..29a35b1 100644 --- a/panel/translations/lxqt-panel.ts +++ b/panel/translations/lxqt-panel.ts @@ -1,219 +1,313 @@ - + + + AddPluginDialog + + + Add Plugins + + + + + Search: + + + + + Add Widget + + + + + Close + + + + + (only one instance can run at a time) + + + ConfigPanelDialog - - + Configure Panel + + + Panel + + + + + Widgets + + ConfigPanelWidget - + Configure panel - + Size - - Size: + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - - - px + + Size: - - Icon size: + + Length: - - Length: + + % - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + px - - % + + + px - - px + + Icon size: - + Rows count: - + Alignment && position - - + + Position: + + + + + Alignment: + + + + + Left - - - + + + Center - - + + Right - - Alignment: + + Auto-hide - - Position: + + Custom styling - - Styling + + Font color: - - Custom font color: + + Background color: - - Custom background image: + + Background opacity: - - Custom background color: + + <small>Compositing is required for panel transparency.</small> - - Opacity + + Background image: - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + + Pick image + + + + Images (*.png *.gif *.jpg) - LxQtPanel + ConfigPluginsWidget + + + Configure Plugins + + + + + Note: changes made in this page cannot be reset. + + + + + Move up + + + + + + + + + ... + + - - Add Panel Widgets + + Move down - - + + Add + + + + + Remove + + + + + Configure + + + + + LxQtPanel + + + Panel - - Configure Panel... + + Configure Panel - - Add Panel Widgets... + + Manage Widgets - + Add Panel - + Remove Panel @@ -221,19 +315,32 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" + + main + + + Use alternate configuration file. + + + + + Configuration file + + + diff --git a/panel/translations/lxqt-panel_ar.ts b/panel/translations/lxqt-panel_ar.ts index 5b7564c..69084ec 100644 --- a/panel/translations/lxqt-panel_ar.ts +++ b/panel/translations/lxqt-panel_ar.ts @@ -154,20 +154,20 @@
- + Left اليسار - - + + Center الوسظ - + Right اليمين @@ -182,88 +182,93 @@ الموقع:
- + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop أعلى سطح المكتب - + Left of desktop يسار سطح المكتب - + Right of desktop يمين سطح المكتب - + Bottom of desktop أسفل سطح المكتب - + Top of desktop %1 أعلى سطح المكتب %1 - + Left of desktop %1 يسار سطح المكتب %1 - + Right of desktop %1 يمين سطح المكتب %1 - + Bottom of desktop %1 أسفل سطح المكتب %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel قائمة التطبيقات - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_cs.ts b/panel/translations/lxqt-panel_cs.ts index debfd1f..81fe3e7 100644 --- a/panel/translations/lxqt-panel_cs.ts +++ b/panel/translations/lxqt-panel_cs.ts @@ -154,20 +154,20 @@
- + Left Zarovnat vlevo - - + + Center Zarovnat na střed - + Right Zarovnat vpravo @@ -182,88 +182,93 @@ Poloha:
- + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Horní strana pracovní plochy - + Left of desktop Levá strana pracovní plochy - + Right of desktop Pravá strana pracovní plochy - + Bottom of desktop Dolní strana pracovní plochy - + Top of desktop %1 Horní strana pracovní plochy %1 - + Left of desktop %1 Levá strana pracovní plochy %1 - + Right of desktop %1 Pravá strana pracovní plochy %1 - + Bottom of desktop %1 Dolní strana pracovní plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_cs_CZ.ts b/panel/translations/lxqt-panel_cs_CZ.ts index 9652242..c3dc66e 100644 --- a/panel/translations/lxqt-panel_cs_CZ.ts +++ b/panel/translations/lxqt-panel_cs_CZ.ts @@ -154,20 +154,20 @@
- + Left Zarovnat vlevo - - + + Center Zarovnat na střed - + Right Zarovnat vpravo @@ -182,88 +182,93 @@ Poloha: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Horní strana pracovní plochy - + Left of desktop Levá strana pracovní plochy - + Right of desktop Pravá strana pracovní plochy - + Bottom of desktop Dolní strana pracovní plochy - + Top of desktop %1 Horní strana pracovní plochy %1 - + Left of desktop %1 Levá strana pracovní plochy %1 - + Right of desktop %1 Pravá strana pracovní plochy %1 - + Bottom of desktop %1 Dolní strana pracovní plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_da.ts b/panel/translations/lxqt-panel_da.ts index 2f55f13..38d7997 100644 --- a/panel/translations/lxqt-panel_da.ts +++ b/panel/translations/lxqt-panel_da.ts @@ -118,20 +118,20 @@ - + Left Venstre - - + + Center Midtpå - + Right Højre @@ -146,88 +146,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Toppen af skrivebordet - + Left of desktop Venstre side af skrivebordet - + Right of desktop Højre side af skrivebordet - + Bottom of desktop Bunden af skrivebordet - + Top of desktop %1 Toppen af skrivebord %1 - + Left of desktop %1 Venstre side af skrivebord %1 - + Right of desktop %1 Højre side af skrivebord %1 - + Bottom of desktop %1 Bunden af skrivebord %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -235,33 +240,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -319,17 +324,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_da_DK.ts b/panel/translations/lxqt-panel_da_DK.ts index 6f94773..f4d72d3 100644 --- a/panel/translations/lxqt-panel_da_DK.ts +++ b/panel/translations/lxqt-panel_da_DK.ts @@ -154,20 +154,20 @@ - + Left Venstrestillet - - + + Center Midterstillet - + Right Højrestillet @@ -182,88 +182,93 @@ Position: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Toppen af skrivebordet - + Left of desktop Venstre side af skrivebordet - + Right of desktop Højre side af skrivebordet - + Bottom of desktop Bunden af skrivebordet - + Top of desktop %1 Toppen af skrivebord %1 - + Left of desktop %1 Venstre side af skrivebord %1 - + Right of desktop %1 Højre side af skrivebord %1 - + Bottom of desktop %1 Bunden af skrivebord %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Hej Verden - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_de.ts b/panel/translations/lxqt-panel_de.ts index a333361..9d73207 100644 --- a/panel/translations/lxqt-panel_de.ts +++ b/panel/translations/lxqt-panel_de.ts @@ -2,352 +2,345 @@ - ConfigPanelDialog - - Configure panel - Panel konfigurieren - - - Panel size - Leistengröße - - - Size: - Höhe: - - - px - px - - - Use automatic sizing - Automatische Größe verwenden - + AddPluginDialog - Panel length && position - Leistenlänge und Position + + Add Plugins + Plugins hinzufügen - Left - Links + + Search: + Suchen: - Center - Zentriert + + Add Widget + Widget hinzufügen - Right - Rechts + + Close + Schließen - % - % - - - Alignment: - Ausrichtung: - - - Length: - Länge: - - - Position: - Position: - - - Top of desktop - Oben - - - Left of desktop - Links - - - Right of desktop - Rechts - - - Bottom of desktop - Unten - - - Top of desktop %1 - Oben %1 - - - Left of desktop %1 - Links %1 + + (only one instance can run at a time) + (es kann nur eine Instanz gleichzeitig ausgeführt werden) + + + ConfigPanelDialog - Right of desktop %1 - Rechts %1 + + Configure Panel + Leiste konfigurieren - Bottom of desktop %1 - Unten %1 + + Panel + Leiste - - - Configure Panel - + + Widgets + Widgets ConfigPanelWidget - + Configure panel - Panel konfigurieren + Leiste konfigurieren - + Size - + Größe - - Size: - Höhe: + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Negative Pixelwerte setzen die Leistenlänge auf den Wert verfügbare Größe minus angegebener Größe.</p><p/><p><i>Z.B. bei "Länge" gesetzt auf -100px und einer Bildschirmgröße von 1000px hat die Leiste eine Größe von 900 px.</i></p> - - - px - + + Size: + Größe: - - Icon size: - + + Length: + Länge: - - Length: - Länge: + + % + % - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + + px + px - - % - % + + + px + px - - px - px + + Icon size: + Symbolgröße: - + Rows count: - + Zeilenzahl: - + Alignment && position - + Ausrichtung und Position + + + + Position: + Position: - - + + Alignment: + Ausrichtung: + + + + Left - Links + Links - - - + + + Center - Zentriert + Mitte - - + + Right - Rechts + Rechts - - Alignment: - Ausrichtung: + + Auto-hide + Automatisch ausblenden - - Position: - Position: + + Custom styling + Eigener Stil - - Styling - + + Font color: + Schriftfarbe: - - Custom font color: - + + Background color: + Hintergrundfarbe: - - Custom background image: - + + Background opacity: + Deckkraft: - - Custom background color: - + + <small>Compositing is required for panel transparency.</small> + <small>Für Transparenzeffekt wird Compositing benötigt.</small> - - Opacity - + + Background image: + Hintergrundbild: - + Top of desktop - Oben + Oben auf der Arbeitsfläche - + Left of desktop - Links + Links auf der Arbeitsfläche - + Right of desktop - Rechts + Rechts auf der Arbeitsfläche - + Bottom of desktop - Unten + Unten auf der Arbeitsfläche - + Top of desktop %1 - Oben %1 + Oben auf Arbeitsfläche %1 - + Left of desktop %1 - Links %1 + Links auf Arbeitsfläche %1 - + Right of desktop %1 - Rechts %1 + Rechts auf Arbeitsfläche %1 - + Bottom of desktop %1 - Unten %1 + Unten auf Arbeitsfläche %1 - + Top - + Oben - + Bottom - + Unten - - + + Pick color - + Farbe auswählen + + + + Pick image + Bild auswählen - + Images (*.png *.gif *.jpg) - + Bilder (*.png *.gif *.jpg) - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - + + Configure Plugins + Plugins konfigurieren - - - Panel - LxQt Konfigurations Center + + Note: changes made in this page cannot be reset. + Hinweis: Hier gemachte Änderungen können nicht rückgängig gemacht werden. - - Configure Panel... - + + Move up + Nach oben schieben - - Add Panel Widgets... - + + + + + + ... + ... - - Add Panel - + + Move down + Nach unten schieben - - Remove Panel - + + Add + Hinzufügen - Configure panel... - Panel konfigurieren... + + Remove + Entfernen - Add plugins ... - Plugins hinzufügen ... + + Configure + Konfigurieren - LxQtPanelPlugin + LxQtPanel - Configure - Konfigurieren + + + Panel + Leiste - Move - Verschieben + + Configure Panel + Leiste konfigurieren - Remove - Entfernen + + Manage Widgets + Widgets verwalten - - - LxQtPanelPrivate - Configure panel - Panel konfigurieren + + Add Panel + Leiste hinzufügen + + + + Remove Panel + Leiste entfernen Plugin - + Configure "%1" - + "%1" konfigurieren - + Move "%1" - + "%1" verschieben - + Remove "%1" - + "%1" entfernen + + + + main + + + Use alternate configuration file. + Alternative Konfigurationsdatei verwenden. + + + + Configuration file + Konfigurationsdatei diff --git a/panel/translations/lxqt-panel_el_GR.ts b/panel/translations/lxqt-panel_el_GR.ts index 30802d2..b0a3b99 100644 --- a/panel/translations/lxqt-panel_el_GR.ts +++ b/panel/translations/lxqt-panel_el_GR.ts @@ -154,20 +154,20 @@ - + Left Αριστερά - - + + Center Κέντρο - + Right Δεξιά @@ -182,88 +182,93 @@ Θέση: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Επάνω στην επιφάνεια εργασίας - + Left of desktop Αριστερά στην επιφάνεια εργασίας - + Right of desktop Δεξιά στην επιφάνεια εργασίας - + Bottom of desktop Κάτω στην επιφάνεια εργασίας - + Top of desktop %1 Επάνω στην επιφάνεια εργασίας %1 - + Left of desktop %1 Αριστερά στην επιφάνεια εργασίας %1 - + Right of desktop %1 Δεξιά στην επιφάνεια εργασίας %1 - + Bottom of desktop %1 Κάτω στην επιφάνεια εργασίας %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Πίνακας - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_eo.ts b/panel/translations/lxqt-panel_eo.ts index 61d265c..4cb2801 100644 --- a/panel/translations/lxqt-panel_eo.ts +++ b/panel/translations/lxqt-panel_eo.ts @@ -154,20 +154,20 @@ - + Left Maldekstre - - + + Center Centre - + Right Dekstre @@ -182,88 +182,93 @@ Loko: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Supre de labortablo - + Left of desktop Maldekstre de labortablo - + Right of desktop Dekstre de labortablo - + Bottom of desktop Malsupre de labortablo - + Top of desktop %1 Supre de labortablo %1 - + Left of desktop %1 Maldekstre de labortablo %1 - + Right of desktop %1 Dekstre de labortablo %1 - + Bottom of desktop %1 Malsupre de labortablo %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Agordoj de muso por LxQto - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_es.ts b/panel/translations/lxqt-panel_es.ts index c51e074..23fd321 100644 --- a/panel/translations/lxqt-panel_es.ts +++ b/panel/translations/lxqt-panel_es.ts @@ -154,20 +154,20 @@ - + Left Izquierda - - + + Center Centro - + Right Derecha @@ -182,88 +182,93 @@ Posición: - + + Auto-hide + Ocultar automáticamente + + + Styling Estilo - + Custom font color: Color de fuente personalizado: - + Custom background image: Imagen de fondo personalizada: - + Custom background color: Color de fondo personalizado: - + Opacity Opacidad - + Top of desktop Extremo superior del escritorio - + Left of desktop Extremo izquierdo del escritorio - + Right of desktop Extremo derecho del escritorio - + Bottom of desktop Extremo inferior del escritorio - + Top of desktop %1 Extremo superior del escritorio %1 - + Left of desktop %1 Extremo izquierdo del escritorio %1 - + Right of desktop %1 Extremo derecho del escritorio %1 - + Bottom of desktop %1 Extremo inferior del escritorio %1 - + Top Arriba - + Bottom Abajo - - + + Pick color Seleccione un color - + Images (*.png *.gif *.jpg) Imágenes (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets Agregar Widgets al Panel - - + + Panel Panel - + Configure Panel... Configurar Panel... - + Add Panel Widgets... Agregar Widgets al Panel... - + Add Panel Agregar Panel - + Remove Panel Eliminar Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" Configurar "%1" - + Move "%1" Mover "%1" - + Remove "%1" Eliminar "%1" diff --git a/panel/translations/lxqt-panel_es_UY.ts b/panel/translations/lxqt-panel_es_UY.ts index a7ff1c3..bb6c46e 100644 --- a/panel/translations/lxqt-panel_es_UY.ts +++ b/panel/translations/lxqt-panel_es_UY.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Arriba del escritorio - + Left of desktop A la izquierda del escritorio - + Right of desktop A la derecha del escritorio - + Bottom of desktop Abajo del escritorio - + Top of desktop %1 Arriba del escritorio %1 - + Left of desktop %1 A la izquierda del escritorio %1 - + Right of desktop %1 A la derecha del excritorio %1 - + Bottom of desktop %1 Abajo del escritorio %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -252,17 +257,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_es_VE.ts b/panel/translations/lxqt-panel_es_VE.ts index 2b3e6ec..999c321 100644 --- a/panel/translations/lxqt-panel_es_VE.ts +++ b/panel/translations/lxqt-panel_es_VE.ts @@ -154,20 +154,20 @@ - + Left Izquierda - - + + Center Centrado - + Right Derecha @@ -182,88 +182,93 @@ Posicion: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Tope del escritorio - + Left of desktop Izquierda del escritorio - + Right of desktop Derecha del escritorio - + Bottom of desktop Inferior del escritorio - + Top of desktop %1 Tope del escritorio %1 - + Left of desktop %1 Izquierda del escritorio %1 - + Right of desktop %1 Derecha del escritorio %1 - + Bottom of desktop %1 Inferior del escritorio %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_eu.ts b/panel/translations/lxqt-panel_eu.ts index a23e5d7..6c1ef09 100644 --- a/panel/translations/lxqt-panel_eu.ts +++ b/panel/translations/lxqt-panel_eu.ts @@ -154,20 +154,20 @@ - + Left Ezkerra - - + + Center Erdia - + Right Eskuina @@ -182,88 +182,93 @@ Posizioa: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Mahaigainaren goialdea - + Left of desktop Mahaigainaren ezkerraldea - + Right of desktop Mahaigainaren eskuinaldea - + Bottom of desktop Mahaigainaren behealdea - + Top of desktop %1 %1 mahaigainaren goialdea - + Left of desktop %1 %1 mahaigainaren ezkerraldea - + Right of desktop %1 %1 mahaigainaren eskuinaldea - + Bottom of desktop %1 %1 mahaigainaren behealdea - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panela - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_fi.ts b/panel/translations/lxqt-panel_fi.ts index e948b50..615991e 100644 --- a/panel/translations/lxqt-panel_fi.ts +++ b/panel/translations/lxqt-panel_fi.ts @@ -154,20 +154,20 @@ - + Left Vasemmalla - - + + Center Keskellä - + Right Oikealla @@ -182,88 +182,93 @@ Sijainti: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Työpöydän yläosassa - + Left of desktop Työpöydän vasemmassa laidassa - + Right of desktop Työpöydän oikeassa laidassa - + Bottom of desktop Työpöydän alaosassa - + Top of desktop %1 Työpöydän %1 yläosassa - + Left of desktop %1 Työpöydän %1 vasemmassa laidassa - + Right of desktop %1 Työpöydän %1 oikeassa laidassa - + Bottom of desktop %1 Työpöydän %1 alaosassa - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Paneeli - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_fr_FR.ts b/panel/translations/lxqt-panel_fr_FR.ts index 1313fcc..18f34f9 100644 --- a/panel/translations/lxqt-panel_fr_FR.ts +++ b/panel/translations/lxqt-panel_fr_FR.ts @@ -154,20 +154,20 @@ - + Left Gauche - - + + Center Centre - + Right Droite @@ -182,88 +182,93 @@ Position : - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Haut du bureau - + Left of desktop Gauche du bureau - + Right of desktop Droite du bureau - + Bottom of desktop Bas du bureau - + Top of desktop %1 Haut du bureau %1 - + Left of desktop %1 Gauche du bureau %1 - + Right of desktop %1 Droite du bureau %1 - + Bottom of desktop %1 Bas du bureau %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Bloc-notes - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_hu.ts b/panel/translations/lxqt-panel_hu.ts index dbb708e..2927d16 100644 --- a/panel/translations/lxqt-panel_hu.ts +++ b/panel/translations/lxqt-panel_hu.ts @@ -1,97 +1,45 @@ - + ConfigPanelDialog - - Configure panel - Panelbeállítás - - - Panel size - Panelméret - - - Size: - Méret: - - - px - px - - - Use automatic sizing - Automatikus méretezés - - - Panel length && position - Panelhossz és elhelyezkedés - - - Left - Balra - - - Center - Középre - - - Right - Jobbra - - - % - % - - - Alignment: - Igazítás: - - - Length: - Hossz: - - - Position: - Pozíció: - Top of desktop - Az asztal tetején + Az asztal tetejére Left of desktop - Az asztal bal oldalán + Az asztal bal oldalára Right of desktop - Az asztal jobb oldalán + Az asztal jobb oldalára Bottom of desktop - Az asztal alján + Az asztal aljára Top of desktop %1 - A(z) %1. asztal tetején + A(z) %1. asztal tetejére Left of desktop %1 - A(z) %1. asztal bal oldalán + A(z) %1. asztal bal oldalára Right of desktop %1 - A(z) %1. asztal jobb oldalán + A(z) %1. asztal jobb oldalára Bottom of desktop %1 - A(z) %1. asztal alján + A(z) %1. asztal aljára Configure Panel - + Panelbeállítás @@ -99,255 +47,234 @@ Configure panel - Panelbeállítás + Panelbeállítás Size - + Méret Size: - Méret: + Méret: px - + pixel Icon size: - + Ikonméret: Length: - Hossz: + Hossz: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p % - % + px - px + pixel Rows count: - + Sorszámláló: Alignment && position - + Igazítás && helyzet - + Left - Balra + Balra - - + + Center - Középre + Középre - + Right - Jobbra + Jobbra Alignment: - Igazítás: + Igazítás: Position: - Pozíció: + Pozíció: + + + + Auto-hide + Automata elrejtés - + Styling - + Hangolás - + Custom font color: - + Egyéni betűszín: - + Custom background image: - + Egyéni háttérkép: - + Custom background color: - + Egyéni háttérszín: - + Opacity - + Áttetszőség - + Top of desktop - Az asztal tetején + Az asztal tetejére - + Left of desktop - Az asztal bal oldalán + Az asztal bal oldalára - + Right of desktop - Az asztal jobb oldalán + Az asztal jobb oldalára - + Bottom of desktop - Az asztal alján + Az asztal aljára - + Top of desktop %1 - A(z) %1. asztal tetején + A(z) %1. asztal tetejére - + Left of desktop %1 - A(z) %1. asztal bal oldalán + A(z) %1. asztal bal oldalára - + Right of desktop %1 - A(z) %1. asztal jobb oldalán + A(z) %1. asztal jobb oldalára - + Bottom of desktop %1 - A(z) %1. asztal alján + A(z) %1. asztal aljára - + Top - + Fenn - + Bottom - + Lenn - - + + Pick color - + Színválasztás - + Images (*.png *.gif *.jpg) - + Képek (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Panelelem hozzáadás - - + + Panel - Alkalmazásmenü + Panel - + Configure Panel... - + Panel beállítása… - + Add Panel Widgets... - + Panelelem hozzáadás... - + Add Panel - + Panel hozzáadás - + Remove Panel - - - - Configure panel... - Panel beállítása… + Panel törlése Add plugins ... - Bővítmények hozzáadása… - - - - LxQtPanelPlugin - - Configure - Beállítás - - - Move - Mozgatás - - - Remove - Eltávolítás - - - - LxQtPanelPrivate - - Configure panel - Panelbeállítás + Bővítmények hozzáadása… Plugin - + Configure "%1" - + "%1" beállítása - + Move "%1" - + "%1" mozgatása - + Remove "%1" - + "%1" törlése diff --git a/panel/translations/lxqt-panel_hu_HU.ts b/panel/translations/lxqt-panel_hu_HU.ts index 7a409b6..36e03e1 100644 --- a/panel/translations/lxqt-panel_hu_HU.ts +++ b/panel/translations/lxqt-panel_hu_HU.ts @@ -1,45 +1,45 @@ - + ConfigPanelDialog Top of desktop - Az asztal tetejére + Az asztal tetejére Left of desktop - Az asztal bal oldalára + Az asztal bal oldalára Right of desktop - Az asztal jobb oldalára + Az asztal jobb oldalára Bottom of desktop - Az asztal aljára + Az asztal aljára Top of desktop %1 - A(z) %1. asztal tetejére + A(z) %1. asztal tetejére Left of desktop %1 - A(z) %1. asztal bal oldalára + A(z) %1. asztal bal oldalára Right of desktop %1 - A(z) %1. asztal jobb oldalára + A(z) %1. asztal jobb oldalára Bottom of desktop %1 - A(z) %1. asztal aljára + A(z) %1. asztal aljára Configure Panel - + Panelbeállítás @@ -47,229 +47,234 @@ Configure panel - + Panelbeállítás Size - + Méret Size: - + Méret: px - + pixel Icon size: - + Ikonméret: Length: - + Hossz: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p % - + px - + pixel Rows count: - + Sorszámláló: Alignment && position - + Igazítás && helyzet - + Left - + Balra - - + + Center - + Középre - + Right - + Jobbra Alignment: - + Igazítás: Position: - + Pozíció: + + + + Auto-hide + Automata elrejtés - + Styling - + Hangolás - + Custom font color: - + Egyéni betűszín: - + Custom background image: - + Egyéni háttérkép: - + Custom background color: - + Egyéni háttérszín: - + Opacity - + Áttetszőség - + Top of desktop - Az asztal tetejére + Az asztal tetejére - + Left of desktop - Az asztal bal oldalára + Az asztal bal oldalára - + Right of desktop - Az asztal jobb oldalára + Az asztal jobb oldalára - + Bottom of desktop - Az asztal aljára + Az asztal aljára - + Top of desktop %1 - A(z) %1. asztal tetejére + A(z) %1. asztal tetejére - + Left of desktop %1 - A(z) %1. asztal bal oldalára + A(z) %1. asztal bal oldalára - + Right of desktop %1 - A(z) %1. asztal jobb oldalára + A(z) %1. asztal jobb oldalára - + Bottom of desktop %1 - A(z) %1. asztal aljára + A(z) %1. asztal aljára - + Top - + Fenn - + Bottom - + Lenn - - + + Pick color - + Színválasztás - + Images (*.png *.gif *.jpg) - + Képek (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Panelelem hozzáadás - - + + Panel Panel - + Configure Panel... - + Panel beállítása… - + Add Panel Widgets... - + Panelelem hozzáadás... - + Add Panel - + Panel hozzáadás - + Remove Panel - + Panel törlése Add plugins ... - Bővítmények hozzáadása… + Bővítmények hozzáadása… Plugin - + Configure "%1" - + "%1" beállítása - + Move "%1" - + "%1" mozgatása - + Remove "%1" - + "%1" törlése diff --git a/panel/translations/lxqt-panel_ia.ts b/panel/translations/lxqt-panel_ia.ts index df840bf..d6eee7d 100644 --- a/panel/translations/lxqt-panel_ia.ts +++ b/panel/translations/lxqt-panel_ia.ts @@ -78,20 +78,20 @@ - + Left - - + + Center - + Right @@ -106,88 +106,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -195,33 +200,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -229,17 +234,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_id_ID.ts b/panel/translations/lxqt-panel_id_ID.ts index d96a9ce..9798e2f 100644 --- a/panel/translations/lxqt-panel_id_ID.ts +++ b/panel/translations/lxqt-panel_id_ID.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Hell World - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_it.ts b/panel/translations/lxqt-panel_it.ts index bf4acf0..8af869e 100644 --- a/panel/translations/lxqt-panel_it.ts +++ b/panel/translations/lxqt-panel_it.ts @@ -91,7 +91,7 @@ Configure Panel - + Configura panello @@ -99,207 +99,213 @@ Configure panel - + Configura panello Size - + Dimensione Size: - Dimensione: + Dimensione: px - + Icon size: - + Dimensione icone: Length: - Lunghezza: + Lunghezza: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> % - % + % px - px + px Rows count: - + Numero righe: Alignment && position - + Allineamento e posizione - + Left - Sinistra + Sinistra - - + + Center - Centro + Centro - + Right - Destra + Destra Alignment: - Allineamento: + Allineamento: Position: - Posizione: + Posizione: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Aspetto + Custom font color: + Colore carattere personalizzato: + + + Custom background image: - + Immagine sfondo: - + Custom background color: - + Colore sfondo personalizzato: - + Opacity - + Trasparenza - + Top of desktop - Alto del desktop + Alto del desktop - + Left of desktop - Sinistra del desktop + Sinistra del desktop - + Right of desktop - Destra del desktop + Destra del desktop - + Bottom of desktop - Basso del desktop + Basso del desktop - + Top of desktop %1 - Alto del desktop %1 + Alto del desktop %1 - + Left of desktop %1 - Sinistra del desktop %1 + Sinistra del desktop %1 - + Right of desktop %1 - Destra del desktop %1 + Destra del desktop %1 - + Bottom of desktop %1 - Basso del desktop %1 + Basso del desktop %1 - + Top - + In cima - + Bottom - + In fondo - - + + Pick color - + Scegli colore - + Images (*.png *.gif *.jpg) - + Immagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Aggiungi elementi - - + + Panel - Centro di Configurazione LxQt + Panello - + Configure Panel... - + Configura pannello... - + Add Panel Widgets... - + Call them "plugins" better? + Aggiungi elementi... - + Add Panel - + Aggiungi panello - + Remove Panel - + Rimuovi panello Configure panel... @@ -335,19 +341,19 @@ Plugin - + Configure "%1" - + Configura "%1" - + Move "%1" - + Sposta "%1" - + Remove "%1" - + Rimuovi "%1" diff --git a/panel/translations/lxqt-panel_it_IT.ts b/panel/translations/lxqt-panel_it_IT.ts index ebdc5ba..c5e4236 100644 --- a/panel/translations/lxqt-panel_it_IT.ts +++ b/panel/translations/lxqt-panel_it_IT.ts @@ -9,7 +9,7 @@ Panel size - Dimensione del pannello + Dimensione pannello Size: @@ -21,11 +21,11 @@ Use automatic sizing - Utilizza il dimensionamento automatico + Usa dimensionamento automatico Panel length && position - Posizione e larghezza del pannello + Lunghezza e posizione del pannello Left @@ -49,7 +49,7 @@ Length: - Larghezza: + Lunghezza: Position: @@ -57,41 +57,41 @@ Top of desktop - In alto nel desktop + Alto del desktop Left of desktop - A sinistra nel desktop + Sinistra del desktop Right of desktop - A destra nel desktop + Destra del desktop Bottom of desktop - In basso nel desktop + Basso del desktop Top of desktop %1 - In alto nel desktop %1 + Alto del desktop %1 Left of desktop %1 - A sinistra nel desktop %1 + Sinistra del desktop %1 Right of desktop %1 - A destra nel desktop %1 + Destra del desktop %1 Bottom of desktop %1 - In basso nel desktop %1 + Basso del desktop %1 Configure Panel - + Configura panello @@ -99,215 +99,221 @@ Configure panel - Configura il pannello + Configura panello Size - + Dimensione Size: - Dimensione: + Dimensione: px - + Icon size: - + Dimensione icone: Length: - Larghezza: + Lunghezza: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> % - % + % px - px + px Rows count: - + Numero righe: Alignment && position - + Allineamento e posizione - + Left - Sinistra + Sinistra - - + + Center - Centro + Centro - + Right - Destra + Destra Alignment: - Allineamento: + Allineamento: Position: - Posizione: + Posizione: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Aspetto + Custom font color: + Colore carattere personalizzato: + + + Custom background image: - + Immagine sfondo: - + Custom background color: - + Colore sfondo personalizzato: - + Opacity - + Trasparenza - + Top of desktop - In alto nel desktop + Alto del desktop - + Left of desktop - A sinistra nel desktop + Sinistra del desktop - + Right of desktop - A destra nel desktop + Destra del desktop - + Bottom of desktop - In basso nel desktop + Basso del desktop - + Top of desktop %1 - In alto nel desktop %1 + Alto del desktop %1 - + Left of desktop %1 - A sinistra nel desktop %1 + Sinistra del desktop %1 - + Right of desktop %1 - A destra nel desktop %1 + Destra del desktop %1 - + Bottom of desktop %1 - In basso nel desktop %1 + Basso del desktop %1 - + Top - + In cima - + Bottom - + In fondo - - + + Pick color - + Scegli colore - + Images (*.png *.gif *.jpg) - + Immagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Aggiungi elementi - - + + Panel - Esci + Panello - + Configure Panel... - + Configura pannello... - + Add Panel Widgets... - + Call them "plugins" better? + Aggiungi elementi... - + Add Panel - + Aggiungi panello - + Remove Panel - + Rimuovi panello Configure panel... - Configura il pannello... + Configura pannello... Add plugins ... - Aggiungi plugin ... + Aggiungi plugin... @@ -329,25 +335,25 @@ LxQtPanelPrivate Configure panel - Configura il pannello + Configura pannello Plugin - + Configure "%1" - + Configura "%1" - + Move "%1" - + Sposta "%1" - + Remove "%1" - + Rimuovi "%1"
diff --git a/panel/translations/lxqt-panel_ja.ts b/panel/translations/lxqt-panel_ja.ts index 2392f5a..8cd0fbd 100644 --- a/panel/translations/lxqt-panel_ja.ts +++ b/panel/translations/lxqt-panel_ja.ts @@ -70,20 +70,20 @@ - + Left 左寄せ - - + + Center 中央 - + Right 右寄せ @@ -98,88 +98,93 @@ 場所: - + + Auto-hide + + + + Styling 見た目 - + Custom font color: フォントの色を変更: - + Custom background image: 背景画像を指定 - + Custom background color: 背景の色を変更: - + Opacity 透明度 - + Top of desktop デスクトップの上 - + Left of desktop デスクトップの左 - + Right of desktop デスクトップの右 - + Bottom of desktop デスクトップの下 - + Top of desktop %1 デスクトップ %1 の上 - + Left of desktop %1 デスクトップ %1 の左 - + Right of desktop %1 デスクトップ %1 の右 - + Bottom of desktop %1 デスクトップ %1 の下 - + Top - + Bottom - - + + Pick color 色を選ぶ - + Images (*.png *.gif *.jpg) 画像 (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets パネルウィジェットを追加 - - + + Panel パネル - + Configure Panel... パネルの設定 - + Add Panel Widgets... ウィジェットを追加 - + Add Panel パネルを追加 - + Remove Panel パネルを削除 @@ -221,17 +226,17 @@ Plugin - + Configure "%1" "%1" を設定 - + Move "%1" "%1" を移動 - + Remove "%1" "%1" を削除 diff --git a/panel/translations/lxqt-panel_ko.ts b/panel/translations/lxqt-panel_ko.ts index b7217b5..50f62a4 100644 --- a/panel/translations/lxqt-panel_ko.ts +++ b/panel/translations/lxqt-panel_ko.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_lt.ts b/panel/translations/lxqt-panel_lt.ts index 3aacd0b..5798d13 100644 --- a/panel/translations/lxqt-panel_lt.ts +++ b/panel/translations/lxqt-panel_lt.ts @@ -154,20 +154,20 @@ - + Left Kairinė - - + + Center Centrinė - + Right Dešininė @@ -182,88 +182,93 @@ Padėtis: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Darbalaukio viršuje - + Left of desktop Darbalaukio kairėje - + Right of desktop Darbalaukio dešinėje - + Bottom of desktop Darbalaukio apačioje - + Top of desktop %1 %1 darbalaukio viršuje - + Left of desktop %1 %1 darbalaukio kairėje - + Right of desktop %1 %1 darbalaukio dešinėje - + Bottom of desktop %1 %1 darbalaukio apačioje - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Qlipper - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_nl.ts b/panel/translations/lxqt-panel_nl.ts index d3801de..cc219c0 100644 --- a/panel/translations/lxqt-panel_nl.ts +++ b/panel/translations/lxqt-panel_nl.ts @@ -154,20 +154,20 @@ - + Left Links - - + + Center Midden - + Right Rechts @@ -182,88 +182,93 @@ Positie: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Bovenaan bureaublad - + Left of desktop Linkerzijkant van bureaublad - + Right of desktop Rechterzijkant van bureaublad - + Bottom of desktop Onderkant van bureaublad - + Top of desktop %1 Bovenkant van bureaublad %1 - + Left of desktop %1 Linkerzijkant van bureaublad %1 - + Right of desktop %1 Rechterzijkant van bureaublad %1 - + Bottom of desktop %1 Onderkant van bureaublad %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Paneel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pl.ts b/panel/translations/lxqt-panel_pl.ts index 4087d11..5663502 100644 --- a/panel/translations/lxqt-panel_pl.ts +++ b/panel/translations/lxqt-panel_pl.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Menu - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pl_PL.ts b/panel/translations/lxqt-panel_pl_PL.ts index 2246317..a7b9e3c 100644 --- a/panel/translations/lxqt-panel_pl_PL.ts +++ b/panel/translations/lxqt-panel_pl_PL.ts @@ -91,7 +91,7 @@ Configure Panel - + KOnfiguruj Panel @@ -99,207 +99,212 @@ Configure panel - Konfiguruj panel + Konfiguruj panel Size - + Rozmiar Size: - Rozmiar: + Rozmiar: px - + px Icon size: - + Rozmiar ikon: Length: - Długość: + Długość: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Ujemna ilość pikseli powoduje zmniejszenie panelu .</p><p/><p><i>Np. "Długość" ustawiona na -100px, rozmiar ekranu 1000px, długość panelu wyniesie 900 px.</i></p> % - % + % px - px + px Rows count: - + Ilość wierszy: Alignment && position - + Wyrównanie i pozycja - + Left - Lewa + Lewa - - + + Center - Środek + Środek - + Right - Prawa + Prawa Alignment: - Wyrównanie: + Wyrównanie: Position: - Pozycja: + Pozycja: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Wygląd + Custom font color: + Własny kolor czcionki: + + + Custom background image: - + Własny obrazek tła: - + Custom background color: - + Własny kolor tła: - + Opacity - + Przezroczystość - + Top of desktop - Górna krawędź pulpitu + Górna krawędź pulpitu - + Left of desktop - Lewa krawędź pulpitu + Lewa krawędź pulpitu - + Right of desktop - Prawa krawędź pulpitu + Prawa krawędź pulpitu - + Bottom of desktop - Dolna krawędź pulpitu + Dolna krawędź pulpitu - + Top of desktop %1 - Górna krawędź pulpitu %1 + Górna krawędź pulpitu %1 - + Left of desktop %1 - Lewa krawędź pulpitu %1 + Lewa krawędź pulpitu %1 - + Right of desktop %1 - Prawa krawędź pulpitu %1 + Prawa krawędź pulpitu %1 - + Bottom of desktop %1 - Dolna krawędź pulpitu %1 + Dolna krawędź pulpitu %1 - + Top - + Góra - + Bottom - + Dół - - + + Pick color - + Wybierz kolor - + Images (*.png *.gif *.jpg) - + Obrazki (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + DOdaj Widgety - - + + Panel Panel - + Configure Panel... - + Konfiguruj Panel... - + Add Panel Widgets... - + Dodaj Widgety... - + Add Panel - + Dodaj Panel - + Remove Panel - + Usuń panel Configure panel... @@ -335,19 +340,19 @@ Plugin - + Configure "%1" - + Konfiguruj "%1" - + Move "%1" - + Przesuń "%1" - + Remove "%1" - + Usuń "%1"
diff --git a/panel/translations/lxqt-panel_pt.ts b/panel/translations/lxqt-panel_pt.ts index f78691c..fa48398 100644 --- a/panel/translations/lxqt-panel_pt.ts +++ b/panel/translations/lxqt-panel_pt.ts @@ -154,20 +154,20 @@ - + Left À esquerda - - + + Center Ao centro - + Right À direita @@ -182,88 +182,93 @@ Posição: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Em cima - + Left of desktop À esquerda - + Right of desktop À direita - + Bottom of desktop Em baixo - + Top of desktop %1 Em cima, área de trabalho %1 - + Left of desktop %1 À esquerda, área de trabalho %1 - + Right of desktop %1 À direita, área de trabalho %1 - + Bottom of desktop %1 Em baixo, área de trabalho %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Painel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pt_BR.ts b/panel/translations/lxqt-panel_pt_BR.ts index f15d600..b39ddf3 100644 --- a/panel/translations/lxqt-panel_pt_BR.ts +++ b/panel/translations/lxqt-panel_pt_BR.ts @@ -154,20 +154,20 @@ - + Left Esquerda - - + + Center Centro - + Right Direita @@ -182,88 +182,93 @@ Posição: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Na parte superior da área de trabalho - + Left of desktop À esquerda da área de trabalho - + Right of desktop À direita da área de trabalho - + Bottom of desktop Na parte inferior da área de trabalho - + Top of desktop %1 Na parte superior da área de trabalho %1 - + Left of desktop %1 A esquerda da área de trabalho %1 - + Right of desktop %1 À direita da área de trabalho %1 - + Bottom of desktop %1 Na parte inferior da área de trabalho %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Suspender Automaticamente - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_ro_RO.ts b/panel/translations/lxqt-panel_ro_RO.ts index 80a4b1c..a23cd5d 100644 --- a/panel/translations/lxqt-panel_ro_RO.ts +++ b/panel/translations/lxqt-panel_ro_RO.ts @@ -25,7 +25,7 @@ Panel length && position - Lungime și &poziție panou + Lungime && poziție panou Left @@ -91,7 +91,7 @@ Configure Panel - + Configurează panoul @@ -104,7 +104,7 @@ Size - + Dimensiune @@ -115,12 +115,12 @@ px - + px Icon size: - + Dimensiune pictograme: @@ -130,7 +130,7 @@ <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Pentru valori negative, dimensiunea panoului va fi calculată ca diferenta dintre marimea disponibilă a ecranului și valoarea introdusă.</p><p/><p><i>De ex. introducând o "lungime" de -100 px si o dimensiune a ecranului de 1000 px, dimensiunea reala a panoului va fi de 900 px.</i></p> @@ -145,29 +145,29 @@ Rows count: - + Număr coloane: Alignment && position - + Aliniere și poziție - + Left Stânga - - + + Center Centru - + Right Dreapta @@ -182,124 +182,129 @@ Poziție: - + + Auto-hide + Auto-ascundere + + + Styling - + Stil - + Custom font color: - + Culoare de font personalizată - + Custom background image: - + Imagine de fundal personalizată - + Custom background color: - + Culoare de fundal personalizată - + Opacity - + Opacitate - + Top of desktop Partea de sus a ecranului - + Left of desktop Stânga ecranului - + Right of desktop Dreapta ecranului - + Bottom of desktop Partea de jos a ecranului - + Top of desktop %1 Partea de sus a ecranului %1 - + Left of desktop %1 Stânga ecranului %1 - + Right of desktop %1 Dreapta ecranului %1 - + Bottom of desktop %1 Partea de jos a ecranului %1 - + Top - + Sus - + Bottom - + Jos - - + + Pick color - + Alege culoare - + Images (*.png *.gif *.jpg) - + Imagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - - + + Panel - Părăsește + Panou - + Configure Panel... - + Configurează panoul... - + Add Panel Widgets... - + Adaugă widget de panou - + Add Panel - + Adaugă panou - + Remove Panel - + Îndepărtează panou Configure panel... @@ -322,7 +327,7 @@ Remove - Elimină + Îndepărtează @@ -335,19 +340,19 @@ Plugin - + Configure "%1" - + Configurează "%1" - + Move "%1" - + Mută "%1" - + Remove "%1" - + Îndepărtează "%1" diff --git a/panel/translations/lxqt-panel_ru.ts b/panel/translations/lxqt-panel_ru.ts index 5bfb9f4..e5b72a8 100644 --- a/panel/translations/lxqt-panel_ru.ts +++ b/panel/translations/lxqt-panel_ru.ts @@ -1,219 +1,313 @@ + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + ConfigPanelDialog - - + Configure Panel Настроить панель + + + Panel + Панель + + + + Widgets + Виджеты + ConfigPanelWidget - + Configure panel Настроить панель - + px пикс - + Rows count: Количество строк: - + Icon size: Размер иконок: - + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> - - + + Left Слева - - - + + + Center По центру - - + + Right Справа - + % % - + Size Размер - + Size: Размер: - - + + px пикс - + Alignment && position Выравнивание && расположение - + Alignment: Выравнивание: - - Styling - Стиль + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: - - Custom font color: - Свой цвет шрифта: + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> - - Custom background image: - Своё фоновое изображение: + + Background image: + Фоновое изображение: - - Custom background color: - Свой цвет фона: + + Background color: + Цвет фона: - - Opacity - Непрозрачность + + Auto-hide + Автоматически скрывать - + Length: Длина: - + Position: Расположение: - + Top of desktop Вверху - + Left of desktop Слева - + Right of desktop Справа - + Bottom of desktop Внизу - + Top of desktop %1 Вверху %1 рабочего стола - + Left of desktop %1 Слева на %1 рабочем столе - + Right of desktop %1 Справа на %1 рабочем столе - + Bottom of desktop %1 Внизу %1 рабочего стола - + Top Вверху - + Bottom Внизу - - + + Pick color Выбрать цвет - + Images (*.png *.gif *.jpg) Изображения (*.png *.gif *.jpg) + + + Pick image + Выберите изображение + - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - Добавить виджеты на панель + + Configure Plugins + Настроить плагины - - + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + Panel Панель - - Configure Panel... - Настроить панель… + + Configure Panel + Настроить панель - - Add Panel Widgets... - Добавить виджеты на панель… + + Manage Widgets + Управление виджетами - + Add Panel Добавить панель - + Remove Panel Удалить панель @@ -221,19 +315,32 @@ Plugin - + Configure "%1" Настроить «%1» - + Move "%1" Переместить «%1» - + Remove "%1" Удалить «%1» + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + diff --git a/panel/translations/lxqt-panel_ru_RU.ts b/panel/translations/lxqt-panel_ru_RU.ts index 4e5738a..a5ad7a3 100644 --- a/panel/translations/lxqt-panel_ru_RU.ts +++ b/panel/translations/lxqt-panel_ru_RU.ts @@ -1,219 +1,313 @@ + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + ConfigPanelDialog - - + Configure Panel Настроить панель + + + Panel + Панель + + + + Widgets + Виджеты + ConfigPanelWidget - + Configure panel Настроить панель - + px пикс - + Rows count: Количество строк: - + Icon size: Размер иконок: - + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> - - + + Left Слева - - - + + + Center По центру - - + + Right Справа - + % % - + Size Размер - + Size: Размер: - - + + px пикс - + Alignment && position Выравнивание && расположение - + Alignment: Выравнивание: - - Styling - Стиль + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: - - Custom font color: - Свой цвет шрифта: + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> - - Custom background image: - Своё фоновое изображение: + + Background image: + Фоновое изображение: - - Custom background color: - Свой цвет фона: + + Background color: + Цвет фона: - - Opacity - Непрозрачность + + Auto-hide + Автоматически скрывать - + Length: Длина: - + Position: Расположение: - + Top of desktop Вверху - + Left of desktop Слева - + Right of desktop Справа - + Bottom of desktop Внизу - + Top of desktop %1 Вверху %1 рабочего стола - + Left of desktop %1 Слева на %1 рабочем столе - + Right of desktop %1 Справа на %1 рабочем столе - + Bottom of desktop %1 Внизу %1 рабочего стола - + Top Вверху - + Bottom Внизу - - + + Pick color Выбрать цвет - + Images (*.png *.gif *.jpg) Изображения (*.png *.gif *.jpg) + + + Pick image + Выберите изображение + - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - Добавить виджеты на панель + + Configure Plugins + Настроить плагины - - + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + Panel Панель - - Configure Panel... - Настроить панель… + + Configure Panel + Настроить панель - - Add Panel Widgets... - Добавить виджеты на панель… + + Manage Widgets + Управление виджетами - + Add Panel Добавить панель - + Remove Panel Удалить панель @@ -221,19 +315,32 @@ Plugin - + Configure "%1" Настроить «%1» - + Move "%1" Переместить «%1» - + Remove "%1" Удалить «%1» + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + diff --git a/panel/translations/lxqt-panel_sk_SK.ts b/panel/translations/lxqt-panel_sk_SK.ts index 75bda96..f60ceb5 100644 --- a/panel/translations/lxqt-panel_sk_SK.ts +++ b/panel/translations/lxqt-panel_sk_SK.ts @@ -126,20 +126,20 @@ - + Left Vľavo - - + + Center Stred - + Right Vpravo @@ -154,88 +154,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Vrch plochy - + Left of desktop Ľavá strana plochy - + Right of desktop Pravá strana plochy - + Bottom of desktop Spodok plochy - + Top of desktop %1 Vrch plochy %1 - + Left of desktop %1 Ľavá strana plochy %1 - + Right of desktop %1 Pravá strana plochy %1 - + Bottom of desktop %1 Spodok plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -243,33 +248,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -288,17 +293,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sl.ts b/panel/translations/lxqt-panel_sl.ts index 05f7bad..c8c880a 100644 --- a/panel/translations/lxqt-panel_sl.ts +++ b/panel/translations/lxqt-panel_sl.ts @@ -154,20 +154,20 @@ - + Left Levo - - + + Center Na sredini - + Right Desno @@ -182,88 +182,93 @@ Položaj: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Vrh namizja - + Left of desktop Leva stran namizja - + Right of desktop Desna stran namizja - + Bottom of desktop Dno namizja - + Top of desktop %1 Vrh namizja %1 - + Left of desktop %1 Leva stran namizja %1 - + Right of desktop %1 Desna stran namizja %1 - + Bottom of desktop %1 Dno namizja %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Pult - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr@latin.ts b/panel/translations/lxqt-panel_sr@latin.ts index 82a2bfc..ec6115e 100644 --- a/panel/translations/lxqt-panel_sr@latin.ts +++ b/panel/translations/lxqt-panel_sr@latin.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Automatsko suspendovanje - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr_BA.ts b/panel/translations/lxqt-panel_sr_BA.ts index e584b21..d2f3456 100644 --- a/panel/translations/lxqt-panel_sr_BA.ts +++ b/panel/translations/lxqt-panel_sr_BA.ts @@ -118,20 +118,20 @@ - + Left Лијево - - + + Center Центар - + Right Десно @@ -146,88 +146,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop врху површи - + Left of desktop лијевој страни површи - + Right of desktop десној страни површи - + Bottom of desktop дну површи - + Top of desktop %1 врху површи %1 - + Left of desktop %1 лијевој страни површи %1 - + Right of desktop %1 десној страни површи %1 - + Bottom of desktop %1 дну површи %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -235,33 +240,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панел - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -319,17 +324,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr_RS.ts b/panel/translations/lxqt-panel_sr_RS.ts index 6cf98ee..f44a87f 100644 --- a/panel/translations/lxqt-panel_sr_RS.ts +++ b/panel/translations/lxqt-panel_sr_RS.ts @@ -142,20 +142,20 @@ - + Left Лево - - + + Center Центар - + Right Десно @@ -170,88 +170,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop врху површи - + Left of desktop левој страни површи - + Right of desktop десној страни површи - + Bottom of desktop дну површи - + Top of desktop %1 врху површи %1 - + Left of desktop %1 левој страни површи %1 - + Right of desktop %1 десној страни површи %1 - + Bottom of desktop %1 дну површи %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -259,33 +264,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панел - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -315,17 +320,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_th_TH.ts b/panel/translations/lxqt-panel_th_TH.ts index d64e24c..fcd59a2 100644 --- a/panel/translations/lxqt-panel_th_TH.ts +++ b/panel/translations/lxqt-panel_th_TH.ts @@ -154,20 +154,20 @@ - + Left ทางซ้าย - - + + Center ตรงกลาง - + Right ทางขวา @@ -182,88 +182,93 @@ ตำแหน่ง: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop ด้านบนของหน้าจอ - + Left of desktop ด้านซ้ายของหน้าจอ - + Right of desktop ด้านขวาของหน้าจอ - + Bottom of desktop ด้านล่างของหน้าจอ - + Top of desktop %1 ด้านบนของหน้าจอ %1 - + Left of desktop %1 ด้านซ้ายของหน้าจอ %1 - + Right of desktop %1 ด้านขวาของหน้าจอ %1 - + Bottom of desktop %1 ด้านล่างของหน้าจอ %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel พาเนล - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_tr.ts b/panel/translations/lxqt-panel_tr.ts index b2e5d13..fe15170 100644 --- a/panel/translations/lxqt-panel_tr.ts +++ b/panel/translations/lxqt-panel_tr.ts @@ -154,20 +154,20 @@ - + Left Sol - - + + Center Merkez - + Right Sağ @@ -182,88 +182,93 @@ Konum: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Masasüstünün üst kısmı - + Left of desktop Masaüstünün sol kısmı - + Right of desktop Masaüstünün sağ kısmı - + Bottom of desktop Masaüstünün alt kısmı - + Top of desktop %1 Masaüstünün üst kısmı %1 - + Left of desktop %1 Masaüstünün sol kısmı %1 - + Right of desktop %1 Masaüstünün sağ kısmı %1 - + Bottom of desktop %1 Masaüstünün alt kısmı %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Not Defteri - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_uk.ts b/panel/translations/lxqt-panel_uk.ts index 4c0a3ea..30af3eb 100644 --- a/panel/translations/lxqt-panel_uk.ts +++ b/panel/translations/lxqt-panel_uk.ts @@ -154,20 +154,20 @@ - + Left Зліва - - + + Center Посередині - + Right Справа @@ -182,88 +182,93 @@ Місце: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Згори стільниці - + Left of desktop Зліва стільниці - + Right of desktop Справа стільниці - + Bottom of desktop Знизу стільниці - + Top of desktop %1 Згори стільниці %1 - + Left of desktop %1 Зліва стільниці %1 - + Right of desktop %1 Справа стільниці %1 - + Bottom of desktop %1 Знизу стільниці %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панель - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_zh_CN.ts b/panel/translations/lxqt-panel_zh_CN.ts index 860a8ef..8aa41d3 100644 --- a/panel/translations/lxqt-panel_zh_CN.ts +++ b/panel/translations/lxqt-panel_zh_CN.ts @@ -154,20 +154,20 @@ - + Left - - + + Center 居中 - + Right @@ -182,88 +182,93 @@ 位置: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop 桌面顶部 - + Left of desktop 桌面左侧 - + Right of desktop 桌面右侧 - + Bottom of desktop 桌面底部 - + Top of desktop %1 桌面顶部 %1 - + Left of desktop %1 桌面左侧 %1 - + Right of desktop %1 左面右侧 %1 - + Bottom of desktop %1 桌面底部 %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel qxkb - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_zh_TW.ts b/panel/translations/lxqt-panel_zh_TW.ts index 221c7ce..9c329bb 100644 --- a/panel/translations/lxqt-panel_zh_TW.ts +++ b/panel/translations/lxqt-panel_zh_TW.ts @@ -154,20 +154,20 @@ - + Left 向左 - - + + Center 中間 - + Right 向右 @@ -182,88 +182,93 @@ 位置 : - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop 桌面頂端 - + Left of desktop 桌面左方 - + Right of desktop 桌面右方 - + Bottom of desktop 桌面底端 - + Top of desktop %1 桌面頂端 %1 - + Left of desktop %1 桌面左方 %1 - + Right of desktop %1 桌面右方 %1 - + Bottom of desktop %1 桌面底端 %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel LxQt滑鼠設定 - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/plugin-clock/CMakeLists.txt b/plugin-clock/CMakeLists.txt index 57ad575..d044761 100644 --- a/plugin-clock/CMakeLists.txt +++ b/plugin-clock/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES calendarpopup.cpp ) -set(MOCS - lxqtclock.h - lxqtclockconfiguration.h - calendarpopup.h -) - set(UIS lxqtclockconfiguration.ui ) diff --git a/plugin-clock/calendarpopup.cpp b/plugin-clock/calendarpopup.cpp index fec20cf..6866302 100644 --- a/plugin-clock/calendarpopup.cpp +++ b/plugin-clock/calendarpopup.cpp @@ -28,7 +28,6 @@ #include "calendarpopup.h" #include #include -#include CalendarPopup::CalendarPopup(QWidget *parent): QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) @@ -37,7 +36,6 @@ CalendarPopup::CalendarPopup(QWidget *parent): layout()->setMargin(1); cal = new QCalendarWidget(this); - cal->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); layout()->addWidget(cal); adjustSize(); } @@ -60,3 +58,8 @@ bool CalendarPopup::event(QEvent *event) return QDialog::event(event); } + +void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday) +{ + cal->setFirstDayOfWeek(wday); +} diff --git a/plugin-clock/calendarpopup.h b/plugin-clock/calendarpopup.h index bc33c61..cf52392 100644 --- a/plugin-clock/calendarpopup.h +++ b/plugin-clock/calendarpopup.h @@ -38,6 +38,7 @@ class CalendarPopup : public QDialog public: CalendarPopup(QWidget *parent = 0); ~CalendarPopup(); + void setFirstDayOfWeek(Qt::DayOfWeek wday); void show(); diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp index dca028e..47bc42f 100644 --- a/plugin-clock/lxqtclock.cpp +++ b/plugin-clock/lxqtclock.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -41,6 +40,8 @@ #include #include #include +#include +#include #include @@ -51,17 +52,40 @@ * @author Kuzma Shapran */ +class DownscaleFontStyle : public QProxyStyle +{ + using QProxyStyle::QProxyStyle; +public: + + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override + { + while (1 < painter->font().pointSize() + && !(rect.size() - painter->fontMetrics().boundingRect(text).size()).isValid()) + { + QFont f{painter->font()}; + f.setPointSize(f.pointSize() - 1); + painter->setFont(f); + } + return QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } +}; + /** * @brief constructor */ LxQtClock::LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), - mAutoRotate(true) + mAutoRotate(true), + mTextStyle{new DownscaleFontStyle}, + mCurrentCharCount(0) { mMainWidget = new QWidget(); mRotatedWidget = new LxQt::RotatedWidget(*(new QWidget()), mMainWidget); mContent = mRotatedWidget->content(); + mContent->setStyle(mTextStyle.data()); mTimeLabel = new QLabel(mContent); mDateLabel = new QLabel(mContent); @@ -76,21 +100,14 @@ LxQtClock::LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo): mTimeLabel->setAlignment(Qt::AlignCenter); mDateLabel->setAlignment(Qt::AlignCenter); - QVBoxLayout *contentLayout = new QVBoxLayout(mContent); - contentLayout->setContentsMargins(0, 0, 0, 0); - contentLayout->setSpacing(1); - contentLayout->addWidget(mTimeLabel, 0, Qt::AlignCenter); - contentLayout->addWidget(mDateLabel, 0, Qt::AlignCenter); - mContent->setLayout(contentLayout); - - mTimeLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mDateLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mContent->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mRotatedWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mMainWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - + mContent->setLayout(new QVBoxLayout{mContent}); + mContent->layout()->setContentsMargins(0, 0, 0, 0); + mContent->layout()->setSpacing(0); + mContent->layout()->addWidget(mTimeLabel); + mContent->layout()->addWidget(mDateLabel); mClockTimer = new QTimer(this); + mClockTimer->setTimerType(Qt::PreciseTimer); connect (mClockTimer, SIGNAL(timeout()), SLOT(updateTime())); mClockFormat = "hh:mm"; @@ -120,43 +137,58 @@ QDateTime LxQtClock::currentDateTime() */ void LxQtClock::updateTime() { - QDateTime now = currentDateTime(); + //XXX: do we need this with PreciseTimer ? + if (currentDateTime().time().msec() > 500) + restartTimer(); - if (now.time().msec() > 500) - restartTimer(now); - - showTime(now); + showTime(); } -void LxQtClock::showTime(const QDateTime &now) +void LxQtClock::showTime() { + QDateTime now{currentDateTime()}; + int new_char_count; if (mDateOnNewLine) { - mTimeLabel->setText(QLocale::system().toString(now, mTimeFormat)); - mDateLabel->setText(QLocale::system().toString(now, mDateFormat)); + QString new_time = QLocale::system().toString(now, mTimeFormat); + QString new_date = QLocale::system().toString(now, mDateFormat); + new_char_count = qMax(new_time.size(), new_date.size()); + mTimeLabel->setText(new_time); + mDateLabel->setText(new_date); } else { - mTimeLabel->setText(QLocale::system().toString(now, mClockFormat)); + QString new_time = QLocale::system().toString(now, mClockFormat); + new_char_count = new_time.size(); + mTimeLabel->setText(new_time); } - mRotatedWidget->adjustContentSize(); - - mRotatedWidget->update(); + if (mCurrentCharCount != new_char_count) + { + mCurrentCharCount = new_char_count; + realign(); + } } -void LxQtClock::restartTimer(const QDateTime &now) +void LxQtClock::restartTimer() { if (mClockTimer->isActive()) mClockTimer->stop(); int updateInterval = mClockTimer->interval(); - int delay = static_cast((updateInterval + 100 /* ms after time change */ - ((now.time().msec() + now.time().second() * 1000) % updateInterval)) % updateInterval); - QTimer::singleShot(delay, this, SLOT(updateTime())); - QTimer::singleShot(delay, mClockTimer, SLOT(start())); + QDateTime now{currentDateTime()}; + int delay = updateInterval - ((now.time().msec() + now.time().second() * 1000) % updateInterval); + QTimer::singleShot(delay, Qt::PreciseTimer, mClockTimer, SLOT(start())); + QTimer::singleShot(delay, Qt::PreciseTimer, this, SLOT(updateTime())); } void LxQtClock::settingsChanged() { + mFirstDayOfWeek = settings()->value("firstDayOfWeek", -1).toInt(); + if (-1 == mFirstDayOfWeek) + mCalendarPopup->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); + else + mCalendarPopup->setFirstDayOfWeek(static_cast(mFirstDayOfWeek)); + mTimeFormat = settings()->value("timeFormat", QLocale::system().timeFormat(QLocale::ShortFormat).toUpper().contains("AP") ? "h:mm AP" : "HH:mm").toString(); mUseUTC = settings()->value("UTC", false).toBool(); @@ -169,13 +201,7 @@ void LxQtClock::settingsChanged() bool dateAfterTime = (settings()->value("showDate", "no").toString().toLower() == "after"); mDateOnNewLine = (settings()->value("showDate", "no").toString().toLower() == "below"); - bool autoRotate = settings()->value("autoRotate", true).toBool(); - if (autoRotate != mAutoRotate) - { - mAutoRotate = autoRotate; - realign(); - } - + mAutoRotate = settings()->value("autoRotate", true).toBool(); if (dateBeforeTime) mClockFormat = QString("%1 %2").arg(mDateFormat).arg(mTimeFormat); @@ -184,143 +210,71 @@ void LxQtClock::settingsChanged() else mClockFormat = mTimeFormat; - mDateLabel->setVisible(mDateOnNewLine); - - updateMinWidth(); + mDateLabel->setHidden(!mDateOnNewLine); // mDateFormat usually does not contain time portion, but since it's possible to use custom date format - it has to be supported. [Kuzma Shapran] int updateInterval = QString(mTimeFormat + " " + mDateFormat).replace(QRegExp("'[^']*'"),"").contains("s") ? 1000 : 60000; QDateTime now = currentDateTime(); - showTime(now); + showTime(); if (mClockTimer->interval() != updateInterval) { mClockTimer->setInterval(updateInterval); - restartTimer(now); + restartTimer(); } } void LxQtClock::realign() { - if (mAutoRotate) + QSize size{QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}; + Qt::Corner origin = Qt::TopLeftCorner; + if (mAutoRotate || panel()->isHorizontal()) + { switch (panel()->position()) { case ILxQtPanel::PositionTop: case ILxQtPanel::PositionBottom: - mRotatedWidget->setOrigin(Qt::TopLeftCorner); + origin = Qt::TopLeftCorner; break; case ILxQtPanel::PositionLeft: - mRotatedWidget->setOrigin(Qt::BottomLeftCorner); + origin = Qt::BottomLeftCorner; break; case ILxQtPanel::PositionRight: - mRotatedWidget->setOrigin(Qt::TopRightCorner); + origin = Qt::TopRightCorner; break; } - else - mRotatedWidget->setOrigin(Qt::TopLeftCorner); -} -static QDate getMaxDate(const QFontMetrics &metrics, const QString &format) -{ - QDate d(QDate::currentDate().year(), 1, 1); - QDateTime dt(d); - QDate res; - - int maxWidth = 0; - while (dt.date().year() == d.year()) + //set minwidth + QFontMetrics metrics{mTimeLabel->font()}; + //Note: using a constant string of reasonably wide characters for computing the width + // (not the current text as width of text can differ for each particular string (based on font)) + size.setWidth(metrics.boundingRect(QString{mCurrentCharCount, 'A'}).width()); + } else if (!panel()->isHorizontal()) { - int w = metrics.boundingRect(dt.toString(format)).width(); - //qDebug() << "*" << dt.toString(format) << w; - if (w > maxWidth) - { - res = dt.date(); - maxWidth = w; - } - dt = dt.addDays(1); + size.setWidth(panel()->globalGometry().width()); } - //qDebug() << "Max date:" << res.toString(format); - return res; -} - - -static QTime getMaxTime(const QFontMetrics &metrics, const QString &format) -{ - int maxMinSec = 0; - for (int width=0, i=0; i<60; ++i) - { - int w = metrics.boundingRect(QString("%1").arg(i, 2, 10, QChar('0'))).width(); - if (w > width) - { - maxMinSec = i; - width = w; - } - } + mTimeLabel->setFixedWidth(size.width()); + mDateLabel->setFixedWidth(size.width()); - QTime res; - QDateTime dt(QDate(1, 1, 1), QTime(0, maxMinSec, maxMinSec)); + int label_height = mTimeLabel->sizeHint().height(); + size.setHeight(mDateOnNewLine ? label_height * 2 : label_height); - int maxWidth = 0; - while (dt.date().day() == 1) - { - int w = metrics.boundingRect(dt.toString(format)).width(); - //qDebug() << "*" << dt.toString(format) << w; - if (w > maxWidth) - { - res = dt.time(); - maxWidth = w; - } - dt = dt.addSecs(3600); - } + const bool changed = mContent->maximumSize() != size || mRotatedWidget->origin() != origin; - //qDebug() << "Max time:" << res.toString(); - return res; -} + mContent->setFixedSize(size); + mRotatedWidget->setOrigin(origin); -/************************************************ - Issue #18: Panel clock plugin changes your size - ************************************************/ -void LxQtClock::updateMinWidth() -{ - QFontMetrics timeLabelMetrics(mTimeLabel->font()); - QFontMetrics dateLabelMetrics(mDateLabel->font()); - QDate maxDate = getMaxDate(mDateOnNewLine ? dateLabelMetrics : timeLabelMetrics, mDateFormat); - QTime maxTime = getMaxTime(timeLabelMetrics, mTimeFormat); - QDateTime dt(maxDate, maxTime); - - //qDebug() << "T:" << metrics.boundingRect(dt.toString(mTimeFormat)).width(); - //qDebug() << "C:" << metrics.boundingRect(QTime::currentTime().toString(mTimeFormat)).width() << QTime::currentTime().toString(mTimeFormat); - //qDebug() << "D:" << metrics.boundingRect(dt.toString(mDateFormat)).width(); - - int width; - int height; - if (mDateOnNewLine) - { - QRect rect1(timeLabelMetrics.boundingRect(dt.toString(mTimeFormat))); - mTimeLabel->setMinimumSize(rect1.size()); - QRect rect2(dateLabelMetrics.boundingRect(dt.toString(mDateFormat))); - mDateLabel->setMinimumSize(rect2.size()); - width = qMax(rect1.width(), rect2.width()); - height = rect1.height() + rect2.height(); -// qDebug() << "LxQtClock Recalc size" << width << height << dt.toString(mTimeFormat) << dt.toString(mDateFormat); - } - else + if (changed) { - QRect rect(timeLabelMetrics.boundingRect(dt.toString(mClockFormat))); - mTimeLabel->setMinimumSize(rect.size()); - mDateLabel->setMinimumSize(0, 0); - width = rect.width(); - height = rect.height(); -// qDebug() << "LxQtClock Recalc size" << width << height << dt.toString(mClockFormat); + mRotatedWidget->adjustContentSize(); + mRotatedWidget->update(); } - - - mContent->setMinimumSize(width, height); } void LxQtClock::activated(ActivationReason reason) diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index 8912ee8..b3ac0b7 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -41,6 +41,7 @@ class QLabel; class QDialog; class QTimer; +class QProxyStyle; class LxQtClock : public QObject, public ILxQtPanelPlugin { @@ -80,25 +81,24 @@ private: QString mDateFormat; bool mDateOnNewLine; bool mUseUTC; - Qt::DayOfWeek mFirstDayOfWeek; + int mFirstDayOfWeek; bool mAutoRotate; + QScopedPointer mTextStyle; + int mCurrentCharCount; QDateTime currentDateTime(); - void showTime(const QDateTime &); - void restartTimer(const QDateTime&); - -private slots: - void updateMinWidth(); + void showTime(); + void restartTimer(); }; class LxQtClockPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtClock(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtClock(startupInfo);} }; diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp index 82a86b1..ef401a3 100644 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ b/plugin-clock/lxqtclockconfiguration.cpp @@ -27,11 +27,54 @@ #include +#include +#include #include "lxqtclockconfiguration.h" #include "ui_lxqtclockconfiguration.h" +namespace +{ + class FirstDayCombo : public QStandardItemModel + { + public: + FirstDayCombo() + { + QStandardItem* item = 0; + int row = 0; + item = new QStandardItem; + item->setData(-1, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(tr(""), Qt::DisplayRole); + setItem(row, 1, item); + ++row; + for (int wday = Qt::Monday; Qt::Sunday >= wday; ++wday, ++row) + { + item = new QStandardItem; + item->setData(wday, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(QLocale::system().dayName(wday), Qt::DisplayRole); + setItem(row, 1, item); + } + } + + int findIndex(int wday) + { + int i = rowCount() - 1; + for ( ; 0 <= i; --i) + { + if (item(i)->data(Qt::UserRole).toInt() == wday) + break; + } + return i; + } + + }; +} + LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *parent) : QDialog(parent), ui(new Ui::LxQtClockConfiguration), @@ -45,6 +88,9 @@ LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *par connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + ui->firstDayOfWeekCB->setModel(new FirstDayCombo); + ui->firstDayOfWeekCB->setModelColumn(1); + loadSettings(); /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly change of state */ @@ -60,6 +106,7 @@ LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *par connect(ui->showDateBelowTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); connect(ui->autorotateCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->firstDayOfWeekCB, SIGNAL(activated(int)), SLOT(saveSettings())); } LxQtClockConfiguration::~LxQtClockConfiguration() @@ -187,6 +234,7 @@ void LxQtClockConfiguration::loadSettings() mOldIndex = ui->dateFormatCOB->currentIndex(); ui->autorotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); + ui->firstDayOfWeekCB->setCurrentIndex(dynamic_cast(*(ui->firstDayOfWeekCB->model())).findIndex(mSettings.value("firstDayOfWeek", -1).toInt())); } void LxQtClockConfiguration::saveSettings() @@ -212,6 +260,7 @@ void LxQtClockConfiguration::saveSettings() mSettings.setValue("dateFormat", ui->dateFormatCOB->itemData(ui->dateFormatCOB->currentIndex())); mSettings.setValue("autoRotate", ui->autorotateCB->isChecked()); + mSettings.setValue("firstDayOfWeek", dynamic_cast(*ui->firstDayOfWeekCB->model()).item(ui->firstDayOfWeekCB->currentIndex(), 0)->data(Qt::UserRole)); } void LxQtClockConfiguration::dialogButtonsAction(QAbstractButton *btn) diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui index 0e728b2..2eb731e 100644 --- a/plugin-clock/lxqtclockconfiguration.ui +++ b/plugin-clock/lxqtclockconfiguration.ui @@ -7,7 +7,7 @@ 0 0 330 - 433 + 447 @@ -101,6 +101,20 @@ + + + + First day of week in calendar + + + firstDayOfWeekCB + + + + + + + diff --git a/plugin-clock/translations/clock.ts b/plugin-clock/translations/clock.ts index 6f817e7..7914ecd 100644 --- a/plugin-clock/translations/clock.ts +++ b/plugin-clock/translations/clock.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -49,12 +57,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ar.ts b/plugin-clock/translations/clock_ar.ts index 19a0bfe..1086869 100644 --- a/plugin-clock/translations/clock_ar.ts +++ b/plugin-clock/translations/clock_ar.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ مائل - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_cs.ts b/plugin-clock/translations/clock_cs.ts index a83c320..4841169 100644 --- a/plugin-clock/translations/clock_cs.ts +++ b/plugin-clock/translations/clock_cs.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kurzíva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_cs_CZ.ts b/plugin-clock/translations/clock_cs_CZ.ts index f37ec65..42c09e5 100644 --- a/plugin-clock/translations/clock_cs_CZ.ts +++ b/plugin-clock/translations/clock_cs_CZ.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kurzíva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_da.ts b/plugin-clock/translations/clock_da.ts index 7011668..3a5030c 100644 --- a/plugin-clock/translations/clock_da.ts +++ b/plugin-clock/translations/clock_da.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -93,12 +106,12 @@ Datoformat - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_da_DK.ts b/plugin-clock/translations/clock_da_DK.ts index 36848c1..3c6ef0e 100644 --- a/plugin-clock/translations/clock_da_DK.ts +++ b/plugin-clock/translations/clock_da_DK.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursiv - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_de.desktop b/plugin-clock/translations/clock_de.desktop index 50e99aa..f24f08e 100644 --- a/plugin-clock/translations/clock_de.desktop +++ b/plugin-clock/translations/clock_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Date & time -Comment=Displays the current time. Comes with a calendar. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Uhr und Kalender -Name[de]=Uhr +Name[de]=Uhr und Kalender +Comment[de]=Zeigt die aktuelle Uhrzeit. Ein Kalender ist auch enthalten. diff --git a/plugin-clock/translations/clock_de.ts b/plugin-clock/translations/clock_de.ts index d24f7d2..af939b0 100644 --- a/plugin-clock/translations/clock_de.ts +++ b/plugin-clock/translations/clock_de.ts @@ -2,15 +2,19 @@ - LxQtClockConfiguration + FirstDayCombo - LxQt Clock Settings - LxQt Uhr Einstellungen + + <locale based> + <Basierend auf lokale Datumseinstellungen> + + + LxQtClockConfiguration Clock Settings - + Uhr-Einstellungen @@ -20,85 +24,70 @@ &Show seconds - + &Sekunden anzeigen 12 &hour style - + 12 Stunden U&hr-Stil &Use UTC - + &UTC verwenden + + + + Date + Datum Date &format - + Datums&format &Do not show date - + &Datum nicht anzeigen Show date &before time - + Datum &vor Zeit anzeigen Show date &after time - + Datum hinter Uhrzeit &anzeigen Show date below time on new &line - - - - - Orientation - - - - - Auto&rotate when the panel is vertical - + Datum unterha&lb Uhrzeit anzeigen - Show seconds - Zeige Sekunden + + First day of week in calendar + Erster Wochentag im Kalender - 12 hour style - 12-Stunden-Format - - - - Date - Datum - - - Show date - Zeige Datum - - - Show date in new line - Zeige Datum in einer neuen Zeile + + Orientation + Ausrichtung - Date format - Datumsformat + + Auto&rotate when the panel is vertical + Automatisch d&rehen bei vertikaler Leiste - + Input custom date format - + Eigenes Datumsformat - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -118,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Interpretierte Datumsformatsequenzen sind: + +d Tag als Zahl ohne führende Null (1 bis 31) +dd Tag als Zahl mit führender Null (01 bis 31) +ddd abgekürzter lokalisierter Tagesname (d.h. 'Mon' bis 'Son'). +dddd ganzer lokalisierter Tagesname (d.h. 'Montag' bis 'Sonntag'). +M Monat als Zahl ohne führende Null (1-12) +MM Monat als Zahl mit führender Null (01-12) +MMM abgekürzter lokalisierter Monatsname (d.h. 'Jan' bis 'Dez'). +MMMM ganzer lokalisierter Monatsname (d.h. 'Januar' bis 'Dezember'). +yy Jahr als zweistellige Zahl (00-99) +yyyy Jahr als vierstellige Zahl + +Alle anderen Zeichen werden als Text behandelt. +Jede Zeichenfolge, die in einfachen Hochkommas eingeschlossen ist ('), +wird ebenfalls als Text behandelt und nicht als Ausdruck benutzt. + + +Eigenes Datumsformat: diff --git a/plugin-clock/translations/clock_el_GR.ts b/plugin-clock/translations/clock_el_GR.ts index 3bc2875..c549c03 100644 --- a/plugin-clock/translations/clock_el_GR.ts +++ b/plugin-clock/translations/clock_el_GR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Πλάγια - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_eo.ts b/plugin-clock/translations/clock_eo.ts index f5a3967..e6ed7ae 100644 --- a/plugin-clock/translations/clock_eo.ts +++ b/plugin-clock/translations/clock_eo.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursive - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es.ts b/plugin-clock/translations/clock_es.ts index 3e4df0d..bbfa100 100644 --- a/plugin-clock/translations/clock_es.ts +++ b/plugin-clock/translations/clock_es.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Cursiva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es_UY.ts b/plugin-clock/translations/clock_es_UY.ts index 81fd031..ed6fe8d 100644 --- a/plugin-clock/translations/clock_es_UY.ts +++ b/plugin-clock/translations/clock_es_UY.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Fecha - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es_VE.ts b/plugin-clock/translations/clock_es_VE.ts index 294e378..7e34690 100644 --- a/plugin-clock/translations/clock_es_VE.ts +++ b/plugin-clock/translations/clock_es_VE.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Italica - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_eu.ts b/plugin-clock/translations/clock_eu.ts index 76c7dba..eed3552 100644 --- a/plugin-clock/translations/clock_eu.ts +++ b/plugin-clock/translations/clock_eu.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Etzana - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_fi.ts b/plugin-clock/translations/clock_fi.ts index b4779e7..8c1281a 100644 --- a/plugin-clock/translations/clock_fi.ts +++ b/plugin-clock/translations/clock_fi.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursivoitu - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_fr_FR.ts b/plugin-clock/translations/clock_fr_FR.ts index 0006d4e..8ed0b11 100644 --- a/plugin-clock/translations/clock_fr_FR.ts +++ b/plugin-clock/translations/clock_fr_FR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -85,12 +98,12 @@ Italique - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_hu.ts b/plugin-clock/translations/clock_hu.ts index cae89c4..1a4cd0e 100644 --- a/plugin-clock/translations/clock_hu.ts +++ b/plugin-clock/translations/clock_hu.ts @@ -1,80 +1,93 @@ - + + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration Clock Settings - + Órabeállítás Time - + Idő &Show seconds - + Má&sodpercek 12 &hour style - + 12 órás &stílus &Use UTC - - - - - Date &format - + &UTC használat &Do not show date - + Ne legyen &dátum Show date &before time - + &Dátum az óra előtt Show date &after time - + Dátum &az óra után Show date below time on new &line - + Dátum az órával új sorban - + + First day of week in calendar + A hét első napja + + + Orientation - + Helyzet - + Auto&rotate when the panel is vertical - + Függélyes panelnél automata görgetés Date - + Dátum - + + Date &format + Dá&tumalak + + + Input custom date format - + Egyéni dátumalak - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -94,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: diff --git a/plugin-clock/translations/clock_hu_HU.ts b/plugin-clock/translations/clock_hu_HU.ts index 98f0d04..cd65f86 100644 --- a/plugin-clock/translations/clock_hu_HU.ts +++ b/plugin-clock/translations/clock_hu_HU.ts @@ -2,15 +2,19 @@ - LxQtClockConfiguration + FirstDayCombo - LxQt Clock Settings - LXDE-Qt - Órabeállítás + + <locale based> + + + + LxQtClockConfiguration Clock Settings - + Órabeállítás @@ -20,52 +24,52 @@ &Show seconds - + Má&sodpercek 12 &hour style - + 12 órás &stílus &Use UTC - - - - - Date &format - + &UTC használat &Do not show date - + Ne legyen &dátum Show date &before time - + &Dátum az óra előtt Show date &after time - + Dátum &az óra után Show date below time on new &line - + Dátum az órával új sorban + + + + First day of week in calendar + A hét első napja - + Orientation - + Helyzet - + Auto&rotate when the panel is vertical - + Függélyes panelnél automata görgetés @@ -73,12 +77,17 @@ Dátum - + + Date &format + Dá&tumalak + + + Input custom date format - + Egyéni dátumalak - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -98,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: diff --git a/plugin-clock/translations/clock_ia.ts b/plugin-clock/translations/clock_ia.ts index ab27126..e75a468 100644 --- a/plugin-clock/translations/clock_ia.ts +++ b/plugin-clock/translations/clock_ia.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_id_ID.ts b/plugin-clock/translations/clock_id_ID.ts index 7316a31..3c7ecab 100644 --- a/plugin-clock/translations/clock_id_ID.ts +++ b/plugin-clock/translations/clock_id_ID.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Tanggal - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_it_IT.ts b/plugin-clock/translations/clock_it_IT.ts index ded6702..e9585d5 100644 --- a/plugin-clock/translations/clock_it_IT.ts +++ b/plugin-clock/translations/clock_it_IT.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Impostazioni orologio @@ -30,42 +38,47 @@ &Use UTC - + &Usa UTC Date &format - + Formato &data &Do not show date - + &Non mostrare la data Show date &before time - + Prima la &data Show date &after time - + Prima l'&ora Show date below time on new &line + Mostra la data su una seconda riga + + + + First day of week in calendar - + Orientation - + Orientamento - + Auto&rotate when the panel is vertical - + Ruota automaticamente se il panello è verticale &Font @@ -137,12 +150,12 @@ Corsivo - + Input custom date format - + Formato personalizzato - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ja.ts b/plugin-clock/translations/clock_ja.ts index 383d054..11b263b 100644 --- a/plugin-clock/translations/clock_ja.ts +++ b/plugin-clock/translations/clock_ja.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ 時刻の下に日付(&L) - + + First day of week in calendar + + + + Orientation 回転 - + Auto&rotate when the panel is vertical パネルが縦のときに自動回転(&R) @@ -69,12 +82,12 @@ 日付 - + Input custom date format 日付の表示形式を指定 - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ko.ts b/plugin-clock/translations/clock_ko.ts index 1269b4a..cd7fe2f 100644 --- a/plugin-clock/translations/clock_ko.ts +++ b/plugin-clock/translations/clock_ko.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_lt.ts b/plugin-clock/translations/clock_lt.ts index fb0004e..5fc25b6 100644 --- a/plugin-clock/translations/clock_lt.ts +++ b/plugin-clock/translations/clock_lt.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Pasviręs - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_nl.ts b/plugin-clock/translations/clock_nl.ts index 3f4874d..809e602 100644 --- a/plugin-clock/translations/clock_nl.ts +++ b/plugin-clock/translations/clock_nl.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Schuin - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pl_PL.ts b/plugin-clock/translations/clock_pl_PL.ts index 1a8738d..13d814a 100644 --- a/plugin-clock/translations/clock_pl_PL.ts +++ b/plugin-clock/translations/clock_pl_PL.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Ustawienia zegara @@ -30,42 +38,47 @@ &Use UTC - + &Użyj UTC Date &format - + &Format daty &Do not show date - + &Nie pokazuj daty Show date &before time - + Poka&ż datę przed godziną Show date &after time - + Pokaż datę &za godziną Show date below time on new &line + Pokaż datę pod godziną w nowej &linii + + + + First day of week in calendar - + Orientation - + Orientacja - + Auto&rotate when the panel is vertical - + Ob&róć gdy panel jest pionowy &Font @@ -137,12 +150,12 @@ Kursywa - + Input custom date format - + Własny format daty - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pt.ts b/plugin-clock/translations/clock_pt.ts index 20619b4..d542707 100644 --- a/plugin-clock/translations/clock_pt.ts +++ b/plugin-clock/translations/clock_pt.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Itálico - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pt_BR.ts b/plugin-clock/translations/clock_pt_BR.ts index 3732985..8b11d95 100644 --- a/plugin-clock/translations/clock_pt_BR.ts +++ b/plugin-clock/translations/clock_pt_BR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Itálico - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ro_RO.desktop b/plugin-clock/translations/clock_ro_RO.desktop index ce729cf..8962abd 100644 --- a/plugin-clock/translations/clock_ro_RO.desktop +++ b/plugin-clock/translations/clock_ro_RO.desktop @@ -8,5 +8,5 @@ Comment=Displays the current time. Comes with a calendar. # Translations -Comment[ro_RO]=Ceas și calendar -Name[ro_RO]=Ceas +Comment[ro_RO]=Afișează ora curentă incluzând și un calendar. +Name[ro_RO]=Data și ora diff --git a/plugin-clock/translations/clock_ro_RO.ts b/plugin-clock/translations/clock_ro_RO.ts index 5903de0..02d159a 100644 --- a/plugin-clock/translations/clock_ro_RO.ts +++ b/plugin-clock/translations/clock_ro_RO.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + <bazat pe localizare> + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Setări ceas @@ -30,42 +38,47 @@ &Use UTC - + &Utilizează UTC Date &format - + &Formatul datei &Do not show date - + &Nu afișa data Show date &before time - + Afișează data &înaintea orei Show date &after time - + Afișează data &după timp Show date below time on new &line - + Afișează data pe un &rând nou sub oră + + + + First day of week in calendar + Prima zi a săptămânii - + Orientation - + Orientare - + Auto&rotate when the panel is vertical - + Rotire automată când panoul e vertical @@ -85,12 +98,12 @@ Afișează data pe rând &nou - + Input custom date format - + Format de dată personalizat - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -110,7 +123,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Secvențe interpretate pentru formatarea datei sunt: + +d numărul zilei fără zero în față (între 1 și 31) +dd numărul zilei cu zero în față (între 01 și 31) +ddd numele abreviat al zilei (de ex. 'Lu' până 'Du'). +dddd numele lung al zilei (de ex. 'Luni' până 'Duminică'). +M numărul lunii fără zero în față (1-12) +MM numărul lunii cu zero în față (01-12) +MMM numele abreviat și localizat al lunii (de ex. 'Ian' - 'Dec'). +MMMM numele lung și localizat al lunii (de ex. 'Ianuarie' - 'December'). +yy anul ca un număr din 2 cifre (00-99) +yyyy anul ca un număr din 4 cifre + +Orice alt caracter introdus va fi tratat ca text. +Orice secvență de caractere intre ghilimele simple (') +vor fi la fel tratate ca text si nu vor fi interpretate in expresie. + + +Format de dată personalizat: diff --git a/plugin-clock/translations/clock_ru.ts b/plugin-clock/translations/clock_ru.ts index 93229f9..a42c171 100644 --- a/plugin-clock/translations/clock_ru.ts +++ b/plugin-clock/translations/clock_ru.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -59,22 +67,27 @@ Показывать дату под временем новой &строкой - + + First day of week in calendar + + + + Orientation Ориентация - + Auto&rotate when the panel is vertical Авто&поворот для вертикальной панели - + Input custom date format Введите свой формат даты - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ru_RU.ts b/plugin-clock/translations/clock_ru_RU.ts index 51a51a0..3a7d645 100644 --- a/plugin-clock/translations/clock_ru_RU.ts +++ b/plugin-clock/translations/clock_ru_RU.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -59,22 +67,27 @@ Показывать дату под временем новой &строкой - + + First day of week in calendar + + + + Orientation Ориентация - + Auto&rotate when the panel is vertical Авто&поворот для вертикальной панели - + Input custom date format Введите свой формат даты - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sk_SK.ts b/plugin-clock/translations/clock_sk_SK.ts index 0aa8fca..7b18d0f 100644 --- a/plugin-clock/translations/clock_sk_SK.ts +++ b/plugin-clock/translations/clock_sk_SK.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Dátum - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sl.ts b/plugin-clock/translations/clock_sl.ts index 38dc1a5..8d4578e 100644 --- a/plugin-clock/translations/clock_sl.ts +++ b/plugin-clock/translations/clock_sl.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Ležeče - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr@latin.ts b/plugin-clock/translations/clock_sr@latin.ts index 0afbda2..e5388d4 100644 --- a/plugin-clock/translations/clock_sr@latin.ts +++ b/plugin-clock/translations/clock_sr@latin.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr_BA.ts b/plugin-clock/translations/clock_sr_BA.ts index 4083314..47959f0 100644 --- a/plugin-clock/translations/clock_sr_BA.ts +++ b/plugin-clock/translations/clock_sr_BA.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -93,12 +106,12 @@ Формат датума - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr_RS.ts b/plugin-clock/translations/clock_sr_RS.ts index 95103bf..0bd4928 100644 --- a/plugin-clock/translations/clock_sr_RS.ts +++ b/plugin-clock/translations/clock_sr_RS.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Датум - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_th_TH.ts b/plugin-clock/translations/clock_th_TH.ts index 0f7da89..82b7b13 100644 --- a/plugin-clock/translations/clock_th_TH.ts +++ b/plugin-clock/translations/clock_th_TH.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ ตัวเอียง - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_tr.ts b/plugin-clock/translations/clock_tr.ts index a41141d..5d767f1 100644 --- a/plugin-clock/translations/clock_tr.ts +++ b/plugin-clock/translations/clock_tr.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Eğik - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_uk.ts b/plugin-clock/translations/clock_uk.ts index 531c003..c209093 100644 --- a/plugin-clock/translations/clock_uk.ts +++ b/plugin-clock/translations/clock_uk.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Нахилений - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_zh_CN.ts b/plugin-clock/translations/clock_zh_CN.ts index eb201f9..93a07c5 100644 --- a/plugin-clock/translations/clock_zh_CN.ts +++ b/plugin-clock/translations/clock_zh_CN.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ 斜体 - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_zh_TW.ts b/plugin-clock/translations/clock_zh_TW.ts index d2d9c90..bc16a59 100644 --- a/plugin-clock/translations/clock_zh_TW.ts +++ b/plugin-clock/translations/clock_zh_TW.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ 斜體 - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-colorpicker/CMakeLists.txt b/plugin-colorpicker/CMakeLists.txt index ae983ba..8d6484e 100644 --- a/plugin-colorpicker/CMakeLists.txt +++ b/plugin-colorpicker/CMakeLists.txt @@ -8,15 +8,10 @@ set(SOURCES colorpicker.cpp ) -set(MOCS - colorpicker.h -) - set(UIS "") set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-colorpicker/colorpicker.cpp b/plugin-colorpicker/colorpicker.cpp index 305cb42..e5da880 100644 --- a/plugin-colorpicker/colorpicker.cpp +++ b/plugin-colorpicker/colorpicker.cpp @@ -25,10 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "colorpicker.h" #include #include -#include "colorpicker.h" ColorPicker::ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo) : QObject(), @@ -37,6 +37,7 @@ ColorPicker::ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo) : realign(); } + ColorPicker::~ColorPicker() { } @@ -69,10 +70,12 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent): } + ColorPickerWidget::~ColorPickerWidget() { } + void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) { if (!mCapturing) @@ -90,6 +93,7 @@ void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) releaseMouse(); } + void ColorPickerWidget::captureMouse() { grabMouse(Qt::CrossCursor); diff --git a/plugin-colorpicker/colorpicker.h b/plugin-colorpicker/colorpicker.h index 7d249de..de63a48 100644 --- a/plugin-colorpicker/colorpicker.h +++ b/plugin-colorpicker/colorpicker.h @@ -28,14 +28,13 @@ #ifndef LXQT_COLORPICKER_H #define LXQT_COLORPICKER_H +#include "../panel/ilxqtpanelplugin.h" #include -#include #include +#include +#include #include #include -#include - -#include "../panel/ilxqtpanelplugin.h" #include @@ -87,7 +86,7 @@ class ColorPickerLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new ColorPicker(startupInfo); } diff --git a/plugin-colorpicker/translations/colorpicker_de.desktop b/plugin-colorpicker/translations/colorpicker_de.desktop new file mode 100644 index 0000000..cc441ce --- /dev/null +++ b/plugin-colorpicker/translations/colorpicker_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Farbwähler +Comment[de]=Wählt Farbe unter dem Cursor. Für Webentwickler. diff --git a/plugin-colorpicker/translations/colorpicker_hu.desktop b/plugin-colorpicker/translations/colorpicker_hu.desktop new file mode 100644 index 0000000..4ac60b7 --- /dev/null +++ b/plugin-colorpicker/translations/colorpicker_hu.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Color picker +Comment=Get the color under the cursor. For web developers. + + +# Translations +Comment[hu]=Színszippantó. Fejlesztőknek. +Name[hu]=Színválasztó diff --git a/plugin-colorpicker/translations/colorpicker_pl_PL.desktop b/plugin-colorpicker/translations/colorpicker_pl_PL.desktop index 36fd463..54f8b77 100644 --- a/plugin-colorpicker/translations/colorpicker_pl_PL.desktop +++ b/plugin-colorpicker/translations/colorpicker_pl_PL.desktop @@ -6,5 +6,5 @@ Comment=Get the color under the cursor. For web developers. # Translations -Comment[pl_PL]=Otrzymaj kolor z pod kursora. Dla webdeveloperów. +Comment[pl_PL]=Pobierz kolor spod kursora. Dla webdeveloperów. Name[pl_PL]=Wybieracz kolorów diff --git a/plugin-cpuload/CMakeLists.txt b/plugin-cpuload/CMakeLists.txt index 1a4880e..4017b67 100644 --- a/plugin-cpuload/CMakeLists.txt +++ b/plugin-cpuload/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtcpuloadconfiguration.cpp ) -set(MOCS - lxqtcpuloadplugin.h - lxqtcpuload.h - lxqtcpuloadconfiguration.h -) - set(UIS lxqtcpuloadconfiguration.ui ) diff --git a/plugin-cpuload/lxqtcpuload.cpp b/plugin-cpuload/lxqtcpuload.cpp index 97c5184..1e08ac3 100644 --- a/plugin-cpuload/lxqtcpuload.cpp +++ b/plugin-cpuload/lxqtcpuload.cpp @@ -50,94 +50,98 @@ extern "C" { LxQtCpuLoad::LxQtCpuLoad(ILxQtPanelPlugin* plugin, QWidget* parent): QFrame(parent), mPlugin(plugin), - m_showText(false), + m_showText(false), + m_barWidth(20), m_barOrientation(TopDownBar), m_timerID(-1) { setObjectName("LxQtCpuLoad"); QHBoxLayout *layout = new QHBoxLayout(this); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(&m_stuff); - /* Initialise statgrab */ + /* Initialise statgrab */ #ifdef STATGRAB_NEWER_THAN_0_90 - sg_init(0); + sg_init(0); #else - sg_init(); + sg_init(); #endif - /* Drop setuid/setgid privileges. */ - if (sg_drop_privileges() != 0) { - perror("Error. Failed to drop privileges"); - } + /* Drop setuid/setgid privileges. */ + if (sg_drop_privileges() != 0) { + perror("Error. Failed to drop privileges"); + } - m_font.setPointSizeF(8); + m_font.setPointSizeF(8); - settingsChanged(); + settingsChanged(); } LxQtCpuLoad::~LxQtCpuLoad() { } -void LxQtCpuLoad::resizeEvent(QResizeEvent *) +void LxQtCpuLoad::setSizes() { if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) { - m_stuff.setMinimumHeight(18); - m_stuff.setMaximumHeight(18); + m_stuff.setFixedHeight(m_barWidth); m_stuff.setMinimumWidth(24); } else { - m_stuff.setMinimumWidth(18); - m_stuff.setMaximumWidth(18); + m_stuff.setFixedWidth(m_barWidth); m_stuff.setMinimumHeight(24); } +} - update(); +void LxQtCpuLoad::resizeEvent(QResizeEvent *) +{ + setSizes(); + update(); } double LxQtCpuLoad::getLoadCpu() const { - #ifdef STATGRAB_NEWER_THAN_0_90 - size_t count; - sg_cpu_percents* cur = sg_get_cpu_percents(&count); +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t count; + sg_cpu_percents* cur = sg_get_cpu_percents(&count); #else - sg_cpu_percents* cur = sg_get_cpu_percents(); + sg_cpu_percents* cur = sg_get_cpu_percents(); #endif - return (cur->user + cur->kernel + cur->nice); + return (cur->user + cur->kernel + cur->nice); } void LxQtCpuLoad::timerEvent(QTimerEvent *event) { - double avg = getLoadCpu(); - if ( qAbs(m_avg-avg)>1 ) - { - m_avg = avg; + double avg = getLoadCpu(); + if ( qAbs(m_avg-avg)>1 ) + { + m_avg = avg; setToolTip(tr("CPU load %1%").arg(m_avg)); - update(); - } + update(); + } } void LxQtCpuLoad::paintEvent ( QPaintEvent * ) { - QPainter p(this); - QPen pen; - pen.setWidth(2); - p.setPen(pen); - p.setRenderHint(QPainter::Antialiasing, true); - const double w = 20; + QPainter p(this); + QPen pen; + pen.setWidth(2); + p.setPen(pen); + p.setRenderHint(QPainter::Antialiasing, true); - p.setFont(m_font); - QRectF r = rect(); + p.setFont(m_font); + QRectF r = rect(); QRectF r1; QLinearGradient shade(0,0,1,1); if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) { - float vo = (r.height() - w )/2.0; + float vo = (r.height() - static_cast(m_barWidth))/2.0; float ho = r.width()*(1-m_avg*0.01); if (m_barOrientation == RightToLeftBar) @@ -153,7 +157,7 @@ void LxQtCpuLoad::paintEvent ( QPaintEvent * ) else // BottomUpBar || TopDownBar { float vo = r.height()*(1-m_avg*0.01); - float ho = (r.width() - w )/2.0; + float ho = (r.width() - static_cast(m_barWidth) )/2.0; if (m_barOrientation == TopDownBar) { @@ -166,14 +170,14 @@ void LxQtCpuLoad::paintEvent ( QPaintEvent * ) shade.setFinalStop(r1.width(), 0); } - shade.setSpread(QLinearGradient::ReflectSpread); - shade.setColorAt(0, QColor(0, 196, 0, 128)); - shade.setColorAt(0.5, QColor(0, 128, 0, 255) ); - shade.setColorAt(1, QColor(0, 196, 0 , 128)); + shade.setSpread(QLinearGradient::ReflectSpread); + shade.setColorAt(0, QColor(0, 196, 0, 128)); + shade.setColorAt(0.5, QColor(0, 128, 0, 255) ); + shade.setColorAt(1, QColor(0, 196, 0 , 128)); - p.fillRect(r1, shade); + p.fillRect(r1, shade); - if (m_showText) + if (m_showText) { p.setPen(fontColor); p.drawText(rect(), Qt::AlignCenter, QString::number(m_avg)); @@ -187,6 +191,7 @@ void LxQtCpuLoad::settingsChanged() killTimer(m_timerID); m_showText = mPlugin->settings()->value("showText", false).toBool(); + m_barWidth = mPlugin->settings()->value("barWidth", 20).toInt(); m_updateInterval = mPlugin->settings()->value("updateInterval", 1000).toInt(); QString barOrientation = mPlugin->settings()->value("barOrientation", BAR_ORIENT_BOTTOMUP).toString(); @@ -199,6 +204,7 @@ void LxQtCpuLoad::settingsChanged() else m_barOrientation = BottomUpBar; - m_timerID = startTimer(m_updateInterval); - update(); + m_timerID = startTimer(m_updateInterval); + setSizes(); + update(); } diff --git a/plugin-cpuload/lxqtcpuload.h b/plugin-cpuload/lxqtcpuload.h index f16c324..ca35e1d 100644 --- a/plugin-cpuload/lxqtcpuload.h +++ b/plugin-cpuload/lxqtcpuload.h @@ -33,8 +33,8 @@ class ILxQtPanelPlugin; class LxQtCpuLoad: public QFrame { - Q_OBJECT - + Q_OBJECT + Q_PROPERTY(QColor fontColor READ getFontColor WRITE setFontColor) public: @@ -49,7 +49,7 @@ public: }; LxQtCpuLoad(ILxQtPanelPlugin *plugin, QWidget* parent = 0); - ~LxQtCpuLoad(); + ~LxQtCpuLoad(); void settingsChanged(); @@ -58,26 +58,28 @@ public: QColor getFontColor() const { return fontColor; } protected: - void virtual timerEvent(QTimerEvent *event); - void virtual paintEvent ( QPaintEvent * event ); - void virtual resizeEvent(QResizeEvent *); + void virtual timerEvent(QTimerEvent *event); + void virtual paintEvent ( QPaintEvent * event ); + void virtual resizeEvent(QResizeEvent *); private: - double getLoadCpu() const; + double getLoadCpu() const; + void setSizes(); ILxQtPanelPlugin *mPlugin; - QWidget m_stuff; + QWidget m_stuff; - //! average load - int m_avg; + //! average load + int m_avg; - bool m_showText; + bool m_showText; + int m_barWidth; BarOrientation m_barOrientation; int m_updateInterval; int m_timerID; - QFont m_font; - + QFont m_font; + QColor fontColor; }; diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.cpp b/plugin-cpuload/lxqtcpuloadconfiguration.cpp index 7f507e2..c52e1a2 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.cpp +++ b/plugin-cpuload/lxqtcpuloadconfiguration.cpp @@ -34,24 +34,26 @@ #define BAR_ORIENT_RIGHTLEFT "rightLeft" LxQtCpuLoadConfiguration::LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent) : - QDialog(parent), - ui(new Ui::LxQtCpuLoadConfiguration), - mSettings(settings), - mOldSettings(settings) + QDialog(parent), + ui(new Ui::LxQtCpuLoadConfiguration), + mSettings(settings), + mOldSettings(settings) { - setAttribute(Qt::WA_DeleteOnClose); - setObjectName("CpuLoadConfigurationWindow"); - ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("CpuLoadConfigurationWindow"); + ui->setupUi(this); fillBarOrientations(); - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); - loadSettings(); + loadSettings(); - connect(ui->showTextCB, SIGNAL(toggled(bool)), + connect(ui->showTextCB, SIGNAL(toggled(bool)), this, SLOT(showTextChanged(bool))); + connect(ui->barWidthSB, SIGNAL(valueChanged(int)), + this, SLOT(barWidthChanged(int))); connect(ui->updateIntervalSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateIntervalChanged(double))); connect(ui->barOrientationCOB, SIGNAL(currentIndexChanged(int)), @@ -60,7 +62,7 @@ LxQtCpuLoadConfiguration::LxQtCpuLoadConfiguration(QSettings *settings, QWidget LxQtCpuLoadConfiguration::~LxQtCpuLoadConfiguration() { - delete ui; + delete ui; } void LxQtCpuLoadConfiguration::fillBarOrientations() @@ -74,6 +76,7 @@ void LxQtCpuLoadConfiguration::fillBarOrientations() void LxQtCpuLoadConfiguration::loadSettings() { ui->showTextCB->setChecked(mSettings->value("showText", false).toBool()); + ui->barWidthSB->setValue(mSettings->value("barWidth", 20).toInt()); ui->updateIntervalSpinBox->setValue(mSettings->value("updateInterval", 1000).toInt() / 1000.0); int boIndex = ui->barOrientationCOB->findData( @@ -95,6 +98,10 @@ void LxQtCpuLoadConfiguration::showTextChanged(bool value) mSettings->setValue("showText", value); } +void LxQtCpuLoadConfiguration::barWidthChanged(int value) +{ + mSettings->setValue("barWidth", value); +} void LxQtCpuLoadConfiguration::updateIntervalChanged(double value) { @@ -108,14 +115,14 @@ void LxQtCpuLoadConfiguration::barOrientationChanged(int index) void LxQtCpuLoadConfiguration::dialogButtonsAction(QAbstractButton *btn) { - if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) - { - mOldSettings.loadToSettings(); - loadSettings(); - } - else - { - close(); - } + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } } diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.h b/plugin-cpuload/lxqtcpuloadconfiguration.h index 3a0116e..c1a4336 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.h +++ b/plugin-cpuload/lxqtcpuloadconfiguration.h @@ -37,21 +37,21 @@ class QSettings; class QAbstractButton; namespace Ui { - class LxQtCpuLoadConfiguration; + class LxQtCpuLoadConfiguration; } class LxQtCpuLoadConfiguration : public QDialog { - Q_OBJECT + Q_OBJECT public: explicit LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent = 0); - ~LxQtCpuLoadConfiguration(); + ~LxQtCpuLoadConfiguration(); private: - Ui::LxQtCpuLoadConfiguration *ui; + Ui::LxQtCpuLoadConfiguration *ui; QSettings *mSettings; - LxQt::SettingsCache mOldSettings; + LxQt::SettingsCache mOldSettings; /* Fills Bar orientation combobox @@ -59,12 +59,13 @@ private: void fillBarOrientations(); private slots: - /* - Saves settings in conf file. - */ - void loadSettings(); - void dialogButtonsAction(QAbstractButton *btn); - void showTextChanged(bool value); + /* + Saves settings in conf file. + */ + void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void showTextChanged(bool value); + void barWidthChanged(int value); void updateIntervalChanged(double value); void barOrientationChanged(int index); diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.ui b/plugin-cpuload/lxqtcpuloadconfiguration.ui index 85fbf0c..b578503 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.ui +++ b/plugin-cpuload/lxqtcpuloadconfiguration.ui @@ -75,6 +75,26 @@ + + + + Bar width: + + + + + + + 4 + + + 2048 + + + 20 + + + diff --git a/plugin-cpuload/lxqtcpuloadplugin.cpp b/plugin-cpuload/lxqtcpuloadplugin.cpp index 1019566..24c16ef 100644 --- a/plugin-cpuload/lxqtcpuloadplugin.cpp +++ b/plugin-cpuload/lxqtcpuloadplugin.cpp @@ -57,7 +57,7 @@ QWidget *LxQtCpuLoadPlugin::widget() QDialog *LxQtCpuLoadPlugin::configureDialog() { - return new LxQtCpuLoadConfiguration(settings(), mContent); + return new LxQtCpuLoadConfiguration(settings()); } void LxQtCpuLoadPlugin::settingsChanged() diff --git a/plugin-cpuload/lxqtcpuloadplugin.h b/plugin-cpuload/lxqtcpuloadplugin.h index a205a5c..9f60712 100644 --- a/plugin-cpuload/lxqtcpuloadplugin.h +++ b/plugin-cpuload/lxqtcpuloadplugin.h @@ -63,7 +63,7 @@ class LxQtCpuLoadPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtCpuLoadPlugin(startupInfo); } diff --git a/plugin-cpuload/translations/cpuload.ts b/plugin-cpuload/translations/cpuload.ts index 3c6bd00..24f94e7 100644 --- a/plugin-cpuload/translations/cpuload.ts +++ b/plugin-cpuload/translations/cpuload.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_ar.ts b/plugin-cpuload/translations/cpuload_ar.ts index 668e879..21c7afa 100644 --- a/plugin-cpuload/translations/cpuload_ar.ts +++ b/plugin-cpuload/translations/cpuload_ar.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_cs.ts b/plugin-cpuload/translations/cpuload_cs.ts index 50a1257..f2a68b6 100644 --- a/plugin-cpuload/translations/cpuload_cs.ts +++ b/plugin-cpuload/translations/cpuload_cs.ts @@ -8,7 +8,7 @@ Vytížení procesoru %1% - + CPU load %1% @@ -50,22 +50,27 @@ Směr pruhu - + + Bar width: + + + + Bottom up Zdola nahoru - + Top down Shora dolů - + Left to right Zleva doprava - + Right to left Zprava doleva diff --git a/plugin-cpuload/translations/cpuload_cs_CZ.ts b/plugin-cpuload/translations/cpuload_cs_CZ.ts index 65afbb2..4353ca8 100644 --- a/plugin-cpuload/translations/cpuload_cs_CZ.ts +++ b/plugin-cpuload/translations/cpuload_cs_CZ.ts @@ -8,7 +8,7 @@ Vytížení procesoru %1% - + CPU load %1% @@ -50,22 +50,27 @@ Směr pruhu - + + Bar width: + + + + Bottom up Zdola nahoru - + Top down Shora dolů - + Left to right Zleva doprava - + Right to left Zprava doleva diff --git a/plugin-cpuload/translations/cpuload_da_DK.ts b/plugin-cpuload/translations/cpuload_da_DK.ts index 12bc305..85f499f 100644 --- a/plugin-cpuload/translations/cpuload_da_DK.ts +++ b/plugin-cpuload/translations/cpuload_da_DK.ts @@ -8,7 +8,7 @@ CPU belastning %1% - + CPU load %1% @@ -50,22 +50,27 @@ Bjælkens orientering: - + + Bar width: + + + + Bottom up Nedefra - + Top down Oppefra - + Left to right Venstre mod højre - + Right to left Højre mod venstre diff --git a/plugin-cpuload/translations/cpuload_de.desktop b/plugin-cpuload/translations/cpuload_de.desktop index 6d216d5..11579ac 100644 --- a/plugin-cpuload/translations/cpuload_de.desktop +++ b/plugin-cpuload/translations/cpuload_de.desktop @@ -1,13 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Cpu monitor -Comment=Displays the current CPU load. - - - - -# Translations -Comment[de]=Prozesslast-Monitor -Name[de]=Prozessauslastung +Name[de]=Prozessorauslastung +Comment[de]=Prozessorlast-Monitor diff --git a/plugin-cpuload/translations/cpuload_de.ts b/plugin-cpuload/translations/cpuload_de.ts index f3c6733..f1dc15b 100644 --- a/plugin-cpuload/translations/cpuload_de.ts +++ b/plugin-cpuload/translations/cpuload_de.ts @@ -4,25 +4,17 @@ LxQtCpuLoad - Cpu load %1% - Prozessorauslastung %1% - - - + CPU load %1% - + Prozessorauslastung %1% LxQtCpuLoadConfiguration - - LxQt Cpu Load settings - LxQt Prozessorauslastung Einstellungen - CPU Load Settings - + Einstellungen zur Prozessorlast-Anzeige @@ -42,30 +34,35 @@ sec - Sek. + s Bar orientation: - Anzeigeausrichtung: + Balkenrichtung: + + + + Bar width: + Balkenbreite: - + Bottom up von unten nach oben - + Top down von oben nach unten - + Left to right von links nach rechts - + Right to left von rechts nach links diff --git a/plugin-cpuload/translations/cpuload_el_GR.ts b/plugin-cpuload/translations/cpuload_el_GR.ts index 4925099..f0f61cd 100644 --- a/plugin-cpuload/translations/cpuload_el_GR.ts +++ b/plugin-cpuload/translations/cpuload_el_GR.ts @@ -8,7 +8,7 @@ Φορτίο ΚΜΕ %1% - + CPU load %1% @@ -50,22 +50,27 @@ Προσανατολισμός γραμμής: - + + Bar width: + + + + Bottom up Κάτω προς τα πάνω - + Top down Πάνω προς τα κάτω - + Left to right Αριστερά προς δεξιά - + Right to left Δεξιά προς αριστερά diff --git a/plugin-cpuload/translations/cpuload_eo.ts b/plugin-cpuload/translations/cpuload_eo.ts index 9814a82..9ae1913 100644 --- a/plugin-cpuload/translations/cpuload_eo.ts +++ b/plugin-cpuload/translations/cpuload_eo.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_es.ts b/plugin-cpuload/translations/cpuload_es.ts index 30e3363..e005744 100644 --- a/plugin-cpuload/translations/cpuload_es.ts +++ b/plugin-cpuload/translations/cpuload_es.ts @@ -8,7 +8,7 @@ Carga de CPU %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientación de la barra: - + + Bar width: + + + + Bottom up De Abajo hacia Arriba - + Top down De Arriba hacia Abajo - + Left to right De Izquierda a Derecha - + Right to left De Derecha a Izquierda diff --git a/plugin-cpuload/translations/cpuload_es_VE.ts b/plugin-cpuload/translations/cpuload_es_VE.ts index a05394b..16bdb99 100644 --- a/plugin-cpuload/translations/cpuload_es_VE.ts +++ b/plugin-cpuload/translations/cpuload_es_VE.ts @@ -8,7 +8,7 @@ Cpu al %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientacion barra - + + Bar width: + + + + Bottom up Abajo a Arriba - + Top down Arriba a abajo - + Left to right Izquierda a derecha - + Right to left Derecha a izquierda diff --git a/plugin-cpuload/translations/cpuload_eu.ts b/plugin-cpuload/translations/cpuload_eu.ts index aaca681..5450df6 100644 --- a/plugin-cpuload/translations/cpuload_eu.ts +++ b/plugin-cpuload/translations/cpuload_eu.ts @@ -8,7 +8,7 @@ PUZaren karga %%1 - + CPU load %1% @@ -50,22 +50,27 @@ Barraren orientazioa: - + + Bar width: + + + + Bottom up Behetik gora - + Top down Goitik behera - + Left to right Ezkerretik eskuinera - + Right to left Eskuinetik ezkerrera diff --git a/plugin-cpuload/translations/cpuload_fi.ts b/plugin-cpuload/translations/cpuload_fi.ts index de1a719..bb69382 100644 --- a/plugin-cpuload/translations/cpuload_fi.ts +++ b/plugin-cpuload/translations/cpuload_fi.ts @@ -8,7 +8,7 @@ Suoritinkuorma %1% - + CPU load %1% @@ -50,22 +50,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_fr_FR.ts b/plugin-cpuload/translations/cpuload_fr_FR.ts index 345f7f0..5d8199f 100644 --- a/plugin-cpuload/translations/cpuload_fr_FR.ts +++ b/plugin-cpuload/translations/cpuload_fr_FR.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_hr.ts b/plugin-cpuload/translations/cpuload_hr.ts new file mode 100644 index 0000000..12ae080 --- /dev/null +++ b/plugin-cpuload/translations/cpuload_hr.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Učitavanje procesora %1 + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Postavke učitavanja procesora + + + + General + Općenito + + + + Show text + Pokaži tekst + + + + Update interval: + Interval ažuriranja: + + + + sec + sek + + + + Bar orientation: + Orijentacija trake: + + + + Bar width: + Duljina trake: + + + + Bottom up + Odozdo gore + + + + Top down + Odozgo dolje + + + + Left to right + S lijeva na desno + + + + Right to left + S desna na lijevo + + + diff --git a/plugin-cpuload/translations/cpuload_hu.ts b/plugin-cpuload/translations/cpuload_hu.ts new file mode 100644 index 0000000..e7f92b8 --- /dev/null +++ b/plugin-cpuload/translations/cpuload_hu.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + + + + + General + Általános + + + + Show text + Szöveg megjelenítése + + + + Update interval: + Frissítési köz: + + + + sec + mp + + + + Bar orientation: + Sáv irány: + + + + Bar width: + Sáv szélesség: + + + + Bottom up + Felfele + + + + Top down + Lefele + + + + Left to right + Jobbra + + + + Right to left + Balra + + + diff --git a/plugin-cpuload/translations/cpuload_hu_HU.ts b/plugin-cpuload/translations/cpuload_hu_HU.ts index 7683cac..62ec026 100644 --- a/plugin-cpuload/translations/cpuload_hu_HU.ts +++ b/plugin-cpuload/translations/cpuload_hu_HU.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -29,37 +29,42 @@ Update interval: - + Frissítési köz: sec - + mp Bar orientation: - + Sáv irány: - + + Bar width: + Sáv szélesség: + + + Bottom up - + Felfele - + Top down - + Lefele - + Left to right - + Jobbra - + Right to left - + Balra diff --git a/plugin-cpuload/translations/cpuload_it_IT.ts b/plugin-cpuload/translations/cpuload_it_IT.ts index f90b0b0..5d46003 100644 --- a/plugin-cpuload/translations/cpuload_it_IT.ts +++ b/plugin-cpuload/translations/cpuload_it_IT.ts @@ -8,7 +8,7 @@ Carico del processore %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientamento della barra: - + + Bar width: + + + + Bottom up Dal basso all'alto - + Top down Dall'alto al basso - + Left to right Da sinistra a destra - + Right to left Da destra a sinistra diff --git a/plugin-cpuload/translations/cpuload_ja.ts b/plugin-cpuload/translations/cpuload_ja.ts index 8deb413..b86f71b 100644 --- a/plugin-cpuload/translations/cpuload_ja.ts +++ b/plugin-cpuload/translations/cpuload_ja.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% CPU負荷 %1% @@ -42,22 +42,27 @@ バーの向き: - + + Bar width: + + + + Bottom up 下から上へ - + Top down 上から下へ - + Left to right 左から右へ - + Right to left 右から左へ diff --git a/plugin-cpuload/translations/cpuload_lt.ts b/plugin-cpuload/translations/cpuload_lt.ts index acec6ae..ffd5557 100644 --- a/plugin-cpuload/translations/cpuload_lt.ts +++ b/plugin-cpuload/translations/cpuload_lt.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_nl.ts b/plugin-cpuload/translations/cpuload_nl.ts index 08c5bfa..b7bc8eb 100644 --- a/plugin-cpuload/translations/cpuload_nl.ts +++ b/plugin-cpuload/translations/cpuload_nl.ts @@ -8,7 +8,7 @@ Cpu-belasting %1% - + CPU load %1% @@ -50,22 +50,27 @@ Balkoriëntatie: - + + Bar width: + + + + Bottom up Van beneden naar boven - + Top down Van boven naar beneden - + Left to right Van links naar rechts - + Right to left Van rechts naar links diff --git a/plugin-cpuload/translations/cpuload_pl_PL.ts b/plugin-cpuload/translations/cpuload_pl_PL.ts index 8a0c975..9ebbfab 100644 --- a/plugin-cpuload/translations/cpuload_pl_PL.ts +++ b/plugin-cpuload/translations/cpuload_pl_PL.ts @@ -8,9 +8,9 @@ Obciążenie CPU %1% - + CPU load %1% - + Obciążenie procesora %1% @@ -22,7 +22,7 @@ CPU Load Settings - + Obciążenie procesora - ustawienia @@ -50,22 +50,27 @@ Orientacja paska stanu - + + Bar width: + + + + Bottom up Z dołu do góry - + Top down Z góry na dół - + Left to right Lewo na prawo - + Right to left Prawo na lewo diff --git a/plugin-cpuload/translations/cpuload_pt.ts b/plugin-cpuload/translations/cpuload_pt.ts index dc1b188..1061704 100644 --- a/plugin-cpuload/translations/cpuload_pt.ts +++ b/plugin-cpuload/translations/cpuload_pt.ts @@ -8,7 +8,7 @@ Carga do cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientação da barra: - + + Bar width: + + + + Bottom up De baixo para cima - + Top down De cima para baixo - + Left to right Da esquerda para a direita - + Right to left Da direita para a esquerda diff --git a/plugin-cpuload/translations/cpuload_pt_BR.ts b/plugin-cpuload/translations/cpuload_pt_BR.ts index 00caf8a..c3b67e7 100644 --- a/plugin-cpuload/translations/cpuload_pt_BR.ts +++ b/plugin-cpuload/translations/cpuload_pt_BR.ts @@ -8,7 +8,7 @@ Carga da Cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientação da barra: - + + Bar width: + + + + Bottom up De baixo para cima - + Top down De cima para baixo - + Left to right Da esquerda para a direita - + Right to left Da direita para a esquerda diff --git a/plugin-cpuload/translations/cpuload_ro_RO.desktop b/plugin-cpuload/translations/cpuload_ro_RO.desktop index 5e01855..d0cdb2d 100644 --- a/plugin-cpuload/translations/cpuload_ro_RO.desktop +++ b/plugin-cpuload/translations/cpuload_ro_RO.desktop @@ -10,4 +10,4 @@ Comment=Displays the current CPU load. # Translations Comment[ro_RO]=Monitor de încărcare a procesorului -Name[ro_RO]=Grad de încărcare al procesorului +Name[ro_RO]=Afișează gradul de încărcare al procesorului diff --git a/plugin-cpuload/translations/cpuload_ro_RO.ts b/plugin-cpuload/translations/cpuload_ro_RO.ts index 2c73400..2709dad 100644 --- a/plugin-cpuload/translations/cpuload_ro_RO.ts +++ b/plugin-cpuload/translations/cpuload_ro_RO.ts @@ -8,9 +8,9 @@ Încărcare procesor %1% - + CPU load %1% - + Încărcare procesor @@ -22,7 +22,7 @@ CPU Load Settings - + Setări încărcare procesor @@ -50,22 +50,27 @@ Orientare bară: - + + Bar width: + Lățime bară: + + + Bottom up De jos în sus - + Top down De sus în jos - + Left to right De la stânga la dreapta - + Right to left De la dreapta la stânga diff --git a/plugin-cpuload/translations/cpuload_ru.ts b/plugin-cpuload/translations/cpuload_ru.ts index f2dc482..31ab786 100644 --- a/plugin-cpuload/translations/cpuload_ru.ts +++ b/plugin-cpuload/translations/cpuload_ru.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% Загрузка процессора %1% @@ -42,22 +42,27 @@ Расположение панели: - + + Bar width: + + + + Bottom up Снизу вверх - + Top down Сверху вниз - + Left to right Слева направо - + Right to left Справа налево diff --git a/plugin-cpuload/translations/cpuload_ru_RU.ts b/plugin-cpuload/translations/cpuload_ru_RU.ts index 14f211e..b40c0ff 100644 --- a/plugin-cpuload/translations/cpuload_ru_RU.ts +++ b/plugin-cpuload/translations/cpuload_ru_RU.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% Загрузка процессора %1% @@ -42,22 +42,27 @@ Расположение панели: - + + Bar width: + + + + Bottom up Снизу вверх - + Top down Сверху вниз - + Left to right Слева направо - + Right to left Справа налево diff --git a/plugin-cpuload/translations/cpuload_sl.ts b/plugin-cpuload/translations/cpuload_sl.ts index 6e16702..99a7356 100644 --- a/plugin-cpuload/translations/cpuload_sl.ts +++ b/plugin-cpuload/translations/cpuload_sl.ts @@ -8,7 +8,7 @@ Uporaba CPE: %1 % - + CPU load %1% @@ -50,22 +50,27 @@ Usmerjenost vrstice: - + + Bar width: + + + + Bottom up Od spodaj navzgor - + Top down Od zgoraj navzdol - + Left to right Iz leve proti desni - + Right to left Iz desne proti levi diff --git a/plugin-cpuload/translations/cpuload_th_TH.ts b/plugin-cpuload/translations/cpuload_th_TH.ts index 6ec9922..0345d68 100644 --- a/plugin-cpuload/translations/cpuload_th_TH.ts +++ b/plugin-cpuload/translations/cpuload_th_TH.ts @@ -8,7 +8,7 @@ Cpu โหลด %1% - + CPU load %1% @@ -50,22 +50,27 @@ การจัดเรียง: - + + Bar width: + + + + Bottom up ล่างขึ้นบน - + Top down บนลงล่าง - + Left to right ซ้ายไปขวา - + Right to left ขวาไปซ้าย diff --git a/plugin-cpuload/translations/cpuload_tr.ts b/plugin-cpuload/translations/cpuload_tr.ts index f5dcd03..602b644 100644 --- a/plugin-cpuload/translations/cpuload_tr.ts +++ b/plugin-cpuload/translations/cpuload_tr.ts @@ -8,7 +8,7 @@ İşlemci yükü %1% - + CPU load %1% @@ -50,22 +50,27 @@ Çubuk yönelimi: - + + Bar width: + + + + Bottom up Aşağıdan yukarı - + Top down Yukarıdan aşağı - + Left to right Soldan sağa - + Right to left Sağdan sola diff --git a/plugin-cpuload/translations/cpuload_uk.ts b/plugin-cpuload/translations/cpuload_uk.ts index 3e13478..2145c8e 100644 --- a/plugin-cpuload/translations/cpuload_uk.ts +++ b/plugin-cpuload/translations/cpuload_uk.ts @@ -8,7 +8,7 @@ Завантаження Cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Напрямок планки: - + + Bar width: + + + + Bottom up Знизу вверх - + Top down Зверху вниз - + Left to right Зліва направо - + Right to left Зправа наліво diff --git a/plugin-cpuload/translations/cpuload_zh_CN.ts b/plugin-cpuload/translations/cpuload_zh_CN.ts index 9448095..149c8f8 100644 --- a/plugin-cpuload/translations/cpuload_zh_CN.ts +++ b/plugin-cpuload/translations/cpuload_zh_CN.ts @@ -8,7 +8,7 @@ Cpu 负载 %1% - + CPU load %1% @@ -50,22 +50,27 @@ 状态栏方向: - + + Bar width: + + + + Bottom up 自下而上 - + Top down 自上而下 - + Left to right 从左到右 - + Right to left 从右到左 diff --git a/plugin-cpuload/translations/cpuload_zh_TW.ts b/plugin-cpuload/translations/cpuload_zh_TW.ts index 52054bc..b3893db 100644 --- a/plugin-cpuload/translations/cpuload_zh_TW.ts +++ b/plugin-cpuload/translations/cpuload_zh_TW.ts @@ -8,7 +8,7 @@ CPU使用率 %1% - + CPU load %1% @@ -50,22 +50,27 @@ 進度條方向 - + + Bar width: + + + + Bottom up 由下至上 - + Top down 由上至下 - + Left to right 由左至右 - + Right to left 由右至左 diff --git a/plugin-desktopswitch/CMakeLists.txt b/plugin-desktopswitch/CMakeLists.txt index dbb3ae7..6f3b792 100644 --- a/plugin-desktopswitch/CMakeLists.txt +++ b/plugin-desktopswitch/CMakeLists.txt @@ -1,20 +1,22 @@ set(PLUGIN "desktopswitch") set(HEADERS - desktopswitch.h + desktopswitch.h desktopswitchbutton.h + desktopswitchconfiguration.h ) set(SOURCES desktopswitch.cpp desktopswitchbutton.cpp + desktopswitchconfiguration.cpp ) -set(MOCS - desktopswitch.h - desktopswitchbutton.h +set(UIS + desktopswitchconfiguration.ui ) -set(LIBRARIES ${LIBRARIES} ${LXQT_LIBRARIES} ${LXQT_GLOBALKEYS_LIBRARIES} ) + +set(LIBRARIES ${LIBRARIES} lxqt lxqt-globalkeys) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-desktopswitch/desktopswitch.cpp b/plugin-desktopswitch/desktopswitch.cpp index dfe4217..26c9434 100644 --- a/plugin-desktopswitch/desktopswitch.cpp +++ b/plugin-desktopswitch/desktopswitch.cpp @@ -30,69 +30,139 @@ #include #include #include +#include #include #include -#include +#include +#include +#include -#include #include "desktopswitch.h" #include "desktopswitchbutton.h" +#include "desktopswitchconfiguration.h" + +#define DEFAULT_SHORTCUT_TEMPLATE QStringLiteral("Control+F%1") DesktopSwitch::DesktopSwitch(const ILxQtPanelPluginStartupInfo &startupInfo) : QObject(), ILxQtPanelPlugin(startupInfo), m_pSignalMapper(new QSignalMapper(this)), - m_desktopCount(KWindowSystem::numberOfDesktops()) + m_desktopCount(KWindowSystem::numberOfDesktops()), + mRows(-1), + mDesktops(new NETRootInfo(QX11Info::connection(), NET::NumberOfDesktops | NET::CurrentDesktop | NET::DesktopNames, NET::WM2DesktopLayout)), + mLabelType(static_cast(-1)) { m_buttons = new QButtonGroup(this); connect (m_pSignalMapper, SIGNAL(mapped(int)), this, SLOT(setDesktop(int))); mLayout = new LxQt::GridLayout(&mWidget); mWidget.setLayout(mLayout); - setup(); + + settingsChanged(); + + onCurrentDesktopChanged(KWindowSystem::currentDesktop()); + QTimer::singleShot(0, this, SLOT(registerShortcuts())); + + connect(m_buttons, SIGNAL(buttonClicked(int)), this, SLOT(setDesktop(int))); connect(KWindowSystem::self(), SIGNAL(numberOfDesktopsChanged(int)), SLOT(onNumberOfDesktopsChanged(int))); connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), SLOT(onCurrentDesktopChanged(int))); connect(KWindowSystem::self(), SIGNAL(desktopNamesChanged()), SLOT(onDesktopNamesChanged())); + + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged), + this, &DesktopSwitch::onWindowChanged); } -void DesktopSwitch::setup() +void DesktopSwitch::registerShortcuts() { - // clear current state - foreach (QAbstractButton * b, m_buttons->buttons()) + // Register shortcuts to change desktop + GlobalKeyShortcut::Action * gshortcut; + QString path; + QString description; + for (int i = 0; i < 12; ++i) { - // TODO/FIXME: maybe it has to be removed from layout too? - m_pSignalMapper->removeMappings(b); - m_buttons->removeButton(b); -// dynamic_cast(b)->unregisterShortcut(); - delete b; + path = QString("/panel/%1/desktop_%2").arg(settings()->group()).arg(i + 1); + description = tr("Switch to desktop %1").arg(i + 1); + + gshortcut = GlobalKeyShortcut::Client::instance()->addAction(QStringLiteral(), path, description, this); + if (nullptr != gshortcut) + { + m_keys << gshortcut; + connect(gshortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); + connect(gshortcut, SIGNAL(activated()), m_pSignalMapper, SLOT(map())); + m_pSignalMapper->setMapping(gshortcut, i); + } } +} + +void DesktopSwitch::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + disconnect(shortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); - // create new desktop layout - for (int i = 0; i < m_desktopCount; ++i) + const int i = m_keys.indexOf(shortcut); + Q_ASSERT(-1 != i); + + if (shortcut->shortcut().isEmpty()) { - QString path = QString("/panel/%1/desktop_%2").arg(settings()->group()).arg(i + 1); - QString shortcut = QString("Control+F%1").arg(i + 1); - - DesktopSwitchButton * m = new DesktopSwitchButton(&mWidget, i, path, shortcut, - KWindowSystem::desktopName(i + 1).isEmpty() ? - tr("Desktop %1").arg(i + 1) : - KWindowSystem::desktopName(i + 1)); - m_pSignalMapper->setMapping(m, i); - connect(m, SIGNAL(activated()), m_pSignalMapper, SLOT(map())) ; - mWidget.layout()->addWidget(m); - m_buttons->addButton(m, i); + shortcut->changeShortcut(DEFAULT_SHORTCUT_TEMPLATE.arg(i + 1)); } +} - int activeDesk = KWindowSystem::currentDesktop(); - QAbstractButton * button = m_buttons->button(activeDesk - 1); - if (button) - button->setChecked(true); +void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2) +{ + if (properties.testFlag(NET::WMState)) + { + KWindowInfo info = KWindowInfo(id, NET::WMDesktop | NET::WMState); + int desktop = info.desktop(); + if (!info.valid() || info.onAllDesktops()) + return; + else + { + DesktopSwitchButton *button = static_cast(m_buttons->button(desktop - 1)); + if(button) + button->setUrgencyHint(id, info.hasState(NET::DemandsAttention)); + } + } +} + +void DesktopSwitch::refresh() +{ + QList btns = m_buttons->buttons(); + + int i = 0; + const int current_cnt = btns.count(); + const int border = qMin(btns.count(), m_desktopCount); + //update existing buttons + for ( ; i < border; ++i) + { + ((DesktopSwitchButton*)m_buttons->button(i))->update(i, mLabelType, + KWindowSystem::desktopName(i + 1).isEmpty() ? + tr("Desktop %1").arg(i + 1) : + KWindowSystem::desktopName(i + 1)); + } - connect(m_buttons, SIGNAL(buttonClicked(int)), - this, SLOT(setDesktop(int))); + //create new buttons (if neccessary) + QAbstractButton *b; + for ( ; i < m_desktopCount; ++i) + { + b = new DesktopSwitchButton(&mWidget, i, mLabelType, + KWindowSystem::desktopName(i+1).isEmpty() ? + tr("Desktop %1").arg(i+1) : + KWindowSystem::desktopName(i+1)); + mWidget.layout()->addWidget(b); + m_buttons->addButton(b, i); + } - realign(); + //delete unneeded buttons (if neccessary) + for ( ; i < current_cnt; ++i) + { + b = m_buttons->buttons().last(); + m_buttons->removeButton(b); + mWidget.layout()->removeWidget(b); + delete b; + } } DesktopSwitch::~DesktopSwitch() @@ -106,13 +176,9 @@ void DesktopSwitch::setDesktop(int desktop) void DesktopSwitch::onNumberOfDesktopsChanged(int count) { - if (m_desktopCount != count) - { - qDebug() << "Desktop count changed from" << m_desktopCount << "to" << count; - m_desktopCount = count; - onDesktopNamesChanged(); - setup(); - } + qDebug() << "Desktop count changed from" << m_desktopCount << "to" << count; + m_desktopCount = count; + refresh(); } void DesktopSwitch::onCurrentDesktopChanged(int current) @@ -124,46 +190,73 @@ void DesktopSwitch::onCurrentDesktopChanged(int current) void DesktopSwitch::onDesktopNamesChanged() { - QStringList names; - const int count = KWindowSystem::numberOfDesktops(); - for (int i = 0; i < count; ++i) - names << KWindowSystem::desktopName(i + 1); - m_desktopNames = names; - setup(); + refresh(); +} + +void DesktopSwitch::settingsChanged() +{ + int value = settings()->value("rows", 1).toInt(); + if (mRows != value) + { + mRows = value; + realign(); + } + value = settings()->value("labelType", DesktopSwitchButton::LABEL_TYPE_NUMBER).toInt(); + if (mLabelType != static_cast(value)) + { + mLabelType = static_cast(value); + refresh(); + } } void DesktopSwitch::realign() { + int columns = static_cast(ceil(static_cast(m_desktopCount) / mRows)); mLayout->setEnabled(false); - if (panel()->isHorizontal()) { - mLayout->setRowCount(qMin(panel()->lineCount(), mLayout->count())); + mLayout->setRowCount(mRows); mLayout->setColumnCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, columns, mRows, NET::DesktopLayoutCornerTopLeft); } else { - mLayout->setColumnCount(qMin(panel()->lineCount(), mLayout->count())); + mLayout->setColumnCount(mRows); mLayout->setRowCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, mRows, columns, NET::DesktopLayoutCornerTopLeft); } mLayout->setEnabled(true); } +QDialog *DesktopSwitch::configureDialog() +{ + return new DesktopSwitchConfiguration(settings()); +} + DesktopSwitchWidget::DesktopSwitchWidget(): - QFrame() + QFrame(), + m_mouseWheelThresholdCounter(0) { } void DesktopSwitchWidget::wheelEvent(QWheelEvent *e) { - int max = KWindowSystem::currentDesktop() - 1; + // Without some sort of threshold which has to be passed, scrolling is too sensitive + m_mouseWheelThresholdCounter -= e->delta(); + // If the user hasn't scrolled far enough in one direction (positive or negative): do nothing + if(abs(m_mouseWheelThresholdCounter) < 100) + return; + + int max = KWindowSystem::numberOfDesktops(); int delta = e->delta() < 0 ? 1 : -1; int current = KWindowSystem::currentDesktop() + delta; - if (current > max) - current = 0; - else if (current < 0) + if (current > max){ + current = 1; + } + else if (current < 1) current = max; + m_mouseWheelThresholdCounter = 0; KWindowSystem::setCurrentDesktop(current); } diff --git a/plugin-desktopswitch/desktopswitch.h b/plugin-desktopswitch/desktopswitch.h index ed3ed41..23ea20a 100644 --- a/plugin-desktopswitch/desktopswitch.h +++ b/plugin-desktopswitch/desktopswitch.h @@ -31,9 +31,14 @@ #include "../panel/ilxqtpanelplugin.h" #include +#include +#include + +#include "desktopswitchbutton.h" class QSignalMapper; class QButtonGroup; +class NETRootInfo; namespace LxQt { class GridLayout; } @@ -44,6 +49,9 @@ class DesktopSwitchWidget: public QFrame public: DesktopSwitchWidget(); +private: + int m_mouseWheelThresholdCounter; + protected: void wheelEvent(QWheelEvent* e); }; @@ -63,30 +71,40 @@ public: bool isSeparate() const { return true; } void realign(); + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + private: QButtonGroup * m_buttons; + QList m_keys; QSignalMapper* m_pSignalMapper; int m_desktopCount; - QStringList m_desktopNames; DesktopSwitchWidget mWidget; LxQt::GridLayout *mLayout; + int mRows; + QScopedPointer mDesktops; + DesktopSwitchButton::LabelType mLabelType; - void setup(); + void refresh(); private slots: void setDesktop(int desktop); void onNumberOfDesktopsChanged(int); void onCurrentDesktopChanged(int); void onDesktopNamesChanged(); + virtual void settingsChanged(); + void registerShortcuts(); + void shortcutRegistered(); + void onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2); }; class DesktopSwitchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new DesktopSwitch(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new DesktopSwitch(startupInfo);} }; #endif diff --git a/plugin-desktopswitch/desktopswitchbutton.cpp b/plugin-desktopswitch/desktopswitchbutton.cpp index 1cf26f7..b458780 100644 --- a/plugin-desktopswitch/desktopswitchbutton.cpp +++ b/plugin-desktopswitch/desktopswitchbutton.cpp @@ -27,43 +27,53 @@ #include -#include +#include +#include #include #include "desktopswitchbutton.h" -DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, const QString &path, const QString &shortcut, const QString &title) - : QToolButton(parent) - , m_shortcut(0) - , mIndex(index) +DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title) + : QToolButton(parent), + mUrgencyHint(false) { - setText(QString::number(index + 1)); + update(index, labelType, title); + setCheckable(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - - if (!shortcut.isEmpty()) +} + +void DesktopSwitchButton::update(int index, LabelType labelType, const QString &title) +{ + switch (labelType) { - QString description = tr("Switch to desktop %1").arg(index + 1); - if (!title.isEmpty()) - { - description.append(QString(" (%1)").arg(title)); - } - m_shortcut = GlobalKeyShortcut::Client::instance()->addAction(QString(), path, description, this); - if (m_shortcut) - { - if (m_shortcut->shortcut().isEmpty()) - m_shortcut->changeShortcut(shortcut); - connect(m_shortcut, SIGNAL(activated()), this, SIGNAL(activated())); - } + case LABEL_TYPE_NAME: + setText(title); + break; + + default: // LABEL_TYPE_NUMBER + setText(QString::number(index + 1)); } - + if (!title.isEmpty()) { setToolTip(title); } } -void DesktopSwitchButton::unregisterShortcut() +void DesktopSwitchButton::setUrgencyHint(WId id, bool urgent) { - GlobalKeyShortcut::Client::instance()->removeAction(QString("/desktop_switch/desktop_%1").arg(mIndex + 1)); + if (urgent) + mUrgentWIds.insert(id); + else + mUrgentWIds.remove(id); + + if (mUrgencyHint != !mUrgentWIds.empty()) + { + mUrgencyHint = !mUrgentWIds.empty(); + setProperty("urgent", mUrgencyHint); + style()->unpolish(this); + style()->polish(this); + QToolButton::update(); + } } diff --git a/plugin-desktopswitch/desktopswitchbutton.h b/plugin-desktopswitch/desktopswitchbutton.h index 911dbf6..18bebcc 100644 --- a/plugin-desktopswitch/desktopswitchbutton.h +++ b/plugin-desktopswitch/desktopswitchbutton.h @@ -30,7 +30,7 @@ #define DESKTOPSWITCHBUTTON_H #include - +#include namespace GlobalKeyShortcut { @@ -40,19 +40,23 @@ class Action; class DesktopSwitchButton : public QToolButton { Q_OBJECT - + public: - DesktopSwitchButton(QWidget * parent, int index, const QString &path, const QString &shortcut, const QString &title=QString()); + enum LabelType { // Must match with combobox indexes + LABEL_TYPE_NUMBER = 0, + LABEL_TYPE_NAME = 1 + }; -public slots: - void unregisterShortcut(); + DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title=QString()); + void update(int index, LabelType labelType, const QString &title); -signals: - void activated(); + void setUrgencyHint(WId, bool); private: - GlobalKeyShortcut::Action * m_shortcut; - int mIndex; + + // for urgency hint handling + bool mUrgencyHint; + QSet mUrgentWIds; }; #endif diff --git a/plugin-desktopswitch/desktopswitchconfiguration.cpp b/plugin-desktopswitch/desktopswitchconfiguration.cpp new file mode 100644 index 0000000..62457b6 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "desktopswitchconfiguration.h" +#include "ui_desktopswitchconfiguration.h" +#include +#include + +DesktopSwitchConfiguration::DesktopSwitchConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::DesktopSwitchConfiguration) + , mSettings(settings) + , mOldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DesktopSwitchConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + + connect(ui->rowsSB, SIGNAL(valueChanged(int)), this, SLOT(rowsChanged(int))); + connect(ui->labelTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(labelTypeChanged(int))); + + loadDesktopsNames(); +} + +DesktopSwitchConfiguration::~DesktopSwitchConfiguration() +{ + delete ui; +} + +void DesktopSwitchConfiguration::loadSettings() +{ + ui->rowsSB->setValue(mSettings->value("rows", 1).toInt()); + ui->labelTypeCB->setCurrentIndex(mSettings->value("labelType", 0).toInt()); +} + +void DesktopSwitchConfiguration::loadDesktopsNames() +{ + int n = KWindowSystem::numberOfDesktops(); + for (int i = 1; i <= n; i++) + { + QLineEdit *edit = new QLineEdit(KWindowSystem::desktopName(i), this); + ((QFormLayout *) ui->namesGroupBox->layout())->addRow(QString("Desktop %1:").arg(i), edit); + + // C++11 rocks! + QTimer *timer = new QTimer(this); + timer->setInterval(400); + timer->setSingleShot(true); + connect(timer, &QTimer::timeout, [=] { KWindowSystem::setDesktopName(i, edit->text()); }); + connect(edit, &QLineEdit::textEdited, [=] { timer->start(); }); + } +} + +void DesktopSwitchConfiguration::rowsChanged(int value) +{ + mSettings->setValue("rows", value); +} + +void DesktopSwitchConfiguration::labelTypeChanged(int type) +{ + mSettings->setValue("labelType", type); +} + +void DesktopSwitchConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + diff --git a/plugin-desktopswitch/desktopswitchconfiguration.h b/plugin-desktopswitch/desktopswitchconfiguration.h new file mode 100644 index 0000000..a2338c8 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.h @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DESKTOPSWITCHCERCONFIGURATION_H +#define DESKTOPSWITCHCERCONFIGURATION_H + +#include + +#include +#include +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class DesktopSwitchConfiguration; +} + +class DesktopSwitchConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit DesktopSwitchConfiguration(QSettings *settings, QWidget *parent = 0); + ~DesktopSwitchConfiguration(); + +private: + Ui::DesktopSwitchConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void loadDesktopsNames(); + void dialogButtonsAction(QAbstractButton *btn); + void rowsChanged(int value); + void labelTypeChanged(int type); +}; + +#endif // DESKTOPSWITCHCERCONFIGURATION_H diff --git a/plugin-desktopswitch/desktopswitchconfiguration.ui b/plugin-desktopswitch/desktopswitchconfiguration.ui new file mode 100644 index 0000000..e387800 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.ui @@ -0,0 +1,89 @@ + + + DesktopSwitchConfiguration + + + + 0 + 0 + 213 + 207 + + + + DesktopSwitch settings + + + + + + Rows + + + + + + 1 + + + 40 + + + 1 + + + + + + + Desktop labels: + + + + + + + Number of rows: + + + + + + + + Numbers + + + + + Names + + + + + + + + + + + Desktop names + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + diff --git a/plugin-desktopswitch/translations/desktopswitch.ts b/plugin-desktopswitch/translations/desktopswitch.ts index 7084f0a..8e780fe 100644 --- a/plugin-desktopswitch/translations/desktopswitch.ts +++ b/plugin-desktopswitch/translations/desktopswitch.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ar.ts b/plugin-desktopswitch/translations/desktopswitch_ar.ts index 49bcbf1..9b4b8c2 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ar.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ar.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 سطح المكتب %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_cs.ts b/plugin-desktopswitch/translations/desktopswitch_cs.ts index c8624ed..4ed8a99 100644 --- a/plugin-desktopswitch/translations/desktopswitch_cs.ts +++ b/plugin-desktopswitch/translations/desktopswitch_cs.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts b/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts index f8bb777..25bd4e7 100644 --- a/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts +++ b/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_da.ts b/plugin-desktopswitch/translations/desktopswitch_da.ts index d543e50..ec70c62 100644 --- a/plugin-desktopswitch/translations/desktopswitch_da.ts +++ b/plugin-desktopswitch/translations/desktopswitch_da.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Skrivebord %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_da_DK.ts b/plugin-desktopswitch/translations/desktopswitch_da_DK.ts index 97c3f81..4b7d15c 100644 --- a/plugin-desktopswitch/translations/desktopswitch_da_DK.ts +++ b/plugin-desktopswitch/translations/desktopswitch_da_DK.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Skrivebord %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_de.desktop b/plugin-desktopswitch/translations/desktopswitch_de.desktop index ffbaac2..d914d52 100644 --- a/plugin-desktopswitch/translations/desktopswitch_de.desktop +++ b/plugin-desktopswitch/translations/desktopswitch_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Desktop switcher -Comment=Allows easy switching between virtual desktops. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Erlaubt es zwichen den virtuellen Arbeitsflächen zu schalten Name[de]=Arbeitsflächenumschalter +Comment[de]=Zwischen den virtuellen Arbeitsflächen umschalten diff --git a/plugin-desktopswitch/translations/desktopswitch_de.ts b/plugin-desktopswitch/translations/desktopswitch_de.ts index fc29bc2..70e8cb8 100644 --- a/plugin-desktopswitch/translations/desktopswitch_de.ts +++ b/plugin-desktopswitch/translations/desktopswitch_de.ts @@ -4,17 +4,53 @@ DesktopSwitch - + + Switch to desktop %1 + Zu Arbeitsfläche %1 wechseln + + + + Desktop %1 Arbeitsfläche %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Arbeitsflächenumschalter - Einstellungen + + + + Rows + Zeilen + + + + Desktop labels: + Arbeitsflächenbezeichnungen: + + + + Number of rows: + Anzahl der Zeilen: + + + + Numbers + Ziffern + + + + Names + Namen + + + + Desktop names + Arbeitsflächenbezeichnungen diff --git a/plugin-desktopswitch/translations/desktopswitch_de_DE.ts b/plugin-desktopswitch/translations/desktopswitch_de_DE.ts deleted file mode 100644 index 763fc82..0000000 --- a/plugin-desktopswitch/translations/desktopswitch_de_DE.ts +++ /dev/null @@ -1,20 +0,0 @@ - - - - - DesktopSwitch - - - Desktop %1 - Arbeitsfläche %1 - - - - DesktopSwitchButton - - - Switch to desktop %1 - - - - diff --git a/plugin-desktopswitch/translations/desktopswitch_el_GR.ts b/plugin-desktopswitch/translations/desktopswitch_el_GR.ts index d1338eb..5324f55 100644 --- a/plugin-desktopswitch/translations/desktopswitch_el_GR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_el_GR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Επιφάνεια εργασίας %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_eo.ts b/plugin-desktopswitch/translations/desktopswitch_eo.ts index f121479..d22161e 100644 --- a/plugin-desktopswitch/translations/desktopswitch_eo.ts +++ b/plugin-desktopswitch/translations/desktopswitch_eo.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Labortablo %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es.ts b/plugin-desktopswitch/translations/desktopswitch_es.ts index 9d91f5b..d661b75 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es_UY.ts b/plugin-desktopswitch/translations/desktopswitch_es_UY.ts index af1163f..3139142 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es_UY.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es_UY.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es_VE.ts b/plugin-desktopswitch/translations/desktopswitch_es_VE.ts index dac3da2..c936769 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es_VE.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es_VE.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_eu.ts b/plugin-desktopswitch/translations/desktopswitch_eu.ts index 3fa883d..e23ee1b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_eu.ts +++ b/plugin-desktopswitch/translations/desktopswitch_eu.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 %1 mahaigaina - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_fi.ts b/plugin-desktopswitch/translations/desktopswitch_fi.ts index d495a34..5d78386 100644 --- a/plugin-desktopswitch/translations/desktopswitch_fi.ts +++ b/plugin-desktopswitch/translations/desktopswitch_fi.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Työpöytä %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts b/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts index 06369bd..884e24b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Bureau %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_hr.ts b/plugin-desktopswitch/translations/desktopswitch_hr.ts new file mode 100644 index 0000000..68078e7 --- /dev/null +++ b/plugin-desktopswitch/translations/desktopswitch_hr.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Prebaci na radnu površinu %1 + + + + + Desktop %1 + Radna površina %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Postavke prebacivaša radnih površina + + + + Number of rows: + Broj redaka: + + + + Desktop labels: + + + + + Numbers + Brojevi + + + + Names + Imena + + + diff --git a/plugin-desktopswitch/translations/desktopswitch_hu.ts b/plugin-desktopswitch/translations/desktopswitch_hu.ts index b348ad3..0c05cfb 100644 --- a/plugin-desktopswitch/translations/desktopswitch_hu.ts +++ b/plugin-desktopswitch/translations/desktopswitch_hu.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + %1. asztalra váltás + + + + Desktop %1 - + %1. asztal - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek diff --git a/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts b/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts index 26f5593..4c43b72 100644 --- a/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts +++ b/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + %1. asztalra váltás + + + + Desktop %1 %1. asztal - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek diff --git a/plugin-desktopswitch/translations/desktopswitch_ia.ts b/plugin-desktopswitch/translations/desktopswitch_ia.ts index ff357dd..053e80f 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ia.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ia.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_id_ID.ts b/plugin-desktopswitch/translations/desktopswitch_id_ID.ts index 7266de9..f5ff166 100644 --- a/plugin-desktopswitch/translations/desktopswitch_id_ID.ts +++ b/plugin-desktopswitch/translations/desktopswitch_id_ID.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_it_IT.ts b/plugin-desktopswitch/translations/desktopswitch_it_IT.ts index a558746..6d599e2 100644 --- a/plugin-desktopswitch/translations/desktopswitch_it_IT.ts +++ b/plugin-desktopswitch/translations/desktopswitch_it_IT.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ja.ts b/plugin-desktopswitch/translations/desktopswitch_ja.ts index eb256dd..6f5e4c9 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ja.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ja.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + デスクトップ%1に切り替える + + + + Desktop %1 デスクトップ %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - デスクトップ%1に切り替える + デスクトップ%1に切り替える + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_ko.ts b/plugin-desktopswitch/translations/desktopswitch_ko.ts index 8acf723..44ccfb1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ko.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ko.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_lt.ts b/plugin-desktopswitch/translations/desktopswitch_lt.ts index 784eb70..99c393c 100644 --- a/plugin-desktopswitch/translations/desktopswitch_lt.ts +++ b/plugin-desktopswitch/translations/desktopswitch_lt.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 %1 darbalaukis - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_nl.ts b/plugin-desktopswitch/translations/desktopswitch_nl.ts index d05a346..977987b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_nl.ts +++ b/plugin-desktopswitch/translations/desktopswitch_nl.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Bureaublad %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts b/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts index 6092fd4..3e7c7f3 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Pulpit %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pt.ts b/plugin-desktopswitch/translations/desktopswitch_pt.ts index 5884cf8..b71d7a6 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pt.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pt.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Área de trabalho %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts b/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts index 83b74ea..e7b91e9 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Área de trabalho %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts b/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts index 57cde84..93055b1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + Comutare la ecranul %1 + + + + Desktop %1 Ecranul %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Setäri de comutare a ecranului + + + + Number of rows: + Numărul de rânduri: + + + + Desktop labels: + Etichetele ecranelor: + + + + Numbers + Numere + + + + Names + Nume diff --git a/plugin-desktopswitch/translations/desktopswitch_ru.ts b/plugin-desktopswitch/translations/desktopswitch_ru.ts index e703819..dead547 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ru.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ru.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + Desktop %1 Рабочий стол %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - Переключиться на рабочий стол %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts b/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts index 4affda1..95aa9c4 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + Desktop %1 Рабочий стол %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - Переключиться на рабочий стол %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts b/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts index 91e8d09..c5777c5 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sl.ts b/plugin-desktopswitch/translations/desktopswitch_sl.ts index 41032f4..3b9d207 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sl.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sl.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Namizje %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts b/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts index 8bc31cc..1ab6a1d 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts b/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts index 3b8063b..bc8eaaa 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Површ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts b/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts index 18874be..5001657 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Површ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_th_TH.ts b/plugin-desktopswitch/translations/desktopswitch_th_TH.ts index 275e04f..0f54e7a 100644 --- a/plugin-desktopswitch/translations/desktopswitch_th_TH.ts +++ b/plugin-desktopswitch/translations/desktopswitch_th_TH.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 พื้นโต๊ะ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_tr.ts b/plugin-desktopswitch/translations/desktopswitch_tr.ts index b01f535..c088b69 100644 --- a/plugin-desktopswitch/translations/desktopswitch_tr.ts +++ b/plugin-desktopswitch/translations/desktopswitch_tr.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Masaüstü %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_uk.ts b/plugin-desktopswitch/translations/desktopswitch_uk.ts index 5f08b13..2d513d0 100644 --- a/plugin-desktopswitch/translations/desktopswitch_uk.ts +++ b/plugin-desktopswitch/translations/desktopswitch_uk.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Стільниця %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts b/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts index 9e012da..96fe963 100644 --- a/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts +++ b/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 桌面 %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts b/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts index ef6b347..430f5d1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts +++ b/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 桌面 %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-directorymenu/CMakeLists.txt b/plugin-directorymenu/CMakeLists.txt new file mode 100644 index 0000000..319b02d --- /dev/null +++ b/plugin-directorymenu/CMakeLists.txt @@ -0,0 +1,23 @@ +set(PLUGIN "directorymenu") + +set(HEADERS + directorymenu.h + directorymenuconfiguration.h +) + +set(SOURCES + directorymenu.cpp + directorymenuconfiguration.cpp +) + +set(UIS + directorymenuconfiguration.ui +) + +set(LIBRARIES + ${LIBRARIES} + Qt5Xdg +) + +include ("../cmake/BuildPlugin.cmake") +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-directorymenu/directorymenu.cpp b/plugin-directorymenu/directorymenu.cpp new file mode 100644 index 0000000..4ffee7f --- /dev/null +++ b/plugin-directorymenu/directorymenu.cpp @@ -0,0 +1,192 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is diinstributed 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#include "directorymenu.h" +#include +#include +#include +#include +#include + +#include + +DirectoryMenu::DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo), + mMenu(0), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + mOpenDirectorySignalMapper = new QSignalMapper(this); + mMenuSignalMapper = new QSignalMapper(this); + + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + mButton.setIcon(XdgIcon::fromTheme("folder")); + + connect(&mButton, SIGNAL(clicked()), this, SLOT(showMenu())); + connect(mOpenDirectorySignalMapper, SIGNAL(mapped(QString)), this, SLOT(openDirectory(QString))); + connect(mMenuSignalMapper, SIGNAL(mapped(QString)), this, SLOT(addMenu(QString))); + + settingsChanged(); +} + +DirectoryMenu::~DirectoryMenu() +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } +} + +void DirectoryMenu::showMenu() +{ + if(mBaseDirectory.exists()) + { + buildMenu(mBaseDirectory.absolutePath()); + } + else + { + buildMenu(QDir::homePath()); + } + + + int x=0, y=0; + + switch (panel()->position()) + { + case ILxQtPanel::PositionTop: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().bottom(); + break; + + case ILxQtPanel::PositionBottom: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().top() - mMenu->sizeHint().height(); + break; + + case ILxQtPanel::PositionLeft: + x = panel()->globalGometry().right(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + + case ILxQtPanel::PositionRight: + x = panel()->globalGometry().left() - mMenu->sizeHint().width(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + } + + // Just using Qt`s activateWindow() won't work on some WMs like Kwin. + // Solution is to execute menu 1ms later using timer + mButton.activateWindow(); + mMenu->exec(QPoint(x, y)); +} + +void DirectoryMenu::buildMenu(const QString& path) +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } + + mPathStrings.clear(); + + mMenu = new QMenu(); + + addActions(mMenu, path); +} + +void DirectoryMenu::openDirectory(const QString& path) +{ + QDesktopServices::openUrl(QUrl("file://" + QDir::toNativeSeparators(path))); +} + +void DirectoryMenu::addMenu(QString path) +{ + QSignalMapper* sender = (QSignalMapper* )QObject::sender(); + QMenu* parentMenu = (QMenu*) sender->mapping(path); + + if(parentMenu->isEmpty()) + { + addActions(parentMenu, path); + } +} + +void DirectoryMenu::addActions(QMenu* menu, const QString& path) +{ + mPathStrings.push_back(path); + + QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme("folder"), tr("Open")); + connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map())); + mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back()); + + menu->addSeparator(); + + QDir dir(path); + QFileInfoList list = dir.entryInfoList(); + + foreach (const QFileInfo& entry, list) + { + if(entry.isDir() && !entry.isHidden()) + { + mPathStrings.push_back(entry.fileName()); + + QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme("folder"), mPathStrings.back()); + + connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map())); + mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath()); + } + } +} + +QDialog* DirectoryMenu::configureDialog() +{ + return new DirectoryMenuConfiguration(*settings()); +} + +void DirectoryMenu::settingsChanged() +{ + mBaseDirectory.setPath(settings()->value("baseDirectory", QDir::homePath()).toString()); + + QString iconPath = settings()->value("icon", QString()).toString(); + QIcon icon = QIcon(iconPath); + + if(!icon.isNull()) + { + QIcon buttonIcon = QIcon(icon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + mButton.setIcon(buttonIcon); + return; + } + } + + mButton.setIcon(mDefaultIcon); +} diff --git a/plugin-directorymenu/directorymenu.h b/plugin-directorymenu/directorymenu.h new file mode 100644 index 0000000..a3825da --- /dev/null +++ b/plugin-directorymenu/directorymenu.h @@ -0,0 +1,94 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DIRECTORYMENU_H +#define DIRECTORYMENU_H + +#include "../panel/ilxqtpanelplugin.h" + #include "directorymenuconfiguration.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +class DirectoryMenu : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo); + ~DirectoryMenu(); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "DirectoryMenu"; } + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + void settingsChanged(); + +private slots: + void showMenu(); + void openDirectory(const QString& path); + void addMenu(QString path); + +protected slots: + void buildMenu(const QString& path); + +private: + void addActions(QMenu* menu, const QString& path); + + QToolButton mButton; + QMenu *mMenu; + QSignalMapper *mOpenDirectorySignalMapper; + QSignalMapper *mMenuSignalMapper; + + QDir mBaseDirectory; + QIcon mDefaultIcon; + std::vector mPathStrings; +}; + +class DirectoryMenuLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new DirectoryMenu(startupInfo); + } +}; + + +#endif + diff --git a/plugin-directorymenu/directorymenuconfiguration.cpp b/plugin-directorymenu/directorymenuconfiguration.cpp new file mode 100644 index 0000000..501d585 --- /dev/null +++ b/plugin-directorymenu/directorymenuconfiguration.cpp @@ -0,0 +1,140 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include +#include +#include +#include + +#include + +#include "directorymenuconfiguration.h" +#include "ui_directorymenuconfiguration.h" + + +DirectoryMenuConfiguration::DirectoryMenuConfiguration(QSettings &settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::DirectoryMenuConfiguration), + mSettings(settings), + mOldSettings(settings), + mBaseDirectory(QDir::homePath()), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DirectoryMenuConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + ui->baseDirectoryB->setIcon(mDefaultIcon); + + connect(ui->baseDirectoryB, SIGNAL(clicked()), SLOT(showDirectoryDialog())); + connect(ui->iconB, SIGNAL(clicked()), SLOT(showIconDialog())); +} + +DirectoryMenuConfiguration::~DirectoryMenuConfiguration() +{ + delete ui; +} + +void DirectoryMenuConfiguration::loadSettings() +{ + mBaseDirectory.setPath(mSettings.value("baseDirectory", QDir::homePath()).toString()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + mIcon = mSettings.value("icon", QString()).toString(); + if(!mIcon.isNull()) + { + QIcon buttonIcon = QIcon(mIcon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + ui->iconB->setIcon(buttonIcon); + return; + } + } + + ui->iconB->setIcon(mDefaultIcon); +} + +void DirectoryMenuConfiguration::saveSettings() +{ + mSettings.setValue("baseDirectory", mBaseDirectory.absolutePath()); + mSettings.setValue("icon", mIcon); +} + +void DirectoryMenuConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + +void DirectoryMenuConfiguration::showDirectoryDialog() +{ + QFileDialog d(this, tr("Choose Base Directory"), mBaseDirectory.absolutePath()); + d.setFileMode(QFileDialog::Directory); + d.setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + mBaseDirectory.setPath(d.selectedFiles().front()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + saveSettings(); + } +} + +void DirectoryMenuConfiguration::showIconDialog() +{ + QFileDialog d(this, tr("Choose Icon"), QDir::homePath(), tr("Icons (*.png *.xpm *.jpg)")); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + QIcon newIcon = QIcon(d.selectedFiles().front()); + + if(newIcon.pixmap(QSize(24,24)).isNull()) + { + QMessageBox::warning(this, tr("Directory Menu"), tr("An error occurred while loading the icon.")); + return; + } + + ui->iconB->setIcon(newIcon); + mIcon = d.selectedFiles().front(); + saveSettings(); + } +} diff --git a/plugin-directorymenu/directorymenuconfiguration.h b/plugin-directorymenu/directorymenuconfiguration.h new file mode 100644 index 0000000..9bdcca4 --- /dev/null +++ b/plugin-directorymenu/directorymenuconfiguration.h @@ -0,0 +1,79 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DIRECTORYMENUCONFIGURATION_H +#define DIRECTORYMENUCONFIGURATION_H + +#include +#include +#include +#include +#include +#include + +#include + +namespace Ui { + class DirectoryMenuConfiguration; +} + +class DirectoryMenuConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit DirectoryMenuConfiguration(QSettings &settings, QWidget *parent = 0); + ~DirectoryMenuConfiguration(); + +private: + Ui::DirectoryMenuConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache mOldSettings; + QDir mBaseDirectory; + QString mIcon; + QIcon mDefaultIcon; + + /* + Read settings from conf file and put data into controls. + */ + void loadSettings(); + +private slots: + /* + Saves settings in conf file. + */ + void saveSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void showDirectoryDialog(); + void showIconDialog(); + +private: +}; + +#endif // DIRECTORYMENUCONFIGURATION_H diff --git a/plugin-directorymenu/directorymenuconfiguration.ui b/plugin-directorymenu/directorymenuconfiguration.ui new file mode 100644 index 0000000..6a592d2 --- /dev/null +++ b/plugin-directorymenu/directorymenuconfiguration.ui @@ -0,0 +1,113 @@ + + + DirectoryMenuConfiguration + + + + 0 + 0 + 342 + 168 + + + + Directory Menu Settings + + + + + + Appearance + + + + + + Base directory: + + + + + + + + 0 + 0 + + + + BaseDirectoryName + + + + + + + Icon: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + DirectoryMenuConfiguration + accept() + + + 214 + 350 + + + 157 + 274 + + + + + buttons + rejected() + DirectoryMenuConfiguration + reject() + + + 214 + 350 + + + 196 + 274 + + + + + diff --git a/plugin-directorymenu/resources/directorymenu.desktop.in b/plugin-directorymenu/resources/directorymenu.desktop.in new file mode 100644 index 0000000..c86b448 --- /dev/null +++ b/plugin-directorymenu/resources/directorymenu.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory +Icon=folder + +#TRANSLATIONS_DIR=../translations diff --git a/plugin-directorymenu/translations/directorymenu.ts b/plugin-directorymenu/translations/directorymenu.ts new file mode 100644 index 0000000..d27edc1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + + + + + Appearance + + + + + Base directory: + + + + + BaseDirectoryName + + + + + Icon: + + + + + Choose Base Directory + + + + + Choose Icon + + + + + Icons (*.png *.xpm *.jpg) + + + + + Directory Menu + + + + + An error occurred while loading the icon. + + + + diff --git a/plugin-directorymenu/translations/directorymenu_de.desktop b/plugin-directorymenu/translations/directorymenu_de.desktop new file mode 100644 index 0000000..4edd17a --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Ordnermenü +Comment[de]=Zeigt ein Menü mit dem Inhalt eines Ordners an diff --git a/plugin-directorymenu/translations/directorymenu_de.ts b/plugin-directorymenu/translations/directorymenu_de.ts new file mode 100644 index 0000000..415bc4e --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_de.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Öffnen + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Einstellungen des Verzeichnismenüs + + + + Appearance + Erscheinungsbild + + + + Base directory: + Basisverzeichnis: + + + + BaseDirectoryName + BasisVerzeichnisName + + + + Icon: + Symbol: + + + + Choose Base Directory + Basisverzeichnis auswählen + + + + Choose Icon + Symbol auswählen + + + + Icons (*.png *.xpm *.jpg) + Symbole (*.png *.xpm *.jpg) + + + + Directory Menu + Verzeichnismenü + + + + An error occurred while loading the icon. + Beim Laden des Symbols trat ein Fehler auf. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hr.ts b/plugin-directorymenu/translations/directorymenu_hr.ts new file mode 100644 index 0000000..8c7e6f1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hr.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Otvori + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Postavke izbornika direktorija + + + + Appearance + Izgled + + + + Base directory: + Osnovni direktorij: + + + + BaseDirectoryName + Ime osnovnog direktorija + + + + Icon: + Ikona: + + + + Choose Base Directory + Izaberite osnovni direktorij + + + + Choose Icon + Izaberite ikonu + + + + Icons (*.png *.xpm *.jpg) + Ikone (*.png *.xpm *.jpg) + + + + Directory Menu + Izbornik direktorija + + + + An error occurred while loading the icon. + Došlo je do greške pri učitavanju ikone. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hu.desktop b/plugin-directorymenu/translations/directorymenu_hu.desktop new file mode 100644 index 0000000..edc6c3b --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Egy könyvtár tartalmát mutató menü +Name[hu]=Könyvtármenü diff --git a/plugin-directorymenu/translations/directorymenu_hu.ts b/plugin-directorymenu/translations/directorymenu_hu.ts new file mode 100644 index 0000000..573fec1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hu_HU.ts b/plugin-directorymenu/translations/directorymenu_hu_HU.ts new file mode 100644 index 0000000..3bac2f9 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu_HU.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/plugin-directorymenu/translations/directorymenu_ru.desktop b/plugin-directorymenu/translations/directorymenu_ru.desktop new file mode 100644 index 0000000..0ee5c98 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Меню папки +Comment[ru]=Показывает меню, отображающее содержимое папки diff --git a/plugin-directorymenu/translations/directorymenu_ru.ts b/plugin-directorymenu/translations/directorymenu_ru.ts new file mode 100644 index 0000000..b900d65 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/plugin-directorymenu/translations/directorymenu_ru_RU.desktop b/plugin-directorymenu/translations/directorymenu_ru_RU.desktop new file mode 100644 index 0000000..5a29599 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Меню папки +Comment[ru_RU]=Показывает меню, отображающее содержимое папки diff --git a/plugin-directorymenu/translations/directorymenu_ru_RU.ts b/plugin-directorymenu/translations/directorymenu_ru_RU.ts new file mode 100644 index 0000000..00d70bb --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru_RU.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/plugin-dom/CMakeLists.txt b/plugin-dom/CMakeLists.txt index 19ea77b..8bddcb9 100644 --- a/plugin-dom/CMakeLists.txt +++ b/plugin-dom/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES domtreeitem.cpp ) -set(MOCS - domplugin.h - treewindow.h - domtreeitem.h -) - set(UIS treewindow.ui ) diff --git a/plugin-dom/domplugin.cpp b/plugin-dom/domplugin.cpp index 712dd97..e7b5551 100644 --- a/plugin-dom/domplugin.cpp +++ b/plugin-dom/domplugin.cpp @@ -25,12 +25,11 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "domplugin.h" #include "treewindow.h" - -#include #include +#include + DomPlugin::DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), @@ -41,6 +40,7 @@ DomPlugin::DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): connect(&mButton, SIGNAL(clicked()), this, SLOT(showDialog())); } + void DomPlugin::showDialog() { TreeWindow *dialog = mButton.findChild(); @@ -54,5 +54,3 @@ void DomPlugin::showDialog() dialog->show(); dialog->activateWindow(); } - - diff --git a/plugin-dom/domplugin.h b/plugin-dom/domplugin.h index 7a9db00..20c3e7b 100644 --- a/plugin-dom/domplugin.h +++ b/plugin-dom/domplugin.h @@ -32,6 +32,7 @@ #include "../panel/ilxqtpanelplugin.h" #include + class DomPlugin: public QObject, public ILxQtPanelPlugin { Q_OBJECT @@ -56,7 +57,7 @@ class DomPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new DomPlugin(startupInfo); } diff --git a/plugin-dom/domtreeitem.cpp b/plugin-dom/domtreeitem.cpp index 1b4d372..1782be3 100644 --- a/plugin-dom/domtreeitem.cpp +++ b/plugin-dom/domtreeitem.cpp @@ -25,17 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "domtreeitem.h" - -#include #include +#include #include #include -/************************************************ - ************************************************/ DomTreeItem::DomTreeItem(QTreeWidget *view, QWidget *widget): QTreeWidgetItem(view), mWidget(widget) @@ -46,9 +42,6 @@ DomTreeItem::DomTreeItem(QTreeWidget *view, QWidget *widget): } -/************************************************ - - ************************************************/ DomTreeItem::DomTreeItem(QTreeWidgetItem *parent, QWidget *widget): QTreeWidgetItem(parent), mWidget(widget) @@ -59,9 +52,6 @@ DomTreeItem::DomTreeItem(QTreeWidgetItem *parent, QWidget *widget): } -/************************************************ - - ************************************************/ void DomTreeItem::init() { QStringList hierarcy = widgetClassHierarcy(); @@ -92,9 +82,6 @@ void DomTreeItem::init() } -/************************************************ - - ************************************************/ void DomTreeItem::fill() { QList widgets = mWidget->findChildren(); @@ -109,9 +96,6 @@ void DomTreeItem::fill() } -/************************************************ - - ************************************************/ bool DomTreeItem::eventFilter(QObject *watched, QEvent *event) { if (watched == mWidget && @@ -136,18 +120,12 @@ bool DomTreeItem::eventFilter(QObject *watched, QEvent *event) } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetObjectName() const { return mWidget->objectName(); } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetText() const { QToolButton *toolButton = qobject_cast(mWidget); @@ -158,18 +136,12 @@ QString DomTreeItem::widgetText() const } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetClassName() const { return mWidget->metaObject()->className(); } -/************************************************ - - ************************************************/ QStringList DomTreeItem::widgetClassHierarcy() const { QStringList hierarcy; @@ -183,11 +155,7 @@ QStringList DomTreeItem::widgetClassHierarcy() const } -/************************************************ - - ************************************************/ void DomTreeItem::widgetDestroyed() { deleteLater(); } - diff --git a/plugin-dom/domtreeitem.h b/plugin-dom/domtreeitem.h index 84cd389..3a2f8ec 100644 --- a/plugin-dom/domtreeitem.h +++ b/plugin-dom/domtreeitem.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef DOMTREEITEM_H #define DOMTREEITEM_H #include #include + class DomTreeItem: public QObject, public QTreeWidgetItem { Q_OBJECT diff --git a/plugin-dom/translations/dom.ts b/plugin-dom/translations/dom.ts index 5121128..6ffbe17 100644 --- a/plugin-dom/translations/dom.ts +++ b/plugin-dom/translations/dom.ts @@ -9,14 +9,30 @@ - + + Property - + Value + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_de.desktop b/plugin-dom/translations/dom_de.desktop new file mode 100644 index 0000000..52f901f --- /dev/null +++ b/plugin-dom/translations/dom_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Leiste DOM-Baum +Comment[de]=Zeigt einen DOM-Baum der LXQt-Leiste. diff --git a/plugin-dom/translations/dom_de.ts b/plugin-dom/translations/dom_de.ts new file mode 100644 index 0000000..c1b910d --- /dev/null +++ b/plugin-dom/translations/dom_de.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM-Baum der Leiste + + + + + Property + Eigenschaft + + + + Value + Wert + + + + All properties + Alle Eigenschaften + + + + Type + Typ + + + + String value + Zeichenkettenwert + + + diff --git a/plugin-dom/translations/dom_hu.desktop b/plugin-dom/translations/dom_hu.desktop new file mode 100644 index 0000000..83f6021 --- /dev/null +++ b/plugin-dom/translations/dom_hu.desktop @@ -0,0 +1,3 @@ +# Translations +Name[hu]=Panel DOM fa +Comment[hu]=DOM faszerkezet az LxQt panelen diff --git a/plugin-dom/translations/dom_hu.ts b/plugin-dom/translations/dom_hu.ts new file mode 100644 index 0000000..adfb252 --- /dev/null +++ b/plugin-dom/translations/dom_hu.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/plugin-dom/translations/dom_hu_HU.ts b/plugin-dom/translations/dom_hu_HU.ts new file mode 100644 index 0000000..47b5a63 --- /dev/null +++ b/plugin-dom/translations/dom_hu_HU.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/plugin-dom/translations/dom_ja.ts b/plugin-dom/translations/dom_ja.ts index 68617be..7bf60ed 100644 --- a/plugin-dom/translations/dom_ja.ts +++ b/plugin-dom/translations/dom_ja.ts @@ -9,14 +9,30 @@ パネルのDOMツリー - + + Property プロパティー - + Value + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_pt.ts b/plugin-dom/translations/dom_pt.ts index 957f3e0..17e1bbd 100644 --- a/plugin-dom/translations/dom_pt.ts +++ b/plugin-dom/translations/dom_pt.ts @@ -9,14 +9,30 @@ Árvore do painel DOM - + + Property Propriedade - + Value Valor + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_ru.desktop b/plugin-dom/translations/dom_ru.desktop index 7ef95e4..f97ba11 100644 --- a/plugin-dom/translations/dom_ru.desktop +++ b/plugin-dom/translations/dom_ru.desktop @@ -2,4 +2,4 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name[ru]=Дерево DOM панели. -Comment[ru]=Показать дерево DOM панели LXDE-Qt. +Comment[ru]=Показать дерево DOM панели LXQt. diff --git a/plugin-dom/translations/dom_ru.ts b/plugin-dom/translations/dom_ru.ts index d14b34f..219982a 100644 --- a/plugin-dom/translations/dom_ru.ts +++ b/plugin-dom/translations/dom_ru.ts @@ -9,14 +9,30 @@ Дерево DOM панели - + + Property Свойство - + Value Значение + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_ru_RU.desktop b/plugin-dom/translations/dom_ru_RU.desktop index d07ba5a..ddf0c19 100644 --- a/plugin-dom/translations/dom_ru_RU.desktop +++ b/plugin-dom/translations/dom_ru_RU.desktop @@ -2,4 +2,4 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name[ru_RU]=Дерево DOM панели. -Comment[ru_RU]=Показать дерево DOM панели LXDE-Qt. +Comment[ru_RU]=Показать дерево DOM панели LXQt. diff --git a/plugin-dom/translations/dom_ru_RU.ts b/plugin-dom/translations/dom_ru_RU.ts index d6e1a63..6d09d78 100644 --- a/plugin-dom/translations/dom_ru_RU.ts +++ b/plugin-dom/translations/dom_ru_RU.ts @@ -9,14 +9,30 @@ Дерево DOM панели - + + Property Свойство - + Value Значение + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/treewindow.cpp b/plugin-dom/treewindow.cpp index e930ec8..78426b9 100644 --- a/plugin-dom/treewindow.cpp +++ b/plugin-dom/treewindow.cpp @@ -29,9 +29,9 @@ #include "treewindow.h" #include "ui_treewindow.h" #include "domtreeitem.h" - #include #include +#include #define PROP_OBJECT_NAME 0 #define PROP_CLASS_NAME 1 @@ -39,9 +39,6 @@ #define PROP_CLASS_HIERARCY 3 -/************************************************ - - ************************************************/ TreeWindow::TreeWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::TreeWindow) @@ -72,21 +69,19 @@ TreeWindow::TreeWindow(QWidget *parent) : connect(ui->tree, SIGNAL(itemSelectionChanged()), this, SLOT(updatePropertiesView())); item->setSelected(true); + QHeaderView* h = new QHeaderView(Qt::Horizontal); + h->setStretchLastSection(true); + ui->allPropertiesView->setHorizontalHeader(h); + connect(h, &QHeaderView::sectionDoubleClicked, this, &TreeWindow::sectionDoubleClickedSlot); } -/************************************************ - - ************************************************/ TreeWindow::~TreeWindow() { delete ui; } -/************************************************ - - ************************************************/ void TreeWindow::initPropertiesView() { ui->propertiesView->viewport()->setAutoFillBackground(false); @@ -115,9 +110,6 @@ void TreeWindow::initPropertiesView() } -/************************************************ - - ************************************************/ void TreeWindow::updatePropertiesView() { if (ui->tree->selectedItems().isEmpty()) @@ -139,22 +131,42 @@ void TreeWindow::updatePropertiesView() ui->propertiesView->item(PROP_CLASS_NAME, 1)->setText(treeItem->widgetClassName()); ui->propertiesView->item(PROP_TEXT, 1)->setText(treeItem->widgetText()); ui->propertiesView->item(PROP_CLASS_HIERARCY, 1)->setText(treeItem->widgetClassHierarcy().join(" :: ")); -} + QString s; + QDebug out(&s); + QMetaObject const * const m = treeItem->widget()->metaObject(); + const int curr_cnt = ui->allPropertiesView->rowCount(); + ui->allPropertiesView->setRowCount(m->propertyCount()); + for (int i = 0, cnt = m->propertyCount(); cnt > i; ++i) + { + if (curr_cnt <= i) + { + ui->allPropertiesView->setItem(i, 0, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 1, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 2, new QTableWidgetItem); + } + QMetaProperty const & prop = m->property(i); + ui->allPropertiesView->item(i, 0)->setText(prop.name()); + ui->allPropertiesView->item(i, 1)->setText(prop.typeName()); + s.clear(); + out << prop.read(treeItem->widget()); + ui->allPropertiesView->item(i, 2)->setText(s); + } + for (int i = m->propertyCount(); curr_cnt > i; ++i) + ui->allPropertiesView->removeRow(i); +} -/************************************************ - ************************************************/ void TreeWindow::clearPropertiesView() { for (int i=0; ipropertiesView->rowCount(); ++i) ui->propertiesView->item(i, 1)->setText(""); + for (int i = ui->allPropertiesView->rowCount(); 0 <= i; --i) + ui->allPropertiesView->removeRow(i); + ui->allPropertiesView->setRowCount(0); } - - - - - - - +void TreeWindow::sectionDoubleClickedSlot(int column) +{ + ui->allPropertiesView->sortByColumn(column, Qt::AscendingOrder); +} diff --git a/plugin-dom/treewindow.h b/plugin-dom/treewindow.h index de0e7ab..e4c9f91 100644 --- a/plugin-dom/treewindow.h +++ b/plugin-dom/treewindow.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef TREEWINDOW_H #define TREEWINDOW_H #include #include + class QTreeWidgetItem; class QTreeWidget; class QEvent; @@ -41,11 +41,10 @@ class TreeWindow; } - class TreeWindow : public QMainWindow { Q_OBJECT - + public: explicit TreeWindow(QWidget *parent = 0); ~TreeWindow(); @@ -53,6 +52,7 @@ public: private slots: void updatePropertiesView(); void clearPropertiesView(); + void sectionDoubleClickedSlot(int column); private: Ui::TreeWindow *ui; diff --git a/plugin-dom/treewindow.ui b/plugin-dom/treewindow.ui index d27a7b3..042dda1 100644 --- a/plugin-dom/treewindow.ui +++ b/plugin-dom/treewindow.ui @@ -6,7 +6,7 @@ 0 0 - 601 + 800 424 @@ -33,26 +33,83 @@ - - - QFrame::NoFrame - - - Qt::DotLine + + + + 1 + 0 + - - true - - - - Property - - - - - Value - - + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + 1 + 0 + + + + true + + + + Property + + + + + Value + + + + + + + + All properties + + + + 0 + 0 + + + + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + Property + + + + + Type + + + + + String value + + + + + + diff --git a/plugin-kbindicator/CMakeLists.txt b/plugin-kbindicator/CMakeLists.txt index 9b8f33a..e235b51 100644 --- a/plugin-kbindicator/CMakeLists.txt +++ b/plugin-kbindicator/CMakeLists.txt @@ -1,29 +1,64 @@ set(PLUGIN "kbindicator") -find_package(KF5GuiAddons REQUIRED) - set(HEADERS - lxqtkbindicator.h - lxqtkbindicatorconfiguration.h + src/kbdstate.h + src/settings.h + src/content.h + src/kbdlayout.h + src/kbdinfo.h + src/kbdkeeper.h + src/kbdwatcher.h + src/controls.h + src/kbdstateconfig.h ) set(SOURCES - lxqtkbindicator.cpp - lxqtkbindicatorconfiguration.cpp -) - -set(MOCS - lxqtkbindicator.h - lxqtkbindicatorconfiguration.h + kbindicator-plugin.cpp + src/kbdstate.cpp + src/settings.cpp + src/content.cpp + src/kbdkeeper.cpp + src/kbdwatcher.cpp + src/kbdstateconfig.cpp ) set(UIS - lxqtkbindicatorconfiguration.ui + src/kbdstateconfig.ui ) set(LIBRARIES - ${LIBRARIES} - KF5::GuiAddons ) +find_package(PkgConfig REQUIRED) +pkg_check_modules(XKB_COMMON REQUIRED xkbcommon) +pkg_check_modules(XKB_COMMON_X11 QUIET xkbcommon-x11) + +if(XKB_COMMON_X11_FOUND) + message(STATUS "XkbCommon X11 was found") + find_package(Qt5 COMPONENTS X11Extras Xml) + pkg_check_modules(XCB_XCB xcb-xkb) + + set(HEADERS + ${HEADERS} + src/x11/kbdlayout.h + ) + + set(SOURCES + ${SOURCES} + src/x11/kbdlayout.cpp + ) + + set(LIBRARIES + ${LIBRARIES} + ${XKB_COMMON_X11_LIBRARIES} + ${XCB_XCB_LIBRARIES} + Qt5::Xml + ) + + add_definitions(-DX11_ENABLED) +else() + message(FATAL_ERROR "No XkbCommon backend(X11) found!") +endif() + BUILD_LXQT_PLUGIN(${PLUGIN}) + diff --git a/plugin-kbindicator/kbindicator-plugin.cpp b/plugin-kbindicator/kbindicator-plugin.cpp new file mode 100644 index 0000000..c81ba00 --- /dev/null +++ b/plugin-kbindicator/kbindicator-plugin.cpp @@ -0,0 +1,18 @@ +#include +#include "src/kbdstate.h" +#include "../panel/ilxqtpanelplugin.h" + +class LxQtKbIndicatorPlugin: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + virtual ~LxQtKbIndicatorPlugin() + {} + + virtual ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { return new KbdState(startupInfo); } +}; + +#include "kbindicator-plugin.moc" diff --git a/plugin-kbindicator/lxqtkbindicator.cpp b/plugin-kbindicator/lxqtkbindicator.cpp deleted file mode 100644 index e6c6411..0000000 --- a/plugin-kbindicator/lxqtkbindicator.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Kuzma Shapran - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "lxqtkbindicator.h" -#include -#include -#include -#include - -LxQtKbIndicator::LxQtKbIndicator(const ILxQtPanelPluginStartupInfo &startupInfo): - QObject(), - ILxQtPanelPlugin(startupInfo), - mContent(new QWidget()) -{ - modifierInfo = new KModifierKeyInfo(this); - connect(modifierInfo, SIGNAL(keyLocked(Qt::Key, bool)), this, SLOT(modifierStateChanged(Qt::Key, bool))); - - QHBoxLayout *layout = new QHBoxLayout(mContent); - mContent->setLayout(layout); - - mCapsLock = new QLabel("C"); - mCapsLock->setObjectName("CapsLockLabel"); - mCapsLock->setAlignment(Qt::AlignCenter); - mCapsLock->installEventFilter(this); - mContent->layout()->addWidget(mCapsLock); - - mNumLock = new QLabel("N"); - mNumLock->setObjectName("NumLockLabel"); - mNumLock->setAlignment(Qt::AlignCenter); - mNumLock->installEventFilter(this); - mContent->layout()->addWidget(mNumLock); - - mScrollLock = new QLabel("S"); - mScrollLock->setObjectName("ScrollLockLabel"); - mScrollLock->setAlignment(Qt::AlignCenter); - mScrollLock->installEventFilter(this); - mContent->layout()->addWidget(mScrollLock); - - QTimer::singleShot(0, this, SLOT(delayedInit())); -} - -LxQtKbIndicator::~LxQtKbIndicator() -{ - delete mContent; -} - -void LxQtKbIndicator::delayedInit() -{ - settingsChanged(); - realign(); -} - -QWidget *LxQtKbIndicator::widget() -{ - return mContent; -} - -void LxQtKbIndicator::settingsChanged() -{ - mShowCapsLock = settings()->value("show_caps_lock", true).toBool(); - mShowNumLock = settings()->value("show_num_lock", true).toBool(); - mShowScrollLock = settings()->value("show_scroll_lock", true).toBool(); - - mCapsLock->setVisible(mShowCapsLock); - mNumLock->setVisible(mShowNumLock); - mScrollLock->setVisible(mShowScrollLock); - - mCapsLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_CapsLock)); - mNumLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_NumLock)); - mScrollLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_ScrollLock)); -} - -QDialog *LxQtKbIndicator::configureDialog() -{ - return new LxQtKbIndicatorConfiguration(settings()); -} - -void LxQtKbIndicator::realign() -{ - if (panel()->isHorizontal()) - mContent->setMinimumSize(0, panel()->iconSize()); - else - mContent->setMinimumSize(panel()->iconSize(), 0); -} - -void LxQtKbIndicator::modifierStateChanged(Qt::Key key, bool active) -{ - switch (key) - { - case Qt::Key_CapsLock: - mCapsLock->setEnabled(active); - break; - - case Qt::Key_NumLock: - mNumLock->setEnabled(active); - break; - - case Qt::Key_ScrollLock: - mScrollLock->setEnabled(active); - break; - - default: - break; - } -} - -bool LxQtKbIndicator::eventFilter(QObject *object, QEvent *event) -{ - if (event->type() == QEvent::QEvent::MouseButtonRelease) - { - if (object == mCapsLock) - modifierInfo->setKeyLocked(Qt::Key_CapsLock, !modifierInfo->isKeyLocked(Qt::Key_CapsLock)); - else if (object == mNumLock) - modifierInfo->setKeyLocked(Qt::Key_NumLock, !modifierInfo->isKeyLocked(Qt::Key_NumLock)); - else if (object == mScrollLock) - modifierInfo->setKeyLocked(Qt::Key_ScrollLock, !modifierInfo->isKeyLocked(Qt::Key_ScrollLock)); - - return true; - } - - return QObject::eventFilter(object, event); -} diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp b/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp deleted file mode 100644 index 7939b6a..0000000 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Kuzma Shapran - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - - -#include "lxqtkbindicatorconfiguration.h" -#include "ui_lxqtkbindicatorconfiguration.h" - - -LxQtKbIndicatorConfiguration::LxQtKbIndicatorConfiguration(QSettings *settings, QWidget *parent) : - QDialog(parent), - ui(new Ui::LxQtKbIndicatorConfiguration), - mSettings(settings), - oldSettings(settings) -{ - setAttribute(Qt::WA_DeleteOnClose); - setObjectName("KbIndicatorConfigurationWindow"); - ui->setupUi(this); - - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); - - connect(ui->capsLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->numLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->scrollLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - - loadSettings(); -} - -LxQtKbIndicatorConfiguration::~LxQtKbIndicatorConfiguration() -{ - delete ui; -} - -void LxQtKbIndicatorConfiguration::loadSettings() -{ - ui->capsLockCB->setChecked(mSettings->value("show_caps_lock", true).toBool()); - ui->numLockCB->setChecked(mSettings->value("show_num_lock", true).toBool()); - ui->scrollLockCB->setChecked(mSettings->value("show_scroll_lock", true).toBool()); -} - -void LxQtKbIndicatorConfiguration::saveSettings() -{ - mSettings->setValue("show_caps_lock", ui->capsLockCB->isChecked()); - mSettings->setValue("show_num_lock", ui->numLockCB->isChecked()); - mSettings->setValue("show_scroll_lock", ui->scrollLockCB->isChecked()); -} - -void LxQtKbIndicatorConfiguration::dialogButtonsAction(QAbstractButton *btn) -{ - if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) - { - oldSettings.loadToSettings(); - loadSettings(); - } - else - close(); -} diff --git a/plugin-kbindicator/resources/kbindicator.desktop.in b/plugin-kbindicator/resources/kbindicator.desktop.in index fc9623a..1fa16db 100644 --- a/plugin-kbindicator/resources/kbindicator.desktop.in +++ b/plugin-kbindicator/resources/kbindicator.desktop.in @@ -1,8 +1,8 @@ [Desktop Entry] Type=Service ServiceTypes=LxQtPanel/Plugin -Name=Keyboard indicator -Comment=Keyboard indicator plugin. +Name=Keyboard state indicator +Comment=Keyboard state indicator and switcher plugin. Icon=input-keyboard #TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/src/content.cpp b/plugin-kbindicator/src/content.cpp new file mode 100644 index 0000000..3313a86 --- /dev/null +++ b/plugin-kbindicator/src/content.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include "kbdstate.h" +#include "content.h" + +Content::Content(bool layoutEnabled): + QWidget(), + m_layoutEnabled(layoutEnabled) +{ + QBoxLayout *box = new QBoxLayout(QBoxLayout::LeftToRight); + box->setContentsMargins(0, 0, 0, 0); + box->setSpacing(0); + setLayout(box); + + m_capsLock = new QLabel("C"); + m_capsLock->setObjectName("CapsLockLabel"); + m_capsLock->setAlignment(Qt::AlignCenter); + m_capsLock->installEventFilter(this); + layout()->addWidget(m_capsLock); + + m_numLock = new QLabel("N"); + m_numLock->setObjectName("NumLockLabel"); + m_numLock->setAlignment(Qt::AlignCenter); + m_numLock->installEventFilter(this); + layout()->addWidget(m_numLock); + + m_scrollLock = new QLabel("S"); + m_scrollLock->setObjectName("ScrollLockLabel"); + m_scrollLock->setAlignment(Qt::AlignCenter); + m_scrollLock->installEventFilter(this); + layout()->addWidget(m_scrollLock); + + m_layout = new QLabel; + m_layout->setObjectName("LayoutLabel"); + m_layout->setAlignment(Qt::AlignCenter); + m_layout->installEventFilter(this); + layout()->addWidget(m_layout); +} + +Content::~Content() +{} + +bool Content::setup() +{ + m_capsLock->setVisible(Settings::instance().showCapLock()); + m_numLock->setVisible(Settings::instance().showNumLock()); + m_scrollLock->setVisible(Settings::instance().showScrollLock()); + m_layout->setVisible(m_layoutEnabled && Settings::instance().showLayout()); + return true; +} + +void Content::layoutChanged(const QString & sym, const QString & name, const QString & variant) +{ + m_layout->setText(sym.toUpper()); + QString txt = QString("\ + \ + \ +
%1: %3
%2: %4
").arg(tr("Layout")).arg(tr("Variant")).arg(name).arg(variant); + m_layout->setToolTip(txt); +} + +void Content::modifierStateChanged(Controls mod, bool active) +{ + setEnabled(mod, active); +} + + +void Content::setEnabled(Controls cnt, bool enabled) +{ + widget(cnt)->setEnabled(enabled); +} + +QWidget* Content::widget(Controls cnt) const +{ + switch(cnt){ + case Caps: return m_capsLock; + case Num: return m_numLock; + case Scroll: return m_scrollLock; + case Layout: return m_layout; + } + return 0; +} + +bool Content::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::QEvent::MouseButtonRelease) + { + if (object == m_capsLock) + emit controlClicked(Controls::Caps); + else if (object == m_numLock) + emit controlClicked(Controls::Num); + else if (object == m_scrollLock) + emit controlClicked(Controls::Scroll); + else if(object == m_layout){ + emit controlClicked(Controls::Layout); + } + return true; + } + + return QObject::eventFilter(object, event); +} + +void Content::showHorizontal() +{ + qobject_cast(layout())->setDirection(QBoxLayout::LeftToRight); +} + +void Content::showVertical() +{ + qobject_cast(layout())->setDirection(QBoxLayout::TopToBottom); +} + diff --git a/plugin-kbindicator/src/content.h b/plugin-kbindicator/src/content.h new file mode 100644 index 0000000..5395d53 --- /dev/null +++ b/plugin-kbindicator/src/content.h @@ -0,0 +1,38 @@ +#ifndef _CONTENT_H_ +#define _CONTENT_H_ + +#include +#include "controls.h" + +class QLabel; + +class Content : public QWidget +{ + Q_OBJECT +public: + Content(bool layoutEnabled); + ~Content(); + +public: + void setEnabled(Controls cnt, bool enabled); + QWidget* widget(Controls cnt) const; + bool setup(); + + virtual bool eventFilter(QObject *object, QEvent *event); + + void showHorizontal(); + void showVertical(); +public slots: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); +signals: + void controlClicked(Controls cnt); +private: + bool m_layoutEnabled; + QLabel *m_capsLock; + QLabel *m_numLock; + QLabel *m_scrollLock; + QLabel *m_layout; +}; + +#endif diff --git a/plugin-kbindicator/src/controls.h b/plugin-kbindicator/src/controls.h new file mode 100644 index 0000000..b751619 --- /dev/null +++ b/plugin-kbindicator/src/controls.h @@ -0,0 +1,11 @@ +#ifndef _CONTROLS_H_ +#define _CONTROLS_H_ + +enum Controls { + Caps, + Num, + Scroll, + Layout +}; + +#endif diff --git a/plugin-kbindicator/src/kbdinfo.h b/plugin-kbindicator/src/kbdinfo.h new file mode 100644 index 0000000..24d4e71 --- /dev/null +++ b/plugin-kbindicator/src/kbdinfo.h @@ -0,0 +1,52 @@ +#ifndef _KBDINFO_H_ +#define _KBDINFO_H_ + +#include +#include + +class KbdInfo +{ +public: + KbdInfo() + {} + + struct Info + { + QString sym; + QString name; + QString variant; + }; + +public: + const QString & currentSym() const + { return m_keyboardInfo[m_current].sym; } + + const QString & currentName() const + { return m_keyboardInfo[m_current].name; } + + const QString & currentVariant() const + { return m_keyboardInfo[m_current].variant; } + + int currentGroup() const + { return m_current; } + + void setCurrentGroup(int group) + { m_current = group; } + + uint size() const + { return m_keyboardInfo.size(); } + + const Info & current() const + { return m_keyboardInfo[m_current]; } + + void clear() + { m_keyboardInfo.clear(); } + + void append(const Info & info) + { m_keyboardInfo.append(info); } +private: + QList m_keyboardInfo; + int m_current = 0; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdkeeper.cpp b/plugin-kbindicator/src/kbdkeeper.cpp new file mode 100644 index 0000000..251b552 --- /dev/null +++ b/plugin-kbindicator/src/kbdkeeper.cpp @@ -0,0 +1,160 @@ +#include +#include +#include +#include +#include "kbdkeeper.h" + +//-------------------------------------------------------------------------------------------------- + +KbdKeeper::KbdKeeper(const KbdLayout & layout, KeeperType type): + m_layout(layout), + m_type(type) +{ + m_layout.readKbdInfo(m_info); +} + +KbdKeeper::~KbdKeeper() +{} + +bool KbdKeeper::setup() +{ + connect(&m_layout, SIGNAL(keyboardChanged()), SLOT(keyboardChanged())); + connect(&m_layout, SIGNAL(layoutChanged(uint)), SLOT(layoutChanged(uint))); + connect(&m_layout, SIGNAL(checkState()), SLOT(checkState())); + + return true; +} + +void KbdKeeper::keyboardChanged() +{ + m_layout.readKbdInfo(m_info); + emit changed(); +} + +void KbdKeeper::layoutChanged(uint group) +{ + m_info.setCurrentGroup(group); + emit changed(); +} + +void KbdKeeper::checkState() +{} + +void KbdKeeper::switchToNext() +{ + uint index = m_info.currentGroup(); + if (index < m_info.size() - 1) + ++index; + else + index = 0; + + switchToGroup(index); +} + +void KbdKeeper::switchToGroup(uint group) +{ + m_layout.lockGroup(group); + emit changed(); +} + +//-------------------------------------------------------------------------------------------------- + +WinKbdKeeper::WinKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +WinKbdKeeper::~WinKbdKeeper() +{} + +void WinKbdKeeper::layoutChanged(uint group) +{ + WId win = KWindowSystem::activeWindow(); + + if (m_active == win){ + m_mapping[win] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + } + emit changed(); +} + +void WinKbdKeeper::checkState() +{ + WId win = KWindowSystem::activeWindow(); + + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + emit changed(); +} + +void WinKbdKeeper::switchToGroup(uint group) +{ + WId win = KWindowSystem::activeWindow(); + m_mapping[win] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} + + +//-------------------------------------------------------------------------------------------------- + +AppKbdKeeper::AppKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +AppKbdKeeper::~AppKbdKeeper() +{} + +void AppKbdKeeper::layoutChanged(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (m_active == app){ + m_mapping[app] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + } + emit changed(); +} + +void AppKbdKeeper::checkState() +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + emit changed(); +} + + +void AppKbdKeeper::switchToGroup(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + m_mapping[app] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} diff --git a/plugin-kbindicator/src/kbdkeeper.h b/plugin-kbindicator/src/kbdkeeper.h new file mode 100644 index 0000000..3b41630 --- /dev/null +++ b/plugin-kbindicator/src/kbdkeeper.h @@ -0,0 +1,80 @@ +#ifndef _KBDKEEPER_H_ +#define _KBDKEEPER_H_ + +#include +#include +#include "kbdlayout.h" +#include "kbdinfo.h" +#include "settings.h" + +//-------------------------------------------------------------------------------------------------- + +class KbdKeeper: public QObject +{ + Q_OBJECT +public: + KbdKeeper(const KbdLayout & layout, KeeperType type = KeeperType::Global); + virtual ~KbdKeeper(); + virtual bool setup(); + + const QString & sym() const + { return m_info.currentSym(); } + + const QString & name() const + { return m_info.currentName(); } + + const QString & variant() const + { return m_info.currentVariant(); } + + KeeperType type() const + { return m_type; } + + void switchToNext(); + virtual void switchToGroup(uint group); +protected slots: + virtual void keyboardChanged(); + virtual void layoutChanged(uint group); + virtual void checkState(); +signals: + void changed(); +protected: + const KbdLayout & m_layout; + KbdInfo m_info; + KeeperType m_type; +}; + +//-------------------------------------------------------------------------------------------------- + +class WinKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + WinKbdKeeper(const KbdLayout & layout); + virtual ~WinKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + WId m_active; +}; + +//-------------------------------------------------------------------------------------------------- + +class AppKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + AppKbdKeeper(const KbdLayout & layout); + virtual ~AppKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + QString m_active; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdlayout.h b/plugin-kbindicator/src/kbdlayout.h new file mode 100644 index 0000000..cf95f61 --- /dev/null +++ b/plugin-kbindicator/src/kbdlayout.h @@ -0,0 +1,9 @@ +#ifndef _KBDLAYOUT_H_ +#define _KBDLAYOUT_H_ + +#ifdef X11_ENABLED +#include "x11/kbdlayout.h" +typedef X11Kbd KbdLayout; +#endif + +#endif diff --git a/plugin-kbindicator/src/kbdstate.cpp b/plugin-kbindicator/src/kbdstate.cpp new file mode 100644 index 0000000..157958b --- /dev/null +++ b/plugin-kbindicator/src/kbdstate.cpp @@ -0,0 +1,46 @@ +#include +#include + +#include "kbdstate.h" +#include "kbdkeeper.h" +#include "kbdstateconfig.h" +#include + +KbdState::KbdState(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + m_content(m_watcher.isLayoutEnabled()) +{ + Settings::instance().init(settings()); + + connect(&m_content, &Content::controlClicked, &m_watcher, &KbdWatcher::controlClicked); + connect(&m_watcher, &KbdWatcher::layoutChanged, &m_content, &Content::layoutChanged); + connect(&m_watcher, &KbdWatcher::modifierStateChanged, &m_content, &Content::modifierStateChanged); + + settingsChanged(); +} + +KbdState::~KbdState() +{} + +void KbdState::settingsChanged() +{ + m_content.setup(); + m_watcher.setup(); +} + +QDialog *KbdState::configureDialog() +{ + return new KbdStateConfig(&m_content); +} + +void KbdState::realign() +{ + if (panel()->isHorizontal()){ + m_content.setMinimumSize(0, panel()->iconSize()); + m_content.showHorizontal(); + } else { + m_content.setMinimumSize(panel()->iconSize(), 0); + m_content.showVertical(); + } +} diff --git a/plugin-kbindicator/src/kbdstate.h b/plugin-kbindicator/src/kbdstate.h new file mode 100644 index 0000000..f958eed --- /dev/null +++ b/plugin-kbindicator/src/kbdstate.h @@ -0,0 +1,49 @@ +#ifndef _KDBSTATE_H_ +#define _KDBSTATE_H_ + +#include "../panel/ilxqtpanelplugin.h" +#include "settings.h" +#include "content.h" +#include "kbdwatcher.h" + +class QLabel; + +class KbdState : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + KbdState(const ILxQtPanelPluginStartupInfo &startupInfo); + virtual ~KbdState(); + + virtual QString themeId() const + { return "KbIndicator"; } + + virtual ILxQtPanelPlugin::Flags flags() const + { return PreferRightAlignment | HaveConfigDialog; } + + virtual bool isSeparate() const + { return false; } + + virtual QWidget *widget() + { return &m_content; } + + QDialog *configureDialog(); + virtual void realign(); + + const Settings & prefs() const + { return m_settings; } + + Settings & prefs() + { return m_settings; } + +protected slots: + virtual void settingsChanged(); + +private: + Settings m_settings; + KbdWatcher m_watcher; + Content m_content; +}; + + +#endif diff --git a/plugin-kbindicator/src/kbdstateconfig.cpp b/plugin-kbindicator/src/kbdstateconfig.cpp new file mode 100644 index 0000000..5a08447 --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.cpp @@ -0,0 +1,84 @@ +#include +#include +#include "kbdstateconfig.h" +#include "ui_kbdstateconfig.h" +#include "settings.h" + +KbdStateConfig::KbdStateConfig(QWidget *parent) : + QDialog(parent), + m_ui(new Ui::KbdStateConfig) +{ + setAttribute(Qt::WA_DeleteOnClose); + m_ui->setupUi(this); + + connect(m_ui->showCaps, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showNum, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showScroll, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showLayout, &QCheckBox::clicked, this, &KbdStateConfig::save); + + connect(m_ui->modes, static_cast(&QButtonGroup::buttonClicked), + [this](int){ + KbdStateConfig::save(); + } + ); + + connect(m_ui->showLayout, &QCheckBox::stateChanged, [this](int checked){ + //m_ui->showFlags->setEnabled(checked); //TODO: Country flags support + m_ui->switchGlobal->setEnabled(checked); + m_ui->switchWindow->setEnabled(checked); + m_ui->switchApplication->setEnabled(checked); + }); + + connect(m_ui->configureLayouts, &QPushButton::clicked, this, &KbdStateConfig::configureLayouts); + + load(); +} + +KbdStateConfig::~KbdStateConfig() +{ + delete m_ui; +} + +void KbdStateConfig::load() +{ + Settings & sets = Settings::instance(); + + m_ui->showCaps->setChecked(sets.showCapLock()); + m_ui->showNum->setChecked(sets.showNumLock()); + m_ui->showScroll->setChecked(sets.showScrollLock()); + m_ui->showLayout->setChecked(sets.showLayout()); + + switch(sets.keeperType()){ + case KeeperType::Global: + m_ui->switchGlobal->setChecked(true); + break; + case KeeperType::Window: + m_ui->switchWindow->setChecked(true); + break; + case KeeperType::Application: + m_ui->switchApplication->setChecked(true); + break; + } +} + +void KbdStateConfig::save() +{ + Settings & sets = Settings::instance(); + + sets.setShowCapLock(m_ui->showCaps->isChecked()); + sets.setShowNumLock(m_ui->showNum->isChecked()); + sets.setShowScrollLock(m_ui->showScroll->isChecked()); + sets.setShowLayout(m_ui->showLayout->isChecked()); + + if (m_ui->switchGlobal->isChecked()) + sets.setKeeperType(KeeperType::Global); + if (m_ui->switchWindow->isChecked()) + sets.setKeeperType(KeeperType::Window); + if (m_ui->switchApplication->isChecked()) + sets.setKeeperType(KeeperType::Application); +} + +void KbdStateConfig::configureLayouts() +{ + QProcess::startDetached(QStringLiteral("lxqt-config-input")); +} diff --git a/plugin-kbindicator/src/kbdstateconfig.h b/plugin-kbindicator/src/kbdstateconfig.h new file mode 100644 index 0000000..b01972d --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.h @@ -0,0 +1,26 @@ +#ifndef _KBDSTATECONFIG_H_ +#define _KBDSTATECONFIG_H_ + +#include + +namespace Ui { +class KbdStateConfig; +} + +class KbdStateConfig : public QDialog +{ + Q_OBJECT + +public: + explicit KbdStateConfig(QWidget *parent = 0); + ~KbdStateConfig(); +private: + void save(); + void load(); + + void configureLayouts(); +private: + Ui::KbdStateConfig *m_ui; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdstateconfig.ui b/plugin-kbindicator/src/kbdstateconfig.ui new file mode 100644 index 0000000..932933c --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.ui @@ -0,0 +1,222 @@ + + + KbdStateConfig + + + + 0 + 0 + 249 + 390 + + + + Dialog + + + + + + Leds + + + + + + Show Caps Lock + + + + + + + Show Num Lock + + + + + + + Show Scroll Lock + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + Show keyboard layout + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Show flags instead labels + + + + + + + Layout mode: + + + + + + + false + + + Global + + + modes + + + + + + + false + + + Window + + + modes + + + + + + + false + + + Application + + + modes + + + + + + + Configure layouts + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + btns + accepted() + KbdStateConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + btns + rejected() + KbdStateConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + + + + diff --git a/plugin-kbindicator/src/kbdwatcher.cpp b/plugin-kbindicator/src/kbdwatcher.cpp new file mode 100644 index 0000000..539f31d --- /dev/null +++ b/plugin-kbindicator/src/kbdwatcher.cpp @@ -0,0 +1,58 @@ +#include +#include "kbdwatcher.h" + +KbdWatcher::KbdWatcher() +{ + connect(&m_layout, SIGNAL(modifierChanged(Controls,bool)), SIGNAL(modifierStateChanged(Controls,bool))); + m_layout.init(); +} + +void KbdWatcher::setup() +{ + emit modifierStateChanged(Controls::Caps, m_layout.isModifierLocked(Controls::Caps)); + emit modifierStateChanged(Controls::Num, m_layout.isModifierLocked(Controls::Num)); + emit modifierStateChanged(Controls::Scroll, m_layout.isModifierLocked(Controls::Scroll)); + + if (!m_keeper || m_keeper->type() != Settings::instance().keeperType()){ + createKeeper(Settings::instance().keeperType()); + } +} + +void KbdWatcher::createKeeper(KeeperType type) +{ + switch(type) + { + case KeeperType::Global: + m_keeper.reset(new KbdKeeper(m_layout)); + break; + case KeeperType::Window: + m_keeper.reset(new WinKbdKeeper(m_layout)); + break; + case KeeperType::Application: + m_keeper.reset(new AppKbdKeeper(m_layout)); + break; + } + + connect(m_keeper.data(), SIGNAL(changed()), this, SLOT(keeperChanged())); + + m_keeper->setup(); + keeperChanged(); +} + +void KbdWatcher::keeperChanged() +{ + emit layoutChanged(m_keeper->sym(), m_keeper->name(), m_keeper->variant()); +} + +void KbdWatcher::controlClicked(Controls cnt) +{ + switch(cnt){ + case Controls::Layout: + m_keeper->switchToNext(); + break; + default: + m_layout.lockModifier(cnt, !m_layout.isModifierLocked(cnt)); + break; + } + +} diff --git a/plugin-kbindicator/src/kbdwatcher.h b/plugin-kbindicator/src/kbdwatcher.h new file mode 100644 index 0000000..17f580b --- /dev/null +++ b/plugin-kbindicator/src/kbdwatcher.h @@ -0,0 +1,38 @@ +#ifndef _KBDWATCHER_H_ +#define _KBDWATCHER_H_ + +#include "kbdlayout.h" +#include "controls.h" +#include "kbdkeeper.h" + +class KbdKeeper; + +class KbdWatcher: public QObject +{ + Q_OBJECT +public: + KbdWatcher(); + + void setup(); + const KbdLayout & kbdLayout() const + { return m_layout; } + + bool isLayoutEnabled() const + { return m_layout.isEnabled(); } +public slots: + void controlClicked(Controls cnt); +signals: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); + +private: + void createKeeper(KeeperType type); +private slots: + void keeperChanged(); + +private: + KbdLayout m_layout; + QScopedPointer m_keeper; +}; + +#endif diff --git a/plugin-kbindicator/src/settings.cpp b/plugin-kbindicator/src/settings.cpp new file mode 100644 index 0000000..49fab1c --- /dev/null +++ b/plugin-kbindicator/src/settings.cpp @@ -0,0 +1,65 @@ +#include +#include "settings.h" + +Settings::Settings() +{} + +Settings & Settings::instance() +{ + static Settings _instance; + return _instance; +} + +void Settings::init(QSettings *settings) +{ m_settings = settings; } + +bool Settings::showCapLock() const +{ return m_settings->value("show_caps_lock", true).toBool(); } + +bool Settings::showNumLock() const +{ return m_settings->value("show_num_lock", true).toBool(); } + +bool Settings::showScrollLock() const +{ return m_settings->value("show_scroll_lock", true).toBool(); } + +bool Settings::showLayout() const +{ return m_settings->value("show_layout", true).toBool(); } + +void Settings::setShowCapLock(bool show) +{ m_settings->setValue("show_caps_lock", show); } + +void Settings::setShowNumLock(bool show) +{ m_settings->setValue("show_num_lock", show); } + +void Settings::setShowScrollLock(bool show) +{ m_settings->setValue("show_scroll_lock", show); } + +void Settings::setShowLayout(bool show) +{ m_settings->setValue("show_layout", show); } + +KeeperType Settings::keeperType() const +{ + QString type = m_settings->value("keeper_type", "application").toString(); + if(type == "global") + return KeeperType::Global; + if(type == "window") + return KeeperType::Window; + if(type == "application") + return KeeperType::Application; + return KeeperType::Application; +} + +void Settings::setKeeperType(KeeperType type) const +{ + switch (type) { + case KeeperType::Global: + m_settings->setValue("keeper_type", "global"); + break; + case KeeperType::Window: + m_settings->setValue("keeper_type", "window"); + break; + case KeeperType::Application: + m_settings->setValue("keeper_type", "application"); + break; + } +} diff --git a/plugin-kbindicator/src/settings.h b/plugin-kbindicator/src/settings.h new file mode 100644 index 0000000..49e6a56 --- /dev/null +++ b/plugin-kbindicator/src/settings.h @@ -0,0 +1,37 @@ +#ifndef _SETTINGS_H_ +#define _SETTINGS_H_ + +class QSettings; + +enum class KeeperType +{ + Global, + Window, + Application +}; + +class Settings +{ +public: + Settings(); + static Settings & instance(); + + void init(QSettings *settings); + +public: + bool showCapLock() const; + bool showNumLock() const; + bool showScrollLock() const; + bool showLayout() const; + KeeperType keeperType() const; +public: + void setShowCapLock(bool show); + void setShowNumLock(bool show); + void setShowScrollLock(bool show); + void setShowLayout(bool show); + void setKeeperType(KeeperType type) const; +private: + QSettings *m_settings = 0; +}; + +#endif diff --git a/plugin-kbindicator/src/x11/kbdlayout.cpp b/plugin-kbindicator/src/x11/kbdlayout.cpp new file mode 100644 index 0000000..0ddccbb --- /dev/null +++ b/plugin-kbindicator/src/x11/kbdlayout.cpp @@ -0,0 +1,292 @@ +#include +#include +#include +#include +#include +#include "kbdlayout.h" + +#include +#include +#define explicit _explicit +#include +#include "../kbdinfo.h" +#include "../controls.h" + +namespace pimpl { + +struct LangInfo +{ + QString name; + QString syn; + QString variant; +}; + +class X11Kbd: public QAbstractNativeEventFilter +{ +public: + X11Kbd(::X11Kbd *pub): + m_pub(pub) + {} + + bool init() + { + m_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + m_connection = xcb_connect(0, 0); + + if (!m_connection || xcb_connection_has_error(m_connection)){ + qWarning() << "Couldn't connect to X server: error code" + << (m_connection ? xcb_connection_has_error(m_connection) : -1); + return false; + } + + xkb_x11_setup_xkb_extension(m_connection, + XKB_X11_MIN_MAJOR_XKB_VERSION, + XKB_X11_MIN_MINOR_XKB_VERSION, + XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS, + NULL, NULL, &m_eventType, NULL + ); + + m_deviceId = xkb_x11_get_core_keyboard_device_id(m_connection); + qApp->installNativeEventFilter(this); + + readState(); + return true; + } + + virtual ~X11Kbd() + { + xkb_state_unref(m_state); + xkb_keymap_unref(m_keymap); + xcb_disconnect(m_connection); + xkb_context_unref(m_context); + } + + bool isEnabled() const + { return true; } + + virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *) + { + if (eventType != "xcb_generic_event_t") + return false; + + xcb_generic_event_t *event = static_cast(message); + if ((event->response_type & ~0x80) == m_eventType){ + xcb_xkb_state_notify_event_t *sevent = reinterpret_cast(event); + switch(sevent->xkbType){ + case XCB_XKB_STATE_NOTIFY: + xkb_state_update_mask(m_state, + sevent->baseMods, + sevent->latchedMods, + sevent->lockedMods, + sevent->baseGroup, + sevent->latchedGroup, + sevent->lockedGroup + ); + + if(sevent->changed & XCB_XKB_STATE_PART_GROUP_STATE){ + emit m_pub->layoutChanged(sevent->group); + } + + if(sevent->changed & XCB_XKB_STATE_PART_MODIFIER_LOCK){ + for(Controls cnt: m_modifiers.keys()){ + bool oldState = m_modifiers[cnt]; + bool newState = xkb_state_led_name_is_active(m_state, modName(cnt)); + if(oldState != newState){ + m_modifiers[cnt] = newState; + emit m_pub->modifierChanged(cnt, newState); + } + } + } + break; + case XCB_XKB_NEW_KEYBOARD_NOTIFY: + readState(); + break; + } + } + + emit m_pub->checkState(); + return false; + } + + void readKbdInfo(KbdInfo & info) const + { + info.clear(); + xkb_layout_index_t count = xkb_keymap_num_layouts(m_keymap); + for(xkb_layout_index_t i = 0; i < count; ++i){ + QString name = xkb_keymap_layout_get_name(m_keymap, i); + const LangInfo & linfo = names(name); + info.append({linfo.syn, linfo.name, linfo.variant}); + if (xkb_state_layout_index_is_active(m_state, i, XKB_STATE_LAYOUT_EFFECTIVE)) + info.setCurrentGroup(i); + } + } + + void lockGroup(uint group) + { + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, 0, 0, 1, group, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + void lockModifier(Controls cnt, bool locked) + { + quint8 mask = fetchMask(cnt); + quint8 curMask = locked ? mask : 0; + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, mask, curMask, 0, 0, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + bool isModifierLocked(Controls cnt) const + { return m_modifiers[cnt]; } + +private: + quint8 fetchMask(Controls cnt) const + { + static QHash masks; + if (masks.contains(cnt)) + return masks[cnt]; + + xkb_mod_index_t index = xkb_keymap_led_get_index(m_keymap, modName(cnt)); + + xcb_generic_error_t *error = 0; + quint8 mask = 0; + + xcb_xkb_get_indicator_map_cookie_t cookie = xcb_xkb_get_indicator_map(m_connection, m_deviceId, 1 << index); + xcb_xkb_get_indicator_map_reply_t *reply = xcb_xkb_get_indicator_map_reply(m_connection, cookie, &error); + + + if (!reply || error){ + qWarning() << "Cannot fetch mask " << error->error_code; + return mask; + } + + xcb_xkb_indicator_map_t *map = xcb_xkb_get_indicator_map_maps(reply); + + mask = map->mods; + masks[cnt] = mask; + + free(reply); + return mask; + } + + const char * modName(Controls cnt) const + { + switch(cnt){ + case Controls::Caps: + return XKB_LED_NAME_CAPS; + case Controls::Num: + return XKB_LED_NAME_NUM; + case Controls::Scroll: + return XKB_LED_NAME_SCROLL; + default: + return 0; + } + } + + void readState() + { + if (m_keymap) + xkb_keymap_unref(m_keymap); + m_keymap = xkb_x11_keymap_new_from_device(m_context, m_connection, m_deviceId, (xkb_keymap_compile_flags)0); + + if (m_state) + xkb_state_unref(m_state); + m_state = xkb_x11_state_new_from_device(m_keymap, m_connection, m_deviceId); + + for(Controls cnt: m_modifiers.keys()){ + m_modifiers[cnt] = xkb_state_led_name_is_active(m_state, modName(cnt)); + } + emit m_pub->keyboardChanged(); + } + + const LangInfo & names(const QString & langName) const + { + static LangInfo def{"Unknown", "??", "None"}; + static QHash names; + if (names.empty()){ + if(QFile::exists("/usr/share/X11/xkb/rules/evdev.xml")){ + QDomDocument doc; + + QFile file("/usr/share/X11/xkb/rules/evdev.xml"); + if (file.open(QIODevice::ReadOnly)){ + if (doc.setContent(&file)) { + QDomElement docElem = doc.documentElement(); + + auto layout= docElem.firstChildElement("layoutList"); + for(int i = 0; i < layout.childNodes().count(); ++i){ + auto conf = layout.childNodes().at(i).firstChildElement("configItem"); + names.insert( + conf.firstChildElement("description").firstChild().toText().data(),{ + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + "None" + } + ); + auto variants = layout.childNodes().at(i).firstChildElement("variantList"); + for(int j = 0; j < variants.childNodes().count(); ++j){ + auto var = variants.childNodes().at(j).firstChildElement("configItem"); + names.insert( + var.firstChildElement("description").firstChild().toText().data(), { + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + var.firstChildElement("name").firstChild().toText().data() + } + ); + } + } + } + file.close(); + } + } + } + if (names.contains(langName)) + return names[langName]; + return def; + } + +private: + struct xkb_context *m_context = 0; + xcb_connection_t *m_connection = 0; + int32_t m_deviceId; + uint8_t m_eventType; + xkb_state *m_state = 0; + xkb_keymap *m_keymap = 0; + ::X11Kbd *m_pub; + QHash m_modifiers = { + {Controls::Caps, false}, + {Controls::Num, false}, + {Controls::Scroll, false}, + }; +}; + +} + +X11Kbd::X11Kbd(): + m_priv(new pimpl::X11Kbd(this)) +{} + +X11Kbd::~X11Kbd() +{} + +bool X11Kbd::init() +{ return m_priv->init(); } + +bool X11Kbd::isEnabled() const +{ return true; } + +void X11Kbd::readKbdInfo(KbdInfo & info) const +{ m_priv->readKbdInfo(info); } + +void X11Kbd::lockGroup(uint layId) const +{ m_priv->lockGroup(layId); } + +void X11Kbd::lockModifier(Controls cnt, bool locked) +{ m_priv->lockModifier(cnt, locked); } + +bool X11Kbd::isModifierLocked(Controls cnt) const +{ return m_priv->isModifierLocked(cnt); } diff --git a/plugin-kbindicator/src/x11/kbdlayout.h b/plugin-kbindicator/src/x11/kbdlayout.h new file mode 100644 index 0000000..2e11b73 --- /dev/null +++ b/plugin-kbindicator/src/x11/kbdlayout.h @@ -0,0 +1,34 @@ +#ifndef _X11KBD_H_ +#define _X11KBD_H_ + +#include +#include "../controls.h" + +class KbdInfo; + +namespace pimpl +{ class X11Kbd; } + +class X11Kbd: public QObject +{ + Q_OBJECT +public: + X11Kbd(); + virtual ~X11Kbd(); + + bool init(); + bool isEnabled() const; + void readKbdInfo(KbdInfo & info) const; + void lockGroup(uint layId) const; + void lockModifier(Controls cnt, bool locked); + bool isModifierLocked(Controls cnt) const; +signals: + void layoutChanged(uint layId); + void modifierChanged(Controls cnt, bool locked); + void checkState(); + void keyboardChanged(); +private: + QScopedPointer m_priv; +}; + +#endif diff --git a/plugin-kbindicator/translations/kbindicator.ts b/plugin-kbindicator/translations/kbindicator.ts index 27054fb..26dc157 100644 --- a/plugin-kbindicator/translations/kbindicator.ts +++ b/plugin-kbindicator/translations/kbindicator.ts @@ -1,26 +1,79 @@ - + - LxQtKbIndicatorConfiguration + Content - - Keyboard Indicator Settings + + Layout - - Caps Lock + + Variant + + + + + KbdStateConfig + + + Dialog + + + + + Leds + + + + + Show Caps Lock + + + + + Show Num Lock + + + + + Show Scroll Lock + + + + + Show keyboard layout + + + + + Show flags instead labels + + + + + Layout mode: + + + + + Global + + + + + Window - - Num Lock + + Application - - Scroll Lock + + Configure layouts diff --git a/plugin-kbindicator/translations/kbindicator_de.desktop b/plugin-kbindicator/translations/kbindicator_de.desktop new file mode 100644 index 0000000..6852c6b --- /dev/null +++ b/plugin-kbindicator/translations/kbindicator_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Tastatur-LED-Anzeige +Comment[de]=Plugin zum Anzeigen der Tastatur-LEDs und Umschalten des Layouts. diff --git a/plugin-kbindicator/translations/kbindicator_de.ts b/plugin-kbindicator/translations/kbindicator_de.ts new file mode 100644 index 0000000..e0060a8 --- /dev/null +++ b/plugin-kbindicator/translations/kbindicator_de.ts @@ -0,0 +1,80 @@ + + + + + Content + + + Layout + Layout + + + + Variant + Variante + + + + KbdStateConfig + + + Dialog + Tastatur + + + + Leds + LEDs + + + + Show Caps Lock + Feststelltaste anzeigen + + + + Show Num Lock + NumLock-Taste anzeigen + + + + Show Scroll Lock + Rollen-Taste anzeigen + + + + Show keyboard layout + Tastatur-Layout anzeigen + + + + Show flags instead labels + Flaggen statt Kennung anzeigen + + + + Layout mode: + Layout-Modus: + + + + Global + Global + + + + Window + Fenster + + + + Application + Anwendung + + + + Configure layouts + Layout konfigurieren... + + + diff --git a/plugin-kbindicator/translations/kbindicator_ja.desktop b/plugin-kbindicator/translations/kbindicator_ja.desktop deleted file mode 100644 index 4ad41d9..0000000 --- a/plugin-kbindicator/translations/kbindicator_ja.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ja]=キーボードインジケーター -Comment[ja]=キーボードインジケーターのプラグイン - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ja.ts b/plugin-kbindicator/translations/kbindicator_ja.ts deleted file mode 100644 index dc8363b..0000000 --- a/plugin-kbindicator/translations/kbindicator_ja.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - キーボードインジケーターの設定 - - - - Caps Lock - Caps Lock - - - - Num Lock - Num Lock - - - - Scroll Lock - Scroll Lock - - - diff --git a/plugin-kbindicator/translations/kbindicator_pt.desktop b/plugin-kbindicator/translations/kbindicator_pt.desktop deleted file mode 100644 index d15b8a1..0000000 --- a/plugin-kbindicator/translations/kbindicator_pt.desktop +++ /dev/null @@ -1,3 +0,0 @@ -#Translations -Name[pt]=Indicador de teclado -Comment[pt]=Plugin indicador do teclado diff --git a/plugin-kbindicator/translations/kbindicator_pt.ts b/plugin-kbindicator/translations/kbindicator_pt.ts deleted file mode 100644 index a6979e2..0000000 --- a/plugin-kbindicator/translations/kbindicator_pt.ts +++ /dev/null @@ -1,55 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - LxQt Keyboard Indicator Settings - Definições do indicador de teclado do LxQt - - - &Caps lock - &Caps lock - - - &Num lock - &Num lock - - - &Scroll lock - &Scroll lock - - - &Advanced control - Controlo &avançado - - - &Bit - &Bits - - - &Text - &Texto - - - - Keyboard Indicator Settings - Definições do indicador de teclado - - - - Caps Lock - Caps Lock - - - - Num Lock - Num Lock - - - - Scroll Lock - Scroll Lock - - - diff --git a/plugin-kbindicator/translations/kbindicator_ru.desktop b/plugin-kbindicator/translations/kbindicator_ru.desktop deleted file mode 100644 index db61346..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ru]=Индикатор раскладки -Comment[ru]=Плагин, отображающий раскладку. - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ru.ts b/plugin-kbindicator/translations/kbindicator_ru.ts deleted file mode 100644 index e2a08a6..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - Настройки индикатора клавиатуры - - - - Caps Lock - - - - - Num Lock - - - - - Scroll Lock - - - - diff --git a/plugin-kbindicator/translations/kbindicator_ru_RU.desktop b/plugin-kbindicator/translations/kbindicator_ru_RU.desktop deleted file mode 100644 index fecc593..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru_RU.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ru_RU]=Индикатор раскладки -Comment[ru_RU]=Плагин, отображающий раскладку. - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ru_RU.ts b/plugin-kbindicator/translations/kbindicator_ru_RU.ts deleted file mode 100644 index d5ac6f7..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru_RU.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - Настройки индикатора клавиатуры - - - - Caps Lock - - - - - Num Lock - - - - - Scroll Lock - - - - diff --git a/plugin-mainmenu/CMakeLists.txt b/plugin-mainmenu/CMakeLists.txt index 047e0cc..1d2e683 100644 --- a/plugin-mainmenu/CMakeLists.txt +++ b/plugin-mainmenu/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtmainmenuconfiguration.cpp ) -set(MOCS - lxqtmainmenu.h - menustyle.h - lxqtmainmenuconfiguration.h -) - set(UIS lxqtmainmenuconfiguration.ui ) @@ -39,10 +33,9 @@ if(MENU_CACHE_FOUND) endif() set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${LXQT_GLOBALKEYS_UI_LIBRARIES} + lxqt + lxqt-globalkeys + lxqt-globalkeys-ui ${MENU_CACHE_LIBRARIES} ) diff --git a/plugin-mainmenu/lxqtmainmenu.cpp b/plugin-mainmenu/lxqtmainmenu.cpp index e4805ba..a14d5d2 100644 --- a/plugin-mainmenu/lxqtmainmenu.cpp +++ b/plugin-mainmenu/lxqtmainmenu.cpp @@ -28,6 +28,7 @@ #include "lxqtmainmenu.h" #include "lxqtmainmenuconfiguration.h" +#include "../panel/lxqtpanel.h" #include #include #include @@ -41,8 +42,8 @@ #include #include #include -#include #include // for find_if() +#include #include #include @@ -73,11 +74,13 @@ LxQtMainMenu::LxQtMainMenu(const ILxQtPanelPluginStartupInfo &startupInfo): mDelayedPopup.setSingleShot(true); mDelayedPopup.setInterval(250); connect(&mDelayedPopup, &QTimer::timeout, this, &LxQtMainMenu::showHideMenu); + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(250); mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); mButton.installEventFilter(this); - connect(&mButton, &QToolButton::clicked, this, &LxQtMainMenu::showMenu); + connect(&mButton, &QToolButton::clicked, this, &LxQtMainMenu::showHideMenu); settingsChanged(); @@ -107,7 +110,8 @@ LxQtMainMenu::~LxQtMainMenu() ************************************************/ void LxQtMainMenu::showHideMenu() { - if (mMenu && mMenu->isVisible()) + + if (mMenu && (mMenu->isVisible() || mHideTimer.isActive())) mMenu->hide(); else showMenu(); @@ -139,34 +143,9 @@ void LxQtMainMenu::showMenu() if (!mMenu) return; - int x=0, y=0; - - switch (panel()->position()) - { - case ILxQtPanel::PositionTop: - x = mButton.mapToGlobal(QPoint(0, 0)).x(); - y = panel()->globalGometry().bottom(); - break; - - case ILxQtPanel::PositionBottom: - x = mButton.mapToGlobal(QPoint(0, 0)).x(); - y = panel()->globalGometry().top() - mMenu->sizeHint().height(); - break; - - case ILxQtPanel::PositionLeft: - x = panel()->globalGometry().right(); - y = mButton.mapToGlobal(QPoint(0, 0)).y(); - break; - - case ILxQtPanel::PositionRight: - x = panel()->globalGometry().left() - mMenu->sizeHint().width(); - y = mButton.mapToGlobal(QPoint(0, 0)).y(); - break; - } - // Just using Qt`s activateWindow() won't work on some WMs like Kwin. // Solution is to execute menu 1ms later using timer - mMenu->exec(QPoint(x, y)); + mMenu->popup(calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); } #ifdef HAVE_MENU_CACHE @@ -198,35 +177,41 @@ void LxQtMainMenu::settingsChanged() mLogDir = settings()->value("log_dir", "").toString(); - QString mMenuFile = settings()->value("menu_file", "").toString(); - if (mMenuFile.isEmpty()) - mMenuFile = XdgMenu::getMenuFileName(); + QString menu_file = settings()->value("menu_file", "").toString(); + if (menu_file.isEmpty()) + menu_file = XdgMenu::getMenuFileName(); -#ifdef HAVE_MENU_CACHE - menu_cache_init(0); - if(mMenuCache) + if (mMenuFile != menu_file) { - menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); - menu_cache_unref(mMenuCache); - } - mMenuCache = menu_cache_lookup(mMenuFile.toLocal8Bit()); - mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this); + mMenuFile = menu_file; +#ifdef HAVE_MENU_CACHE + menu_cache_init(0); + if(mMenuCache) + { + menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); + menu_cache_unref(mMenuCache); + } + mMenuCache = menu_cache_lookup(mMenuFile.toLocal8Bit()); + if (menu_cache_get_root_dir(mMenuCache)) + buildMenu(); + mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this); #else - mXdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LxQt"); - mXdgMenu.setLogDir(mLogDir); + mXdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LxQt"); + mXdgMenu.setLogDir(mLogDir); - bool res = mXdgMenu.read(mMenuFile); - connect(&mXdgMenu, SIGNAL(changed()), this, SLOT(buildMenu())); - if (res) - { - QTimer::singleShot(1000, this, SLOT(buildMenu())); - } - else - { - QMessageBox::warning(0, "Parse error", mXdgMenu.errorString()); - return; - } + bool res = mXdgMenu.read(mMenuFile); + connect(&mXdgMenu, SIGNAL(changed()), this, SLOT(buildMenu())); + if (res) + { + QTimer::singleShot(1000, this, SLOT(buildMenu())); + } + else + { + QMessageBox::warning(0, "Parse error", mXdgMenu.errorString()); + return; + } #endif + } QString shortcut = settings()->value("shortcut", DEFAULT_SHORTCUT).toString(); if (shortcut.isEmpty()) @@ -240,6 +225,8 @@ void LxQtMainMenu::settingsChanged() } mShortcutSeq = QKeySequence(shortcut); + setMenuFontSize(); + realign(); } @@ -266,17 +253,36 @@ void LxQtMainMenu::buildMenu() } menu->installEventFilter(this); + connect(menu, &QMenu::aboutToHide, &mHideTimer, static_cast(&QTimer::start)); + connect(menu, &QMenu::aboutToShow, &mHideTimer, &QTimer::stop); + // panel notification (needed in case of auto-hide) + connect(menu, &QMenu::aboutToHide, dynamic_cast(panel()), &LxQtPanel::hidePanel); QMenu *oldMenu = mMenu; mMenu = menu; if(oldMenu) delete oldMenu; + setMenuFontSize(); +} + +/************************************************ + + ************************************************/ +void LxQtMainMenu::setMenuFontSize() +{ + if (!mMenu) + return; + + QFont menuFont = mButton.font(); if(settings()->value("customFont", false).toBool()) { - QFont menuFont = mMenu->font(); + menuFont = mMenu->font(); menuFont.setPointSize(settings()->value("customFontSize").toInt()); + } + if (mMenu->font() != menuFont) + { mMenu->setFont(menuFont); QList subMenuList = mMenu->findChildren(); foreach (QMenu* subMenu, subMenuList) @@ -297,7 +303,7 @@ QDialog *LxQtMainMenu::configureDialog() /************************************************ ************************************************/ - + // functor used to match a QAction by prefix struct MatchAction { @@ -305,7 +311,7 @@ struct MatchAction bool operator()(QAction* action) { return action->text().startsWith(key_, Qt::CaseInsensitive); } QString key_; }; - + bool LxQtMainMenu::eventFilter(QObject *obj, QEvent *event) { if(obj == &mButton) diff --git a/plugin-mainmenu/lxqtmainmenu.h b/plugin-mainmenu/lxqtmainmenu.h index aa1e81f..9653809 100644 --- a/plugin-mainmenu/lxqtmainmenu.h +++ b/plugin-mainmenu/lxqtmainmenu.h @@ -77,6 +77,9 @@ public: protected: bool eventFilter(QObject *obj, QEvent *event); +private: + void setMenuFontSize(); + private: QToolButton mButton; QString mLogDir; @@ -95,7 +98,9 @@ private: bool mLockCascadeChanges; QTimer mDelayedPopup; + QTimer mHideTimer; QKeySequence mShortcutSeq; + QString mMenuFile; protected slots: @@ -111,10 +116,10 @@ private slots: class LxQtMainMenuPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtMainMenu(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtMainMenu(startupInfo);} }; #endif diff --git a/plugin-mainmenu/lxqtmainmenuconfiguration.cpp b/plugin-mainmenu/lxqtmainmenuconfiguration.cpp index 00d5825..2c78cb5 100644 --- a/plugin-mainmenu/lxqtmainmenuconfiguration.cpp +++ b/plugin-mainmenu/lxqtmainmenuconfiguration.cpp @@ -29,6 +29,7 @@ #include "lxqtmainmenuconfiguration.h" #include "ui_lxqtmainmenuconfiguration.h" #include +#include #include @@ -43,6 +44,8 @@ LxQtMainMenuConfiguration::LxQtMainMenuConfiguration(QSettings &settings, const setObjectName("MainMenuConfigurationWindow"); ui->setupUi(this); + ui->chooseMenuFilePB->setIcon(XdgIcon::fromTheme("folder")); + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); loadSettings(); @@ -50,7 +53,11 @@ LxQtMainMenuConfiguration::LxQtMainMenuConfiguration(QSettings &settings, const connect(ui->showTextCB, SIGNAL(toggled(bool)), this, SLOT(showTextChanged(bool))); connect(ui->textLE, SIGNAL(textEdited(QString)), this, SLOT(textButtonChanged(QString))); connect(ui->chooseMenuFilePB, SIGNAL(clicked()), this, SLOT(chooseMenuFile())); - + connect(ui->menuFilePathLE, &QLineEdit::textChanged, [this] (QString const & file) + { + mSettings.setValue(QStringLiteral("menu_file"), file); + }); + connect(ui->shortcutEd, SIGNAL(shortcutGrabbed(QString)), this, SLOT(shortcutChanged(QString))); connect(ui->shortcutEd->addMenuAction(tr("Reset")), SIGNAL(triggered()), this, SLOT(shortcutReset())); @@ -97,12 +104,16 @@ void LxQtMainMenuConfiguration::showTextChanged(bool value) void LxQtMainMenuConfiguration::chooseMenuFile() { - QString path = QFileDialog::getOpenFileName(this, tr("Choose menu file"), "~", tr("Menu files (*.menu)")); - if (!path.isEmpty()) - { - ui->menuFilePathLE->setText(path); - mSettings.setValue("menu_file", path); - } + QFileDialog *d = new QFileDialog(this, + tr("Choose menu file"), + QStringLiteral("/etc/xdg/menus"), + tr("Menu files (*.menu)")); + d->setWindowModality(Qt::WindowModal); + d->setAttribute(Qt::WA_DeleteOnClose); + connect(d, &QFileDialog::fileSelected, [&] (const QString &file) { + ui->menuFilePathLE->setText(file); + }); + d->show(); } void LxQtMainMenuConfiguration::shortcutChanged(const QString &value) diff --git a/plugin-mainmenu/lxqtmainmenuconfiguration.ui b/plugin-mainmenu/lxqtmainmenuconfiguration.ui index d3f4e2c..7ba4d93 100644 --- a/plugin-mainmenu/lxqtmainmenuconfiguration.ui +++ b/plugin-mainmenu/lxqtmainmenuconfiguration.ui @@ -89,18 +89,10 @@ - - - true - - + - - - ... - - + diff --git a/plugin-mainmenu/translations/mainmenu.ts b/plugin-mainmenu/translations/mainmenu.ts index 1e26ea8..73d2fc8 100644 --- a/plugin-mainmenu/translations/mainmenu.ts +++ b/plugin-mainmenu/translations/mainmenu.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_ar.ts b/plugin-mainmenu/translations/mainmenu_ar.ts index 0c270c9..0577531 100644 --- a/plugin-mainmenu/translations/mainmenu_ar.ts +++ b/plugin-mainmenu/translations/mainmenu_ar.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - مغادرة + مغادرة diff --git a/plugin-mainmenu/translations/mainmenu_cs.ts b/plugin-mainmenu/translations/mainmenu_cs.ts index aa9ba2c..cf03517 100644 --- a/plugin-mainmenu/translations/mainmenu_cs.ts +++ b/plugin-mainmenu/translations/mainmenu_cs.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustit + Opustit diff --git a/plugin-mainmenu/translations/mainmenu_cs_CZ.ts b/plugin-mainmenu/translations/mainmenu_cs_CZ.ts index f1938fc..97ac808 100644 --- a/plugin-mainmenu/translations/mainmenu_cs_CZ.ts +++ b/plugin-mainmenu/translations/mainmenu_cs_CZ.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustit + Opustit diff --git a/plugin-mainmenu/translations/mainmenu_da.ts b/plugin-mainmenu/translations/mainmenu_da.ts index 61b3f69..60e01a5 100644 --- a/plugin-mainmenu/translations/mainmenu_da.ts +++ b/plugin-mainmenu/translations/mainmenu_da.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlad + Forlad diff --git a/plugin-mainmenu/translations/mainmenu_da_DK.ts b/plugin-mainmenu/translations/mainmenu_da_DK.ts index 36423dd..b1cacce 100644 --- a/plugin-mainmenu/translations/mainmenu_da_DK.ts +++ b/plugin-mainmenu/translations/mainmenu_da_DK.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlad + Forlad diff --git a/plugin-mainmenu/translations/mainmenu_de.desktop b/plugin-mainmenu/translations/mainmenu_de.desktop index 1402227..eaf499e 100644 --- a/plugin-mainmenu/translations/mainmenu_de.desktop +++ b/plugin-mainmenu/translations/mainmenu_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Application menu -Comment=A menu of all your applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Menü basierter Anwendungsstarter Name[de]=Anwendungsmenü +Comment[de]=Menübasierter Anwendungsstarter diff --git a/plugin-mainmenu/translations/mainmenu_de.ts b/plugin-mainmenu/translations/mainmenu_de.ts index d090de9..94cb85d 100644 --- a/plugin-mainmenu/translations/mainmenu_de.ts +++ b/plugin-mainmenu/translations/mainmenu_de.ts @@ -4,54 +4,37 @@ LxQtMainMenu - + Show/hide main menu - - - - - Leave - Verlassen + Hauptmenü anzeigen/verstecken LxQtMainMenuConfiguration - LxQt Main Menu settings - LxQt Hauptmenü-Einstellungen + + Main Menu settings + Hauptmenü-Einstellungen General Allgemein - - Show text - Text anzeigen - - - Button text - Knopf-Text - - - - Main Menu settings - - Button text: - + Schaltflächentext: Custom font size: - + Eigene Schriftgröße: pt - + pt @@ -61,35 +44,30 @@ Menu file: - - - - - ... - ... + Menü-Datei: - + Keyboard Shortcut - Tastaturkürzel + Tastenkürzel - + Click the button to record shortcut: - Klicken Sie auf die Schaltfläche, um ein Tastaturkürzel aufzunehmen: + Auf die Schaltfläche klicken, um ein Tastenkürzel aufzunehmen: - + Reset - + Zurücksetzen - + Choose menu file Menü-Datei auswählen - + Menu files (*.menu) Menü-Dateien (*.menu) diff --git a/plugin-mainmenu/translations/mainmenu_el_GR.ts b/plugin-mainmenu/translations/mainmenu_el_GR.ts index bc87087..9ff8f32 100644 --- a/plugin-mainmenu/translations/mainmenu_el_GR.ts +++ b/plugin-mainmenu/translations/mainmenu_el_GR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Έξοδος + Έξοδος diff --git a/plugin-mainmenu/translations/mainmenu_eo.ts b/plugin-mainmenu/translations/mainmenu_eo.ts index ed22abe..400c5ac 100644 --- a/plugin-mainmenu/translations/mainmenu_eo.ts +++ b/plugin-mainmenu/translations/mainmenu_eo.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlasi + Forlasi diff --git a/plugin-mainmenu/translations/mainmenu_es.ts b/plugin-mainmenu/translations/mainmenu_es.ts index 75dc2ad..25f31f2 100644 --- a/plugin-mainmenu/translations/mainmenu_es.ts +++ b/plugin-mainmenu/translations/mainmenu_es.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_es_UY.ts b/plugin-mainmenu/translations/mainmenu_es_UY.ts index 058119e..e4c69eb 100644 --- a/plugin-mainmenu/translations/mainmenu_es_UY.ts +++ b/plugin-mainmenu/translations/mainmenu_es_UY.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_es_VE.ts b/plugin-mainmenu/translations/mainmenu_es_VE.ts index e642691..9c1628f 100644 --- a/plugin-mainmenu/translations/mainmenu_es_VE.ts +++ b/plugin-mainmenu/translations/mainmenu_es_VE.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_eu.ts b/plugin-mainmenu/translations/mainmenu_eu.ts index a4acdd2..0fe6784 100644 --- a/plugin-mainmenu/translations/mainmenu_eu.ts +++ b/plugin-mainmenu/translations/mainmenu_eu.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Irten + Irten diff --git a/plugin-mainmenu/translations/mainmenu_fi.ts b/plugin-mainmenu/translations/mainmenu_fi.ts index 8b17a60..4d556a2 100644 --- a/plugin-mainmenu/translations/mainmenu_fi.ts +++ b/plugin-mainmenu/translations/mainmenu_fi.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Poistu + Poistu diff --git a/plugin-mainmenu/translations/mainmenu_fr_FR.ts b/plugin-mainmenu/translations/mainmenu_fr_FR.ts index de3f00e..f127304 100644 --- a/plugin-mainmenu/translations/mainmenu_fr_FR.ts +++ b/plugin-mainmenu/translations/mainmenu_fr_FR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Quitter + Quitter diff --git a/plugin-mainmenu/translations/mainmenu_hr.ts b/plugin-mainmenu/translations/mainmenu_hr.ts new file mode 100644 index 0000000..e82b93c --- /dev/null +++ b/plugin-mainmenu/translations/mainmenu_hr.ts @@ -0,0 +1,75 @@ + + + + + LxQtMainMenu + + + Show/hide main menu + Pokaži/sakrij glavni izbornik + + + + LxQtMainMenuConfiguration + + + General + Općenito + + + + Main Menu settings + Postavke glavnoga izbornika + + + + Button text: + + + + + Custom font size: + Prilagođena veličina fonta: + + + + pt + pt + + + + Menu file + Datoteka izbornika + + + + Menu file: + Datoteka izbornika: + + + + Keyboard Shortcut + Kratica tipkovnice + + + + Click the button to record shortcut: + + + + + Reset + + + + + Choose menu file + Izaberite datoteku izbornika + + + + Menu files (*.menu) + + + + diff --git a/plugin-mainmenu/translations/mainmenu_hu.ts b/plugin-mainmenu/translations/mainmenu_hu.ts index 2c15ba8..0958db1 100644 --- a/plugin-mainmenu/translations/mainmenu_hu.ts +++ b/plugin-mainmenu/translations/mainmenu_hu.ts @@ -1,24 +1,23 @@ - + LxQtMainMenu - + Show/hide main menu - + Menü láttatás/elrejtés - Leave - Kilépés + Leállítás LxQtMainMenuConfiguration LxQt Main Menu settings - A LxQt főmenü beállításai + LxQt főmenü beállítás @@ -27,31 +26,31 @@ Show text - Szöveg megjelenítése + Szöveg megjelenítése Button text - Gombszöveg + Gombszöveg Main Menu settings - + Menübeállítás Button text: - + Gombszöveg: Custom font size: - + Saját betűnagyság: pt - + .pont @@ -61,7 +60,7 @@ Menu file: - + Menüfájl: @@ -71,17 +70,17 @@ Keyboard Shortcut - Gyorsbillentyűk + Gyorsbillentyű Click the button to record shortcut: - Kattintson a gombra a gyorsbillentyű rögzítéséhez: + Billentyű nyomása a megjegyzéshez... Reset - + Visszaállít diff --git a/plugin-mainmenu/translations/mainmenu_hu_HU.ts b/plugin-mainmenu/translations/mainmenu_hu_HU.ts index ee38197..4514508 100644 --- a/plugin-mainmenu/translations/mainmenu_hu_HU.ts +++ b/plugin-mainmenu/translations/mainmenu_hu_HU.ts @@ -1,15 +1,14 @@ - + LxQtMainMenu - + Show/hide main menu - + Menü láttatás/elrejtés - Leave Leállítás @@ -18,7 +17,7 @@ LxQtMainMenuConfiguration LxQt Main Menu settings - LXDE-Qt - A főmen beállítása + LxQt főmenü beállítás @@ -27,31 +26,31 @@ Show text - Szöveg megjelenítése + Szöveg megjelenítése Button text - Gombszöveg + Gombszöveg Main Menu settings - + Menübeállítás Button text: - + Gombszöveg: Custom font size: - + Saját betűnagyság: pt - + .pont @@ -61,7 +60,7 @@ Menu file: - + Menüfájl: @@ -71,17 +70,17 @@ Keyboard Shortcut - + Gyorsbillentyű Click the button to record shortcut: - + Billentyű nyomása a megjegyzéshez... Reset - + Visszaállít diff --git a/plugin-mainmenu/translations/mainmenu_ia.ts b/plugin-mainmenu/translations/mainmenu_ia.ts index 16fa8cd..7cc16c2 100644 --- a/plugin-mainmenu/translations/mainmenu_ia.ts +++ b/plugin-mainmenu/translations/mainmenu_ia.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_id_ID.ts b/plugin-mainmenu/translations/mainmenu_id_ID.ts index ee9b4c9..095b42b 100644 --- a/plugin-mainmenu/translations/mainmenu_id_ID.ts +++ b/plugin-mainmenu/translations/mainmenu_id_ID.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_it_IT.ts b/plugin-mainmenu/translations/mainmenu_it_IT.ts index 7d8a59e..b3a286a 100644 --- a/plugin-mainmenu/translations/mainmenu_it_IT.ts +++ b/plugin-mainmenu/translations/mainmenu_it_IT.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - + Mostra/nascondi menu principale - Leave - Esci + Esci @@ -23,7 +22,7 @@ General - Generale + Generali Show text @@ -36,22 +35,22 @@ Main Menu settings - + Impostazioni del menu principale di LXQt Button text: - + Testo pulsante: Custom font size: - + Dimensione carattere personalizzato: pt - + @@ -61,7 +60,7 @@ Menu file: - + File del menu: @@ -71,17 +70,17 @@ Keyboard Shortcut - Scorciatoie da tastiera + Scorciatoia da tastiera Click the button to record shortcut: - Fai clic sul pulsante per registrare una scorciatoia: + Fai clic sul pulsante per impostare una scorciatoia: Reset - + Ripristina diff --git a/plugin-mainmenu/translations/mainmenu_ja.ts b/plugin-mainmenu/translations/mainmenu_ja.ts index f2cbaae..5f3b0d3 100644 --- a/plugin-mainmenu/translations/mainmenu_ja.ts +++ b/plugin-mainmenu/translations/mainmenu_ja.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu メインメニューを表示/隠す - Leave - 終了 + 終了 diff --git a/plugin-mainmenu/translations/mainmenu_ko.ts b/plugin-mainmenu/translations/mainmenu_ko.ts index 736872a..d1a91b9 100644 --- a/plugin-mainmenu/translations/mainmenu_ko.ts +++ b/plugin-mainmenu/translations/mainmenu_ko.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_lt.ts b/plugin-mainmenu/translations/mainmenu_lt.ts index 67b3adc..7f03949 100644 --- a/plugin-mainmenu/translations/mainmenu_lt.ts +++ b/plugin-mainmenu/translations/mainmenu_lt.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Išeiti + Išeiti diff --git a/plugin-mainmenu/translations/mainmenu_nl.ts b/plugin-mainmenu/translations/mainmenu_nl.ts index dab47c7..9724c07 100644 --- a/plugin-mainmenu/translations/mainmenu_nl.ts +++ b/plugin-mainmenu/translations/mainmenu_nl.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Verlaten + Verlaten diff --git a/plugin-mainmenu/translations/mainmenu_pl_PL.ts b/plugin-mainmenu/translations/mainmenu_pl_PL.ts index ebb304c..7ff8b07 100644 --- a/plugin-mainmenu/translations/mainmenu_pl_PL.ts +++ b/plugin-mainmenu/translations/mainmenu_pl_PL.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - + Pokaż/ukryj menu - Leave - Opuść + Opuść @@ -36,22 +35,22 @@ Main Menu settings - + Ustawienia Menu Button text: - + Tekst przycisku: Custom font size: - + Własny rozmiar czcionki: pt - + pt @@ -61,7 +60,7 @@ Menu file: - + Plik menu: @@ -81,7 +80,7 @@ Reset - + Zresetuj diff --git a/plugin-mainmenu/translations/mainmenu_pt.ts b/plugin-mainmenu/translations/mainmenu_pt.ts index a1f2782..f59075d 100644 --- a/plugin-mainmenu/translations/mainmenu_pt.ts +++ b/plugin-mainmenu/translations/mainmenu_pt.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Sair + Sair diff --git a/plugin-mainmenu/translations/mainmenu_pt_BR.ts b/plugin-mainmenu/translations/mainmenu_pt_BR.ts index 69d0e1b..90a5fd0 100644 --- a/plugin-mainmenu/translations/mainmenu_pt_BR.ts +++ b/plugin-mainmenu/translations/mainmenu_pt_BR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Sair + Sair diff --git a/plugin-mainmenu/translations/mainmenu_ro_RO.ts b/plugin-mainmenu/translations/mainmenu_ro_RO.ts index c080071..20c0fa4 100644 --- a/plugin-mainmenu/translations/mainmenu_ro_RO.ts +++ b/plugin-mainmenu/translations/mainmenu_ro_RO.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Părăsește + Părăsește diff --git a/plugin-mainmenu/translations/mainmenu_ru.ts b/plugin-mainmenu/translations/mainmenu_ru.ts index d067af5..d9cf260 100644 --- a/plugin-mainmenu/translations/mainmenu_ru.ts +++ b/plugin-mainmenu/translations/mainmenu_ru.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu Показать/скрыть главное меню - - - Leave - Выход - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_ru_RU.ts b/plugin-mainmenu/translations/mainmenu_ru_RU.ts index 74c0440..b4a25ce 100644 --- a/plugin-mainmenu/translations/mainmenu_ru_RU.ts +++ b/plugin-mainmenu/translations/mainmenu_ru_RU.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu Показать/скрыть главное меню - - - Leave - Выход - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_sk_SK.ts b/plugin-mainmenu/translations/mainmenu_sk_SK.ts index 9d943dd..872a01b 100644 --- a/plugin-mainmenu/translations/mainmenu_sk_SK.ts +++ b/plugin-mainmenu/translations/mainmenu_sk_SK.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustiť + Opustiť diff --git a/plugin-mainmenu/translations/mainmenu_sl.ts b/plugin-mainmenu/translations/mainmenu_sl.ts index 30123c6..2d3f242 100644 --- a/plugin-mainmenu/translations/mainmenu_sl.ts +++ b/plugin-mainmenu/translations/mainmenu_sl.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Zapusti + Zapusti diff --git a/plugin-mainmenu/translations/mainmenu_sr@latin.ts b/plugin-mainmenu/translations/mainmenu_sr@latin.ts index 74b72f5..d1449a7 100644 --- a/plugin-mainmenu/translations/mainmenu_sr@latin.ts +++ b/plugin-mainmenu/translations/mainmenu_sr@latin.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_sr_BA.ts b/plugin-mainmenu/translations/mainmenu_sr_BA.ts index da70ee6..9582e30 100644 --- a/plugin-mainmenu/translations/mainmenu_sr_BA.ts +++ b/plugin-mainmenu/translations/mainmenu_sr_BA.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Напуштање + Напуштање diff --git a/plugin-mainmenu/translations/mainmenu_sr_RS.ts b/plugin-mainmenu/translations/mainmenu_sr_RS.ts index 0cdf1da..91a5d24 100644 --- a/plugin-mainmenu/translations/mainmenu_sr_RS.ts +++ b/plugin-mainmenu/translations/mainmenu_sr_RS.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Напуштање + Напуштање diff --git a/plugin-mainmenu/translations/mainmenu_th_TH.ts b/plugin-mainmenu/translations/mainmenu_th_TH.ts index 225db27..cf050cc 100644 --- a/plugin-mainmenu/translations/mainmenu_th_TH.ts +++ b/plugin-mainmenu/translations/mainmenu_th_TH.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - ออก + ออก diff --git a/plugin-mainmenu/translations/mainmenu_tr.ts b/plugin-mainmenu/translations/mainmenu_tr.ts index 1fac717..88516fc 100644 --- a/plugin-mainmenu/translations/mainmenu_tr.ts +++ b/plugin-mainmenu/translations/mainmenu_tr.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Çık + Çık diff --git a/plugin-mainmenu/translations/mainmenu_uk.ts b/plugin-mainmenu/translations/mainmenu_uk.ts index 29a99fe..1e21f47 100644 --- a/plugin-mainmenu/translations/mainmenu_uk.ts +++ b/plugin-mainmenu/translations/mainmenu_uk.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Полишити + Полишити diff --git a/plugin-mainmenu/translations/mainmenu_zh_CN.ts b/plugin-mainmenu/translations/mainmenu_zh_CN.ts index efac34c..f9ddeee 100644 --- a/plugin-mainmenu/translations/mainmenu_zh_CN.ts +++ b/plugin-mainmenu/translations/mainmenu_zh_CN.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - 离开 + 离开 diff --git a/plugin-mainmenu/translations/mainmenu_zh_TW.ts b/plugin-mainmenu/translations/mainmenu_zh_TW.ts index 82cd2b2..5bc02fb 100644 --- a/plugin-mainmenu/translations/mainmenu_zh_TW.ts +++ b/plugin-mainmenu/translations/mainmenu_zh_TW.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - 離開 + 離開 diff --git a/plugin-mainmenu/xdgcachedmenu.h b/plugin-mainmenu/xdgcachedmenu.h index 8da3da3..4f380d1 100644 --- a/plugin-mainmenu/xdgcachedmenu.h +++ b/plugin-mainmenu/xdgcachedmenu.h @@ -1,21 +1,21 @@ /* * * Copyright (C) 2013 - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * */ #ifndef XDGCACHEDMENU_H diff --git a/plugin-mount/CMakeLists.txt b/plugin-mount/CMakeLists.txt index 9afd7ad..e9e2211 100644 --- a/plugin-mount/CMakeLists.txt +++ b/plugin-mount/CMakeLists.txt @@ -2,8 +2,8 @@ set(PLUGIN "mount") set(HEADERS lxqtmountplugin.h - lxqtmountconfiguration.h - mountbutton.h + configuration.h + button.h menudiskitem.h popup.h actions/deviceaction.h @@ -13,10 +13,9 @@ set(HEADERS ) set(SOURCES - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.cpp lxqtmountplugin.cpp - lxqtmountconfiguration.cpp - mountbutton.cpp + configuration.cpp + button.cpp menudiskitem.cpp popup.cpp actions/deviceaction.cpp @@ -25,24 +24,11 @@ set(SOURCES actions/deviceaction_nothing.cpp ) -set(MOCS - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.h - lxqtmountplugin.h - lxqtmountconfiguration.h - mountbutton.h - menudiskitem.h - popup.h - actions/deviceaction.h - actions/deviceaction_info.h - actions/deviceaction_menu.h - actions/deviceaction_nothing.h -) - set(UIS - lxqtmountconfiguration.ui + configuration.ui ) -include_directories(${LXQTMOUNT_INCLUDE_DIRS}) -set(LIBRARIES ${QTXDG_LIBRARIES} ${LXQTMOUNT_LIBRARIES}) +find_package(KF5Solid REQUIRED) +set(LIBRARIES Qt5Xdg KF5::Solid) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-mount/actions/deviceaction.cpp b/plugin-mount/actions/deviceaction.cpp index 1a21e18..1165d8c 100644 --- a/plugin-mount/actions/deviceaction.cpp +++ b/plugin-mount/actions/deviceaction.cpp @@ -25,15 +25,15 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction.h" #include "deviceaction_info.h" #include "deviceaction_menu.h" #include "deviceaction_nothing.h" - #include "../menudiskitem.h" #include "../lxqtmountplugin.h" +#include + #define ACT_NOTHING "nothing" #define ACT_INFO "showInfo" #define ACT_MENU "showMenu" @@ -80,19 +80,20 @@ QString DeviceAction::actionIdToString(DeviceAction::ActionId id) return ACT_INFO; } -void DeviceAction::deviceAdded(LxQt::MountDevice *device) +void DeviceAction::onDeviceAdded(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + Solid::Device device(udi); + if (device.is()) doDeviceAdded(device); } -void DeviceAction::deviceRemoved(LxQt::MountDevice *device) +void DeviceAction::onDeviceRemoved(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + Solid::Device device(udi); + if (device.is()) doDeviceRemoved(device); } - DeviceAction::ActionId DeviceAction::stringToActionId(const QString &string, ActionId defaultValue) { QString s = string.toUpper(); @@ -102,4 +103,3 @@ DeviceAction::ActionId DeviceAction::stringToActionId(const QString &string, Act return defaultValue; } - diff --git a/plugin-mount/actions/deviceaction.h b/plugin-mount/actions/deviceaction.h index 3cadbcf..58ecc27 100644 --- a/plugin-mount/actions/deviceaction.h +++ b/plugin-mount/actions/deviceaction.h @@ -25,45 +25,42 @@ * * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef DEVICEACTION_H -#define DEVICEACTION_H +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_H #include #include -#include - -namespace { -class MountDevice; -class MountManager; -} +#include class LxQtMountPlugin; class DeviceAction: public QObject { Q_OBJECT + public: - enum ActionId { + enum ActionId + { ActionNothing, ActionInfo, ActionMenu }; virtual ~DeviceAction(); + virtual ActionId Type() const throw () = 0; - static DeviceAction *create(ActionId id, LxQtMountPlugin *plugin, QObject *parent=0); + static DeviceAction *create(ActionId id, LxQtMountPlugin *plugin, QObject *parent = 0); static ActionId stringToActionId(const QString &string, ActionId defaultValue); static QString actionIdToString(ActionId id); public slots: - void deviceAdded(LxQt::MountDevice *device); - void deviceRemoved(LxQt::MountDevice *device); + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); protected: - explicit DeviceAction(LxQtMountPlugin *plugin, QObject *parent=0); - virtual void doDeviceAdded(LxQt::MountDevice *device) = 0; - virtual void doDeviceRemoved(LxQt::MountDevice *device) = 0; + explicit DeviceAction(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual void doDeviceAdded(Solid::Device device) = 0; + virtual void doDeviceRemoved(Solid::Device device) = 0; LxQtMountPlugin *mPlugin; }; diff --git a/plugin-mount/actions/deviceaction_info.cpp b/plugin-mount/actions/deviceaction_info.cpp index 725b408..5a5b4c7 100644 --- a/plugin-mount/actions/deviceaction_info.cpp +++ b/plugin-mount/actions/deviceaction_info.cpp @@ -25,37 +25,27 @@ * * END_COMMON_COPYRIGHT_HEADER */ - -#include "deviceaction_info.h" #include "../lxqtmountplugin.h" +#include "deviceaction_info.h" + #include -#include DeviceActionInfo::DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent): DeviceAction(plugin, parent) { - qDebug() << Q_FUNC_INFO; } - -void DeviceActionInfo::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionInfo::doDeviceAdded(Solid::Device device) { - qDebug() << Q_FUNC_INFO; - - showMessage(tr("The device \"%1\" is connected.").arg(device->label())); + showMessage(tr("The device \"%1\" is connected.").arg(device.description())); } - -void DeviceActionInfo::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionInfo::doDeviceRemoved(Solid::Device device) { - qDebug() << Q_FUNC_INFO; - - showMessage(tr("The device \"%1\" is removed.").arg(device->label())); + showMessage(tr("The device \"%1\" is removed.").arg(device.description())); } - void DeviceActionInfo::showMessage(const QString &text) { LxQt::Notification::notify(tr("Removable media/devices manager"), text, mPlugin->icon().name()); } - diff --git a/plugin-mount/actions/deviceaction_info.h b/plugin-mount/actions/deviceaction_info.h index d2ca884..99e8733 100644 --- a/plugin-mount/actions/deviceaction_info.h +++ b/plugin-mount/actions/deviceaction_info.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H -#ifndef DEVICEACTION_INFO_H -#define DEVICEACTION_INFO_H +#include "deviceaction.h" #include #include -#include "deviceaction.h" class Popup; @@ -39,11 +39,12 @@ class DeviceActionInfo : public DeviceAction { Q_OBJECT public: - explicit DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionInfo; } protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); private: void showMessage(const QString &text); diff --git a/plugin-mount/actions/deviceaction_menu.cpp b/plugin-mount/actions/deviceaction_menu.cpp index 5b7c1cf..982834a 100644 --- a/plugin-mount/actions/deviceaction_menu.cpp +++ b/plugin-mount/actions/deviceaction_menu.cpp @@ -25,13 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction_menu.h" #include "../lxqtmountplugin.h" #include "../popup.h" -#include - DeviceActionMenu::DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent): DeviceAction(plugin, parent) { @@ -39,19 +36,15 @@ DeviceActionMenu::DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent): mHideTimer.setSingleShot(true); mHideTimer.setInterval(5000); - connect(&mHideTimer, SIGNAL(timeout()), mPopup, SLOT(hide())); + connect(&mHideTimer, &QTimer::timeout, mPopup, &Popup::hide); } - -void DeviceActionMenu::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionMenu::doDeviceAdded(Solid::Device device) { mHideTimer.start(); mPopup->show(); } - -void DeviceActionMenu::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionMenu::doDeviceRemoved(Solid::Device device) { - } - diff --git a/plugin-mount/actions/deviceaction_menu.h b/plugin-mount/actions/deviceaction_menu.h index 3813cb3..66a0244 100644 --- a/plugin-mount/actions/deviceaction_menu.h +++ b/plugin-mount/actions/deviceaction_menu.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H -#ifndef DEVICEACTIONMENU_H -#define DEVICEACTIONMENU_H +#include "deviceaction.h" #include #include -#include "deviceaction.h" class Popup; @@ -39,11 +39,12 @@ class DeviceActionMenu : public DeviceAction { Q_OBJECT public: - explicit DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionMenu; } protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); private: Popup *mPopup; diff --git a/plugin-mount/actions/deviceaction_nothing.cpp b/plugin-mount/actions/deviceaction_nothing.cpp index 77b1f3f..3e4bd9b 100644 --- a/plugin-mount/actions/deviceaction_nothing.cpp +++ b/plugin-mount/actions/deviceaction_nothing.cpp @@ -25,7 +25,6 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction_nothing.h" DeviceActionNothing::DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent): @@ -33,13 +32,10 @@ DeviceActionNothing::DeviceActionNothing(LxQtMountPlugin *plugin, QObject *paren { } - -void DeviceActionNothing::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionNothing::doDeviceAdded(Solid::Device device) { } - -void DeviceActionNothing::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionNothing::doDeviceRemoved(Solid::Device device) { } - diff --git a/plugin-mount/actions/deviceaction_nothing.h b/plugin-mount/actions/deviceaction_nothing.h index 4227e5f..105bf97 100644 --- a/plugin-mount/actions/deviceaction_nothing.h +++ b/plugin-mount/actions/deviceaction_nothing.h @@ -26,21 +26,23 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef DEVICEACTIONNOTHING_H -#define DEVICEACTIONNOTHING_H +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H -#include #include "deviceaction.h" +#include class DeviceActionNothing : public DeviceAction { Q_OBJECT + public: - explicit DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionNothing; }; protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); }; #endif // DEVICEACTIONNOTHING_H diff --git a/plugin-mount/button.cpp b/plugin-mount/button.cpp new file mode 100644 index 0000000..962f438 --- /dev/null +++ b/plugin-mount/button.cpp @@ -0,0 +1,42 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "button.h" +#include + +Button::Button(QWidget * parent) : + QToolButton(parent) +{ + setIcon(XdgIcon::fromTheme(QStringLiteral("drive-removable-media"))); + setToolTip(tr("Removable media/devices manager")); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +} + +Button::~Button() +{ +} diff --git a/plugin-mount/button.h b/plugin-mount/button.h new file mode 100644 index 0000000..2628cbc --- /dev/null +++ b/plugin-mount/button.h @@ -0,0 +1,43 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2011 Razor team + * Authors: + * Petr Vanek + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_BUTTON_H +#define LXQT_PLUGIN_MOUNT_BUTTON_H + +#include + + +class Button : public QToolButton +{ + Q_OBJECT +public: + Button(QWidget *parent = 0); + ~Button(); +}; + +#endif diff --git a/plugin-mount/configuration.cpp b/plugin-mount/configuration.cpp new file mode 100644 index 0000000..c7a92ac --- /dev/null +++ b/plugin-mount/configuration.cpp @@ -0,0 +1,65 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include "configuration.h" +#include "ui_configuration.h" + +#include +#include + +Configuration::Configuration(QSettings &settings, QWidget *parent) : + LxQtPanelPluginConfigDialog(settings, parent), + ui(new Ui::Configuration) +{ + ui->setupUi(this); + ui->devAddedCombo->addItem(tr("Popup menu"), QStringLiteral(ACT_SHOW_MENU)); + ui->devAddedCombo->addItem(tr("Show info"), QStringLiteral(ACT_SHOW_INFO)); + ui->devAddedCombo->addItem(tr("Do nothing"), QStringLiteral(ACT_NOTHING)); + + loadSettings(); + connect(ui->devAddedCombo, static_cast(&QComboBox::currentIndexChanged), + this, &Configuration::devAddedChanged); + connect(ui->buttons, &QDialogButtonBox::clicked, this, &Configuration::dialogButtonsAction); +} + +Configuration::~Configuration() +{ + delete ui; +} + +void Configuration::loadSettings() +{ + QVariant value = settings().value(QStringLiteral(CFG_KEY_ACTION), QStringLiteral(ACT_SHOW_INFO)); + setComboboxIndexByData(ui->devAddedCombo, value, 1); +} + +void Configuration::devAddedChanged(int index) +{ + QString s = ui->devAddedCombo->itemData(index).toString(); + settings().setValue(QStringLiteral(CFG_KEY_ACTION), s); +} diff --git a/plugin-mount/configuration.h b/plugin-mount/configuration.h new file mode 100644 index 0000000..aadd967 --- /dev/null +++ b/plugin-mount/configuration.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQT_PLUGIN_MOUNT_CONFIGURATION_H +#define LXQT_PLUGIN_MOUNT_CONFIGURATION_H + +#include "../panel/lxqtpanelpluginconfigdialog.h" + +#define CFG_KEY_ACTION "newDeviceAction" +#define ACT_SHOW_MENU "showMenu" +#define ACT_SHOW_INFO "showInfo" +#define ACT_NOTHING "nothing" + +namespace Ui { + class Configuration; +} + +class Configuration : public LxQtPanelPluginConfigDialog +{ + Q_OBJECT + +public: + explicit Configuration(QSettings &settings, QWidget *parent = 0); + ~Configuration(); + +protected slots: + virtual void loadSettings(); + void devAddedChanged(int index); + +private: + Ui::Configuration *ui; +}; + +#endif // LXQTMOUNTCONFIGURATION_H diff --git a/plugin-mount/configuration.ui b/plugin-mount/configuration.ui new file mode 100644 index 0000000..2deef8c --- /dev/null +++ b/plugin-mount/configuration.ui @@ -0,0 +1,96 @@ + + + Configuration + + + + 0 + 0 + 407 + 129 + + + + Removable Media Settings + + + + + + Behaviour + + + + + + When a device is connected : + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 41 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + Configuration + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttons + rejected() + Configuration + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/plugin-mount/lxqtmountplugin.cpp b/plugin-mount/lxqtmountplugin.cpp index 379ed03..263a15d 100644 --- a/plugin-mount/lxqtmountplugin.cpp +++ b/plugin-mount/lxqtmountplugin.cpp @@ -25,92 +25,60 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtmountplugin.h" -#include "lxqtmountconfiguration.h" -#include -#include "actions/deviceaction.h" -#include "popup.h" -#include "mountbutton.h" +#include "configuration.h" -#include +#include LxQtMountPlugin::LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), - mPopup(NULL), - mMountManager(NULL), - mDeviceAction(0) + mPopup(nullptr), + mDeviceAction(nullptr) { - mButton = new MountButton(); - connect(mButton, SIGNAL(clicked(bool)), SLOT(buttonClicked())); -} + mButton = new Button; + mPopup = new Popup(this); + connect(mButton, &QToolButton::clicked, mPopup, &Popup::showHide); + connect(mPopup, &Popup::visibilityChanged, mButton, &QToolButton::setDown); +} LxQtMountPlugin::~LxQtMountPlugin() { delete mButton; - delete mDeviceAction; -} - - -QWidget *LxQtMountPlugin::widget() -{ - return mButton; -} - - -void LxQtMountPlugin::realign() -{ - if(mPopup) - mPopup->hide(); + delete mPopup; } - QDialog *LxQtMountPlugin::configureDialog() { - if(mPopup) + if (mPopup) mPopup->hide(); - LxQtMountConfiguration *configWindow = new LxQtMountConfiguration(*settings()); + + Configuration *configWindow = new Configuration(*settings()); configWindow->setAttribute(Qt::WA_DeleteOnClose, true); return configWindow; } - -QIcon LxQtMountPlugin::icon() const +void LxQtMountPlugin::realign() { - return mButton->icon(); + //nothing to do } - void LxQtMountPlugin::settingsChanged() { - QString s = settings()->value("newDeviceAction").toString(); + QString s = settings()->value(QStringLiteral(CFG_KEY_ACTION)).toString(); DeviceAction::ActionId actionId = DeviceAction::stringToActionId(s, DeviceAction::ActionMenu); - delete mDeviceAction; - mDeviceAction = DeviceAction::create(actionId, this); - - if(mMountManager) + if (mDeviceAction == nullptr || mDeviceAction->Type() != actionId) { - connect(mMountManager, SIGNAL(deviceAdded(LxQt::MountDevice*)), - mDeviceAction, SLOT(deviceAdded(LxQt::MountDevice*))); + delete mDeviceAction; + mDeviceAction = DeviceAction::create(actionId, this); - connect(mMountManager, SIGNAL(deviceRemoved(LxQt::MountDevice*)), - mDeviceAction, SLOT(deviceRemoved(LxQt::MountDevice*))); - } -} - -void LxQtMountPlugin::buttonClicked() -{ - if(!mMountManager) - { - mMountManager = new LxQt::MountManager(this); - mPopup = new Popup(mMountManager, this, mButton); - settingsChanged(); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + mDeviceAction, &DeviceAction::onDeviceAdded); - connect(mPopup, SIGNAL(visibilityChanged(bool)), mButton, SLOT(setDown(bool))); - mMountManager->update(); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + mDeviceAction, &DeviceAction::onDeviceRemoved); } - mPopup->showHide(); + } diff --git a/plugin-mount/lxqtmountplugin.h b/plugin-mount/lxqtmountplugin.h index a2e66b5..66d8e1c 100644 --- a/plugin-mount/lxqtmountplugin.h +++ b/plugin-mount/lxqtmountplugin.h @@ -25,25 +25,21 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTMOUNTPLUGIN_H #define LXQTMOUNTPLUGIN_H #include "../panel/ilxqtpanelplugin.h" #include "../panel/lxqtpanel.h" +#include "button.h" +#include "popup.h" +#include "actions/deviceaction.h" -namespace LxQt { -class MountManager; -} - -class Popup; -class MountButton; -class DeviceAction; -class QIcon; +#include /*! \author Petr Vanek */ + class LxQtMountPlugin : public QObject, public ILxQtPanelPlugin { Q_OBJECT @@ -52,36 +48,34 @@ public: LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); ~LxQtMountPlugin(); - virtual QWidget *widget(); - virtual QString themeId() const { return "LxQtMount"; } - virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } - void realign(); - QDialog *configureDialog(); + virtual QWidget *widget() { return mButton; } + virtual QString themeId() const { return QStringLiteral("LxQtMount"); } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } - LxQt::MountManager *mountManager() const { return mMountManager; } Popup *popup() { return mPopup; } + QIcon icon() { return mButton->icon(); }; + QDialog *configureDialog(); - QIcon icon() const; +public slots: + void realign(); protected slots: virtual void settingsChanged(); - void buttonClicked(); private: - MountButton *mButton; + Button *mButton; Popup *mPopup; - LxQt::MountManager *mMountManager; DeviceAction *mDeviceAction; }; - class LxQtMountPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) + public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtMountPlugin(startupInfo); } diff --git a/plugin-mount/menudiskitem.cpp b/plugin-mount/menudiskitem.cpp index 7f1de72..3f70618 100644 --- a/plugin-mount/menudiskitem.cpp +++ b/plugin-mount/menudiskitem.cpp @@ -25,162 +25,155 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include #include "menudiskitem.h" -#include +#include "popup.h" + +#include +#include +#include +#include +#include #include +#include +#include +#include #include -#include -#include -#include -#include -/************************************************ - - ************************************************/ -MenuDiskItem::MenuDiskItem(LxQt::MountDevice *device, QWidget *parent): - QFrame(parent), - mDevice(device) +MenuDiskItem::MenuDiskItem(Solid::Device device, Popup *popup): + QFrame(popup), + mPopup(popup), + mDevice(device), + mDiskButton(nullptr), + mEjectButton(nullptr), + mDiskButtonClicked(false), + mEjectButtonClicked(false) { + Solid::StorageAccess * const iface = device.as(); + Q_ASSERT(nullptr != iface); + mDiskButton = new QToolButton(this); mDiskButton->setObjectName("DiskButton"); mDiskButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mDiskButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); - connect(mDiskButton, SIGNAL(clicked()), this, SLOT(diskButtonClicked())); + connect(mDiskButton, &QToolButton::clicked, this, &MenuDiskItem::diskButtonClicked); - mEjectButton = new QToolButton(this); + mEjectButton = new QToolButton(this); mEjectButton->setObjectName("EjectButton"); - connect(mEjectButton, SIGNAL(clicked()), this, SLOT(ejectButtonClicked())); + mEjectButton->setIcon(XdgIcon::fromTheme("media-eject")); + connect(mEjectButton, &QToolButton::clicked, this, &MenuDiskItem::ejectButtonClicked); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(mDiskButton); layout->addWidget(mEjectButton); - this->setLayout(layout); - layout->setMargin(0); layout->setSpacing(0); + setLayout(layout); - mEjectButton->setIcon(XdgIcon::fromTheme("media-eject")); + connect(iface, &Solid::StorageAccess::setupDone, this, &MenuDiskItem::onMounted); + connect(iface, &Solid::StorageAccess::teardownDone, this, &MenuDiskItem::onUnmounted); + connect(iface, &Solid::StorageAccess::accessibilityChanged, [this] (bool accessible, QString const &) { + updateMountStatus(); + }); - connect(device, SIGNAL(destroyed()), - this, SLOT(free())); - - connect(device, SIGNAL(changed()), - this, SLOT(update())); - - connect(device, SIGNAL(mounted()), - this, SLOT(mounted())); - - connect(device, SIGNAL(unmounted()), - this, SLOT(unmounted())); - - update(); + updateMountStatus(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::free() +MenuDiskItem::~MenuDiskItem() { - this->deleteLater(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::update() +void MenuDiskItem::setMountStatus(bool mounted) { - mDiskButton->setIcon(XdgIcon::fromTheme(QStringList() - << mDevice->iconName() - << "drive-removable-media-usb" - )); - - QString label = mDevice->label(); - mDiskButton->setText(label); - - setMountStatus(mDevice->isMounted()); + mEjectButton->setEnabled(mounted); } - -/************************************************ - - ************************************************/ -bool MenuDiskItem::isUsableDevice(const LxQt::MountDevice *device) +void MenuDiskItem::updateMountStatus() { - switch (device->mediaType()) - { - case LxQt::MountDevice::MediaTypeFdd: - return true; + static const QIcon icon = XdgIcon::fromTheme(mDevice.icon(), QStringLiteral("drive-removable-media")); - case LxQt::MountDevice::MediaTypeOptical: - return true; - break; - - case LxQt::MountDevice::MediaTypePartition: - case LxQt::MountDevice::MediaTypeDrive: - return device->isExternal(); - break; + if (mDevice.isValid()) + { + mDiskButton->setIcon(icon); + mDiskButton->setText(mDevice.description()); - default: - return false; + setMountStatus(mDevice.as()->isAccessible() || !opticalParent().udi().isEmpty()); } - - return false; + else + emit invalid(mDevice.udi()); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::setMountStatus(bool is_mount) +Solid::Device MenuDiskItem::opticalParent() const { - mEjectButton->setEnabled(is_mount); + Solid::Device it; + if (mDevice.isValid()) + { + it = mDevice; + // search for parent drive + for (; !it.udi().isEmpty(); it = it.parent()) + if (it.is()) + break; + } + return it; } - -/************************************************ - - ************************************************/ void MenuDiskItem::diskButtonClicked() { - if (!mDevice->isMounted()) - mDevice->mount(); + mDiskButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (!di->isAccessible()) + di->setup(); else - mounted(); - - qobject_cast(parent())->hide(); -} - + onMounted(Solid::NoError, QString(), mDevice.udi()); -/************************************************ - - ************************************************/ -void MenuDiskItem::mounted() -{ - QDesktopServices::openUrl(QUrl(mDevice->mountPath())); + mPopup->hide(); } - -/************************************************ - - ************************************************/ void MenuDiskItem::ejectButtonClicked() { - mDevice->unmount(); - setMountStatus(mDevice->isMounted()); + mEjectButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (di->isAccessible()) + di->teardown(); + else + onUnmounted(Solid::NoError, QString(), mDevice.udi()); - qobject_cast(parent())->hide(); + mPopup->hide(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::unmounted() +void MenuDiskItem::onMounted(Solid::ErrorType error, QVariant resultData, const QString &udi) { - if (mDevice->isEjectable()) - mDevice->eject(); + if (mDiskButtonClicked) + { + mDiskButtonClicked = false; + + if (Solid::NoError == error) + QDesktopServices::openUrl(QUrl(mDevice.as()->filePath())); + else + { + QString errorMsg = tr("Mounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } } +void MenuDiskItem::onUnmounted(Solid::ErrorType error, QVariant resultData, const QString &udi) +{ + if (mEjectButtonClicked) + { + mEjectButtonClicked = false; + + if (Solid::NoError == error) + { + Solid::Device opt_parent = opticalParent(); + if (!opt_parent.udi().isEmpty()) + opt_parent.as()->eject(); + } + else + { + QString errorMsg = tr("Unmounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } +} diff --git a/plugin-mount/menudiskitem.h b/plugin-mount/menudiskitem.h index 6e059ee..ccd26e7 100644 --- a/plugin-mount/menudiskitem.h +++ b/plugin-mount/menudiskitem.h @@ -25,43 +25,52 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef MENUDISKITEM_H -#define MENUDISKITEM_H +#ifndef LXQT_PLUGIN_MOUNT_MENUDISKITEM_H +#define LXQT_PLUGIN_MOUNT_MENUDISKITEM_H #include +#include +#include +#include -namespace LxQt { -class MountDevice; -} - -class QToolButton; +class Popup; class MenuDiskItem : public QFrame { Q_OBJECT public: - explicit MenuDiskItem(LxQt::MountDevice *device, QWidget *parent); + explicit MenuDiskItem(Solid::Device device, Popup *popup); + ~MenuDiskItem(); - void setMountStatus(bool is_mount); + QString deviceUdi() const { return mDevice.udi(); } + void setMountStatus(bool mounted); - static bool isUsableDevice(const LxQt::MountDevice *device); +private: + void updateMountStatus(); + Solid::Device opticalParent() const; signals: - void error(const QString &msg); + void invalid(QString const & udi); private slots: - void ejectButtonClicked(); void diskButtonClicked(); - void update(); - void free(); - void mounted(); - void unmounted(); + void ejectButtonClicked(); + + void onMounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); + void onUnmounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); private: - LxQt::MountDevice *mDevice; + Popup *mPopup; + Solid::Device mDevice; QToolButton *mDiskButton; QToolButton *mEjectButton; + bool mDiskButtonClicked; + bool mEjectButtonClicked; }; #endif // MENUDISKITEM_H diff --git a/plugin-mount/popup.cpp b/plugin-mount/popup.cpp index 3bd7979..6a6b76e 100644 --- a/plugin-mount/popup.cpp +++ b/plugin-mount/popup.cpp @@ -26,21 +26,38 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include -#include -#include -#include -#include "menudiskitem.h" #include "popup.h" +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include +#include +#include +#include + +// Paulo: I'm not sure what this is for +static bool hasRemovableParent(Solid::Device device) +{ + // qDebug() << "acess:" << device.udi(); + for ( ; !device.udi().isEmpty(); device = device.parent()) + { + Solid::StorageDrive* drive = device.as(); + if (drive && drive->isRemovable()) + { + // qDebug() << "removable parent drive:" << device.udi(); + return true; + } + } + return false; +} -Popup::Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* parent): +Popup::Popup(ILxQtPanelPlugin * plugin, QWidget* parent): QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint), - mManager(manager), mPlugin(plugin), + mPlaceholder(nullptr), mDisplayCount(0) { - setObjectName("LxQtMountPopup"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setLayout(new QVBoxLayout(this)); @@ -48,96 +65,103 @@ Popup::Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* par setAttribute(Qt::WA_AlwaysShowToolTips); - connect(mManager, SIGNAL(deviceAdded(LxQt::MountDevice*)), - this, SLOT(addItem(LxQt::MountDevice*))); - connect(mManager, SIGNAL(deviceRemoved(LxQt::MountDevice*)), - this, SLOT(removeItem(LxQt::MountDevice*))); - mPlaceholder = new QLabel(tr("No devices are available"), this); mPlaceholder->setObjectName("NoDiskLabel"); layout()->addWidget(mPlaceholder); - mPlaceholder->hide(); - foreach(LxQt::MountDevice *device, mManager->devices()) - { - addItem(device); - } + //Perform the potential long time operation after object construction + //Note: can't use QTimer::singleShot with lambda in pre QT 5.4 code + QTimer * aux_timer = new QTimer; + connect(aux_timer, &QTimer::timeout, [this, aux_timer] + { + delete aux_timer; //cleanup + for (Solid::Device device : Solid::Device::listFromType(Solid::DeviceInterface::StorageAccess)) + if (hasRemovableParent(device)) + addItem(device); + }); + aux_timer->setSingleShot(true); + aux_timer->start(0); + + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + this, &Popup::onDeviceAdded); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + this, &Popup::onDeviceRemoved); } +void Popup::showHide() +{ + setVisible(isHidden()); +} -MenuDiskItem *Popup::addItem(LxQt::MountDevice *device) +void Popup::onDeviceAdded(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) - { - MenuDiskItem *item = new MenuDiskItem(device, this); - layout()->addWidget(item); - item->setVisible(true); - mDisplayCount++; - if (mDisplayCount != 0) - mPlaceholder->hide(); - - if (isVisible()) - realign(); - return item; - } - else - { - return 0; - } + Solid::Device device(udi); + if (device.is() && hasRemovableParent(device)) + addItem(device); } -void Popup::removeItem(LxQt::MountDevice *device) +void Popup::onDeviceRemoved(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + MenuDiskItem* item = nullptr; + const int size = layout()->count() - 1; + for (int i = size; 0 <= i; --i) { - mDisplayCount--; + QWidget *w = layout()->itemAt(i)->widget(); + if (w == mPlaceholder) + continue; + + MenuDiskItem *it = static_cast(w); + if (udi == it->deviceUdi()) + { + item = it; + break; + } + } + + if (item != nullptr) + { + layout()->removeWidget(item); + item->deleteLater(); + + --mDisplayCount; if (mDisplayCount == 0) mPlaceholder->show(); } } -void Popup::resizeEvent(QResizeEvent *event) -{ - QWidget::resizeEvent(event); - realign(); -} - - void Popup::showEvent(QShowEvent *event) { - if (mDisplayCount == 0) - mPlaceholder->show(); - + mPlaceholder->setVisible(mDisplayCount == 0); realign(); - - this->setFocus(); - this->activateWindow(); + setFocus(); + activateWindow(); QWidget::showEvent(event); emit visibilityChanged(true); } - void Popup::hideEvent(QHideEvent *event) { - mPlaceholder->hide(); - QWidget::hideEvent(event); emit visibilityChanged(false); } - -void Popup::realign() +void Popup::addItem(Solid::Device device) { - updateGeometry(); - adjustSize(); + MenuDiskItem *item = new MenuDiskItem(device, this); + connect(item, &MenuDiskItem::invalid, this, &Popup::onDeviceRemoved); + item->setVisible(true); + layout()->addWidget(item); - QRect rect = mPlugin->calculatePopupWindowPos(size()); - setGeometry(rect); -} + mDisplayCount++; + if (mDisplayCount != 0) + mPlaceholder->hide(); + if (isVisible()) + realign(); +} -void Popup::showHide() +void Popup::realign() { - setHidden(!isHidden()); + adjustSize(); + setGeometry(mPlugin->calculatePopupWindowPos(sizeHint())); } - diff --git a/plugin-mount/popup.h b/plugin-mount/popup.h index b6395f9..63dd098 100644 --- a/plugin-mount/popup.h +++ b/plugin-mount/popup.h @@ -26,48 +26,45 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_POPUP_H +#define LXQT_PLUGIN_MOUNT_POPUP_H -#ifndef POPUP_H -#define POPUP_H +#include "menudiskitem.h" +#include #include -#include "../panel/ilxqtpanelplugin.h" +#include -namespace LxQt { -class MountManager; -class MountDevice; -} - -class MenuDiskItem; -class QLabel; +class ILxQtPanelPlugin; class Popup: public QDialog { Q_OBJECT + public: - explicit Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* parent = 0); + explicit Popup(ILxQtPanelPlugin * plugin, QWidget* parent = 0); + void realign(); public slots: void showHide(); +private slots: + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); + signals: void visibilityChanged(bool visible); protected: - void resizeEvent(QResizeEvent *event); void showEvent(QShowEvent *event); void hideEvent(QHideEvent *event); -private slots: - MenuDiskItem *addItem(LxQt::MountDevice *device); - void removeItem(LxQt::MountDevice *device); - private: - void realign(); - LxQt::MountManager *mManager; - ILxQtPanelPlugin *mPlugin; + ILxQtPanelPlugin * mPlugin; QLabel *mPlaceholder; int mDisplayCount; + + void addItem(Solid::Device device); }; #endif // POPUP_H diff --git a/plugin-mount/translations/mount.ts b/plugin-mount/translations/mount.ts index 0f667ce..50d142b 100644 --- a/plugin-mount/translations/mount.ts +++ b/plugin-mount/translations/mount.ts @@ -2,68 +2,87 @@ - DeviceActionInfo - - - The device <b><nobr>"%1"</nobr></b> is connected. - - - - - The device <b><nobr>"%1"</nobr></b> is removed. - - + Button - + Removable media/devices manager - LxQtMountConfiguration + Configuration - + Removable Media Settings - + Behaviour - - When a device is connected + + When a device is connected : - + Popup menu - + Show info - + Do nothing - MountButton + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + + - + + Removable media/devices manager + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ar.ts b/plugin-mount/translations/mount_ar.ts index 51cab99..bcb7bf3 100644 --- a/plugin-mount/translations/mount_ar.ts +++ b/plugin-mount/translations/mount_ar.ts @@ -66,11 +66,27 @@ Click to eject this disc. اضغط ﻹخراج هذا القرص. + + + + Removable media/devices manager + مدير الوسائط واﻷقراص القابلة للفصل + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager مدير الوسائط واﻷقراص القابلة للفصل @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_cs.ts b/plugin-mount/translations/mount_cs.ts index a3b8abd..2fed6e0 100644 --- a/plugin-mount/translations/mount_cs.ts +++ b/plugin-mount/translations/mount_cs.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klepněte pro vysunutí tohoto disku. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správce odstranitelných nosičů/zařízení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_cs_CZ.ts b/plugin-mount/translations/mount_cs_CZ.ts index 36ad87f..95a721b 100644 --- a/plugin-mount/translations/mount_cs_CZ.ts +++ b/plugin-mount/translations/mount_cs_CZ.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klepněte pro vysunutí tohoto disku. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správce odstranitelných nosičů/zařízení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_da.ts b/plugin-mount/translations/mount_da.ts index 682f84a..f0a9538 100644 --- a/plugin-mount/translations/mount_da.ts +++ b/plugin-mount/translations/mount_da.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klik for at skubbe disken ud. + + + + Removable media/devices manager + Håndtering af medier/enheder + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Håndtering af medier/enheder @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_da_DK.ts b/plugin-mount/translations/mount_da_DK.ts index 1f0ddfc..0c71bcf 100644 --- a/plugin-mount/translations/mount_da_DK.ts +++ b/plugin-mount/translations/mount_da_DK.ts @@ -66,11 +66,27 @@ Click to eject this disc. Skub ud. + + + + Removable media/devices manager + Håndtering af flytbare medier + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Håndtering af flytbare medier @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_de.desktop b/plugin-mount/translations/mount_de.desktop index e187fcc..71a2208 100644 --- a/plugin-mount/translations/mount_de.desktop +++ b/plugin-mount/translations/mount_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Removable media -Comment=Easy mounting and unmounting of USB and optical drives. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Wechseldatenträger Verwaltung (USB, CD, DVD, ...) Name[de]=Wechseldatenträger +Comment[de]=Wechseldatenträgerverwaltung (USB, CD, DVD, ...) diff --git a/plugin-mount/translations/mount_de.ts b/plugin-mount/translations/mount_de.ts index 1ab39e9..335269f 100644 --- a/plugin-mount/translations/mount_de.ts +++ b/plugin-mount/translations/mount_de.ts @@ -2,97 +2,89 @@ - DeviceActionInfo + Button - - The device <b><nobr>"%1"</nobr></b> is connected. - Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. - - - - The device <b><nobr>"%1"</nobr></b> is removed. - Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. - - - + Removable media/devices manager - Entfernbare Medien-/Geräteverwaltung + Entfernbare Medien-/Geräteverwaltung - LxQtMountConfiguration - - LxQt Removable media manager settings - LxQt entfernbare Medienverwaltung-Einstellungen - + Configuration - + Removable Media Settings - + Entfernbare Medien - Einstellungen - + Behaviour Verhalten - - When a device is connected - Wenn ein Gerät verbunden wurde + + When a device is connected : + Wenn ein Gerät verbunden ist: - + Popup menu Aufklapp-Menü - + Show info - Zeige Informationen + Informationen anzeigen - + Do nothing Nichts tun - MenuDiskItem + DeviceActionInfo - Click to access this device from other applications. - Klicken, um auf dieses Gerät von anderen Anwendungen aus zuzugreifen. + + The device <b><nobr>"%1"</nobr></b> is connected. + Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. - Click to eject this disc. - Klicken, um diese CD auszuwerfen. + + The device <b><nobr>"%1"</nobr></b> is removed. + Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. - - - MountButton - + Removable media/devices manager Entfernbare Medien-/Geräteverwaltung + + + MenuDiskItem - The device <b><nobr>"%1"</nobr></b> is connected. - Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Das Einbinden von <b><nobr>"%1"</nobr></b> ist fehlgeschlagen: %2 - The device <b><nobr>"%1"</nobr></b> is removed. - Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. + + + Removable media/devices manager + Entfernbare Medien-/Geräteverwaltung - No devices Available. - Kein Gerät verfügbar. + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Das Lösen von <strong><nobr>"%1"</nobr></strong> ist fehlgeschlagen: %2 Popup - + No devices are available - + Keine Geräte verfügbar diff --git a/plugin-mount/translations/mount_el_GR.ts b/plugin-mount/translations/mount_el_GR.ts index 4240eca..ffdc669 100644 --- a/plugin-mount/translations/mount_el_GR.ts +++ b/plugin-mount/translations/mount_el_GR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Κλίκ για εξαγωγή αυτού του δίσκου. + + + + Removable media/devices manager + Διαχειριστής αφαιρούμενων μέσων/συσκευών + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Διαχειριστής αφαιρούμενων μέσων/συσκευών @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_eo.ts b/plugin-mount/translations/mount_eo.ts index b693a41..df1448d 100644 --- a/plugin-mount/translations/mount_eo.ts +++ b/plugin-mount/translations/mount_eo.ts @@ -66,11 +66,27 @@ Click to eject this disc. Alklaku por elĵeti ĉi tiun diskon. + + + + Removable media/devices manager + Mastrumilo de demeteblaj aparatoj + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Mastrumilo de demeteblaj aparatoj @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es.ts b/plugin-mount/translations/mount_es.ts index d6ecda5..f934515 100644 --- a/plugin-mount/translations/mount_es.ts +++ b/plugin-mount/translations/mount_es.ts @@ -66,11 +66,27 @@ Click to eject this disc. Haga clic para expulsar este disco. + + + + Removable media/devices manager + Gestor de medios y dispositivos extraíbles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestor de medios y dispositivos extraíbles @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es_UY.ts b/plugin-mount/translations/mount_es_UY.ts index 2fb2bf5..9adc366 100644 --- a/plugin-mount/translations/mount_es_UY.ts +++ b/plugin-mount/translations/mount_es_UY.ts @@ -66,11 +66,27 @@ Click to eject this disc. Presione para expulsar este disco. + + + + Removable media/devices manager + Administrador de dispositivos desmontables + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrador de dispositivos desmontables @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es_VE.ts b/plugin-mount/translations/mount_es_VE.ts index 1f6554a..cce1821 100644 --- a/plugin-mount/translations/mount_es_VE.ts +++ b/plugin-mount/translations/mount_es_VE.ts @@ -66,11 +66,27 @@ Click to eject this disc. Presione para expulsar este disco. + + + + Removable media/devices manager + Administrador de medios y dispositivos + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrador de medios y dispositivos @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_eu.ts b/plugin-mount/translations/mount_eu.ts index 6515b0e..7f5d9bc 100644 --- a/plugin-mount/translations/mount_eu.ts +++ b/plugin-mount/translations/mount_eu.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klikatu diskoa egozteko. + + + + Removable media/devices manager + Eduki/gailu aldagarrien kudeatzailea + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Eduki/gailu aldagarrien kudeatzailea @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_fi.ts b/plugin-mount/translations/mount_fi.ts index 22fe06d..d5c7403 100644 --- a/plugin-mount/translations/mount_fi.ts +++ b/plugin-mount/translations/mount_fi.ts @@ -66,11 +66,27 @@ Click to eject this disc. Napsauta poistaaksesi tämän levyn. + + + + Removable media/devices manager + Irrotettavien laitteiden ja levyjen hallinta + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Irrotettavien laitteiden ja levyjen hallinta @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_fr_FR.ts b/plugin-mount/translations/mount_fr_FR.ts index 5706bbf..9e34d71 100644 --- a/plugin-mount/translations/mount_fr_FR.ts +++ b/plugin-mount/translations/mount_fr_FR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Cliquez pour éjecter ce disque. + + + + Removable media/devices manager + Gestionnaire de médias/périphériques amovibles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestionnaire de médias/périphériques amovibles @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_hr.ts b/plugin-mount/translations/mount_hr.ts new file mode 100644 index 0000000..395f717 --- /dev/null +++ b/plugin-mount/translations/mount_hr.ts @@ -0,0 +1,90 @@ + + + + + Button + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Configuration + + + Removable Media Settings + Postavke uklonjivih medija + + + + Behaviour + Ponašanje + + + + When a device is connected : + + + + + Popup menu + + + + + Show info + Pokaži info + + + + Do nothing + Ne čini ništa + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Uređaj <b><nobr>"%1"</nobr></b> je spojen. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Uređaj <b><nobr>"%1"</nobr></b> je uklonjen. + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Montiranje <b><nobr>"%1"</nobr></b> nije uspjelo: %2 + + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Odmontiranje <strong><nobr>"%1"</nobr></strong> nije uspjelo: %2 + + + + Popup + + + No devices are available + Nije dostupan nijedan uređaj + + + diff --git a/plugin-mount/translations/mount_hu.ts b/plugin-mount/translations/mount_hu.ts index 52d99b0..6915125 100644 --- a/plugin-mount/translations/mount_hu.ts +++ b/plugin-mount/translations/mount_hu.ts @@ -1,71 +1,114 @@ - + DeviceActionInfo The device <b><nobr>"%1"</nobr></b> is connected. - + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. Removable media/devices manager - + Cserélhetőeszköz-kezelő LxQtMountConfiguration + + LxQt Removable media manager settings + A LxQt cserélhetőeszköz-kezelő beállításai + Removable Media Settings - + Cserélhető eszközbeállítás Behaviour - + Működés When a device is connected - + Ha az eszköz csatlakoztatva van Popup menu - + Felugró menü Show info - + Információ megjelenítése Do nothing - + Ne tegyen semmit + + + + MenuDiskItem + + Click to access this device from other applications. + Kattintson az eszköz más alkalmazásokból való eléréséhez. + + + Click to eject this disc. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 MountButton - + Removable media/devices manager - + Cserélhetőeszköz-kezelő + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + No devices Available. + Nem érhetők el eszközök. Popup - + No devices are available - + Nincs elérhető eszköz diff --git a/plugin-mount/translations/mount_hu_HU.ts b/plugin-mount/translations/mount_hu_HU.ts index 84c8f3d..1c1eb09 100644 --- a/plugin-mount/translations/mount_hu_HU.ts +++ b/plugin-mount/translations/mount_hu_HU.ts @@ -1,34 +1,34 @@ - + DeviceActionInfo The device <b><nobr>"%1"</nobr></b> is connected. - A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. Removable media/devices manager - Cserélhetőeszköz-kezelő + Cserélhetőeszköz-kezelő LxQtMountConfiguration LxQt Removable media manager settings - A LxQt cserélhetőeszköz-kezelő beállításai + A LxQt cserélhetőeszköz-kezelő beállításai Removable Media Settings - + Cserélhető eszközbeállítás @@ -60,39 +60,55 @@ MenuDiskItem Click to access this device from other applications. - Kattintson az eszköz más alkalmazásokból való eléréséhez. + Kattintson az eszköz más alkalmazásokból való eléréséhez. Click to eject this disc. - Kattintson a lemez kiadásához. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 MountButton - + Removable media/devices manager Cserélhetőeszköz-kezelő The device <b><nobr>"%1"</nobr></b> is connected. - A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. No devices Available. - Nem érhetők el eszközök. + Nem érhetők el eszközök. Popup - + No devices are available - + Nincs elérhető eszköz diff --git a/plugin-mount/translations/mount_ia.ts b/plugin-mount/translations/mount_ia.ts index 1f569ee..110a061 100644 --- a/plugin-mount/translations/mount_ia.ts +++ b/plugin-mount/translations/mount_ia.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_id_ID.ts b/plugin-mount/translations/mount_id_ID.ts index ea71dc0..943bfd6 100644 --- a/plugin-mount/translations/mount_id_ID.ts +++ b/plugin-mount/translations/mount_id_ID.ts @@ -62,11 +62,27 @@ Click to eject this disc. Klik untuk mengeluarkan disk ini. + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager @@ -74,7 +90,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_it_IT.ts b/plugin-mount/translations/mount_it_IT.ts index 50ec821..88d590f 100644 --- a/plugin-mount/translations/mount_it_IT.ts +++ b/plugin-mount/translations/mount_it_IT.ts @@ -66,11 +66,27 @@ Click to eject this disc. Fai clic per espellere il disco. + + + + Removable media/devices manager + Gestore dei dispositivi rimovibili + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestore dei dispositivi rimovibili @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ja.ts b/plugin-mount/translations/mount_ja.ts index 4ceebac..f62b4dc 100644 --- a/plugin-mount/translations/mount_ja.ts +++ b/plugin-mount/translations/mount_ja.ts @@ -52,10 +52,29 @@ 何もしない + + MenuDiskItem + + + + Removable media/devices manager + リムーバルメディア/デバイスの管理 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager リムーバルメディア/デバイスの管理 @@ -63,7 +82,7 @@ Popup - + No devices are available 接続可能なデバイスはありません diff --git a/plugin-mount/translations/mount_ko.ts b/plugin-mount/translations/mount_ko.ts index 016e1d2..7f8db3b 100644 --- a/plugin-mount/translations/mount_ko.ts +++ b/plugin-mount/translations/mount_ko.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_lt.ts b/plugin-mount/translations/mount_lt.ts index 20b705a..6855c3e 100644 --- a/plugin-mount/translations/mount_lt.ts +++ b/plugin-mount/translations/mount_lt.ts @@ -66,11 +66,27 @@ Click to eject this disc. Norėdami išstumti diską, spragtelėkite. + + + + Removable media/devices manager + Pašalinamų įrenginių tvarkytuvė + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Pašalinamų įrenginių tvarkytuvė @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_nl.ts b/plugin-mount/translations/mount_nl.ts index 3fed200..5f2db72 100644 --- a/plugin-mount/translations/mount_nl.ts +++ b/plugin-mount/translations/mount_nl.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klik om deze schijf uit te werpen. + + + + Removable media/devices manager + Beheerder van verwijderbare media/apparaten + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Beheerder van verwijderbare media/apparaten @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_pl_PL.ts b/plugin-mount/translations/mount_pl_PL.ts index 8119b92..5154fbc 100644 --- a/plugin-mount/translations/mount_pl_PL.ts +++ b/plugin-mount/translations/mount_pl_PL.ts @@ -6,17 +6,17 @@ The device <b><nobr>"%1"</nobr></b> is connected. - Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. + Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. The device <b><nobr>"%1"</nobr></b> is removed. - Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. + Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. Removable media/devices manager - Menedżer nośników wymiennych + Menedżer nośników wymiennych @@ -28,7 +28,7 @@ Removable Media Settings - + Ustawienia nośników wymiennych @@ -66,11 +66,27 @@ Click to eject this disc. Kliknij aby wysunąć ten dysk. + + + + Removable media/devices manager + Menedżer nośników wymiennych + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Menedżer nośników wymiennych @@ -90,9 +106,9 @@ Popup - + No devices are available - + Brak dostępnych urządzeń diff --git a/plugin-mount/translations/mount_pt.ts b/plugin-mount/translations/mount_pt.ts index 6c2ef05..9e96135 100644 --- a/plugin-mount/translations/mount_pt.ts +++ b/plugin-mount/translations/mount_pt.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clique para ejetar este disco. + + + + Removable media/devices manager + Gestor de discos e unidades amovíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + +
MountButton - + Removable media/devices manager Gestor de discos e unidades amovíveis @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_pt_BR.ts b/plugin-mount/translations/mount_pt_BR.ts index ca1cb04..d886a6d 100644 --- a/plugin-mount/translations/mount_pt_BR.ts +++ b/plugin-mount/translations/mount_pt_BR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clique para ejetar este disco. + + + + Removable media/devices manager + Gerenciador de dispositivos/mídias removíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gerenciador de dispositivos/mídias removíveis @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ro_RO.ts b/plugin-mount/translations/mount_ro_RO.ts index dc7e5b7..b7fcad5 100644 --- a/plugin-mount/translations/mount_ro_RO.ts +++ b/plugin-mount/translations/mount_ro_RO.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clic pentru a scoate acest disc. + + + + Removable media/devices manager + Administrator medii/dispozitive detașabile + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrator medii/dispozitive detașabile @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ru.ts b/plugin-mount/translations/mount_ru.ts index 6ef7a60..836576d 100644 --- a/plugin-mount/translations/mount_ru.ts +++ b/plugin-mount/translations/mount_ru.ts @@ -52,10 +52,29 @@ Ничего не делать + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager Диспетчер съёмных медиа/устройств @@ -63,7 +82,7 @@ Popup - + No devices are available Нет доступных устройств diff --git a/plugin-mount/translations/mount_ru_RU.ts b/plugin-mount/translations/mount_ru_RU.ts index d7b461b..f6e59b4 100644 --- a/plugin-mount/translations/mount_ru_RU.ts +++ b/plugin-mount/translations/mount_ru_RU.ts @@ -52,10 +52,29 @@ Ничего не делать + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager Диспетчер съёмных медиа/устройств @@ -63,7 +82,7 @@ Popup - + No devices are available Нет доступных устройств diff --git a/plugin-mount/translations/mount_sk_SK.ts b/plugin-mount/translations/mount_sk_SK.ts index 16dfee4..742c1e6 100644 --- a/plugin-mount/translations/mount_sk_SK.ts +++ b/plugin-mount/translations/mount_sk_SK.ts @@ -66,11 +66,27 @@ Click to eject this disc. Kliknutím vysuniete tento disk. + + + + Removable media/devices manager + Správca prenosných médií a zariadení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správca prenosných médií a zariadení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sl.ts b/plugin-mount/translations/mount_sl.ts index 411d01b..d325a6d 100644 --- a/plugin-mount/translations/mount_sl.ts +++ b/plugin-mount/translations/mount_sl.ts @@ -66,11 +66,27 @@ Click to eject this disc. Kliknite za izmet diska. + + + + Removable media/devices manager + Upravljalnik odstranljivih nosilcev/naprav + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Upravljalnik odstranljivih nosilcev/naprav @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr@latin.ts b/plugin-mount/translations/mount_sr@latin.ts index 7d26182..950b4ea 100644 --- a/plugin-mount/translations/mount_sr@latin.ts +++ b/plugin-mount/translations/mount_sr@latin.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr_BA.ts b/plugin-mount/translations/mount_sr_BA.ts index 5398c9b..1d05e04 100644 --- a/plugin-mount/translations/mount_sr_BA.ts +++ b/plugin-mount/translations/mount_sr_BA.ts @@ -66,11 +66,27 @@ Click to eject this disc. Кликните да избаците диск. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Менаџер уклоњивих медија/уређаја @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr_RS.ts b/plugin-mount/translations/mount_sr_RS.ts index 5398c9b..1d05e04 100644 --- a/plugin-mount/translations/mount_sr_RS.ts +++ b/plugin-mount/translations/mount_sr_RS.ts @@ -66,11 +66,27 @@ Click to eject this disc. Кликните да избаците диск. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Менаџер уклоњивих медија/уређаја @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_th_TH.ts b/plugin-mount/translations/mount_th_TH.ts index 0b728a3..00cb276 100644 --- a/plugin-mount/translations/mount_th_TH.ts +++ b/plugin-mount/translations/mount_th_TH.ts @@ -66,11 +66,27 @@ Click to eject this disc. คลิกเพื่อดันแผ่นดิสก์ออก + + + + Removable media/devices manager + ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_tr.ts b/plugin-mount/translations/mount_tr.ts index ba10fde..bae5385 100644 --- a/plugin-mount/translations/mount_tr.ts +++ b/plugin-mount/translations/mount_tr.ts @@ -66,11 +66,27 @@ Click to eject this disc. Bu diski çıkartmak için tıklayın. + + + + Removable media/devices manager + Çıkarılabilir ortam/aygıt yönetici + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Çıkarılabilir ortam/aygıt yönetici @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_uk.ts b/plugin-mount/translations/mount_uk.ts index bd50448..3838030 100644 --- a/plugin-mount/translations/mount_uk.ts +++ b/plugin-mount/translations/mount_uk.ts @@ -66,11 +66,27 @@ Click to eject this disc. Натисніть, щоб витягти диск. + + + + Removable media/devices manager + Керування знімними носіями + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Керування знімними носіями @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_zh_CN.ts b/plugin-mount/translations/mount_zh_CN.ts index d5ccd0b..e01eac9 100644 --- a/plugin-mount/translations/mount_zh_CN.ts +++ b/plugin-mount/translations/mount_zh_CN.ts @@ -66,11 +66,27 @@ Click to eject this disc. 点击以弹出该存储卷。 + + + + Removable media/devices manager + 可移动存储设备管理器 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager 可移动存储设备管理器 @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_zh_TW.ts b/plugin-mount/translations/mount_zh_TW.ts index 0fa80bd..81bf339 100644 --- a/plugin-mount/translations/mount_zh_TW.ts +++ b/plugin-mount/translations/mount_zh_TW.ts @@ -66,11 +66,27 @@ Click to eject this disc. 點擊以退出此磁片。 + + + + Removable media/devices manager + 可卸除式裝置管理員 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager 可卸除式裝置管理員 @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-networkmonitor/CMakeLists.txt b/plugin-networkmonitor/CMakeLists.txt index 6357384..f83b32f 100644 --- a/plugin-networkmonitor/CMakeLists.txt +++ b/plugin-networkmonitor/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtnetworkmonitorconfiguration.cpp ) -set(MOCS - lxqtnetworkmonitorplugin.h - lxqtnetworkmonitor.h - lxqtnetworkmonitorconfiguration.h -) - set(UIS lxqtnetworkmonitorconfiguration.ui ) diff --git a/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp b/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp index 77c2d00..ef73086 100644 --- a/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp +++ b/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp @@ -49,7 +49,7 @@ QWidget *LxQtNetworkMonitorPlugin::widget() QDialog *LxQtNetworkMonitorPlugin::configureDialog() { - return new LxQtNetworkMonitorConfiguration(settings(), mWidget); + return new LxQtNetworkMonitorConfiguration(settings()); } void LxQtNetworkMonitorPlugin::settingsChanged() diff --git a/plugin-networkmonitor/lxqtnetworkmonitorplugin.h b/plugin-networkmonitor/lxqtnetworkmonitorplugin.h index ff61eab..3441d60 100644 --- a/plugin-networkmonitor/lxqtnetworkmonitorplugin.h +++ b/plugin-networkmonitor/lxqtnetworkmonitorplugin.h @@ -62,7 +62,7 @@ class LxQtNetworkMonitorPluginLibrary: public QObject, public ILxQtPanelPluginLi Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtNetworkMonitorPlugin(startupInfo); } diff --git a/plugin-networkmonitor/translations/networkmonitor_cs.desktop b/plugin-networkmonitor/translations/networkmonitor_cs.desktop index 12596b2..4f23ddf 100644 --- a/plugin-networkmonitor/translations/networkmonitor_cs.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_cs.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[cs]=Nabídka -Name[cs]=Hlavní nabídka +Name[cs]=Monitor sítě +Comment[cs]=Zobrazuje stav a aktivity sítě diff --git a/plugin-networkmonitor/translations/networkmonitor_da.ts b/plugin-networkmonitor/translations/networkmonitor_da.ts new file mode 100644 index 0000000..f29aa53 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_da.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Netværksinterface <b>%1</b> + + + + Transmitted %1 + Sendt %1 + + + + Received %1 + Modtaget %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Indstillinger for LxQt Netværksmonitor + + + + Network Monitor settings + + + + + General + Generelt + + + + Interface + Grænseflade + + + + Modem + Modem + + + + Monitor + Monitor + + + + Network + Netværk + + + + Wireless + Trådløs + + + + Icon + Ikon + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_de.desktop b/plugin-networkmonitor/translations/networkmonitor_de.desktop index d9dc91a..ba549f3 100644 --- a/plugin-networkmonitor/translations/networkmonitor_de.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_de.desktop @@ -1,10 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - -# Translations -Name[de]=Netzwerk Monitor +Name[de]=Netzwerkmonitor Comment[de]=Informationen zu Status und Aktivität des Netzwerks diff --git a/plugin-networkmonitor/translations/networkmonitor_de.ts b/plugin-networkmonitor/translations/networkmonitor_de.ts index 9b69205..a128522 100644 --- a/plugin-networkmonitor/translations/networkmonitor_de.ts +++ b/plugin-networkmonitor/translations/networkmonitor_de.ts @@ -51,14 +51,10 @@ LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - LxQt Netzwerkmonitor Einstellungen - Network Monitor settings - + Netzwerkmonitor-Einstellungen @@ -78,7 +74,7 @@ Monitor - Monitor + Bildschirm @@ -88,7 +84,7 @@ Wireless - drahtlos + Drahtlos diff --git a/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop b/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop deleted file mode 100644 index d9dc91a..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - -# Translations -Name[de]=Netzwerk Monitor -Comment[de]=Informationen zu Status und Aktivität des Netzwerks diff --git a/plugin-networkmonitor/translations/networkmonitor_el.desktop b/plugin-networkmonitor/translations/networkmonitor_el.desktop new file mode 100644 index 0000000..c068ef0 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_el.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin + +Name=Network monitor +Comment=Displays network status and activity. + + + + +# Translations +Comment[el_GR]=Εμφάνιση της κατάστασης δικτύου και δραστηριότητας. +Name[el_GR]=Επόπτης δικτύου diff --git a/plugin-networkmonitor/translations/networkmonitor_el.ts b/plugin-networkmonitor/translations/networkmonitor_el.ts new file mode 100644 index 0000000..5dc42bb --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_el.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Διεπαφή δικτύου <b>%1</b> + + + + Transmitted %1 + Στάλθηκαν %1 + + + + Received %1 + Λήφθηκαν %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Ρυθμίσεις επίβλεψης δικτύου LxQt + + + + Network Monitor settings + + + + + General + Γενικά + + + + Interface + Διεπαφή + + + + Modem + Μόντεμ + + + + Monitor + Εποπτεία + + + + Network + Δίκτυο + + + + Wireless + Ασύρματο + + + + Icon + Εικονίδιο + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_eo.desktop b/plugin-networkmonitor/translations/networkmonitor_eo.desktop index fe7f8d8..36c540d 100644 --- a/plugin-networkmonitor/translations/networkmonitor_eo.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_eo.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[eo]=Agordoj de muso por LxQto -Name[eo]=Agordi X11-muson +Name[eo]=Ret-observilo +Comment[eo]=Elmontras ret-staton kaj -aktivecon diff --git a/plugin-networkmonitor/translations/networkmonitor_eo.ts b/plugin-networkmonitor/translations/networkmonitor_eo.ts index 2713b62..a6fc9fa 100644 --- a/plugin-networkmonitor/translations/networkmonitor_eo.ts +++ b/plugin-networkmonitor/translations/networkmonitor_eo.ts @@ -1,95 +1,95 @@ - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Ĝenerala - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Reta interfaco <b>%1</b> + + + + Transmitted %1 + Sendita %1 + + + + Received %1 + Ricevita %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Agordoj por ret-observilo + + + + General + Ĝenerala + + + + Interface + Interfaco + + + + Modem + Modemo + + + + Monitor + Observilo + + + + Network + Reto + + + + Wireless + Sendrata + + + + Icon + Bildsimbolo + + diff --git a/plugin-networkmonitor/translations/networkmonitor_es.desktop b/plugin-networkmonitor/translations/networkmonitor_es.desktop index bbc4755..5352d05 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_es.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[es]=Administrador de tareas -Name[es]=Entorno de escritorio Qt4 +Comment[es]=Despliega el estado y actividades de la red. +Name[es]=Monitor de redes diff --git a/plugin-networkmonitor/translations/networkmonitor_es.ts b/plugin-networkmonitor/translations/networkmonitor_es.ts index 034b630..6e06b39 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es.ts +++ b/plugin-networkmonitor/translations/networkmonitor_es.ts @@ -53,12 +53,12 @@ LxQtNetworkMonitorConfiguration LxQt Network Monitor settings - Opciones del Monitor de Redes de LxQt + Configuración del monitor de redes de LxQt Network Monitor settings - + Configuración del monitor de redes @@ -73,7 +73,7 @@ Modem - Modem + Módem @@ -88,7 +88,7 @@ Wireless - Inalámbrico + Conexión inalámbrica diff --git a/plugin-networkmonitor/translations/networkmonitor_fr.desktop b/plugin-networkmonitor/translations/networkmonitor_fr.desktop new file mode 100644 index 0000000..5d2d242 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_fr.desktop @@ -0,0 +1,3 @@ +# Translations +Name[fr_FR]=Moniteur Réseau +Comment[fr_FR]=Affiche le statut et l'activité du réseau diff --git a/plugin-networkmonitor/translations/networkmonitor_fr.ts b/plugin-networkmonitor/translations/networkmonitor_fr.ts new file mode 100644 index 0000000..3171548 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_fr.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interface réseau <b>%1</b> + + + + Transmitted %1 + Transmis %1 + + + + Received %1 + Reçu %1 + + + + B + o + + + + KiB + Ko + + + + MiB + Mo + + + + GiB + Go + + + + TiB + To + + + + PiB + Po + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Paramètres du moniteur réseau + + + + General + Généraux + + + + Interface + Interface + + + + Modem + Modem + + + + Monitor + Moniteur + + + + Network + Réseau + + + + Wireless + Sans-Fil + + + + Icon + Icône + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_hr.ts b/plugin-networkmonitor/translations/networkmonitor_hr.ts new file mode 100644 index 0000000..e0bd49b --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_hr.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Mrežno sučelje <b>%1</b> + + + + Transmitted %1 + + + + + Received %1 + Primljeno %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Postavke nadzora mreže + + + + General + Općenito + + + + Interface + Sučelje + + + + Modem + Modem + + + + Monitor + Nadzor + + + + Network + Mreža + + + + Wireless + Bežično + + + + Icon + Ikona + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_hu.desktop b/plugin-networkmonitor/translations/networkmonitor_hu.desktop index 06bf911..694cf7f 100644 --- a/plugin-networkmonitor/translations/networkmonitor_hu.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_hu.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[hu]=Alkalmazásmenü Name[hu]=Alkalmazásindító alapú menü +Comment[hu]=Alkalmazásmenü diff --git a/plugin-networkmonitor/translations/networkmonitor_hu.ts b/plugin-networkmonitor/translations/networkmonitor_hu.ts new file mode 100644 index 0000000..b910bf5 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_hu.ts @@ -0,0 +1,95 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Hálózati eszköz <b>%1</b> + + + + Transmitted %1 + Küldött %1 + + + + Received %1 + Fogadott %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + Tib + + + + PiB + Pib + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Hálózatfigyelő beállítás + + + + General + Általános + + + + Interface + Eszköz + + + + Modem + + + + + Monitor + + + + + Network + Hálózat + + + + Wireless + + + + + Icon + Ikon + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts b/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts deleted file mode 100644 index 5573391..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Általános - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_it.desktop b/plugin-networkmonitor/translations/networkmonitor_it.desktop index 51106c2..d3e6e88 100644 --- a/plugin-networkmonitor/translations/networkmonitor_it.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_it.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[it]=Centro di Configurazione LxQt -Name[it]=Configura moduli di LXDE-Qt +Name[it]=Monitor di rete +Comment[it]=Mostra stato e attività della rete diff --git a/plugin-networkmonitor/translations/networkmonitor_it.ts b/plugin-networkmonitor/translations/networkmonitor_it.ts new file mode 100644 index 0000000..90dfa3a --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_it.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interfaccia di rete <b>%1</b> + + + + Transmitted %1 + Trasmesso %1 + + + + Received %1 + Ricevuto %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Impostazioni del monitor di rete di LxQt + + + + Network Monitor settings + Impostazioni del monitor di rete + + + + General + Generale + + + + Interface + Interfaccia + + + + Modem + Modem + + + + Monitor + Monitor + + + + Network + Rete + + + + Wireless + Wireless + + + + Icon + Icona + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop b/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop deleted file mode 100644 index b41c335..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[it_IT]=Esci -Name[it_IT]=Permette di passare ad altri desktop virtuali diff --git a/plugin-networkmonitor/translations/networkmonitor_lt.ts b/plugin-networkmonitor/translations/networkmonitor_lt.ts deleted file mode 100644 index 482d885..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_lt.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Pagrindinės - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_nl.desktop b/plugin-networkmonitor/translations/networkmonitor_nl.desktop index 19787ef..a53f431 100644 --- a/plugin-networkmonitor/translations/networkmonitor_nl.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_nl.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[nl]=Notepad -Name[nl]=Scherm notepad +Name[nl]=Netwerkmonitor +Comment[nl]=Toont netwerkstatus en -activiteit diff --git a/plugin-networkmonitor/translations/networkmonitor_nl.ts b/plugin-networkmonitor/translations/networkmonitor_nl.ts index 243ae1b..da59450 100644 --- a/plugin-networkmonitor/translations/networkmonitor_nl.ts +++ b/plugin-networkmonitor/translations/networkmonitor_nl.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Netwerkmonitorinstellingen diff --git a/plugin-networkmonitor/translations/networkmonitor_pl.desktop b/plugin-networkmonitor/translations/networkmonitor_pl.desktop index c49b4e0..90348bf 100644 --- a/plugin-networkmonitor/translations/networkmonitor_pl.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_pl.desktop @@ -1,13 +1,10 @@ [Desktop Entry] Type=Service -ServiceTypes=LxQtPanel/Plugin +ServiceTypes=LXQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[pl]=Menu -Name[pl]=Główne menu +Name[pl]=monitor sieci +Comment[pl]=pokazuje stan i aktywność sieci. diff --git a/plugin-networkmonitor/translations/networkmonitor_pl.ts b/plugin-networkmonitor/translations/networkmonitor_pl.ts new file mode 100644 index 0000000..e402658 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_pl.ts @@ -0,0 +1,99 @@ + + + + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Interfejs sieci <b>%1</b> + + + + Transmitted %1 + Przesłano %1 + + + + Received %1 + Otrzymano %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + LxQt Network Monitor settings + Ustawienia LxQt Network Monitor + + + + Network Monitor settings + Ustawienia monitora sieci + + + + General + Ogólne + + + + Interface + Interfejs + + + + Modem + Modem + + + + Monitor + Monitor + + + + Network + Sieć + + + + Wireless + Bezprzewodowe + + + + Icon + Ikona + + + diff --git a/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop b/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop deleted file mode 100644 index 69163be..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[pl_PL]=Konfiguracja wyglądu LxQt -Name[pl_PL]=Środowisko graficzne Qt4 diff --git a/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop b/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop index 88e7a69..d98d904 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[ro_RO]=Părăsește -Name[ro_RO]=Lansează aplicațiile favorite +Comment[ro_RO]=Afisează starea și activitatea rețelei +Name[ro_RO]=Monitor rețea diff --git a/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts b/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts index b333af7..e3d019f 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts +++ b/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Setări monitorizare rețea diff --git a/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop b/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop deleted file mode 100644 index 5e052b9..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[ru_RU]=Отображает сетевой статус и активность. -Name[ru_RU]=Сетевой Монитор \ No newline at end of file diff --git a/plugin-networkmonitor/translations/networkmonitor_tr.desktop b/plugin-networkmonitor/translations/networkmonitor_tr.desktop index 66e7f8e..db2f801 100644 --- a/plugin-networkmonitor/translations/networkmonitor_tr.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_tr.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[tr]=Not Defteri -Name[tr]=Ekran not defteri +Name[tr]=Ağ izleme +Comment[tr]=Ağ iletişimi izleme ve yönetme diff --git a/plugin-networkmonitor/translations/networkmonitor_tr.ts b/plugin-networkmonitor/translations/networkmonitor_tr.ts index 758a3ab..903d363 100644 --- a/plugin-networkmonitor/translations/networkmonitor_tr.ts +++ b/plugin-networkmonitor/translations/networkmonitor_tr.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Ağ İzleme Ayarları diff --git a/plugin-quicklaunch/CMakeLists.txt b/plugin-quicklaunch/CMakeLists.txt index 624c9b5..dd48bcf 100644 --- a/plugin-quicklaunch/CMakeLists.txt +++ b/plugin-quicklaunch/CMakeLists.txt @@ -14,15 +14,8 @@ set(SOURCES quicklaunchaction.cpp ) -set(MOCS - lxqtquicklaunchplugin.h - lxqtquicklaunch.h - quicklaunchbutton.h - quicklaunchaction.h -) - set(LIBRARIES - ${QTXDG_LIBRARIES} + Qt5Xdg ) include_directories( diff --git a/plugin-quicklaunch/lxqtquicklaunch.cpp b/plugin-quicklaunch/lxqtquicklaunch.cpp index 03f4edd..9a8c917 100644 --- a/plugin-quicklaunch/lxqtquicklaunch.cpp +++ b/plugin-quicklaunch/lxqtquicklaunch.cpp @@ -28,24 +28,22 @@ #include "lxqtquicklaunch.h" #include "quicklaunchbutton.h" -#include #include "quicklaunchaction.h" #include "../panel/ilxqtpanelplugin.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include + LxQtQuickLaunch::LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent) : QFrame(parent), @@ -112,20 +110,24 @@ LxQtQuickLaunch::LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent) : realign(); } + LxQtQuickLaunch::~LxQtQuickLaunch() { } + int LxQtQuickLaunch::indexOfButton(QuickLaunchButton* button) const { return mLayout->indexOf(button); } + int LxQtQuickLaunch::countOfButtons() const { return mLayout->count(); } + void LxQtQuickLaunch::realign() { mLayout->setEnabled(false); @@ -152,6 +154,7 @@ void LxQtQuickLaunch::realign() mLayout->setEnabled(true); } + void LxQtQuickLaunch::addButton(QuickLaunchAction* action) { mLayout->setEnabled(false); @@ -170,6 +173,7 @@ void LxQtQuickLaunch::addButton(QuickLaunchAction* action) realign(); } + void LxQtQuickLaunch::dragEnterEvent(QDragEnterEvent *e) { // Getting URL from mainmenu... @@ -185,6 +189,7 @@ void LxQtQuickLaunch::dragEnterEvent(QDragEnterEvent *e) } } + void LxQtQuickLaunch::dropEvent(QDropEvent *e) { const QMimeData *mime = e->mimeData(); @@ -235,6 +240,7 @@ void LxQtQuickLaunch::switchButtons(QuickLaunchButton *button1, QuickLaunchButto saveSettings(); } + void LxQtQuickLaunch::buttonDeleted() { QuickLaunchButton *btn = qobject_cast(sender()); @@ -251,6 +257,7 @@ void LxQtQuickLaunch::buttonDeleted() realign(); } + void LxQtQuickLaunch::buttonMoveLeft() { QuickLaunchButton *btn = qobject_cast(sender()); @@ -309,6 +316,7 @@ void LxQtQuickLaunch::saveSettings() settings->endArray(); } + void LxQtQuickLaunch::showPlaceHolder() { if (!mPlaceHolder) diff --git a/plugin-quicklaunch/lxqtquicklaunch.h b/plugin-quicklaunch/lxqtquicklaunch.h index 4e11c24..624c428 100644 --- a/plugin-quicklaunch/lxqtquicklaunch.h +++ b/plugin-quicklaunch/lxqtquicklaunch.h @@ -34,6 +34,7 @@ #include #include + class XdgDesktopFile; class QuickLaunchAction; class QDragEnterEvent; @@ -45,6 +46,7 @@ namespace LxQt { class GridLayout; } + /*! \brief Loader for "quick launcher" icons in the panel. \author Petr Vanek */ @@ -80,5 +82,4 @@ private slots: void buttonMoveRight(); }; - #endif diff --git a/plugin-quicklaunch/lxqtquicklaunchplugin.cpp b/plugin-quicklaunch/lxqtquicklaunchplugin.cpp index bbc1f21..2242eec 100644 --- a/plugin-quicklaunch/lxqtquicklaunchplugin.cpp +++ b/plugin-quicklaunch/lxqtquicklaunchplugin.cpp @@ -25,10 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtquicklaunchplugin.h" #include "lxqtquicklaunch.h" + LxQtQuickLaunchPlugin::LxQtQuickLaunchPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), diff --git a/plugin-quicklaunch/lxqtquicklaunchplugin.h b/plugin-quicklaunch/lxqtquicklaunchplugin.h index bbb2c17..88c7a3b 100644 --- a/plugin-quicklaunch/lxqtquicklaunchplugin.h +++ b/plugin-quicklaunch/lxqtquicklaunchplugin.h @@ -25,12 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTQUICKLAUNCHPLUGIN_H #define LXQTQUICKLAUNCHPLUGIN_H #include "../panel/ilxqtpanelplugin.h" #include + + class LxQtQuickLaunch; class LxQtQuickLaunchPlugin: public QObject, public ILxQtPanelPlugin @@ -42,6 +43,7 @@ public: virtual QWidget *widget(); virtual QString themeId() const { return "QuickLaunch"; } + virtual Flags flags() const { return NeedsHandle; } void realign(); @@ -55,10 +57,10 @@ private: class LxQtQuickLaunchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtQuickLaunchPlugin(startupInfo); } diff --git a/plugin-quicklaunch/quicklaunchaction.cpp b/plugin-quicklaunch/quicklaunchaction.cpp index 0d282a0..3b6e821 100644 --- a/plugin-quicklaunch/quicklaunchaction.cpp +++ b/plugin-quicklaunch/quicklaunchaction.cpp @@ -25,21 +25,18 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "quicklaunchaction.h" - -#include -#include -#include -#include #include #include #include - +#include +#include +#include #include #include #include + QuickLaunchAction::QuickLaunchAction(const QString & name, const QString & exec, const QString & icon, @@ -48,7 +45,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & name, m_valid(true) { m_type = ActionLegacy; - + m_settingsMap["name"] = name; m_settingsMap["exec"] = exec; m_settingsMap["icon"] = icon; @@ -68,7 +65,7 @@ QuickLaunchAction::QuickLaunchAction(const XdgDesktopFile * xdg, m_valid(true) { m_type = ActionXdg; - + m_settingsMap["desktop"] = xdg->fileName(); QString title(xdg->localizedValue("Name").toString()); @@ -90,7 +87,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & fileName, QWidget * parent) m_type = ActionFile; setText(fileName); setData(fileName); - + m_settingsMap["file"] = fileName; QFileInfo fi(fileName); @@ -105,7 +102,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & fileName, QWidget * parent) XdgMimeType mi(db.mimeTypeForFile(fi)); setIcon(mi.icon()); } - + connect(this, SIGNAL(triggered()), this, SLOT(execAction())); } diff --git a/plugin-quicklaunch/quicklaunchaction.h b/plugin-quicklaunch/quicklaunchaction.h index 61d4793..423850c 100644 --- a/plugin-quicklaunch/quicklaunchaction.h +++ b/plugin-quicklaunch/quicklaunchaction.h @@ -25,12 +25,12 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef QUICKLAUNCHACTION_H #define QUICKLAUNCHACTION_H #include + class XdgDesktopFile; @@ -57,13 +57,13 @@ public: /*! Constructor for XDG desktop handlers. */ QuickLaunchAction(const XdgDesktopFile * xdg, QWidget * parent); - /*! Constructor for regular files + /*! Constructor for regular files */ QuickLaunchAction(const QString & fileName, QWidget * parent); //! Returns true if the action is valid (contains all required properties). bool isValid() { return m_valid; } - + QHash settingsMap() { return m_settingsMap; } public slots: diff --git a/plugin-quicklaunch/quicklaunchbutton.cpp b/plugin-quicklaunch/quicklaunchbutton.cpp index 59fdd79..7ba8055 100644 --- a/plugin-quicklaunch/quicklaunchbutton.cpp +++ b/plugin-quicklaunch/quicklaunchbutton.cpp @@ -25,17 +25,16 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "quicklaunchbutton.h" +#include "lxqtquicklaunch.h" #include +#include #include +#include #include #include -#include #include #include -#include - -#include "quicklaunchbutton.h" -#include "lxqtquicklaunch.h" #define MIMETYPE "x-lxqt/quicklaunch-button" @@ -74,11 +73,13 @@ QuickLaunchButton::QuickLaunchButton(QuickLaunchAction * act, QWidget * parent) this, SLOT(this_customContextMenuRequested(const QPoint&))); } + QuickLaunchButton::~QuickLaunchButton() { //m_act->deleteLater(); } + QHash QuickLaunchButton::settingsMap() { Q_ASSERT(mAct); @@ -95,11 +96,13 @@ void QuickLaunchButton::this_customContextMenuRequested(const QPoint & pos) mMenu->popup(mapToGlobal(pos)); } + void QuickLaunchButton::selfRemove() { emit buttonDeleted(); } + void QuickLaunchButton::paintEvent(QPaintEvent *) { // Do not paint that ugly "has menu" arrow @@ -110,6 +113,7 @@ void QuickLaunchButton::paintEvent(QPaintEvent *) p.drawComplexControl(QStyle::CC_ToolButton, opt); } + void QuickLaunchButton::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::LeftButton && e->modifiers() == Qt::ControlModifier) @@ -121,6 +125,7 @@ void QuickLaunchButton::mousePressEvent(QMouseEvent *e) QToolButton::mousePressEvent(e); } + void QuickLaunchButton::mouseMoveEvent(QMouseEvent *e) { if (!(e->buttons() & Qt::LeftButton)) @@ -152,6 +157,7 @@ void QuickLaunchButton::mouseMoveEvent(QMouseEvent *e) } } + void QuickLaunchButton::dragMoveEvent(QDragMoveEvent * e) { if (e->mimeData()->hasFormat(MIMETYPE)) @@ -160,6 +166,7 @@ void QuickLaunchButton::dragMoveEvent(QDragMoveEvent * e) e->ignore(); } + void QuickLaunchButton::dragEnterEvent(QDragEnterEvent *e) { const ButtonMimeData *mimeData = qobject_cast(e->mimeData()); @@ -168,4 +175,3 @@ void QuickLaunchButton::dragEnterEvent(QDragEnterEvent *e) emit switchButtons(mimeData->button(), this); } } - diff --git a/plugin-quicklaunch/quicklaunchbutton.h b/plugin-quicklaunch/quicklaunchbutton.h index 57f8136..cedaf4c 100644 --- a/plugin-quicklaunch/quicklaunchbutton.h +++ b/plugin-quicklaunch/quicklaunchbutton.h @@ -30,9 +30,9 @@ #ifndef LXQTQUICKLAUNCHBUTTON_H #define LXQTQUICKLAUNCHBUTTON_H -#include -#include #include "quicklaunchaction.h" +#include +#include class QuickLaunchButton : public QToolButton diff --git a/plugin-quicklaunch/translations/quicklaunch.ts b/plugin-quicklaunch/translations/quicklaunch.ts index e48df72..ca203d4 100644 --- a/plugin-quicklaunch/translations/quicklaunch.ts +++ b/plugin-quicklaunch/translations/quicklaunch.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_ar.ts b/plugin-quicklaunch/translations/quicklaunch_ar.ts index e460928..90f5092 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ar.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ar.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error خطاٌ في النَّقل - + File/URL '%1' cannot be embedded into QuickLaunch for now ﻻ يمكن تضمين الملف أو الرَّابط %1 في لوحة البدء السَّريع حاليَّاً - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left إلى اليسار - + Move right إلى اليمين - + Remove from quicklaunch إزالة من لوحة البدء السَّريع diff --git a/plugin-quicklaunch/translations/quicklaunch_cs.ts b/plugin-quicklaunch/translations/quicklaunch_cs.ts index 8a458bc..078d8a8 100644 --- a/plugin-quicklaunch/translations/quicklaunch_cs.ts +++ b/plugin-quicklaunch/translations/quicklaunch_cs.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Problém s upuštěním - + File/URL '%1' cannot be embedded into QuickLaunch for now Soubor/URL '%1' nyní nelze vložit do rychlého spuštění - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Přesunout vlevo - + Move right Přesunout vpravo - + Remove from quicklaunch Odstranit z rychlého spuštění diff --git a/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts b/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts index 9c9451d..1041dde 100644 --- a/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts +++ b/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Problém s upuštěním - + File/URL '%1' cannot be embedded into QuickLaunch for now Soubor/URL '%1' nyní nelze vložit do rychlého spuštění - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Přesunout vlevo - + Move right Přesunout vpravo - + Remove from quicklaunch Odstranit z rychlého spuštění diff --git a/plugin-quicklaunch/translations/quicklaunch_da.ts b/plugin-quicklaunch/translations/quicklaunch_da.ts index 1ef231f..1d96f01 100644 --- a/plugin-quicklaunch/translations/quicklaunch_da.ts +++ b/plugin-quicklaunch/translations/quicklaunch_da.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Slipfejl - + File/URL '%1' cannot be embedded into QuickLaunch for now Fil/URL '%1' kan ikke indlejres i HurtigStart lige nu - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Flyt mod venstre - + Move right Flyt mod højre - + Remove from quicklaunch Fjern fra Hurtigstart diff --git a/plugin-quicklaunch/translations/quicklaunch_da_DK.ts b/plugin-quicklaunch/translations/quicklaunch_da_DK.ts index 2dafd69..a270973 100644 --- a/plugin-quicklaunch/translations/quicklaunch_da_DK.ts +++ b/plugin-quicklaunch/translations/quicklaunch_da_DK.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Træk og slip fejl - + File/URL '%1' cannot be embedded into QuickLaunch for now Fil/URL '%1' kan ikke blive indlejret i QuickLaunch lige nu - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Flyt mod venstre - + Move right Flyt mod højre - + Remove from quicklaunch Fjern fra quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_de.desktop b/plugin-quicklaunch/translations/quicklaunch_de.desktop index 796f7af..1cfaefd 100644 --- a/plugin-quicklaunch/translations/quicklaunch_de.desktop +++ b/plugin-quicklaunch/translations/quicklaunch_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Quick launch -Comment=Easy access to your favourite applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Starten Sie Ihre lieblings Anwendungen Name[de]=Schnellstarter +Comment[de]=Starten Sie Ihre Lieblingsanwendungen diff --git a/plugin-quicklaunch/translations/quicklaunch_de.ts b/plugin-quicklaunch/translations/quicklaunch_de.ts index 2e006b1..1f15174 100644 --- a/plugin-quicklaunch/translations/quicklaunch_de.ts +++ b/plugin-quicklaunch/translations/quicklaunch_de.ts @@ -4,36 +4,37 @@ LxQtQuickLaunch - + Drop Error - Fehler fallen lassen + Fehler beim fallen lassen - + File/URL '%1' cannot be embedded into QuickLaunch for now - Datei/URL »%1« kann momentan nicht in die Schnellstartleiste eingebettet werden. + Datei/URL '%1' kann momentan nicht in die Schnellstartleiste eingebettet werden. - + Drop application icons here - + Anwendung/Symbol +hier fallen lassen QuickLaunchButton - + Move left Nach links verschieben - + Move right Nach rechts verschieben - + Remove from quicklaunch Aus der Schnellstartleiste entfernen diff --git a/plugin-quicklaunch/translations/quicklaunch_de_DE.ts b/plugin-quicklaunch/translations/quicklaunch_de_DE.ts deleted file mode 100644 index 74e8ad6..0000000 --- a/plugin-quicklaunch/translations/quicklaunch_de_DE.ts +++ /dev/null @@ -1,41 +0,0 @@ - - - - - LxQtQuickLaunch - - - Drop Error - Drop Error - - - - File/URL '%1' cannot be embedded into QuickLaunch for now - Datei/Pfad '%1' kann im moment nicht in den Schnellstarter integriert werden - - - - Drop application -icons here - - - - - QuickLaunchButton - - - Move left - Nach links bewegen - - - - Move right - Nach rechts bewegen - - - - Remove from quicklaunch - Aus dem Schnellstarter löschen - - - diff --git a/plugin-quicklaunch/translations/quicklaunch_el_GR.ts b/plugin-quicklaunch/translations/quicklaunch_el_GR.ts index e2fb17b..4501097 100644 --- a/plugin-quicklaunch/translations/quicklaunch_el_GR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_el_GR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Σφάλμα εναπόθεσης - + File/URL '%1' cannot be embedded into QuickLaunch for now Το αρχείο/η διεύθυνση "%1" δεν μπορεί να ενσωματωθεί για την ώρα στη γρήγορη εκκίνηση - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Μετακίνηση αριστερά - + Move right Μετακίνηση δεξιά - + Remove from quicklaunch Αφαίρεση από τη γρήγορη εκκίνηση diff --git a/plugin-quicklaunch/translations/quicklaunch_eo.ts b/plugin-quicklaunch/translations/quicklaunch_eo.ts index c212b88..2a148dc 100644 --- a/plugin-quicklaunch/translations/quicklaunch_eo.ts +++ b/plugin-quicklaunch/translations/quicklaunch_eo.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Eraro dum forigado - + File/URL '%1' cannot be embedded into QuickLaunch for now Dosiero/URL '%1' ne povas esti enkorpigita en rapidlanĉilo nun - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Movi maldekstren - + Move right Movi dekstren - + Remove from quicklaunch Forigi el rapidlanĉilo diff --git a/plugin-quicklaunch/translations/quicklaunch_es.ts b/plugin-quicklaunch/translations/quicklaunch_es.ts index 24a0f0e..48188b3 100644 --- a/plugin-quicklaunch/translations/quicklaunch_es.ts +++ b/plugin-quicklaunch/translations/quicklaunch_es.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Error al soltar - + File/URL '%1' cannot be embedded into QuickLaunch for now El archivo/URL '%1' por el momento no puede incrustarse en QuickLaunch - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover a la izquierda - + Move right Mover a la derecha - + Remove from quicklaunch Quitar de quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_es_VE.ts b/plugin-quicklaunch/translations/quicklaunch_es_VE.ts index 6ee4af4..e6596a5 100644 --- a/plugin-quicklaunch/translations/quicklaunch_es_VE.ts +++ b/plugin-quicklaunch/translations/quicklaunch_es_VE.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Error al remover - + File/URL '%1' cannot be embedded into QuickLaunch for now Archivo/URL '%1' no puede ser empotrado en la barra de lanzadores por ahora - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover a la izquierda - + Move right Mover a la derecha - + Remove from quicklaunch Remover de la barra de lanzadores diff --git a/plugin-quicklaunch/translations/quicklaunch_eu.ts b/plugin-quicklaunch/translations/quicklaunch_eu.ts index 4d25e4f..a1c8c3b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_eu.ts +++ b/plugin-quicklaunch/translations/quicklaunch_eu.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Errorea jaregitean - + File/URL '%1' cannot be embedded into QuickLaunch for now '%1' fitxategia/URLa ezin da QuickLaunch-en txertatu oraingoz - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mugitu ezkerrera - + Move right Mugitu eskuinera - + Remove from quicklaunch Kendu abio azkarretik diff --git a/plugin-quicklaunch/translations/quicklaunch_fi.ts b/plugin-quicklaunch/translations/quicklaunch_fi.ts index 5c6c769..287c0c2 100644 --- a/plugin-quicklaunch/translations/quicklaunch_fi.ts +++ b/plugin-quicklaunch/translations/quicklaunch_fi.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Poistovirhe - + File/URL '%1' cannot be embedded into QuickLaunch for now Tiedostoa/osoitetta '%1' ei toistaiseksi voi asettaa pikakäynnistykseen - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Siirrä vasemmalle - + Move right Siirrä oikealle - + Remove from quicklaunch Poista pikakäynnistyksestä diff --git a/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts b/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts index d1849d5..35c275e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ne pas tenir compte de l'erreur - + File/URL '%1' cannot be embedded into QuickLaunch for now Le fichier/l'URL '%1' ne peut pas être inclus dans le lancement rapide pour l'instant - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Déplacer vers la gauche - + Move right Déplacer vers la droite - + Remove from quicklaunch Enlever du lancement rapide diff --git a/plugin-quicklaunch/translations/quicklaunch_hu.ts b/plugin-quicklaunch/translations/quicklaunch_hu.ts index 43ece95..9c7e2fe 100644 --- a/plugin-quicklaunch/translations/quicklaunch_hu.ts +++ b/plugin-quicklaunch/translations/quicklaunch_hu.ts @@ -1,41 +1,42 @@ - + LxQtQuickLaunch - + Drop Error - + Ejtési hiba - + File/URL '%1' cannot be embedded into QuickLaunch for now - + A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba - + Drop application icons here - + Ejts ide +indító ikont QuickLaunchButton - + Move left - + Balra - + Move right - + Jobbra - + Remove from quicklaunch - + Eltávolítás a gyorsindítóról diff --git a/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts b/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts index cd74faf..4c85f5b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts +++ b/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts @@ -1,39 +1,40 @@ - + LxQtQuickLaunch - + Drop Error Ejtési hiba - + File/URL '%1' cannot be embedded into QuickLaunch for now A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba - + Drop application icons here - + Ejts ide +indító ikont QuickLaunchButton - + Move left Balra - + Move right Jobbra - + Remove from quicklaunch Eltávolítás a gyorsindítóról diff --git a/plugin-quicklaunch/translations/quicklaunch_ia.ts b/plugin-quicklaunch/translations/quicklaunch_ia.ts index 5787b3e..8bfd4c4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ia.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ia.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_id_ID.ts b/plugin-quicklaunch/translations/quicklaunch_id_ID.ts index 2033904..d22169f 100644 --- a/plugin-quicklaunch/translations/quicklaunch_id_ID.ts +++ b/plugin-quicklaunch/translations/quicklaunch_id_ID.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_it_IT.ts b/plugin-quicklaunch/translations/quicklaunch_it_IT.ts index 61d89ed..fa3fabd 100644 --- a/plugin-quicklaunch/translations/quicklaunch_it_IT.ts +++ b/plugin-quicklaunch/translations/quicklaunch_it_IT.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Errore di spostamento - + File/URL '%1' cannot be embedded into QuickLaunch for now Il file/URL '%1' in questo momento non può essere inserito in Avvio rapido - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Sposta a sinistra - + Move right Sposta a destra - + Remove from quicklaunch Rimuovi da Avvio rapido diff --git a/plugin-quicklaunch/translations/quicklaunch_ja.ts b/plugin-quicklaunch/translations/quicklaunch_ja.ts index f45f58e..29d90a7 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ja.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ja.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error ドロップエラー - + File/URL '%1' cannot be embedded into QuickLaunch for now ファイル/URL '%1' は現在、クイック起動に埋め込むことができません - + Drop application icons here アプリケーションアイコンを @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left 左に移動 - + Move right 右に移動 - + Remove from quicklaunch クイック起動から削除 diff --git a/plugin-quicklaunch/translations/quicklaunch_ko.ts b/plugin-quicklaunch/translations/quicklaunch_ko.ts index e9f0a73..45bb56b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ko.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ko.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_lt.ts b/plugin-quicklaunch/translations/quicklaunch_lt.ts index 1f724eb..498cf45 100644 --- a/plugin-quicklaunch/translations/quicklaunch_lt.ts +++ b/plugin-quicklaunch/translations/quicklaunch_lt.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Tempimo klaida - + File/URL '%1' cannot be embedded into QuickLaunch for now Failo/URL „%1“ šiuo metu negalima patalpinti greitajame paleidime - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Perkelti į kairę - + Move right Perkelti į dešinę - + Remove from quicklaunch Pašalinti diff --git a/plugin-quicklaunch/translations/quicklaunch_nl.ts b/plugin-quicklaunch/translations/quicklaunch_nl.ts index efa2742..41b819a 100644 --- a/plugin-quicklaunch/translations/quicklaunch_nl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_nl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Neerzetfout - + File/URL '%1' cannot be embedded into QuickLaunch for now Bestand/URL '%1' kan vooralsnog niet worden ingebed in de snelstartbalk - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Verplaats naar links - + Move right Verplaats naar rechts - + Remove from quicklaunch Verwijder uit snelstartbalk diff --git a/plugin-quicklaunch/translations/quicklaunch_pl.ts b/plugin-quicklaunch/translations/quicklaunch_pl.ts index 4d27521..5f441d6 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Przesuń w lewo - + Move right Przesuń w prawo - + Remove from quicklaunch Usuń z szybkiego uruchamiania diff --git a/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts b/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts index 2868ec3..a455735 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts @@ -4,36 +4,36 @@ LxQtQuickLaunch - + Drop Error Problem dodawania - + File/URL '%1' cannot be embedded into QuickLaunch for now Plik/URL '%1' nie może zostać umiesczony na pasku szybkiego uruchamiania - + Drop application icons here - + Upuść ikonę aplikacji tutaj QuickLaunchButton - + Move left Przesuń w lewo - + Move right Przesuń w prawo - + Remove from quicklaunch Usuń z paska szybkiego uruchamiania diff --git a/plugin-quicklaunch/translations/quicklaunch_pt.ts b/plugin-quicklaunch/translations/quicklaunch_pt.ts index edbfdc2..a880dd4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pt.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pt.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Erro ao largar - + File/URL '%1' cannot be embedded into QuickLaunch for now Neste momento, não pode incluir o ficheiro/url '%1' no inicio rápido. - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover para a esquerda - + Move right Mover para a direita - + Remove from quicklaunch Remover do inicio rápido diff --git a/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts b/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts index a811b90..35db758 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Erro de queda - + File/URL '%1' cannot be embedded into QuickLaunch for now O arquivo/URL '%1' não pôde ser incorporado ao lançador rápido - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover para a esquerda - + Move right Mover para a direita - + Remove from quicklaunch Remover do lançador rápido diff --git a/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts b/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts index bda08e1..209c10a 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now Fișierul/URL-ul '%1' nu poate fi inclus în lista de lansare rapidă momentan - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mută spre stânga - + Move right Mută spre dreapta - + Remove from quicklaunch Îndepărtează din lista pentru lansare rapidă diff --git a/plugin-quicklaunch/translations/quicklaunch_ru.ts b/plugin-quicklaunch/translations/quicklaunch_ru.ts index 23c324d..d263e7e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ru.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ru.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ошибка бросания - + File/URL '%1' cannot be embedded into QuickLaunch for now Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас - + Drop application icons here Бросьте значки @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left Сдвинуть влево - + Move right Сдвинуть вправо - + Remove from quicklaunch Удалить из быстрого запуска diff --git a/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts b/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts index 9ad9f6a..5bfb41f 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ошибка бросания - + File/URL '%1' cannot be embedded into QuickLaunch for now Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас - + Drop application icons here Бросьте значки @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left Сдвинуть влево - + Move right Сдвинуть вправо - + Remove from quicklaunch Удалить из быстрого запуска diff --git a/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts b/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts index f984c15..9db0473 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error CHyba pri pustení - + File/URL '%1' cannot be embedded into QuickLaunch for now Súbor/URL „%1“ nateraz nemožno vložiť do rýchleho spustenia - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Presunúť vľavo - + Move right Presunúť vpravo - + Remove from quicklaunch Odstrániť z rýchleho spustenia diff --git a/plugin-quicklaunch/translations/quicklaunch_sl.ts b/plugin-quicklaunch/translations/quicklaunch_sl.ts index 39e689b..0dee705 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Napaka spusta - + File/URL '%1' cannot be embedded into QuickLaunch for now Datoteke/lokacije »%1« trenutno ni bilo moč vstaviti v Hitri zagon - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Premakni levo - + Move right Premakni desno - + Remove from quicklaunch Odstrani iz hitrega zagona diff --git a/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts b/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts index b5a2b3a..793429e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts b/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts index f015968..c067b5e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Грешка испуштања - + File/URL '%1' cannot be embedded into QuickLaunch for now Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Помјери лијево - + Move right Помјери десно - + Remove from quicklaunch Уклони са брзог покретања diff --git a/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts b/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts index ae63a16..414e650 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Грешка испуштања - + File/URL '%1' cannot be embedded into QuickLaunch for now Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Помери лево - + Move right Помери десно - + Remove from quicklaunch Уклони са брзог покретања diff --git a/plugin-quicklaunch/translations/quicklaunch_th_TH.ts b/plugin-quicklaunch/translations/quicklaunch_th_TH.ts index ed51400..8f46cc4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_th_TH.ts +++ b/plugin-quicklaunch/translations/quicklaunch_th_TH.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error การหย่อนขัดข้อง - + File/URL '%1' cannot be embedded into QuickLaunch for now แฟ้ม/URL '%1' ไม่สามารถฝังตัวไปยังตัวเรียกโปรแกรมด่วนได้ในตอนนี้ - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left ย้ายไปทางซ้าย - + Move right ย้ายไปทางขวา - + Remove from quicklaunch ลบออกจากตัวเรียกโปรแกรมด่วน diff --git a/plugin-quicklaunch/translations/quicklaunch_tr.ts b/plugin-quicklaunch/translations/quicklaunch_tr.ts index 9e8e501..59ab575 100644 --- a/plugin-quicklaunch/translations/quicklaunch_tr.ts +++ b/plugin-quicklaunch/translations/quicklaunch_tr.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Bırakma Hatası - + File/URL '%1' cannot be embedded into QuickLaunch for now Şimdilik '%1' dosyası/bağlantısı Hızlı Başlatıcı' ya eklenemiyor - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Sola kaydır - + Move right Sağa kaydır - + Remove from quicklaunch Hızlı başlatıcıdan kaldır diff --git a/plugin-quicklaunch/translations/quicklaunch_uk.ts b/plugin-quicklaunch/translations/quicklaunch_uk.ts index f66ff98..471e7b2 100644 --- a/plugin-quicklaunch/translations/quicklaunch_uk.ts +++ b/plugin-quicklaunch/translations/quicklaunch_uk.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Збій при розміщенні - + File/URL '%1' cannot be embedded into QuickLaunch for now Не вдається додати "%1" до швидкого запуску - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Посунути ліворуч - + Move right Посунути враворуч - + Remove from quicklaunch Вилучити зі швидкого запуску diff --git a/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts b/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts index 4cd8ee0..5006503 100644 --- a/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts +++ b/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error 出现错误 - + File/URL '%1' cannot be embedded into QuickLaunch for now 文件/URL '%1' 暂时无法被嵌入到快速启动 - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left 左移 - + Move right 右移 - + Remove from quicklaunch 从快速启动删除 diff --git a/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts b/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts index 09fe3b0..67b6ace 100644 --- a/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts +++ b/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error 移入錯誤 - + File/URL '%1' cannot be embedded into QuickLaunch for now 檔案位址'%1'現在無法嵌入至快速啟動 - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left 往左移 - + Move right 往右移 - + Remove from quicklaunch 從快速啟動中移除 diff --git a/plugin-screensaver/CMakeLists.txt b/plugin-screensaver/CMakeLists.txt index 2412b03..e687a5d 100644 --- a/plugin-screensaver/CMakeLists.txt +++ b/plugin-screensaver/CMakeLists.txt @@ -8,13 +8,9 @@ set(SOURCES panelscreensaver.cpp ) -set(MOCS - panelscreensaver.h -) - set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} + lxqt-globalkeys ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-screensaver/panelscreensaver.cpp b/plugin-screensaver/panelscreensaver.cpp index 260dc7d..f0624ad 100644 --- a/plugin-screensaver/panelscreensaver.cpp +++ b/plugin-screensaver/panelscreensaver.cpp @@ -52,15 +52,19 @@ PanelScreenSaver::PanelScreenSaver(const ILxQtPanelPluginStartupInfo &startupInf mShortcutKey = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/lock").arg(settings()->group()), tr("Lock Screen"), this); if (mShortcutKey) { + connect(mShortcutKey, &GlobalKeyShortcut::Action::registrationFinished, this, &PanelScreenSaver::shortcutRegistered); connect(mShortcutKey, SIGNAL(activated()), mSaver, SLOT(lockScreen())); + } +} +void PanelScreenSaver::shortcutRegistered() +{ + if (mShortcutKey->shortcut().isEmpty()) + { + mShortcutKey->changeShortcut(DEFAULT_SHORTCUT); if (mShortcutKey->shortcut().isEmpty()) { - mShortcutKey->changeShortcut(DEFAULT_SHORTCUT); - if (mShortcutKey->shortcut().isEmpty()) - { - LxQt::Notification::notify(tr("Panel Screensaver: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); - } + LxQt::Notification::notify(tr("Panel Screensaver: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); } } } diff --git a/plugin-screensaver/panelscreensaver.h b/plugin-screensaver/panelscreensaver.h index a34d661..7926755 100644 --- a/plugin-screensaver/panelscreensaver.h +++ b/plugin-screensaver/panelscreensaver.h @@ -50,6 +50,9 @@ public: virtual QWidget *widget() { return &mButton; } virtual QString themeId() const { return "PanelScreenSaver"; } +private slots: + void shortcutRegistered(); + private: QToolButton mButton; LxQt::ScreenSaver * mSaver; @@ -62,7 +65,7 @@ class PanelScreenSaverLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new PanelScreenSaver(startupInfo); } diff --git a/plugin-screensaver/translations/screensaver.ts b/plugin-screensaver/translations/screensaver.ts index f6ec551..a7e5827 100644 --- a/plugin-screensaver/translations/screensaver.ts +++ b/plugin-screensaver/translations/screensaver.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ar.ts b/plugin-screensaver/translations/screensaver_ar.ts index 29e2f80..2669739 100644 --- a/plugin-screensaver/translations/screensaver_ar.ts +++ b/plugin-screensaver/translations/screensaver_ar.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_cs.ts b/plugin-screensaver/translations/screensaver_cs.ts index 4b73521..b2dac8e 100644 --- a/plugin-screensaver/translations/screensaver_cs.ts +++ b/plugin-screensaver/translations/screensaver_cs.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_cs_CZ.ts b/plugin-screensaver/translations/screensaver_cs_CZ.ts index f9257ea..434b079 100644 --- a/plugin-screensaver/translations/screensaver_cs_CZ.ts +++ b/plugin-screensaver/translations/screensaver_cs_CZ.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_da.ts b/plugin-screensaver/translations/screensaver_da.ts index 4622ac2..ec68690 100644 --- a/plugin-screensaver/translations/screensaver_da.ts +++ b/plugin-screensaver/translations/screensaver_da.ts @@ -17,7 +17,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_da_DK.ts b/plugin-screensaver/translations/screensaver_da_DK.ts index 2cfdde2..4259c72 100644 --- a/plugin-screensaver/translations/screensaver_da_DK.ts +++ b/plugin-screensaver/translations/screensaver_da_DK.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_de.desktop b/plugin-screensaver/translations/screensaver_de.desktop index 2e3ce17..72bad46 100644 --- a/plugin-screensaver/translations/screensaver_de.desktop +++ b/plugin-screensaver/translations/screensaver_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Launch screensaver -Comment=Activate a screensaver and/or lock the screen - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Aktiviere einen Bildschirmschoner und/oder sperre den Bildschirm Name[de]=Bildschirmschoner +Comment[de]=Bildschirmschoner aktivieren und/oder Bildschirm sperren diff --git a/plugin-screensaver/translations/screensaver_de.ts b/plugin-screensaver/translations/screensaver_de.ts index 88a309b..0638eda 100644 --- a/plugin-screensaver/translations/screensaver_de.ts +++ b/plugin-screensaver/translations/screensaver_de.ts @@ -3,23 +3,15 @@ PanelScreenSaver - - Global keyboard shortcut - Globales Tastaturkürzel - - - Panel Screensaver Global shortcut: '%1' cannot be registered - Globales Tastenkürzel für Bildschirmschoner: »%1« kann nicht registriert werden - Lock Screen - + Bildschirm sperren - + Panel Screensaver: Global shortcut '%1' cannot be registered - + Für den Bildschirmschoner kann das globale Tastenkürzel '%1' nicht registriert werden diff --git a/plugin-screensaver/translations/screensaver_el_GR.ts b/plugin-screensaver/translations/screensaver_el_GR.ts index 95c0230..311f26d 100644 --- a/plugin-screensaver/translations/screensaver_el_GR.ts +++ b/plugin-screensaver/translations/screensaver_el_GR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_eo.ts b/plugin-screensaver/translations/screensaver_eo.ts index 8b8b322..0488b02 100644 --- a/plugin-screensaver/translations/screensaver_eo.ts +++ b/plugin-screensaver/translations/screensaver_eo.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_es.ts b/plugin-screensaver/translations/screensaver_es.ts index 3ea4795..35bdb70 100644 --- a/plugin-screensaver/translations/screensaver_es.ts +++ b/plugin-screensaver/translations/screensaver_es.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_es_VE.ts b/plugin-screensaver/translations/screensaver_es_VE.ts index 6eee89d..5218d96 100644 --- a/plugin-screensaver/translations/screensaver_es_VE.ts +++ b/plugin-screensaver/translations/screensaver_es_VE.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_eu.ts b/plugin-screensaver/translations/screensaver_eu.ts index 78f8e43..699a6e3 100644 --- a/plugin-screensaver/translations/screensaver_eu.ts +++ b/plugin-screensaver/translations/screensaver_eu.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_fi.ts b/plugin-screensaver/translations/screensaver_fi.ts index 3ce87bc..7306c38 100644 --- a/plugin-screensaver/translations/screensaver_fi.ts +++ b/plugin-screensaver/translations/screensaver_fi.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_fr_FR.ts b/plugin-screensaver/translations/screensaver_fr_FR.ts index 193e360..0b0e649 100644 --- a/plugin-screensaver/translations/screensaver_fr_FR.ts +++ b/plugin-screensaver/translations/screensaver_fr_FR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_hu.ts b/plugin-screensaver/translations/screensaver_hu.ts index 0082b40..2f9a870 100644 --- a/plugin-screensaver/translations/screensaver_hu.ts +++ b/plugin-screensaver/translations/screensaver_hu.ts @@ -1,17 +1,21 @@ - + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + Lock Screen - + Képernyőzár - + Panel Screensaver: Global shortcut '%1' cannot be registered - + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható diff --git a/plugin-screensaver/translations/screensaver_hu_HU.ts b/plugin-screensaver/translations/screensaver_hu_HU.ts index 1157bb8..7f6f9aa 100644 --- a/plugin-screensaver/translations/screensaver_hu_HU.ts +++ b/plugin-screensaver/translations/screensaver_hu_HU.ts @@ -1,21 +1,21 @@ - + PanelScreenSaver Panel Screensaver Global shortcut: '%1' cannot be registered - A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható Lock Screen - + Képernyőzár - + Panel Screensaver: Global shortcut '%1' cannot be registered - + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható diff --git a/plugin-screensaver/translations/screensaver_ia.ts b/plugin-screensaver/translations/screensaver_ia.ts index 8455534..e7ca110 100644 --- a/plugin-screensaver/translations/screensaver_ia.ts +++ b/plugin-screensaver/translations/screensaver_ia.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_id_ID.ts b/plugin-screensaver/translations/screensaver_id_ID.ts index 8a1b8ce..2cb2530 100644 --- a/plugin-screensaver/translations/screensaver_id_ID.ts +++ b/plugin-screensaver/translations/screensaver_id_ID.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_it_IT.ts b/plugin-screensaver/translations/screensaver_it_IT.ts index 16d0b37..fe44c3d 100644 --- a/plugin-screensaver/translations/screensaver_it_IT.ts +++ b/plugin-screensaver/translations/screensaver_it_IT.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ja.ts b/plugin-screensaver/translations/screensaver_ja.ts index 206f11d..b5852b1 100644 --- a/plugin-screensaver/translations/screensaver_ja.ts +++ b/plugin-screensaver/translations/screensaver_ja.ts @@ -9,7 +9,7 @@ スクリーンをロック - + Panel Screensaver: Global shortcut '%1' cannot be registered スクリーンセーバー: グローバルショートカット '%1' を登録することができません diff --git a/plugin-screensaver/translations/screensaver_ko.ts b/plugin-screensaver/translations/screensaver_ko.ts index ea6e114..55a4faa 100644 --- a/plugin-screensaver/translations/screensaver_ko.ts +++ b/plugin-screensaver/translations/screensaver_ko.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_lt.ts b/plugin-screensaver/translations/screensaver_lt.ts index c757c9c..46f8737 100644 --- a/plugin-screensaver/translations/screensaver_lt.ts +++ b/plugin-screensaver/translations/screensaver_lt.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_nl.ts b/plugin-screensaver/translations/screensaver_nl.ts index 24831f3..ad59586 100644 --- a/plugin-screensaver/translations/screensaver_nl.ts +++ b/plugin-screensaver/translations/screensaver_nl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pl.ts b/plugin-screensaver/translations/screensaver_pl.ts index faa2b39..02ee63b 100644 --- a/plugin-screensaver/translations/screensaver_pl.ts +++ b/plugin-screensaver/translations/screensaver_pl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pl_PL.ts b/plugin-screensaver/translations/screensaver_pl_PL.ts index 936a1ce..92a3968 100644 --- a/plugin-screensaver/translations/screensaver_pl_PL.ts +++ b/plugin-screensaver/translations/screensaver_pl_PL.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pt.ts b/plugin-screensaver/translations/screensaver_pt.ts index dff3e84..a159d8a 100644 --- a/plugin-screensaver/translations/screensaver_pt.ts +++ b/plugin-screensaver/translations/screensaver_pt.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pt_BR.ts b/plugin-screensaver/translations/screensaver_pt_BR.ts index 1d34988..3720191 100644 --- a/plugin-screensaver/translations/screensaver_pt_BR.ts +++ b/plugin-screensaver/translations/screensaver_pt_BR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ro_RO.ts b/plugin-screensaver/translations/screensaver_ro_RO.ts index e55d8e5..4defc9f 100644 --- a/plugin-screensaver/translations/screensaver_ro_RO.ts +++ b/plugin-screensaver/translations/screensaver_ro_RO.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ru.ts b/plugin-screensaver/translations/screensaver_ru.ts index 248ffbd..dbf9d50 100644 --- a/plugin-screensaver/translations/screensaver_ru.ts +++ b/plugin-screensaver/translations/screensaver_ru.ts @@ -9,7 +9,7 @@ Блокировать экран - + Panel Screensaver: Global shortcut '%1' cannot be registered Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано diff --git a/plugin-screensaver/translations/screensaver_ru_RU.ts b/plugin-screensaver/translations/screensaver_ru_RU.ts index b46dd45..742e0b7 100644 --- a/plugin-screensaver/translations/screensaver_ru_RU.ts +++ b/plugin-screensaver/translations/screensaver_ru_RU.ts @@ -9,7 +9,7 @@ Блокировать экран - + Panel Screensaver: Global shortcut '%1' cannot be registered Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано diff --git a/plugin-screensaver/translations/screensaver_sk_SK.ts b/plugin-screensaver/translations/screensaver_sk_SK.ts index 48c02b0..3e35ca9 100644 --- a/plugin-screensaver/translations/screensaver_sk_SK.ts +++ b/plugin-screensaver/translations/screensaver_sk_SK.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sl.ts b/plugin-screensaver/translations/screensaver_sl.ts index 6d5b03c..c04b712 100644 --- a/plugin-screensaver/translations/screensaver_sl.ts +++ b/plugin-screensaver/translations/screensaver_sl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr@latin.ts b/plugin-screensaver/translations/screensaver_sr@latin.ts index 4ca5aa5..061eab1 100644 --- a/plugin-screensaver/translations/screensaver_sr@latin.ts +++ b/plugin-screensaver/translations/screensaver_sr@latin.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr_BA.ts b/plugin-screensaver/translations/screensaver_sr_BA.ts index 2c54c35..e32806b 100644 --- a/plugin-screensaver/translations/screensaver_sr_BA.ts +++ b/plugin-screensaver/translations/screensaver_sr_BA.ts @@ -17,7 +17,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr_RS.ts b/plugin-screensaver/translations/screensaver_sr_RS.ts index 91df10e..c8d4794 100644 --- a/plugin-screensaver/translations/screensaver_sr_RS.ts +++ b/plugin-screensaver/translations/screensaver_sr_RS.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_th_TH.ts b/plugin-screensaver/translations/screensaver_th_TH.ts index 14d3316..f014b66 100644 --- a/plugin-screensaver/translations/screensaver_th_TH.ts +++ b/plugin-screensaver/translations/screensaver_th_TH.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_tr.ts b/plugin-screensaver/translations/screensaver_tr.ts index 7d2b0f3..0d1e185 100644 --- a/plugin-screensaver/translations/screensaver_tr.ts +++ b/plugin-screensaver/translations/screensaver_tr.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_uk.ts b/plugin-screensaver/translations/screensaver_uk.ts index d7ed6dd..73d977e 100644 --- a/plugin-screensaver/translations/screensaver_uk.ts +++ b/plugin-screensaver/translations/screensaver_uk.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_zh_CN.ts b/plugin-screensaver/translations/screensaver_zh_CN.ts index 84f1b8b..988ad1c 100644 --- a/plugin-screensaver/translations/screensaver_zh_CN.ts +++ b/plugin-screensaver/translations/screensaver_zh_CN.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_zh_TW.ts b/plugin-screensaver/translations/screensaver_zh_TW.ts index d0e5939..b03475a 100644 --- a/plugin-screensaver/translations/screensaver_zh_TW.ts +++ b/plugin-screensaver/translations/screensaver_zh_TW.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-sensors/CMakeLists.txt b/plugin-sensors/CMakeLists.txt index 5e5a262..a7f7956 100644 --- a/plugin-sensors/CMakeLists.txt +++ b/plugin-sensors/CMakeLists.txt @@ -18,14 +18,8 @@ set(SOURCES sensors.cpp ) -set(MOCS - lxqtsensorsplugin.h - lxqtsensors.h - lxqtsensorsconfiguration.h -) - set(UIS - lxqtsensorsconfiguration.ui + lxqtsensorsconfiguration.ui ) set(LIBRARIES ${SENSORS_LIB}) diff --git a/plugin-sensors/chip.cpp b/plugin-sensors/chip.cpp index 03e7c7c..09379f9 100644 --- a/plugin-sensors/chip.cpp +++ b/plugin-sensors/chip.cpp @@ -28,6 +28,7 @@ #include "chip.h" #include + Chip::Chip(const sensors_chip_name* sensorsChipName) : mSensorsChipName(sensorsChipName) { @@ -49,11 +50,13 @@ Chip::Chip(const sensors_chip_name* sensorsChipName) } } + const QString& Chip::getName() const { return mName; } + const QList& Chip::getFeatures() const { return mFeatures; diff --git a/plugin-sensors/chip.h b/plugin-sensors/chip.h index d5fc896..2993e95 100644 --- a/plugin-sensors/chip.h +++ b/plugin-sensors/chip.h @@ -29,9 +29,10 @@ #define CHIP_H #include "feature.h" -#include +#include "sensors.h" #include -#include +#include + /** * @brief Chip class is providing RAII-style for lm_sensors library diff --git a/plugin-sensors/feature.cpp b/plugin-sensors/feature.cpp index 7267f46..169f253 100644 --- a/plugin-sensors/feature.cpp +++ b/plugin-sensors/feature.cpp @@ -28,6 +28,7 @@ #include "feature.h" #include + Feature::Feature(const sensors_chip_name* sensorsChipName, const sensors_feature* sensorsFeature) : mSensorsChipName(sensorsChipName), mSensorsFeature(sensorsFeature) @@ -44,11 +45,13 @@ Feature::Feature(const sensors_chip_name* sensorsChipName, const sensors_feature << "(" << mLabel << ")"; } + const QString& Feature::getLabel() const { return mLabel; } + double Feature::getValue(sensors_subfeature_type subfeature_type) const { double result = 0; @@ -66,6 +69,7 @@ double Feature::getValue(sensors_subfeature_type subfeature_type) const return result; } + sensors_feature_type Feature::getType() const { return mSensorsFeature->type; diff --git a/plugin-sensors/feature.h b/plugin-sensors/feature.h index 5b9cc62..1f6c620 100644 --- a/plugin-sensors/feature.h +++ b/plugin-sensors/feature.h @@ -28,10 +28,11 @@ #ifndef FEATURE_H #define FEATURE_H -#include #include +#include #include + /** * @brief Feature class is providing RAII-style for lm_sensors library */ diff --git a/plugin-sensors/lxqtsensors.cpp b/plugin-sensors/lxqtsensors.cpp index 162e212..78feb04 100644 --- a/plugin-sensors/lxqtsensors.cpp +++ b/plugin-sensors/lxqtsensors.cpp @@ -29,10 +29,10 @@ #include "lxqtsensorsconfiguration.h" #include "../panel/ilxqtpanelplugin.h" #include "../panel/ilxqtpanel.h" +#include +#include #include #include -#include -#include LxQtSensors::LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent): @@ -108,24 +108,25 @@ LxQtSensors::LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent): updateSensorReadings(); // Run timer that will be updating sensor readings - mUpdateSensorReadingsTimer.setParent(this); connect(&mUpdateSensorReadingsTimer, SIGNAL(timeout()), this, SLOT(updateSensorReadings())); mUpdateSensorReadingsTimer.start(mSettings->value("updateInterval").toInt() * 1000); // Run timer that will be showin warning - mWarningAboutHighTemperatureTimer.setParent(this); + mWarningAboutHighTemperatureTimer.setInterval(500); connect(&mWarningAboutHighTemperatureTimer, SIGNAL(timeout()), this, SLOT(warningAboutHighTemperature())); if (mSettings->value("warningAboutHighTemperature").toBool()) { - mWarningAboutHighTemperatureTimer.start(mWarningAboutHighTemperatureTimerFreq); + mWarningAboutHighTemperatureTimer.start(); } } + LxQtSensors::~LxQtSensors() { } + void LxQtSensors::updateSensorReadings() { QString tooltip; @@ -230,6 +231,7 @@ void LxQtSensors::updateSensorReadings() update(); } + void LxQtSensors::warningAboutHighTemperature() { // Iterator for temperature progress bars @@ -313,7 +315,8 @@ void LxQtSensors::settingsChanged() // Update sensors readings to get the list of high temperature progress bars updateSensorReadings(); - mWarningAboutHighTemperatureTimer.start(mWarningAboutHighTemperatureTimerFreq); + if (!mWarningAboutHighTemperatureTimer.isActive()) + mWarningAboutHighTemperatureTimer.start(); } else if (mWarningAboutHighTemperatureTimer.isActive()) { @@ -327,6 +330,7 @@ void LxQtSensors::settingsChanged() update(); } + void LxQtSensors::realign() { // Default values for LxQtPanel::PositionBottom or LxQtPanel::PositionTop @@ -375,12 +379,14 @@ void LxQtSensors::realign() } } + double LxQtSensors::celsiusToFahrenheit(double celsius) { // Fahrenheit = 32 * (9/5) * Celsius return 32 + 1.8 * celsius; } + void LxQtSensors::initDefaultSettings() { if (!mSettings->contains("updateInterval")) @@ -435,11 +441,13 @@ void LxQtSensors::initDefaultSettings() } } + ProgressBar::ProgressBar(QWidget *parent): QProgressBar(parent) { } + QSize ProgressBar::sizeHint() const { return QSize(20, 20); diff --git a/plugin-sensors/lxqtsensors.h b/plugin-sensors/lxqtsensors.h index 45f6b7d..0769e53 100644 --- a/plugin-sensors/lxqtsensors.h +++ b/plugin-sensors/lxqtsensors.h @@ -30,10 +30,10 @@ #include "sensors.h" #include -#include #include -#include #include +#include + class ProgressBar: public QProgressBar { @@ -67,8 +67,6 @@ private: QBoxLayout *mLayout; QTimer mUpdateSensorReadingsTimer; QTimer mWarningAboutHighTemperatureTimer; - // How often warning time should fire in ms - int mWarningAboutHighTemperatureTimerFreq; Sensors mSensors; QList mDetectedChips; QList mTemperatureProgressBars; diff --git a/plugin-sensors/lxqtsensorsconfiguration.cpp b/plugin-sensors/lxqtsensorsconfiguration.cpp index efb7d34..013e894 100644 --- a/plugin-sensors/lxqtsensorsconfiguration.cpp +++ b/plugin-sensors/lxqtsensorsconfiguration.cpp @@ -25,14 +25,14 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtsensorsconfiguration.h" #include "ui_lxqtsensorsconfiguration.h" -#include -#include #include #include #include +#include +#include + LxQtSensorsConfiguration::LxQtSensorsConfiguration(QSettings *settings, QWidget *parent) : QDialog(parent), @@ -62,11 +62,13 @@ LxQtSensorsConfiguration::LxQtSensorsConfiguration(QSettings *settings, QWidget */ } + LxQtSensorsConfiguration::~LxQtSensorsConfiguration() { delete ui; } + void LxQtSensorsConfiguration::loadSettings() { ui->updateIntervalSB->setValue(mSettings->value("updateInterval").toInt()); @@ -99,6 +101,7 @@ void LxQtSensorsConfiguration::loadSettings() mSettings->value("warningAboutHighTemperature").toBool()); } + void LxQtSensorsConfiguration::saveSettings() { mSettings->setValue("updateInterval", ui->updateIntervalSB->value()); @@ -150,6 +153,7 @@ void LxQtSensorsConfiguration::saveSettings() ui->warningAboutHighTemperatureChB->isChecked()); } + void LxQtSensorsConfiguration::dialogButtonsAction(QAbstractButton *btn) { if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) @@ -163,6 +167,7 @@ void LxQtSensorsConfiguration::dialogButtonsAction(QAbstractButton *btn) } } + void LxQtSensorsConfiguration::changeProgressBarColor() { QAbstractButton* btn = qobject_cast(sender()); @@ -185,6 +190,7 @@ void LxQtSensorsConfiguration::changeProgressBarColor() } } + void LxQtSensorsConfiguration::detectedChipSelected(int index) { mSettings->beginGroup("chips"); @@ -244,4 +250,3 @@ void LxQtSensorsConfiguration::detectedChipSelected(int index) mSettings->endGroup(); } - diff --git a/plugin-sensors/lxqtsensorsconfiguration.h b/plugin-sensors/lxqtsensorsconfiguration.h index 0601e2d..d2823c0 100644 --- a/plugin-sensors/lxqtsensorsconfiguration.h +++ b/plugin-sensors/lxqtsensorsconfiguration.h @@ -25,18 +25,17 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTSENSORSCONFIGURATION_H #define LXQTSENSORSCONFIGURATION_H -#include #include #include -#include #include - +#include +#include #include + namespace Ui { class LxQtSensorsConfiguration; } diff --git a/plugin-sensors/lxqtsensorsplugin.cpp b/plugin-sensors/lxqtsensorsplugin.cpp index aa1e67a..f6e4ae6 100644 --- a/plugin-sensors/lxqtsensorsplugin.cpp +++ b/plugin-sensors/lxqtsensorsplugin.cpp @@ -25,11 +25,11 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtsensorsplugin.h" #include "lxqtsensors.h" #include "lxqtsensorsconfiguration.h" + LxQtSensorsPlugin::LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), @@ -37,26 +37,31 @@ LxQtSensorsPlugin::LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupI { } + LxQtSensorsPlugin::~LxQtSensorsPlugin() { delete mWidget; } + QWidget *LxQtSensorsPlugin::widget() { return mWidget; } + QDialog *LxQtSensorsPlugin::configureDialog() { - return new LxQtSensorsConfiguration(settings(), mWidget); + return new LxQtSensorsConfiguration(settings()); } + void LxQtSensorsPlugin::realign() { mWidget->realign(); } + void LxQtSensorsPlugin::settingsChanged() { mWidget->settingsChanged(); diff --git a/plugin-sensors/lxqtsensorsplugin.h b/plugin-sensors/lxqtsensorsplugin.h index 749c32b..678bb2e 100644 --- a/plugin-sensors/lxqtsensorsplugin.h +++ b/plugin-sensors/lxqtsensorsplugin.h @@ -29,9 +29,10 @@ #ifndef LXQTSENSORSPLUGIN_H #define LXQTSENSORSPLUGIN_H - #include "../panel/ilxqtpanelplugin.h" #include + + class LxQtSensors; class LxQtSensorsPlugin: public QObject, public ILxQtPanelPlugin @@ -64,11 +65,10 @@ class LxQtSensorsPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtSensorsPlugin(startupInfo); } }; - #endif // LXQTSENSORSPLUGIN_H diff --git a/plugin-sensors/sensors.cpp b/plugin-sensors/sensors.cpp index 6f486d8..a4c0a09 100644 --- a/plugin-sensors/sensors.cpp +++ b/plugin-sensors/sensors.cpp @@ -28,10 +28,12 @@ #include "sensors.h" #include + QList Sensors::mDetectedChips = QList(); int Sensors::mInstanceCounter = 0; bool Sensors::mSensorsInitialized = false; + Sensors::Sensors() { // Increase instance counter @@ -53,6 +55,7 @@ Sensors::Sensors() } } + Sensors::~Sensors() { // Decrease instance counter @@ -68,8 +71,8 @@ Sensors::~Sensors() } } + const QList& Sensors::getDetectedChips() const { return mDetectedChips; } - diff --git a/plugin-sensors/sensors.h b/plugin-sensors/sensors.h index 190fe38..43cd502 100644 --- a/plugin-sensors/sensors.h +++ b/plugin-sensors/sensors.h @@ -32,6 +32,9 @@ #include #include + +class Chip; + /** * @brief Sensors class is providing RAII-style for lm_sensors library */ diff --git a/plugin-sensors/translations/sensors.ts b/plugin-sensors/translations/sensors.ts index c2ea741..0509b2d 100644 --- a/plugin-sensors/translations/sensors.ts +++ b/plugin-sensors/translations/sensors.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_ca.ts b/plugin-sensors/translations/sensors_ca.ts index b0aa48d..2be5bef 100644 --- a/plugin-sensors/translations/sensors_ca.ts +++ b/plugin-sensors/translations/sensors_ca.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_cs.ts b/plugin-sensors/translations/sensors_cs.ts index f7bc3bc..1394911 100644 --- a/plugin-sensors/translations/sensors_cs.ts +++ b/plugin-sensors/translations/sensors_cs.ts @@ -68,17 +68,17 @@ Vlastnosti čipů: - + Enabled Povoleno - + Label Štítek - + Color Barva diff --git a/plugin-sensors/translations/sensors_cs_CZ.ts b/plugin-sensors/translations/sensors_cs_CZ.ts index a3b8685..d0cf8e5 100644 --- a/plugin-sensors/translations/sensors_cs_CZ.ts +++ b/plugin-sensors/translations/sensors_cs_CZ.ts @@ -68,17 +68,17 @@ Vlastnosti čipů: - + Enabled Povoleno - + Label Štítek - + Color Barva diff --git a/plugin-sensors/translations/sensors_da_DK.ts b/plugin-sensors/translations/sensors_da_DK.ts index 203eb1a..5194907 100644 --- a/plugin-sensors/translations/sensors_da_DK.ts +++ b/plugin-sensors/translations/sensors_da_DK.ts @@ -68,17 +68,17 @@ Chipsæt funktioner: - + Enabled Aktiveret - + Label Identifikation - + Color Farve diff --git a/plugin-sensors/translations/sensors_de.desktop b/plugin-sensors/translations/sensors_de.desktop new file mode 100644 index 0000000..f71d2a6 --- /dev/null +++ b/plugin-sensors/translations/sensors_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Sensoren +Comment[de]=Messwerte der Hardware-Sensoren anzeigen. diff --git a/plugin-sensors/translations/sensors_de.ts b/plugin-sensors/translations/sensors_de.ts new file mode 100644 index 0000000..eb1dea4 --- /dev/null +++ b/plugin-sensors/translations/sensors_de.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Sensor-Einstellungen + + + + Common + Allgemein + + + + Update interval (seconds) + Aktualisierungsintervall (Sekunden) + + + + Temperature bar width + Temperaturbalkenbreite + + + + Temperature scale + Temperaturskala + + + + Celsius + Celsius + + + + Fahrenheit + Fahrenheit + + + + Blink progress bars when the temperature is too high + Blinken der Verlaufsbalken bei zu hoher Temperatur + + + + Warning about high temperature + Warnung bei zu hoher Temperatur + + + + Sensors + Sensoren + + + + Detected chips: + Erkannte Bausteine: + + + + Chip features: + Bausteineigenschaften: + + + + Enabled + Aktiviert + + + + Label + Bezeichnung + + + + Color + Farbe + + + diff --git a/plugin-sensors/translations/sensors_el_GR.ts b/plugin-sensors/translations/sensors_el_GR.ts index 2a86807..9ab37bd 100644 --- a/plugin-sensors/translations/sensors_el_GR.ts +++ b/plugin-sensors/translations/sensors_el_GR.ts @@ -68,17 +68,17 @@ Χαρακτηριστικά κυκλώματος - + Enabled Ενεργοποιημένο - + Label Ετικέτα - + Color Χρώμα diff --git a/plugin-sensors/translations/sensors_es.ts b/plugin-sensors/translations/sensors_es.ts index 2106827..6b4036d 100644 --- a/plugin-sensors/translations/sensors_es.ts +++ b/plugin-sensors/translations/sensors_es.ts @@ -68,17 +68,17 @@ Características del chip: - + Enabled Habilitado - + Label Etiqueta - + Color Color diff --git a/plugin-sensors/translations/sensors_es_VE.ts b/plugin-sensors/translations/sensors_es_VE.ts index 5003fea..46578b1 100644 --- a/plugin-sensors/translations/sensors_es_VE.ts +++ b/plugin-sensors/translations/sensors_es_VE.ts @@ -68,17 +68,17 @@ Chips caracteristicas: - + Enabled Habilitado - + Label Etiqueta - + Color Color diff --git a/plugin-sensors/translations/sensors_eu.ts b/plugin-sensors/translations/sensors_eu.ts index 4529507..e247486 100644 --- a/plugin-sensors/translations/sensors_eu.ts +++ b/plugin-sensors/translations/sensors_eu.ts @@ -68,17 +68,17 @@ Txiparen ezaugarriak: - + Enabled Gaituta - + Label Etiketa - + Color Kolorea diff --git a/plugin-sensors/translations/sensors_fi.ts b/plugin-sensors/translations/sensors_fi.ts index 52fe6ae..483bf94 100644 --- a/plugin-sensors/translations/sensors_fi.ts +++ b/plugin-sensors/translations/sensors_fi.ts @@ -64,17 +64,17 @@ - + Enabled Käytössä - + Label Nimike - + Color Väri diff --git a/plugin-sensors/translations/sensors_fr_FR.ts b/plugin-sensors/translations/sensors_fr_FR.ts index 08edd39..e10e395 100644 --- a/plugin-sensors/translations/sensors_fr_FR.ts +++ b/plugin-sensors/translations/sensors_fr_FR.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_hu.desktop b/plugin-sensors/translations/sensors_hu.desktop index fb4fb3f..0a041a6 100644 --- a/plugin-sensors/translations/sensors_hu.desktop +++ b/plugin-sensors/translations/sensors_hu.desktop @@ -6,5 +6,5 @@ Comment=View readings from hardware sensors. # Translations -Name[hu]=Szenzorok -Comment[hu]=Megjeleníti a hardver szenzorjainak értékeit. +Name[hu]=Érzékelők +Comment[hu]=Megjeleníti a gépbe épített érzékelők értékeit. diff --git a/plugin-sensors/translations/sensors_hu.ts b/plugin-sensors/translations/sensors_hu.ts new file mode 100644 index 0000000..610033c --- /dev/null +++ b/plugin-sensors/translations/sensors_hu.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/plugin-sensors/translations/sensors_hu_HU.ts b/plugin-sensors/translations/sensors_hu_HU.ts new file mode 100644 index 0000000..e0deadc --- /dev/null +++ b/plugin-sensors/translations/sensors_hu_HU.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/plugin-sensors/translations/sensors_it_IT.ts b/plugin-sensors/translations/sensors_it_IT.ts index 35562ef..180f6be 100644 --- a/plugin-sensors/translations/sensors_it_IT.ts +++ b/plugin-sensors/translations/sensors_it_IT.ts @@ -68,17 +68,17 @@ Caratteristiche del chip: - + Enabled Attivato - + Label Etichetta - + Color Colore diff --git a/plugin-sensors/translations/sensors_ja.ts b/plugin-sensors/translations/sensors_ja.ts index deb64a8..4ede2b0 100644 --- a/plugin-sensors/translations/sensors_ja.ts +++ b/plugin-sensors/translations/sensors_ja.ts @@ -64,17 +64,17 @@ チップの機能: - + Enabled 有効 - + Label ラベル - + Color diff --git a/plugin-sensors/translations/sensors_pl_PL.ts b/plugin-sensors/translations/sensors_pl_PL.ts index 10a9450..1d616ca 100644 --- a/plugin-sensors/translations/sensors_pl_PL.ts +++ b/plugin-sensors/translations/sensors_pl_PL.ts @@ -68,17 +68,17 @@ Cechy chipu: - + Enabled Włączone - + Label Etykieta - + Color Kolor diff --git a/plugin-sensors/translations/sensors_pt.ts b/plugin-sensors/translations/sensors_pt.ts index 687b1d3..e16dcf6 100644 --- a/plugin-sensors/translations/sensors_pt.ts +++ b/plugin-sensors/translations/sensors_pt.ts @@ -68,17 +68,17 @@ Funcionalidades do circuito: - + Enabled Ativo - + Label Texto - + Color Cor diff --git a/plugin-sensors/translations/sensors_pt_BR.ts b/plugin-sensors/translations/sensors_pt_BR.ts index 69da076..355723a 100644 --- a/plugin-sensors/translations/sensors_pt_BR.ts +++ b/plugin-sensors/translations/sensors_pt_BR.ts @@ -68,17 +68,17 @@ Características do chips: - + Enabled Habilitado - + Label Rótulo - + Color Cor diff --git a/plugin-sensors/translations/sensors_ro_RO.ts b/plugin-sensors/translations/sensors_ro_RO.ts index 76c438c..c15eb19 100644 --- a/plugin-sensors/translations/sensors_ro_RO.ts +++ b/plugin-sensors/translations/sensors_ro_RO.ts @@ -64,17 +64,17 @@ - + Enabled - + Label Etichetă - + Color Culoare diff --git a/plugin-sensors/translations/sensors_ru.ts b/plugin-sensors/translations/sensors_ru.ts index c613473..292f093 100644 --- a/plugin-sensors/translations/sensors_ru.ts +++ b/plugin-sensors/translations/sensors_ru.ts @@ -64,17 +64,17 @@ Возможности чипов: - + Enabled Включён - + Label Метка - + Color Цвет diff --git a/plugin-sensors/translations/sensors_ru_RU.ts b/plugin-sensors/translations/sensors_ru_RU.ts index 86ee6b8..e71a227 100644 --- a/plugin-sensors/translations/sensors_ru_RU.ts +++ b/plugin-sensors/translations/sensors_ru_RU.ts @@ -64,17 +64,17 @@ Возможности чипов: - + Enabled Включён - + Label Метка - + Color Цвет diff --git a/plugin-sensors/translations/sensors_th_TH.ts b/plugin-sensors/translations/sensors_th_TH.ts index ec200bc..8e97b20 100644 --- a/plugin-sensors/translations/sensors_th_TH.ts +++ b/plugin-sensors/translations/sensors_th_TH.ts @@ -68,17 +68,17 @@ คุณสมบัติชิป: - + Enabled เปิดใช้ - + Label ป้าย - + Color สี diff --git a/plugin-sensors/translations/sensors_uk.ts b/plugin-sensors/translations/sensors_uk.ts index e75ea85..30d6a98 100644 --- a/plugin-sensors/translations/sensors_uk.ts +++ b/plugin-sensors/translations/sensors_uk.ts @@ -68,17 +68,17 @@ Особливості мікросхеми: - + Enabled Включено - + Label Позначка - + Color Колір diff --git a/plugin-sensors/translations/sensors_zh_CN.ts b/plugin-sensors/translations/sensors_zh_CN.ts index a44cfb8..e3b8010 100644 --- a/plugin-sensors/translations/sensors_zh_CN.ts +++ b/plugin-sensors/translations/sensors_zh_CN.ts @@ -68,17 +68,17 @@ 芯片功能: - + Enabled 已启用 - + Label 标注 - + Color 颜色 diff --git a/plugin-sensors/translations/sensors_zh_TW.ts b/plugin-sensors/translations/sensors_zh_TW.ts index 0f41acd..428d7c2 100644 --- a/plugin-sensors/translations/sensors_zh_TW.ts +++ b/plugin-sensors/translations/sensors_zh_TW.ts @@ -68,17 +68,17 @@ 晶片資訊 - + Enabled 允許 - + Label 標籤 - + Color 顏色 diff --git a/plugin-showdesktop/CMakeLists.txt b/plugin-showdesktop/CMakeLists.txt index e621065..8913718 100644 --- a/plugin-showdesktop/CMakeLists.txt +++ b/plugin-showdesktop/CMakeLists.txt @@ -8,14 +8,11 @@ set(SOURCES showdesktop.cpp ) -set(MOCS - showdesktop.h -) - set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt-globalkeys + Qt5Xdg + ${XCB_LIBRARIES} ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-showdesktop/showdesktop.cpp b/plugin-showdesktop/showdesktop.cpp index 2daa9cd..aa76831 100644 --- a/plugin-showdesktop/showdesktop.cpp +++ b/plugin-showdesktop/showdesktop.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include "showdesktop.h" // Still needed for lxde/lxqt#338 @@ -48,16 +48,8 @@ ShowDesktop::ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo) : m_key = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/show_hide").arg(settings()->group()), tr("Show desktop"), this); if (m_key) { + connect(m_key, &GlobalKeyShortcut::Action::registrationFinished, this, &ShowDesktop::shortcutRegistered); connect(m_key, SIGNAL(activated()), this, SLOT(toggleShowingDesktop())); - - if (m_key->shortcut().isEmpty()) - { - m_key->changeShortcut(DEFAULT_SHORTCUT); - if (m_key->shortcut().isEmpty()) - { - LxQt::Notification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); - } - } } QAction * act = new QAction(XdgIcon::fromTheme("user-desktop"), tr("Show Desktop"), this); @@ -67,35 +59,21 @@ ShowDesktop::ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo) : mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } -void ShowDesktop::toggleShowingDesktop() +void ShowDesktop::shortcutRegistered() { - // Paulo: KWindowSystem is not working for Openbox here, see lxde/lxqt#338 - // KWindowSystem fix: https://git.reviewboard.kde.org/r/121667 - // NETRootInfo info(QX11Info::connection(), NET::WMDesktop); - // info.setShowingDesktop(!KWindowSystem::showingDesktop()); - - const char *atomStr = "_NET_SHOWING_DESKTOP"; - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), false, strlen(atomStr), atomStr); - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(QX11Info::connection(), cookie, 0); - xcb_atom_t showing_desktop_atom = reply->atom; - free(reply); - - uint32_t data[5] = { - uint32_t(KWindowSystem::showingDesktop() ? 0 : 1), 0, 0, 0, 0 - }; - - xcb_client_message_event_t event; - event.response_type = XCB_CLIENT_MESSAGE; - event.format = 32; - event.sequence = 0; - event.window = QX11Info::appRootWindow(); - event.type = showing_desktop_atom; - for (int i = 0; i < 5; i++) - event.data.data32[i] = data[i]; + if (m_key->shortcut().isEmpty()) + { + m_key->changeShortcut(DEFAULT_SHORTCUT); + if (m_key->shortcut().isEmpty()) + { + LxQt::Notification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); + } + } +} - xcb_send_event(QX11Info::connection(), false, QX11Info::appRootWindow(), - (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), - (const char *) &event); +void ShowDesktop::toggleShowingDesktop() +{ + KWindowSystem::setShowingDesktop(!KWindowSystem::showingDesktop()); } #undef DEFAULT_SHORTCUT diff --git a/plugin-showdesktop/showdesktop.h b/plugin-showdesktop/showdesktop.h index f7f73ef..4e1e9a1 100644 --- a/plugin-showdesktop/showdesktop.h +++ b/plugin-showdesktop/showdesktop.h @@ -52,6 +52,7 @@ private: private slots: void toggleShowingDesktop(); + void shortcutRegistered(); private: QToolButton mButton; @@ -60,10 +61,10 @@ private: class ShowDesktopLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new ShowDesktop(startupInfo); } diff --git a/plugin-showdesktop/translations/showdesktop.ts b/plugin-showdesktop/translations/showdesktop.ts index 8273cb2..a6c2691 100644 --- a/plugin-showdesktop/translations/showdesktop.ts +++ b/plugin-showdesktop/translations/showdesktop.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_ar.ts b/plugin-showdesktop/translations/showdesktop_ar.ts index f6cce6f..e2b1e08 100644 --- a/plugin-showdesktop/translations/showdesktop_ar.ts +++ b/plugin-showdesktop/translations/showdesktop_ar.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` - + Show Desktop إظهار سطح المكتب diff --git a/plugin-showdesktop/translations/showdesktop_cs.ts b/plugin-showdesktop/translations/showdesktop_cs.ts index 9b074ca..8093964 100644 --- a/plugin-showdesktop/translations/showdesktop_cs.ts +++ b/plugin-showdesktop/translations/showdesktop_cs.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Show Desktop Ukázat pracovní plochu diff --git a/plugin-showdesktop/translations/showdesktop_cs_CZ.ts b/plugin-showdesktop/translations/showdesktop_cs_CZ.ts index fc755f0..cdaae29 100644 --- a/plugin-showdesktop/translations/showdesktop_cs_CZ.ts +++ b/plugin-showdesktop/translations/showdesktop_cs_CZ.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Show Desktop Ukázat pracovní plochu diff --git a/plugin-showdesktop/translations/showdesktop_da.ts b/plugin-showdesktop/translations/showdesktop_da.ts index 53343be..ab2af5c 100644 --- a/plugin-showdesktop/translations/showdesktop_da.ts +++ b/plugin-showdesktop/translations/showdesktop_da.ts @@ -17,12 +17,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Vis skrivebord diff --git a/plugin-showdesktop/translations/showdesktop_da_DK.ts b/plugin-showdesktop/translations/showdesktop_da_DK.ts index ef1f519..158a56f 100644 --- a/plugin-showdesktop/translations/showdesktop_da_DK.ts +++ b/plugin-showdesktop/translations/showdesktop_da_DK.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Vis Skrivebord: Global genvej '%1' kan ikke registreres - + Show Desktop Vis Skrivebord diff --git a/plugin-showdesktop/translations/showdesktop_de.desktop b/plugin-showdesktop/translations/showdesktop_de.desktop index 83fc665..b79fdc3 100644 --- a/plugin-showdesktop/translations/showdesktop_de.desktop +++ b/plugin-showdesktop/translations/showdesktop_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Show desktop -Comment=Minimize all windows and show the desktop - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Minimiere alle Fenster und zeige den Desktop -Name[de]=Zeige Desktop +Name[de]=Arbeitsfläche anzeigen +Comment[de]=Alle Fenster minimieren und die Arbeitsfläche anzeigen diff --git a/plugin-showdesktop/translations/showdesktop_de.ts b/plugin-showdesktop/translations/showdesktop_de.ts index 50f630b..f00c7af 100644 --- a/plugin-showdesktop/translations/showdesktop_de.ts +++ b/plugin-showdesktop/translations/showdesktop_de.ts @@ -3,28 +3,20 @@ ShowDesktop - - Global keyboard shortcut - Globales Tastaturkürzel - - - Panel Show Desktop Global shortcut: '%1' cannot be registered - Globales Tastenkürzel für Arbeitsfläche anzeigen: »%1« kann nicht registriert werden - Show desktop - + Arbeitsfläche anzeigen - - Show Desktop: Global shortcut '%1' cannot be registered - + + Show Desktop + Arbeitsfläche anzeigen - - Show Desktop - Zeige Arbeitsoberfläche + + Show Desktop: Global shortcut '%1' cannot be registered + Das globale Tastaturkürzel zum Arbeitsfläche anzeigen '%1' kann nicht registriert werden diff --git a/plugin-showdesktop/translations/showdesktop_el_GR.ts b/plugin-showdesktop/translations/showdesktop_el_GR.ts index 577e184..27c2144 100644 --- a/plugin-showdesktop/translations/showdesktop_el_GR.ts +++ b/plugin-showdesktop/translations/showdesktop_el_GR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" - + Show Desktop Εμφάνιση επιφάνειας εργασίας diff --git a/plugin-showdesktop/translations/showdesktop_eo.ts b/plugin-showdesktop/translations/showdesktop_eo.ts index bbe2112..c4bfe66 100644 --- a/plugin-showdesktop/translations/showdesktop_eo.ts +++ b/plugin-showdesktop/translations/showdesktop_eo.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Montri labortablon: ĉiea klavkombino '%1' ne registreblas - + Show Desktop Montri labortablon diff --git a/plugin-showdesktop/translations/showdesktop_es.ts b/plugin-showdesktop/translations/showdesktop_es.ts index ca96ae1..d947a16 100644 --- a/plugin-showdesktop/translations/showdesktop_es.ts +++ b/plugin-showdesktop/translations/showdesktop_es.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar Escritorio: Atajo global '%1' no puede ser registrado - + Show Desktop Mostrar Escritorio diff --git a/plugin-showdesktop/translations/showdesktop_es_VE.ts b/plugin-showdesktop/translations/showdesktop_es_VE.ts index 4e8b7ce..d310ccc 100644 --- a/plugin-showdesktop/translations/showdesktop_es_VE.ts +++ b/plugin-showdesktop/translations/showdesktop_es_VE.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse - + Show Desktop Mostrar Escritorio diff --git a/plugin-showdesktop/translations/showdesktop_eu.ts b/plugin-showdesktop/translations/showdesktop_eu.ts index e2e5ba8..65f79ca 100644 --- a/plugin-showdesktop/translations/showdesktop_eu.ts +++ b/plugin-showdesktop/translations/showdesktop_eu.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu - + Show Desktop Erakutsi mahaigaina diff --git a/plugin-showdesktop/translations/showdesktop_fi.ts b/plugin-showdesktop/translations/showdesktop_fi.ts index 0ffbe54..24025ec 100644 --- a/plugin-showdesktop/translations/showdesktop_fi.ts +++ b/plugin-showdesktop/translations/showdesktop_fi.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä - + Show Desktop Näytä työpöytä diff --git a/plugin-showdesktop/translations/showdesktop_fr_FR.ts b/plugin-showdesktop/translations/showdesktop_fr_FR.ts index 51d92a9..ebf9d2d 100644 --- a/plugin-showdesktop/translations/showdesktop_fr_FR.ts +++ b/plugin-showdesktop/translations/showdesktop_fr_FR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Montrer le bureau : le raccourci global '%1' ne peut pas être défini - + Show Desktop Montrer le bureau diff --git a/plugin-showdesktop/translations/showdesktop_hu.ts b/plugin-showdesktop/translations/showdesktop_hu.ts index 332cc7e..8975255 100644 --- a/plugin-showdesktop/translations/showdesktop_hu.ts +++ b/plugin-showdesktop/translations/showdesktop_hu.ts @@ -1,22 +1,22 @@ - + ShowDesktop Show desktop - + Asztalmegjelenítés - + Show Desktop: Global shortcut '%1' cannot be registered - + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható - + Show Desktop - + Asztalmegjelenítés diff --git a/plugin-showdesktop/translations/showdesktop_hu_HU.ts b/plugin-showdesktop/translations/showdesktop_hu_HU.ts index 139f771..a3dfb55 100644 --- a/plugin-showdesktop/translations/showdesktop_hu_HU.ts +++ b/plugin-showdesktop/translations/showdesktop_hu_HU.ts @@ -1,22 +1,22 @@ - + ShowDesktop Show desktop - + Asztalmegjelenítés - + Show Desktop: Global shortcut '%1' cannot be registered - + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható - + Show Desktop - Az asztal megjelenítése + Asztalmegjelenítés diff --git a/plugin-showdesktop/translations/showdesktop_ia.ts b/plugin-showdesktop/translations/showdesktop_ia.ts index b5e08da..e6ab8cb 100644 --- a/plugin-showdesktop/translations/showdesktop_ia.ts +++ b/plugin-showdesktop/translations/showdesktop_ia.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_id_ID.ts b/plugin-showdesktop/translations/showdesktop_id_ID.ts index 716c8ab..2b356d5 100644 --- a/plugin-showdesktop/translations/showdesktop_id_ID.ts +++ b/plugin-showdesktop/translations/showdesktop_id_ID.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Tampilkan Desktop diff --git a/plugin-showdesktop/translations/showdesktop_it_IT.ts b/plugin-showdesktop/translations/showdesktop_it_IT.ts index 3d47876..f879db9 100644 --- a/plugin-showdesktop/translations/showdesktop_it_IT.ts +++ b/plugin-showdesktop/translations/showdesktop_it_IT.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostra desktop: la scorciatoia globale '%1' non può essere registrata - + Show Desktop Mostra desktop diff --git a/plugin-showdesktop/translations/showdesktop_ja.ts b/plugin-showdesktop/translations/showdesktop_ja.ts index 4ca0e2f..19d0152 100644 --- a/plugin-showdesktop/translations/showdesktop_ja.ts +++ b/plugin-showdesktop/translations/showdesktop_ja.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered デスクトップの表示: グローバルなショートカット '%1' は登録できません - + Show Desktop デスクトップを表示 diff --git a/plugin-showdesktop/translations/showdesktop_ko.ts b/plugin-showdesktop/translations/showdesktop_ko.ts index 42a6b5c..bc35785 100644 --- a/plugin-showdesktop/translations/showdesktop_ko.ts +++ b/plugin-showdesktop/translations/showdesktop_ko.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_lt.ts b/plugin-showdesktop/translations/showdesktop_lt.ts index 12181ad..e15e2b0 100644 --- a/plugin-showdesktop/translations/showdesktop_lt.ts +++ b/plugin-showdesktop/translations/showdesktop_lt.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas - + Show Desktop Rodyti darbalaukį diff --git a/plugin-showdesktop/translations/showdesktop_nl.ts b/plugin-showdesktop/translations/showdesktop_nl.ts index 92a8190..bdaf9c0 100644 --- a/plugin-showdesktop/translations/showdesktop_nl.ts +++ b/plugin-showdesktop/translations/showdesktop_nl.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd - + Show Desktop Toon bureaublad diff --git a/plugin-showdesktop/translations/showdesktop_pl_PL.ts b/plugin-showdesktop/translations/showdesktop_pl_PL.ts index 4d592c0..9793ae5 100644 --- a/plugin-showdesktop/translations/showdesktop_pl_PL.ts +++ b/plugin-showdesktop/translations/showdesktop_pl_PL.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany - + Show Desktop Pokaż pulpit diff --git a/plugin-showdesktop/translations/showdesktop_pt.ts b/plugin-showdesktop/translations/showdesktop_pt.ts index 7413c63..1ae73d2 100644 --- a/plugin-showdesktop/translations/showdesktop_pt.ts +++ b/plugin-showdesktop/translations/showdesktop_pt.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Tecla de atalho global: '%1' não pode ser registada - + Show Desktop Mostrar área de trabalho diff --git a/plugin-showdesktop/translations/showdesktop_pt_BR.ts b/plugin-showdesktop/translations/showdesktop_pt_BR.ts index 40c910a..777d91f 100644 --- a/plugin-showdesktop/translations/showdesktop_pt_BR.ts +++ b/plugin-showdesktop/translations/showdesktop_pt_BR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado - + Show Desktop Exibir a área de trabalho diff --git a/plugin-showdesktop/translations/showdesktop_ro_RO.ts b/plugin-showdesktop/translations/showdesktop_ro_RO.ts index b75723e..9deca7c 100644 --- a/plugin-showdesktop/translations/showdesktop_ro_RO.ts +++ b/plugin-showdesktop/translations/showdesktop_ro_RO.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Afișează desktopul diff --git a/plugin-showdesktop/translations/showdesktop_ru.ts b/plugin-showdesktop/translations/showdesktop_ru.ts index 20f4b52..10a1e7b 100644 --- a/plugin-showdesktop/translations/showdesktop_ru.ts +++ b/plugin-showdesktop/translations/showdesktop_ru.ts @@ -9,12 +9,12 @@ Показать рабочий стол - + Show Desktop: Global shortcut '%1' cannot be registered Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано - + Show Desktop Показать рабочий стол diff --git a/plugin-showdesktop/translations/showdesktop_ru_RU.ts b/plugin-showdesktop/translations/showdesktop_ru_RU.ts index ceaedf8..c6d4427 100644 --- a/plugin-showdesktop/translations/showdesktop_ru_RU.ts +++ b/plugin-showdesktop/translations/showdesktop_ru_RU.ts @@ -9,12 +9,12 @@ Показать рабочий стол - + Show Desktop: Global shortcut '%1' cannot be registered Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано - + Show Desktop Показать рабочий стол diff --git a/plugin-showdesktop/translations/showdesktop_sk_SK.ts b/plugin-showdesktop/translations/showdesktop_sk_SK.ts index 5b81bc1..9d31aa4 100644 --- a/plugin-showdesktop/translations/showdesktop_sk_SK.ts +++ b/plugin-showdesktop/translations/showdesktop_sk_SK.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Zobraziť plochu diff --git a/plugin-showdesktop/translations/showdesktop_sl.ts b/plugin-showdesktop/translations/showdesktop_sl.ts index 07c6e23..eb9b10a 100644 --- a/plugin-showdesktop/translations/showdesktop_sl.ts +++ b/plugin-showdesktop/translations/showdesktop_sl.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Prikaz namizja: globalne bližnjice »%1« ni moč registrirati - + Show Desktop Pokaži namizje diff --git a/plugin-showdesktop/translations/showdesktop_sr@latin.ts b/plugin-showdesktop/translations/showdesktop_sr@latin.ts index d9077f5..6a772ca 100644 --- a/plugin-showdesktop/translations/showdesktop_sr@latin.ts +++ b/plugin-showdesktop/translations/showdesktop_sr@latin.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_sr_BA.ts b/plugin-showdesktop/translations/showdesktop_sr_BA.ts index 7cc7548..46543f8 100644 --- a/plugin-showdesktop/translations/showdesktop_sr_BA.ts +++ b/plugin-showdesktop/translations/showdesktop_sr_BA.ts @@ -17,12 +17,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Прикажи радну површ diff --git a/plugin-showdesktop/translations/showdesktop_sr_RS.ts b/plugin-showdesktop/translations/showdesktop_sr_RS.ts index e5f6a5f..c5e55e3 100644 --- a/plugin-showdesktop/translations/showdesktop_sr_RS.ts +++ b/plugin-showdesktop/translations/showdesktop_sr_RS.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Прикажи радну површ diff --git a/plugin-showdesktop/translations/showdesktop_th_TH.ts b/plugin-showdesktop/translations/showdesktop_th_TH.ts index 228eec3..ca8ab32 100644 --- a/plugin-showdesktop/translations/showdesktop_th_TH.ts +++ b/plugin-showdesktop/translations/showdesktop_th_TH.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ - + Show Desktop แสดงพื้นโต๊ะ diff --git a/plugin-showdesktop/translations/showdesktop_tr.ts b/plugin-showdesktop/translations/showdesktop_tr.ts index 6b18a87..ed70e01 100644 --- a/plugin-showdesktop/translations/showdesktop_tr.ts +++ b/plugin-showdesktop/translations/showdesktop_tr.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Masaüstünü Göster: '%1' genel kısayolu kaydedilemiyor - + Show Desktop Masaüstünü Göster diff --git a/plugin-showdesktop/translations/showdesktop_uk.ts b/plugin-showdesktop/translations/showdesktop_uk.ts index 1e05001..0229e03 100644 --- a/plugin-showdesktop/translations/showdesktop_uk.ts +++ b/plugin-showdesktop/translations/showdesktop_uk.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' - + Show Desktop Показати стільницю diff --git a/plugin-showdesktop/translations/showdesktop_zh_CN.ts b/plugin-showdesktop/translations/showdesktop_zh_CN.ts index 41214a3..33da8b3 100644 --- a/plugin-showdesktop/translations/showdesktop_zh_CN.ts +++ b/plugin-showdesktop/translations/showdesktop_zh_CN.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered 显示桌面:无法注册全局快捷键'%1' - + Show Desktop 显示桌面 diff --git a/plugin-showdesktop/translations/showdesktop_zh_TW.ts b/plugin-showdesktop/translations/showdesktop_zh_TW.ts index 1cc3124..4190d5a 100644 --- a/plugin-showdesktop/translations/showdesktop_zh_TW.ts +++ b/plugin-showdesktop/translations/showdesktop_zh_TW.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered 顯示桌面:全域快捷鍵'%1'無法被註冊 - + Show Desktop 顯示桌面 diff --git a/plugin-spacer/CMakeLists.txt b/plugin-spacer/CMakeLists.txt new file mode 100644 index 0000000..27cf663 --- /dev/null +++ b/plugin-spacer/CMakeLists.txt @@ -0,0 +1,17 @@ +set(PLUGIN "spacer") + +set(HEADERS + spacer.h + spacerconfiguration.h +) + +set(SOURCES + spacer.cpp + spacerconfiguration.cpp +) + +set(UIS + spacerconfiguration.ui +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-spacer/resources/spacer.desktop.in b/plugin-spacer/resources/spacer.desktop.in new file mode 100644 index 0000000..6654498 --- /dev/null +++ b/plugin-spacer/resources/spacer.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Spacer +Comment=Space between widgets +Icon=bookmark-new + +#TRANSLATIONS_DIR=../translations diff --git a/plugin-spacer/spacer.cpp b/plugin-spacer/spacer.cpp new file mode 100644 index 0000000..49ebad7 --- /dev/null +++ b/plugin-spacer/spacer.cpp @@ -0,0 +1,109 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacer.h" +#include "spacerconfiguration.h" +#include + +void SpacerWidget::setType(QString const & type) +{ + if (type != mType) + { + mType = type; + style()->unpolish(this); + style()->polish(this); + } +} + +void SpacerWidget::setOrientation(QString const & orientation) +{ + if (orientation != mOrientation) + { + mOrientation = orientation; + style()->unpolish(this); + style()->polish(this); + } +} + +/************************************************ + + ************************************************/ +Spacer::Spacer(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject() + , ILxQtPanelPlugin(startupInfo) + , mSize(8) +{ + settingsChanged(); +} + +/************************************************ + + ************************************************/ +void Spacer::settingsChanged() +{ + mSize = settings()->value("size", 8).toInt(); + mSpacer.setType(settings()->value("spaceType", SpacerConfiguration::msTypes[0]).toString()); + setSizes(); +} + +/************************************************ + + ************************************************/ +QDialog *Spacer::configureDialog() +{ + return new SpacerConfiguration(settings()); +} + +/************************************************ + + ************************************************/ +void Spacer::setSizes() +{ + if (panel()->isHorizontal()) + { + mSpacer.setOrientation("horizontal"); + mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + mSpacer.setFixedWidth(mSize); + mSpacer.setMinimumHeight(0); + mSpacer.setMaximumHeight(QWIDGETSIZE_MAX); + } + else + { + mSpacer.setOrientation("vertical"); + mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + mSpacer.setFixedHeight(mSize); + mSpacer.setMinimumWidth(0); + mSpacer.setMaximumWidth(QWIDGETSIZE_MAX); + } +} + +/************************************************ + + ************************************************/ +void Spacer::realign() +{ + setSizes(); +} diff --git a/plugin-spacer/spacer.h b/plugin-spacer/spacer.h new file mode 100644 index 0000000..9fec1e0 --- /dev/null +++ b/plugin-spacer/spacer.h @@ -0,0 +1,91 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACER_H +#define SPACER_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class SpacerWidget : public QFrame +{ + Q_OBJECT + + Q_PROPERTY(QString type READ getType) + Q_PROPERTY(QString orientation READ getOrientation) + +public: + const QString& getType() const throw () { return mType; } + void setType(QString const & type); + const QString& getOrientation() const throw () { return mOrientation; } + void setOrientation(QString const & orientation); + +private: + QString mType; + QString mOrientation; +}; + +class Spacer : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + Spacer(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mSpacer; } + virtual QString themeId() const { return "Spacer"; } + + bool isSeparate() const { return true; } + + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + + virtual void realign(); + +private slots: + virtual void settingsChanged(); + +private: + void setSizes(); + +private: + SpacerWidget mSpacer; + int mSize; +}; + +class SpacerPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new Spacer(startupInfo);} +}; + +#endif + diff --git a/plugin-spacer/spacerconfiguration.cpp b/plugin-spacer/spacerconfiguration.cpp new file mode 100644 index 0000000..60002ae --- /dev/null +++ b/plugin-spacer/spacerconfiguration.cpp @@ -0,0 +1,77 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacerconfiguration.h" +#include "ui_spacerconfiguration.h" + + +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList SpacerConfiguration::msTypes = { + QStringLiteral(QT_TR_NOOP("lined")) + , QStringLiteral(QT_TR_NOOP("dotted")) + , QStringLiteral(QT_TR_NOOP("invisible")) +}; + +SpacerConfiguration::SpacerConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::SpacerConfiguration) + , mSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("SpacerConfigurationWindow"); + ui->setupUi(this); + + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msTypes) + ui->typeCB->addItem(tr(type.toStdString().c_str()), type); + + loadSettings(); + + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &SpacerConfiguration::sizeChanged); + connect(ui->typeCB, static_cast(&QComboBox::currentIndexChanged), this, &SpacerConfiguration::typeChanged); +} + +SpacerConfiguration::~SpacerConfiguration() +{ + delete ui; +} + +void SpacerConfiguration::loadSettings() +{ + ui->sizeSB->setValue(mSettings->value("size", 8).toInt()); + ui->typeCB->setCurrentIndex(ui->typeCB->findData(mSettings->value("spaceType", msTypes[0]).toString())); +} + +void SpacerConfiguration::sizeChanged(int value) +{ + mSettings->setValue("size", value); +} + +void SpacerConfiguration::typeChanged(int index) +{ + mSettings->setValue("spaceType", ui->typeCB->itemData(index, Qt::UserRole)); +} diff --git a/plugin-spacer/spacerconfiguration.h b/plugin-spacer/spacerconfiguration.h new file mode 100644 index 0000000..def3410 --- /dev/null +++ b/plugin-spacer/spacerconfiguration.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACERCONFIGURATION_H +#define SPACERCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class SpacerConfiguration; +} + +class SpacerConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit SpacerConfiguration(QSettings *settings, QWidget *parent = 0); + ~SpacerConfiguration(); + +public: + static const QStringList msTypes; + +private: + Ui::SpacerConfiguration *ui; + QSettings *mSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void sizeChanged(int value); + void typeChanged(int index); +}; + +#endif // SPACERCONFIGURATION_H diff --git a/plugin-spacer/spacerconfiguration.ui b/plugin-spacer/spacerconfiguration.ui new file mode 100644 index 0000000..1ed809f --- /dev/null +++ b/plugin-spacer/spacerconfiguration.ui @@ -0,0 +1,70 @@ + + + SpacerConfiguration + + + + 0 + 0 + + + + Spacer Settings + + + + + + Space width: + + + + + + + 4 + + + 2048 + + + 8 + + + + + + + Space type: + + + + + + + false + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttons + clicked(QAbstractButton*) + SpacerConfiguration + close() + + + diff --git a/plugin-spacer/translations/spacer.ts b/plugin-spacer/translations/spacer.ts new file mode 100644 index 0000000..2f4886e --- /dev/null +++ b/plugin-spacer/translations/spacer.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + + + + + Space width: + + + + + Space type: + + + + + lined + + + + + dotted + + + + + invisible + + + + diff --git a/plugin-spacer/translations/spacer_de.desktop b/plugin-spacer/translations/spacer_de.desktop new file mode 100644 index 0000000..c58ea1e --- /dev/null +++ b/plugin-spacer/translations/spacer_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Spacer +Comment[de]=Stellt den Abstand zwischen den Widgets ein diff --git a/plugin-spacer/translations/spacer_de.ts b/plugin-spacer/translations/spacer_de.ts new file mode 100644 index 0000000..bea2914 --- /dev/null +++ b/plugin-spacer/translations/spacer_de.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Leerraum Einstellungen + + + + Space width: + Leerraumbreite: + + + + Space type: + Leerraumtyp: + + + + lined + liniert + + + + dotted + punktiert + + + + invisible + unsichtbar + + + diff --git a/plugin-spacer/translations/spacer_hu.desktop b/plugin-spacer/translations/spacer_hu.desktop new file mode 100644 index 0000000..0f5d07a --- /dev/null +++ b/plugin-spacer/translations/spacer_hu.desktop @@ -0,0 +1,2 @@ +Name[hu]=Távtartó +Comment[hu]=Elemek közötti távolságtartó diff --git a/plugin-spacer/translations/spacer_hu.ts b/plugin-spacer/translations/spacer_hu.ts new file mode 100644 index 0000000..9ee4d68 --- /dev/null +++ b/plugin-spacer/translations/spacer_hu.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/plugin-spacer/translations/spacer_hu_HU.ts b/plugin-spacer/translations/spacer_hu_HU.ts new file mode 100644 index 0000000..9394c6c --- /dev/null +++ b/plugin-spacer/translations/spacer_hu_HU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/plugin-spacer/translations/spacer_ru.desktop b/plugin-spacer/translations/spacer_ru.desktop new file mode 100644 index 0000000..966c4d8 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Разделитель +Comment[ru]=Промежуток между виджетами diff --git a/plugin-spacer/translations/spacer_ru.ts b/plugin-spacer/translations/spacer_ru.ts new file mode 100644 index 0000000..23b35f2 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/plugin-spacer/translations/spacer_ru_RU.desktop b/plugin-spacer/translations/spacer_ru_RU.desktop new file mode 100644 index 0000000..b8c65bf --- /dev/null +++ b/plugin-spacer/translations/spacer_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Разделитель +Comment[ru_RU]=Промежуток между виджетами diff --git a/plugin-spacer/translations/spacer_ru_RU.ts b/plugin-spacer/translations/spacer_ru_RU.ts new file mode 100644 index 0000000..2730852 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru_RU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/plugin-spacer/translations/spacer_sk.ts b/plugin-spacer/translations/spacer_sk.ts new file mode 100644 index 0000000..4845e69 --- /dev/null +++ b/plugin-spacer/translations/spacer_sk.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Nastavenia medzery + + + + Space width: + Šírka medzery: + + + + Space type: + Typ medzery: + + + + lined + plná čiara + + + + dotted + bodkovaná čiara + + + + invisible + neviditeľná + + + diff --git a/plugin-statusnotifier/CMakeLists.txt b/plugin-statusnotifier/CMakeLists.txt new file mode 100644 index 0000000..42ea321 --- /dev/null +++ b/plugin-statusnotifier/CMakeLists.txt @@ -0,0 +1,35 @@ +set(PLUGIN "statusnotifier") + + +find_package(dbusmenu-qt5 REQUIRED QUIET) + +set(HEADERS + statusnotifier.h + dbustypes.h + statusnotifierbutton.h + statusnotifieriteminterface.h + statusnotifierwatcher.h + statusnotifierwidget.h +) + +set(SOURCES + statusnotifier.cpp + dbustypes.cpp + statusnotifierbutton.cpp + statusnotifieriteminterface.cpp + statusnotifierwatcher.cpp + statusnotifierwidget.cpp +) + +qt5_add_dbus_adaptor(SOURCES + org.kde.StatusNotifierItem.xml + statusnotifieriteminterface.h + StatusNotifierItemInterface +) + +set(LIBRARIES + lxqt + dbusmenu-qt5 +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-statusnotifier/dbustypes.cpp b/plugin-statusnotifier/dbustypes.cpp new file mode 100644 index 0000000..f4b345d --- /dev/null +++ b/plugin-statusnotifier/dbustypes.cpp @@ -0,0 +1,75 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "dbustypes.h" + +// Marshall the IconPixmap data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon) +{ + argument.beginStructure(); + argument << icon.width; + argument << icon.height; + argument << icon.bytes; + argument.endStructure(); + return argument; +} + +// Retrieve the ImageStruct data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon) +{ + argument.beginStructure(); + argument >> icon.width; + argument >> icon.height; + argument >> icon.bytes; + argument.endStructure(); + return argument; +} + +// Marshall the ToolTip data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip) +{ + argument.beginStructure(); + argument << toolTip.iconName; + argument << toolTip.iconPixmap; + argument << toolTip.title; + argument << toolTip.description; + argument.endStructure(); + return argument; +} + +// Retrieve the ToolTip data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip) +{ + argument.beginStructure(); + argument >> toolTip.iconName; + argument >> toolTip.iconPixmap; + argument >> toolTip.title; + argument >> toolTip.description; + argument.endStructure(); + return argument; +} diff --git a/plugin-statusnotifier/dbustypes.h b/plugin-statusnotifier/dbustypes.h new file mode 100644 index 0000000..ecdb220 --- /dev/null +++ b/plugin-statusnotifier/dbustypes.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#ifndef DBUSTYPES_H +#define DBUSTYPES_H + +struct IconPixmap { + int width; + int height; + QByteArray bytes; +}; + +typedef QList IconPixmapList; + +struct ToolTip { + QString iconName; + QList iconPixmap; + QString title; + QString description; +}; + +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon); +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon); + +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip); +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip); + +Q_DECLARE_METATYPE(IconPixmap) +Q_DECLARE_METATYPE(ToolTip) + +#endif // DBUSTYPES_H diff --git a/plugin-statusnotifier/org.kde.StatusNotifierItem.xml b/plugin-statusnotifier/org.kde.StatusNotifierItem.xml new file mode 100644 index 0000000..0a563c5 --- /dev/null +++ b/plugin-statusnotifier/org.kde.StatusNotifierItem.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugin-statusnotifier/resources/statusnotifier.desktop.in b/plugin-statusnotifier/resources/statusnotifier.desktop.in new file mode 100644 index 0000000..66a4bc0 --- /dev/null +++ b/plugin-statusnotifier/resources/statusnotifier.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Status Notifier Plugin +Comment=Status Notifier Plugin +Icon=go-bottom diff --git a/plugin-statusnotifier/statusnotifier.cpp b/plugin-statusnotifier/statusnotifier.cpp new file mode 100644 index 0000000..0d80484 --- /dev/null +++ b/plugin-statusnotifier/statusnotifier.cpp @@ -0,0 +1,41 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifier.h" + +StatusNotifier::StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + m_widget = new StatusNotifierWidget(this); +} + +void StatusNotifier::realign() +{ + m_widget->realign(); +} diff --git a/plugin-statusnotifier/statusnotifier.h b/plugin-statusnotifier/statusnotifier.h new file mode 100644 index 0000000..93aed9e --- /dev/null +++ b/plugin-statusnotifier/statusnotifier.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIER_PLUGIN_H +#define STATUSNOTIFIER_PLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include "statusnotifierwidget.h" + +class StatusNotifier : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo); + + bool isSeparate() const { return true; } + void realign(); + QString themeId() const { return "StatusNotifier"; } + virtual Flags flags() const { return SingleInstance | NeedsHandle; } + QWidget *widget() { return m_widget; } + +private: + StatusNotifierWidget *m_widget; +}; + +class StatusNotifierLibrary : public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT +// Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new StatusNotifier(startupInfo); + } +}; + +#endif // STATUSNOTIFIER_PLUGIN_H diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp new file mode 100644 index 0000000..525b043 --- /dev/null +++ b/plugin-statusnotifier/statusnotifierbutton.cpp @@ -0,0 +1,248 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierbutton.h" + +#include +#include +#include +#include "../panel/ilxqtpanelplugin.h" + + +StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent) + : QToolButton(parent), + mMenu(NULL), + mStatus(Passive), + mValid(true), + mFallbackIcon(QIcon::fromTheme("application-x-executable")), + mPlugin(plugin) +{ + interface = new org::kde::StatusNotifierItem(service, objectPath, QDBusConnection::sessionBus(), this); + + QString menuPath = interface->menu().path(); + if (!menuPath.isEmpty()) + { + mMenu = (new DBusMenuImporter(service, interface->menu().path(), this))->menu(); + dynamic_cast(*mMenu).setParent(this); + mMenu->setObjectName(QStringLiteral("StatusNotifierMenu")); + } + + // HACK: sni-qt creates some invalid items (like one for konversarion 1.5) + if (interface->title().isEmpty() && interface->id().isEmpty()) + mValid = false; + + if (mValid) + { + newToolTip(); + refetchIcon(Active); + refetchIcon(Passive); + refetchIcon(NeedsAttention); + newStatus(interface->status()); + resetIcon(); + + connect(interface, SIGNAL(NewIcon()), this, SLOT(newIcon())); + connect(interface, SIGNAL(NewOverlayIcon()), this, SLOT(newOverlayIcon())); + connect(interface, SIGNAL(NewAttentionIcon()), this, SLOT(newAttentionIcon())); + connect(interface, SIGNAL(NewToolTip()), this, SLOT(newToolTip())); + connect(interface, SIGNAL(NewStatus(QString)), this, SLOT(newStatus(QString))); + } +} + +StatusNotifierButton::~StatusNotifierButton() +{ +} + +void StatusNotifierButton::newIcon() +{ + refetchIcon(Passive); + resetIcon(); +} + +void StatusNotifierButton::newOverlayIcon() +{ + refetchIcon(Active); + resetIcon(); +} + +void StatusNotifierButton::newAttentionIcon() +{ + refetchIcon(NeedsAttention); + resetIcon(); +} + +void StatusNotifierButton::refetchIcon(Status status) +{ + QString iconName; + switch (status) + { + case Active: + iconName = interface->overlayIconName(); + break; + case NeedsAttention: + iconName = interface->attentionIconName(); + break; + case Passive: + iconName = interface->iconName(); + break; + } + + QIcon nextIcon; + if (!iconName.isEmpty()) + { + if (QIcon::hasThemeIcon(iconName)) + nextIcon = QIcon::fromTheme(iconName); + else + { + QDir themeDir(interface->iconThemePath()); + if (themeDir.exists()) + { + if (themeDir.exists(iconName + ".png")) + nextIcon.addFile(themeDir.filePath(iconName + ".png")); + + if (themeDir.cd("hicolor") || (themeDir.cd("icons") && themeDir.cd("hicolor"))) + { + QStringList sizes = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString dir, sizes) + { + QStringList dirs = QDir(themeDir.filePath(dir)).entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString innerDir, dirs) + { + QString file = themeDir.absolutePath() + "/" + dir + "/" + innerDir + "/" + iconName + ".png"; + if (QFile::exists(file)) + nextIcon.addFile(file); + } + } + } + } + } + } + else + { + IconPixmapList iconPixmaps; + switch (status) + { + case Active: + iconPixmaps = interface->overlayIconPixmap(); + break; + case NeedsAttention: + iconPixmaps = interface->attentionIconPixmap(); + break; + case Passive: + iconPixmaps = interface->iconPixmap(); + break; + } + + + if (!iconPixmaps.empty() && !iconPixmaps.first().bytes.isNull()) + { + IconPixmap iconPixmap = iconPixmaps.first(); + QImage image((uchar*) iconPixmap.bytes.data(), iconPixmap.width, iconPixmap.height, QImage::Format_ARGB32); + const uchar *end = image.constBits() + image.byteCount(); + uchar *dest = reinterpret_cast(iconPixmap.bytes.data()); + for (const uchar *src = image.constBits(); src < end; src += 4, dest += 4) + qToUnaligned(qToBigEndian(qFromUnaligned(src)), dest); + + QPixmap pixmap = QPixmap::fromImage(image); + nextIcon = QIcon(pixmap); + } + } + + switch (status) + { + case Active: + mOverlayIcon = nextIcon; + break; + case NeedsAttention: + mAttentionIcon = nextIcon; + break; + case Passive: + mIcon = nextIcon; + break; + } +} + +void StatusNotifierButton::newToolTip() +{ + QString toolTipTitle = interface->toolTip().title; + setToolTip(toolTipTitle.isEmpty() ? interface->title() : toolTipTitle); +} + +void StatusNotifierButton::newStatus(QString status) +{ + Status newStatus; + if (status == QStringLiteral("Passive")) + newStatus = Passive; + else if (status == QStringLiteral("Active")) + newStatus = Active; + else + newStatus = NeedsAttention; + + if (mStatus == newStatus) + return; + + mStatus = newStatus; + resetIcon(); +} + +void StatusNotifierButton::contextMenuEvent(QContextMenuEvent* event) +{ + //XXX: avoid showing of parent's context menu, we are (optionaly) providing context menu on mouseReleaseEvent + //QWidget::contextMenuEvent(event); +} + +void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + interface->Activate(QCursor::pos().x(), QCursor::pos().y()); + else if (event->button() == Qt::MidButton) + interface->SecondaryActivate(QCursor::pos().x(), QCursor::pos().y()); + else if (Qt::RightButton == event->button()) + mMenu->popup(mPlugin->calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); + QToolButton::mouseReleaseEvent(event); +} + +void StatusNotifierButton::wheelEvent(QWheelEvent *event) +{ + interface->Scroll(event->delta(), "vertical"); +} + +void StatusNotifierButton::resetIcon() +{ + if (mStatus == Active && !mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (mStatus == NeedsAttention && !mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else if (!mIcon.isNull()) // mStatus == Passive + setIcon(mIcon); + else if (!mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (!mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else + setIcon(mFallbackIcon); +} diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h new file mode 100644 index 0000000..ea0da60 --- /dev/null +++ b/plugin-statusnotifier/statusnotifierbutton.h @@ -0,0 +1,95 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERBUTTON_H +#define STATUSNOTIFIERBUTTON_H + +#include +#include +#include +#include +#include +#include +#include + +#include "statusnotifieriteminterface.h" + +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +template inline T qFromUnaligned(const uchar *src) +{ + T dest; + const size_t size = sizeof(T); + memcpy(&dest, src, size); + return dest; +} +#endif + +class ILxQtPanelPlugin; + +class StatusNotifierButton : public QToolButton +{ + Q_OBJECT + +public: + StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent = 0); + ~StatusNotifierButton(); + + bool isValid() const { return mValid; } + + enum Status + { + Passive, Active, NeedsAttention + }; + +public slots: + void newIcon(); + void newAttentionIcon(); + void newOverlayIcon(); + void newToolTip(); + void newStatus(QString status); + +private: + org::kde::StatusNotifierItem *interface; + QMenu *mMenu; + Status mStatus; + bool mValid; + + QIcon mIcon, mOverlayIcon, mAttentionIcon, mFallbackIcon; + + ILxQtPanelPlugin* mPlugin; + +protected: + void contextMenuEvent(QContextMenuEvent * event); + void mouseReleaseEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent *event); + + void refetchIcon(Status status); + void resetIcon(); +}; + +#endif // STATUSNOTIFIERBUTTON_H diff --git a/plugin-statusnotifier/statusnotifieriteminterface.cpp b/plugin-statusnotifier/statusnotifieriteminterface.cpp new file mode 100644 index 0000000..ad8fbda --- /dev/null +++ b/plugin-statusnotifier/statusnotifieriteminterface.cpp @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "statusnotifieriteminterface.h" + +/* + * Implementation of interface class StatusNotifierItemInterface + */ + +StatusNotifierItemInterface::StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +StatusNotifierItemInterface::~StatusNotifierItemInterface() +{ +} + diff --git a/plugin-statusnotifier/statusnotifieriteminterface.h b/plugin-statusnotifier/statusnotifieriteminterface.h new file mode 100644 index 0000000..a1417b1 --- /dev/null +++ b/plugin-statusnotifier/statusnotifieriteminterface.h @@ -0,0 +1,174 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef STATUSNOTIFIERITEMINTERFACE_H +#define STATUSNOTIFIERITEMINTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "dbustypes.h" + +/* + * Proxy class for interface org.kde.StatusNotifierItem + */ +class StatusNotifierItemInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.kde.StatusNotifierItem"; } + +public: + StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~StatusNotifierItemInterface(); + + Q_PROPERTY(QString AttentionIconName READ attentionIconName) + inline QString attentionIconName() const + { return qvariant_cast< QString >(property("AttentionIconName")); } + + Q_PROPERTY(IconPixmapList AttentionIconPixmap READ attentionIconPixmap) + inline IconPixmapList attentionIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("AttentionIconPixmap")); } + + Q_PROPERTY(QString AttentionMovieName READ attentionMovieName) + inline QString attentionMovieName() const + { return qvariant_cast< QString >(property("AttentionMovieName")); } + + Q_PROPERTY(QString Category READ category) + inline QString category() const + { return qvariant_cast< QString >(property("Category")); } + + Q_PROPERTY(QString IconName READ iconName) + inline QString iconName() const + { return qvariant_cast< QString >(property("IconName")); } + + Q_PROPERTY(IconPixmapList IconPixmap READ iconPixmap) + inline IconPixmapList iconPixmap() const + { return qvariant_cast< IconPixmapList >(property("IconPixmap")); } + + Q_PROPERTY(QString IconThemePath READ iconThemePath) + inline QString iconThemePath() const + { return qvariant_cast< QString >(property("IconThemePath")); } + + Q_PROPERTY(QString Id READ id) + inline QString id() const + { return qvariant_cast< QString >(property("Id")); } + + Q_PROPERTY(bool ItemIsMenu READ itemIsMenu) + inline bool itemIsMenu() const + { return qvariant_cast< bool >(property("ItemIsMenu")); } + + Q_PROPERTY(QDBusObjectPath Menu READ menu) + inline QDBusObjectPath menu() const + { return qvariant_cast< QDBusObjectPath >(property("Menu")); } + + Q_PROPERTY(QString OverlayIconName READ overlayIconName) + inline QString overlayIconName() const + { return qvariant_cast< QString >(property("OverlayIconName")); } + + Q_PROPERTY(IconPixmapList OverlayIconPixmap READ overlayIconPixmap) + inline IconPixmapList overlayIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("OverlayIconPixmap")); } + + Q_PROPERTY(QString Status READ status) + inline QString status() const + { return qvariant_cast< QString >(property("Status")); } + + Q_PROPERTY(QString Title READ title) + inline QString title() const + { return qvariant_cast< QString >(property("Title")); } + + Q_PROPERTY(ToolTip ToolTip READ toolTip) + inline ToolTip toolTip() const + { return qvariant_cast< ToolTip >(property("ToolTip")); } + + Q_PROPERTY(int WindowId READ windowId) + inline int windowId() const + { return qvariant_cast< int >(property("WindowId")); } + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> Activate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList); + } + + inline QDBusPendingReply<> ContextMenu(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("ContextMenu"), argumentList); + } + + inline QDBusPendingReply<> Scroll(int delta, const QString &orientation) + { + QList argumentList; + argumentList << QVariant::fromValue(delta) << QVariant::fromValue(orientation); + return asyncCallWithArgumentList(QStringLiteral("Scroll"), argumentList); + } + + inline QDBusPendingReply<> SecondaryActivate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("SecondaryActivate"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void NewAttentionIcon(); + void NewIcon(); + void NewOverlayIcon(); + void NewStatus(const QString &status); + void NewTitle(); + void NewToolTip(); +}; + +namespace org { + namespace kde { + typedef ::StatusNotifierItemInterface StatusNotifierItem; + } +} +#endif diff --git a/plugin-statusnotifier/statusnotifierwatcher.cpp b/plugin-statusnotifier/statusnotifierwatcher.cpp new file mode 100644 index 0000000..4fcfa2e --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwatcher.cpp @@ -0,0 +1,117 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwatcher.h" +#include +#include + +StatusNotifierWatcher::StatusNotifierWatcher(QObject *parent) : QObject(parent) +{ + qRegisterMetaType("IconPixmap"); + qDBusRegisterMetaType(); + qRegisterMetaType("IconPixmapList"); + qDBusRegisterMetaType(); + qRegisterMetaType("ToolTip"); + qDBusRegisterMetaType(); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + if (!dbus.registerService("org.kde.StatusNotifierWatcher")) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + if (!dbus.registerObject("/StatusNotifierWatcher", this, QDBusConnection::ExportScriptableContents)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new QDBusServiceWatcher(this); + mWatcher->setConnection(dbus); + mWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration); + + connect(mWatcher, &QDBusServiceWatcher::serviceUnregistered, this, &StatusNotifierWatcher::serviceUnregistered); +} + +StatusNotifierWatcher::~StatusNotifierWatcher() +{ + QDBusConnection::sessionBus().unregisterService("org.kde.StatusNotifierWatcher"); +} + +void StatusNotifierWatcher::RegisterStatusNotifierItem(const QString &serviceOrPath) +{ + QString service = serviceOrPath; + QString path = "/StatusNotifierItem"; + + // workaround for sni-qt + if (service.startsWith('/')) + { + path = service; + service = message().service(); + } + + QString notifierItemId = service + path; + + if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value() + && !mServices.contains(notifierItemId)) + { + mServices << notifierItemId; + mWatcher->addWatchedService(service); + emit StatusNotifierItemRegistered(notifierItemId); + } +} + +void StatusNotifierWatcher::RegisterStatusNotifierHost(const QString &service) +{ + if (!mHosts.contains(service)) + { + mHosts.append(service); + mWatcher->addWatchedService(service); + } +} + +void StatusNotifierWatcher::serviceUnregistered(const QString &service) +{ + qDebug() << "Service" << service << "unregistered"; + + mWatcher->removeWatchedService(service); + + if (mHosts.contains(service)) + { + mHosts.removeAll(service); + return; + } + + QString match = service + '/'; + QStringList::Iterator it = mServices.begin(); + while (it != mServices.end()) + { + if (it->startsWith(match)) + { + QString name = *it; + it = mServices.erase(it); + emit StatusNotifierItemUnregistered(name); + } + else + ++it; + } +} diff --git a/plugin-statusnotifier/statusnotifierwatcher.h b/plugin-statusnotifier/statusnotifierwatcher.h new file mode 100644 index 0000000..0c2be8a --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwatcher.h @@ -0,0 +1,73 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWATCHER_H +#define STATUSNOTIFIERWATCHER_H + +#include +#include +#include +#include +#include + +#include "dbustypes.h" + +class StatusNotifierWatcher : public QObject, protected QDBusContext +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.StatusNotifierWatcher") + Q_SCRIPTABLE Q_PROPERTY(bool IsStatusNotifierHostRegistered READ isStatusNotifierHostRegistered) + Q_SCRIPTABLE Q_PROPERTY(int ProtocolVersion READ protocolVersion) + Q_SCRIPTABLE Q_PROPERTY(QStringList RegisteredStatusNotifierItems READ RegisteredStatusNotifierItems) + +public: + explicit StatusNotifierWatcher(QObject *parent = 0); + ~StatusNotifierWatcher(); + + bool isStatusNotifierHostRegistered() { return mHosts.count() > 0; } + int protocolVersion() const { return 0; } + QStringList RegisteredStatusNotifierItems() const { return mServices; } + +signals: + Q_SCRIPTABLE void StatusNotifierItemRegistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierItemUnregistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierHostRegistered(); + +public slots: + Q_SCRIPTABLE void RegisterStatusNotifierItem(const QString &serviceOrPath); + Q_SCRIPTABLE void RegisterStatusNotifierHost(const QString &service); + + void serviceUnregistered(const QString &service); + +private: + QStringList mServices; + QStringList mHosts; + QDBusServiceWatcher *mWatcher; +}; + +#endif // STATUSNOTIFIERWATCHER_H diff --git a/plugin-statusnotifier/statusnotifierwidget.cpp b/plugin-statusnotifier/statusnotifierwidget.cpp new file mode 100644 index 0000000..8a569ee --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwidget.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwidget.h" +#include +#include "../panel/ilxqtpanelplugin.h" + +StatusNotifierWidget::StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent) : + QWidget(parent), + mPlugin(plugin) +{ + QString dbusName = QString("org.kde.StatusNotifierHost-%1-%2").arg(QApplication::applicationPid()).arg(1); + if (!QDBusConnection::sessionBus().registerService(dbusName)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new StatusNotifierWatcher; + mWatcher->RegisterStatusNotifierHost(dbusName); + + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemRegistered, + this, &StatusNotifierWidget::itemAdded); + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemUnregistered, + this, &StatusNotifierWidget::itemRemoved); + + setLayout(new LxQt::GridLayout(this)); + realign(); + + qDebug() << mWatcher->RegisteredStatusNotifierItems(); + +} + +void StatusNotifierWidget::itemAdded(QString serviceAndPath) +{ + int slash = serviceAndPath.indexOf('/'); + QString serv = serviceAndPath.left(slash); + QString path = serviceAndPath.mid(slash); + StatusNotifierButton *button = new StatusNotifierButton(serv, path, mPlugin, this); + + if (!button->isValid()) + delete button; + else + { + mServices.insert(serviceAndPath, button); + layout()->addWidget(button); + layout()->setAlignment(button, Qt::AlignCenter); + button->show(); + } +} + +void StatusNotifierWidget::itemRemoved(const QString &serviceAndPath) +{ + StatusNotifierButton *button = mServices.value(serviceAndPath, NULL); + if (button) + { + button->deleteLater(); + layout()->removeWidget(button); + } +} + +void StatusNotifierWidget::realign() +{ + LxQt::GridLayout *layout = qobject_cast(this->layout()); + layout->setEnabled(false); + + ILxQtPanel *panel = mPlugin->panel(); + if (panel->isHorizontal()) + { + layout->setRowCount(panel->lineCount()); + layout->setColumnCount(0); + } + else + { + layout->setColumnCount(panel->lineCount()); + layout->setRowCount(0); + } + + layout->setEnabled(true); +} diff --git a/plugin-statusnotifier/statusnotifierwidget.h b/plugin-statusnotifier/statusnotifierwidget.h new file mode 100644 index 0000000..35e303a --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwidget.h @@ -0,0 +1,61 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWIDGET_H +#define STATUSNOTIFIERWIDGET_H + +#include + +#include + +#include "statusnotifierbutton.h" +#include "statusnotifierwatcher.h" + +class StatusNotifierWidget : public QWidget +{ + Q_OBJECT + +public: + StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent = 0); + +signals: + +public slots: + void itemAdded(QString serviceAndPath); + void itemRemoved(const QString &serviceAndPath); + + void realign(); + +private: + ILxQtPanelPlugin *mPlugin; + StatusNotifierWatcher *mWatcher; + + QHash mServices; +}; + +#endif // STATUSNOTIFIERWIDGET_H diff --git a/plugin-statusnotifier/translations/statusnotifier.ts b/plugin-statusnotifier/translations/statusnotifier.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugin-statusnotifier/translations/statusnotifier_de.desktop b/plugin-statusnotifier/translations/statusnotifier_de.desktop new file mode 100644 index 0000000..6f367a0 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Statusbenachrichtigungen +Comment[de]=Plugin für Statusbenachrichtigungen diff --git a/plugin-statusnotifier/translations/statusnotifier_ru.desktop b/plugin-statusnotifier/translations/statusnotifier_ru.desktop new file mode 100644 index 0000000..3b3766b --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Плагин уведомлений +Comment[ru]=Плагин уведомлений diff --git a/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop b/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop new file mode 100644 index 0000000..5c5fc79 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Плагин уведомлений +Comment[ru_RU]=Плагин уведомлений diff --git a/plugin-sysstat/CMakeLists.txt b/plugin-sysstat/CMakeLists.txt index 1634635..6cb28e6 100644 --- a/plugin-sysstat/CMakeLists.txt +++ b/plugin-sysstat/CMakeLists.txt @@ -16,18 +16,11 @@ set(SOURCES lxqtsysstatutils.cpp ) -set(MOCS - lxqtsysstat.h - lxqtsysstatconfiguration.h - lxqtsysstatcolours.h -) - set(UIS lxqtsysstatconfiguration.ui lxqtsysstatcolours.ui ) -set(LIBRARIES ${SYSSTAT_LIBRARIES}) -include_directories("${SYSSTAT_INCLUDE_DIRS}") +set(LIBRARIES sysstat-qt5) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-sysstat/lxqtsysstat.cpp b/plugin-sysstat/lxqtsysstat.cpp index 7febd34..ee6c020 100644 --- a/plugin-sysstat/lxqtsysstat.cpp +++ b/plugin-sysstat/lxqtsysstat.cpp @@ -37,6 +37,7 @@ #include #include #include +#include LxQtSysStat::LxQtSysStat(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), @@ -231,7 +232,7 @@ void LxQtSysStatContent::updateSettings(const QSettings *settings) mTitleLabel = settings->value("title/label", QString()).toString(); // default to CPU monitoring - mDataType = settings->value("data/type", QString("CPU")).toString(); + mDataType = settings->value("data/type", LxQtSysStatConfiguration::msStatTypes[0]).toString(); mDataSource = settings->value("data/source", QString("cpu")).toString(); @@ -300,7 +301,10 @@ void LxQtSysStatContent::updateSettings(const QSettings *settings) if (dataTypeChanged) { if (mStat) + { mStat->deleteLater(); + mStat = nullptr; + } if (mDataType == "CPU") mStat = new SysStat::CpuStat(this); @@ -384,11 +388,20 @@ void LxQtSysStatContent::clearLine() void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other, float frequencyRate, uint) { - int y_system = clamp(static_cast(system * 100.0 * frequencyRate) , 0, 99); - int y_user = clamp(static_cast(user * 100.0 * frequencyRate) + y_system, 0, 99); - int y_nice = clamp(static_cast(nice * 100.0 * frequencyRate) + y_user , 0, 99); - int y_other = clamp(static_cast(other * 100.0 * frequencyRate) + y_nice , 0, 99); - int y_freq = clamp(static_cast( 100.0 * frequencyRate) , 0, 99); + int y_system = static_cast(system * 100.0 * frequencyRate); + int y_user = static_cast(user * 100.0 * frequencyRate); + int y_nice = static_cast(nice * 100.0 * frequencyRate); + int y_other = static_cast(other * 100.0 * frequencyRate); + int y_freq = static_cast( 100.0 * frequencyRate); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: %5%", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other).arg(y_freq)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user , 0, 99); + y_other = clamp(y_other, 0, 99); + y_freq = clamp(y_freq, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -425,10 +438,18 @@ void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float o void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other) { - int y_system = clamp(static_cast(system * 100.0) , 0, 99); - int y_user = clamp(static_cast(user * 100.0) + y_system, 0, 99); - int y_nice = clamp(static_cast(nice * 100.0) + y_user , 0, 99); - int y_other = clamp(static_cast(other * 100.0) + y_nice , 0, 99); + int y_system = static_cast(system * 100.0); + int y_user = static_cast(user * 100.0); + int y_nice = static_cast(nice * 100.0); + int y_other = static_cast(other * 100.0); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: n/a", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user, 0, 99); + y_other = clamp(y_other + y_nice, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -460,9 +481,16 @@ void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float o void LxQtSysStatContent::memoryUpdate(float apps, float buffers, float cached) { - int y_apps = clamp(static_cast(apps * 100.0) , 0, 99); - int y_buffers = clamp(static_cast(buffers * 100.0) + y_apps , 0, 99); - int y_cached = clamp(static_cast(cached * 100.0) + y_buffers, 0, 99); + int y_apps = static_cast(apps * 100.0); + int y_buffers = static_cast(buffers * 100.0); + int y_cached = static_cast(cached * 100.0); + + toolTipInfo(tr("apps: %1%
buffers: %2%
cached: %3%", "Memory tooltip information") + .arg(y_apps).arg(y_buffers).arg(y_cached)); + + y_apps = clamp(y_apps, 0, 99); + y_buffers = clamp(y_buffers + y_apps, 0, 99); + y_cached = clamp(y_cached + y_buffers, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -489,7 +517,11 @@ void LxQtSysStatContent::memoryUpdate(float apps, float buffers, float cached) void LxQtSysStatContent::swapUpdate(float used) { - int y_used = clamp(static_cast(used * 100.0), 0, 99); + int y_used = static_cast(used * 100.0); + + toolTipInfo(tr("used: %1%", "Swap tooltip information").arg(y_used)); + + y_used = clamp(y_used, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -514,8 +546,13 @@ void LxQtSysStatContent::networkUpdate(unsigned received, unsigned transmitted) max_value = qLn(max_value * (mLogScaleMax - 1.0) + 1.0) / qLn(2.0) / static_cast(mLogScaleSteps); } - int y_min_value = clamp(static_cast(min_value * 100.0) , 0, 99); - int y_max_value = clamp(static_cast(max_value * 100.0) + y_min_value, 0, 99); + int y_min_value = static_cast(min_value * 100.0); + int y_max_value = static_cast(max_value * 100.0); + + toolTipInfo(tr("min: %1%
max: %2%", "Network tooltip information").arg(y_min_value).arg(y_max_value)); + + y_min_value = clamp(y_min_value, 0, 99); + y_max_value = clamp(y_max_value + y_min_value, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -580,3 +617,11 @@ void LxQtSysStatContent::paintEvent(QPaintEvent *event) p.drawLine(QPointF(0.0, y), QPointF(w, y)); } } + +void LxQtSysStatContent::toolTipInfo(QString const & tooltip) +{ + setToolTip(QStringLiteral("%1(%2)
%3") + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataType.toStdString().c_str())) + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataSource.toStdString().c_str())) + .arg(tooltip)); +} diff --git a/plugin-sysstat/lxqtsysstat.h b/plugin-sysstat/lxqtsysstat.h index d3ffaa7..6737fdb 100644 --- a/plugin-sysstat/lxqtsysstat.h +++ b/plugin-sysstat/lxqtsysstat.h @@ -143,7 +143,8 @@ protected slots: void swapUpdate(float used); void networkUpdate(unsigned received, unsigned transmitted); - +private: + void toolTipInfo(QString const & tooltip); private: ILxQtPanelPlugin *mPlugin; @@ -217,7 +218,7 @@ class LxQtSysStatLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtSysStat(startupInfo); } diff --git a/plugin-sysstat/lxqtsysstatcolours.cpp b/plugin-sysstat/lxqtsysstatcolours.cpp index 1db61d5..ce7cfbf 100644 --- a/plugin-sysstat/lxqtsysstatcolours.cpp +++ b/plugin-sysstat/lxqtsysstatcolours.cpp @@ -38,6 +38,7 @@ LxQtSysStatColours::LxQtSysStatColours(QWidget *parent) : ui(new Ui::LxQtSysStatColours), mSelectColourMapper(new QSignalMapper(this)) { + setWindowModality(Qt::WindowModal); ui->setupUi(this); mDefaultColours["grid"] = QColor("#808080"); diff --git a/plugin-sysstat/lxqtsysstatconfiguration.cpp b/plugin-sysstat/lxqtsysstatconfiguration.cpp index c6ca354..1723725 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.cpp +++ b/plugin-sysstat/lxqtsysstatconfiguration.cpp @@ -35,6 +35,52 @@ #include #include +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList LxQtSysStatConfiguration::msStatTypes = { + QStringLiteral(QT_TR_NOOP("CPU")) + , QStringLiteral(QT_TR_NOOP("Memory")) + , QStringLiteral(QT_TR_NOOP("Network")) +}; + +namespace +{ + //Note: workaround for making source strings translatable + // (no need to ever call this function) + void localizationWorkaround(); + auto t = localizationWorkaround;//avoid unused function warning + void localizationWorkaround() + { + const char * loc; + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu1"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu2"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu3"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu4"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu5"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu6"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu7"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu8"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu9"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu11"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu12"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu13"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu14"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu15"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu16"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu17"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu18"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu19"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu20"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu21"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu22"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu23"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu24"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "memory"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "swap"); + static_cast(t);//avoid unused variable warning + } +} LxQtSysStatConfiguration::LxQtSysStatConfiguration(QSettings *settings, QWidget *parent) : QDialog(parent), @@ -42,15 +88,27 @@ LxQtSysStatConfiguration::LxQtSysStatConfiguration(QSettings *settings, QWidget mSettings(settings), oldSettings(settings), mStat(NULL), - mLockSaving(false), mColoursDialog(NULL) { setAttribute(Qt::WA_DeleteOnClose); setObjectName("SysStatConfigurationWindow"); ui->setupUi(this); + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msStatTypes) + ui->typeCOB->addItem(tr(type.toStdString().c_str()), type); loadSettings(); + + connect(ui->typeCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->intervalSB, static_cast(&QDoubleSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->linesSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->titleLE, &QLineEdit::editingFinished, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useFrequencyCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->logarithmicCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sourceCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useThemeColoursRB, &QRadioButton::toggled, this, &LxQtSysStatConfiguration::saveSettings); } LxQtSysStatConfiguration::~LxQtSysStatConfiguration() @@ -60,8 +118,6 @@ LxQtSysStatConfiguration::~LxQtSysStatConfiguration() void LxQtSysStatConfiguration::loadSettings() { - mLockSaving = true; - ui->intervalSB->setValue(mSettings->value("graph/updateInterval", 1.0).toDouble()); ui->sizeSB->setValue(mSettings->value("graph/minimalSize", 30).toInt()); @@ -69,11 +125,11 @@ void LxQtSysStatConfiguration::loadSettings() ui->titleLE->setText(mSettings->value("title/label", QString()).toString()); - int typeIndex = ui->typeCOB->findText(mSettings->value("data/type", QString("CPU")).toString()); + int typeIndex = ui->typeCOB->findData(mSettings->value("data/type", msStatTypes[0])); ui->typeCOB->setCurrentIndex((typeIndex >= 0) ? typeIndex : 0); on_typeCOB_currentIndexChanged(ui->typeCOB->currentIndex()); - int sourceIndex = ui->sourceCOB->findText(mSettings->value("data/source", QString()).toString()); + int sourceIndex = ui->sourceCOB->findData(mSettings->value("data/source", QString())); ui->sourceCOB->setCurrentIndex((sourceIndex >= 0) ? sourceIndex : 0); ui->useFrequencyCB->setChecked(mSettings->value("cpu/useFrequency", true).toBool()); @@ -86,15 +142,10 @@ void LxQtSysStatConfiguration::loadSettings() ui->useThemeColoursRB->setChecked(useThemeColours); ui->useCustomColoursRB->setChecked(!useThemeColours); ui->customColoursB->setEnabled(!useThemeColours); - - mLockSaving = false; } void LxQtSysStatConfiguration::saveSettings() { - if (mLockSaving) - return; - mSettings->setValue("graph/useThemeColours", ui->useThemeColoursRB->isChecked()); mSettings->setValue("graph/updateInterval", ui->intervalSB->value()); mSettings->setValue("graph/minimalSize", ui->sizeSB->value()); @@ -103,8 +154,12 @@ void LxQtSysStatConfiguration::saveSettings() mSettings->setValue("title/label", ui->titleLE->text()); - mSettings->setValue("data/type", ui->typeCOB->currentText()); - mSettings->setValue("data/source", ui->sourceCOB->currentText()); + //Note: + // need to make a realy deep copy of the msStatTypes[x] because of SEGFAULTs + // occuring in static finalization time (don't know the real reason...maybe ordering of static finalizers/destructors) + QString type = ui->typeCOB->itemData(ui->typeCOB->currentIndex(), Qt::UserRole).toString().toStdString().c_str(); + mSettings->setValue("data/type", type); + mSettings->setValue("data/source", ui->sourceCOB->itemData(ui->sourceCOB->currentIndex(), Qt::UserRole)); mSettings->setValue("cpu/useFrequency", ui->useFrequencyCB->isChecked()); @@ -143,16 +198,17 @@ void LxQtSysStatConfiguration::on_typeCOB_currentIndexChanged(int index) break; } + ui->sourceCOB->blockSignals(true); ui->sourceCOB->clear(); - ui->sourceCOB->addItems(mStat->sources()); + for (auto const & s : mStat->sources()) + ui->sourceCOB->addItem(tr(s.toStdString().c_str()), s); + ui->sourceCOB->blockSignals(false); ui->sourceCOB->setCurrentIndex(0); } void LxQtSysStatConfiguration::on_maximumHS_valueChanged(int value) { - emit maximumNetSpeedChanged(PluginSysStat::netSpeedToString(value)); - - saveSettings(); + ui->maximumValueL->setText(PluginSysStat::netSpeedToString(value)); } void LxQtSysStatConfiguration::coloursChanged() diff --git a/plugin-sysstat/lxqtsysstatconfiguration.h b/plugin-sysstat/lxqtsysstatconfiguration.h index ef26b90..e804bfc 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.h +++ b/plugin-sysstat/lxqtsysstatconfiguration.h @@ -64,6 +64,9 @@ public slots: void coloursChanged(); +public: + static const QStringList msStatTypes; + signals: void maximumNetSpeedChanged(QString); @@ -76,8 +79,6 @@ private: SysStat::BaseStat *mStat; - bool mLockSaving; - LxQtSysStatColours *mColoursDialog; }; diff --git a/plugin-sysstat/lxqtsysstatconfiguration.ui b/plugin-sysstat/lxqtsysstatconfiguration.ui index b97878e..346872f 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.ui +++ b/plugin-sysstat/lxqtsysstatconfiguration.ui @@ -278,29 +278,7 @@ - - - 0 - - - 3 - - - - CPU - - - - - Memory - - - - - Network - - - + @@ -463,150 +441,6 @@ - - LxQtSysStatConfiguration - maximumNetSpeedChanged(QString) - maximumValueL - setText(QString) - - - 704 - 158 - - - 251 - 260 - - - - - intervalSB - valueChanged(double) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 57 - - - 392 - 82 - - - - - sizeSB - valueChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 84 - - - 387 - 117 - - - - - linesSB - valueChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 111 - - - 390 - 187 - - - - - titleLE - editingFinished() - LxQtSysStatConfiguration - saveSettings() - - - 386 - 138 - - - 386 - 290 - - - - - useFrequencyCB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 346 - 256 - - - 387 - 244 - - - - - logarithmicCB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 146 - 287 - - - 392 - 214 - - - - - sourceCOB - currentIndexChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 231 - - - 704 - 105 - - - - - typeCOB - currentIndexChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 203 - - - 704 - 52 - - - useCustomColoursRB toggled(bool) @@ -623,29 +457,5 @@ - - useThemeColoursRB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 32 - 337 - - - 2 - 335 - - - - - maximumNetSpeedChanged(QString) - on_typeCOB_currentIndexChanged(int) - on_sourceCOB_currentIndexChanged(int) - on_maximumHS_valueChanged(int) - saveSettings() - on_customColoursB_clicked() - diff --git a/plugin-sysstat/translations/sysstat_de.desktop b/plugin-sysstat/translations/sysstat_de.desktop new file mode 100644 index 0000000..b11a9a4 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Systemstatistiken +Comment[de]=Plugin zum Anzeigen von Systemstatistiken diff --git a/plugin-sysstat/translations/sysstat_de.ts b/plugin-sysstat/translations/sysstat_de.ts new file mode 100644 index 0000000..31ec36a --- /dev/null +++ b/plugin-sysstat/translations/sysstat_de.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Systemstatistik-Farben + + + + Graph + Graph + + + + &Grid + &Raster + + + + + + + + + + + + + + + + Change ... + ändern... + + + + T&itle + T&itel + + + + CPU + Prozessor + + + + &Nice + &Priorität + + + + Ot&her + A&ndere + + + + &Frequency + &Frequenz + + + + S&ystem + S&ystem + + + + &User + Ben&utzer + + + + Memory + Speicher + + + + Cache&d + Zwischenspei&cher + + + + S&wap + Ausge&lagert + + + + &Applications + &Anwendungen + + + + &Buffers + Puff&er + + + + Network + Netzwerk + + + + &Received + E&mpfangen + + + + &Transmitted + &Gesendet + + + + LxQtSysStatConfiguration + + + System Statistics Settings + Systemstatistik - Einstellungen + + + + Graph + Graph + + + + &Minimal size + &Mindestgröße + + + + Update &interval + Aktualisierungs&intervall + + + + &Title + &Titel + + + + &Grid lines + &Rasterlinien + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Mindestbreite bei horizontalem Panel.</p><p>Mindesthöhe bei vertikalem Panel.</p></body></html> + + + + px + px + + + + s + s + + + + Data + Daten + + + + Use &frequency + &Frequenz nutzen + + + + Ma&ximum + Ma&ximum + + + + XXX KBs + XXX KB/s + + + + Lo&garithmic scale + Lo&garithmische Skala + + + + steps + Schritte + + + + CPU + Prozessor + + + + Memory + Speicher + + + + Network + Netzwerk + + + + &Source + &Quelle + + + + T&ype + T&yp + + + + Colours + Farben + + + + Use t&heme colours + Farben des Farbsc&hemas + + + + Use c&ustom colours + &Eigene Farben + + + + Custom colour ... + auswählen... + + + diff --git a/plugin-sysstat/translations/sysstat_hu.desktop b/plugin-sysstat/translations/sysstat_hu.desktop new file mode 100644 index 0000000..d5211b8 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Rendszerstatisztika +Comment[pt]=Infó a rendszerállapotról diff --git a/plugin-sysstat/translations/sysstat_hu.ts b/plugin-sysstat/translations/sysstat_hu.ts new file mode 100644 index 0000000..1d07a6b --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/plugin-sysstat/translations/sysstat_hu_HU.ts b/plugin-sysstat/translations/sysstat_hu_HU.ts new file mode 100644 index 0000000..49bf4d9 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu_HU.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/plugin-sysstat/translations/sysstat_pt.ts b/plugin-sysstat/translations/sysstat_pt.ts index dde326d..ae23b37 100644 --- a/plugin-sysstat/translations/sysstat_pt.ts +++ b/plugin-sysstat/translations/sysstat_pt.ts @@ -1,6 +1,6 @@ - + LxQtSysStatColours @@ -115,7 +115,7 @@ LxQtSysStatConfiguration LxQt SysStat Settings - Definições do LxQt SysStat + Definições do LxQt SysStat @@ -124,11 +124,11 @@ Update interval - Intervalo de atualização + Intervalo de atualização Minimal size - Tamanho mínimo + Tamanho mínimo @@ -142,31 +142,31 @@ Grid - Grelha + Grelha Lines - Linhas + Linhas Colour - Cor + Cor Change ... - Mudar... + Mudar... Title - Título + Título Label - Etiqueta + Etiqueta Font - Tipo de letra + Tipo de letra @@ -175,7 +175,7 @@ Type - Tipo + Tipo @@ -269,59 +269,59 @@ Source - Fonte + Fonte System - Sistema + Sistema User - Utilizador + Utilizador Nice - Aceitável + Aceitável Other - Outras + Outras Use Frequency - Utilizar frequência + Utilizar frequência Frequency - Frequência + Frequência Applications - Aplicações + Aplicações Buffers - Buffers + Buffers Cached - Cache + Cache Used - Utilizado + Utilizado Received - Recebido + Recebido Transmitted - Enviado + Enviado Maximum - Máximo + Máximo @@ -330,7 +330,7 @@ Logarithmic scale - Escala logarítmica + Escala logarítmica @@ -339,31 +339,31 @@ Ultra light - Ultra claro + Ultra claro Light - Claro + Claro Ultra black - Ultra escuro + Ultra escuro Black - Escuro + Escuro Bold - Negrito + Negrito Demi bold - Semi-negrito + Semi-negrito Italic - Itálico + Itálico diff --git a/plugin-taskbar/CMakeLists.txt b/plugin-taskbar/CMakeLists.txt index 7712eb3..3e646cc 100644 --- a/plugin-taskbar/CMakeLists.txt +++ b/plugin-taskbar/CMakeLists.txt @@ -5,6 +5,8 @@ set(HEADERS lxqttaskbutton.h lxqttaskbarconfiguration.h lxqttaskbarplugin.h + lxqttaskgroup.h + lxqtgrouppopup.h ) set(SOURCES @@ -12,13 +14,8 @@ set(SOURCES lxqttaskbutton.cpp lxqttaskbarconfiguration.cpp lxqttaskbarplugin.cpp -) - -set(MOCS - lxqttaskbar.h - lxqttaskbutton.h - lxqttaskbarconfiguration.h - lxqttaskbarplugin.h + lxqttaskgroup.cpp + lxqtgrouppopup.cpp ) set(UIS @@ -26,8 +23,8 @@ set(UIS ) set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt + Qt5Xdg ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-taskbar/lxqtgrouppopup.cpp b/plugin-taskbar/lxqtgrouppopup.cpp new file mode 100644 index 0000000..55eda7a --- /dev/null +++ b/plugin-taskbar/lxqtgrouppopup.cpp @@ -0,0 +1,171 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtgrouppopup.h" +#include +#include +#include +#include +#include + +/************************************************ + this class is just a container of window buttons + the main purpose is showing window buttons in + vertical layout and drag&drop feature inside + group + ************************************************/ +LxQtGroupPopup::LxQtGroupPopup(LxQtTaskGroup *group): + QFrame(group), + mGroup(group) +{ + Q_ASSERT(group); + setAcceptDrops(true); + setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); + setAttribute(Qt::WA_AlwaysShowToolTips); + + setLayout(new QVBoxLayout); + layout()->setSpacing(3); + layout()->setMargin(3); + + connect(&mCloseTimer, &QTimer::timeout, this, &LxQtGroupPopup::closeTimerSlot); + mCloseTimer.setSingleShot(true); + mCloseTimer.setInterval(400); +} + +LxQtGroupPopup::~LxQtGroupPopup() +{ +} + +void LxQtGroupPopup::dropEvent(QDropEvent *event) +{ + qlonglong temp; + WId window; + QDataStream stream(event->mimeData()->data(LxQtTaskButton::mimeDataFormat())); + stream >> temp; + window = (WId) temp; + + LxQtTaskButton *button; + int oldIndex(0); + // get current position of the button being dragged + for (int i = 0; i < layout()->count(); i++) + { + LxQtTaskButton *b = qobject_cast(layout()->itemAt(i)->widget()); + if (b && b->windowId() == window) + { + button = b; + oldIndex = i; + break; + } + } + + int newIndex = -1; + // find the new position to place it in + for (int i = 0; i < oldIndex && newIndex == -1; i++) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 > event->pos().y()) + newIndex = i; + } + const int size = layout()->count(); + for (int i = size - 1; i > oldIndex && newIndex == -1; i--) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 < event->pos().y()) + newIndex = i; + } + + if (newIndex == -1 || newIndex == oldIndex) + return; + + QVBoxLayout * l = qobject_cast(layout()); + l->takeAt(oldIndex); + l->insertWidget(newIndex, button); + l->invalidate(); +} + +void LxQtGroupPopup::dragEnterEvent(QDragEnterEvent *event) +{ + event->accept(); + QWidget::dragEnterEvent(event); +} + +void LxQtGroupPopup::dragLeaveEvent(QDragLeaveEvent *event) +{ + hide(false/*not fast*/); + QFrame::dragLeaveEvent(event); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::leaveEvent(QEvent *event) +{ + mCloseTimer.start(); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::enterEvent(QEvent *event) +{ + mCloseTimer.stop(); +} + +void LxQtGroupPopup::hide(bool fast) +{ + if (fast) + close(); + else + mCloseTimer.start(); +} + +void LxQtGroupPopup::show() +{ + mCloseTimer.stop(); + QFrame::show(); +} + +void LxQtGroupPopup::closeTimerSlot() +{ + bool button_has_dnd_hover = false; + QLayout* l = layout(); + for (int i = 0; l->count() > i; ++i) + { + LxQtTaskButton const * const button = dynamic_cast(l->itemAt(i)->widget()); + if (0 != button && button->hasDragAndDropHover()) + { + button_has_dnd_hover = true; + break; + } + } + if (!button_has_dnd_hover) + close(); +} diff --git a/plugin-taskbar/lxqtgrouppopup.h b/plugin-taskbar/lxqtgrouppopup.h new file mode 100644 index 0000000..67f2d7d --- /dev/null +++ b/plugin-taskbar/lxqtgrouppopup.h @@ -0,0 +1,78 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKPOPUP_H +#define LXQTTASKPOPUP_H + +#include +#include +#include +#include +#include + +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +class LxQtGroupPopup: public QFrame +{ + Q_OBJECT + +public: + LxQtGroupPopup(LxQtTaskGroup *group); + ~LxQtGroupPopup(); + + void hide(bool fast = false); + void show(); + + // Layout + int indexOf(LxQtTaskButton *button) { return layout()->indexOf(button); } + int count() { return layout()->count(); } + QLayoutItem * itemAt(int i) { return layout()->itemAt(i); } + int spacing() { return layout()->spacing(); } + void addButton(LxQtTaskButton* button) { layout()->addWidget(button); } + void removeWidget(QWidget *button) { layout()->removeWidget(button); } + +protected: + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent *event); + void dropEvent(QDropEvent * event); + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + + void closeTimerSlot(); + +private: + LxQtTaskGroup *mGroup; + QTimer mCloseTimer; +}; + +#endif // LXQTTASKPOPUP_H diff --git a/plugin-taskbar/lxqttaskbar.cpp b/plugin-taskbar/lxqttaskbar.cpp index 542e066..06cd032 100644 --- a/plugin-taskbar/lxqttaskbar.cpp +++ b/plugin-taskbar/lxqttaskbar.cpp @@ -33,20 +33,19 @@ #include #include #include - -#include -#include #include #include -#include #include #include #include #include +#include + +#include +#include #include "lxqttaskbar.h" -#include "lxqttaskbutton.h" -#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskgroup.h" using namespace LxQt; @@ -56,33 +55,36 @@ using namespace LxQt; LxQtTaskBar::LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget *parent) : QFrame(parent), mButtonStyle(Qt::ToolButtonTextBesideIcon), - mCheckedBtn(NULL), mCloseOnMiddleClick(true), - mShowOnlyCurrentDesktopTasks(false), + mRaiseOnCurrentDesktop(true), + mShowOnlyOneDesktopTasks(false), + mShowDesktopNum(0), + mShowOnlyCurrentScreenTasks(false), + mShowOnlyMinimizedTasks(false), mAutoRotate(true), + mShowGroupOnHover(true), mPlugin(plugin), mPlaceHolder(new QWidget(this)), - mStyle(new ElidedButtonStyle()) + mStyle(new LeftAlignedTextStyle()) { + setStyle(mStyle); mLayout = new LxQt::GridLayout(this); setLayout(mLayout); mLayout->setMargin(0); + mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); realign(); - mPlaceHolder->setStyle(mStyle); mPlaceHolder->setMinimumSize(1, 1); mPlaceHolder->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); mPlaceHolder->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); mLayout->addWidget(mPlaceHolder); - settingsChanged(); + QTimer::singleShot(0, this, SLOT(settingsChanged())); setAcceptDrops(true); connect(KWindowSystem::self(), SIGNAL(stackingOrderChanged()), SLOT(refreshTaskList())); - connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), SLOT(refreshTaskList())); - connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId))); - connect(KWindowSystem::self(), SIGNAL(windowChanged(WId, NET::Properties, NET::Properties2)), - SLOT(windowChanged(WId, NET::Properties, NET::Properties2))); + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged) + , this, &LxQtTaskBar::onWindowChanged); } /************************************************ @@ -93,31 +95,6 @@ LxQtTaskBar::~LxQtTaskBar() delete mStyle; } -/************************************************ - - ************************************************/ -LxQtTaskButton* LxQtTaskBar::buttonByWindow(WId window) const -{ - if (mButtonsHash.contains(window)) - return mButtonsHash.value(window); - return 0; -} - -/************************************************ - - ************************************************/ -bool LxQtTaskBar::windowOnActiveDesktop(WId window) const -{ - if (!mShowOnlyCurrentDesktopTasks) - return true; - - int desktop = KWindowInfo(window, NET::WMDesktop).desktop(); - if (desktop == NET::OnAllDesktops) - return true; - - return desktop == KWindowSystem::currentDesktop(); -} - /************************************************ ************************************************/ @@ -162,7 +139,7 @@ bool LxQtTaskBar::acceptWindow(WId window) const ************************************************/ void LxQtTaskBar::dragEnterEvent(QDragEnterEvent* event) { - if (event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) event->acceptProposedAction(); else event->ignore(); @@ -174,32 +151,50 @@ void LxQtTaskBar::dragEnterEvent(QDragEnterEvent* event) ************************************************/ void LxQtTaskBar::dropEvent(QDropEvent* event) { - if (!event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (!event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) + { + event->ignore(); return; + } - QDataStream stream(event->mimeData()->data("lxqt/lxqttaskbutton")); - // window id for dropped button - qlonglong temp; - stream >> temp; - WId droppedWid = (WId) temp; - qDebug() << QString("Dropped window: %1").arg(droppedWid); + QString data; + QDataStream stream(event->mimeData()->data(LxQtTaskGroup::mimeDataFormat())); + stream >> data; - int droppedIndex = mLayout->indexOf(mButtonsHash[droppedWid]); + LxQtTaskGroup *group = mGroupsHash.value(data, NULL); + if (!group) + { + qDebug() << "Dropped invalid"; + return; + } + + int droppedIndex = mLayout->indexOf(group); int newPos = -1; const int size = mLayout->count(); - for (int i = 0; i < droppedIndex && newPos == -1; i++) - if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) - newPos = i; + if (mPlugin->panel()->isHorizontal()) + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) + newPos = i; - for (int i = size - 1; i > droppedIndex && newPos == -1; i--) - if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x()) - newPos = i; + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x()) + newPos = i; + } + else + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 > event->pos().y()) + newPos = i; + + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 < event->pos().y()) + newPos = i; + } if (newPos == -1 || droppedIndex == newPos) return; - qDebug() << QString("Dropped button shoud go to position %1").arg(newPos); - mLayout->moveItem(droppedIndex, newPos); mLayout->invalidate(); @@ -209,42 +204,78 @@ void LxQtTaskBar::dropEvent(QDropEvent* event) /************************************************ ************************************************/ +void LxQtTaskBar::groupBecomeEmptySlot() +{ + //group now contains no buttons - clean up in hash and delete the group + LxQtTaskGroup *group = qobject_cast(sender()); + Q_ASSERT(group); + + mGroupsHash.erase(mGroupsHash.find(group->groupName())); + group->deleteLater(); +} + +/************************************************ + + ************************************************/ + +void LxQtTaskBar::addWindow(WId window, QString const & groupId) +{ + LxQtTaskGroup *group = mGroupsHash.value(groupId); + + if (!group) + { + group = new LxQtTaskGroup(groupId, KWindowSystem::icon(window), mPlugin, this); + connect(group, SIGNAL(groupBecomeEmpty(QString)), this, SLOT(groupBecomeEmptySlot())); + connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility())); + connect(group, &LxQtTaskGroup::popupShown, this, &LxQtTaskBar::groupPopupShown); + connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList())); + + mLayout->addWidget(group); + mGroupsHash.insert(groupId, group); + group->setToolButtonsStyle(mButtonStyle); + } + group->addWindow(window); +} +/************************************************ + + ************************************************/ + void LxQtTaskBar::refreshTaskList() { + // Just add new windows to groups, deleting is up to the groups QList tmp = KWindowSystem::stackingOrder(); - QMutableHashIterator i(mButtonsHash); - while (i.hasNext()) + Q_FOREACH (WId wnd, tmp) { - i.next(); - int n = tmp.removeAll(i.key()); - - if (!n) + if (acceptWindow(wnd)) { - // if the button we're removing is the currently selected app - if(i.value() == mCheckedBtn) - mCheckedBtn = NULL; - delete i.value(); - i.remove(); + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(wnd, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(wnd); + addWindow(wnd, id); } } - foreach (WId wnd, tmp) + refreshPlaceholderVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(window, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(window); + LxQtTaskGroup *group = mGroupsHash.value(id); + + bool consumed{false}; + if (nullptr != group) { - if (acceptWindow(wnd)) - { - LxQtTaskButton* btn = new LxQtTaskButton(wnd, this); - btn->setStyle(mStyle); - btn->setToolButtonStyle(mButtonStyle); + consumed = group->onWindowChanged(window, prop, prop2); - mButtonsHash.insert(wnd, btn); - mLayout->addWidget(btn); - } } - refreshButtonVisibility(); - mLayout->invalidate(); - activeWindowChanged(); - realign(); + + if (!consumed && acceptWindow(window)) + addWindow(window, id); } /************************************************ @@ -255,28 +286,27 @@ void LxQtTaskBar::refreshButtonRotation() bool autoRotate = mAutoRotate && (mButtonStyle != Qt::ToolButtonIconOnly); ILxQtPanel::Position panelPosition = mPlugin->panel()->position(); - - QHashIterator i(mButtonsHash); - while (i.hasNext()) + QHashIterator j(mGroupsHash); + while(j.hasNext()) { - i.next(); - i.value()->setAutoRotation(autoRotate, panelPosition); + j.next(); + j.value()->setAutoRotation(autoRotate,panelPosition); } } + /************************************************ ************************************************/ - -void LxQtTaskBar::refreshButtonVisibility() +void LxQtTaskBar::refreshPlaceholderVisibility() { + // if no visible group button show placeholder widget bool haveVisibleWindow = false; - QHashIterator i(mButtonsHash); - while (i.hasNext()) + QHashIterator j(mGroupsHash); + while (j.hasNext()) { - i.next(); - bool isVisible = windowOnActiveDesktop(i.key()); - haveVisibleWindow |= isVisible; - i.value()->setVisible(isVisible); + j.next(); + if (j.value()->isVisible()) + haveVisibleWindow = true; } mPlaceHolder->setVisible(!haveVisibleWindow); if (haveVisibleWindow) @@ -294,83 +324,14 @@ void LxQtTaskBar::refreshButtonVisibility() ************************************************/ void LxQtTaskBar::refreshIconGeometry() { - // FIXME: sometimes we get wrong globalPos here, especially - // after changing the pos or size of the panel. - // this might be caused by bugs in lxqtpanel.cpp. - QHashIterator i(mButtonsHash); + QHashIterator i(mGroupsHash); while (i.hasNext()) { i.next(); - LxQtTaskButton* button = i.value(); - QRect rect = button->geometry(); - QPoint globalPos = mapToGlobal(button->pos()); - rect.moveTo(globalPos); - - NETWinInfo info(QX11Info::connection(), button->windowId(), - (WId) QX11Info::appRootWindow(), NET::WMIconGeometry, 0); - NETRect nrect; - nrect.pos.x = rect.x(); - nrect.pos.y = rect.y(); - nrect.size.height = rect.height(); - nrect.size.width = rect.width(); - info.setIconGeometry(nrect); + i.value()->refreshIconsGeometry(); } } -/************************************************ - - ************************************************/ -void LxQtTaskBar::activeWindowChanged(WId window) -{ - if (!window) - window = KWindowSystem::activeWindow(); - - LxQtTaskButton* btn = buttonByWindow(window); - - if (mCheckedBtn != btn) - { - if (mCheckedBtn) - mCheckedBtn->setChecked(false); - if (btn) - { - btn->setChecked(true); - if (btn->hasUrgencyHint()) - btn->setUrgencyHint(false); - } - mCheckedBtn = btn; - } -} - -/************************************************ - - ************************************************/ -void LxQtTaskBar::windowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) -{ - LxQtTaskButton* button = buttonByWindow(window); - if (!button) - return; - - // window changed virtual desktop - if (prop.testFlag(NET::WMDesktop)) - { - if (mShowOnlyCurrentDesktopTasks) - { - int desktop = button->desktopNum(); - button->setHidden(desktop != NET::OnAllDesktops && desktop != KWindowSystem::currentDesktop()); - } - } - - if (prop.testFlag(NET::WMVisibleName) || prop.testFlag(NET::WMName)) - button->updateText(); - - // FIXME: NET::WMIconGeometry is causing high CPU and memory usage - if (prop.testFlag(NET::WMIcon) /*|| prop.testFlag(NET::WMIconGeometry)*/) - button->updateIcon(); - - if (prop.testFlag(NET::WMState)) - button->setUrgencyHint(KWindowInfo(window, NET::WMState).hasState(NET::DemandsAttention)); -} - /************************************************ ************************************************/ @@ -378,11 +339,11 @@ void LxQtTaskBar::setButtonStyle(Qt::ToolButtonStyle buttonStyle) { mButtonStyle = buttonStyle; - QHashIterator i(mButtonsHash); + QHashIterator i(mGroupsHash); while (i.hasNext()) { i.next(); - i.value()->setToolButtonStyle(mButtonStyle); + i.value()->setToolButtonsStyle(buttonStyle); } } @@ -391,7 +352,14 @@ void LxQtTaskBar::setButtonStyle(Qt::ToolButtonStyle buttonStyle) ************************************************/ void LxQtTaskBar::settingsChanged() { + bool groupingEnabledOld = mGroupingEnabled; + bool showOnlyOneDesktopTasksOld = mShowOnlyOneDesktopTasks; + const int showDesktopNumOld = mShowDesktopNum; + bool showOnlyCurrentScreenTasksOld = mShowOnlyCurrentScreenTasks; + bool showOnlyMinimizedTasksOld = mShowOnlyMinimizedTasks; + mButtonWidth = mPlugin->settings()->value("buttonWidth", 400).toInt(); + mButtonHeight = mPlugin->settings()->value("buttonHeight", 100).toInt(); QString s = mPlugin->settings()->value("buttonStyle").toString().toUpper(); if (s == "ICON") @@ -401,9 +369,34 @@ void LxQtTaskBar::settingsChanged() else setButtonStyle(Qt::ToolButtonTextBesideIcon); - mShowOnlyCurrentDesktopTasks = mPlugin->settings()->value("showOnlyCurrentDesktopTasks", mShowOnlyCurrentDesktopTasks).toBool(); + mShowOnlyOneDesktopTasks = mPlugin->settings()->value("showOnlyOneDesktopTasks", mShowOnlyOneDesktopTasks).toBool(); + mShowDesktopNum = mPlugin->settings()->value("showDesktopNum", mShowDesktopNum).toInt(); + mShowOnlyCurrentScreenTasks = mPlugin->settings()->value("showOnlyCurrentScreenTasks", mShowOnlyCurrentScreenTasks).toBool(); + mShowOnlyMinimizedTasks = mPlugin->settings()->value("showOnlyMinimizedTasks", mShowOnlyMinimizedTasks).toBool(); mAutoRotate = mPlugin->settings()->value("autoRotate", true).toBool(); mCloseOnMiddleClick = mPlugin->settings()->value("closeOnMiddleClick", true).toBool(); + mRaiseOnCurrentDesktop = mPlugin->settings()->value("raiseOnCurrentDesktop", false).toBool(); + mGroupingEnabled = mPlugin->settings()->value("groupingEnabled",true).toBool(); + mShowGroupOnHover = mPlugin->settings()->value("showGroupOnHover",true).toBool(); + + // Delete all groups if grouping feature toggled and start over + if (groupingEnabledOld != mGroupingEnabled) + { + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash.values()) + { + mLayout->removeWidget(group); + group->deleteLater(); + } + mGroupsHash.clear(); + } + + if (showOnlyOneDesktopTasksOld != mShowOnlyOneDesktopTasks + || (mShowOnlyOneDesktopTasks && showDesktopNumOld != mShowDesktopNum) + || showOnlyCurrentScreenTasksOld != mShowOnlyCurrentScreenTasks + || showOnlyMinimizedTasksOld != mShowOnlyMinimizedTasks + ) + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); refreshTaskList(); } @@ -414,134 +407,56 @@ void LxQtTaskBar::settingsChanged() void LxQtTaskBar::realign() { mLayout->setEnabled(false); - refreshButtonRotation(); ILxQtPanel *panel = mPlugin->panel(); - QSize maxSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + QSize maxSize = QSize(mButtonWidth, mButtonHeight); QSize minSize = QSize(0, 0); bool rotated = false; + if (panel->isHorizontal()) { - if (mButtonStyle == Qt::ToolButtonIconOnly) - { - // Horizontal + Icons ************** - mLayout->setRowCount(panel->lineCount()); - mLayout->setColumnCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = mButtonWidth; - } - else - { - // Horizontal + Text *************** - mLayout->setRowCount(panel->lineCount()); - mLayout->setColumnCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = mButtonWidth; - } + mLayout->setRowCount(panel->lineCount()); + mLayout->setColumnCount(0); } else { + mLayout->setRowCount(0); + if (mButtonStyle == Qt::ToolButtonIconOnly) { - // Vertical + Icons **************** - mLayout->setRowCount(0); + // Vertical + Icons mLayout->setColumnCount(panel->lineCount()); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = QWIDGETSIZE_MAX; - } else { - if (mAutoRotate) - { - switch (panel->position()) - { - case ILxQtPanel::PositionLeft: - case ILxQtPanel::PositionRight: - rotated = true; - break; - - default:; - } - } + rotated = mAutoRotate && (panel->position() == ILxQtPanel::PositionLeft || panel->position() == ILxQtPanel::PositionRight); - // Vertical + Text ***************** + // Vertical + Text if (rotated) { - mLayout->setColumnCount(panel->lineCount()); - mLayout->setRowCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - + maxSize.rwidth() = mButtonHeight; maxSize.rheight() = mButtonWidth; - maxSize.rwidth() = QWIDGETSIZE_MAX; + + mLayout->setColumnCount(panel->lineCount()); } else { mLayout->setColumnCount(1); - mLayout->setRowCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal); - - minSize.rheight() = 0; - minSize.rwidth() = mButtonWidth; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = QWIDGETSIZE_MAX; } } } mLayout->setCellMinimumSize(minSize); mLayout->setCellMaximumSize(maxSize); - mLayout->setDirection(rotated ? LxQt::GridLayout::TopToBottom : LxQt::GridLayout::LeftToRight); mLayout->setEnabled(true); - refreshIconGeometry(); -} - -/************************************************ - - ************************************************/ -void LxQtTaskBar::mousePressEvent(QMouseEvent *event) -{ - // close the app on mouse middle click - if (mCloseOnMiddleClick && event->button() == Qt::MidButton) - { - // find the button at current cursor pos - QHashIterator i(mButtonsHash); - while (i.hasNext()) - { - i.next(); - LxQtTaskButton* btn = i.value(); - if (btn->geometry().contains(event->pos()) && - (!mShowOnlyCurrentDesktopTasks || KWindowSystem::currentDesktop() == KWindowInfo(i.key(), NET::WMDesktop).desktop())) - { - btn->closeApplication(); - break; - } - } - } - QFrame::mousePressEvent(event); + //our placement on screen could have been changed + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); + refreshIconGeometry(); } /************************************************ @@ -549,26 +464,47 @@ void LxQtTaskBar::mousePressEvent(QMouseEvent *event) ************************************************/ void LxQtTaskBar::wheelEvent(QWheelEvent* event) { - if (!mCheckedBtn) - return; - - int current = mLayout->indexOf(mCheckedBtn); - if (current == -1) + static int threshold = 0; + threshold += abs(event->delta()); + if (threshold < 300) return; + else + threshold = 0; int delta = event->delta() < 0 ? 1 : -1; - for (int ix = current + delta; 0 <= ix && ix < mLayout->count(); ix += delta) + + // create temporary list of visible groups in the same order like on the layout + QList list; + LxQtTaskGroup *group = NULL; + for (int i = 0; i < mLayout->count(); i++) { - QLayoutItem *item = mLayout->itemAt(ix); - if (!item) + QWidget * o = mLayout->itemAt(i)->widget(); + LxQtTaskGroup * g = qobject_cast(o); + if (!g) continue; - WId window = ((LxQtTaskButton *) item->widget())->windowId(); - if (acceptWindow(window) && windowOnActiveDesktop(window)) - { - KWindowSystem::activateWindow(window); - break; - } + if (g->isVisible()) + list.append(g); + if (g->isChecked()) + group = g; + } + + if (list.isEmpty()) + return; + + if (!group) + group = list.at(0); + + LxQtTaskButton *button = NULL; + + // switching between groups from temporary list in modulo addressing + while (!button) + { + button = group->getNextPrevChildButton(delta == 1, !(list.count() - 1)); + if (button) + button->raiseApplication(); + int idx = (list.indexOf(group) + delta + list.count()) % list.count(); + group = list.at(idx); } } @@ -593,3 +529,13 @@ void LxQtTaskBar::changeEvent(QEvent* event) QFrame::changeEvent(event); } + +void LxQtTaskBar::groupPopupShown(LxQtTaskGroup * const sender) +{ + //close all popups (should they be visible because of close delay) + for (auto group : mGroupsHash) + { + if (group->isVisible() && sender != group) + group->setPopupVisible(false, true/*fast*/); + } +} diff --git a/plugin-taskbar/lxqttaskbar.h b/plugin-taskbar/lxqttaskbar.h index 675284e..e672051 100644 --- a/plugin-taskbar/lxqttaskbar.h +++ b/plugin-taskbar/lxqttaskbar.h @@ -33,18 +33,22 @@ #ifndef LXQTTASKBAR_H #define LXQTTASKBAR_H +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" #include "lxqttaskbarconfiguration.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbutton.h" + #include #include #include #include "../panel/ilxqtpanel.h" -#include -#include -#include +#include +#include +#include class LxQtTaskButton; class ElidedButtonStyle; -class ILxQtPanelPlugin; namespace LxQt { class GridLayout; @@ -58,46 +62,68 @@ public: explicit LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget* parent = 0); virtual ~LxQtTaskBar(); - virtual void settingsChanged(); void realign(); + Qt::ToolButtonStyle buttonStyle() const { return mButtonStyle; } + int buttonWidth() const { return mButtonWidth; } + bool closeOnMiddleClick() const { return mCloseOnMiddleClick; } + bool raiseOnCurrentDesktop() const { return mRaiseOnCurrentDesktop; } + bool isShowOnlyOneDesktopTasks() const { return mShowOnlyOneDesktopTasks; } + int showDesktopNum() const { return mShowDesktopNum; } + bool isShowOnlyCurrentScreenTasks() const { return mShowOnlyCurrentScreenTasks; } + bool isShowOnlyMinimizedTasks() const { return mShowOnlyMinimizedTasks; } + bool isAutoRotate() const { return mAutoRotate; } + bool isGroupingEnabled() const { return mGroupingEnabled; } + bool isShowGroupOnHover() const { return mShowGroupOnHover; } + ILxQtPanel * panel() const { return mPlugin->panel(); } + public slots: - void windowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); - void activeWindowChanged(WId window = 0); - void refreshIconGeometry(); + void settingsChanged(); protected: virtual void dragEnterEvent(QDragEnterEvent * event); virtual void dropEvent(QDropEvent * event); private slots: + void refreshIconGeometry(); void refreshTaskList(); void refreshButtonRotation(); - void refreshButtonVisibility(); + void refreshPlaceholderVisibility(); + void groupBecomeEmptySlot(); + void groupPopupShown(LxQtTaskGroup * const sender); + void onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + +private: + void addWindow(WId window, QString const & groupId); private: - QHash mButtonsHash; + QHash mGroupsHash; LxQt::GridLayout *mLayout; + + // Settings Qt::ToolButtonStyle mButtonStyle; int mButtonWidth; - LxQtTaskButton* mCheckedBtn; + int mButtonHeight; bool mCloseOnMiddleClick; - bool mShowOnlyCurrentDesktopTasks; + bool mRaiseOnCurrentDesktop; + bool mShowOnlyOneDesktopTasks; + int mShowDesktopNum; + bool mShowOnlyCurrentScreenTasks; + bool mShowOnlyMinimizedTasks; bool mAutoRotate; + bool mGroupingEnabled; + bool mShowGroupOnHover; - LxQtTaskButton* buttonByWindow(WId window) const; - bool windowOnActiveDesktop(WId window) const; bool acceptWindow(WId window) const; void setButtonStyle(Qt::ToolButtonStyle buttonStyle); void wheelEvent(QWheelEvent* event); void changeEvent(QEvent* event); - void mousePressEvent(QMouseEvent *event); void resizeEvent(QResizeEvent *event); ILxQtPanelPlugin *mPlugin; QWidget *mPlaceHolder; - ElidedButtonStyle* mStyle; + LeftAlignedTextStyle *mStyle; }; #endif // LXQTTASKBAR_H diff --git a/plugin-taskbar/lxqttaskbarconfiguration.cpp b/plugin-taskbar/lxqttaskbarconfiguration.cpp index c849a25..23f90af 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.cpp +++ b/plugin-taskbar/lxqttaskbarconfiguration.cpp @@ -30,6 +30,7 @@ #include "lxqttaskbarconfiguration.h" #include "ui_lxqttaskbarconfiguration.h" +#include LxQtTaskbarConfiguration::LxQtTaskbarConfiguration(QSettings &settings, QWidget *parent): QDialog(parent), @@ -47,16 +48,29 @@ LxQtTaskbarConfiguration::LxQtTaskbarConfiguration(QSettings &settings, QWidget ui->buttonStyleCB->addItem(tr("Only icon"), "Icon"); ui->buttonStyleCB->addItem(tr("Only text"), "Text"); + ui->showDesktopNumCB->addItem(tr("Current"), 0); + //Note: in KWindowSystem desktops are numbered from 1..N + const int desk_cnt = KWindowSystem::numberOfDesktops(); + for (int i = 1; desk_cnt >= i; ++i) + ui->showDesktopNumCB->addItem(QStringLiteral("%1 - %2").arg(i).arg(KWindowSystem::desktopName(i)), i); + loadSettings(); + /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly change of state */ - connect(ui->fAllDesktopsCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->fCurrentDesktopRB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->buttonStyleCB, SIGNAL(activated(int)), this, SLOT(updateControls(int))); + connect(ui->limitByDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByDesktopCB, &QCheckBox::stateChanged, ui->showDesktopNumCB, &QWidget::setEnabled); + connect(ui->showDesktopNumCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); + connect(ui->limitByScreenCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByMinimizedCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->raiseOnCurrentDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); connect(ui->buttonStyleCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); connect(ui->buttonWidthSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->buttonHeightSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); connect(ui->autoRotateCB, SIGNAL(clicked()), this, SLOT(saveSettings())); connect(ui->middleClickCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->groupingGB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->showGroupOnHoverCB, SIGNAL(clicked()), this, SLOT(saveSettings())); } LxQtTaskbarConfiguration::~LxQtTaskbarConfiguration() @@ -66,45 +80,37 @@ LxQtTaskbarConfiguration::~LxQtTaskbarConfiguration() void LxQtTaskbarConfiguration::loadSettings() { - if (mSettings.value("showOnlyCurrentDesktopTasks", false).toBool() == true) - { - ui->fCurrentDesktopRB->setChecked(true); - } - else - { - ui->fAllDesktopsCB->setChecked(true); - } + const bool showOnlyOneDesktopTasks = mSettings.value("showOnlyOneDesktopTasks", false).toBool(); + ui->limitByDesktopCB->setChecked(showOnlyOneDesktopTasks); + ui->showDesktopNumCB->setCurrentIndex(ui->showDesktopNumCB->findData(mSettings.value("showDesktopNum", 0).toInt())); + ui->showDesktopNumCB->setEnabled(showOnlyOneDesktopTasks); + ui->limitByScreenCB->setChecked(mSettings.value("showOnlyCurrentScreenTasks", false).toBool()); + ui->limitByMinimizedCB->setChecked(mSettings.value("showOnlyMinimizedTasks", false).toBool()); ui->autoRotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); ui->middleClickCB->setChecked(mSettings.value("closeOnMiddleClick", true).toBool()); + ui->raiseOnCurrentDesktopCB->setChecked(mSettings.value("raiseOnCurrentDesktop", false).toBool()); ui->buttonStyleCB->setCurrentIndex(ui->buttonStyleCB->findData(mSettings.value("buttonStyle", "IconText"))); - updateControls(ui->buttonStyleCB->currentIndex()); - - /* Keep buttonWidth loading at the end of this method to prevent errors */ ui->buttonWidthSB->setValue(mSettings.value("buttonWidth", 400).toInt()); + ui->buttonHeightSB->setValue(mSettings.value("buttonHeight", 100).toInt()); + ui->groupingGB->setChecked(mSettings.value("groupingEnabled",true).toBool()); + ui->showGroupOnHoverCB->setChecked(mSettings.value("showGroupOnHover",true).toBool()); } void LxQtTaskbarConfiguration::saveSettings() { - mSettings.setValue("showOnlyCurrentDesktopTasks", ui->fCurrentDesktopRB->isChecked()); + mSettings.setValue("showOnlyOneDesktopTasks", ui->limitByDesktopCB->isChecked()); + mSettings.setValue("showDesktopNum", ui->showDesktopNumCB->itemData(ui->showDesktopNumCB->currentIndex())); + mSettings.setValue("showOnlyCurrentScreenTasks", ui->limitByScreenCB->isChecked()); + mSettings.setValue("showOnlyMinimizedTasks", ui->limitByMinimizedCB->isChecked()); mSettings.setValue("buttonStyle", ui->buttonStyleCB->itemData(ui->buttonStyleCB->currentIndex())); mSettings.setValue("buttonWidth", ui->buttonWidthSB->value()); + mSettings.setValue("buttonHeight", ui->buttonHeightSB->value()); mSettings.setValue("autoRotate", ui->autoRotateCB->isChecked()); mSettings.setValue("closeOnMiddleClick", ui->middleClickCB->isChecked()); -} - -void LxQtTaskbarConfiguration::updateControls(int index) -{ - if (ui->buttonStyleCB->itemData(index) == "Icon") - { - ui->buttonWidthSB->setEnabled(false); - ui->buttonWidthL->setEnabled(false); - } - else - { - ui->buttonWidthSB->setEnabled(true); - ui->buttonWidthL->setEnabled(true); - } + mSettings.setValue("raiseOnCurrentDesktop", ui->raiseOnCurrentDesktopCB->isChecked()); + mSettings.setValue("groupingEnabled",ui->groupingGB->isChecked()); + mSettings.setValue("showGroupOnHover",ui->showGroupOnHoverCB->isChecked()); } void LxQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) @@ -114,12 +120,12 @@ void LxQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) /* We have to disable signals for buttonWidthSB to prevent errors. Otherwise not all data could be restored */ ui->buttonWidthSB->blockSignals(true); + ui->buttonHeightSB->blockSignals(true); oldSettings.loadToSettings(); loadSettings(); ui->buttonWidthSB->blockSignals(false); + ui->buttonHeightSB->blockSignals(false); } else - { close(); - } } diff --git a/plugin-taskbar/lxqttaskbarconfiguration.h b/plugin-taskbar/lxqttaskbarconfiguration.h index 999882e..4ee8de6 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.h +++ b/plugin-taskbar/lxqttaskbarconfiguration.h @@ -58,7 +58,6 @@ private: private slots: void saveSettings(); void dialogButtonsAction(QAbstractButton *btn); - void updateControls(int index); }; #endif // LXQTTASKBARCONFIGURATION_H diff --git a/plugin-taskbar/lxqttaskbarconfiguration.ui b/plugin-taskbar/lxqttaskbarconfiguration.ui index 5c6767c..a18fce4 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.ui +++ b/plugin-taskbar/lxqttaskbarconfiguration.ui @@ -6,8 +6,8 @@ 0 0 - 354 - 316 + 401 + 484 @@ -17,27 +17,74 @@ - Taskbar Contents + General - + + + 0 + + + 0 + + + + + Show only windows from desktop + + + + + + + + + + - Show windows from current desktop + Show only windows from &panel's screen - - wlcB - - + - Show windows from all desktops + Show only minimized windows + + + + + + + Raise minimized windows on current desktop + + + + + + + Close on middle-click + + + + + + + + + + Window &grouping + + + true + + + + + + Show popup on mouse hover - - wlcB - @@ -46,9 +93,12 @@ - Taskbar Appearance + Appearance + + QFormLayout::AllNonFixedFieldsGrow + @@ -62,18 +112,47 @@ - Minimum button width + Maximum button width - + + 0 + 0 + + + + px + + + 1 + + + 500 + + + + + + + Maximum button height + + + + + + + 0 0 + + px + 1 @@ -82,7 +161,7 @@ - + Auto&rotate buttons when the panel is vertical @@ -92,13 +171,6 @@ - - - - Close on middle-click - - - @@ -133,8 +205,8 @@ accept() - 248 - 254 + 262 + 496 157 @@ -149,8 +221,8 @@ reject() - 316 - 260 + 330 + 496 286 @@ -159,7 +231,4 @@ - - - diff --git a/plugin-taskbar/lxqttaskbarplugin.h b/plugin-taskbar/lxqttaskbarplugin.h index bfe363c..4778175 100644 --- a/plugin-taskbar/lxqttaskbarplugin.h +++ b/plugin-taskbar/lxqttaskbarplugin.h @@ -43,7 +43,7 @@ public: ~LxQtTaskBarPlugin(); QString themeId() const { return "TaskBar"; } - virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog ; } + virtual Flags flags() const { return HaveConfigDialog | NeedsHandle; } QWidget *widget() { return mTaskBar; } QDialog *configureDialog(); @@ -60,10 +60,10 @@ private: class LxQtTaskBarPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtTaskBarPlugin(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtTaskBarPlugin(startupInfo);} }; #endif // LXQTTASKBARPLUGIN_H diff --git a/plugin-taskbar/lxqttaskbutton.cpp b/plugin-taskbar/lxqttaskbutton.cpp index 4d361d3..be30600 100644 --- a/plugin-taskbar/lxqttaskbutton.cpp +++ b/plugin-taskbar/lxqttaskbutton.cpp @@ -28,6 +28,9 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" #include #include @@ -43,34 +46,44 @@ #include #include #include +#include #include "lxqttaskbutton.h" -#include +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" +#include // Necessary for closeApplication() -#include +#include #include +bool LxQtTaskButton::sDraggging = false; + /************************************************ ************************************************/ -void ElidedButtonStyle::drawItemText(QPainter* painter, const QRect& rect, - int flags, const QPalette & pal, bool enabled, - const QString & text, QPalette::ColorRole textRole) const +void LeftAlignedTextStyle::drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole) const { - QString s = painter->fontMetrics().elidedText(text, Qt::ElideRight, rect.width()); - QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, s, textRole); + return QProxyStyle::drawItemText(painter, rect, (flags & ~Qt::AlignHCenter) | Qt::AlignLeft, pal, enabled, text, textRole); } /************************************************ ************************************************/ -LxQtTaskButton::LxQtTaskButton(const WId window, QWidget *parent) : +LxQtTaskButton::LxQtTaskButton(const WId window, LxQtTaskBar * taskbar, QWidget *parent) : QToolButton(parent), mWindow(window), - mDrawPixmap(false) + mUrgencyHint(false), + mOrigin(Qt::TopLeftCorner), + mDrawPixmap(false), + mParentTaskBar(taskbar), + mDNDTimer(new QTimer(this)) { + Q_ASSERT(taskbar); + setCheckable(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -81,6 +94,10 @@ LxQtTaskButton::LxQtTaskButton(const WId window, QWidget *parent) : updateText(); updateIcon(); + + mDNDTimer->setSingleShot(true); + mDNDTimer->setInterval(700); + connect(mDNDTimer, SIGNAL(timeout()), this, SLOT(activateWithDraggable())); } /************************************************ @@ -109,10 +126,30 @@ void LxQtTaskButton::updateIcon() QIcon ico; QPixmap pix = KWindowSystem::icon(mWindow); ico.addPixmap(pix); - if (!pix.isNull()) - setIcon(ico); - else - setIcon(XdgIcon::defaultApplicationIcon()); + setIcon(!pix.isNull() ? ico : XdgIcon::defaultApplicationIcon()); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::refreshIconGeometry(QRect const & geom) +{ + NETWinInfo info(QX11Info::connection(), + windowId(), + (WId) QX11Info::appRootWindow(), + NET::WMIconGeometry, + 0); + NETRect const curr = info.iconGeometry(); + if (curr.pos.x != geom.x() || curr.pos.y != geom.y() + || curr.size.width != geom.width() || curr.size.height != geom.height()) + { + NETRect nrect; + nrect.pos.x = geom.x(); + nrect.pos.y = geom.y(); + nrect.size.height = geom.height(); + nrect.size.width = geom.width(); + info.setIconGeometry(nrect); + } } /************************************************ @@ -120,22 +157,32 @@ void LxQtTaskButton::updateIcon() ************************************************/ void LxQtTaskButton::dragEnterEvent(QDragEnterEvent *event) { - if (event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (event->mimeData()->hasFormat(mimeDataFormat())) { event->ignore(); return; } - mDraggableMimeData = event->mimeData(); - QTimer::singleShot(1000, this, SLOT(activateWithDraggable())); -} + mDNDTimer->start(); -/************************************************ + // It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called + // on the other hand drop and dragmove events of parent widget won't be called + event->accept(); + QToolButton::dragEnterEvent(event); +} - ************************************************/ void LxQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) { - mDraggableMimeData = NULL; + mDNDTimer->stop(); + event->ignore(); + QToolButton::dragLeaveEvent(event); +} + +void LxQtTaskButton::dropEvent(QDropEvent *event) +{ + mDNDTimer->stop(); + event->ignore(); + QToolButton::dropEvent(event); } /************************************************ @@ -143,8 +190,13 @@ void LxQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) ************************************************/ void LxQtTaskButton::mousePressEvent(QMouseEvent* event) { - if (event->button() == Qt::LeftButton) + const Qt::MouseButton b = event->button(); + + if (Qt::LeftButton == b) mDragStartPosition = event->pos(); + else if (Qt::MidButton == b && parentTaskBar()->closeOnMiddleClick()) + closeApplication(); + QToolButton::mousePressEvent(event); } @@ -155,7 +207,6 @@ void LxQtTaskButton::mouseReleaseEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { - // qDebug() << "isChecked:" << isChecked(); if (isChecked()) minimizeApplication(); else @@ -164,6 +215,19 @@ void LxQtTaskButton::mouseReleaseEvent(QMouseEvent* event) QToolButton::mouseReleaseEvent(event); } +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskButton::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray ba; + QDataStream stream(&ba,QIODevice::WriteOnly); + stream << (qlonglong)(mWindow); + mimedata->setData(mimeDataFormat(), ba); + return mimedata; +} + /************************************************ ************************************************/ @@ -175,27 +239,29 @@ void LxQtTaskButton::mouseMoveEvent(QMouseEvent* event) if ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance()) return; - QMimeData *mime = new QMimeData; - QByteArray byteArray; - QDataStream stream(&byteArray, QIODevice::WriteOnly); - qDebug() << QString("Dragging window: %1").arg(mWindow); - stream << (qlonglong) mWindow; - mime->setData("lxqt/lxqttaskbutton", byteArray); - QDrag *drag = new QDrag(this); - drag->setMimeData(mime); + drag->setMimeData(mimeData()); + + //fixme when vertical panel, pixmap is empty QPixmap pixmap = grab(); drag->setPixmap(pixmap); drag->setHotSpot(QPoint(mapTo(this, event->pos()))); + + sDraggging = true; drag->exec(); + // if button is dropped out of panel (e.g. on desktop) + // it is not deleted automatically by Qt + drag->deleteLater(); + sDraggging = false; + QAbstractButton::mouseMoveEvent(event); } /************************************************ ************************************************/ -bool LxQtTaskButton::isAppHidden() const +bool LxQtTaskButton::isApplicationHidden() const { KWindowInfo info(mWindow, NET::WMState); return (info.state() & NET::Hidden); @@ -214,12 +280,10 @@ bool LxQtTaskButton::isApplicationActive() const ************************************************/ void LxQtTaskButton::activateWithDraggable() { - if (!mDraggableMimeData) - return; - // raise app in any time when there is a drag // in progress to allow drop it into an app raiseApplication(); + KWindowSystem::forceActiveWindow(mWindow); } /************************************************ @@ -227,10 +291,17 @@ void LxQtTaskButton::activateWithDraggable() ************************************************/ void LxQtTaskButton::raiseApplication() { - KWindowInfo info(mWindow, NET::WMDesktop); - int winDesktop = info.desktop(); - if (KWindowSystem::currentDesktop() != winDesktop) - KWindowSystem::setCurrentDesktop(winDesktop); + KWindowInfo info(mWindow, NET::WMDesktop | NET::WMState | NET::XAWMState); + if (parentTaskBar()->raiseOnCurrentDesktop() && info.isMinimized()) + { + KWindowSystem::setOnDesktop(mWindow, KWindowSystem::currentDesktop()); + } + else + { + int winDesktop = info.desktop(); + if (KWindowSystem::currentDesktop() != winDesktop) + KWindowSystem::setCurrentDesktop(winDesktop); + } KWindowSystem::activateWindow(mWindow); setUrgencyHint(false); @@ -268,6 +339,9 @@ void LxQtTaskButton::maximizeApplication() KWindowSystem::setState(mWindow, NET::Max); break; } + + if (!isApplicationActive()) + raiseApplication(); } /************************************************ @@ -276,6 +350,9 @@ void LxQtTaskButton::maximizeApplication() void LxQtTaskButton::deMaximizeApplication() { KWindowSystem::clearState(mWindow, NET::Max); + + if (!isApplicationActive()) + raiseApplication(); } /************************************************ @@ -364,7 +441,8 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) KWindowInfo info(mWindow, 0, NET::WM2AllowedActions); unsigned long state = KWindowInfo(mWindow, NET::WMState).state(); - QMenu menu(tr("Application")); + QMenu * menu = new QMenu(tr("Application")); + menu->setAttribute(Qt::WA_DeleteOnClose); QAction* a; /* KDE menu ******* @@ -397,7 +475,7 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) if (deskNum > 1) { int winDesk = KWindowInfo(mWindow, NET::WMDesktop).desktop(); - QMenu* deskMenu = menu.addMenu(tr("To &Desktop")); + QMenu* deskMenu = menu->addMenu(tr("To &Desktop")); a = deskMenu->addAction(tr("&All Desktops")); a->setData(NET::OnAllDesktops); @@ -414,58 +492,58 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) } int curDesk = KWindowSystem::currentDesktop(); - a = menu.addAction(tr("&To Current Desktop")); + a = menu->addAction(tr("&To Current Desktop")); a->setData(curDesk); a->setEnabled(curDesk != winDesk); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop())); } /********** State menu **********/ - menu.addSeparator(); + menu->addSeparator(); - a = menu.addAction(tr("Ma&ximize")); - a->setEnabled(info.actionSupported(NET::ActionMax) && !(state & NET::Max)); + a = menu->addAction(tr("Ma&ximize")); + a->setEnabled(info.actionSupported(NET::ActionMax) && (!(state & NET::Max) || (state & NET::Hidden))); a->setData(NET::Max); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); if (event->modifiers() & Qt::ShiftModifier) { - a = menu.addAction(tr("Maximize vertically")); + a = menu->addAction(tr("Maximize vertically")); a->setEnabled(info.actionSupported(NET::ActionMaxVert) && !((state & NET::MaxVert) || (state & NET::Hidden))); a->setData(NET::MaxVert); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); - a = menu.addAction(tr("Maximize horizontally")); + a = menu->addAction(tr("Maximize horizontally")); a->setEnabled(info.actionSupported(NET::ActionMaxHoriz) && !((state & NET::MaxHoriz) || (state & NET::Hidden))); a->setData(NET::MaxHoriz); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); } - a = menu.addAction(tr("&Restore")); + a = menu->addAction(tr("&Restore")); a->setEnabled((state & NET::Hidden) || (state & NET::Max) || (state & NET::MaxHoriz) || (state & NET::MaxVert)); connect(a, SIGNAL(triggered(bool)), this, SLOT(deMaximizeApplication())); - a = menu.addAction(tr("Mi&nimize")); + a = menu->addAction(tr("Mi&nimize")); a->setEnabled(info.actionSupported(NET::ActionMinimize) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(minimizeApplication())); if (state & NET::Shaded) { - a = menu.addAction(tr("Roll down")); + a = menu->addAction(tr("Roll down")); a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(unShadeApplication())); } else { - a = menu.addAction(tr("Roll up")); + a = menu->addAction(tr("Roll up")); a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(shadeApplication())); } /********** Layer menu **********/ - menu.addSeparator(); + menu->addSeparator(); - QMenu* layerMenu = menu.addMenu(tr("&Layer")); + QMenu* layerMenu = menu->addMenu(tr("&Layer")); a = layerMenu->addAction(tr("Always on &top")); // FIXME: There is no info.actionSupported(NET::ActionKeepAbove) @@ -486,10 +564,11 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) connect(a, SIGNAL(triggered(bool)), this, SLOT(setApplicationLayer())); /********** Kill menu **********/ - menu.addSeparator(); - a = menu.addAction(XdgIcon::fromTheme("process-stop"), tr("&Close")); + menu->addSeparator(); + a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("&Close")); connect(a, SIGNAL(triggered(bool)), this, SLOT(closeApplication())); - menu.exec(mapToGlobal(event->pos())); + menu->setGeometry(mParentTaskBar->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); } /************************************************ @@ -513,9 +592,19 @@ void LxQtTaskButton::setUrgencyHint(bool set) /************************************************ ************************************************/ -int LxQtTaskButton::desktopNum() const +bool LxQtTaskButton::isOnDesktop(int desktop) const +{ + return KWindowInfo(mWindow, NET::WMDesktop).isOnDesktop(desktop); +} + +bool LxQtTaskButton::isOnCurrentScreen() const { - return KWindowInfo(mWindow, NET::WMDesktop).desktop(); + return QApplication::desktop()->screenGeometry(parentTaskBar()).intersects(KWindowInfo(mWindow, NET::WMFrameExtents).frameGeometry()); +} + +bool LxQtTaskButton::isMinimized() const +{ + return KWindowInfo(mWindow,NET::WMState | NET::XAWMState).isMinimized(); } Qt::Corner LxQtTaskButton::origin() const @@ -630,3 +719,8 @@ void LxQtTaskButton::paintEvent(QPaintEvent *event) mDrawPixmap = drawPixmapNextTime; } + +bool LxQtTaskButton::hasDragAndDropHover() const +{ + return mDNDTimer->isActive(); +} diff --git a/plugin-taskbar/lxqttaskbutton.h b/plugin-taskbar/lxqttaskbutton.h index 3b4fa85..419212a 100644 --- a/plugin-taskbar/lxqttaskbutton.h +++ b/plugin-taskbar/lxqttaskbutton.h @@ -39,15 +39,17 @@ class QPainter; class QPalette; class QMimeData; +class LxQtTaskGroup; +class LxQtTaskBar; -class ElidedButtonStyle: public QProxyStyle +class LeftAlignedTextStyle : public QProxyStyle { + using QProxyStyle::QProxyStyle; public: - ElidedButtonStyle(QStyle* style=0): QProxyStyle(style) {} - void drawItemText(QPainter* painter, const QRect& rect, int flags, - const QPalette & pal, bool enabled, const QString & text, - QPalette::ColorRole textRole = QPalette::NoRole ) const; + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override; }; @@ -58,22 +60,34 @@ class LxQtTaskButton : public QToolButton Q_PROPERTY(Qt::Corner origin READ origin WRITE setOrigin) public: - explicit LxQtTaskButton(const WId window, QWidget *parent = 0); + explicit LxQtTaskButton(const WId window, LxQtTaskBar * taskBar, QWidget *parent = 0); virtual ~LxQtTaskButton(); - bool isAppHidden() const; + bool isApplicationHidden() const; bool isApplicationActive() const; WId windowId() const { return mWindow; } bool hasUrgencyHint() const { return mUrgencyHint; } void setUrgencyHint(bool set); - int desktopNum() const; + bool isOnDesktop(int desktop) const; + bool isOnCurrentScreen() const; + bool isMinimized() const; void updateText(); void updateIcon(); Qt::Corner origin() const; - void setAutoRotation(bool value, ILxQtPanel::Position position); + virtual void setAutoRotation(bool value, ILxQtPanel::Position position); + + LxQtTaskGroup * parentGroup(void) const {return mParentGroup;} + void setParentGroup(LxQtTaskGroup * group) {mParentGroup = group;} + LxQtTaskBar * parentTaskBar() const {return mParentTaskBar;} + + void refreshIconGeometry(QRect const & geom); + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); } + /*! \return true if this buttom received DragEnter event (and no DragLeave event yet) + * */ + bool hasDragAndDropHover() const; public slots: void raiseApplication(); @@ -89,25 +103,39 @@ public slots: void setOrigin(Qt::Corner); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dragLeaveEvent(QDragLeaveEvent *event); + virtual void dropEvent(QDropEvent *event); void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); - void contextMenuEvent(QContextMenuEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *event); void paintEvent(QPaintEvent *); + void setWindowId(WId wid) {mWindow = wid;} + virtual QMimeData * mimeData(); + static bool sDraggging; + private: WId mWindow; bool mUrgencyHint; - const QMimeData *mDraggableMimeData; QPoint mDragStartPosition; Qt::Corner mOrigin; QPixmap mPixmap; bool mDrawPixmap; + LxQtTaskGroup * mParentGroup; + LxQtTaskBar * mParentTaskBar; + + // Timer for when draggind something into a button (the button's window + // must be activated so that the use can continue dragging to the window + QTimer * mDNDTimer; private slots: void activateWithDraggable(); + +signals: + void dropped(QDropEvent * event); + void dragging(bool executing = false); }; typedef QHash LxQtTaskButtonHash; diff --git a/plugin-taskbar/lxqttaskgroup.cpp b/plugin-taskbar/lxqttaskgroup.cpp new file mode 100644 index 0000000..9be7a5d --- /dev/null +++ b/plugin-taskbar/lxqttaskgroup.cpp @@ -0,0 +1,657 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/************************************************ + + ************************************************/ +LxQtTaskGroup::LxQtTaskGroup(const QString &groupName, QIcon icon, ILxQtPanelPlugin * plugin, LxQtTaskBar *parent) + : LxQtTaskButton(0, parent, parent), + mGroupName(groupName), + mPopup(new LxQtGroupPopup(this)), + mPlugin(plugin), + mPreventPopup(false) +{ + Q_ASSERT(parent); + + setObjectName(groupName); + setText(groupName); + setIcon(icon); + + connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool))); + connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(onDesktopChanged(int))); + connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(onWindowRemoved(WId))); + connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId))); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::contextMenuEvent(QContextMenuEvent *event) +{ + setPopupVisible(false, true); + mPreventPopup = true; + if (windowId()) + { + LxQtTaskButton::contextMenuEvent(event); + return; + } + + QMenu * menu = new QMenu(tr("Group")); + menu->setAttribute(Qt::WA_DeleteOnClose); + QAction *a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("Close group")); + connect(a, SIGNAL(triggered()), this, SLOT(closeGroup())); + connect(menu, &QMenu::aboutToHide, [this] { + mPreventPopup = false; + }); + menu->setGeometry(mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::closeGroup() +{ + foreach (LxQtTaskButton * button, mButtonHash.values()) + if (button->isOnDesktop(KWindowSystem::currentDesktop())) + button->closeApplication(); +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::addWindow(WId id) +{ + if (mButtonHash.contains(id)) + return mButtonHash.value(id); + + LxQtTaskButton *btn = new LxQtTaskButton(id, parentTaskBar(), mPopup); + btn->setToolButtonStyle(toolButtonStyle()); + + if (btn->isApplicationActive()) + { + btn->setChecked(true); + setChecked(true); + } + + btn->setParentGroup(this); + + mButtonHash.insert(id, btn); + mPopup->addButton(btn); + + connect(btn, SIGNAL(clicked()), this, SLOT(onChildButtonClicked())); + refreshVisibility(); + + return btn; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::checkedButton() const +{ + foreach (LxQtTaskButton* button, mButtonHash.values()) + if (button->isChecked()) + return button; + + return NULL; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::getNextPrevChildButton(bool next, bool circular) +{ + LxQtTaskButton *button = checkedButton(); + int idx = mPopup->indexOf(button); + int inc = next ? 1 : -1; + idx += inc; + + // if there is no cheked button, get the first one if next equals true + // or the last one if not + if (!button) + { + idx = -1; + if (next) + { + for (int i = 0; i < mPopup->count() && idx == -1; i++) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + else + { + for (int i = mPopup->count() - 1; i >= 0 && idx == -1; i--) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + } + + if (circular) + idx = (idx + mButtonHash.count()) % mButtonHash.count(); + else if (mPopup->count() <= idx || idx < 0) + return NULL; + + // return the next or the previous child + QLayoutItem *item = mPopup->itemAt(idx); + if (item) + { + button = qobject_cast(item->widget()); + if (button->isVisibleTo(mPopup)) + return button; + } + + return NULL; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onActiveWindowChanged(WId window) +{ + LxQtTaskButton *button = mButtonHash.value(window, nullptr); + foreach (LxQtTaskButton *btn, mButtonHash.values()) + btn->setChecked(false); + + if (button) + { + button->setChecked(true); + if (button->hasUrgencyHint()) + button->setUrgencyHint(false); + } + setChecked(nullptr != button); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onDesktopChanged(int number) +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onWindowRemoved(WId window) +{ + if (mButtonHash.contains(window)) + { + LxQtTaskButton *button = mButtonHash.value(window); + mButtonHash.remove(window); + mPopup->removeWidget(button); + button->deleteLater(); + + if (mButtonHash.count()) + regroup(); + else + { + if (isVisible()) + emit visibilityChanged(false); + hide(); + emit groupBecomeEmpty(groupName()); + + } + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onChildButtonClicked() +{ + setPopupVisible(false, true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setToolButtonsStyle(Qt::ToolButtonStyle style) +{ + setToolButtonStyle(style); + for (auto & button : mButtonHash) + { + button->setToolButtonStyle(style); + } +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::buttonsCount() const +{ + return mButtonHash.count(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::visibleButtonsCount() const +{ + int i = 0; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + if (btn->isVisibleTo(mPopup)) + i++; + return i; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::draggingTimerTimeout() +{ + if (windowId()) + setPopupVisible(false); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onClicked(bool) +{ + if (visibleButtonsCount() > 1) + { + setChecked(mButtonHash.contains(KWindowSystem::activeWindow())); + setPopupVisible(true); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::regroup() +{ + int cont = visibleButtonsCount(); + recalculateFrameIfVisible(); + + if (cont == 1) + { + // Get first visible button + LxQtTaskButton * button = NULL; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + { + if (btn->isVisibleTo(mPopup)) + { + button = btn; + break; + } + } + + if (button) + { + setText(button->text()); + setToolTip(button->toolTip()); + setWindowId(button->windowId()); + } + } + else if (cont == 0) + hide(); + else + { + QString t = QString("%1 - %2 windows").arg(mGroupName).arg(cont); + setText(t); + setToolTip(parentTaskBar()->isShowGroupOnHover() ? QStringLiteral() : t); + setWindowId(0); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::showOnlySettingChanged() +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::recalculateFrameIfVisible() +{ + if (mPopup->isVisible()) + { + recalculateFrameSize(); + if (mPlugin->panel()->position() == ILxQtPanel::PositionBottom) + recalculateFramePosition(); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setAutoRotation(bool value, ILxQtPanel::Position position) +{ + foreach (LxQtTaskButton *button, mButtonHash.values()) + button->setAutoRotation(false, position); + + LxQtTaskButton::setAutoRotation(value, position); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshVisibility() +{ + bool will = false; + LxQtTaskBar const * taskbar = parentTaskBar(); + const int showDesktop = taskbar->showDesktopNum(); + foreach(LxQtTaskButton * btn, mButtonHash.values()) + { + bool visible = taskbar->isShowOnlyOneDesktopTasks() ? btn->isOnDesktop(0 == showDesktop ? KWindowSystem::currentDesktop() : showDesktop) : true; + visible &= taskbar->isShowOnlyCurrentScreenTasks() ? btn->isOnCurrentScreen() : true; + visible &= taskbar->isShowOnlyMinimizedTasks() ? btn->isMinimized() : true; + btn->setVisible(visible); + will |= visible; + } + + bool is = isVisible(); + setVisible(will); + regroup(); + + if (is != will) + emit visibilityChanged(will); +} + +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskGroup::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray byteArray; + QDataStream stream(&byteArray, QIODevice::WriteOnly); + stream << groupName(); + mimedata->setData(mimeDataFormat(), byteArray); + return mimedata; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setPopupVisible(bool visible, bool fast) +{ + if (visible && !mPreventPopup && 0 == windowId()) + { + if (!mPopup->isVisible()) + { + // setup geometry + recalculateFrameSize(); + recalculateFramePosition(); + } + + mPopup->show(); + emit popupShown(this); + } + else + mPopup->hide(fast); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshIconsGeometry() +{ + QRect rect = geometry(); + rect.moveTo(mapToGlobal(QPoint(0, 0))); + + if (windowId()) + { + refreshIconGeometry(rect); + return; + } + + foreach(LxQtTaskButton *but, mButtonHash.values()) + { + but->refreshIconGeometry(rect); + but->setIconSize(QSize(mPlugin->panel()->iconSize(), mPlugin->panel()->iconSize())); + } +} + +/************************************************ + + ************************************************/ +QSize LxQtTaskGroup::recalculateFrameSize() +{ + int height = recalculateFrameHeight(); + mPopup->setMaximumHeight(1000); + mPopup->setMinimumHeight(0); + + int hh = recalculateFrameWidth(); + mPopup->setMaximumWidth(hh); + mPopup->setMinimumWidth(0); + + QSize newSize(hh, height); + mPopup->resize(newSize); + + return newSize; +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameHeight() const +{ + int cont = visibleButtonsCount(); + int h = !mPlugin->panel()->isHorizontal() && parentTaskBar()->isAutoRotate() ? width() : height(); + return cont * h + (cont + 1) * mPopup->spacing(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameWidth() const +{ + // FIXME: 300? + int minimum = 300; + int hh = width(); + + if (!mPlugin->panel()->isHorizontal() && !parentTaskBar()->isAutoRotate()) + hh = height(); + + if (hh < minimum) + hh = minimum; + + return hh; +} + +/************************************************ + + ************************************************/ +QPoint LxQtTaskGroup::recalculateFramePosition() +{ + // Set position + int x_offset = 0, y_offset = 0; + switch (mPlugin->panel()->position()) + { + case ILxQtPanel::PositionTop: + y_offset += height(); + break; + case ILxQtPanel::PositionBottom: + y_offset = -recalculateFrameHeight(); + break; + case ILxQtPanel::PositionLeft: + x_offset += width(); + break; + case ILxQtPanel::PositionRight: + x_offset = -recalculateFrameWidth(); + break; + } + + QPoint pos = mapToGlobal(QPoint(x_offset, y_offset)); + mPopup->move(pos); + + return pos; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::leaveEvent(QEvent *event) +{ + setPopupVisible(false); + QToolButton::leaveEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::enterEvent(QEvent *event) +{ + QToolButton::enterEvent(event); + + if (sDraggging) + return; + + if (parentTaskBar()->isShowGroupOnHover()) + setPopupVisible(true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragEnterEvent(QDragEnterEvent *event) +{ + sDraggging = true; + // only show the popup if we aren't dragging a taskgroup + if (!event->mimeData()->hasFormat(mimeDataFormat())) + { + setPopupVisible(true); + LxQtTaskButton::dragEnterEvent(event); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragLeaveEvent(QDragLeaveEvent *event) +{ + // if draggind something into the taskgroup or the taskgroups' popup, + // do not close the popup + if (!sDraggging) + setPopupVisible(false); + else + sDraggging = false; + LxQtTaskButton::dragLeaveEvent(event); +} + +void LxQtTaskGroup::mouseMoveEvent(QMouseEvent* event) +{ + // if dragging the taskgroup, do not show the popup + setPopupVisible(false, true); + LxQtTaskButton::mouseMoveEvent(event); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + bool consumed{false}; + bool needsRefreshVisibility{false}; + QVector buttons; + if (mButtonHash.contains(window)) + buttons.append(mButtonHash.value(window)); + + // If group contains only one window properties must be changed also on button group + if (window == windowId()) + buttons.append(this); + + foreach (LxQtTaskButton * button, buttons) + { + consumed = true; + // if class is changed the window won't belong to our group any more + if (parentTaskBar()->isGroupingEnabled() && prop2.testFlag(NET::WM2WindowClass) && this != button) + { + KWindowInfo info(window, 0, NET::WM2WindowClass); + if (info.windowClassClass() != mGroupName) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + } + // window changed virtual desktop + if (prop.testFlag(NET::WMDesktop) || prop.testFlag(NET::WMGeometry)) + { + if (parentTaskBar()->isShowOnlyOneDesktopTasks() + || parentTaskBar()->isShowOnlyCurrentScreenTasks()) + { + needsRefreshVisibility = true; + } + } + + if (prop.testFlag(NET::WMVisibleName) || prop.testFlag(NET::WMName)) + button->updateText(); + + // XXX: we are setting window icon geometry -> don't need to handle NET::WMIconGeometry + if (prop.testFlag(NET::WMIcon)) + button->updateIcon(); + + if (prop.testFlag(NET::WMState)) + { + KWindowInfo info{window, NET::WMState}; + if (info.hasState(NET::SkipTaskbar) && this != button) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + button->setUrgencyHint(info.hasState(NET::DemandsAttention)); + + if (parentTaskBar()->isShowOnlyMinimizedTasks()) + { + needsRefreshVisibility = true; + } + } + } + + if (needsRefreshVisibility) + refreshVisibility(); + + return consumed; +} diff --git a/plugin-taskbar/lxqttaskgroup.h b/plugin-taskbar/lxqttaskgroup.h new file mode 100644 index 0000000..040bd1a --- /dev/null +++ b/plugin-taskbar/lxqttaskgroup.h @@ -0,0 +1,121 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKGROUP_H +#define LXQTTASKGROUP_H + +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskbar.h" +#include "lxqtgrouppopup.h" +#include "lxqttaskbutton.h" +#include + +class QVBoxLayout; +class ILxQtPanelPlugin; + +class LxQtGroupPopup; +class LxQtMasterPopup; + +class LxQtTaskGroup: public LxQtTaskButton +{ + Q_OBJECT + +public: + LxQtTaskGroup(const QString & groupName, QIcon icon ,ILxQtPanelPlugin * plugin, LxQtTaskBar * parent); + + QString groupName() const { return mGroupName; } + + void removeButton(WId window); + int buttonsCount() const; + int visibleButtonsCount() const; + + LxQtTaskButton * addWindow(WId id); + LxQtTaskButton * checkedButton() const; + + // Returns the next or the previous button in the popup + // if circular is true, then it will go around the list of buttons + LxQtTaskButton * getNextPrevChildButton(bool next, bool circular); + + bool onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + void refreshIconsGeometry(); + void showOnlySettingChanged(); + void setAutoRotation(bool value, ILxQtPanel::Position position); + void setToolButtonsStyle(Qt::ToolButtonStyle style); + + void setPopupVisible(bool visible = true, bool fast = false); + + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskgroup"); } + +protected: + QMimeData * mimeData(); + + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent * event); + void contextMenuEvent(QContextMenuEvent * event); + void mouseMoveEvent(QMouseEvent * event); + int recalculateFrameHeight() const; + int recalculateFrameWidth() const; + + void draggingTimerTimeout(); + +private slots: + void onClicked(bool checked); + void onChildButtonClicked(); + void onActiveWindowChanged(WId window); + void onWindowRemoved(WId window); + void onDesktopChanged(int number); + + void closeGroup(); + +signals: + void groupBecomeEmpty(QString name); + void visibilityChanged(bool visible); + void popupShown(LxQtTaskGroup* sender); + void windowDisowned(WId window); + +private: + QString mGroupName; + LxQtGroupPopup * mPopup; + LxQtTaskButtonHash mButtonHash; + ILxQtPanelPlugin * mPlugin; + bool mPreventPopup; + + QSize recalculateFrameSize(); + QPoint recalculateFramePosition(); + void recalculateFrameIfVisible(); + void refreshVisibility(); + void regroup(); +}; + +#endif // LXQTTASKGROUP_H diff --git a/plugin-taskbar/translations/taskbar.ts b/plugin-taskbar/translations/taskbar.ts index 559d8dc..62d8e35 100644 --- a/plugin-taskbar/translations/taskbar.ts +++ b/plugin-taskbar/translations/taskbar.ts @@ -1,94 +1,107 @@ - + LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,42 +111,73 @@ - Taskbar Contents + General - Show windows from current desktop + Show only windows from c&urrent desktop - - Show windows from all desktops + + Show only windows from &panel's screen - - Taskbar Appearance + + Show only minimized windows - - Minimum button width + + Raise minimized windows on current desktop - - Auto&rotate buttons when the panel is vertical + + Close on middle-click + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance - + Button style - - Close on middle-click + + Maximum button width + + + + + + px + + + + + Maximum button height + + + + + Auto&rotate buttons when the panel is vertical diff --git a/plugin-taskbar/translations/taskbar_ar.ts b/plugin-taskbar/translations/taskbar_ar.ts index ff0277d..1cde641 100644 --- a/plugin-taskbar/translations/taskbar_ar.ts +++ b/plugin-taskbar/translations/taskbar_ar.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application التطبيق - + To &Desktop إلى س&طح المكتب - + &All Desktops كا&فَّة أسطح المكتب - + Desktop &%1 سطح المكتب &%1 - + &To Current Desktop إلى سطح المكتب ال&حالي - + Ma&ximize ت&كبير - + Maximize vertically تكبيرٌ عموديٌّ - + Maximize horizontally تكبيرٌ أفقيٌّ - + &Restore استر&جاع - + Mi&nimize ت&صغير - + Roll down لفٌّ نحو اﻷسفل - + Roll up لفٌّ نحو اﻷعلى - + &Layer طب&قة - + Always on &top دوماً في اﻷ&على - + &Normal عا&دي - + Always on &bottom دوماً في اﻷس&فل - + &Close إ&غلاق + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - إظهار نوافذ سطح المكتب الحاليّ + Show windows from c&urrent desktop + - Show windows from all desktops - إظهار نوافذ كافَّة اﻷسطح المكتبيَّة + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + إظهار نوافذ سطح المكتب الحاليّ + + + Show windows from all desktops + إظهار نوافذ كافَّة اﻷسطح المكتبيَّة + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ مظهر قائمة النَّوافذ - + Button style شكل الزُّرّ @@ -148,7 +184,7 @@ عرض زرِّ التكبير - + Close on middle-click إغلاق عند الضغط على زرّ الفأرة اﻷوسط diff --git a/plugin-taskbar/translations/taskbar_cs.ts b/plugin-taskbar/translations/taskbar_cs.ts index e09dadd..6605eb1 100644 --- a/plugin-taskbar/translations/taskbar_cs.ts +++ b/plugin-taskbar/translations/taskbar_cs.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Na &plochu - + &All Desktops &Všechny plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na nynější plochu - + Ma&ximize Zvě&tšit - + Maximize vertically Zvětšit svisle - + Maximize horizontally Zvětšit vodorovně - + &Restore &Obnovit - + Mi&nimize &Zmenšit - + Roll down Sbalit - + Roll up Rozbalit - + &Layer &Vrstva - + Always on &top Vždy &nahoře - + &Normal &Obvyklé - + Always on &bottom Vždy &dole - + &Close &Zavřít + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Ukázat okna z nynější plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Ukázat okna ze všech ploch + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhled seznamu oken - + Button style Styl tlačítek @@ -148,7 +184,7 @@ Největší šířka tlačítka - + Close on middle-click Zavřít klepnutím prostředním tlačítkem diff --git a/plugin-taskbar/translations/taskbar_cs_CZ.ts b/plugin-taskbar/translations/taskbar_cs_CZ.ts index a3e26d0..c80ae3b 100644 --- a/plugin-taskbar/translations/taskbar_cs_CZ.ts +++ b/plugin-taskbar/translations/taskbar_cs_CZ.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Na &plochu - + &All Desktops &Všechny plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na nynější plochu - + Ma&ximize Zvě&tšit - + Maximize vertically Zvětšit svisle - + Maximize horizontally Zvětšit vodorovně - + &Restore &Obnovit - + Mi&nimize &Zmenšit - + Roll down Sbalit - + Roll up Rozbalit - + &Layer &Vrstva - + Always on &top Vždy &nahoře - + &Normal &Obvyklé - + Always on &bottom Vždy &dole - + &Close &Zavřít + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Ukázat okna z nynější plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Ukázat okna ze všech ploch + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhled seznamu oken - + Button style Styl tlačítek @@ -148,7 +184,7 @@ Největší šířka tlačítka - + Close on middle-click Zavřít klepnutím prostředním tlačítkem diff --git a/plugin-taskbar/translations/taskbar_da.ts b/plugin-taskbar/translations/taskbar_da.ts index 469c550..c805b8d 100644 --- a/plugin-taskbar/translations/taskbar_da.ts +++ b/plugin-taskbar/translations/taskbar_da.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Til skrivebor&d - + &All Desktops &Alle skriveborde - + Desktop &%1 Skrivebord &%1 - + &To Current Desktop &Til aktuelt skrivebord - + Ma&ximize Ma&ksimer - + Maximize vertically Maksimer vertikalt - + Maximize horizontally Maksimer horisontalt - + &Restore &Gendan - + Mi&nimize Mi&nimer - + Roll down Rul ned - + Roll up Rul op - + &Layer &Lag - + Always on &top Al&tid øverst - + &Normal &Normal - + Always on &bottom Altid &nederst - + &Close &Luk + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,55 @@ - Taskbar Contents + General - Show windows from current desktop - Vis vinduer fra aktuelle skrivebord + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra aktuelle skrivebord + + + Auto&rotate buttons when the panel is vertical - + Close on middle-click @@ -139,16 +176,15 @@ wlcB - Show windows from all desktops - Vis vinduer fra alle skriveborde + Vis vinduer fra alle skriveborde Window List Appearance Udseende af Vinduesliste - + Button style Knapstil diff --git a/plugin-taskbar/translations/taskbar_da_DK.ts b/plugin-taskbar/translations/taskbar_da_DK.ts index b0c221d..adc69ba 100644 --- a/plugin-taskbar/translations/taskbar_da_DK.ts +++ b/plugin-taskbar/translations/taskbar_da_DK.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Til &Skrivebord - + &All Desktops A&lle Skriveborde - + Desktop &%1 Skrivebord &%1 - + &To Current Desktop Til Nuværende Skrivebor&d - + Ma&ximize Ma&ksimer - + Maximize vertically Maksimer vertikalt - + Maximize horizontally Maksimer horisontalt - + &Restore &Gendan - + Mi&nimize Mi&nimer - + Roll down Rul ned - + Roll up Rul op - + &Layer &Lag - + Always on &top Altid &Ovenpå - + &Normal &Normal - + Always on &bottom Altid Ned&erst - + &Close &Afslut + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Vis vinduer fra nuværende skrivebord + Show windows from c&urrent desktop + - Show windows from all desktops - Vis vinduer fra alle skriveborde + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra nuværende skrivebord + + + Show windows from all desktops + Vis vinduer fra alle skriveborde + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Udseende af vinduesliste - + Button style Knap stil @@ -148,7 +184,7 @@ Maks. knapbredde - + Close on middle-click Luk ved midterklik diff --git a/plugin-taskbar/translations/taskbar_de.desktop b/plugin-taskbar/translations/taskbar_de.desktop index c809473..f57f1a2 100644 --- a/plugin-taskbar/translations/taskbar_de.desktop +++ b/plugin-taskbar/translations/taskbar_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Task manager -Comment=Switch between running applications - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Wechsel zwischen laufenden Anwendungen Name[de]=Anwendungsverwalter +Comment[de]=Wechsel zwischen laufenden Anwendungen diff --git a/plugin-taskbar/translations/taskbar_de.ts b/plugin-taskbar/translations/taskbar_de.ts index 9d9a5c2..834a0de 100644 --- a/plugin-taskbar/translations/taskbar_de.ts +++ b/plugin-taskbar/translations/taskbar_de.ts @@ -4,172 +4,201 @@ LxQtTaskButton - + Application Anwendung - + To &Desktop Zur Arb&eitsfläche - + &All Desktops &Alle Arbeitsflächen - + Desktop &%1 Arbeitsfläche &%1 - + &To Current Desktop - Zur Ak&tuellen Arbeitsfläche + Zur ak&tuellen Arbeitsfläche - + Ma&ximize Ma&ximieren - + Maximize vertically Vertikal maximieren - + Maximize horizontally Horizontal maximieren - + &Restore &Wiederherstellen - + Mi&nimize Mi&nimieren - + Roll down Herunterrollen - + Roll up Hochrollen - + &Layer &Ebene - + Always on &top Immer &oben - + &Normal &Normal - + Always on &bottom Immer &unten - + &Close &Schließen - LxQtTaskbarConfiguration + LxQtTaskGroup - LxQt Task Manager Settings - LxQt Taskmanager Einstellungen + + Group + Gruppe - Window List Content - Fensterlisteninhalt + + Close group + Gruppe schließen + + + LxQtTaskbarConfiguration Task Manager Settings - + Anwendungsverwalter - Einstellungen - Taskbar Contents - + General + Allgemein - - Show windows from current desktop - Fenster der aktuellen Arbeitsfläche anzeigen + + Show only windows from desktop + Nur Fenster der Arbeitsfläche anzeigen - - Taskbar Appearance - + + Show only windows from &panel's screen + Nur Fenster aus der &Taskleiste anzeigen - - Minimum button width - + + Show only minimized windows + Nur minimierte Fenster anzeigen - - Auto&rotate buttons when the panel is vertical - + + Raise minimized windows on current desktop + Minimierte Fenster auf aktuelle Arbeitsfläche heben - + Close on middle-click - + Fenster bei Mittelklick schließen - wlcB - wlcB + + Window &grouping + Fensteranordnun&g - - Show windows from all desktops - Fenster aller Arbeitsflächen anzeigen + + Show popup on mouse hover + Popup beim Überfahren mit dem Mauszeiger - Window List Appearance - Fensterlisten Erscheinungsbild + + Appearance + Erscheinungsbild - + Button style - Schaltflächenstiel + Schaltflächenstil + + + + Maximum button width + Max. Schaltflächenbreite + + + + + px + px - Max button width - Max. Schaltflächenbreite + + Maximum button height + Max. Schaltflächenhöhe - + + Auto&rotate buttons when the panel is vertical + Schaltflächen automatisch d&rehen bei vertikaler Leiste + + + Icon and text Symbol und Text - + Only icon Nur Symbol - + Only text Nur Text + + + Current + Aktuell + diff --git a/plugin-taskbar/translations/taskbar_de_DE.ts b/plugin-taskbar/translations/taskbar_de_DE.ts deleted file mode 100644 index f5d5fa8..0000000 --- a/plugin-taskbar/translations/taskbar_de_DE.ts +++ /dev/null @@ -1,171 +0,0 @@ - - - - - LxQtTaskButton - - - Application - Anwendung - - - - To &Desktop - Zur &Arbeitsfläche - - - - &All Desktops - &Alle Arbeitsflächen - - - - Desktop &%1 - Arbeitsfläche &%1 - - - - &To Current Desktop - &Zur aktuellen Arbeitsfläche - - - - Ma&ximize - Ma&ximieren - - - - Maximize vertically - Maximiere vertikal - - - - Maximize horizontally - Maximiere horizintal - - - - &Restore - &Wiederherstellen - - - - Mi&nimize - Mi&nimieren - - - - Roll down - Roll runter - - - - Roll up - Roll hoch - - - - &Layer - &Schicht - - - - Always on &top - Immer &oben - - - - &Normal - &Normal - - - - Always on &bottom - Immer &unten - - - - &Close - &Schließen - - - - LxQtTaskbarConfiguration - - LxQt Task Manager Settings - LxQt Anwendungsverwalter Einstellungen - - - Window List Content - Fester Inhalt - - - - Task Manager Settings - - - - - Taskbar Contents - - - - - Show windows from current desktop - Zeige Fenster von der aktuellen Arbeitsfläche - - - - Show windows from all desktops - Zeige Fester von allen Arbeitsflächen - - - - Taskbar Appearance - - - - - Minimum button width - - - - - Auto&rotate buttons when the panel is vertical - - - - Window List Appearance - Festerlisten Erscheinungsbild - - - - Button style - Knopf Stil - - - Max button width - Max Knopf breite - - - - Close on middle-click - Schließen mit Mittelklick - - - - Icon and text - Symbole und Text - - - - Only icon - Nur Symbole - - - - Only text - Nur Text - - - diff --git a/plugin-taskbar/translations/taskbar_el_GR.ts b/plugin-taskbar/translations/taskbar_el_GR.ts index cee922b..c7b06a1 100644 --- a/plugin-taskbar/translations/taskbar_el_GR.ts +++ b/plugin-taskbar/translations/taskbar_el_GR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Εφαρμογή - + To &Desktop Στην επι&φάνεια εργασίας - + &All Desktops Ό&λες οι επιφάνειες εργασίας - + Desktop &%1 Επιφάνεια εργασίας &%1 - + &To Current Desktop Στ&ην τρέχουσα επιφάνεια εργασίας - + Ma&ximize &Μεγιστοποίηση - + Maximize vertically Μεγιστοποίηση κάθετα - + Maximize horizontally Μεγιστοποίηση οριζόντια - + &Restore &Επαναφορά - + Mi&nimize Ελα&χιστοποίηση - + Roll down Κύλιση κάτω - + Roll up Κύλιση επάνω - + &Layer Στ&ρώμα - + Always on &top Πάντα ε&πάνω - + &Normal Κα&νονικό - + Always on &bottom Πάντα &κάτω - + &Close Κλεί&σιμο + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Εμφάνιση παραθύρων από την τρέχουσα επιφάνεια εργασίας + Show windows from c&urrent desktop + - Show windows from all desktops - Εμφάνιση παραθύρων από όλες τις επιφάνειες εργασίας + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Εμφάνιση παραθύρων από την τρέχουσα επιφάνεια εργασίας + + + Show windows from all desktops + Εμφάνιση παραθύρων από όλες τις επιφάνειες εργασίας + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Εμφάνιση λίστας παραθύρων - + Button style Στυλ πλήκτρου @@ -148,7 +184,7 @@ Μέγιστο πλάτος πλήκτρου - + Close on middle-click Κλείσιμο με μεσαίο κλικ diff --git a/plugin-taskbar/translations/taskbar_eo.ts b/plugin-taskbar/translations/taskbar_eo.ts index 8a88838..61663db 100644 --- a/plugin-taskbar/translations/taskbar_eo.ts +++ b/plugin-taskbar/translations/taskbar_eo.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikaĵo - + To &Desktop &Al labortablo - + &All Desktops Ĉiuj l&abortabloj - + Desktop &%1 Labortablo &%1 - + &To Current Desktop Al ak&tuala labortablo - + Ma&ximize Ma&ksimumigi - + Maximize vertically Vertikale maksimumigi - + Maximize horizontally Horizontale maksimumigi - + &Restore &Restaŭri - + Mi&nimize &Malmaksimumigi - + Roll down Malsupren rulumi - + Roll up Supren rulumi - + &Layer Tavo&lo - + Always on &top Ĉiam &supre - + &Normal &Normale - + Always on &bottom Ĉiam &malsupre - + &Close &Fermi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Montri fenestrojn el aktuala labortablo + Show windows from c&urrent desktop + - Show windows from all desktops - Montri fenestrojn el ĉiuj labortabloj + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montri fenestrojn el aktuala labortablo + + + Show windows from all desktops + Montri fenestrojn el ĉiuj labortabloj + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apero de listo de fenestroj - + Button style Stilo de butonoj @@ -148,7 +184,7 @@ Maksimuma grando de butonoj - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_es.ts b/plugin-taskbar/translations/taskbar_es.ts index 15d56a4..8789602 100644 --- a/plugin-taskbar/translations/taskbar_es.ts +++ b/plugin-taskbar/translations/taskbar_es.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicación - + To &Desktop Al &escritorio - + &All Desktops &Todos los escritorios - + Desktop &%1 Escritorio &%1 - + &To Current Desktop &Al escritorio actual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar horizontalmente - + &Restore &Restauar - + Mi&nimize Mi&nimizar - + Roll down Desplegar - + Roll up Enrollar - + &Layer &Capa - + Always on &top Siempre &encima - + &Normal &Normal - + Always on &bottom Siempre al &fondo - + &Close &Cerrar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar ventanas del escritorio actual + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar ventanas de todos los escritorios + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio actual + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apariencia de la lista de ventanas - + Button style Estilo del botón @@ -148,7 +184,7 @@ Ancho máximo del botón - + Close on middle-click Cerrar con el boton central diff --git a/plugin-taskbar/translations/taskbar_es_VE.ts b/plugin-taskbar/translations/taskbar_es_VE.ts index b064ad9..d1d9baa 100644 --- a/plugin-taskbar/translations/taskbar_es_VE.ts +++ b/plugin-taskbar/translations/taskbar_es_VE.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicación - + To &Desktop Al &Escritorio - + &All Desktops &Todos los escritorios - + Desktop &%1 Escritorio &%1 - + &To Current Desktop &Al escritorio actual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar Orizzontalmente - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down DesEnrolar - + Roll up Enrolar - + &Layer Ca&pa - + Always on &top Siempre &encima - + &Normal &Normal - + Always on &bottom Siempre por de&bajo - + &Close &Cerrar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar ventanas del escritorio activo + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar ventanas de todos los escritorios + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio activo + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apariencia de la lista de ventanas - + Button style Estilo de boton @@ -148,7 +184,7 @@ Ancho maximo - + Close on middle-click Cerrar en click medio diff --git a/plugin-taskbar/translations/taskbar_eu.ts b/plugin-taskbar/translations/taskbar_eu.ts index 0196e50..dee7fdc 100644 --- a/plugin-taskbar/translations/taskbar_eu.ts +++ b/plugin-taskbar/translations/taskbar_eu.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikazioa - + To &Desktop &Mahaigainera - + &All Desktops Mahaigain &guztiak - + Desktop &%1 &%1 mahaigaina - + &To Current Desktop &Uneko mahaigainera - + Ma&ximize Maximizatu - + Maximize vertically Maximizatu bertikalki - + Maximize horizontally Maximizatu horizontalki - + &Restore &Leheneratu - + Mi&nimize Minimizatu - + Roll down Zabaldu - + Roll up Bildu - + &Layer &Geruza - + Always on &top Beti &goian - + &Normal &Normala - + Always on &bottom Beti &behean - + &Close &Itxi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Erakutsi uneko mahaigaineko leihoak + Show windows from c&urrent desktop + - Show windows from all desktops - Erakutsi mahaigain guztietako leihoak + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Erakutsi uneko mahaigaineko leihoak + + + Show windows from all desktops + Erakutsi mahaigain guztietako leihoak + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Leiho-zerrendaren itxura - + Button style Botoi-estiloa @@ -148,7 +184,7 @@ Botoien zabalera maximoa - + Close on middle-click Itxi erdiko botoia klikatzean diff --git a/plugin-taskbar/translations/taskbar_fi.ts b/plugin-taskbar/translations/taskbar_fi.ts index 391c1f6..3a74d08 100644 --- a/plugin-taskbar/translations/taskbar_fi.ts +++ b/plugin-taskbar/translations/taskbar_fi.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Sovellus - + To &Desktop Työ&pöydälle - + &All Desktops &Kaikille työpöydille - + Desktop &%1 Työpöytä &%1 - + &To Current Desktop &Nykyiselle työpöydälle - + Ma&ximize Suu&renna - + Maximize vertically Suurenna pystysuunnassa - + Maximize horizontally Suurenna vaakasuunnassa - + &Restore &Palauta - + Mi&nimize Pie&nennä - + Roll down Rullaa alas - + Roll up Rullaa ylös - + &Layer Tas&o - + Always on &top Aina &ylimpänä - + &Normal &Tavallinen - + Always on &bottom Aina &alimpana - + &Close &Sulje + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Näytä ikkunat nykyiseltä työpöydältä + Show windows from c&urrent desktop + - Show windows from all desktops - Näytä ikkunat kaikilta työpöydiltä + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Näytä ikkunat nykyiseltä työpöydältä + + + Show windows from all desktops + Näytä ikkunat kaikilta työpöydiltä + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Ikkunaluettelon ulkoasu - + Button style Painiketyyli @@ -148,7 +184,7 @@ Painikkeen enimmäisleveys - + Close on middle-click Sulje hiiren keskimmäisen painikkeen painalluksella diff --git a/plugin-taskbar/translations/taskbar_fr_FR.ts b/plugin-taskbar/translations/taskbar_fr_FR.ts index 7efcfb1..dec8095 100644 --- a/plugin-taskbar/translations/taskbar_fr_FR.ts +++ b/plugin-taskbar/translations/taskbar_fr_FR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Application - + To &Desktop Vers &le bureau - + &All Desktops &Tous les bureaux - + Desktop &%1 Bureau &%1 - + &To Current Desktop &Vers le bureau courant - + Ma&ximize Maximiser - + Maximize vertically Maximiser verticalement - + Maximize horizontally Maximiser horizontalement - + &Restore &Restaurer - + Mi&nimize Mi&nimiser - + Roll down Enrouler vers le bas - + Roll up Enrouler vers le haut - + &Layer &Calque - + Always on &top Toujours au &dessus - + &Normal &Normal - + Always on &bottom Toujours en &bas - + &Close &Fermer + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Montrer les fenêtres du bureau actuel + Show windows from c&urrent desktop + - Show windows from all desktops - Montrer les fenêtres de tous les bureaux + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montrer les fenêtres du bureau actuel + + + Show windows from all desktops + Montrer les fenêtres de tous les bureaux + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apparence de la liste des fenêtres - + Button style Style de boutons @@ -148,7 +184,7 @@ Largeur maximale du bouton - + Close on middle-click Fermer d'un clic du milieu diff --git a/plugin-taskbar/translations/taskbar_hu.desktop b/plugin-taskbar/translations/taskbar_hu.desktop index bfea3f8..22f402c 100644 --- a/plugin-taskbar/translations/taskbar_hu.desktop +++ b/plugin-taskbar/translations/taskbar_hu.desktop @@ -8,5 +8,5 @@ Comment=Switch between running applications # Translations -Comment[hu]=Váltás a futú alkalmazások között +Comment[hu]=Váltás a futó alkalmazások között Name[hu]=Feladatkezelő diff --git a/plugin-taskbar/translations/taskbar_hu.ts b/plugin-taskbar/translations/taskbar_hu.ts index 93c55c7..7a812d1 100644 --- a/plugin-taskbar/translations/taskbar_hu.ts +++ b/plugin-taskbar/translations/taskbar_hu.ts @@ -1,155 +1,207 @@ - + LxQtTaskButton - + Application - + Alkalmazás - + To &Desktop - + Erre az asztal&ra - + &All Desktops - + &Az összes asztalra - + Desktop &%1 - + &%1. asztal - + &To Current Desktop - + Az ak&tuális asztalra - + Ma&ximize - + Ma&ximalizálás - + Maximize vertically - + Maximalizálás függőlegesen - + Maximize horizontally - + Maximalizálás vízszintesen - + &Restore - + &Visszaállítás - + Mi&nimize - + Mi&nimalizálás - + Roll down - + Legördítés - + Roll up - + Felgördítés - + &Layer - + Réte&g - + Always on &top - + Mindig &felül - + &Normal - + &Normál - + Always on &bottom - + Min&dig alul - + &Close - + &Bezárás + + + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás LxQtTaskbarConfiguration + + LxQt Task Manager Settings + A LxQt feladatkezelő beállításai + + + Window List Content + Az ablaklista tartalma + Task Manager Settings - + Feladatkezelő beállítása - Taskbar Contents - + General + Általános - Show windows from current desktop - + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak + + + + Show windows from all des&ktops + Az összes asztal ablakai létszanak - - Taskbar Appearance - + + Window &grouping + &Ablakcsoportok - Minimum button width - + Show popup on mouse hover + Egérre felbukkanó jelzés - - Auto&rotate buttons when the panel is vertical - + + Appearance + Megjelenés - - Close on middle-click - + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai - Show windows from all desktops - + Az összes asztal ablakai + + + + Auto&rotate buttons when the panel is vertical + Gombok függőleges panelnál gördülnek + + + Window List Appearance + Az ablaklista megjelenése - + Button style - + Gombstílus: + + + Max button width + Max. gombszélesség + + + + Close on middle-click + Középkattintásra bezárul Icon and text - + Ikon és szöveg Only icon - + Csak ikon Only text - + Csak szöveg diff --git a/plugin-taskbar/translations/taskbar_hu_HU.ts b/plugin-taskbar/translations/taskbar_hu_HU.ts index ec78c39..f6c594a 100644 --- a/plugin-taskbar/translations/taskbar_hu_HU.ts +++ b/plugin-taskbar/translations/taskbar_hu_HU.ts @@ -1,156 +1,192 @@ - + LxQtTaskButton - + Application Alkalmazás - + To &Desktop Erre az asztal&ra - + &All Desktops &Az összes asztalra - + Desktop &%1 &%1. asztal - + &To Current Desktop Az ak&tuális asztalra - + Ma&ximize Ma&ximalizálás - + Maximize vertically Maximalizálás függőlegesen - + Maximize horizontally Maximalizálás vízszintesen - + &Restore &Visszaállítás - + Mi&nimize Mi&nimalizálás - + Roll down Legördítés - + Roll up Felgördítés - + &Layer - Réte&] + Réte&g - + Always on &top Mindig &felül - + &Normal &Normál - + Always on &bottom Min&dig alul - + &Close &Bezárás + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás + + LxQtTaskbarConfiguration LxQt Task Manager Settings - A LxQt feladatkezelő beállításai + A LxQt feladatkezelő beállításai Window List Content - Az ablaklista tartalma + Az ablaklista tartalma Task Manager Settings - + Feladatkezelő beállítása - Taskbar Contents - + General + Általános - Show windows from current desktop - A jelenlegi asztal ablakai + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak - Show windows from all desktops - Az összes asztal ablakai + Show windows from all des&ktops + Az összes asztal ablakai létszanak - - Taskbar Appearance - + + Window &grouping + &Ablakcsoportok - Minimum button width - + Show popup on mouse hover + Egérre felbukkanó jelzés + + + + Appearance + Megjelenés + + + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai + + + Show windows from all desktops + Az összes asztal ablakai - + Auto&rotate buttons when the panel is vertical - + Gombok függőleges panelnál gördülnek Window List Appearance - Az ablaklista megjelenése + Az ablaklista megjelenése - + Button style Gombstílus: Max button width - Max. gombszélesség: + Max. gombszélesség - + Close on middle-click - + Középkattintásra bezárul diff --git a/plugin-taskbar/translations/taskbar_ia.ts b/plugin-taskbar/translations/taskbar_ia.ts index 895e429..95354c3 100644 --- a/plugin-taskbar/translations/taskbar_ia.ts +++ b/plugin-taskbar/translations/taskbar_ia.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_id_ID.ts b/plugin-taskbar/translations/taskbar_id_ID.ts index da02ff8..959e2d1 100644 --- a/plugin-taskbar/translations/taskbar_id_ID.ts +++ b/plugin-taskbar/translations/taskbar_id_ID.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_it_IT.ts b/plugin-taskbar/translations/taskbar_it_IT.ts index e326388..f6498a8 100644 --- a/plugin-taskbar/translations/taskbar_it_IT.ts +++ b/plugin-taskbar/translations/taskbar_it_IT.ts @@ -4,96 +4,109 @@ LxQtTaskButton - + Application Applicazione - + To &Desktop Al &desktop - + &All Desktops &Tutti i desktop - + Desktop &%1 Desktop &%1 - + &To Current Desktop &Al desktop corrente - + Ma&ximize Ma&ssimizza - + Maximize vertically Massimizza verticalmente - + Maximize horizontally Massimizza orizzontalmente - + &Restore &Ripristina - + Mi&nimize Mi&nimizza - + Roll down - Minimizza + &Srotola - + Roll up - Ripristina + &Arrotola - + &Layer &Livello - + Always on &top - Sempre in &alto + Sempre in &primo piano - + &Normal &Normale - + Always on &bottom - Sempre in &basso + Sempre in &secondo piano - + &Close &Chiudi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration LxQt Task Manager Settings - Impostazioni del Task Manager di LxQt + Impostazioni del Task Manager di LXQt Window List Content @@ -102,44 +115,79 @@ Task Manager Settings - + Impostazioni della barra applicazioni - Taskbar Contents + General - Show windows from current desktop - Mostra finestre sul desktop corrente + Show windows from c&urrent desktop + - Show windows from all desktops - Mostra finestre da tutti i desktop + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance + + + Maximum button width + + + + + px + + + + Taskbar Contents + Contenuti della barra + + + Show windows from current desktop + Mostra finestre del desktop corrente + + + Show windows from all desktops + Mostra finestre da tutti i desktop + + + Taskbar Appearance + Aspetto + + + Minimum button width + Larghezza minima dei pulsanti + + + + Auto&rotate buttons when the panel is vertical + Ruota &automaticamente se il panello è verticale + Window List Appearance Aspetto delle finestre - + Button style Stile dei pulsanti @@ -148,7 +196,7 @@ Larghezza massima dei pulsanti - + Close on middle-click Chiudi con un clic del tasto centrale diff --git a/plugin-taskbar/translations/taskbar_ja.ts b/plugin-taskbar/translations/taskbar_ja.ts index 618c4d0..b81a168 100644 --- a/plugin-taskbar/translations/taskbar_ja.ts +++ b/plugin-taskbar/translations/taskbar_ja.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application アプリケーション - + To &Desktop デスクトップへ(&D) - + &All Desktops すべてのデスクトップ(&A) - + Desktop &%1 デスクトップ &%1 - + &To Current Desktop 現在のデスクトップへ(&T) - + Ma&ximize 最大化(&x) - + Maximize vertically 縦方向の最大化 - + Maximize horizontally 横方向の最大化 - + &Restore 復元(&R) - + Mi&nimize 最小化(&N) - + Roll down 広げる - + Roll up たたむ - + &Layer レイヤー(&L) - + Always on &top 常に手前に表示(&T) - + &Normal 通常(&N) - + Always on &bottom 常に奥に表示(&B) - + &Close 閉じる(&C) + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -97,45 +110,80 @@ タスクマネージャーの設定 - Taskbar Contents - タスクバーの内容 + タスクバーの内容 - Show windows from current desktop - 現在のデスクトップのウィンドウを表示 + 現在のデスクトップのウィンドウを表示 - Show windows from all desktops - 全てのデスクトップのウィンドウを表示 + 全てのデスクトップのウィンドウを表示 - Taskbar Appearance - タスクバーの見た目 + タスクバーの見た目 - Minimum button width - ボタン幅の最小値 + ボタン幅の最小値 - + Auto&rotate buttons when the panel is vertical パネルが垂直なときにはボタンを回転(&R) - + Button style ボタンのスタイル - + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + Close on middle-click 中ボタンのクリックで閉じる + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + Icon and text diff --git a/plugin-taskbar/translations/taskbar_ko.ts b/plugin-taskbar/translations/taskbar_ko.ts index 6b3f9d2..2b1d173 100644 --- a/plugin-taskbar/translations/taskbar_ko.ts +++ b/plugin-taskbar/translations/taskbar_ko.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_lt.ts b/plugin-taskbar/translations/taskbar_lt.ts index 970e65d..81bcf69 100644 --- a/plugin-taskbar/translations/taskbar_lt.ts +++ b/plugin-taskbar/translations/taskbar_lt.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Programa - + To &Desktop Į &darbalaukį - + &All Desktops &visus darbalaukius - + Desktop &%1 &%1 darbalaukį - + &To Current Desktop &Į dabartinį darbalaukį - + Ma&ximize &Išdidinti - + Maximize vertically Išdidinti vertikaliai - + Maximize horizontally Išdidinti horizontaliai - + &Restore &Atstatyti - + Mi&nimize &Nuleisti - + Roll down Išvynioti - + Roll up Suvynioti - + &Layer S&luoksnis - + Always on &top Visada &viršuje - + &Normal Įpras&tas - + Always on &bottom Visada vi&ršuje - + &Close &Užverti + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Rodyti tik šio darbalaukio langus + Show windows from c&urrent desktop + - Show windows from all desktops - Rodyti visų darbalaukių langus + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Rodyti tik šio darbalaukio langus + + + Show windows from all desktops + Rodyti visų darbalaukių langus + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Langų sąrašo išvaizda - + Button style Mygtuko stilius @@ -148,7 +184,7 @@ Didžiausias leidžiamas plotis - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_nl.ts b/plugin-taskbar/translations/taskbar_nl.ts index b04a855..2e5a87b 100644 --- a/plugin-taskbar/translations/taskbar_nl.ts +++ b/plugin-taskbar/translations/taskbar_nl.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Toepassing - + To &Desktop Naar &bureaublad - + &All Desktops &Alle bureaubladen - + Desktop &%1 Bureaublad &%1 - + &To Current Desktop &Naar huidig bureaublad - + Ma&ximize Ma&ximaliseren - + Maximize vertically Verticaal maximaliseren - + Maximize horizontally Horizontaal maximaliseren - + &Restore &Herstellen - + Mi&nimize Mi&nimaliseren - + Roll down Uitrollen - + Roll up Oprollen - + &Layer &Laag - + Always on &top Altijd bovenop - + &Normal &Normaal - + Always on &bottom Altijd onderop - + &Close &Sluiten + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Toon vensters van huidig bureaublad + Show windows from c&urrent desktop + - Show windows from all desktops - Toon vensters van alle bureaubladen + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Toon vensters van huidig bureaublad + + + Show windows from all desktops + Toon vensters van alle bureaubladen + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Uiterlijk van vensterlijst - + Button style Stijl van knoppen @@ -148,7 +184,7 @@ Maximale knopbreedte - + Close on middle-click Sluiten bij middelklik diff --git a/plugin-taskbar/translations/taskbar_pl_PL.ts b/plugin-taskbar/translations/taskbar_pl_PL.ts index 0677000..c14f3dd 100644 --- a/plugin-taskbar/translations/taskbar_pl_PL.ts +++ b/plugin-taskbar/translations/taskbar_pl_PL.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikacja - + To &Desktop Na &pulpit - + &All Desktops &Wszystkie pulpity - + Desktop &%1 Pulpit &%1 - + &To Current Desktop &Na obecny pulpit - + Ma&ximize Zma&ksymalizuj - + Maximize vertically Zmaksymalizuj pionowo - + Maximize horizontally Zmaksymalizuj poziomo - + &Restore &Odzyskaj - + Mi&nimize Zmi&nimalizuj - + Roll down Zwiń - + Roll up Rozwiń - + &Layer &Warstwa - + Always on &top Zawsze na &wierzchu - + &Normal &Normalnie - + Always on &bottom Zawsze pod &spodem - + &Close &Zamknij + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Pokazuj okna z obecnego pulpitu + Show windows from c&urrent desktop + - Show windows from all desktops - Pokazuj okna ze wszystkich pulpitów + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokazuj okna z obecnego pulpitu + + + Show windows from all desktops + Pokazuj okna ze wszystkich pulpitów + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Wygląd listy zadań - + Button style Styl przycisku @@ -148,7 +184,7 @@ Maksymalna szerokość - + Close on middle-click Zamknij środkowym klawiszem diff --git a/plugin-taskbar/translations/taskbar_pt.ts b/plugin-taskbar/translations/taskbar_pt.ts index 5c8c24e..e121959 100644 --- a/plugin-taskbar/translations/taskbar_pt.ts +++ b/plugin-taskbar/translations/taskbar_pt.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicação - + To &Desktop Na área &de trabalho - + &All Desktops Tod&as as áreas de trabalho - + Desktop &%1 Área de trabalho &%1 - + &To Current Desktop Na área de &trabalho atual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar na vertical - + Maximize horizontally Maximizar na horizontal - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down Enrolar para baixo - + Roll up Enrolar para cima - + &Layer Ca&mada - + Always on &top Sempre na &frente - + &Normal &Normal - + Always on &bottom Sempre a&trás - + &Close Fe&char + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar janelas da área de trabalho atual + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar janelas de todas as áreas de trabalho + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar janelas da área de trabalho atual + + + Show windows from all desktops + Mostrar janelas de todas as áreas de trabalho + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Aparência da lista de janelas - + Button style Estilo dos botões @@ -148,7 +184,7 @@ Largura máxima do botão - + Close on middle-click Fechar com a roda do rato diff --git a/plugin-taskbar/translations/taskbar_pt_BR.ts b/plugin-taskbar/translations/taskbar_pt_BR.ts index 69c7fe1..cb6db4e 100644 --- a/plugin-taskbar/translations/taskbar_pt_BR.ts +++ b/plugin-taskbar/translations/taskbar_pt_BR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicativo - + To &Desktop Para a área &de trabalho - + &All Desktops Todas &as áreas de trabalho - + Desktop &%1 Área de trabalho &%1 - + &To Current Desktop Para a área de &trabalho atual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar horizontalmente - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down Rolar para baixo - + Roll up Rolar para cima - + &Layer &Camada - + Always on &top Sempre em &cima - + &Normal &Normal - + Always on &bottom Sempre em &baixo - + &Close &Fechar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Exibir as janelas da área de trabalho atual + Show windows from c&urrent desktop + - Show windows from all desktops - Exibir as janelas de todas as áreas de trabalho + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Exibir as janelas da área de trabalho atual + + + Show windows from all desktops + Exibir as janelas de todas as áreas de trabalho + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Aparência da lista de janelas - + Button style Estilo dos botões @@ -148,7 +184,7 @@ Largura máxima do botão - + Close on middle-click Fechar em meio clique diff --git a/plugin-taskbar/translations/taskbar_ro_RO.ts b/plugin-taskbar/translations/taskbar_ro_RO.ts index 46ab9af..a0ad0d3 100644 --- a/plugin-taskbar/translations/taskbar_ro_RO.ts +++ b/plugin-taskbar/translations/taskbar_ro_RO.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicație - + To &Desktop Către &desktop - + &All Desktops Toate ecr&anele - + Desktop &%1 Ecranul &%1 - + &To Current Desktop Că&tre ecranul virtual curent - + Ma&ximize Ma&ximizează - + Maximize vertically Maximizează pe verticală - + Maximize horizontally Maximizează pe orizontală - + &Restore &Restaurează - + Mi&nimize Mi&nimizează - + Roll down Derulează în jos - + Roll up Derulează în sus - + &Layer &Strat - + Always on &top Întotdeauna de&asupra - + &Normal &Normal - + Always on &bottom Întotdeauna de&desubt - + &Close În&chide + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -102,31 +115,54 @@ - Taskbar Contents + General - Show windows from current desktop - Afișează ferestrele de pe ecranul virtual curent + Show windows from c&urrent desktop + - Show windows from all desktops - Afișează ferestrele din toate ecranele virtuale + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Afișează ferestrele de pe ecranul virtual curent + + + Show windows from all desktops + Afișează ferestrele din toate ecranele virtuale + + + Auto&rotate buttons when the panel is vertical @@ -135,7 +171,7 @@ Aspect listă ferestre - + Button style Stil butoane @@ -144,7 +180,7 @@ Lățime maximă butoane - + Close on middle-click Închide prin clic pe butonul din mijloc diff --git a/plugin-taskbar/translations/taskbar_ru.ts b/plugin-taskbar/translations/taskbar_ru.ts index b38a3aa..5e9cda9 100644 --- a/plugin-taskbar/translations/taskbar_ru.ts +++ b/plugin-taskbar/translations/taskbar_ru.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Приложение - + To &Desktop &На рабочий стол - + &All Desktops &Все рабочие столы - + Desktop &%1 Рабочий стол &%1 - + &To Current Desktop На &текущий рабочий стол - + Ma&ximize Р&аспахнуть - + Maximize vertically Распахнуть по вертикали - + Maximize horizontally Распахнуть по горизонтали - + &Restore &Восстановить - + Mi&nimize &Свернуть - + Roll down Развернуть из заголовока - + Roll up Свернуть в заголовок - + &Layer &Положение - + Always on &top Всегда на &верху - + &Normal &Обычное - + Always on &bottom Всегда в&низу - + &Close &Закрыть + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + LxQtTaskbarConfiguration @@ -98,58 +111,94 @@ - Taskbar Contents - Содержимое панели задач + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид - - Show windows from current desktop - Показывать окна только с текущего стола + + Maximum button width + Максимальная ширина кнопки - - Show windows from all desktops - Показывать окна со всех рабочих столов + + + px + пикс - - Taskbar Appearance - Внешний вид панели задач + + Maximum button height + Максимальная высота кнопки - + Button style Стиль кнопок - - Minimum button width - Минимальная ширина кнопки + + Show only windows from desktop + Показывать окна только с рабочего стола - + Auto&rotate buttons when the panel is vertical Авто&поворот кнопок, когда панель вертикальна - + Close on middle-click Закрыть по щелчку средней кнопки мыши - + Icon and text Значок и текст - + Only icon Только значок - + Only text Только текст + + + Current + Текущий + diff --git a/plugin-taskbar/translations/taskbar_ru_RU.ts b/plugin-taskbar/translations/taskbar_ru_RU.ts index 9130364..02202d0 100644 --- a/plugin-taskbar/translations/taskbar_ru_RU.ts +++ b/plugin-taskbar/translations/taskbar_ru_RU.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Приложение - + To &Desktop &На рабочий стол - + &All Desktops &Все рабочие столы - + Desktop &%1 Рабочий стол &%1 - + &To Current Desktop На &текущий рабочий стол - + Ma&ximize Р&аспахнуть - + Maximize vertically Распахнуть по вертикали - + Maximize horizontally Распахнуть по горизонтали - + &Restore &Восстановить - + Mi&nimize &Свернуть - + Roll down Развернуть из заголовока - + Roll up Свернуть в заголовок - + &Layer &Положение - + Always on &top Всегда на &верху - + &Normal &Обычное - + Always on &bottom Всегда в&низу - + &Close &Закрыть + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + LxQtTaskbarConfiguration @@ -98,58 +111,94 @@ - Taskbar Contents - Содержимое панели задач + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид - - Show windows from current desktop - Показывать окна только с текущего стола + + Maximum button width + Максимальная ширина кнопки - - Show windows from all desktops - Показывать окна со всех рабочих столов + + + px + пикс - - Taskbar Appearance - Внешний вид панели задач + + Maximum button height + Максимальная высота кнопки - + Button style Стиль кнопок - - Minimum button width - Минимальная ширина кнопки + + Show only windows from desktop + Показывать окна только с рабочего стола - + Auto&rotate buttons when the panel is vertical Авто&поворот кнопок, когда панель вертикальна - + Close on middle-click Закрыть по щелчку средней кнопки мыши - + Icon and text Значок и текст - + Only icon Только значок - + Only text Только текст + + + Current + Текущий + diff --git a/plugin-taskbar/translations/taskbar_sk_SK.ts b/plugin-taskbar/translations/taskbar_sk_SK.ts index 34187fe..ba7c83c 100644 --- a/plugin-taskbar/translations/taskbar_sk_SK.ts +++ b/plugin-taskbar/translations/taskbar_sk_SK.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikácia - + To &Desktop Na &plochu - + &All Desktops &Všetky plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na aktuálnu plochu - + Ma&ximize Ma&ximalizovať - + Maximize vertically Maximalizovať zvisle - + Maximize horizontally Maximalizovať vodorovne - + &Restore &Obnoviť - + Mi&nimize Mi&nimalizovať - + Roll down Zrolovať nahor - + Roll up Zrolovať dolu - + &Layer &Vrstva - + Always on &top Vždy &navrchu - + &Normal &Normálne - + Always on &bottom Vždy na&spodku - + &Close &Zatvoriť + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Zobraziť okná z aktuálnej plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Zobraziť okná z každej plochy + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Zobraziť okná z aktuálnej plochy + + + Show windows from all desktops + Zobraziť okná z každej plochy + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhľad zoznamu okien - + Button style Štýl tlačidiel @@ -148,7 +184,7 @@ Maximálna šírka tlačidla - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_sl.ts b/plugin-taskbar/translations/taskbar_sl.ts index e90975f..155fda5 100644 --- a/plugin-taskbar/translations/taskbar_sl.ts +++ b/plugin-taskbar/translations/taskbar_sl.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop &Na namizje - + &All Desktops &Vsa namizja - + Desktop &%1 Namizje &%1 - + &To Current Desktop Na &trenutno namizje - + Ma&ximize &Razpni - + Maximize vertically Razpni navpično - + Maximize horizontally Razpni vodoravno - + &Restore &Obnovi - + Mi&nimize Po&manjšaj - + Roll down Razvij - + Roll up Zvij - + &Layer &Plast - + Always on &top Vedno na &vrhu - + &Normal &Običajno - + Always on &bottom Vedno na &dnu - + &Close &Zapri + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Pokaži okna s trenutnega namizja + Show windows from c&urrent desktop + - Show windows from all desktops - Pokaži okna z vseh namizij + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokaži okna s trenutnega namizja + + + Show windows from all desktops + Pokaži okna z vseh namizij + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Videz seznama oken - + Button style Slog z gumbi @@ -148,7 +184,7 @@ Največja širina gumbov - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_sr@latin.ts b/plugin-taskbar/translations/taskbar_sr@latin.ts index 0ce8342..fbde286 100644 --- a/plugin-taskbar/translations/taskbar_sr@latin.ts +++ b/plugin-taskbar/translations/taskbar_sr@latin.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_sr_BA.ts b/plugin-taskbar/translations/taskbar_sr_BA.ts index c10a40f..82ab86e 100644 --- a/plugin-taskbar/translations/taskbar_sr_BA.ts +++ b/plugin-taskbar/translations/taskbar_sr_BA.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програм - + To &Desktop На &површ - + &All Desktops &све површи - + Desktop &%1 површ &%1 - + &To Current Desktop &На тренутну површ - + Ma&ximize Ма&ксимизуј - + Maximize vertically Максимизуј вертикално - + Maximize horizontally Максимизуј хоризонтално - + &Restore &Обнови - + Mi&nimize &Минимизуј - + Roll down Одмотај - + Roll up Намотај - + &Layer &Слој - + Always on &top увијек &изнад - + &Normal &нормално - + Always on &bottom увијек испо&д - + &Close &Затвори + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,55 @@ - Taskbar Contents + General - Show windows from current desktop - Прикажи прозоре са тренутне површи + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + Auto&rotate buttons when the panel is vertical - + Close on middle-click @@ -139,16 +176,15 @@ wlcB - Show windows from all desktops - Прикажи прозоре са свих површи + Прикажи прозоре са свих површи Window List Appearance Изглед листе прозора - + Button style Стил тастера diff --git a/plugin-taskbar/translations/taskbar_sr_RS.ts b/plugin-taskbar/translations/taskbar_sr_RS.ts index fdb6660..2409003 100644 --- a/plugin-taskbar/translations/taskbar_sr_RS.ts +++ b/plugin-taskbar/translations/taskbar_sr_RS.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програм - + To &Desktop На &површ - + &All Desktops &све површи - + Desktop &%1 површ &%1 - + &To Current Desktop &На тренутну површ - + Ma&ximize Ма&ксимизуј - + Maximize vertically Максимизуј вертикално - + Maximize horizontally Максимизуј хоризонтално - + &Restore &Обнови - + Mi&nimize &Минимизуј - + Roll down Одмотај - + Roll up Намотај - + &Layer &Слој - + Always on &top увек &изнад - + &Normal &нормално - + Always on &bottom увек испо&д - + &Close &Затвори + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Прикажи прозоре са тренутне површи + Show windows from c&urrent desktop + - Show windows from all desktops - Прикажи прозоре са свих површи + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + Show windows from all desktops + Прикажи прозоре са свих површи + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Изглед листе прозора - + Button style Стил тастера @@ -148,7 +184,7 @@ Макс. ширина тастера - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_th_TH.ts b/plugin-taskbar/translations/taskbar_th_TH.ts index 33f2d3b..0ca915e 100644 --- a/plugin-taskbar/translations/taskbar_th_TH.ts +++ b/plugin-taskbar/translations/taskbar_th_TH.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application โปรแกรม - + To &Desktop ไปยัง &พ&ื&้นโต๊ะ - + &All Desktops &ท&ุกพื้นโต๊ะ - + Desktop &%1 พื้นโต๊ะ &%1 - + &To Current Desktop &ไปยังพื้นโต๊ะปัจจุบัน - + Ma&ximize &ขยายแผ่ - + Maximize vertically ขยายแผ่ทางแนวตั้ง - + Maximize horizontally ขยายแผ่ทางแนวนอน - + &Restore &ค&ืนสภาพ - + Mi&nimize &ย&่อเก็บ - + Roll down ม้วนลง - + Roll up ม้วนขึ้น - + &Layer &ลำดับชั้น - + Always on &top ด้าน&หน้าเสมอ - + &Normal &ปกติ - + Always on &bottom ด้านหลัง&งเสมอ - + &Close ปิ&ด + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - แสดงหน้าต่างเฉพาะพื้นโต๊ะปัจจุบัน + Show windows from c&urrent desktop + - Show windows from all desktops - แสดงหน้าต่างจากทุกพื้นโต๊ะ + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + แสดงหน้าต่างเฉพาะพื้นโต๊ะปัจจุบัน + + + Show windows from all desktops + แสดงหน้าต่างจากทุกพื้นโต๊ะ + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ ลักษณะรายการหน้าต่าง - + Button style รูปแบบปุ่ม @@ -148,7 +184,7 @@ ความกว้างปุ่มขนาดสูงสุด - + Close on middle-click ปิดด้วยการคลิกปุ่มกลาง diff --git a/plugin-taskbar/translations/taskbar_tr.ts b/plugin-taskbar/translations/taskbar_tr.ts index f830e48..862ae07 100644 --- a/plugin-taskbar/translations/taskbar_tr.ts +++ b/plugin-taskbar/translations/taskbar_tr.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Uygulama - + To &Desktop &Masaüstüne - + &All Desktops &Tüm Masaüstlerine - + Desktop &%1 Masaüstü &%1 - + &To Current Desktop &Şimdiki Masaüstüne - + Ma&ximize Bü&yüt - + Maximize vertically Dikey büyüt - + Maximize horizontally Yatay büyüt - + &Restore &Geri getir - + Mi&nimize Kü&çült - + Roll down Aşağı indir - + Roll up Yukarı çıkar - + &Layer &Katman - + Always on &top Her zaman &üstte - + &Normal &Normal - + Always on &bottom Her zaman &altta - + &Close &Kapat + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Şimdiki masaüstündeki pencereleri göster + Show windows from c&urrent desktop + - Show windows from all desktops - Tüm masaüstlerindeki pencereleri göster + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Şimdiki masaüstündeki pencereleri göster + + + Show windows from all desktops + Tüm masaüstlerindeki pencereleri göster + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Pencere Listesi Görünümü - + Button style Düğme biçimi @@ -148,7 +184,7 @@ En fazla düğme genişliği - + Close on middle-click Orta tıklama ile kapat diff --git a/plugin-taskbar/translations/taskbar_uk.ts b/plugin-taskbar/translations/taskbar_uk.ts index 62dc0cc..5752841 100644 --- a/plugin-taskbar/translations/taskbar_uk.ts +++ b/plugin-taskbar/translations/taskbar_uk.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програма - + To &Desktop На &стільницю - + &All Desktops На &всі стільниці - + Desktop &%1 Стільниця &%1 - + &To Current Desktop На &поточну стільницю - + Ma&ximize Ма&ксимізувати - + Maximize vertically Максимізувати вертикально - + Maximize horizontally Максимізувати горизонтально - + &Restore &Розгорнути - + Mi&nimize &Згорнути - + Roll down Посунути вниз - + Roll up Посунути вгору - + &Layer &Шар - + Always on &top Завжди з&гори - + &Normal &Типово - + Always on &bottom Завжди з&низу - + &Close З&акрити + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Показувати вікна поточної стільниці + Show windows from c&urrent desktop + - Show windows from all desktops - Показувати вікна всіх стільниць + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Показувати вікна поточної стільниці + + + Show windows from all desktops + Показувати вікна всіх стільниць + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Вигляд списку вікон - + Button style Стиль кнопок @@ -148,7 +184,7 @@ Макс. довжина кнопки - + Close on middle-click Закривати по середній кнопці миші diff --git a/plugin-taskbar/translations/taskbar_zh_CN.ts b/plugin-taskbar/translations/taskbar_zh_CN.ts index 4711892..15b1eb9 100644 --- a/plugin-taskbar/translations/taskbar_zh_CN.ts +++ b/plugin-taskbar/translations/taskbar_zh_CN.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application 应用程序 - + To &Desktop 到&桌面 - + &All Desktops &全部桌面 - + Desktop &%1 桌面 &%1 - + &To Current Desktop &到当前桌面 - + Ma&ximize 最&大化 - + Maximize vertically 垂直最大化 - + Maximize horizontally 水平最大化 - + &Restore &恢复 - + Mi&nimize 最&小化 - + Roll down 卷下 - + Roll up 卷上 - + &Layer &层 - + Always on &top 总在&顶层 - + &Normal &正常 - + Always on &bottom 总在&底层 - + &Close &关闭 + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - 显示当前桌面的窗口 + Show windows from c&urrent desktop + - Show windows from all desktops - 显示所有桌面的窗口 + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 显示当前桌面的窗口 + + + Show windows from all desktops + 显示所有桌面的窗口 + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ 窗口列表外观 - + Button style 按钮样式 @@ -148,7 +184,7 @@ 最大按钮宽度 - + Close on middle-click 鼠标中击时关闭 diff --git a/plugin-taskbar/translations/taskbar_zh_TW.ts b/plugin-taskbar/translations/taskbar_zh_TW.ts index fac5b24..99f0b23 100644 --- a/plugin-taskbar/translations/taskbar_zh_TW.ts +++ b/plugin-taskbar/translations/taskbar_zh_TW.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application 應用程式 - + To &Desktop 傳送到桌面(&D) - + &All Desktops 傳送到全部桌面(&A) - + Desktop &%1 桌面 &%1 - + &To Current Desktop 傳送到當前桌面(&T) - + Ma&ximize 最大化(&x) - + Maximize vertically 垂直最大化 - + Maximize horizontally 水平最大化 - + &Restore 恢復(&R) - + Mi&nimize 最小化(&n) - + Roll down 放下視窗 - + Roll up 捲起視窗 - + &Layer 層(&L) - + Always on &top 總是在最上層(&t) - + &Normal 正常(&N) - + Always on &bottom 總是在最底層(&b) - + &Close 關閉(&C) + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - 顯示當前桌面視窗 + Show windows from c&urrent desktop + - Show windows from all desktops - 顯示所有桌面視窗 + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 顯示當前桌面視窗 + + + Show windows from all desktops + 顯示所有桌面視窗 + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ 視窗清單外觀 - + Button style 按鈕樣式 @@ -148,7 +184,7 @@ 最大按鈕寬度 - + Close on middle-click 按滑鼠中鍵關閉 diff --git a/plugin-tray/CMakeLists.txt b/plugin-tray/CMakeLists.txt index d5238f8..184c92a 100644 --- a/plugin-tray/CMakeLists.txt +++ b/plugin-tray/CMakeLists.txt @@ -1,8 +1,12 @@ set(PLUGIN "tray") -include(FindPkgConfig) include(CheckLibraryExists) +find_package(PkgConfig) +pkg_check_modules(XCB REQUIRED xcb) +pkg_check_modules(XCB_UTIL REQUIRED xcb-util) +pkg_check_modules(XCB_DAMAGE REQUIRED xcb-damage) + find_package(X11 REQUIRED) pkg_check_modules(XCOMPOSITE REQUIRED xcomposite) pkg_check_modules(XDAMAGE REQUIRED xdamage) @@ -22,13 +26,6 @@ set(SOURCES xfitman.cpp ) -set(MOCS - lxqttrayplugin.h - lxqttray.h - trayicon.h - xfitman.h -) - set(LIBRARIES ${X11_LIBRARIES} ${XCOMPOSITE_LIBRARIES} diff --git a/plugin-tray/lxqttray.cpp b/plugin-tray/lxqttray.cpp index efa8d05..83736d4 100644 --- a/plugin-tray/lxqttray.cpp +++ b/plugin-tray/lxqttray.cpp @@ -225,6 +225,7 @@ TrayIcon* LxQtTray::findIcon(Window id) ************************************************/ void LxQtTray::setIconSize(QSize iconSize) { + mIconSize = iconSize; unsigned long size = qMin(mIconSize.width(), mIconSize.height()); XChangeProperty(mDisplay, mTrayId, @@ -234,10 +235,6 @@ void LxQtTray::setIconSize(QSize iconSize) PropModeReplace, (unsigned char*)&size, 1); - - mIconSize = iconSize; - foreach(TrayIcon* icon, mIcons) - icon->setIconSize(mIconSize); } @@ -384,7 +381,6 @@ void LxQtTray::addIcon(Window winId) return; } - icon->setIconSize(mIconSize); mIcons.append(icon); mLayout->addWidget(icon); } diff --git a/plugin-tray/lxqttray.h b/plugin-tray/lxqttray.h index 53354cc..20ab76b 100644 --- a/plugin-tray/lxqttray.h +++ b/plugin-tray/lxqttray.h @@ -34,6 +34,7 @@ #include #include #include +#include "fixx11h.h" class TrayIcon; class QSize; diff --git a/plugin-tray/lxqttrayplugin.h b/plugin-tray/lxqttrayplugin.h index 49d9068..fafc610 100644 --- a/plugin-tray/lxqttrayplugin.h +++ b/plugin-tray/lxqttrayplugin.h @@ -42,7 +42,7 @@ public: virtual QWidget *widget(); virtual QString themeId() const { return "Tray"; } - virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment; } + virtual Flags flags() const { return PreferRightAlignment | SingleInstance | NeedsHandle; } void realign(); bool isSeparate() const { return true; } @@ -55,10 +55,10 @@ private: class LxQtTrayPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtTrayPlugin(startupInfo); } diff --git a/plugin-tray/resources/tray.desktop.in b/plugin-tray/resources/tray.desktop.in index 110e874..7225961 100644 --- a/plugin-tray/resources/tray.desktop.in +++ b/plugin-tray/resources/tray.desktop.in @@ -3,5 +3,6 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name=System tray Comment=Display applications minimized to the system tray. +Icon=go-bottom #TRANSLATIONS_DIR=../translations diff --git a/plugin-tray/translations/tray_de.desktop b/plugin-tray/translations/tray_de.desktop index a4f2628..30e2af1 100644 --- a/plugin-tray/translations/tray_de.desktop +++ b/plugin-tray/translations/tray_de.desktop @@ -1,12 +1,3 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=System tray -Comment=Display applications minimized to the system tray. - -#TRANSLATIONS_DIR=../translations - - # Translations -Comment[de]=Zugang zu minimierten Anwendungen in der Fensterleiste -Name[de]=Fensterleiste +Name[de]=Benachrichtigungsfläche +Comment[de]=Benachrichtigungen von Anwendungen gem. System Tray Protocol diff --git a/plugin-volume/CMakeLists.txt b/plugin-volume/CMakeLists.txt index 6dd8c6d..55457b1 100644 --- a/plugin-volume/CMakeLists.txt +++ b/plugin-volume/CMakeLists.txt @@ -20,25 +20,14 @@ set(SOURCES ossengine.cpp ) -set(MOCS - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.h - lxqtvolume.h - volumebutton.h - volumepopup.h - audiodevice.h - lxqtvolumeconfiguration.h - audioengine.h - ossengine.h -) - set(UIS lxqtvolumeconfiguration.ui ) set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt-globalkeys + Qt5Xdg ) if(PULSEAUDIO_FOUND) diff --git a/plugin-volume/audiodevice.cpp b/plugin-volume/audiodevice.cpp index b50f2af..1882426 100644 --- a/plugin-volume/audiodevice.cpp +++ b/plugin-volume/audiodevice.cpp @@ -26,7 +26,6 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "audiodevice.h" - #include "audioengine.h" AudioDevice::AudioDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent) : @@ -74,7 +73,7 @@ void AudioDevice::setIndex(uint index) void AudioDevice::setVolumeNoCommit(int volume) { if (m_engine) - volume = qBound(0, volume, m_engine->volumeMax(this)); + volume = m_engine->volumeBounded(volume, this); if (m_volume == volume) return; diff --git a/plugin-volume/audiodevice.h b/plugin-volume/audiodevice.h index 1a9e3c2..8b854ae 100644 --- a/plugin-volume/audiodevice.h +++ b/plugin-volume/audiodevice.h @@ -59,7 +59,7 @@ public: void setName(const QString &name); void setDescription(const QString &description); void setIndex(uint index); - + AudioEngine* engine() { return m_engine; } public slots: diff --git a/plugin-volume/audioengine.cpp b/plugin-volume/audioengine.cpp index b1cbd81..6cef716 100644 --- a/plugin-volume/audioengine.cpp +++ b/plugin-volume/audioengine.cpp @@ -43,6 +43,15 @@ AudioEngine::~AudioEngine() m_sinks.clear(); } +int AudioEngine::volumeBounded(int volume, AudioDevice* device) const +{ + int maximum = volumeMax(device); + double v = ((double) volume / 100.0) * maximum; + double bounded = qBound(0, v, maximum); + return qRound((bounded / maximum) * 100); +} + + void AudioEngine::mute(AudioDevice *device) { setMute(device, true); diff --git a/plugin-volume/audioengine.h b/plugin-volume/audioengine.h index cfb83d4..5fb9ea7 100644 --- a/plugin-volume/audioengine.h +++ b/plugin-volume/audioengine.h @@ -44,6 +44,7 @@ public: const QList &sinks() const { return m_sinks; } virtual int volumeMax(AudioDevice *device) const = 0; + virtual int volumeBounded(int volume, AudioDevice *device) const; virtual const QString backendName() const = 0; public slots: diff --git a/plugin-volume/lxqtvolume.cpp b/plugin-volume/lxqtvolume.cpp index 6dd2977..0476c81 100644 --- a/plugin-volume/lxqtvolume.cpp +++ b/plugin-volume/lxqtvolume.cpp @@ -60,13 +60,42 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): m_notification = new LxQt::Notification("", this); - // global key shortcuts - QString shortcutNotRegistered; - m_keyVolumeUp = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/up").arg(settings()->group()), tr("Increase sound volume"), this); if (m_keyVolumeUp) { + connect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); connect(m_keyVolumeUp, SIGNAL(activated()), this, SLOT(handleShortcutVolumeUp())); + } + m_keyVolumeDown = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/down").arg(settings()->group()), tr("Decrease sound volume"), this); + if (m_keyVolumeDown) + { + connect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown())); + } + m_keyMuteToggle = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/mute").arg(settings()->group()), tr("Mute/unmute sound volume"), this); + if (m_keyMuteToggle) + { + connect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute())); + } + + settingsChanged(); +} + +LxQtVolume::~LxQtVolume() +{ + delete m_volumeButton; +} + +void LxQtVolume::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + QString shortcutNotRegistered; + + if (shortcut == m_keyVolumeUp) + { + disconnect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyVolumeUp->shortcut().isEmpty()) { @@ -76,12 +105,9 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): shortcutNotRegistered = " '" DEFAULT_UP_SHORTCUT "'"; } } - } - - m_keyVolumeDown = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/down").arg(settings()->group()), tr("Decrease sound volume"), this); - if (m_keyVolumeDown) + } else if (shortcut == m_keyVolumeDown) { - connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown())); + disconnect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyVolumeDown->shortcut().isEmpty()) { @@ -91,12 +117,9 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): shortcutNotRegistered += " '" DEFAULT_DOWN_SHORTCUT "'"; } } - } - - m_keyMuteToggle = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/mute").arg(settings()->group()), tr("Mute/unmute sound volume"), this); - if (m_keyMuteToggle) + } else if (shortcut == m_keyMuteToggle) { - connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute())); + disconnect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyMuteToggle->shortcut().isEmpty()) { @@ -116,13 +139,6 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): m_notification->setTimeout(1000); m_notification->setUrgencyHint(LxQt::Notification::UrgencyLow); - - settingsChanged(); -} - -LxQtVolume::~LxQtVolume() -{ - delete m_volumeButton; } void LxQtVolume::setAudioEngine(AudioEngine *engine) diff --git a/plugin-volume/lxqtvolume.h b/plugin-volume/lxqtvolume.h index b72fe3f..56fd869 100644 --- a/plugin-volume/lxqtvolume.h +++ b/plugin-volume/lxqtvolume.h @@ -66,6 +66,7 @@ protected slots: void handleShortcutVolumeUp(); void handleShortcutVolumeDown(); void handleShortcutVolumeMute(); + void shortcutRegistered(); private: AudioEngine *m_engine; @@ -86,7 +87,7 @@ class LxQtVolumePluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtVolume(startupInfo); } diff --git a/plugin-volume/ossengine.cpp b/plugin-volume/ossengine.cpp index 7a6e8b6..13b6b9c 100644 --- a/plugin-volume/ossengine.cpp +++ b/plugin-volume/ossengine.cpp @@ -36,7 +36,7 @@ #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__NetBSD__) #include #elif defined(__linux__) || defined(__Linux__) #include diff --git a/plugin-volume/translations/volume.ts b/plugin-volume/translations/volume.ts index 4171d29..9c9af62 100644 --- a/plugin-volume/translations/volume.ts +++ b/plugin-volume/translations/volume.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ar.ts b/plugin-volume/translations/volume_ar.ts index 109debb..493c95a 100644 --- a/plugin-volume/translations/volume_ar.ts +++ b/plugin-volume/translations/volume_ar.ts @@ -8,28 +8,28 @@ إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_cs.ts b/plugin-volume/translations/volume_cs.ts index cfb7d75..1230b30 100644 --- a/plugin-volume/translations/volume_cs.ts +++ b/plugin-volume/translations/volume_cs.ts @@ -8,28 +8,28 @@ Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_cs_CZ.ts b/plugin-volume/translations/volume_cs_CZ.ts index ae9f3f4..815ac1f 100644 --- a/plugin-volume/translations/volume_cs_CZ.ts +++ b/plugin-volume/translations/volume_cs_CZ.ts @@ -8,28 +8,28 @@ Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_da_DK.ts b/plugin-volume/translations/volume_da_DK.ts index 34aaae4..0df3bcd 100644 --- a/plugin-volume/translations/volume_da_DK.ts +++ b/plugin-volume/translations/volume_da_DK.ts @@ -8,28 +8,28 @@ Vis Skrivebord: Global genvej '%1' kan ikke registreres - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_de.desktop b/plugin-volume/translations/volume_de.desktop new file mode 100644 index 0000000..32df5d6 --- /dev/null +++ b/plugin-volume/translations/volume_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Lautstärkeeinstellung +Comment[de]=Systemlautstärke einstellen und den bevorzugten Mischer starten. diff --git a/plugin-volume/translations/volume_de.ts b/plugin-volume/translations/volume_de.ts new file mode 100644 index 0000000..4f32770 --- /dev/null +++ b/plugin-volume/translations/volume_de.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Lautstärke erhöhen + + + + Decrease sound volume + Lautstärke verringern + + + + Mute/unmute sound volume + Lautstärke stummschalten/wiederherstellen + + + + Volume Control: The following shortcuts can not be registered: %1 + Lautstärkeeinstellung: Die folgenden Tastaturkürzel konnten nicht registriert werden: %1 + + + + + Volume: %1 + Lautstärke: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Lautstärkeeinstellungen + + + + Device to control + Zu steuerndes Gerät + + + + Alsa + ALSA + + + + PulseAudio + PulseAudio + + + + OSS + OSS + + + + Behavior + Verhalten + + + + Mute on middle click + Stummschaltung per Mittelklick + + + + Show on mouse click + Bei Mausklick anzeigen + + + + Allow volume beyond 100% (0dB) + Lautstärke über 100% (0dB) erlauben + + + + Volume adjust step + Lautstärkeschrittweite + + + + External Mixer + Externer Mischer + + + + VolumePopup + + + Launch mixer + Mischer starten + + + + Mi&xer + &Mischer + + + diff --git a/plugin-volume/translations/volume_el_GR.ts b/plugin-volume/translations/volume_el_GR.ts index adfa582..98563c6 100644 --- a/plugin-volume/translations/volume_el_GR.ts +++ b/plugin-volume/translations/volume_el_GR.ts @@ -8,28 +8,28 @@ Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_eo.ts b/plugin-volume/translations/volume_eo.ts index 4f31086..38b4f41 100644 --- a/plugin-volume/translations/volume_eo.ts +++ b/plugin-volume/translations/volume_eo.ts @@ -8,28 +8,28 @@ Montri labortablon: ĉiea klavkombino '%1' ne registreblas - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_es.ts b/plugin-volume/translations/volume_es.ts index 7514323..14fc080 100644 --- a/plugin-volume/translations/volume_es.ts +++ b/plugin-volume/translations/volume_es.ts @@ -8,28 +8,28 @@ Mostrar Escritorio: Atajo global '%1' no puede ser registrado - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_es_VE.ts b/plugin-volume/translations/volume_es_VE.ts index a63ca2e..d2a4f76 100644 --- a/plugin-volume/translations/volume_es_VE.ts +++ b/plugin-volume/translations/volume_es_VE.ts @@ -8,28 +8,28 @@ Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_eu.ts b/plugin-volume/translations/volume_eu.ts index 12b8546..b35dd73 100644 --- a/plugin-volume/translations/volume_eu.ts +++ b/plugin-volume/translations/volume_eu.ts @@ -8,28 +8,28 @@ Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_fi.ts b/plugin-volume/translations/volume_fi.ts index 2926394..50c300c 100644 --- a/plugin-volume/translations/volume_fi.ts +++ b/plugin-volume/translations/volume_fi.ts @@ -8,28 +8,28 @@ Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_fr_FR.ts b/plugin-volume/translations/volume_fr_FR.ts index 23e922b..842d3d2 100644 --- a/plugin-volume/translations/volume_fr_FR.ts +++ b/plugin-volume/translations/volume_fr_FR.ts @@ -8,28 +8,28 @@ Montrer le bureau : le raccourci global '%1' ne peut pas être défini - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_hu.desktop b/plugin-volume/translations/volume_hu.desktop new file mode 100644 index 0000000..1f90583 --- /dev/null +++ b/plugin-volume/translations/volume_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Volume control +Comment=Control the system's volume and launch your preferred mixer. + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=A rendszer hangerejének beállítása +Name[hu]=Hangerőszabályzó diff --git a/plugin-volume/translations/volume_hu.ts b/plugin-volume/translations/volume_hu.ts new file mode 100644 index 0000000..5a59b05 --- /dev/null +++ b/plugin-volume/translations/volume_hu.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/plugin-volume/translations/volume_hu_HU.ts b/plugin-volume/translations/volume_hu_HU.ts new file mode 100644 index 0000000..8901b59 --- /dev/null +++ b/plugin-volume/translations/volume_hu_HU.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/plugin-volume/translations/volume_it_IT.ts b/plugin-volume/translations/volume_it_IT.ts index 2da4b27..3a36662 100644 --- a/plugin-volume/translations/volume_it_IT.ts +++ b/plugin-volume/translations/volume_it_IT.ts @@ -8,28 +8,28 @@ Mostra desktop: la scorciatoia globale '%1' non può essere registrata - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ja.ts b/plugin-volume/translations/volume_ja.ts index 5a11437..829e408 100644 --- a/plugin-volume/translations/volume_ja.ts +++ b/plugin-volume/translations/volume_ja.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume 音量を上げる - + Decrease sound volume 音量を下げる - + Mute/unmute sound volume ミュート/解除 - + Volume Control: The following shortcuts can not be registered: %1 音量制御: このショートカットは登録することができません: %1 - - + + Volume: %1 音量: %1 diff --git a/plugin-volume/translations/volume_lt.ts b/plugin-volume/translations/volume_lt.ts index 3049e00..de1b083 100644 --- a/plugin-volume/translations/volume_lt.ts +++ b/plugin-volume/translations/volume_lt.ts @@ -8,28 +8,28 @@ Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_nl.ts b/plugin-volume/translations/volume_nl.ts index 7e931fb..8268eae 100644 --- a/plugin-volume/translations/volume_nl.ts +++ b/plugin-volume/translations/volume_nl.ts @@ -8,28 +8,28 @@ Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pl_PL.ts b/plugin-volume/translations/volume_pl_PL.ts index 5df03e8..5b78505 100644 --- a/plugin-volume/translations/volume_pl_PL.ts +++ b/plugin-volume/translations/volume_pl_PL.ts @@ -8,28 +8,28 @@ Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pt.ts b/plugin-volume/translations/volume_pt.ts index 7da3821..3ec8efa 100644 --- a/plugin-volume/translations/volume_pt.ts +++ b/plugin-volume/translations/volume_pt.ts @@ -8,28 +8,28 @@ Tecla de atalho global: "%1" não pode ser registada - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pt_BR.ts b/plugin-volume/translations/volume_pt_BR.ts index a0b338b..52874e5 100644 --- a/plugin-volume/translations/volume_pt_BR.ts +++ b/plugin-volume/translations/volume_pt_BR.ts @@ -8,28 +8,28 @@ Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ro_RO.ts b/plugin-volume/translations/volume_ro_RO.ts index f7cfbb6..0b368b3 100644 --- a/plugin-volume/translations/volume_ro_RO.ts +++ b/plugin-volume/translations/volume_ro_RO.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ru.ts b/plugin-volume/translations/volume_ru.ts index a651d8d..beb9ab1 100644 --- a/plugin-volume/translations/volume_ru.ts +++ b/plugin-volume/translations/volume_ru.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume Увеличить громкость звука - + Decrease sound volume Уменьшить громкость звука - + Mute/unmute sound volume Выкл/вкл звук - + Volume Control: The following shortcuts can not be registered: %1 Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 - - + + Volume: %1 Громкость: %1 diff --git a/plugin-volume/translations/volume_ru_RU.ts b/plugin-volume/translations/volume_ru_RU.ts index a7988d5..93a7e7f 100644 --- a/plugin-volume/translations/volume_ru_RU.ts +++ b/plugin-volume/translations/volume_ru_RU.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume Увеличить громкость звука - + Decrease sound volume Уменьшить громкость звука - + Mute/unmute sound volume Выкл/вкл звук - + Volume Control: The following shortcuts can not be registered: %1 Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 - - + + Volume: %1 Громкость: %1 diff --git a/plugin-volume/translations/volume_sl.ts b/plugin-volume/translations/volume_sl.ts index 342d1b9..5ff9d41 100644 --- a/plugin-volume/translations/volume_sl.ts +++ b/plugin-volume/translations/volume_sl.ts @@ -8,28 +8,28 @@ Prikaz namizja: globalne bližnjice »%1« ni moč registrirati - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_th_TH.ts b/plugin-volume/translations/volume_th_TH.ts index 3d6e732..f2422fd 100644 --- a/plugin-volume/translations/volume_th_TH.ts +++ b/plugin-volume/translations/volume_th_TH.ts @@ -8,28 +8,28 @@ แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_uk.ts b/plugin-volume/translations/volume_uk.ts index 18c26b8..b9598a9 100644 --- a/plugin-volume/translations/volume_uk.ts +++ b/plugin-volume/translations/volume_uk.ts @@ -8,28 +8,28 @@ Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_zh_CN.ts b/plugin-volume/translations/volume_zh_CN.ts index 9ff66e5..94dfc34 100644 --- a/plugin-volume/translations/volume_zh_CN.ts +++ b/plugin-volume/translations/volume_zh_CN.ts @@ -8,28 +8,28 @@ 显示桌面:无法注册全局快捷键'%1' - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_zh_TW.ts b/plugin-volume/translations/volume_zh_TW.ts index 63391a5..1c09ef6 100644 --- a/plugin-volume/translations/volume_zh_TW.ts +++ b/plugin-volume/translations/volume_zh_TW.ts @@ -8,28 +8,28 @@ 顯示桌面:全域快捷鍵'%1'無法被註冊 - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/volumebutton.cpp b/plugin-volume/volumebutton.cpp index ff489ef..4b90a9a 100644 --- a/plugin-volume/volumebutton.cpp +++ b/plugin-volume/volumebutton.cpp @@ -49,7 +49,7 @@ VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent): // In the worst case - no soundcard/pulse - is found it remains // in the button but at least the button is not blank ("invisible") handleStockIconChanged("dialog-error"); - m_volumePopup = new VolumePopup(); + m_volumePopup = new VolumePopup(this); m_popupHideTimer.setInterval(1000); connect(this, SIGNAL(clicked()), this, SLOT(toggleVolumeSlider())); @@ -64,8 +64,6 @@ VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent): VolumeButton::~VolumeButton() { - if (m_volumePopup) - delete m_volumePopup; } void VolumeButton::setShowOnClicked(bool state) @@ -135,7 +133,7 @@ void VolumeButton::showVolumeSlider() m_volumePopup->updateGeometry(); m_volumePopup->adjustSize(); QRect pos = mPlugin->calculatePopupWindowPos(m_volumePopup->size()); - m_volumePopup->open(pos.topLeft(), Qt::TopLeftCorner); + m_volumePopup->openAt(pos.topLeft(), Qt::TopLeftCorner); m_volumePopup->activateWindow(); } diff --git a/plugin-volume/volumepopup.cpp b/plugin-volume/volumepopup.cpp index 4313c19..59cf84c 100644 --- a/plugin-volume/volumepopup.cpp +++ b/plugin-volume/volumepopup.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "audioengine.h" #include @@ -50,18 +50,9 @@ VolumePopup::VolumePopup(QWidget* parent): m_mixerButton = new QPushButton(this); m_mixerButton->setObjectName("MixerLink"); m_mixerButton->setMinimumWidth(1); - m_mixerButton->setFlat(true); m_mixerButton->setToolTip(tr("Launch mixer")); - m_mixerButton->setText(tr("Mixer")); - QSize textSize = m_mixerButton->fontMetrics().size(Qt::TextShowMnemonic, m_mixerButton->text()); - QStyleOptionButton opt; - opt.initFrom(m_mixerButton); - opt.rect.setSize(textSize); - m_mixerButton->setMaximumSize(m_mixerButton->style()->sizeFromContents(QStyle::CT_PushButton, - &opt, - textSize, - m_mixerButton)); - m_mixerButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + m_mixerButton->setText(tr("Mi&xer")); + m_mixerButton->setAutoDefault(false); m_volumeSlider = new QSlider(Qt::Vertical, this); m_volumeSlider->setTickPosition(QSlider::TicksBothSides); @@ -73,11 +64,11 @@ VolumePopup::VolumePopup(QWidget* parent): m_muteToggleButton = new QPushButton(this); m_muteToggleButton->setIcon(XdgIcon::fromTheme(QStringList() << "audio-volume-muted")); m_muteToggleButton->setCheckable(true); - m_muteToggleButton->setFlat(true); + m_muteToggleButton->setAutoDefault(false); QVBoxLayout *l = new QVBoxLayout(this); l->setSpacing(0); - l->setMargin(2); + l->setMargin(0); l->addWidget(m_mixerButton, 0, Qt::AlignHCenter); l->addWidget(m_volumeSlider, 0, Qt::AlignHCenter); @@ -115,6 +106,9 @@ void VolumePopup::handleSliderValueChanged(int value) return; // qDebug("VolumePopup::handleSliderValueChanged: %d\n", value); m_device->setVolume(value); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(value)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel + QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip(), m_volumeSlider); } void VolumePopup::handleMuteToggleClicked() @@ -134,6 +128,8 @@ void VolumePopup::handleDeviceVolumeChanged(int volume) // signal emission. m_volumeSlider->blockSignals(true); m_volumeSlider->setValue(volume); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(volume)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel m_volumeSlider->blockSignals(false); // emit volumeChanged(percent); @@ -171,7 +167,7 @@ void VolumePopup::resizeEvent(QResizeEvent *event) realign(); } -void VolumePopup::open(QPoint pos, Qt::Corner anchor) +void VolumePopup::openAt(QPoint pos, Qt::Corner anchor) { m_pos = pos; m_anchor = anchor; diff --git a/plugin-volume/volumepopup.h b/plugin-volume/volumepopup.h index 04de241..f02b9c0 100644 --- a/plugin-volume/volumepopup.h +++ b/plugin-volume/volumepopup.h @@ -40,7 +40,7 @@ class VolumePopup : public QDialog public: VolumePopup(QWidget* parent = 0); - void open(QPoint pos, Qt::Corner anchor); + void openAt(QPoint pos, Qt::Corner anchor); void handleWheelEvent(QWheelEvent *event); QSlider *volumeSlider() const { return m_volumeSlider; } diff --git a/plugin-worldclock/CMakeLists.txt b/plugin-worldclock/CMakeLists.txt index b43151b..90d10c2 100644 --- a/plugin-worldclock/CMakeLists.txt +++ b/plugin-worldclock/CMakeLists.txt @@ -14,13 +14,6 @@ set(SOURCES lxqtworldclockconfigurationmanualformat.cpp ) -set(MOCS - lxqtworldclock.h - lxqtworldclockconfiguration.h - lxqtworldclockconfigurationtimezones.h - lxqtworldclockconfigurationmanualformat.h -) - set(UIS lxqtworldclockconfiguration.ui lxqtworldclockconfigurationtimezones.ui diff --git a/plugin-worldclock/lxqtworldclock.cpp b/plugin-worldclock/lxqtworldclock.cpp index 8dc473b..d37384a 100644 --- a/plugin-worldclock/lxqtworldclock.cpp +++ b/plugin-worldclock/lxqtworldclock.cpp @@ -45,6 +45,8 @@ LxQtWorldClock::LxQtWorldClock(const ILxQtPanelPluginStartupInfo &startupInfo): ILxQtPanelPlugin(startupInfo), mPopup(NULL), mTimer(new QTimer(this)), + mUpdateInterval(1), + mLastUpdate(0), mAutoRotate(true), mPopupContent(NULL) { @@ -77,33 +79,28 @@ LxQtWorldClock::~LxQtWorldClock() void LxQtWorldClock::timeout() { - QString str = formatDateTime(QDateTime::currentDateTime(), mActiveTimeZone); - if (str != mLastShownText) - { - mContent->setText(str); - mLastShownText = str; + QDateTime now = QDateTime::currentDateTime(); + qint64 nowMsec = now.toMSecsSinceEpoch(); + if ((mLastUpdate / mUpdateInterval) == (nowMsec / mUpdateInterval)) + return; - mRotatedWidget->adjustContentSize(); - mRotatedWidget->update(); + mLastUpdate = nowMsec; - updatePopupContent(); - } -} + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + mContent->setText(formatDateTime(now, timeZoneName)); -void LxQtWorldClock::restartTimer(int timerInterval) -{ - mTimer->stop(); - mTimer->setInterval(timerInterval); + mRotatedWidget->update(); - if (timerInterval < 1000) - mTimer->start(); - else - { - int delay = static_cast((timerInterval + 100 - (static_cast(QTime::currentTime().msecsSinceStartOfDay()) % timerInterval)) % timerInterval); - QTimer::singleShot(delay, this, SLOT(timeout())); - QTimer::singleShot(delay, mTimer, SLOT(start())); - } + updatePopupContent(); +} + +void LxQtWorldClock::restartTimer(int updateInterval) +{ + mUpdateInterval = updateInterval; + mTimer->start(qMin(100, updateInterval)); } void LxQtWorldClock::settingsChanged() @@ -124,7 +121,7 @@ void LxQtWorldClock::settingsChanged() } _settings->endArray(); if (mTimeZones.isEmpty()) - mTimeZones.append(QString::fromLatin1(QTimeZone::systemTimeZoneId())); + mTimeZones.append(QLatin1String("local")); mDefaultTimeZone = _settings->value(QLatin1String("defaultTimeZone"), QString()).toString(); if (mDefaultTimeZone.isEmpty()) @@ -190,7 +187,6 @@ void LxQtWorldClock::settingsChanged() mFormat = customFormat; else { - QTimeZone timeZone(mActiveTimeZone.toLatin1()); QLocale locale = QLocale(QLocale::AnyLanguage, QLocale().country()); if (formatType == QLatin1String("short-timeonly")) @@ -268,18 +264,18 @@ void LxQtWorldClock::settingsChanged() if ((oldFormat != mFormat)) { - int timerInterval = 0; + int updateInterval = 0; QString format = mFormat; format.replace(QRegExp(QLatin1String("'[^']*'")), QString()); if (format.contains(QLatin1String("z"))) - timerInterval = 1; + updateInterval = 1; else if (format.contains(QLatin1String("s"))) - timerInterval = 1000; + updateInterval = 1000; else - timerInterval = 60000; + updateInterval = 60000; - restartTimer(timerInterval); + restartTimer(updateInterval); } bool autoRotate = settings()->value(QLatin1String("autoRotate"), true).toBool(); @@ -338,7 +334,11 @@ void LxQtWorldClock::activated(ActivationReason reason) QCalendarWidget *calendarWidget = new QCalendarWidget(mPopup); mPopup->layout()->addWidget(calendarWidget); - QTimeZone timeZone(mActiveTimeZone.toLatin1()); + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + + QTimeZone timeZone(timeZoneName.toLatin1()); calendarWidget->setFirstDayOfWeek(QLocale(QLocale::AnyLanguage, timeZone.country()).firstDayOfWeek()); calendarWidget->setSelectedDate(QDateTime::currentDateTime().toTimeZone(timeZone).date()); } @@ -388,6 +388,9 @@ void LxQtWorldClock::updatePopupContent() foreach (QString timeZoneName, mTimeZones) { + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + QString formatted = formatDateTime(now, timeZoneName); if (!hasTimeZone) diff --git a/plugin-worldclock/lxqtworldclock.h b/plugin-worldclock/lxqtworldclock.h index 118c77e..ee9206b 100644 --- a/plugin-worldclock/lxqtworldclock.h +++ b/plugin-worldclock/lxqtworldclock.h @@ -74,6 +74,8 @@ private: LxQtWorldClockPopup* mPopup; QTimer *mTimer; + int mUpdateInterval; + qint64 mLastUpdate; QStringList mTimeZones; QMap mTimeZoneCustomNames; @@ -82,7 +84,6 @@ private: QString mFormat; bool mAutoRotate; - QString mLastShownText; QLabel *mPopupContent; void restartTimer(int); @@ -134,7 +135,7 @@ class LxQtWorldClockLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtWorldClock(startupInfo); } diff --git a/plugin-worldclock/lxqtworldclockconfiguration.cpp b/plugin-worldclock/lxqtworldclockconfiguration.cpp index ff1d128..7e215aa 100644 --- a/plugin-worldclock/lxqtworldclockconfiguration.cpp +++ b/plugin-worldclock/lxqtworldclockconfiguration.cpp @@ -519,15 +519,18 @@ void LxQtWorldClockConfiguration::addTimeZone() if (mConfigurationTimeZones->updateAndExec() == QDialog::Accepted) { QString timeZone = mConfigurationTimeZones->timeZone(); - if (findTimeZone(timeZone) == -1) + if (timeZone != QString()) { - int row = ui->timeZonesTW->rowCount(); - ui->timeZonesTW->setRowCount(row + 1); - QTableWidgetItem *item = new QTableWidgetItem(timeZone); - ui->timeZonesTW->setItem(row, 0, item); - ui->timeZonesTW->setItem(row, 1, new QTableWidgetItem(QString())); - if (mDefaultTimeZone.isEmpty()) - setDefault(row); + if (findTimeZone(timeZone) == -1) + { + int row = ui->timeZonesTW->rowCount(); + ui->timeZonesTW->setRowCount(row + 1); + QTableWidgetItem *item = new QTableWidgetItem(timeZone); + ui->timeZonesTW->setItem(row, 0, item); + ui->timeZonesTW->setItem(row, 1, new QTableWidgetItem(QString())); + if (mDefaultTimeZone.isEmpty()) + setDefault(row); + } } } @@ -587,11 +590,14 @@ void LxQtWorldClockConfiguration::editTimeZoneCustomName() QString oldName = ui->timeZonesTW->item(row, 1)->text(); - bool ok; - QString newName = QInputDialog::getText(this, tr("Input custom time zone name"), tr("Custom name"), QLineEdit::Normal, oldName, &ok); - if (ok) + QInputDialog d(this); + d.setWindowTitle(tr("Input custom time zone name")); + d.setLabelText(tr("Custom name")); + d.setTextValue(oldName); + d.setWindowModality(Qt::WindowModal); + if (d.exec()) { - ui->timeZonesTW->item(row, 1)->setText(newName); + ui->timeZonesTW->item(row, 1)->setText(d.textValue()); saveSettings(); } diff --git a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp b/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp index 9edffc5..774920e 100644 --- a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp +++ b/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp @@ -39,6 +39,7 @@ LxQtWorldClockConfigurationManualFormat::LxQtWorldClockConfigurationManualFormat ui(new Ui::LxQtWorldClockConfigurationManualFormat) { setObjectName("WorldClockConfigurationManualFormatWindow"); + setWindowModality(Qt::WindowModal); ui->setupUi(this); connect(ui->manualFormatPTE, SIGNAL(textChanged()), this, SIGNAL(manualFormatChanged())); diff --git a/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp b/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp index dce022f..bbf9eb3 100644 --- a/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp +++ b/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp @@ -39,6 +39,7 @@ LxQtWorldClockConfigurationTimeZones::LxQtWorldClockConfigurationTimeZones(QWidg ui(new Ui::LxQtWorldClockConfigurationTimeZones) { setObjectName("WorldClockConfigurationTimeZonesWindow"); + setWindowModality(Qt::WindowModal); ui->setupUi(this); connect(ui->timeZonesTW, SIGNAL(itemSelectionChanged()), SLOT(itemSelectionChanged())); @@ -123,6 +124,11 @@ int LxQtWorldClockConfigurationTimeZones::updateAndExec() makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); } + QStringList qStrings = QStringList() << tr("Other") << QLatin1String("local"); + QTreeWidgetItem *tzItem = new QTreeWidgetItem(QStringList() << qStrings[qStrings.length() - 1] << QString() << tr("Local timezone") << QString()); + tzItem->setData(0, Qt::UserRole, qStrings[qStrings.length() - 1]); + makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); + ui->timeZonesTW->sortByColumn(0, Qt::AscendingOrder); return exec(); diff --git a/plugin-worldclock/translations/worldclock.ts b/plugin-worldclock/translations/worldclock.ts index f0efb2a..846c397 100644 --- a/plugin-worldclock/translations/worldclock.ts +++ b/plugin-worldclock/translations/worldclock.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -118,7 +118,7 @@ - + Custom name @@ -233,7 +233,7 @@ - + Input custom time zone name @@ -321,8 +321,14 @@ + Other + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_de.desktop b/plugin-worldclock/translations/worldclock_de.desktop new file mode 100644 index 0000000..c4e8a1b --- /dev/null +++ b/plugin-worldclock/translations/worldclock_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Weltzeituhr +Comment[de]=Weltzeituhr diff --git a/plugin-worldclock/translations/worldclock_de.ts b/plugin-worldclock/translations/worldclock_de.ts new file mode 100644 index 0000000..c51cf08 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_de.ts @@ -0,0 +1,370 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Weltzeituhr - Einstellungen + + + + Display &format + Anzeige&format + + + + &Time + &Zeit + + + + F&ormat: + F&ormat: + + + + + + Short + Kurz + + + + + + Long + Lang + + + + + Custom + Eigenes + + + + Sho&w seconds + Se&kunden anzeigen + + + + Pad &hour with zero + Stunden mit fü&hrender Null + + + + &Use 12-hour format + 12-St&undenformat benutzen + + + + T&ime zone + Ze&itzone + + + + &Position: + &Position: + + + + For&mat: + For&mat: + + + + + Below + Unter + + + + + Above + Über + + + + + Before + Vor + + + + + After + Nach + + + + Offset from UTC + Versatz zu UTC + + + + Abbreviation + Abkürzung + + + + Location identifier + Ortsbezeichnung + + + + + + Custom name + Eigener Name + + + + &Date + &Datum + + + + Po&sition: + &Position: + + + + Fo&rmat: + Fo&rmat: + + + + ISO 8601 + ISO 8601 + + + + Show &year + &Jahr anzeigen + + + + Show day of wee&k + &Wochentag anzeigen + + + + Pad d&ay with zero + T&ag mit führender Null + + + + &Long month and day of week names + &Lange Monats- und Wochentagsbezeichnungen + + + + Ad&vanced manual format + &Erweitertes manuelles Format + + + + &Customise ... + &Ändern... + + + + Time &zones + &Zeitzonen + + + + IANA id + IANA-ID + + + + &Add ... + &Hinzufügen ... + + + + &Remove + &Entfernen + + + + Set as &default + Als &Default setzen + + + + &Edit custom name ... + &Eigenen Namen bearbeiten... + + + + Move &up + Nach &oben + + + + Move do&wn + Nach &unten + + + + &General + All&gemein + + + + Auto&rotate when the panel is vertical + &Bei senkrechter Leiste automatisch drehen + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + Input custom time zone name + Eigenen Zeitzonennamen eingeben + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Syntax für eigenes Datums-/Zeitformat </h1> +<p>Ein Datumsmuster ist eine Zeichenkette, in der bestimmte Zeichenfolgen durch Datums- und Zeitangaben eines Kalenders ersetzt werden.</p> +<p>In der unten angegebenen Tabelle sind die Zeichenfolgen angegeben, für die eine Ersetzung vorgenommen wird. Dabei können einzelne Zeichen mehrfach angegeben werden, um die Bedeutung zu verändern. Beispielsweise wird y zur Darstellung des Jahres benutzt. Dabei produziert 'yy' z.B. '99', und 'yyyy' produziert dann '1999'. Bei den meisten numerischen Feldern bestimmt die Anzahl der Zeichen die Feldbreite. Beispielsweise bei h, das zur Darstellung der Stunden dient, könnte 'h' eine '5' produzieren, aber 'hh' ergäbe '05'. Bei einigen Zeichen wird durch die Anzahl bestimmt, ob die abgekürzte oder ausgeschriebene Form benutzt werden soll.</p> +<p>Zwei Hochkommas werden durch ein einzelnes Hochkomma ersetzt, sowohl innerhalb als auch außerhalb Hochkommas. Text innerhalb einfacher Hochkommas wird nicht ersetzt (abgesehen von zwei aufeinander folgenden Hochkommas). Ansonsten sind alle ASCII-Zeichen von a bis z und A bis Z reservierte Zeichen und müssen in Hochkommas stehen, wenn sie für sich selbst stehen sollen. Außerdem könnten bestimmte Satzzeichen zukünftig als Variablen aufgefasst werden (z.B. könnte ":" als Trennzeichen zwischen Zeitbestandteilen und '/' als Datumstrenner interpretiert werden, welche durch entsprechende lokale Zeichen in der Anzeige ersetzt werden).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Bedeutung</th></tr> +<tr><td>d</td><td>Tag als Zahl ohne führende Null (1 bis 31)</td></tr> +<tr><td>dd</td><td>Tag als Zahl mit führender Null (01 bis 31)</td></tr> +<tr><td>ddd</td><td>Abgekürzter lokalisierter Tagesname (z.B. 'Mon' bis 'Son').</td></tr> +<tr><td>dddd</td><td>Ausgeschriebener lokalisierter Tagesname (z.B. 'Montag' bis 'Sonntag</td></tr> +<tr><td>M</td><td>Monat als Zahl ohne führende Null (1-12)</td></tr> +<tr><td>MM</td><td>Monat als Zahl mit führender Null (01-12)</td></tr> +<tr><td>MMM</td><td>Abgekürzter lokalisierter Monatsname (z.B. 'Jan' bis 'Dez').</td></tr> +<tr><td>MMMM</td><td>Ausgeschriebener lokalisierter Monatsname (z.B. 'Januar' bis 'Dezember').</td></tr> +<tr><td>yy</td><td>Jahr als zweistellige Zahl (00-99)</td></tr> +<tr><td>yyyy</td><td>Jahr als vierstellige Zahl</td></tr> +<tr><td>h</td><td>Stunde ohne führende Null (0 bis 23 oder 1 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>hh</td><td>Stunde mit führender Null (00 bis 23 oder 01 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>H</td><td>Stunde ohne führende Null (0 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>HH</td><td>Stunde mit führender Null (00 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>m</td><td>Minute ohne führende Null (0 bis 59)</td></tr> +<tr><td>mm</td><td>Minute mit führender Null (00 bis 59)</td></tr> +<tr><td>s</td><td>Sekunde ohne führende Null (0 bis 59)</td></tr> +<tr><td>ss</td><td>Sekunde mit führender Null (00 bis 59)</td></tr> +<tr><td>z</td><td>Millisekunden ohne führende Nullen (0 bis 999)</td></tr> +<tr><td>zzz</td><td>Millisekunden mit führenden Nullen (000 bis 999)</td></tr> +<tr><td>AP <i>oder</i> A</td><td>AM/PM-Anzeige nutzen. <b>A/AP</b> wird durch "AM" oder "PM" ersetzt.<</td></tr> +<tr><td>ap <i>oder</i> a</td><td>am/pm-Anzeige nutzen. <b>a/ap</b> wird durch "am" oder "pm" ersetzt.<</td></tr> +<tr><td>t</td><td>Zeitzone (z.B. "CEST")</td></tr> +<tr><td>T</td><td>Offset zu UTC</td></tr> +<tr><td>TT</td><td>Zeitzone IANA-ID</td></tr> +<tr><td>TTT</td><td>Zeitzone abgekürzt</td></tr> +<tr><td>TTTT</td><td>Zeitzone kurz</td></tr> +<tr><td>TTTTT</td><td>Zeitzone lang</td></tr> +<tr><td>TTTTTT</td><td>Eigener Name für die Zeitzone. Dieser kann im Reiter 'Zeitzonen' gesetzt werden.</td></tr></table> +<p><br /><b>Hinweis:</b> Jedes Zeichen, das nicht in den Bereichen ['a'..'z'] und ['A'..'Z'] liegt, wird als in Hochkommas eingeschlossener Text behandelt. Zeichen wie ':', '.', ' ', '#' und '@' erscheinen im resultierenden Text auch wenn sie nicht in Hochkommas eingeschlossen sind. Das Hochkomma wird als Fluchtzeichen verwendet. Zwei aufeinander folgende Hochkommas repräsentieren ein 'echtes' Hochkomma.</p> + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + Time zone + Zeitzone + + + + Name + Name + + + + Comment + Kommentar + + + + Country + Land + + + + UTC + UTC + + + + + Other + Andere + + + + Local timezone + Lokale Zeitzone + + + diff --git a/plugin-worldclock/translations/worldclock_hu.desktop b/plugin-worldclock/translations/worldclock_hu.desktop new file mode 100644 index 0000000..36fd874 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Világóra +Comment[hu]=Világóra bővítmény diff --git a/plugin-worldclock/translations/worldclock_hu.ts b/plugin-worldclock/translations/worldclock_hu.ts new file mode 100644 index 0000000..e77c109 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/plugin-worldclock/translations/worldclock_hu_HU.ts b/plugin-worldclock/translations/worldclock_hu_HU.ts new file mode 100644 index 0000000..c281ad3 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu_HU.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/plugin-worldclock/translations/worldclock_ja.ts b/plugin-worldclock/translations/worldclock_ja.ts index f9657dc..08a506a 100644 --- a/plugin-worldclock/translations/worldclock_ja.ts +++ b/plugin-worldclock/translations/worldclock_ja.ts @@ -4,9 +4,9 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -121,7 +121,6 @@ 場所 - IANA id IANAのID @@ -129,7 +128,7 @@ - + Custom name 指定した名前 @@ -229,12 +228,12 @@ パネルが垂直なときには回転する(&R) - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + Input custom time zone name タイムゾーンの名前を入力 @@ -358,8 +357,14 @@ + Other その他 + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_pt.ts b/plugin-worldclock/translations/worldclock_pt.ts index 26ed172..7a76d26 100644 --- a/plugin-worldclock/translations/worldclock_pt.ts +++ b/plugin-worldclock/translations/worldclock_pt.ts @@ -1,10 +1,10 @@ - + LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Curto, apenas horas + &Curto, apenas horas &Long, time only - &Longo, apenas horas + &Longo, apenas horas S&hort, date && time - C&urto, hora e data + C&urto, hora e data L&ong, date && time - L&ongo, hora e data + L&ongo, hora e data &Custom - &Personalizar + &Personalizar <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Sintaxe do formato de data/hora personalizado</span></p><p>Um formato de data é uma cadeia de caracteres em que os caracteres são substituidos pelos dados de data e hora de um calendário ou que são utilizados para gerar os dados do calendário.</p><p>A tabela de símbolos para campos de data abaixo contém os caracteres utilizados em padrões para mostrar os devidos formatos de uma região. Os caracteres podem ser utilizados diversas vezes. Por exemplo, se utilizar y para o anor, yy devolve 99 e yyyy devolve 1999. Para a maioria dos campo numéricos, o número de caracteres especifica o tamanho do campo. Por exemplo, se utilizar h para a hora, h devolve 5 mas hh devolve 05. Para alguns caracteres, o número de letras especifica o formato utilizado (pode ser abreviado ou completo), conforme explicado abaixo.</p><p>Duas aspas simples representam uma aspa simples literal, seja dentro ou fora das aspas simples. O texto entre aspas simples não é interpretado de qualquer forma (exceto para duas aspas simples adjacentes). Doutra forma, todas as letras ASCII , de "a" a "z" e "A" a "Z" estão reservadas para caracteres de sintaxe e são necessárias aspas para representarem caracteres literais. Adicionalmente, alguns símbolos de pontuação ASCII podem ser tornados variáveis no futuro (ex: &quot;:&quot; é interpretado como separador de hora e '/' como separador de data e são substituidos pelos separadores normalmente utilizados na região).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Significado</span></p></td></tr><tr><td><p>d</p></td><td><p>o dia como número sem o zero inicial (1 a 31)</p></td></tr><tr><td><p>dd</p></td><td><p>o dia como número mas com zero inicial (01 a 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>o nome do dia abreviado (Seg a Dom).</p></td></tr><tr><td><p>dddd</p></td><td><p>o nome do dia completo (Segunda a Domingo</p></td></tr><tr><td><p>M</p></td><td><p>o mês como número sem o zero inicial (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>o mês como número mas com zero inicial (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>o nome abreviado do mês (Jan a Dez).</p></td></tr><tr><td><p>MMMM</p></td><td><p>o nome completo do mês (Janeiro a Dezembro).</p></td></tr><tr><td><p>yy</p></td><td><p>o ano como número de 2 dígitos (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>o ano como número de 4 dígitos</p></td></tr><tr><td><p>h</p></td><td><p>a hora sem o zero inicial (0 a 23 ou 1 a 12 se AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>a hora mas com o zero inicial (00 a 23 ou 01 a 12 se AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>a hora sem o zero inicial (0 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>a hora mas com o zero inicial (00 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>m</p></td><td><p>os minutos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>mm</p></td><td><p>os minutos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>s</p></td><td><p>os segundos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>ss</p></td><td><p>os segundos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>z</p></td><td><p>os milissegundos sem o zero inicial (0 a 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>os milissegundos mas com zero inicial (000 a 999)</p></td></tr><tr><td><p>AP ou A</p></td><td><p>para mostrar AM/PM <span style=" font-weight:600;">A/AP</span> será substituido por &quot;AM&quot; ou &quot;PM&quot;.</p></td></tr><tr><td><p>ap ou a</p></td><td><p>para mostrar am/pm <span style=" font-weight:600;">a/ap</span> será substituido por &quot;am&quot; ou &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>o fuso horário (por exemplo: &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>o desvio da UTC</p></td></tr><tr><td><p>TT</p></td><td><p>a ID IANA do fuso horário</p></td></tr><tr><td><p>TTT</p></td><td><p>a abreviatura do fuso horário</p></td></tr><tr><td><p>TTTT</p></td><td><p>o nome abreviado do fuso horário</p></td></tr><tr><td><p>TTTTT</p></td><td><p>o nome completo do fuso horário</p></td></tr></table><p><br/><span style=" font-weight:600;">Nota:</span> quaisquer caracteres no padrão que não estejam no intervalo [a...z] e [A...Z] serão tratados como texto. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão no texto mesmo se não tiverem aspas.As aspas simples são utilizadas para 'escape' de letras. As aspas duplas, dentro ou fora da sequência entre aspas, representa uma aspa simples 'real.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Sintaxe do formato de data/hora personalizado</span></p><p>Um formato de data é uma cadeia de caracteres em que os caracteres são substituidos pelos dados de data e hora de um calendário ou que são utilizados para gerar os dados do calendário.</p><p>A tabela de símbolos para campos de data abaixo contém os caracteres utilizados em padrões para mostrar os devidos formatos de uma região. Os caracteres podem ser utilizados diversas vezes. Por exemplo, se utilizar y para o anor, yy devolve 99 e yyyy devolve 1999. Para a maioria dos campo numéricos, o número de caracteres especifica o tamanho do campo. Por exemplo, se utilizar h para a hora, h devolve 5 mas hh devolve 05. Para alguns caracteres, o número de letras especifica o formato utilizado (pode ser abreviado ou completo), conforme explicado abaixo.</p><p>Duas aspas simples representam uma aspa simples literal, seja dentro ou fora das aspas simples. O texto entre aspas simples não é interpretado de qualquer forma (exceto para duas aspas simples adjacentes). Doutra forma, todas as letras ASCII , de "a" a "z" e "A" a "Z" estão reservadas para caracteres de sintaxe e são necessárias aspas para representarem caracteres literais. Adicionalmente, alguns símbolos de pontuação ASCII podem ser tornados variáveis no futuro (ex: &quot;:&quot; é interpretado como separador de hora e '/' como separador de data e são substituidos pelos separadores normalmente utilizados na região).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Significado</span></p></td></tr><tr><td><p>d</p></td><td><p>o dia como número sem o zero inicial (1 a 31)</p></td></tr><tr><td><p>dd</p></td><td><p>o dia como número mas com zero inicial (01 a 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>o nome do dia abreviado (Seg a Dom).</p></td></tr><tr><td><p>dddd</p></td><td><p>o nome do dia completo (Segunda a Domingo</p></td></tr><tr><td><p>M</p></td><td><p>o mês como número sem o zero inicial (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>o mês como número mas com zero inicial (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>o nome abreviado do mês (Jan a Dez).</p></td></tr><tr><td><p>MMMM</p></td><td><p>o nome completo do mês (Janeiro a Dezembro).</p></td></tr><tr><td><p>yy</p></td><td><p>o ano como número de 2 dígitos (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>o ano como número de 4 dígitos</p></td></tr><tr><td><p>h</p></td><td><p>a hora sem o zero inicial (0 a 23 ou 1 a 12 se AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>a hora mas com o zero inicial (00 a 23 ou 01 a 12 se AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>a hora sem o zero inicial (0 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>a hora mas com o zero inicial (00 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>m</p></td><td><p>os minutos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>mm</p></td><td><p>os minutos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>s</p></td><td><p>os segundos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>ss</p></td><td><p>os segundos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>z</p></td><td><p>os milissegundos sem o zero inicial (0 a 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>os milissegundos mas com zero inicial (000 a 999)</p></td></tr><tr><td><p>AP ou A</p></td><td><p>para mostrar AM/PM <span style=" font-weight:600;">A/AP</span> será substituido por &quot;AM&quot; ou &quot;PM&quot;.</p></td></tr><tr><td><p>ap ou a</p></td><td><p>para mostrar am/pm <span style=" font-weight:600;">a/ap</span> será substituido por &quot;am&quot; ou &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>o fuso horário (por exemplo: &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>o desvio da UTC</p></td></tr><tr><td><p>TT</p></td><td><p>a ID IANA do fuso horário</p></td></tr><tr><td><p>TTT</p></td><td><p>a abreviatura do fuso horário</p></td></tr><tr><td><p>TTTT</p></td><td><p>o nome abreviado do fuso horário</p></td></tr><tr><td><p>TTTTT</p></td><td><p>o nome completo do fuso horário</p></td></tr></table><p><br/><span style=" font-weight:600;">Nota:</span> quaisquer caracteres no padrão que não estejam no intervalo [a...z] e [A...Z] serão tratados como texto. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão no texto mesmo se não tiverem aspas.As aspas simples são utilizadas para 'escape' de letras. As aspas duplas, dentro ou fora da sequência entre aspas, representa uma aspa simples 'real.</p></body></html> @@ -177,7 +177,7 @@ - + Custom name Nome personalizado @@ -257,7 +257,7 @@ '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + Input custom time zone name Escreva o nome do fuso horário personalizado @@ -380,8 +380,14 @@ + Other Outro + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_ru.ts b/plugin-worldclock/translations/worldclock_ru.ts index 47e6c35..e16c1c0 100644 --- a/plugin-worldclock/translations/worldclock_ru.ts +++ b/plugin-worldclock/translations/worldclock_ru.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Короткий, только время + &Короткий, только время &Long, time only - &Длинный, только время + &Длинный, только время S&hort, date && time - К&ороткий, дата и время + К&ороткий, дата и время L&ong, date && time - Д&линный, дата и время + Д&линный, дата и время &Custom - &Свой + &Свой <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> @@ -172,7 +172,7 @@ - + Custom name Своё имя @@ -257,7 +257,7 @@ - + Input custom time zone name Введите своё имя для часового пояса @@ -380,8 +380,14 @@ + Other Другое + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_ru_RU.ts b/plugin-worldclock/translations/worldclock_ru_RU.ts index 2e12214..31c2b4b 100644 --- a/plugin-worldclock/translations/worldclock_ru_RU.ts +++ b/plugin-worldclock/translations/worldclock_ru_RU.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Короткий, только время + &Короткий, только время &Long, time only - &Длинный, только время + &Длинный, только время S&hort, date && time - К&ороткий, дата и время + К&ороткий, дата и время L&ong, date && time - Д&линный, дата и время + Д&линный, дата и время &Custom - &Свой + &Свой <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> @@ -172,7 +172,7 @@ - + Custom name Своё имя @@ -257,7 +257,7 @@ - + Input custom time zone name Введите своё имя для часового пояса @@ -380,8 +380,14 @@ + Other Другое + + + Local timezone + +