From 6421457998d5f788fd069b941239e17c89cef198 Mon Sep 17 00:00:00 2001 From: Scare Crowe <84860158+CWDSYSTEMS@users.noreply.github.com> Date: Wed, 3 Nov 2021 11:36:41 +0500 Subject: [PATCH] LXQT core lib for Sinclair Desktop --- LibLXQT/AUTHORS | 13 + LibLXQT/CHANGELOG | 639 ++++++++++++++++ LibLXQT/CMakeLists.txt | 412 ++++++++++ LibLXQT/COPYING | 458 +++++++++++ LibLXQT/README.md | 40 + LibLXQT/cmake/lxqt-config.cmake.in | 39 + LibLXQT/configdialog/lxqtconfigdialog.cpp | 192 +++++ LibLXQT/configdialog/lxqtconfigdialog.h | 113 +++ LibLXQT/configdialog/lxqtconfigdialog.ui | 84 +++ LibLXQT/configdialog/lxqtconfigdialog_p.h | 66 ++ .../lxqtconfigdialogcmdlineoptions.cpp | 62 ++ .../lxqtconfigdialogcmdlineoptions.h | 55 ++ LibLXQT/configdialog/lxqtpageselectwidget.cpp | 193 +++++ LibLXQT/configdialog/lxqtpageselectwidget.h | 65 ++ .../dbus/org.freedesktop.Notifications.xml | 69 ++ LibLXQT/dbus/org.lxqt.SingleApplication.xml | 7 + LibLXQT/liblxqt.doxygen | 4 + LibLXQT/lxqtapplication.cpp | 152 ++++ LibLXQT/lxqtapplication.h | 85 +++ LibLXQT/lxqtautostartentry.cpp | 130 ++++ LibLXQT/lxqtautostartentry.h | 114 +++ LibLXQT/lxqtbacklight.cpp | 72 ++ LibLXQT/lxqtbacklight.h | 57 ++ .../linux_backend/driver/CMakeLists.txt | 16 + .../driver/libbacklight_backend.c | 237 ++++++ .../driver/libbacklight_backend.h | 74 ++ .../driver/lxqtbacklight_backend.c | 213 ++++++ .../linux_backend/linuxbackend.cpp | 113 +++ .../linux_backend/linuxbackend.h | 55 ++ LibLXQT/lxqtbacklight/virtual_backend.cpp | 51 ++ LibLXQT/lxqtbacklight/virtual_backend.h | 46 ++ LibLXQT/lxqtglobals.h | 55 ++ LibLXQT/lxqtgridlayout.cpp | 712 ++++++++++++++++++ LibLXQT/lxqtgridlayout.h | 245 ++++++ LibLXQT/lxqthtmldelegate.cpp | 137 ++++ LibLXQT/lxqthtmldelegate.h | 57 ++ LibLXQT/lxqtnotification.cpp | 254 +++++++ LibLXQT/lxqtnotification.h | 211 ++++++ LibLXQT/lxqtnotification_p.h | 71 ++ LibLXQT/lxqtplugininfo.cpp | 180 +++++ LibLXQT/lxqtplugininfo.h | 116 +++ LibLXQT/lxqtpower/lxqtpower.cpp | 98 +++ LibLXQT/lxqtpower/lxqtpower.h | 129 ++++ LibLXQT/lxqtpower/lxqtpowerproviders.cpp | 696 +++++++++++++++++ LibLXQT/lxqtpower/lxqtpowerproviders.h | 159 ++++ LibLXQT/lxqtpowermanager.cpp | 205 +++++ LibLXQT/lxqtpowermanager.h | 73 ++ LibLXQT/lxqtprogramfinder.cpp | 68 ++ LibLXQT/lxqtprogramfinder.h | 61 ++ LibLXQT/lxqtrotatedwidget.cpp | 326 ++++++++ LibLXQT/lxqtrotatedwidget.h | 126 ++++ LibLXQT/lxqtscreensaver.cpp | 266 +++++++ LibLXQT/lxqtscreensaver.h | 66 ++ LibLXQT/lxqtsettings.cpp | 709 +++++++++++++++++ LibLXQT/lxqtsettings.h | 217 ++++++ LibLXQT/lxqtsingleapplication.cpp | 108 +++ LibLXQT/lxqtsingleapplication.h | 158 ++++ LibLXQT/lxqttranslator.cpp | 186 +++++ LibLXQT/lxqttranslator.h | 72 ++ .../org.lxqt.backlight.pkexec.policy.in | 15 + LibLXQT/resources/power.conf | 3 + LibLXQT/translations/CMakeLists.txt | 3 + LibLXQT/translations/liblxqt.ts | 179 +++++ LibLXQT/translations/liblxqt_ar.ts | 179 +++++ LibLXQT/translations/liblxqt_arn.ts | 179 +++++ LibLXQT/translations/liblxqt_ast.ts | 179 +++++ LibLXQT/translations/liblxqt_bg.ts | 179 +++++ LibLXQT/translations/liblxqt_ca.ts | 179 +++++ LibLXQT/translations/liblxqt_cs.ts | 179 +++++ LibLXQT/translations/liblxqt_cy.ts | 179 +++++ LibLXQT/translations/liblxqt_da.ts | 179 +++++ LibLXQT/translations/liblxqt_de.ts | 179 +++++ LibLXQT/translations/liblxqt_el.ts | 179 +++++ LibLXQT/translations/liblxqt_en_GB.ts | 179 +++++ LibLXQT/translations/liblxqt_eo.ts | 179 +++++ LibLXQT/translations/liblxqt_es.ts | 179 +++++ LibLXQT/translations/liblxqt_es_VE.ts | 179 +++++ LibLXQT/translations/liblxqt_et.ts | 179 +++++ LibLXQT/translations/liblxqt_eu.ts | 179 +++++ LibLXQT/translations/liblxqt_fi.ts | 179 +++++ LibLXQT/translations/liblxqt_fr.ts | 179 +++++ LibLXQT/translations/liblxqt_gl.ts | 179 +++++ LibLXQT/translations/liblxqt_he.ts | 179 +++++ LibLXQT/translations/liblxqt_hr.ts | 179 +++++ LibLXQT/translations/liblxqt_hu.ts | 179 +++++ LibLXQT/translations/liblxqt_ia.ts | 179 +++++ LibLXQT/translations/liblxqt_id.ts | 179 +++++ LibLXQT/translations/liblxqt_it.ts | 179 +++++ LibLXQT/translations/liblxqt_ja.ts | 179 +++++ LibLXQT/translations/liblxqt_ko.ts | 179 +++++ LibLXQT/translations/liblxqt_lt.ts | 179 +++++ LibLXQT/translations/liblxqt_lv.ts | 179 +++++ LibLXQT/translations/liblxqt_nb_NO.ts | 179 +++++ LibLXQT/translations/liblxqt_nl.ts | 179 +++++ LibLXQT/translations/liblxqt_pl.ts | 179 +++++ LibLXQT/translations/liblxqt_pt.ts | 179 +++++ LibLXQT/translations/liblxqt_pt_BR.ts | 179 +++++ LibLXQT/translations/liblxqt_ro_RO.ts | 179 +++++ LibLXQT/translations/liblxqt_ru.ts | 179 +++++ LibLXQT/translations/liblxqt_si.ts | 179 +++++ LibLXQT/translations/liblxqt_sk_SK.ts | 179 +++++ LibLXQT/translations/liblxqt_sl.ts | 179 +++++ LibLXQT/translations/liblxqt_sr@latin.ts | 179 +++++ LibLXQT/translations/liblxqt_sr_RS.ts | 179 +++++ LibLXQT/translations/liblxqt_th_TH.ts | 179 +++++ LibLXQT/translations/liblxqt_tr.ts | 179 +++++ LibLXQT/translations/liblxqt_uk.ts | 179 +++++ LibLXQT/translations/liblxqt_zh_CN.ts | 179 +++++ LibLXQT/translations/liblxqt_zh_TW.ts | 179 +++++ 109 files changed, 18121 insertions(+) create mode 100644 LibLXQT/AUTHORS create mode 100644 LibLXQT/CHANGELOG create mode 100644 LibLXQT/CMakeLists.txt create mode 100644 LibLXQT/COPYING create mode 100644 LibLXQT/README.md create mode 100644 LibLXQT/cmake/lxqt-config.cmake.in create mode 100644 LibLXQT/configdialog/lxqtconfigdialog.cpp create mode 100644 LibLXQT/configdialog/lxqtconfigdialog.h create mode 100644 LibLXQT/configdialog/lxqtconfigdialog.ui create mode 100644 LibLXQT/configdialog/lxqtconfigdialog_p.h create mode 100644 LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.cpp create mode 100644 LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.h create mode 100644 LibLXQT/configdialog/lxqtpageselectwidget.cpp create mode 100644 LibLXQT/configdialog/lxqtpageselectwidget.h create mode 100644 LibLXQT/dbus/org.freedesktop.Notifications.xml create mode 100644 LibLXQT/dbus/org.lxqt.SingleApplication.xml create mode 100644 LibLXQT/liblxqt.doxygen create mode 100644 LibLXQT/lxqtapplication.cpp create mode 100644 LibLXQT/lxqtapplication.h create mode 100644 LibLXQT/lxqtautostartentry.cpp create mode 100644 LibLXQT/lxqtautostartentry.h create mode 100644 LibLXQT/lxqtbacklight.cpp create mode 100644 LibLXQT/lxqtbacklight.h create mode 100644 LibLXQT/lxqtbacklight/linux_backend/driver/CMakeLists.txt create mode 100644 LibLXQT/lxqtbacklight/linux_backend/driver/libbacklight_backend.c create mode 100644 LibLXQT/lxqtbacklight/linux_backend/driver/libbacklight_backend.h create mode 100644 LibLXQT/lxqtbacklight/linux_backend/driver/lxqtbacklight_backend.c create mode 100644 LibLXQT/lxqtbacklight/linux_backend/linuxbackend.cpp create mode 100644 LibLXQT/lxqtbacklight/linux_backend/linuxbackend.h create mode 100644 LibLXQT/lxqtbacklight/virtual_backend.cpp create mode 100644 LibLXQT/lxqtbacklight/virtual_backend.h create mode 100644 LibLXQT/lxqtglobals.h create mode 100644 LibLXQT/lxqtgridlayout.cpp create mode 100644 LibLXQT/lxqtgridlayout.h create mode 100644 LibLXQT/lxqthtmldelegate.cpp create mode 100644 LibLXQT/lxqthtmldelegate.h create mode 100644 LibLXQT/lxqtnotification.cpp create mode 100644 LibLXQT/lxqtnotification.h create mode 100644 LibLXQT/lxqtnotification_p.h create mode 100644 LibLXQT/lxqtplugininfo.cpp create mode 100644 LibLXQT/lxqtplugininfo.h create mode 100644 LibLXQT/lxqtpower/lxqtpower.cpp create mode 100644 LibLXQT/lxqtpower/lxqtpower.h create mode 100644 LibLXQT/lxqtpower/lxqtpowerproviders.cpp create mode 100644 LibLXQT/lxqtpower/lxqtpowerproviders.h create mode 100644 LibLXQT/lxqtpowermanager.cpp create mode 100644 LibLXQT/lxqtpowermanager.h create mode 100644 LibLXQT/lxqtprogramfinder.cpp create mode 100644 LibLXQT/lxqtprogramfinder.h create mode 100644 LibLXQT/lxqtrotatedwidget.cpp create mode 100644 LibLXQT/lxqtrotatedwidget.h create mode 100644 LibLXQT/lxqtscreensaver.cpp create mode 100644 LibLXQT/lxqtscreensaver.h create mode 100644 LibLXQT/lxqtsettings.cpp create mode 100644 LibLXQT/lxqtsettings.h create mode 100644 LibLXQT/lxqtsingleapplication.cpp create mode 100644 LibLXQT/lxqtsingleapplication.h create mode 100644 LibLXQT/lxqttranslator.cpp create mode 100644 LibLXQT/lxqttranslator.h create mode 100644 LibLXQT/polkit/org.lxqt.backlight.pkexec.policy.in create mode 100644 LibLXQT/resources/power.conf create mode 100644 LibLXQT/translations/CMakeLists.txt create mode 100644 LibLXQT/translations/liblxqt.ts create mode 100644 LibLXQT/translations/liblxqt_ar.ts create mode 100644 LibLXQT/translations/liblxqt_arn.ts create mode 100644 LibLXQT/translations/liblxqt_ast.ts create mode 100644 LibLXQT/translations/liblxqt_bg.ts create mode 100644 LibLXQT/translations/liblxqt_ca.ts create mode 100644 LibLXQT/translations/liblxqt_cs.ts create mode 100644 LibLXQT/translations/liblxqt_cy.ts create mode 100644 LibLXQT/translations/liblxqt_da.ts create mode 100644 LibLXQT/translations/liblxqt_de.ts create mode 100644 LibLXQT/translations/liblxqt_el.ts create mode 100644 LibLXQT/translations/liblxqt_en_GB.ts create mode 100644 LibLXQT/translations/liblxqt_eo.ts create mode 100644 LibLXQT/translations/liblxqt_es.ts create mode 100644 LibLXQT/translations/liblxqt_es_VE.ts create mode 100644 LibLXQT/translations/liblxqt_et.ts create mode 100644 LibLXQT/translations/liblxqt_eu.ts create mode 100644 LibLXQT/translations/liblxqt_fi.ts create mode 100644 LibLXQT/translations/liblxqt_fr.ts create mode 100644 LibLXQT/translations/liblxqt_gl.ts create mode 100644 LibLXQT/translations/liblxqt_he.ts create mode 100644 LibLXQT/translations/liblxqt_hr.ts create mode 100644 LibLXQT/translations/liblxqt_hu.ts create mode 100644 LibLXQT/translations/liblxqt_ia.ts create mode 100644 LibLXQT/translations/liblxqt_id.ts create mode 100644 LibLXQT/translations/liblxqt_it.ts create mode 100644 LibLXQT/translations/liblxqt_ja.ts create mode 100644 LibLXQT/translations/liblxqt_ko.ts create mode 100644 LibLXQT/translations/liblxqt_lt.ts create mode 100644 LibLXQT/translations/liblxqt_lv.ts create mode 100644 LibLXQT/translations/liblxqt_nb_NO.ts create mode 100644 LibLXQT/translations/liblxqt_nl.ts create mode 100644 LibLXQT/translations/liblxqt_pl.ts create mode 100644 LibLXQT/translations/liblxqt_pt.ts create mode 100644 LibLXQT/translations/liblxqt_pt_BR.ts create mode 100644 LibLXQT/translations/liblxqt_ro_RO.ts create mode 100644 LibLXQT/translations/liblxqt_ru.ts create mode 100644 LibLXQT/translations/liblxqt_si.ts create mode 100644 LibLXQT/translations/liblxqt_sk_SK.ts create mode 100644 LibLXQT/translations/liblxqt_sl.ts create mode 100644 LibLXQT/translations/liblxqt_sr@latin.ts create mode 100644 LibLXQT/translations/liblxqt_sr_RS.ts create mode 100644 LibLXQT/translations/liblxqt_th_TH.ts create mode 100644 LibLXQT/translations/liblxqt_tr.ts create mode 100644 LibLXQT/translations/liblxqt_uk.ts create mode 100644 LibLXQT/translations/liblxqt_zh_CN.ts create mode 100644 LibLXQT/translations/liblxqt_zh_TW.ts diff --git a/LibLXQT/AUTHORS b/LibLXQT/AUTHORS new file mode 100644 index 0000000000..837c309e1c --- /dev/null +++ b/LibLXQT/AUTHORS @@ -0,0 +1,13 @@ +Library Optimizer: + Scare Crowe of Qortal: https://qortal.org + +Upstream Authors: + LXQt team: https://lxqt-project.org + Razor team: http://razor-qt.org + +Copyright: + Copyright (c) 2010-2012 Razor team + Copyright (c) 2012-2018 LXQt team + +License: LGPL-2.1+ +The full text of the LGPL-2.1+ licenses can be found in the 'COPYING' file. diff --git a/LibLXQT/CHANGELOG b/LibLXQT/CHANGELOG new file mode 100644 index 0000000000..03bd714486 --- /dev/null +++ b/LibLXQT/CHANGELOG @@ -0,0 +1,639 @@ +liblxqt-0.17.0 / 2021-04-15 +=========================== + * Used Qt5.15's Qt::SplitBehavior. + * Fixed dbus errors with invalid QVariant data sent over it. + * Made GlobalSettings public (exported symbols) in lxqtsettings. + * Modernized some headers. + * Modernize the trivial destructors. + * Used "handle quit signals" constructor in lxqtsingleapplication. + * Replaced the deprecated constructor of QWheelEvent. + +liblxqt-0.16.0 / 2020-11-01 +=========================== + * Use QFlags default constructor + * Added an action for showing LXQt leave dialog (to be used when the power button is pressed). + * Don't use deprecated QProcess methods. + +liblxqt-0.15.1 / 2020-05-28 +=========================== + * Bumped version to 0.15.1. + * Removed dead codes. + * Removed Xdg Dirs Fallback workaround. + * Let Qt handle dialog position. + * Prevent crash when closing screen saver error message. + +liblxqt-0.15.0 / 2020-04-22 +=========================== + * Bumped version to 0.15.0. + * Fixed licenses. + * Removed message handler from lxqtapplication. + * Set default button to Yes in leave dialogs. + * C++11 code updates. + * Used braced initializer list in returns. + * Allow spacing to be added between items in GridLayout. + * Set size hint of selection widget correctly. + * Make macOS build possible. + * Fixed compilation error on the Hurd. + * Fixed error messages for screensavers. + * Fixed the wrong arguments in dbusCall. + * Allow custom lock command in lxqtscreensaver. + * Improved error messages in lxqtscreensaver. + * Fixed LinuxBackend backlightChanged signal. + * Remove deprecated QDesktopWidget. + * Remove (duplicated) string casts definitions. + * Don't use Qt keywords "emit", "signal" and "slot" (they may collide with glib). + * Fixed memory leak in backlight brightness driver. + * lxqtnotification: async API for querying serverInfo. + +liblxqt-0.14.1 / 2019-02-24 +=========================== + + * Bumped version to 0.14.1 + * Enable/disable a standard button if it exists. This is needed for adding + Apply button later because Apply button should be enabled/disabled + appropriately. + * Updated translations + * Note for packagers: liblxqt now depend on libqtxdg 3.3.1 + +liblxqt-0.14.0 / 2019-01-25 +=========================== + + * Implementation fixed: + - Added missing text color of our HTML delegate + - Use the new signal and slot syntax + - Don't use automatic string conversions + - lxqtbacklight: centralize fopen() and perform path handling with length checks + - lxqtbacklight: apply maximum string length to fscanf to prevent overflow + - lxqtbacklight: removed useless commented out code + - lxqtbacklight: constified char *driver, where appropriate + - lxqtbacklight: centralized error output on empty backlight dir + - lxqtbacklight: fix and improve command line parameter handling + - lxqtbacklight: only pass basename into open_driver_file() + - lxqt-backlight: Simplify string construction + - lxqthtmldelegate: Position, alignment and size fixes for HTML delegate + - lxqtpageselectwidget: Fix config dialog cell height + - lxqtpageselectwidget: Fixed config dialog select widget cells + * Improved cmake scripting + - Set cmake_minimum_required to 3.1.0 + - Removed locale compile definitons + * Moved translations from lxqt-l10n back to liblxqt + - Removed obsolete translation fuctionality + - Added translation promo in README.md + * Translation updates + +liblxqt-0.13.0 / 2018-05-21 +=========================== + + * Bump minor version to 13 and fix the comment + * Don't find packages quietly + * Use PolkitQt5-1 policy files install directory + * build: Don't use hardcoded /usr/share path + * Normalize backlight value + * lxqtbacklight: Remove not used code + * CMake: Prevent in-source builds + * lxqtbacklight: Fix a FTBFS in superbuild mode + * blacklight power control has been added. + * Backlight::isBacklightAvailable returns false if the screen is turned off. + * Back light control added. + * Adds a ConfigDialogCommandLineOptions class + * ConfigDialog: Adds the ability to select the shown page by name + * ConfigDialog: Use d-pointer design pattern + * Fixed project uris to https://lxqt.org + * Fixed some mentions of lxde + * Make lxqt globals a public header + * Adds Qt Strings abbreviations + * lxqtpower: Add support for turning monitor(s) off + * Use qAsConst() + * Drop foreach use + * cmake: Handle CMP0071 + +0.12.0 / 2017-10-21 +=================== + + * Release 0.12.0: Update changelog + * Bump minimum qtxdg version to 3.1.0 + * Don't export github templates + * Bump version and needed versions to the final values + * lxqtpower: Allow disabling of lxqt-session provider + * Drops Qt5Core_VERSION_STRING + * HtmlDelegate: Fix sizeHint() computation + * Add some comments about the meaning of versions + * Move LXQt version back to liblxqt + * Fixes (#118) + * lxqtapplication: Avoid wrong signal handling + * Removes unneeded semicolon in namespace definition + * Fix format conversions [-Wformat-pedantic] warnings + * Suppress compiler warnings about unused function parameters + * Removes extra semicolons in Qt's Q macros + * Translator: Prefer XDG_DATA_DIRS over compiled in path + * Help the compiler optimizing loops + * Use const variables where possible + * Update AUTHORS + +0.11.1 / 2017-01-01 +=================== + + * Release 0.11.1: Update changelog + * Bump needed build tools version (#113) + * build: Enable/disable WITH_XDG_DIRS_FALLBACK based on Qt version (#111) + * Updates lxqt-build-tools required version + * Adds a CMake minimum version requirement to the -config.cmake + * Refactors superbuild support + * Adds PROJECT_NAME to the build with Qt version message + * Pack target_compile_definitions() and target_include_directories() + * Adds PROJECT_NAME to the build with Qt version message + * Pack target_compile_definitions() and target_include_directories() + * Use the LXQtConfigVars module + * Make liblxqt depend on lxqt-build-tools + * Use the lxqt-build-tools LXQtCreatePortableHeaders + * Use the new LXQt Build Tools package + * Sets a minimum Qt5Xdg required version + * Adds minimum Qt version requirement (5.4.2) + * Remove cpack (#107) + +0.11.0 / 2016-09-24 +=================== + + * Release 0.11.0: Add changelog + * Bump version ot 0.11.0 (#105) + * Settings: Make use of reverse_iterator conditional + * Application: Add include + * Settings: Add "homemade" XDG_CONFIG_DIRS support + * Settings: unify duplicated code + * Add README.md + * translations: Change default translations repository + * Update DBus Notify method annotation name + * Fix lupdate warning missing Q_OBJECT macro + * Replaces deprecated QStyleOptionViewItemV4 + * Don't lock the screen when it's already locked. + * lxqtscreensaver: Makes it a opaque pointer class + * GridLayout: Store current animation flag + * lxqtgridlayout: Move private class definition + * HtmlDelegate: Take layoutDirection into account + * GridLayout: Take layoutDirection into account + * application: Correct signal handling & clean-up (#72) + * lxqtpower: Removes unused stuff + * SingleApplication: Only create an DBus adaptor when needed + * NotificationPrivate: Fixes programming typo + * Don't set icon theme name + * configdialog: Update icons in ThemeChanged event + * lxqtpower: Add suspend and hibernate to ConsoleKit2 provider + * LXQtTranslateTs.cmake: Enable PULL_TRANSLATIONS by default + * LXQtTranslateTs.cmake: Use/update template in remote repo + * .gitignore: Cleanup + * build: Use external translations + * ts-files removal (#90) + * GridLayout: Fix memory leak + * translations: Fix external translations logic + * translations: Add external translations support + * configdialog: Fix icon bar sizing + * configdialog: fix size of PageSelectWidget (#83) + * Use const references with the foreach iterator + * SettingsCache: Improve performance + * Print warning messages when using the fallback Icon Theme + * Use LXQT_DATA_DIR for fallback icon theme search path + * Sets Oxygen as the only fallback icon theme + * Adds CMAKE_INSTALL_PREFIX to the LXQt Theme search paths + * LXQtCompilerSettings: Add QT_USE_QSTRINGBUILDER to the compile definitions + * SingleApplication: Use QCoreApplication::exit() instead of ::exit() + * bump year + * TranslateDesktopTs: Adds UPDATE_OPTIONS options + * TranslateDesktop: Remove lupdate absolute option + * TranslateDesktop: Use -a switch in grep commands + * LXQtTheme: Remove (outdated) "singleclick" qss assembly + * settings: Upgrade emitting of "changed" signals + * SingleApplication: Call also QWidget::show on activate + * Updated Russian translation Removed ru_RU file + * Use QString() instead of "" + * Use CMAKE_INSTALL_FULL_DATAROOTDIR + * Add LXQT_GRAPHICS_DIR directory definition + * lxqt-config: Correct escaping while setting variables + * CMake: Removes artifact + * Adds FindXdgUserDirs CMake find_package module + * Italian translation update + +0.10.0 / 2015-11-02 +=================== + + * Release 0.10.0 + * Update translations + * Fix mixed indents + * Fix license file + * Revert "Lock screen on suspend and hibernate" + * gridlayout: Use linear animation + * gridlayout: Add occupied geometry info + * gridlayout: Fix setting geometry info + * gridlayout: Add animated move support + * license fix for AUTHORS + * config dialog: Protect against null pages add. + * pluginTranslation: removed using QStringLiteral as it was causing SEGFAULT in static finalization time + * pluginTranslation: add some symbol for referencing (for file to be not stripped out in static linking time) + * Adds "automatic" plugin translations loader support + * Warn missing xscreensaver in a non-blocking way + * Fix typos in translations/liblxqt_fr_FR.ts + * Removed country variant, improved and corrected italian translation + * Update lxqtpower.h + * Lock screen on suspend and hibernate + * licensefix for lxqttranslator.cpp + * Fix typos in comments in lxqtsingleapplicatoin.h + * Rename LxQt to LXQt everywhere + * Update Greek (el) translation Remove country variant in language code + * Handles CMake policy CMP0063 + * Adds an lxqt_enable_target_exceptions() CMake function + * Adds LXQtCompilerSettings CMake module + * Removes Cannot open qss file + * LXQtCreatePkgConfigFile.cmake: Makes install COMPONENT configurable + * LXQtTranslateTs.cmake Adds install COMPONENT option + * Adds Runtime install COMPONENT + * fix build with qt 5.5 + * Fixes an SuperBuild/NormalBuild FTBFS + * CMake: Use CMAKE_AUTOUIC, drop qt5_wrap() + * CMake: Quote variables + * CMake: Removes unused variables + * configdialog: Sets the page layout margin to 0 + * LxQt::Application: unix signal handling support & (optional) quit handling + * Removes LIB_INSTALL_DIR CACHE PATH variable + * Removes deprecated documentation + * Use relative paths in install DESTINATION + * Marks link libraries as PUBLIC + * Use target_compile_definitions() instead of add_definitions() + * Make Release the default build type + * Simplifies build type matching + * lxqt-config.cmake.in: Use find_dependency() + * Updates the build system to the Targets infrastructure + * Removes .tx transaction dir artifact + * Sort .desktop translations. Fix typos in the comments. Remove local dir artifact. + * Updated template and german translation after moving about dialog. + * pkg-config: Adds Qt5Xdg to the required dependencies + * Updates lxqt_create_pkgconfig_file() + * Remove trailing whitespaces + * Stops using Qt5Xdg dropped stuff + * Adds LXQT_DATA_DIR configuration variable + * Sort screen saver error messages + * Updates translations + * Moves the about dialog to lxqt-about + * debug: showing qDebug()/qWarning() only in "debug" build + * LxQtTheme: removed superfluous warning (can't occure) + * debug: strip debug messages in "release" build + * Remove AddPluginDialog as it is no longer used + * Hungarian translation update + * Method to change buttons in the buttonbar of ConfigDialog has been added. + * gridlayout: avoid array out of bounds for misused sizes configuration + * gridlayout: correctly recover from wrong minSize setting + * gridlayout: avoid empty margins when stretching is active + * lxqtpower: prefer systemd as a power provider + * ConfigDialog: allow changing page by QWidget* + * Add KDevelop4 project type to .gitignore + * addplugindialog: added managing button + * require c++11 support + * addplugindialog: support for managing plugins + * Updated german translation. + * addplugindialog: corrected <> -> "" in include + * addplugindialog: remember list position + * Prepends an '/' to LXQT_RELATIVE_SHARE_TRANSLATIONS_DIR + * Removes misleading "Qt translations not found!" warning + +0.9.0 / 2015-02-07 +================== + + * Release 0.9.0 + * - Remove KF5 from prefix. This will fix compilation when KDE framework headers are not in standard paths. + * Enhance the panel Add Plugin Dialog + * Portuguese update + * Workaround Qt 5.4 issue: Re-add a config file to the file watcher if it's already deleted to get proper change notifications. + * Update Japanese translation. + * i18n/i10n: Updates documentation and behavior + * remove lxqtleave from liblxqt + * lxqt_translate_desktop: pass -h instead of --no-filename to grep which is compatible with Busybox + * Add Portuguese for actions .desktop files + * add executable to handle leave actions + * Revert 34232018eb. Fixes #430. + * Update Japanese translation. + * lxqt_translate_desktop: Updates code to cope with the cmake-policy CMP0054 + * german translation + * Fix ConsoleKit powerprovicer to handle everything but logout + * - Use simple approach to data dir. Current setup of code not allows both qt4 and qt5 cohexists, and data files are same for both libraries. If a different data dir is required for specifics reason, is possible to set in cmake run -DLXQT_LIBRARY_NAME:STRING="string" + * remove not needed whitespaces + * Adds StartOptions to the SingleApplication class + * Adds the LxQt::SingleApplication class. + * CMakeLists.txt maintenaince + * Fixes yet another translations install dir mistake + * Get rid of USE_QT5 in lxqt-config.cmake + * Fixes translations install dir + * Use the new LXQtTranslate modules. + * Fixes Qt5LinguistToolsMacros file extension bug + * Copied Qt5LinguistToolsMacros.cmake + * Removes cmake commented code + * Removes duplicates add_definitions() + * Removes lxqt_translate_desktop() from the _use.cnake + * Adds Qt5TranslationLoader cmake module + * Fix HtmlDelegate and move it to its own file. Also get rid of X11 on CMakeLists.txt. + * Delete XfitMan class. Fixes lxde/lxde-qt#226 + * Don't update (extract) translations by default. + * Includes all LXQt translation modules + * Adds automatic translations loaders for LXQt libs and apps + * Adds LXQtTranslateDesktop module + * Adds the LXQtranslateTs cmake module + * Update Russian translation + * Drop support for Qt4 in code + * Clean up CMakeLists.txt and drop Qt 4 support + * Add myself to the authors list + * Use QString default constructor instead of "" + +0.8.0 / 2014-10-13 +================== + + * Release v0.8.0 + * Adds a translation loader for plugins + * Adds Qt5 automatic load of self translations + * Updates translations installation and search paths + * Mark translations as loaded for the English locale + * Updates translations + * Generate source.ts when updating translations + * Don't translate uic generated files + * Fixes another QTranslator related memory leak + * Simplify translate() code + * Fixes an memory leak that occurs when no translation is found + * Fixes lxde/lxde-qt#140 and lxde/lxqt-panel#54 + * Stop creating unused QTranslator instances. + * Fix top-to-bottom layout x-coord calculation + * Fix broken *.ts files and update to the latest strings. + * Replace LXDE-Qt with LXQt. + * Add -locations absolute option to lupdate so our *.ts files can contain informations about the source lines. + * Fix incorrect namespace in the *.ts files. + * Add code to update the *.ts files when the UPDATE_TRANSLATIONS option is turned on. + * Fix context names which uses C++ namespaces in all of the *.ts files. + * Add support for getting the hints' flags of a window + * Skip leave confirmation dialogs depending on session settings + * remove magic from cmake. USE_QT5 should be the only trigger + * Use the "new" CMake FIND_PACKAGE case policy + * Add include(${QTXDG_USE_FILE}) to Qt5 also. + * Use the "new" CMake FIND_PACKAGE case policy + * Adds missing libqtxdg dependency + * Don't allow #include + * Updates the Qt4 and Qt5 library names and related stuff + * Use the same header namespace everywhere + * Don't use undefined variables + * Find liblxqt dependencies automatically + * Removes another duplicated installation of a file + * Removes duplicate installation of a file + * Fixes extra misleading slashes in path names + * Cleans commented unneeded stuff + * Fix a typo in variable name + * Update liblxqt_pl_PL.ts + * Fix broken build of qt4 version + * Use more portable Qt and qtxdg header names + * Use newer version of cmake 2.8.9 + * Detect the path of qmake correctly for Qt5. + * Fix internal include + * Fix after merging from master, by removing dupplicated items + * Merge branch 'master' of https://github.com/lxde/liblxqt into qt5 + * Update qt5 porting + * Update Turkish tranlations + * Set include dirs properly. + * Install pkgconfig file to /usr/local/libdata/pkgconfig when FreeBSD is detected. + * Set link directories properly + * Use cmake export functionality. + * Qt5 support (step 1) + * Intree build + +0.7.0 / 2014-05-07 +================== + + * Release 0.7.0 + +0.6.99 / 2014-05-01 +=================== + + * Release 0.6.99 (0.7.0pre alpha) + * Update the About dialog information + * Update AUTHORS and COPYING + * Add CPack rules for creating tarball + * Fix incorrect arguments passing to logind + * Don't append library suffix to library path and use it by default + * CMakeLists.txt: Adds quotes to the lib string + * Respect standard LIB_INSTALL_DIR + * Reformats CMakeLists.txt to fit in an 80x24 terminal + * Removes blank lines + * Properly format about author dialog links + * Removed CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR usages from translatorsinfo/CMakeLists.txt + * Retain old CMAKE_CXX_FLAGS while adding visibility stuff. Add -Wl,-no-undefined -Wall flags to ensure correctness. + * Add missing file. + * Use gcc visibility feature to decrease number of exported symbols to half. + * Use the correct updated org.freedesktop.Notifications.xml file from razor-resources. + * Restore previous XfitMan::moveWindowToDesktop() due to regression bugs. + * Add setIconGeometry(), getShowingDesktop(), setShowingDesktop(), and getWMState() to Xfitman. + * Fix renaming bugs, replacing lxqt-qt with lxde-qt + * Finish the crazy razor=>lxqt renaming tasks. + * Add logout support for lxsession. + * Rename razor to lxqt in settings + * find themes when they are located in /usr/local/... + * Revert "header fix" + * header fix + * Add proper namespace to signal parameters due to the limitation of Qt moc system. + * Rename razor to lxqt and fix XdgDir header inclusion. + * Add missing namespace for LxQt::PowerManager. + * Fix namespace for LxQt::xFitMan() to avoid undefined reference when linking with liblxqt. + * The Translatator class added, all translations moved to /usr//share/lxde/transalations + * Descriptions for translators + * Razor-qt => LXDE-Qt on about dialog + * Simplify translations script + * Simplify translations script + * All public files has lxqt prefix + * XfitMan => LxQt::XfitMan + * ScreenSaver => LxQt::ScreenSaver + * RotatedWidget => LxQt::RotatedWidget + * Razorsettings => LxQt::Settings + * RazorPluginInfo => LxQt::PluginInfo + * RazorNotification => LxQt::Notification + * RazorGridLayout => LxQt::GridLayout + * RazorAutostartEntry => LxQt::AutostartEntry + * RazorApplication => LxQt::Application + * ProgramFinder=>LxQt::ProgramFinder + * RazorConfigDialog=>LxQt::ConfigDialog + * Libtranslate => LxQt::LibTranslate + * TranslatorsInfo => LxQt::TranslatorsInfo + * Small code refactoring in the LxQt::Power + * AddPluginDialog => LxQt::AddPluginDialog + * RazorAboutDlg => LxQt::AboutDialog + * RazorPower => LxQt::Power + * Build errors, wrong include paths. + * Cmake find_package files + * Fix broken CMakeLists.txt and make the lib compile again. + * Make liblxqt (original librazorqt) compiles independently. + * Add COPYING and AUTHORS files + * Fix for Issue #571 [quicklaunch plugin] + * Renames the "Add plugin" button to "Add Widget" + * Removes hardcoded "Add plugin" window title + * razorqt-desktop: Unify plugins and widgets names. Closes #447 + * More verbose constants + * Type sign fixed + * No dependencies on STL + * Typo fixed + * Issue #605 fixed. Double rendering removed + * Theme change autodetection + * Mouse event transparency is controllable in rotated widget + * Old files removed + * Rotated widget transits some mouse events + * Helper functions added to Rotated widget + * Rotated widget requires content + * Rotated widget added + * libraries: Removes unneeded include(RazorLibSuffix) + * Initial version of Razor Screenlocker + * ProgramFinder: a set of functions to check if programs are installed + * issue #473: move count/active text into item header + * initial implementation for #473 Highlight installed plugins. Now it needs to be "designed" + * Change "leave"-button in razor-lightdm-greeter to a menu button. Fix #323 + * Fix typos + * Add RazorGridLayout::setCellXXXWidth, RazorGridLayout::setCellXXXHeight and RazorGridLayout::setCellFixedXXX, functions + * Fix for Issues #564 "new panel: cfg "Line size" can be set to 10px but the value is not accepted" #563 "new panel: vertical mode makes panel too lerge (width)" + * Add moveItem method to RazorGridLayout + * Close Issue #541 + * Close Issue #541 + * RazorGridLayout handle new item incorrectlly + * Fix translators' webpage links + * Update layout when plugin shows. + * Improved razorpanellayout and new razorgridlayout. + * Add autostart entry API into the library + * xfitman: try to get window title even harder + * New panel layout and many changes + * Improve icons handling. + * Added missing license header in the technicalinfo + * Make it possible to load translations for multiple libraries + * About dialog: Reword authors tab + * Added "Copy to clipboard" button to razor-about->technical information. + * Don't "fail" when a dbus call returns no value + * Trtanslations + * Razor-panel: New plugin API + * Simplify code in the PowerManager + * Do not display non-urgent notifications in fallback mode + * razor-power: add systemd support + * Change license for xfitman + * BSD does not handle the way with two consecutive slashes. + * Translations updated + * Translations updated + * first part of fixes based on Coverity Scan (code static analysis) + * Fix components missing translations + * razor-about: Authors text changed + * Translations + * Delete bad en_GB translations + * Update translations + * Minor fixes + * Translations updated + * Removed line num from TS files. + * Translators info & refactoring of the About dialog + * Replace

tag with newlines since it's not valid notification markup + * Add a fallback provider for those without UPower/CK + * Don't write on every RazorSettings initialization + * Translations + * Fixed librazorqt.qm directory + * Translations for librazorqt + * fixed #412 Panel plugin configuration is broken + * optional debugging when there is RAZOR_DEBUG env.var. set + * fix for infinite event loop on panel start in power manager when there is no DBUS/notificationd running. The QMessageBox should not be displayed on init. + * fixed #349 RazorSettings settingsChanged signal is not emitted + * razor-desktop reworked to enable future features and fix RTTI related crashes. + * Update libraries/razorqt/screensaver.cpp + * Sort plugins in the "Add plugin dialog" + * Updated ts.src files + * part of #329: on-click on notification launces default action or it tries to find appropariate window to raise; xfitman method renamed + one new + * extended "razor-about" implementation. Resolves #253 + * Add capabilities and server information functions + * Improve RazorNotification docs + * Add Hints support + * notifications: vrious fixes; more options (hardcoded values removed); layouting + * notifications: razorapplication used (theming); qtxdg used; spec icon loading implemented + * Implement Actions and add some more functions + * Implement new RazorNotification class + * Remove RazorNotification classes (no license/copyright) + * Ts.src files updated. + * Language name zh_CN.GB2312 braked cmake process. + * Translations updated + * Split sessionconfigwindow and remove old module config + * fixed #284 qmmp its not registered in window list panel and properly fixed #81 Qlipper should not appear in Task Manager + * fixed #277 cmake installs private class + * Small improvement to dialog icon sizing + * Don't reset when pressing Enter + * reduce error messages when there is no session running in razor-power + * QDbusError canot be print out on Ubuntu version of qt + * notification client library uses a QMessageBox failback message when it's not able to send a dbus message + * fixed #147 razorpower: things to implement - notifications + * default arguments for notification client lib + * Fix default wallpaper loading + * GUI for change razor theme. + * Moving qtservice to libraries + * Stylesheets are not always applied. + * Typos in code. Thanks Aaron Lewis. * In razor-runner , providers item: title() was typed as tile() * For RazorSettings class , settingsChanged() was typed as settigsChanged() + * RazorSettings not read global settings. + * Changing notification ui. Adding default notitifaction icon. Embedding icons in notification + * Proper default values + * Proper id number assigned to notifications Properly remove notification by quint32 id + * Remove custom settings, use razor ones + * Adding razor-config-notificationd + * Moving notification client library to razorqt + * Don't try to print in color if it's not a terminal + * Use QSS for setting single-click mode + * Refactor desktop config to use RazorConfigDialog + * Revert "Global shortcuts now based on PSI code." + * Global shortcuts now based on PSI code + * better path for logging in DEBUG mode + * fix for theme loading when there is no theme specified in config + * Added localizedValue() in RazorSettings + * Fix: wrong path for debug log + * Config coresponds XDG directory specification + * Transifex desktop: sr_BA.ts should be a local + * strongly enhances debugging + * Transifex desktop: local translations + * Transifex desktop: Translations pulled + * fixed #218 Use /session.log instead of ~/.razor-session.log + * Icons for the desktop menu + * Add Traditional Chinese Translations + * Translations update + * Added support for the online translation service. www.transifex.net + * RazorApplication class implemented; all modules ported to this class + * Serbian translation files + * Greek translation by iosifidis + * Added danish translations + * Russian translation + * Fix for issue #100 + * Fix for issue #100 + * fix #169: italian translation + * Lock the screen when "Lock Screen" is selected + * Update icons change when theme changes + * Add function to use alternative icons + * Env variables for plugins dirs RAZORQT_DESKTOP_PLUGINS_DIR & RAZORQT_DESKTOP_PLUGINS_SO_DIR RAZORQT_PANEL_PLUGINS_DIR & RAZORQT_PANEL_PLUGINS_SO_DIR + * Create a "standardized" configuration dialog + * Relicense razorqtlib + * XdgAutoStart rewriten (lgpl2+) + * Fix gmail.ru -> gmail.com + * Issue#147 add return value to provide a valuable feedback to user + * menus are adopted to the new backends; old code removed; check for running razor-session to allow/disallow "logout" item + * Czech translations (cs_CZ) + * New power engine & razor-power program + * Make XDG autostart fully editable + * unneeded code removed + * Update german [de] translation + * Let XdgAutoStart return Hidden files, and save modified files + * Correct the XdgAutoStart behavior + * SVK translation finalized + * Replaces return"" by return QString() + * Initial german [de] translation + * Fix issue #116 + * License audit + * implemented #70: pkg-config for libs + * Add Chinese(simplified) translation files. + * License audit + * razorqt: add find_package(X11) as ${X11_X11_LIB} is used + * Add Slovak (sk) translation + * Typo in russian translation + * Czech translations (cs_CZ) + * A-MeGo Theme + * fix for crashes when there is no upower + * fix for powermanager. These dbus calls are pain... + * New doxygen ifrastructure + * power manager: list actions only if is user allowed to call it + * fixed warning: The Free Software Foundation address in this file seems to be outdated + * devel-docs generated in CMAKE_BINARY_DIR/docs includig dummy index.html + * missing translations in CMakeLists + * XdgDesktopFile is implicitly shared + * huge refactoring of the libraries build organization diff --git a/LibLXQT/CMakeLists.txt b/LibLXQT/CMakeLists.txt new file mode 100644 index 0000000000..18f3c78a6d --- /dev/null +++ b/LibLXQT/CMakeLists.txt @@ -0,0 +1,412 @@ +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level +# CMakeLists.txt file even before calling the project() command. +# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION) +# command to specify that the current project code is written for the given range of CMake +# versions. +project(liblxqt) + + +set(LXQTBT_MINIMUM_VERSION "0.9.0") +set(KF5_MINIMUM_VERSION "5.36.0") +set(QT_MINIMUM_VERSION "5.15.0") +set(QTXDG_MINIMUM_VERSION "3.7.0") + +# Major LXQt Version, belong to all components +set(LXQT_MAJOR_VERSION 0) +# Minor LXQt Version, belong to all components +set(LXQT_MINOR_VERSION 17) +# +# Patch Version, belong *only* to the component +# LXQt is 0.13 - liblxqt is at patch version 0 +# The official LXQt version will follow liblxqt. +# +# In a perfect world all components would have the same major- and minor- and +# patch-version as liblxqt - in real life it will be fine if every component +# has it's own patch version within a major/minor life cyle. +# +set(LXQT_PATCH_VERSION 0) +set(LXQT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PATCH_VERSION}) + + +option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) +option(BUILD_BACKLIGHT_LINUX_BACKEND "Build the Linux backend for the backlight" ON) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) +find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Widgets DBus LinguistTools) +find_package(Qt5Xdg ${QTXDG_MINIMUM_VERSION} REQUIRED) +find_package(KF5WindowSystem ${KF5_MINIMUM_VERSION} REQUIRED) +if (BUILD_BACKLIGHT_LINUX_BACKEND) + find_package(PolkitQt5-1 REQUIRED) +endif (BUILD_BACKLIGHT_LINUX_BACKEND) +if (NOT APPLE) + find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED X11Extras) + find_package(X11 REQUIRED) +endif() +message(STATUS "Building ${PROJECT_NAME} with Qt ${Qt5Core_VERSION}") + +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) # Standard directories for installation + +if (BUILD_BACKLIGHT_LINUX_BACKEND) + add_subdirectory(lxqtbacklight/linux_backend/driver) + add_definitions(-DUSE_BACKLIGHT_LINUX_BACKEND) +endif (BUILD_BACKLIGHT_LINUX_BACKEND) + +set(LXQT_PKG_CONFIG_DESCRIPTION "Shared library for LXQt applications") + +set(PUB_HDRS + lxqthtmldelegate.h + lxqtsettings.h + lxqtplugininfo.h + lxqtpowermanager.h + lxqtapplication.h + lxqtsingleapplication.h + lxqttranslator.h + lxqtprogramfinder.h + + configdialog/lxqtconfigdialog.h + configdialog/lxqtconfigdialogcmdlineoptions.h + configdialog/lxqtpageselectwidget.h + + lxqtpower/lxqtpower.h + lxqtnotification.h + lxqtautostartentry.h + lxqtgridlayout.h + lxqtrotatedwidget.h + lxqtglobals.h + lxqtbacklight.h + #lxqtbacklight/virtual_backend.h + #lxqtbacklight/linux_backend/linuxbackend.h +) + +if (NOT APPLE) + list (APPEND PUB_HDRS + lxqtscreensaver.h + ) +endif (NOT APPLE) + +set(PUBLIC_CLASSES + HtmlDelegate + Settings + PluginInfo + PowerManager + Application + SingleApplication + Translator + ProgramFinder + + ConfigDialog + ConfigDialogCmdLineOptions + PageSelectWidget + + Power + Notification + AutostartEntry + GridLayout + RotatedWidget + Globals + Backlight +) +if (NOT APPLE) + list (APPEND PUBLIC_CLASSES + ScreenSaver + ) +endif (NOT APPLE) + +set(SRCS + lxqthtmldelegate.cpp + lxqtplugininfo.cpp + lxqtpowermanager.cpp + lxqtsettings.cpp + lxqtapplication.cpp + lxqtsingleapplication.cpp + lxqttranslator.cpp + lxqtprogramfinder.cpp + + configdialog/lxqtconfigdialog.cpp + configdialog/lxqtconfigdialogcmdlineoptions.cpp + configdialog/lxqtpageselectwidget.cpp + + lxqtpower/lxqtpower.cpp + lxqtpower/lxqtpowerproviders.cpp + lxqtautostartentry.cpp + lxqtnotification.cpp + lxqtgridlayout.cpp + lxqtrotatedwidget.cpp + lxqtbacklight.cpp + lxqtbacklight/virtual_backend.cpp +) + +if (NOT APPLE) + list (APPEND SRCS + lxqtscreensaver.cpp + ) +endif (NOT APPLE) + +if (BUILD_BACKLIGHT_LINUX_BACKEND) + list (APPEND SRCS + lxqtbacklight/linux_backend/linuxbackend.cpp + ) +endif (BUILD_BACKLIGHT_LINUX_BACKEND) + +set(MOCS + lxqthtmldelegate.h + lxqtpowermanager.h + lxqtsettings.h + lxqtapplication.h + lxqtbacklight.h + + configdialog/lxqtconfigdialog.h + configdialog/lxqtconfigdialog_p.h + configdialog/lxqtpageselectwidget.h + + lxqtnotification.h + lxqtnotification_p.h + lxqtpower/lxqtpower.h + lxqtpower/lxqtpowerproviders.h + lxqtgridlayout.h + lxqtrotatedwidget.h + lxqtbacklight/virtual_backend.h +) + +if (NOT APPLE) + list (APPEND MOCS + lxqtscreensaver.h + ) +endif (NOT APPLE) + +if (BUILD_BACKLIGHT_LINUX_BACKEND) + list (APPEND SRCS + lxqtbacklight/linux_backend/linuxbackend.h + ) +endif (BUILD_BACKLIGHT_LINUX_BACKEND) + +set(FORMS + configdialog/lxqtconfigdialog.ui +) + +set(POLKIT_FILES + "${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.backlight.pkexec.policy" +) + +# Build Polkit file +configure_file ( polkit/org.lxqt.backlight.pkexec.policy.in "${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.backlight.pkexec.policy" ) + +file(GLOB LXQT_CONFIG_FILES resources/*.conf) + +QT5_ADD_DBUS_INTERFACE(DBUS_INTERFACE_SRCS + dbus/org.freedesktop.Notifications.xml + notifications_interface +) + +QT5_ADD_DBUS_ADAPTOR(DBUS_ADAPTOR_SRCS + dbus/org.lxqt.SingleApplication.xml + lxqtsingleapplication.h LXQt::SingleApplication +) + +set_property(SOURCE ${DBUS_INTERFACE_SRCS} ${DBUS_ADAPTOR_SRCS} PROPERTY SKIP_AUTOGEN ON) +list(APPEND SRCS "${DBUS_INTERFACE_SRCS}" "${DBUS_ADAPTOR_SRCS}") + +# KF5WindowSystem is missing here. KF5WindowSystem doesn't provide an .pc file. +set(LXQT_PKG_CONFIG_REQUIRES "Qt5Xdg >= ${QTXDG_MINIMUM_VERSION}, Qt5Widgets >= ${QT_MINIMUM_VERSION}, Qt5Xml >= ${QT_MINIMUM_VERSION}, Qt5DBus >= ${QT_MINIMUM_VERSION}") + +if (NOT APPLE) + set(LXQT_PKG_CONFIG_REQUIRES "${LXQT_PKG_CONFIG_REQUIRES}, Qt5X11Extras >= ${QT_MINIMUM_VERSION}") +endif (NOT APPLE) + + +# Standard directories for installation +include(LXQtPreventInSourceBuilds) +include(LXQtCompilerSettings NO_POLICY_SCOPE) +include(LXQtCreatePkgConfigFile) +include(LXQtCreatePortableHeaders) +include(LXQtConfigVars) + +set(LXQT_INTREE_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include") + +set(LXQT_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}") +set(LXQT_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/cmake") + + +## Translations +include(LXQtTranslateTs) + +lxqt_translate_ts(QM_FILES + UPDATE_TRANSLATIONS + ${UPDATE_TRANSLATIONS} + SOURCES + ${SRCS} + ${FORMS} + INSTALL_DIR + "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" +) + +message(STATUS "") +message(STATUS "liblxqt version: ${LXQT_VERSION}") +message(STATUS "") + + +# Copy public headers +foreach(h ${PUB_HDRS}) + get_filename_component(bh ${h} NAME) + configure_file(${h} "${LXQT_INTREE_INCLUDE_DIR}/LXQt/${bh}" COPYONLY) +endforeach() + +# Create the portable headers +lxqt_create_portable_headers(INTREE_PORTABLE_HEADERS + NAME_PREFIX "lxqt" + OUTPUT_DIR "${LXQT_INTREE_INCLUDE_DIR}/LXQt" + HEADER_NAMES ${PUBLIC_CLASSES} +) + +#check_portable_headers(H_FILES ${PUB_HDRS} LINKS "${INTREE_PORTABLE_HEADERS}") + +#************************************************ +# Create in-tree build infrastructure +#************************************************ +set(CFG_LXQT_TARGETS_FILE "${LXQT_INTREE_TARGETS_FILE}") + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in" + "${CMAKE_BINARY_DIR}/${LXQT_LIBRARY_NAME}-config.cmake" + INSTALL_DESTINATION "neverland" # required, altough we don't install it +) + +#************************************************ +# Create installable build infrastructure +#************************************************ +set(CFG_LXQT_TARGETS_FILE "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}/${LXQT_LIBRARY_NAME}-targets.cmake") + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/install/${LXQT_LIBRARY_NAME}-config.cmake" + INSTALL_DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}" +) + +write_basic_package_version_file( + "${CMAKE_BINARY_DIR}/${LXQT_LIBRARY_NAME}-config-version.cmake" + VERSION ${LXQT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/install/${LXQT_LIBRARY_NAME}-config.cmake" + "${CMAKE_BINARY_DIR}/${LXQT_LIBRARY_NAME}-config-version.cmake" + DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_LIBRARY_NAME}" + COMPONENT Devel +) + +install(EXPORT + ${LXQT_LIBRARY_NAME}-targets + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${LXQT_LIBRARY_NAME}" + COMPONENT Devel +) + +add_library(${LXQT_LIBRARY_NAME} + SHARED ${PUB_HDRS} + ${SRCS} + ${dbus_generated} + ${UIS} ${MOCS} + ${QM_FILES} + ${QRC_CXX_SOURCES} + +) + +target_link_libraries(${LXQT_LIBRARY_NAME} + PUBLIC + KF5::WindowSystem + Qt5::Widgets + Qt5::DBus + Qt5Xdg +) + +if (NOT APPLE) + target_link_libraries(${LXQT_LIBRARY_NAME} + PUBLIC + Qt5::X11Extras + PRIVATE + ${X11_Xscreensaver_LIB} + ${X11_X11_LIB} + ) +endif (NOT APPLE) + +set_target_properties(${LXQT_LIBRARY_NAME} PROPERTIES + VERSION ${LXQT_VERSION} + SOVERSION ${LXQT_MAJOR_VERSION} +) + +target_compile_definitions(${LXQT_LIBRARY_NAME} + PRIVATE + "LXQT_RELATIVE_SHARE_DIR=\"${LXQT_RELATIVE_SHARE_DIR}\"" + "LXQT_SHARE_DIR=\"${LXQT_SHARE_DIR}\"" + "LXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"${LXQT_RELATIVE_TRANSLATIONS_DIR}\"" + "LXQT_SHARE_TRANSLATIONS_DIR=\"${LXQT_TRANSLATIONS_DIR}\"" + "LXQT_GRAPHICS_DIR=\"${LXQT_GRAPHICS_DIR}\"" + "LXQT_ETC_XDG_DIR=\"${LXQT_ETC_XDG_DIR}\"" + "LXQT_DATA_DIR=\"${LXQT_DATA_DIR}\"" + "LXQT_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\"" + "LXQT_VERSION=\"${LXQT_VERSION}\"" + "COMPILE_LIBLXQT" + "$<$:QT_NO_DEBUG_OUTPUT>" + "$<$:QT_NO_WARNING_OUTPUT>" + "QT_NO_KEYWORDS" +) + +target_include_directories(${LXQT_LIBRARY_NAME} + INTERFACE + "$" + "$" + "$" + "$" +) + +install(TARGETS + ${LXQT_LIBRARY_NAME} + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + EXPORT ${LXQT_LIBRARY_NAME}-targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT Runtime +) + +install(FILES + ${PUB_HDRS} + DESTINATION "${LXQT_INSTALL_INCLUDE_DIR}/LXQt" + COMPONENT Devel +) + +install(FILES + ${INTREE_PORTABLE_HEADERS} + DESTINATION "${LXQT_INSTALL_INCLUDE_DIR}/LXQt" + COMPONENT Devel +) + +install(FILES ${LXQT_CONFIG_FILES} + DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/lxqt" + COMPONENT Runtime +) + +if (BUILD_BACKLIGHT_LINUX_BACKEND) + install(FILES ${POLKIT_FILES} DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}") +endif (BUILD_BACKLIGHT_LINUX_BACKEND) + +#************************************************ +# Create and install pkgconfig file +#************************************************ +lxqt_create_pkgconfig_file( + PACKAGE_NAME ${LXQT_LIBRARY_NAME} + DESCRIPTIVE_NAME ${LXQT_LIBRARY_NAME} + DESCRIPTION ${LXQT_PKG_CONFIG_DESCRIPTION} + INCLUDEDIRS ${LXQT_LIBRARY_NAME} + LIBS ${LXQT_LIBRARY_NAME} + REQUIRES ${LXQT_PKG_CONFIG_REQUIRES} + VERSION ${LXQT_VERSION} + INSTALL +) +#************************************************ diff --git a/LibLXQT/COPYING b/LibLXQT/COPYING new file mode 100644 index 0000000000..20fb9c7da2 --- /dev/null +++ b/LibLXQT/COPYING @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, 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/LibLXQT/README.md b/LibLXQT/README.md new file mode 100644 index 0000000000..e5bdc9c82a --- /dev/null +++ b/LibLXQT/README.md @@ -0,0 +1,40 @@ +# liblxqt tuned for Sinclair Desktop + +## Overview + +`liblxqt` represents the core library of LXQt providing essential functionality +needed by nearly all of its components. + +## Installation + +### Sources + +Its runtime dependencies are libxss, KWindowSystem, qtbase, qtx11extras and +[libqtxdg](https://github.com/lxqt/libqtxdg). +Additional build dependencies are CMake and optionally Git to pull latest VCS +checkouts. The localization files were outsourced to repository +[lxqt-l10n](https://github.com/lxqt/lxqt-l10n) so the corresponding dependencies +are needed, too. Please refer to this repository's `README.md` for further +information. + +Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` +will normally have to be set to `/usr`, depending on the way library paths are +dealt with on 64bit systems variables like `CMAKE_INSTALL_LIBDIR` may have to be +set as well. + +To build run `make`, to install `make install` which accepts variable `DESTDIR` +as usual. + +### Binary packages + +The library is provided by all major Linux distributions like Arch Linux, Debian, +Fedora and openSUSE. Just use your package manager to search for string `liblxqt`. + + +### Translation + +Translations can be done in [LXQt-Weblate](https://translate.lxqt-project.org/projects/lxqt-desktop/liblxqt/) + + +Translation status diff --git a/LibLXQT/cmake/lxqt-config.cmake.in b/LibLXQT/cmake/lxqt-config.cmake.in new file mode 100644 index 0000000000..25eaf61860 --- /dev/null +++ b/LibLXQT/cmake/lxqt-config.cmake.in @@ -0,0 +1,39 @@ +# - Finds the lxqt package + +@PACKAGE_INIT@ + +if (CMAKE_VERSION VERSION_LESS 3.0.2) + message(FATAL_ERROR \"@PROJECT_NAME@ requires at least CMake version 3.0.2\") +endif() + +include(CMakeFindDependencyMacro) + +find_dependency(Qt5Widgets @QT_MINIMUM_VERSION@) +find_dependency(Qt5DBus @QT_MINIMUM_VERSION@) +find_dependency(Qt5LinguistTools @QT_MINIMUM_VERSION@) +find_dependency(Qt5Xdg @QTXDG_MINIMUM_VERSION@) +find_dependency(KF5WindowSystem) +find_dependency(lxqt-build-tools @LXQTBT_MINIMUM_VERSION@) +if (NOT APPLE) + find_dependency(Qt5X11Extras @QT_MINIMUM_VERSION@) +endif (NOT APPLE) +include(LXQtConfigVars) + + +# - Set version informations +set(LXQT_MAJOR_VERSION "@LXQT_MAJOR_VERSION@") +set(LXQT_MINOR_VERSION "@LXQT_MINOR_VERSION@") +set(LXQT_PATCH_VERSION "@LXQT_PATCH_VERSION@") +set(LXQT_VERSION "@LXQT_VERSION@") + +add_definitions("-DLXQT_MAJOR_VERSION=\"${LXQT_MAJOR_VERSION}\"") +add_definitions("-DLXQT_MINOR_VERSION=\"${LXQT_MINOR_VERSION}\"") +add_definitions("-DLXQT_PATCH_VERSION=\"${LXQT_PATCH_VERSION}\"") +add_definitions("-DLXQT_VERSION=\"${LXQT_VERSION}\"") + +if (NOT TARGET @LXQT_LIBRARY_NAME@) + if (POLICY CMP0024) + cmake_policy(SET CMP0024 NEW) + endif() + include("${CMAKE_CURRENT_LIST_DIR}/lxqt-targets.cmake") +endif() diff --git a/LibLXQT/configdialog/lxqtconfigdialog.cpp b/LibLXQT/configdialog/lxqtconfigdialog.cpp new file mode 100644 index 0000000000..625270ae4f --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialog.cpp @@ -0,0 +1,192 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtconfigdialog.h" +#include "lxqtconfigdialog_p.h" +#include "ui_lxqtconfigdialog.h" + +#include +#include + +#include "lxqtsettings.h" + +using namespace LXQt; + +ConfigDialogPrivate::ConfigDialogPrivate(ConfigDialog *q, Settings *settings) + : q_ptr(q), + mCache(new SettingsCache(settings)), + ui(new Ui::ConfigDialog) +{ + init(); +} + +ConfigDialogPrivate::~ConfigDialogPrivate() +{ + delete ui; + delete mCache; +} + +void ConfigDialogPrivate::init() +{ + Q_Q(ConfigDialog); + ui->setupUi(q); + + QObject::connect(ui->buttons, &QDialogButtonBox::clicked, + [=](QAbstractButton* button) { dialogButtonsAction(button); } + ); + + ui->moduleList->setVisible(false); + const QList buttons = ui->buttons->findChildren(); + for(QPushButton* button : buttons) + button->setAutoDefault(false); +} + +void ConfigDialogPrivate::dialogButtonsAction(QAbstractButton* button) +{ + Q_Q(ConfigDialog); + QDialogButtonBox::StandardButton standardButton = ui->buttons->standardButton(button); + Q_EMIT q->clicked(standardButton); + if (standardButton == QDialogButtonBox::Reset) + { + mCache->loadToSettings(); + Q_EMIT q->reset(); + } + else if(standardButton == QDialogButtonBox::Close) + { + q->close(); + } +} + +void ConfigDialogPrivate::updateIcons() +{ + Q_Q(ConfigDialog); + for (int ix = 0; ix < mIcons.size(); ix++) + ui->moduleList->item(ix)->setIcon(XdgIcon::fromTheme(mIcons.at(ix))); + q->update(); +} + +ConfigDialog::ConfigDialog(const QString& title, Settings* settings, QWidget* parent) : + QDialog(parent), + mSettings(settings), + d_ptr(new ConfigDialogPrivate(this, settings)) +{ + setWindowTitle(title); +} + +void ConfigDialog::setButtons(QDialogButtonBox::StandardButtons buttons) +{ + Q_D(ConfigDialog); + d->ui->buttons->setStandardButtons(buttons); + const QList b = d->ui->buttons->findChildren(); + for(QPushButton* button : b) + button->setAutoDefault(false); +} + +void ConfigDialog::enableButton(QDialogButtonBox::StandardButton which, bool enable) +{ + Q_D(ConfigDialog); + if (QPushButton* pb = d->ui->buttons->button(which)) + pb->setEnabled(enable); +} + +void ConfigDialog::addPage(QWidget* page, const QString& name, const QString& iconName) +{ + addPage(page, name, QStringList() << iconName); +} + +void ConfigDialog::addPage(QWidget* page, const QString& name, const QStringList& iconNames) +{ + Q_D(ConfigDialog); + Q_ASSERT(page); + if (!page) + { + return; + } + + /* We set the layout margin to 0. In the default configuration, one page + * only, it aligns buttons with the page. In multi-page it saves a little + * bit of space, without clutter. + */ + if (page->layout()) + { + page->layout()->setMargin(0); + } + + QStringList icons = QStringList(iconNames) << QL1S("application-x-executable"); + new QListWidgetItem(XdgIcon::fromTheme(icons), name, d->ui->moduleList); + d->mIcons.append(icons); + d->ui->stackedWidget->addWidget(page); + d->mPages[name] = page; + if(d->ui->stackedWidget->count() > 1) + { + d->ui->moduleList->setVisible(true); + d->ui->moduleList->setCurrentRow(0); + d->mMaxSize = QSize(qMax(page->geometry().width() + d->ui->moduleList->geometry().width(), + d->mMaxSize.width()), + qMax(page->geometry().height() + d->ui->buttons->geometry().height(), + d->mMaxSize.height())); + } + else + { + d->mMaxSize = page->geometry().size(); + } + resize(d->mMaxSize); +} + +void ConfigDialog::showPage(QWidget* page) +{ + Q_D(ConfigDialog); + int index = d->ui->stackedWidget->indexOf(page); + if (index < 0) + return; + + d->ui->stackedWidget->setCurrentIndex(index); + d->ui->moduleList->setCurrentRow(index); +} + +void ConfigDialog::showPage(const QString &name) +{ + Q_D(ConfigDialog); + if (d->mPages.contains(name)) + showPage(d->mPages.value(name)); + else + qWarning("ConfigDialog::showPage: Invalid page name (%s)", name.toLocal8Bit().constData()); +} + +bool ConfigDialog::event(QEvent * event) +{ + Q_D(ConfigDialog); + if (QEvent::ThemeChange == event->type()) + d->updateIcons(); + return QDialog::event(event); +} + +void ConfigDialog::closeEvent(QCloseEvent* event) +{ + Q_UNUSED(event) + Q_EMIT save(); + mSettings->sync(); +} + +ConfigDialog::~ConfigDialog() = default; diff --git a/LibLXQT/configdialog/lxqtconfigdialog.h b/LibLXQT/configdialog/lxqtconfigdialog.h new file mode 100644 index 0000000000..4829f31ca1 --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialog.h @@ -0,0 +1,113 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTCONFIGDIALOG_H +#define LXQTCONFIGDIALOG_H + +#include +#include +#include +#include +#include "lxqtglobals.h" + +namespace Ui { +class ConfigDialog; +} + +namespace LXQt +{ +class Settings; +class ConfigDialogPrivate; + +class LXQT_API ConfigDialog : public QDialog +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ConfigDialog) + +public: + explicit ConfigDialog(const QString& title, Settings* settings, QWidget* parent = nullptr); + + ~ConfigDialog() override; + + /*! + * Sets buttons in button bar + */ + void setButtons(QDialogButtonBox::StandardButtons buttons); + + /*! + * Enable/disable a standard button if it exists + */ + void enableButton(QDialogButtonBox::StandardButton which, bool enable); + + /*! + * Add a page to the configure dialog + */ + void addPage(QWidget* page, const QString& name, const QString& iconName = QLatin1String("application-x-executable")); + + /*! + * Add a page to the configure dialog, attempting several alternative icons to find one in the theme + */ + void addPage(QWidget* page, const QString& name, const QStringList& iconNames); + + /*! + * Show page containing the widget in parameter + */ + void showPage(QWidget *page); + + /*! + * \brief Shows the given page + * \param name The page to be shown. + */ + void showPage(const QString &name); + +Q_SIGNALS: + /*! + * This signal is emitted when the user pressed the "Reset" button. + * Settings should be re-read and the widgets should be set accordingly. + */ + void reset(); + + /*! + * This is emitted whenever the window is closed and settings need to be saved. + * It is only necessary if additional actions need to be performed - Settings are handled automatically. + */ + void save(); + + /*! + * This is emitted when some button in the buttonbar is clicked. + */ + void clicked(QDialogButtonBox::StandardButton); + +protected: + Settings* mSettings; + bool event(QEvent * event) override; + void closeEvent(QCloseEvent* event) override; + +private: + Q_DISABLE_COPY(ConfigDialog) + QScopedPointer const d_ptr; +}; + +} // namespace LXQt +#endif // LXQTCONFIGDIALOG_H diff --git a/LibLXQT/configdialog/lxqtconfigdialog.ui b/LibLXQT/configdialog/lxqtconfigdialog.ui new file mode 100644 index 0000000000..a1bfbdfc5d --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialog.ui @@ -0,0 +1,84 @@ + + + ConfigDialog + + + + 0 + 0 + 272 + 231 + + + + Dialog + + + + + + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + + + + + + + -1 + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + LXQt::PageSelectWidget + QListWidget +

configdialog/lxqtpageselectwidget.h
+ + + + moduleList + buttons + + + + + moduleList + currentRowChanged(int) + stackedWidget + setCurrentIndex(int) + + + 150 + 123 + + + 344 + 117 + + + + + diff --git a/LibLXQT/configdialog/lxqtconfigdialog_p.h b/LibLXQT/configdialog/lxqtconfigdialog_p.h new file mode 100644 index 0000000000..7673f36346 --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialog_p.h @@ -0,0 +1,66 @@ +/* + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * Copyright (C) 2018 Luís Pereira + * + * 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 LXQTCONFIGDIALOG_P_H +#define LXQTCONFIGDIALOG_P_H + +#include +#include +#include +#include + +namespace Ui { +class ConfigDialog; +} + +class QAbstractButton; +namespace LXQt +{ + +class ConfigDialog; +class Settings; +class SettingsCache; + +class Q_DECL_HIDDEN ConfigDialogPrivate +{ + Q_DECLARE_PUBLIC(ConfigDialog) + ConfigDialog* const q_ptr; + +public: + ConfigDialogPrivate(ConfigDialog *q, Settings* settings); + ~ConfigDialogPrivate(); + + void init(); + void dialogButtonsAction(QAbstractButton* button); + void updateIcons(); + + SettingsCache* mCache; + QList mIcons; + QSize mMaxSize; + Ui::ConfigDialog* ui; + QHash mPages; +}; + +} // namespace LXQt + +#endif // LXQTCONFIGDIALOG_P_H diff --git a/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.cpp b/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.cpp new file mode 100644 index 0000000000..8a2f7892d6 --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.cpp @@ -0,0 +1,62 @@ +/* + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2018 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 + */ + +#include "lxqtconfigdialogcmdlineoptions.h" + +#include + +namespace LXQt { + +class Q_DECL_HIDDEN ConfigDialogCmdLineOptionsPrivate { +public: + QString mPage; +}; + +ConfigDialogCmdLineOptions::ConfigDialogCmdLineOptions() + : d(new ConfigDialogCmdLineOptionsPrivate) +{ +} + +ConfigDialogCmdLineOptions::~ConfigDialogCmdLineOptions() = default; + +bool ConfigDialogCmdLineOptions::setCommandLine(QCommandLineParser *parser) +{ + Q_ASSERT(parser); + if (!parser) + return false; + + return parser->addOption(QCommandLineOption{QStringList{QL1S("s"), QL1S("show-page")}, QCoreApplication::tr("Choose the page to be shown."), QL1S("name")}); +} + +void ConfigDialogCmdLineOptions::process(QCommandLineParser &parser) +{ + if (parser.isSet(QL1S("show-page"))) { + d->mPage = parser.value(QL1S("show-page")); + } +} + +QString ConfigDialogCmdLineOptions::page() const +{ + return d->mPage; +} + +} // LXQt namespace diff --git a/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.h b/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.h new file mode 100644 index 0000000000..04c5ab4ccc --- /dev/null +++ b/LibLXQT/configdialog/lxqtconfigdialogcmdlineoptions.h @@ -0,0 +1,55 @@ +/* + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2018 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 + */ + +#ifndef LXQTCONFIGDIALOGCMDLINEOPTIONS_H +#define LXQTCONFIGDIALOGCMDLINEOPTIONS_H + +#include "lxqtglobals.h" + +#include +#include + +class QCommandLineParser; + +namespace LXQt { + +class ConfigDialogCmdLineOptionsPrivate; + +class LXQT_API ConfigDialogCmdLineOptions +{ +public: + ConfigDialogCmdLineOptions(); + ~ConfigDialogCmdLineOptions(); + + bool setCommandLine(QCommandLineParser *parser); + void process(QCommandLineParser &parser); + + QString page() const; + +private: + Q_DISABLE_COPY(ConfigDialogCmdLineOptions) + QScopedPointer const d; +}; + +} // LXQt namespace + +#endif // LXQTCONFIGDIALOGCMDLINEOPTIONS_H diff --git a/LibLXQT/configdialog/lxqtpageselectwidget.cpp b/LibLXQT/configdialog/lxqtpageselectwidget.cpp new file mode 100644 index 0000000000..c51d3a2de5 --- /dev/null +++ b/LibLXQT/configdialog/lxqtpageselectwidget.cpp @@ -0,0 +1,193 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 "lxqtpageselectwidget.h" +#include +#include +#include +#include +#include + +using namespace LXQt; + +class PageSelectWidgetItemDelegate: public QStyledItemDelegate +{ +public: + explicit PageSelectWidgetItemDelegate(PageSelectWidget *parent = nullptr); + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + +private: + PageSelectWidget* mView; +}; + + +/************************************************ + + ************************************************/ +PageSelectWidgetItemDelegate::PageSelectWidgetItemDelegate(PageSelectWidget *parent): + QStyledItemDelegate(parent), + mView(parent) +{ +} + + +/************************************************ + + ************************************************/ +QSize PageSelectWidgetItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QVariant value = index.data(Qt::SizeHintRole); + if (value.isValid()) + return qvariant_cast(value); + + //all items should have unified width + + QStyleOptionViewItem opt = option; + initStyleOption(&opt, index); + const QWidget *widget = option.widget; + QStyle *style = widget ? widget->style() : QApplication::style(); + QSize size = style->sizeFromContents(QStyle::CT_ItemViewItem, &opt, QSize(), widget); + //NOTE: this margin logic follows code in QCommonStylePrivate::viewItemLayout() + const int margin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, option.widget) + 1; + + // Find the extra vertical gap by subtracting the height of the text when wrapped within + // the default size from the height of the text when wrapped within our max. width. + const QRect R1 = mView->fontMetrics().boundingRect(QRect(0, 0, size.width() - 2 * margin, 0), + Qt::AlignLeft | Qt::TextWordWrap, opt.text); + const QRect R2 = mView->fontMetrics().boundingRect(QRect(0, 0, mView->getWrappedTextWidth(), 0), + Qt::AlignLeft | Qt::TextWordWrap, opt.text); + // compensate for the vertical gap + size.rheight() -= qAbs(R1.height() - R2.height()); + + //considering the icon size too + size.setWidth(qMax(mView->maxTextWidth(), option.decorationSize.width())); + // adding the margin is good but not necessary because it is already added + size.rwidth() += 2 * margin; + size.rheight() += margin; // only at the bottom + + return size; +} + + + +/************************************************ + + ************************************************/ +PageSelectWidget::PageSelectWidget(QWidget *parent) : + QListWidget(parent) + , mMaxTextWidth(0) +{ + mWrappedTextWidth = fontMetrics().averageCharWidth() * 13; // max. 13 characters + + setSelectionRectVisible(false); + setViewMode(IconMode); + setSpacing(2); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); + setWordWrap(true); + setDragEnabled(NoDragDrop); + setEditTriggers(NoEditTriggers); + setTextElideMode(Qt::ElideNone); + setContentsMargins(0, 0, 0, 0); + + setItemDelegate(new PageSelectWidgetItemDelegate(this)); + connect(model(), &QAbstractItemModel::rowsInserted, this, &PageSelectWidget::updateMaxTextWidth); + connect(model(), &QAbstractItemModel::rowsRemoved, this, &PageSelectWidget::updateMaxTextWidth); + connect(model(), &QAbstractItemModel::dataChanged, this, &PageSelectWidget::updateMaxTextWidth); +} + + +/************************************************ + + ************************************************/ +PageSelectWidget::~PageSelectWidget() = default; + +/************************************************ + + ************************************************/ +int PageSelectWidget::maxTextWidth() const +{ + return mMaxTextWidth; +} + +/************************************************ + + ************************************************/ +QSize PageSelectWidget::viewportSizeHint() const +{ + const int spacing2 = spacing() * 2; + QSize size{sizeHintForColumn(0) + spacing2, (sizeHintForRow(0) + spacing2) * count()}; + auto vScrollbar = verticalScrollBar(); + if (vScrollbar + && vScrollbar->isVisible() + && !vScrollbar->style()->styleHint(QStyle::SH_ScrollBar_Transient, nullptr, vScrollbar)) + { + size.rwidth() += verticalScrollBar()->sizeHint().width(); + } + return size; +} + +/************************************************ + + ************************************************/ +QSize PageSelectWidget::sizeHint() const +{ + const int f = 2 * frameWidth(); + return viewportSizeHint() + QSize(f, f); +} + +/************************************************ + + ************************************************/ +QSize PageSelectWidget::minimumSizeHint() const +{ + return QSize{0, 0}; +} + +/************************************************ + + ************************************************/ +void PageSelectWidget::updateMaxTextWidth() +{ + for(int i = count() - 1; 0 <= i; --i) + { + const QRect r = fontMetrics().boundingRect(QRect(0, 0, mWrappedTextWidth, 0), + Qt::AlignLeft | Qt::TextWordWrap, item(i)->text()); + mMaxTextWidth = qMax(mMaxTextWidth, r.width()); + } +} + +/************************************************ + + ************************************************/ +bool PageSelectWidget::event(QEvent * event) +{ + if (QEvent::StyleChange == event->type()) + updateMaxTextWidth(); + + return QListWidget::event(event); +} diff --git a/LibLXQT/configdialog/lxqtpageselectwidget.h b/LibLXQT/configdialog/lxqtpageselectwidget.h new file mode 100644 index 0000000000..52fcf3920b --- /dev/null +++ b/LibLXQT/configdialog/lxqtpageselectwidget.h @@ -0,0 +1,65 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTPAGESELECTWIDGET_H +#define LXQTPAGESELECTWIDGET_H + +#include "lxqtglobals.h" +#include + +namespace LXQt +{ + +class LXQT_API PageSelectWidget : public QListWidget +{ + Q_OBJECT +public: + explicit PageSelectWidget(QWidget *parent = nullptr); + ~PageSelectWidget() override; + int maxTextWidth() const; + bool event(QEvent * event) override; + + int getWrappedTextWidth() const { + return mWrappedTextWidth; + } + +protected: + QSize viewportSizeHint() const override; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; + +protected Q_SLOTS: + void updateMaxTextWidth(); + +private: + int mMaxTextWidth; + int mWrappedTextWidth; +}; + +} // namespace LXQt +#endif // PAGESELECTWIDGET_H diff --git a/LibLXQT/dbus/org.freedesktop.Notifications.xml b/LibLXQT/dbus/org.freedesktop.Notifications.xml new file mode 100644 index 0000000000..5cf538e1a0 --- /dev/null +++ b/LibLXQT/dbus/org.freedesktop.Notifications.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LibLXQT/dbus/org.lxqt.SingleApplication.xml b/LibLXQT/dbus/org.lxqt.SingleApplication.xml new file mode 100644 index 0000000000..f580356fa6 --- /dev/null +++ b/LibLXQT/dbus/org.lxqt.SingleApplication.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/LibLXQT/liblxqt.doxygen b/LibLXQT/liblxqt.doxygen new file mode 100644 index 0000000000..d3fa7f7db9 --- /dev/null +++ b/LibLXQT/liblxqt.doxygen @@ -0,0 +1,4 @@ +/*! \mainpage A minimal shared library for LXQt DE. + +liblxqt containing shared classes for LXQt developed by LXQt team and contributors. +*/ diff --git a/LibLXQT/lxqtapplication.cpp b/LibLXQT/lxqtapplication.cpp new file mode 100644 index 0000000000..da164d8ddd --- /dev/null +++ b/LibLXQT/lxqtapplication.cpp @@ -0,0 +1,152 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2012-2013 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 "lxqtapplication.h" +#include "lxqtsettings.h" + +#include + +using namespace LXQt; + +#define COLOR_DEBUG "\033[32;2m" +#define COLOR_WARN "\033[33;2m" +#define COLOR_CRITICAL "\033[31;1m" +#define COLOR_FATAL "\033[33;1m" +#define COLOR_RESET "\033[0m" + +#define QAPP_NAME qApp ? qApp->objectName().toUtf8().constData() : "" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +Application::Application(int &argc, char** argv) + : QApplication(argc, argv) +{ + setWindowIcon(QIcon(QFile::decodeName(LXQT_GRAPHICS_DIR) + QL1S("/lxqt_logo.png"))); + connect(Settings::globalSettings(), &GlobalSettings::lxqtThemeChanged, this, &Application::updateTheme); + updateTheme(); +} + +Application::Application(int &argc, char** argv, bool handleQuitSignals) + : Application(argc, argv) +{ + if (handleQuitSignals) + { + QList signo_list = {SIGINT, SIGTERM, SIGHUP}; + connect(this, &Application::unixSignal, [this, signo_list] (int signo) + { + if (signo_list.contains(signo)) + quit(); + }); + listenToUnixSignals(signo_list); + } +} + +void Application::updateTheme() +{ + const QString styleSheetKey = QFileInfo(applicationFilePath()).fileName(); + setStyleSheet(lxqtTheme.qss(styleSheetKey)); + Q_EMIT themeChanged(); +} + +namespace +{ + class SignalHandler + { + public: + static void signalHandler(int signo) + { + const int ret = write(instance->mSignalSock[0], &signo, sizeof (int)); + if (sizeof (int) != ret) + qCritical("unable to write into socketpair: %s", strerror(errno)); + } + + public: + template + SignalHandler(Application * app, Lambda signalEmitter) + : mSignalSock{-1, -1} + { + if (0 != socketpair(AF_UNIX, SOCK_STREAM, 0, mSignalSock)) + { + qCritical("unable to create socketpair for correct signal handling: %s", strerror(errno)); + return; + } + + mNotifier.reset(new QSocketNotifier(mSignalSock[1], QSocketNotifier::Read)); + QObject::connect(mNotifier.data(), &QSocketNotifier::activated, app, [this, signalEmitter] { + int signo = 0; + int ret = read(mSignalSock[1], &signo, sizeof (int)); + if (sizeof (int) != ret) + qCritical("unable to read signal from socketpair, %s", strerror(errno)); + signalEmitter(signo); + }); + } + + ~SignalHandler() + { + close(mSignalSock[0]); + close(mSignalSock[1]); + } + + void listenToSignals(QList const & signoList) + { + struct sigaction sa; + sa.sa_handler = signalHandler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + for (auto const & signo : signoList) + sigaction(signo, &sa, nullptr); + } + + public: + static QScopedPointer instance; + + private: + int mSignalSock[2]; + QScopedPointer mNotifier; + }; + + QScopedPointer SignalHandler::instance; +} + +void Application::listenToUnixSignals(QList const & signoList) +{ + static QScopedPointer signal_notifier; + + if (SignalHandler::instance.isNull()) + SignalHandler::instance.reset(new SignalHandler{this, [this] (int signo) { Q_EMIT unixSignal(signo); }}); + SignalHandler::instance->listenToSignals(signoList); +} diff --git a/LibLXQT/lxqtapplication.h b/LibLXQT/lxqtapplication.h new file mode 100644 index 0000000000..6d751755d2 --- /dev/null +++ b/LibLXQT/lxqtapplication.h @@ -0,0 +1,85 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2012-2013 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 LXQTAPPLICATION_H +#define LXQTAPPLICATION_H + +#include +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +/*! \brief LXQt wrapper around QApplication. + * It loads various LXQt related stuff by default (window icon, icon theme...) + * + * \note This wrapper is intended to be used only inside LXQt project. Using it + * in external application will automatically require linking to various + * LXQt libraries. + * + */ +class LXQT_API Application : public QApplication +{ + Q_OBJECT + +public: + /*! Construct a LXQt application object. + * \param argc standard argc as in QApplication + * \param argv standard argv as in QApplication + */ + Application(int &argc, char **argv); + /*! Construct a LXQt application object. + * \param argc standard argc as in QApplication + * \param argv standard argv as in QApplication + * \param handleQuitSignals flag if signals SIGINT, SIGTERM, SIGHUP should be handled internaly (\sa quit() application) + */ + Application(int &argc, char **argv, bool handleQuitSignals); + ~Application() override {} + /*! Install UNIX signal handler for signals defined in \param signalList + * Upon receiving of any of this signals the \sa unixSignal signal is emitted + */ + void listenToUnixSignals(QList const & signolList); + +private Q_SLOTS: + void updateTheme(); + +Q_SIGNALS: + void themeChanged(); + /*! Signal is emitted upon receival of registered unix signal + * \param signo the received unix signal number + */ + void unixSignal(int signo); +}; + +#if defined(lxqtApp) +#undef lxqtApp +#endif +#define lxqtApp (static_cast(qApp)) + +} // namespace LXQt +#endif // LXQTAPPLICATION_H diff --git a/LibLXQT/lxqtautostartentry.cpp b/LibLXQT/lxqtautostartentry.cpp new file mode 100644 index 0000000000..ae6e7b38a9 --- /dev/null +++ b/LibLXQT/lxqtautostartentry.cpp @@ -0,0 +1,130 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtautostartentry.h" +#include + +#include +#include + +using namespace LXQt; + +AutostartEntry::AutostartEntry() : + mLocalState(StateNone), mSystem(false) +{ +} + +AutostartEntry::AutostartEntry(const QString& name): + mLocalState(StateNone), mSystem(false) +{ + const QStringList& dirs = XdgDirs::autostartDirs(); + for (const QString& dir : dirs) + { + const QString path = QString::fromLatin1("%1/%2").arg(dir, name); + if (QFile(path).exists()) + { + mSystemFile.load(path); + mSystem = true; + break; + } + } + + const QString path = QString::fromLatin1("%1/%2").arg(XdgDirs::autostartHome(), name); + if (QFile(path).exists()) + { + mLocalFile.load(path); + mLocalState = StateExists; + } +} + +void AutostartEntry::setFile(const XdgDesktopFile& file) +{ + const bool local = isLocal(); + if (mSystem && local && file == mSystemFile) + { + removeLocal(); + } + else + { + if (local) + mLocalState = StateModified; + else + mLocalState = StateTransient; + mLocalFile = file; + } +} + +bool AutostartEntry::removeLocal() +{ + if (!isLocal()) + return false; + + if (mLocalState == StateTransient) + mLocalState = StateNone; + else + mLocalState = StateDeleted; + + return !mSystem; +} + +const XdgDesktopFile& AutostartEntry::file() const +{ + return isLocal() ? mLocalFile : mSystemFile; +} + +QString AutostartEntry::name() const +{ + return QFileInfo(file().fileName()).fileName(); +} + +void AutostartEntry::setEnabled(bool enable) +{ + XdgDesktopFile f = file(); + if (enable) + f.removeEntry(QL1S("Hidden")); + else + f.setValue(QL1S("Hidden"), true); + + setFile(f); +} + +bool AutostartEntry::isEnabled() const +{ + return !isEmpty() && !file().value(QL1S("Hidden"), false).toBool(); +} + +bool AutostartEntry::commit() +{ + if (mLocalState == StateDeleted) + { + mLocalState = StateNone; + return QFile::remove(mLocalFile.fileName()); + } + else if (mLocalState == StateModified || mLocalState == StateTransient) + { + mLocalState = StateExists; + return mLocalFile.save(XdgAutoStart::localPath(mLocalFile)); + } + return true; +} diff --git a/LibLXQT/lxqtautostartentry.h b/LibLXQT/lxqtautostartentry.h new file mode 100644 index 0000000000..6624689e27 --- /dev/null +++ b/LibLXQT/lxqtautostartentry.h @@ -0,0 +1,114 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTAUTOSTARTENTRY_H +#define LXQTAUTOSTARTENTRY_H + +#include "lxqtglobals.h" +#include + +namespace LXQt +{ + +/*! \brief The AutostartEntry class provides an interface for staging configuration of individual +autostart items. All changes are made in memory until commit() is called. + + - "system" file refers to a read-only file in /etc/xdg/autostart (or a directory in $XDG_CONFIG_DIRS) + - "local" file refers to the file in user's ~/.config/autostart (or in $XDG_CONFIG_HOME/autostart) + +When a "local" file has the same name as the "system" file, the local one overrides it. This class +tries to ensure that the "local" file is deleted if it's identical to the "system" file. +*/ +class LXQT_API AutostartEntry +{ +public: + /*! Constructs an AutostartEntry object for a specific entry. + * \param name The name of the autostart desktop file (e.g. "lxqt-panel.desktop") + */ + AutostartEntry(const QString& name); + + //! \brief Default constructor + AutostartEntry(); + + //! Destructor + virtual ~AutostartEntry() { } + + //! Returns the "active" desktop file + const XdgDesktopFile& file() const; + + //! Returns the name of the autostart entry (e.g. "lxqt-panel.desktop") + QString name() const; + + /*! Sets to the specified desktop file. Use this to make modifications. + * \param file The desktop file + */ + void setFile(const XdgDesktopFile& file); + + /*! Sets whether the item auto-starts + * \param enable When false, sets the "Hidden" key which will prevent the item from starting + */ + void setEnabled(bool enable); + + //! Returns true if the item will auto-start + bool isEnabled() const; + + /*! Returns true if the entry does not exist, and the object carries no useful information + * and can be ignored/deleted. + */ + bool isEmpty() const { return !mSystem && mLocalState == StateNone; } + + /*! Write any changes to disk + * \return true on success + */ + bool commit(); + +protected: + //! Returns true if the user's "local" version exists + bool isLocal() const { return mLocalState != StateNone && mLocalState != StateDeleted; } + + /*! Removes the user's "local" version of the file, reverting to system defaults + * \return true if there is no "system" version left (i.e. the entry was entirely deleted) + */ + bool removeLocal(); + + //! \brief a read-only file in /etc/xdg/autostart (or a directory in $XDG_CONFIG_DIRS) + XdgDesktopFile mSystemFile; + + //! \brief the file in user's ~/.config/autostart (or in $XDG_CONFIG_HOME/autostart) + XdgDesktopFile mLocalFile; + + //! State of the "local" file + enum ItemState + { + StateNone, //! does not exist at all + StateDeleted, //! needs to be deleted from disk + StateTransient, //! does not yet exist on disk + StateModified, //! exists on disk and is modified + StateExists //! exists on disk and unmodified + } mLocalState; + bool mSystem; //! true if the "system" file exists +}; + +} // namespace LXQt +#endif // LXQTAUTOSTARTENTRY_H diff --git a/LibLXQT/lxqtbacklight.cpp b/LibLXQT/lxqtbacklight.cpp new file mode 100644 index 0000000000..40e787117c --- /dev/null +++ b/LibLXQT/lxqtbacklight.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include "lxqtbacklight.h" +#include "lxqtbacklight/virtual_backend.h" +#ifdef USE_BACKLIGHT_LINUX_BACKEND + #include "lxqtbacklight/linux_backend/linuxbackend.h" +#endif + +namespace LXQt { + +Backlight::Backlight(QObject *parent):QObject(parent) +{ +#ifdef USE_BACKLIGHT_LINUX_BACKEND + m_backend = (VirtualBackEnd *) new LinuxBackend(this); +#else + m_backend = new VirtualBackEnd(this); +#endif + connect(m_backend, &VirtualBackEnd::backlightChanged, this, &Backlight::backlightChangedSlot); +} + +Backlight::~Backlight() +{ + delete m_backend; +} + +int Backlight::getBacklight() +{ + return m_backend->getBacklight(); +} + +int Backlight::getMaxBacklight() +{ + return m_backend->getMaxBacklight(); +} + +bool Backlight::isBacklightAvailable() +{ + return m_backend->isBacklightAvailable(); +} + +bool Backlight::isBacklightOff() +{ + return m_backend->isBacklightOff(); +} + +void Backlight::setBacklight(int value) +{ + m_backend->setBacklight(value); +} + +void Backlight::backlightChangedSlot(int value) +{ + Q_EMIT backlightChanged(value); +} + +} // namespace LXQt diff --git a/LibLXQT/lxqtbacklight.h b/LibLXQT/lxqtbacklight.h new file mode 100644 index 0000000000..2641010115 --- /dev/null +++ b/LibLXQT/lxqtbacklight.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef __Backlight_H__ +#define __Backlight_H__ + +#include +#include "lxqtglobals.h" + +namespace LXQt +{ +class VirtualBackEnd; + +class LXQT_API Backlight : public QObject +{ +Q_OBJECT + +public: + Backlight(QObject *parent = nullptr); + ~Backlight() override; + + bool isBacklightAvailable(); + bool isBacklightOff(); + /**Sets backlight level. + * @param value backlight level. Negative values turn off backlight. + */ + void setBacklight(int value); + int getBacklight(); + int getMaxBacklight(); + +Q_SIGNALS: + void backlightChanged(int value); + +private Q_SLOTS: + void backlightChangedSlot(int value); + +private: + VirtualBackEnd *m_backend; +}; + +} // namespace LXQt + +#endif // __Backlight_H__ diff --git a/LibLXQT/lxqtbacklight/linux_backend/driver/CMakeLists.txt b/LibLXQT/lxqtbacklight/linux_backend/driver/CMakeLists.txt new file mode 100644 index 0000000000..997444328d --- /dev/null +++ b/LibLXQT/lxqtbacklight/linux_backend/driver/CMakeLists.txt @@ -0,0 +1,16 @@ +project(lxqt-backlight_backend) + +set(C_FILES + lxqtbacklight_backend.c +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + +add_executable(${PROJECT_NAME} + ${C_FILES} +) + +install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) diff --git a/LibLXQT/lxqtbacklight/linux_backend/driver/libbacklight_backend.c b/LibLXQT/lxqtbacklight/linux_backend/driver/libbacklight_backend.c new file mode 100644 index 0000000000..12827067cd --- /dev/null +++ b/LibLXQT/lxqtbacklight/linux_backend/driver/libbacklight_backend.c @@ -0,0 +1,237 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +/******************************************************************************** + * This library uses Linux /sys/class/backlight files to read and change the + * backlight level. + * + * If screen backlight can be controlled, the Linux kernel will show inside + * /sys/class/backlight directory one or more directories. Each directory has + * got the following files: + * /sys/class/backlight/driver/max_brightness + * /sys/class/backlight/driver/actual_brightness + * /sys/class/backlight/driver/brightness + * /sys/class/backlight/driver/type + * /sys/class/backlight/driver/bl_power + * + * The "max_brightness" file contains the maximum value that can be set to the + * backlight level. + * + * In "brightness" file you can write the value of backlight and the Linux + * kernel will set that value. + * + * The "bl_power" controls if backlight is turn on (0) or turn off (>0). + * + * You must read actual backlight level from "actual_brightness" file. Never + * read the backlight level from "brightness" file. + * + * The "type" file is the type of control and it can be: + * firmware + * platform + * raw + * The firmware control should be preferred to platform control. The platform + * control should be preferred to raw control. + * If there are several directories in /sys/class/backlight/, you should use + * the directory which its "type" file has got the "firmware" value. + * + * In order to write in /sys/class/backlight/driver/brightness file root + * permissions are needed. This library calls to a command line tool called + * "lxqtbacklight_backend". "lxqtbacklight_backend" has a policy in Polkit + * in order to write in /sys/class/backlight/driver/brightness file. + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "libbacklight_backend.h" + +#define True 1 +#define False 0 + +static FILE* open_driver_file(const char *file, const char *driver, const char *mode); +static int read_backlight(const char *driver); +static int read_max_backlight(const char *driver); +static int read_bl_power(const char *driver); +static const char *sysfs_backlight_dir = "/sys/class/backlight"; + +int lxqt_backlight_backend_get() +{ + char *driver = lxqt_backlight_backend_get_driver(); + if( driver == NULL ) { + return -1; + } + int value = read_backlight(driver); + free(driver); + return value; +} + +int lxqt_backlight_backend_get_max() +{ + char *driver = lxqt_backlight_backend_get_driver(); + if( driver == NULL ) { + return -1; + } + int value = read_max_backlight(driver); + int bl_power = read_bl_power(driver); + free(driver); + return bl_power==0 ? value : -1; +} + +FILE *lxqt_backlight_backend_get_write_stream() +{ + FILE *stream = popen("pkexec lxqt-backlight_backend --stdin", "w"); + return stream; +} + +int lxqt_backlight_is_backlight_off() +{ + char *driver = lxqt_backlight_backend_get_driver(); + if( driver == NULL ) { + return -1; + } + int bl_power = read_bl_power(driver); + free(driver); + return bl_power; +} + +static int read_int(const char *file, const char *driver) +{ + FILE *in = open_driver_file(file, driver, "r"); + if( in == NULL ) { + return -1; + } + int value; + int ok = fscanf(in, "%d", &value); + fclose(in); + if( ok == EOF ) { + value = 0; + } + return value; +} + +static FILE* open_driver_file(const char *file, const char *driver, const char *mode) +{ + char path[PATH_MAX]; + int res; + + res = snprintf(path, PATH_MAX, "%s/%s/%s", sysfs_backlight_dir, driver, file); + + if( res <= 0 || res >= PATH_MAX ) { + path[0] = '\0'; + return NULL; + } + + FILE *ret = fopen(path, mode); + + if( ret == NULL ) { + fprintf(stderr, "Couldn't open %s: %s\n", path, strerror(errno)); + } + + return ret; +} + +static int read_backlight(const char *driver) +{ + return read_int("actual_brightness", driver); +} + +static int read_max_backlight(const char *driver) +{ + return read_int("max_brightness", driver); +} + +static int read_bl_power(const char *driver) +{ + return read_int("bl_power", driver); +} + +typedef enum {FIRMWARE, PLATFORM, RAW, OTHER, N_BACKLIGHT} BackligthTypes; + +char *lxqt_backlight_backend_get_driver() +{ + DIR *dirp; + struct dirent *dp; + + char *drivers[N_BACKLIGHT]; + char *driver; + int n; + char type[1024]; + + for(n=0;nd_name, ".") || !strcmp(dp->d_name, "..") ) + continue; + driver = dp->d_name; + FILE *in = open_driver_file("type", driver, "r"); + if( in == NULL ) + continue; + // the maximum field width does not include '\0'! + int ok = fscanf(in, "%1023s", type); + fclose(in); + if( ok != EOF ) { + // firmware control should be preferred to platform control should be preferred to raw control. + if( ! strcmp("firmware", type) ) { + drivers[FIRMWARE] = strdup(driver); + break; + } else if( ! strcmp("platform", type) ) + drivers[PLATFORM] = strdup(driver); + else if( ! strcmp("raw", type) ) + drivers[RAW] = strdup(driver); + else // Only, firmware, platform and raw are defined, but... + drivers[OTHER] = strdup(driver); + } + } + } while (dp != NULL); + + closedir(dirp); + + if (errno != 0) { + fprintf(stderr, "Error reading directory %s: %s\n", sysfs_backlight_dir, strerror(errno)); + } + + driver = NULL; + for(n=0;n + +/**Returns actual value of backlight. + * -1 will be returned if backlight can not be changed. + */ +int lxqt_backlight_backend_get(); + +/**Returns maximum value of backlight. + * -1 will be returned if backlight can not be changed. + */ +int lxqt_backlight_backend_get_max(); + +/**Returns a FILE pointer to stream which can be used to write values + * of backlight. + * int max_backlight = lxqt_backlight_backend_get_max(); + * if(max_backlight<0) + * return; // Backlight can not be controlled. + * FILE *fout = lxqt_backlight_backend_write_stream(); + * fprintf(fout, "%d\n", 3); + * fflush(fout); + * // ... Do something ... + * fprintf(fout, "%d\n", 7); + * fclose(fout); + * Under Qt you can use QTextStream class: + * FILE *fout = lxqt_backlight_backend_write_stream(); + * QTextStream backlightStream(fout); + * backlightStream << 3 << endl; + */ +FILE *lxqt_backlight_backend_get_write_stream(); + +/**Returns if backlight power is turned off. + * @ return 0 backlight off, bigger then 0 backlight on. + */ +int lxqt_backlight_is_backlight_off(); + +/**Returns the driver. Backlight values are read from /sys/class/backlight/driver/. + * Example: + * char *driver = lxqt_backlight_backend_get_driver(); + * printf("%s\n", driver); + * free(driver); + */ +char *lxqt_backlight_backend_get_driver(); + +#ifdef __cplusplus +} +#endif + + +#endif \ No newline at end of file diff --git a/LibLXQT/lxqtbacklight/linux_backend/driver/lxqtbacklight_backend.c b/LibLXQT/lxqtbacklight/linux_backend/driver/lxqtbacklight_backend.c new file mode 100644 index 0000000000..b32159aa58 --- /dev/null +++ b/LibLXQT/lxqtbacklight/linux_backend/driver/lxqtbacklight_backend.c @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "libbacklight_backend.h" +#include "libbacklight_backend.c" + +#define True 1 +#define False 0 + +/**bl_power turn off or turn on backlight. + * @param driver is the driver to use + * @param value 0 turns on backlight, 4 turns off backlight + */ +static void set_bl_power(const char *driver, int value) +{ + FILE *out = open_driver_file("bl_power", driver, "w"); + if( out != NULL ) { + fprintf(out, "%d", value); + fclose(out); + } +} + + +static void set_backlight(const char *driver, int value) +{ + if(value>0) { + FILE *out = open_driver_file("brightness", driver, "w"); + if( out != NULL ) { + fprintf(out, "%d", value); + fclose(out); + } + if(read_bl_power(driver) > 0) + set_bl_power(driver, 0); + } else { + set_bl_power(driver, 4); + } +} + +static char *get_driver() +{ + return lxqt_backlight_backend_get_driver(); +} + + +static void show_blacklight() +{ + char *driver = get_driver(); + if( driver == NULL ) { + return; + } + int max_value = read_max_backlight(driver); + int actual = read_backlight(driver); + printf("%s %d %d\n", driver, max_value, actual); + free(driver); +} + +static void change_blacklight(int value, int percent_ok) +{ + char *driver = get_driver(); + if( driver == NULL ) { + return; + } + int max_value = read_max_backlight(driver); + if(percent_ok) { + value = (float)(max_value*value)/100.0; + if( value == 0 ) { + // avoid switching off backlight but support zero as lowest value + value = 1; + } + } + if(value<=max_value && value>0) { + set_backlight(driver, value); + } + free(driver); +} + +static void increases_blacklight() +{ + char *driver = get_driver(); + if( driver == NULL ) { + return; + } + int max_value = read_max_backlight(driver); + int actual = read_backlight(driver); + int incr = max_value/10; + if( incr == 0 ) + incr = 1; + int value = actual + incr; + if( value > max_value) + value = max_value; + if(value0) { + set_backlight(driver, value); + } + free(driver); +} + +static void decreases_blacklight() +{ + char *driver = get_driver(); + if( driver == NULL ) { + return; + } + int max_value = read_max_backlight(driver); + int actual = read_backlight(driver); + int decr = max_value/10; + if( decr == 0 ) + decr = 1; + int value = actual - decr; + if( value <= 0 ) + value = 1; + if(value 0 && value <= max_value) { + set_backlight(driver, value); + } + } + free(driver); +} + +static void help(char *argv0) +{ + printf("%s [backlight-level [ %% ]] [--help]\n" + "--help Shows this message.\n" + "--show Shows actual brightness level.\n" + "--inc Increases actual brightness level.\n" + "--dec Decreases actual brightness level.\n" + "--stdin Read backlight value from stdin\n" + "backlight-level Sets backlight\n" + "backlight-level %% Sets backlight from 1%% to 100%%\n" + "This tool changes screen backlight.\n" + "Example:\n" + "%s 10 %% Sets backlight level until 10%%.\n" + , argv0, argv0 + ); +} + + +int main(int argc, char *argv[]) +{ + int value = -1, value_percent_ok = False; + int n; + for(n=1; n +#include + +namespace LXQt { + +LinuxBackend::LinuxBackend(QObject *parent):VirtualBackEnd(parent) +{ + maxBacklight = lxqt_backlight_backend_get_max(); + backlightStream = NULL; + if( isBacklightAvailable() ) { + char *driver = lxqt_backlight_backend_get_driver(); + fileSystemWatcher = new QFileSystemWatcher(this); + fileSystemWatcher->addPath(QString::fromLatin1("/sys/class/backlight/%1/actual_brightness").arg(QL1S(driver))); + fileSystemWatcher->addPath(QString::fromLatin1("/sys/class/backlight/%1/brightness").arg(QL1S(driver))); + fileSystemWatcher->addPath(QString::fromLatin1("/sys/class/backlight/%1/bl_power").arg(QL1S(driver))); + free(driver); + actualBacklight = lxqt_backlight_backend_get(); + connect(fileSystemWatcher, &QFileSystemWatcher::fileChanged, + this, &LinuxBackend::fileSystemChanged); + } +} + +LinuxBackend::~LinuxBackend() +{ + closeBacklightStream(); +} + +int LinuxBackend::getBacklight() +{ + actualBacklight = lxqt_backlight_backend_get(); + return actualBacklight; +} + +int LinuxBackend::getMaxBacklight() +{ + return maxBacklight; +} + +bool LinuxBackend::isBacklightAvailable() +{ + return maxBacklight > 0; +} + +bool LinuxBackend::isBacklightOff() +{ + return lxqt_backlight_is_backlight_off() > 0; +} + +void LinuxBackend::setBacklight(int value) +{ + if( ! isBacklightAvailable() ) + return; + if( backlightStream == NULL ) { + backlightStream = lxqt_backlight_backend_get_write_stream(); + if( backlightStream != NULL ) { + // Close stream after 60 seconds + QTimer::singleShot(60000, this, SLOT(closeBacklightStream())); + } + } + if( backlightStream != NULL ) { + // normalize the value (to work around an issue in QSlider) + value = qBound(0, value, maxBacklight); + fprintf(backlightStream, "%d\n", value); + fflush(backlightStream); + } +} + +void LinuxBackend::closeBacklightStream() +{ + if( backlightStream != NULL ) { + fclose(backlightStream); + backlightStream = NULL; + } +} + +void LinuxBackend::fileSystemChanged(const QString & /*path*/) +{ + int value = actualBacklight; + if( value != getBacklight() ) { + Q_EMIT backlightChanged(actualBacklight); + } +} + +} // namespace LXQt diff --git a/LibLXQT/lxqtbacklight/linux_backend/linuxbackend.h b/LibLXQT/lxqtbacklight/linux_backend/linuxbackend.h new file mode 100644 index 0000000000..aae6ff229d --- /dev/null +++ b/LibLXQT/lxqtbacklight/linux_backend/linuxbackend.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef __LinuxBackend_H__ +#define __LinuxBackend_H__ + +#include "../virtual_backend.h" +#include +#include + +namespace LXQt +{ + +class LinuxBackend:public VirtualBackEnd +{ +Q_OBJECT + +public: + LinuxBackend(QObject *parent = nullptr); + ~LinuxBackend() override; + + bool isBacklightAvailable() override; + bool isBacklightOff() override; + void setBacklight(int value) override; + int getBacklight() override; + int getMaxBacklight() override; + +private Q_SLOTS: + void closeBacklightStream(); + void fileSystemChanged(const QString & path); + +private: + int maxBacklight; + int actualBacklight; + QFileSystemWatcher *fileSystemWatcher; + FILE *backlightStream; +}; + +} // namespace LXQt + +#endif // __LinuxBackend_H__ diff --git a/LibLXQT/lxqtbacklight/virtual_backend.cpp b/LibLXQT/lxqtbacklight/virtual_backend.cpp new file mode 100644 index 0000000000..0248dc1f54 --- /dev/null +++ b/LibLXQT/lxqtbacklight/virtual_backend.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2018 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "virtual_backend.h" + +namespace LXQt { + +VirtualBackEnd::VirtualBackEnd(QObject *parent):QObject(parent) +{ +} + +bool VirtualBackEnd::isBacklightAvailable() +{ + return false; +} + +bool VirtualBackEnd::isBacklightOff() +{ + return false; +} + +void VirtualBackEnd::setBacklight(int /*value*/) +{ +} + +int VirtualBackEnd::getBacklight() +{ + return -1; +} + +int VirtualBackEnd::getMaxBacklight() +{ + return -1; +} + +} // namespace LXQt \ No newline at end of file diff --git a/LibLXQT/lxqtbacklight/virtual_backend.h b/LibLXQT/lxqtbacklight/virtual_backend.h new file mode 100644 index 0000000000..d36a0abb37 --- /dev/null +++ b/LibLXQT/lxqtbacklight/virtual_backend.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2016 P.L. Lucas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef __VirtualBackend_H__ +#define __VirtualBackend_H__ + +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +class LXQT_API VirtualBackEnd:public QObject +{ +Q_OBJECT + +public: + VirtualBackEnd(QObject *parent = nullptr); + + virtual bool isBacklightAvailable(); + virtual bool isBacklightOff(); + virtual void setBacklight(int value); + virtual int getBacklight(); + virtual int getMaxBacklight(); + +Q_SIGNALS: + void backlightChanged(int value); +}; + +} // namespace LXQt + +#endif // __VirtualBackend_H__ diff --git a/LibLXQT/lxqtglobals.h b/LibLXQT/lxqtglobals.h new file mode 100644 index 0000000000..7bd7025522 --- /dev/null +++ b/LibLXQT/lxqtglobals.h @@ -0,0 +1,55 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2013 - 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 */ + +#ifndef _LXQT_GLOBALS_H_ +#define _LXQT_GLOBALS_H_ + +#include + +#ifdef COMPILE_LIBLXQT +#define LXQT_API Q_DECL_EXPORT +#else +#define LXQT_API Q_DECL_IMPORT +#endif + +#ifndef QL1S +#define QL1S(x) QLatin1String(x) +#endif + +#ifndef QL1C +#define QL1C(x) QLatin1Char(x) +#endif + +#ifndef QSL +#define QSL(x) QStringLiteral(x) +#endif + +#ifndef QBAL +#define QBAL(x) QByteArrayLiteral(x) +#endif + +#endif // _LXQT_GLOBALS_H_ diff --git a/LibLXQT/lxqtgridlayout.cpp b/LibLXQT/lxqtgridlayout.cpp new file mode 100644 index 0000000000..09b54bd589 --- /dev/null +++ b/LibLXQT/lxqtgridlayout.cpp @@ -0,0 +1,712 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 "lxqtgridlayout.h" +#include +#include +#include +#include + +using namespace LXQt; + +class LXQt::GridLayoutPrivate +{ +public: + GridLayoutPrivate(); + ~GridLayoutPrivate(); + + QList mItems; + int mRowCount; + int mColumnCount; + GridLayout::Direction mDirection; + + bool mIsValid; + QSize mCellSizeHint; + QSize mCellMaxSize; + int mVisibleCount; + GridLayout::Stretch mStretch; + bool mAnimate; + int mAnimatedItems; //!< counter of currently animated items + + + void updateCache(); + int rows() const; + int cols() const; + void setItemGeometry(QLayoutItem * item, QRect const & geometry); + QSize mPrefCellMinSize; + QSize mPrefCellMaxSize; + QRect mOccupiedGeometry; +}; + +namespace +{ + class ItemMoveAnimation : public QVariantAnimation + { + public: + static void animate(QLayoutItem * item, QRect const & geometry, LXQt::GridLayoutPrivate * layout) + { + ItemMoveAnimation* animation = new ItemMoveAnimation(item); + animation->setStartValue(item->geometry()); + animation->setEndValue(geometry); + ++layout->mAnimatedItems; + connect(animation, &QAbstractAnimation::finished, [layout] { --layout->mAnimatedItems; Q_ASSERT(0 <= layout->mAnimatedItems); }); + animation->start(DeleteWhenStopped); + } + + ItemMoveAnimation(QLayoutItem *item) + : mItem(item) + { + setDuration(150); + } + + void updateCurrentValue(const QVariant ¤t) override + { + mItem->setGeometry(current.toRect()); + } + + private: + QLayoutItem* mItem; + + }; +} + + +/************************************************ + + ************************************************/ +GridLayoutPrivate::GridLayoutPrivate() +{ + mColumnCount = 0; + mRowCount = 0; + mDirection = GridLayout::LeftToRight; + mIsValid = false; + mVisibleCount = 0; + mStretch = GridLayout::StretchHorizontal | GridLayout::StretchVertical; + mAnimate = false; + mAnimatedItems = 0; + mPrefCellMinSize = QSize(0,0); + mPrefCellMaxSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); +} + +/************************************************ + + ************************************************/ +GridLayoutPrivate::~GridLayoutPrivate() +{ + qDeleteAll(mItems); +} + + +/************************************************ + + ************************************************/ +void GridLayoutPrivate::updateCache() +{ + mCellSizeHint = QSize(0, 0); + mCellMaxSize = QSize(0, 0); + mVisibleCount = 0; + + const int N = mItems.count(); + for (int i=0; i < N; ++i) + { + QLayoutItem *item = mItems.at(i); + if (!item->widget() || item->widget()->isHidden()) + continue; + + int h = qBound(item->minimumSize().height(), + item->sizeHint().height(), + item->maximumSize().height()); + + int w = qBound(item->minimumSize().width(), + item->sizeHint().width(), + item->maximumSize().width()); + + mCellSizeHint.rheight() = qMax(mCellSizeHint.height(), h); + mCellSizeHint.rwidth() = qMax(mCellSizeHint.width(), w); + + mCellMaxSize.rheight() = qMax(mCellMaxSize.height(), item->maximumSize().height()); + mCellMaxSize.rwidth() = qMax(mCellMaxSize.width(), item->maximumSize().width()); + mVisibleCount++; + +#if 0 + qDebug() << "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"; + qDebug() << "item.min" << item->minimumSize().width(); + qDebug() << "item.sz " << item->sizeHint().width(); + qDebug() << "item.max" << item->maximumSize().width(); + qDebug() << "w h" << w << h; + qDebug() << "wid.sizeHint" << item->widget()->sizeHint(); + qDebug() << "mCellSizeHint:" << mCellSizeHint; + qDebug() << "mCellMaxSize: " << mCellMaxSize; + qDebug() << "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"; +#endif + + } + mCellSizeHint.rwidth() = qBound(mPrefCellMinSize.width(), mCellSizeHint.width(), mPrefCellMaxSize.width()); + mCellSizeHint.rheight()= qBound(mPrefCellMinSize.height(), mCellSizeHint.height(), mPrefCellMaxSize.height()); + mIsValid = !mCellSizeHint.isEmpty(); +} + + +/************************************************ + + ************************************************/ +int GridLayoutPrivate::rows() const +{ + if (mRowCount) + return mRowCount; + + if (!mColumnCount) + return 1; + + return ceil(mVisibleCount * 1.0 / mColumnCount); +} + + +/************************************************ + + ************************************************/ +int GridLayoutPrivate::cols() const +{ + if (mColumnCount) + return mColumnCount; + + int rows = mRowCount; + if (!rows) + rows = 1; + + return ceil(mVisibleCount * 1.0 / rows); +} + +void GridLayoutPrivate::setItemGeometry(QLayoutItem * item, QRect const & geometry) +{ + mOccupiedGeometry |= geometry; + if (mAnimate) + { + ItemMoveAnimation::animate(item, geometry, this); + } else + { + item->setGeometry(geometry); + } +} + + +/************************************************ + + ************************************************/ +GridLayout::GridLayout(QWidget *parent): + QLayout(parent), + d_ptr(new GridLayoutPrivate()) +{ + // no space between items by default + setSpacing(0); +} + + +/************************************************ + + ************************************************/ +GridLayout::~GridLayout() +{ + delete d_ptr; +} + + +/************************************************ + + ************************************************/ +void GridLayout::addItem(QLayoutItem *item) +{ + d_ptr->mItems.append(item); +} + + +/************************************************ + + ************************************************/ +QLayoutItem *GridLayout::itemAt(int index) const +{ + Q_D(const GridLayout); + if (index < 0 || index >= d->mItems.count()) + return nullptr; + + return d->mItems.at(index); +} + + +/************************************************ + + ************************************************/ +QLayoutItem *GridLayout::takeAt(int index) +{ + Q_D(GridLayout); + if (index < 0 || index >= d->mItems.count()) + return nullptr; + + QLayoutItem *item = d->mItems.takeAt(index); + return item; +} + + +/************************************************ + + ************************************************/ +int GridLayout::count() const +{ + Q_D(const GridLayout); + return d->mItems.count(); +} + + +/************************************************ + + ************************************************/ +void GridLayout::invalidate() +{ + Q_D(GridLayout); + d->mIsValid = false; + QLayout::invalidate(); +} + + +/************************************************ + + ************************************************/ +int GridLayout::rowCount() const +{ + Q_D(const GridLayout); + return d->mRowCount; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setRowCount(int value) +{ + Q_D(GridLayout); + if (d->mRowCount != value) + { + d->mRowCount = value; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +int GridLayout::columnCount() const +{ + Q_D(const GridLayout); + return d->mColumnCount; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setColumnCount(int value) +{ + Q_D(GridLayout); + if (d->mColumnCount != value) + { + d->mColumnCount = value; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +GridLayout::Direction GridLayout::direction() const +{ + Q_D(const GridLayout); + return d->mDirection; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setDirection(GridLayout::Direction value) +{ + Q_D(GridLayout); + if (d->mDirection != value) + { + d->mDirection = value; + invalidate(); + } +} + +/************************************************ + + ************************************************/ +GridLayout::Stretch GridLayout::stretch() const +{ + Q_D(const GridLayout); + return d->mStretch; +} + +/************************************************ + + ************************************************/ +void GridLayout::setStretch(Stretch value) +{ + Q_D(GridLayout); + if (d->mStretch != value) + { + d->mStretch = value; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::moveItem(int from, int to, bool withAnimation /*= false*/) +{ + Q_D(GridLayout); + d->mAnimate = withAnimation; + d->mItems.move(from, to); + invalidate(); +} + + +/************************************************ + + ************************************************/ +bool GridLayout::animatedMoveInProgress() const +{ + Q_D(const GridLayout); + return 0 < d->mAnimatedItems; +} + + +/************************************************ + + ************************************************/ +QSize GridLayout::cellMinimumSize() const +{ + Q_D(const GridLayout); + return d->mPrefCellMinSize; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMinimumSize(QSize minSize) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize != minSize) + { + d->mPrefCellMinSize = minSize; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMinimumHeight(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize.height() != value) + { + d->mPrefCellMinSize.setHeight(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMinimumWidth(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize.width() != value) + { + d->mPrefCellMinSize.setWidth(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +QSize GridLayout::cellMaximumSize() const +{ + Q_D(const GridLayout); + return d->mPrefCellMaxSize; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMaximumSize(QSize maxSize) +{ + Q_D(GridLayout); + if (d->mPrefCellMaxSize != maxSize) + { + d->mPrefCellMaxSize = maxSize; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMaximumHeight(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMaxSize.height() != value) + { + d->mPrefCellMaxSize.setHeight(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellMaximumWidth(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMaxSize.width() != value) + { + d->mPrefCellMaxSize.setWidth(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellFixedSize(QSize size) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize != size || + d->mPrefCellMaxSize != size) + { + d->mPrefCellMinSize = size; + d->mPrefCellMaxSize = size; + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellFixedHeight(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize.height() != value || + d->mPrefCellMaxSize.height() != value) + { + d->mPrefCellMinSize.setHeight(value); + d->mPrefCellMaxSize.setHeight(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +void GridLayout::setCellFixedWidth(int value) +{ + Q_D(GridLayout); + if (d->mPrefCellMinSize.width() != value || + d->mPrefCellMaxSize.width() != value) + { + d->mPrefCellMinSize.setWidth(value); + d->mPrefCellMaxSize.setWidth(value); + invalidate(); + } +} + + +/************************************************ + + ************************************************/ +QSize GridLayout::sizeHint() const +{ + Q_D(const GridLayout); + + if (!d->mIsValid) + const_cast(d)->updateCache(); + + if (d->mVisibleCount == 0) + return {0, 0}; + + const int sp = spacing(); + return {d->cols() * (d->mCellSizeHint.width() + sp) - sp, + d->rows() * (d->mCellSizeHint.height() + sp) - sp}; +} + + +/************************************************ + + ************************************************/ +void GridLayout::setGeometry(const QRect &geometry) +{ + Q_D(GridLayout); + + const bool visual_h_reversed = parentWidget() && parentWidget()->isRightToLeft(); + + QLayout::setGeometry(geometry); + const QPoint occupied_start = visual_h_reversed ? geometry.topRight() : geometry.topLeft(); + d->mOccupiedGeometry.setTopLeft(occupied_start); + d->mOccupiedGeometry.setBottomRight(occupied_start); + + if (!d->mIsValid) + d->updateCache(); + + int y = geometry.top(); + int x = geometry.left(); + + // For historical reasons QRect::right returns left() + width() - 1 + // and QRect::bottom() returns top() + height() - 1; + // So we use left() + height() and top() + height() + // + // http://qt-project.org/doc/qt-4.8/qrect.html + + const int maxX = geometry.left() + geometry.width(); + const int maxY = geometry.top() + geometry.height(); + + const bool stretch_h = d->mStretch.testFlag(StretchHorizontal); + const bool stretch_v = d->mStretch.testFlag(StretchVertical); + const int sp = spacing(); + + const int cols = d->cols(); + int itemWidth = 0; + int widthRemain = 0; + if (stretch_h && 0 < cols) + { + itemWidth = qMin((geometry.width() + sp) / cols - sp, d->mCellMaxSize.width()); + widthRemain = (geometry.width() + sp) % cols; + } + else + { + itemWidth = d->mCellSizeHint.width(); + } + itemWidth = qBound(qMin(d->mPrefCellMinSize.width(), maxX), itemWidth, d->mPrefCellMaxSize.width()); + + const int rows = d->rows(); + int itemHeight = 0; + int heightRemain = 0; + if (stretch_v && 0 < rows) + { + itemHeight = qMin((geometry.height() + sp) / rows - sp, d->mCellMaxSize.height()); + heightRemain = (geometry.height() + sp) % rows; + } + else + { + itemHeight = d->mCellSizeHint.height(); + } + itemHeight = qBound(qMin(d->mPrefCellMinSize.height(), maxY), itemHeight, d->mPrefCellMaxSize.height()); + +#if 0 + qDebug() << "** GridLayout::setGeometry *******************************"; + qDebug() << "Geometry:" << geometry; + qDebug() << "CellSize:" << d->mCellSizeHint; + qDebug() << "Constraints:" << "min" << d->mPrefCellMinSize << "max" << d->mPrefCellMaxSize; + qDebug() << "Count" << count(); + qDebug() << "Cols:" << d->cols() << "(" << d->mColumnCount << ")"; + qDebug() << "Rows:" << d->rows() << "(" << d->mRowCount << ")"; + qDebug() << "Stretch:" << "h:" << (d->mStretch.testFlag(StretchHorizontal)) << " v:" << (d->mStretch.testFlag(StretchVertical)); + qDebug() << "Item:" << "h:" << itemHeight << " w:" << itemWidth; +#endif + + int remain_height = heightRemain; + int remain_width = widthRemain; + if (d->mDirection == LeftToRight) + { + int height = itemHeight + (0 < remain_height-- ? 1 : 0); + for (QLayoutItem *item : qAsConst(d->mItems)) + { + if (!item->widget() || item->widget()->isHidden()) + continue; + int width = itemWidth + (0 < remain_width-- ? 1 : 0); + + if (x + width > maxX) + { + x = geometry.left(); + y += height + sp; + + height = itemHeight + (0 < remain_height-- ? 1 : 0); + remain_width = widthRemain; + } + + const int left = visual_h_reversed ? geometry.left() + geometry.right() - x - width + 1 : x; + d->setItemGeometry(item, QRect(left, y, width, height)); + x += width + sp; + } + } + else + { + int width = itemWidth + (0 < remain_width-- ? 1 : 0); + for (QLayoutItem *item : qAsConst(d->mItems)) + { + if (!item->widget() || item->widget()->isHidden()) + continue; + int height = itemHeight + (0 < remain_height-- ? 1 : 0); + + if (y + height > maxY) + { + y = geometry.top(); + x += width + sp; + + width = itemWidth + (0 < remain_width-- ? 1 : 0); + remain_height = heightRemain; + } + const int left = visual_h_reversed ? geometry.left() + geometry.right() - x - width + 1 : x; + d->setItemGeometry(item, QRect(left, y, width, height)); + y += height + sp; + } + } + d->mAnimate = false; +} + +/************************************************ + + ************************************************/ +QRect GridLayout::occupiedGeometry() const +{ + return d_func()->mOccupiedGeometry; +} diff --git a/LibLXQT/lxqtgridlayout.h b/LibLXQT/lxqtgridlayout.h new file mode 100644 index 0000000000..9d822825fb --- /dev/null +++ b/LibLXQT/lxqtgridlayout.h @@ -0,0 +1,245 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTGRIDLAYOUT_H +#define LXQTGRIDLAYOUT_H + +#include +#include "lxqtglobals.h" +#include + + +namespace LXQt +{ + +class GridLayoutPrivate; + +/** + The GridLayout class lays out widgets in a grid. + **/ +class LXQT_API GridLayout: public QLayout +{ + Q_OBJECT +public: + /** + This enum type is used to describe direction for this grid. + **/ + enum Direction + { + LeftToRight, ///< The items are first laid out horizontally and then vertically. + TopToBottom ///< The items are first laid out vertically and then horizontally. + }; + + /** + This enum type is used to describe stretch. It contains one horizontal + and one vertical flags that can be combined to produce the required effect. + */ + enum StretchFlag + { + NoStretch = 0, ///< No justifies items + StretchHorizontal = 1, ///< Justifies items in the available horizontal space + StretchVertical = 2 ///< Justifies items in the available vertical space + }; + Q_DECLARE_FLAGS(Stretch, StretchFlag) + + + + /** + Constructs a new GridLayout with parent widget, parent. + The layout has one row and zero column initially, and will + expand to left when new items are inserted. + **/ + explicit GridLayout(QWidget *parent = nullptr); + + /** + Destroys the grid layout. The layout's widgets aren't destroyed. + **/ + ~GridLayout() override; + + void addItem(QLayoutItem *item) override; + QLayoutItem *itemAt(int index) const override; + QLayoutItem *takeAt(int index) override; + int count() const override; + void invalidate() override; + + QSize sizeHint() const override; + void setGeometry(const QRect &geometry) override; + QRect occupiedGeometry() const; + + + /** + Returns the number of rows in this grid. + **/ + int rowCount() const; + + /** + Sets the number of rows in this grid. If value is 0, then rows + count will calculated automatically when new items are inserted. + + In the most cases you should to set fixed number for one thing, + or for rows, or for columns. + + \sa GridLayout::setColumnCount + **/ + void setRowCount(int value); + + + /** + Returns the number of columns in this grid. + **/ + int columnCount() const; + + /** + Sets the number of columns in this grid. If value is 0, then columns + count will calculated automatically when new items are inserted. + + In the most cases you should to set fixed number for one thing, + or for rows, or for columns. + + \sa GridLayout::setRowCount + **/ + void setColumnCount(int value); + + + /** + Returns the alignment of this grid. + + \sa GridLayout::Direction + **/ + Direction direction() const; + + /** + Sets the direction for this grid. + + \sa GridLayout::Direction + **/ + void setDirection(Direction value); + + /** + Returns the stretch flags of this grid. + + \sa GridLayout::StretchFlag + **/ + Stretch stretch() const; + + /** + Sets the stretch flags for this grid. + + \sa GridLayout::StretchFlag + **/ + void setStretch(Stretch value); + + /** + Moves the item at index position \param from to index position \param to. + If \param withAnimation set the reordering will be animated + **/ + void moveItem(int from, int to, bool withAnimation = false); + + /** + Checks if layout is currently animated after the \sa moveItem() + invocation. + **/ + bool animatedMoveInProgress() const; + + /** + Returns the cells' minimum size. + By default, this property contains a size with zero width and height. + **/ + QSize cellMinimumSize() const; + + /** + Sets the minimum size of all cells to minSize pixels. + **/ + void setCellMinimumSize(QSize minSize); + + /** + Sets the minimum height of the cells to value without + changing the width. Provided for convenience. + **/ + void setCellMinimumHeight(int value); + + /** + Sets the minimum width of the cells to value without + changing the heights. Provided for convenience. + **/ + void setCellMinimumWidth(int value); + + + + /** + Returns the cells' maximum size. + By default, this property contains a size with zero width and height. + **/ + QSize cellMaximumSize() const; + + /** + Sets the maximum size of all cells to maxSize pixels. + **/ + void setCellMaximumSize(QSize maxSize); + + /** + Sets the maximum height of the cells to value without + changing the width. Provided for convenience. + **/ + void setCellMaximumHeight(int value); + + /** + Sets the maximum width of the cells to value without + changing the heights. Provided for convenience. + **/ + void setCellMaximumWidth(int value); + + + + /** + Sets both the minimum and maximum sizes of the cells to size, + thereby preventing it from ever growing or shrinking. + **/ + void setCellFixedSize(QSize size); + + /** + Sets both the minimum and maximum height of the cells to value without + changing the width. Provided for convenience. + **/ + void setCellFixedHeight(int value); + + /** + Sets both the minimum and maximum width of the cells to value without + changing the heights. Provided for convenience. + **/ + void setCellFixedWidth(int value); + +private: + GridLayoutPrivate* const d_ptr; + Q_DECLARE_PRIVATE(GridLayout) +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(GridLayout::Stretch) + +} // namespace LXQt +#endif // LXQTGRIDLAYOUT_H diff --git a/LibLXQT/lxqthtmldelegate.cpp b/LibLXQT/lxqthtmldelegate.cpp new file mode 100644 index 0000000000..89da228624 --- /dev/null +++ b/LibLXQT/lxqthtmldelegate.cpp @@ -0,0 +1,137 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * 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 "lxqthtmldelegate.h" +#include +#include +#include + +using namespace LXQt; + + +HtmlDelegate::HtmlDelegate(const QSize iconSize, QObject* parent) : + QStyledItemDelegate(parent), + mIconSize(iconSize) +{ +} + +HtmlDelegate::~HtmlDelegate() = default; + +/************************************************ + + ************************************************/ +void HtmlDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + if (!index.isValid()) + return; + + QStyleOptionViewItem options = option; + initStyleOption(&options, index); + const bool is_right_to_left = Qt::RightToLeft == options.direction; + + painter->save(); + + QTextDocument doc; + doc.setHtml(options.text); + QIcon icon = options.icon; + + // icon size + const QSize iconSize = icon.actualSize(mIconSize); + // center the icon vertically + QRect iconRect = QRect(8, qMax(options.rect.height() - iconSize.height(), 0) / 2, + iconSize.width(), iconSize.height()); + if (is_right_to_left) + { + iconRect.moveLeft(options.rect.left() + options.rect.right() - iconRect.x() - iconRect.width() + 1); + } + + // set doc size + // NOTE: Qt has a bug, because of which HTML tags are included in QTextDocument::setTextWidth() + // when the text is set by QTextDocument::setHtml(). + // As a result, the text height may be a little greater than needed. + doc.setTextWidth(options.rect.width() - iconRect.width() - 8 - 8); // 8-px icon-text spacing + + // draw the item's panel + const QWidget* widget = option.widget; + QStyle* style = widget ? widget->style() : QApplication::style(); + style->drawPrimitive(QStyle::PE_PanelItemViewItem, &options, painter, widget); + + // paint icon + painter->translate(options.rect.left(), options.rect.top()); + icon.paint(painter, iconRect); + + // center the text vertically + painter->translate(0, qMax(static_cast(options.rect.height()) - doc.size().height(), 0.0) / 2.0); + + if (!is_right_to_left) + { + // shift text right to make icon visible + painter->translate((iconRect.right() + 1) + 8, 0); + } + const QRect clip(0, 0, options.rect.width() - iconRect.width() - 8, options.rect.height()); + painter->setClipRect(clip); + + // set text colors + QAbstractTextDocumentLayout::PaintContext ctx; + QPalette::ColorGroup colorGroup = (option.state & QStyle::State_Active) ? QPalette::Active : QPalette::Inactive; + if (option.state & QStyle::State_Selected) // selected items + ctx.palette.setColor(QPalette::Text, option.palette.color(colorGroup, QPalette::HighlightedText)); + else // ordinary items and those with an alternate base color (there is no alternate text color) + ctx.palette.setColor(QPalette::Text, option.palette.color(colorGroup, QPalette::Text)); + + ctx.clip = clip; + doc.documentLayout()->draw(painter, ctx); + + painter->restore(); +} + + +/************************************************ + + ************************************************/ +QSize HtmlDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QStyleOptionViewItem options = option; + initStyleOption(&options, index); + + const QSize iconSize = options.icon.actualSize(mIconSize); + // 8-px left, top and bottom margins for the icon + const QRect iconRect = QRect(8, 8, iconSize.width(), iconSize.height()); + const int w = options.rect.width(); + + QTextDocument doc; + doc.setHtml(options.text); + + if (w > 0) + doc.setTextWidth(static_cast(w - (iconRect.right() + 1) - 8)); // 8-px icon-text spacing + else + doc.adjustSize(); + return {w > 0 ? w : iconRect.width() + 8 + qRound(doc.size().width()) + 8, + qMax(qRound(doc.size().height() + 8), // 4-px top/bottom text spacing + iconSize.height() + 16)}; +} diff --git a/LibLXQT/lxqthtmldelegate.h b/LibLXQT/lxqthtmldelegate.h new file mode 100644 index 0000000000..5eba3db163 --- /dev/null +++ b/LibLXQT/lxqthtmldelegate.h @@ -0,0 +1,57 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * 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 LXQTHTMLDELEGATE_H +#define LXQTHTMLDELEGATE_H + +#include +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +class LXQT_API HtmlDelegate : public QStyledItemDelegate +{ + Q_OBJECT + +public: + explicit HtmlDelegate(const QSize iconSize, QObject* parent = nullptr); + ~HtmlDelegate() override; + + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; + + QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override; + +private: + QSize mIconSize; +}; + +} + +#endif diff --git a/LibLXQT/lxqtnotification.cpp b/LibLXQT/lxqtnotification.cpp new file mode 100644 index 0000000000..947ce56b72 --- /dev/null +++ b/LibLXQT/lxqtnotification.cpp @@ -0,0 +1,254 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtnotification.h" +#include "lxqtnotification_p.h" +#include +#include + +using namespace LXQt; + +Notification::Notification(const QString& summary, QObject* parent) : + QObject(parent), + d_ptr(new NotificationPrivate(summary, this)) +{ +} + +Notification::~Notification() +{ + Q_D(Notification); + delete d; +} + +void Notification::update() +{ + Q_D(Notification); + d->update(); +} + +void Notification::close() +{ + Q_D(Notification); + d->close(); +} + +void Notification::setSummary(const QString& summary) +{ + Q_D(Notification); + d->mSummary = summary; +} + +void Notification::setBody(const QString& body) +{ + Q_D(Notification); + d->mBody = body; +} + +void Notification::setIcon(const QString& iconName) +{ + Q_D(Notification); + d->mIconName = iconName; +} + +void Notification::setActions(const QStringList& actions, int defaultAction) +{ + Q_D(Notification); + d->setActions(actions, defaultAction); +} + +void Notification::setTimeout(int timeout) +{ + Q_D(Notification); + d->mTimeout = timeout; +} + +void Notification::setHint(const QString& hintName, const QVariant& value) +{ + Q_D(Notification); + d->mHints.insert(hintName, value); +} + +void Notification::setUrgencyHint(Urgency urgency) +{ + Q_D(Notification); + d->mHints.insert(QL1S("urgency"), qvariant_cast(urgency)); +} + +void Notification::clearHints() +{ + Q_D(Notification); + d->mHints.clear(); +} + +QStringList Notification::getCapabilities() +{ + Q_D(Notification); + return d->mInterface->GetCapabilities().value(); +} + +const Notification::ServerInfo Notification::serverInfo() +{ + Q_D(Notification); + return d->serverInfo(); +} + +void Notification::queryServerInfo() +{ + Q_D(Notification); + d->queryServerInfo(/*async=*/true); +} + +void Notification::notify(const QString& summary, const QString& body, const QString& iconName) +{ + Notification notification(summary); + notification.setBody(body); + notification.setIcon(iconName); + notification.update(); +} + +bool NotificationPrivate::sIsServerInfoQuried = 0; +Notification::ServerInfo NotificationPrivate::sServerInfo; + +NotificationPrivate::NotificationPrivate(const QString& summary, Notification* parent) : + mId(0), + mSummary(summary), + mTimeout(-1), + q_ptr(parent) +{ + mInterface = new OrgFreedesktopNotificationsInterface(QL1S("org.freedesktop.Notifications"), + QL1S("/org/freedesktop/Notifications"), + QDBusConnection::sessionBus(), this); + connect(mInterface, &OrgFreedesktopNotificationsInterface::NotificationClosed, + this, &NotificationPrivate::notificationClosed); + connect(mInterface, &OrgFreedesktopNotificationsInterface::ActionInvoked, + this, &NotificationPrivate::handleAction); +} + +NotificationPrivate::~NotificationPrivate() = default; + +void NotificationPrivate::update() +{ + QDBusPendingReply reply = mInterface->Notify(qAppName(), mId, mIconName, mSummary, mBody, mActions, mHints, mTimeout); + reply.waitForFinished(); + if (!reply.isError()) + { + mId = reply.value(); + } + else + { + if (mHints.contains(QL1S("urgency")) && mHints.value(QL1S("urgency")).toInt() != Notification::UrgencyLow) + QMessageBox::information(nullptr, tr("Notifications Fallback"), mSummary + QL1S(" \n\n ") + mBody); + } +} + + +void NotificationPrivate::setActions(QStringList actions, int defaultAction) +{ + mActions.clear(); + mDefaultAction = defaultAction; + const int N = actions.size(); + for (int ix = 0; ix < N; ix++) + { + if (ix == defaultAction) + mActions.append(QL1S("default")); + else + mActions.append(QString::number(ix)); + mActions.append(actions[ix]); + } +} + +const Notification::ServerInfo NotificationPrivate::serverInfo() +{ + if (!sIsServerInfoQuried) { + queryServerInfo (/*async=*/false); + } + + return sServerInfo; +} + +void NotificationPrivate::queryServerInfo(bool async) +{ + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(mInterface->GetServerInformation(), this); + + connect(watcher, &QDBusPendingCallWatcher::finished, [this](QDBusPendingCallWatcher* callWatcher) { + Q_Q(Notification); + QDBusPendingReply reply = *callWatcher; + + if (!reply.isError()) { + sServerInfo.name = reply.argumentAt<0>(); + sServerInfo.vendor = reply.argumentAt<1>(); + sServerInfo.version = reply.argumentAt<2>(); + sServerInfo.specVersion = reply.argumentAt<3>(); + } else { + // server either responds something strange or nothing; assume it's malfunctioning + sServerInfo.name.clear(); + sServerInfo.vendor.clear(); + sServerInfo.version.clear(); + sServerInfo.specVersion.clear(); + } + sIsServerInfoQuried = true; + Q_EMIT q->serverInfoReady(); + sender()->deleteLater(); + }); + + if (!async) { + QEventLoop loop; + connect(watcher, &QDBusPendingCallWatcher::finished, &loop, &QEventLoop::quit); + loop.exec(); + } +} + +void NotificationPrivate::handleAction(uint id, const QString& key) +{ + if (id != mId) + return; + + Q_Q(Notification); + qDebug() << "action invoked:" << key; + bool ok = true; + int keyId; + if (key == QL1S("default")) + keyId = mDefaultAction; + else + keyId = key.toInt(&ok); + + if (ok && keyId >= 0) + Q_EMIT q->actionActivated(keyId); +} + +void NotificationPrivate::close() +{ + mInterface->CloseNotification(mId); + mId = 0; +} + +void NotificationPrivate::notificationClosed(uint id, uint reason) +{ + Q_Q(Notification); + if (id != 0 && id == mId) + { + mId = 0; + } + Q_EMIT q->notificationClosed(Notification::CloseReason(reason)); +} diff --git a/LibLXQT/lxqtnotification.h b/LibLXQT/lxqtnotification.h new file mode 100644 index 0000000000..0e2ecf9bef --- /dev/null +++ b/LibLXQT/lxqtnotification.h @@ -0,0 +1,211 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTNOTIFICATION_H +#define LXQTNOTIFICATION_H + +#include +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +class NotificationPrivate; + +/** + * \brief Libnotify-style desktop notifications + * + * Spec: http://developer.gnome.org/notification-spec + */ +class LXQT_API Notification : public QObject +{ + Q_OBJECT +public: + /*! + * \brief Notification is an object that represents a single notification. + * \param summary Summary text briefly describing the notification (required by the spec) + */ + Notification(const QString& summary = QString(), QObject* parent = nullptr); + ~Notification() override; + + enum CloseReason + { + //! The notification expired. + Expired = 1, + //! The notification was dismissed by the user. + Dismissed = 2, + //! The notification was closed by a call to close(). + ForceClosed = 3, + //! Undefined/reserved reasons. + Unknown = 4 + }; + + enum Urgency + { + UrgencyLow = 0, + UrgencyNormal = 1, + UrgencyCritical = 2 + }; + + struct ServerInfo + { + //! The product name of the server. + QString name; + //! The vendor name. For example, "lxqt.org" + QString vendor; + //! The server's version number. + QString version; + //! The specification version the server is compliant with. + QString specVersion; + }; + + /*! + * \brief Set the summary text briefly describing the notification + */ + void setSummary(const QString& summary); + + /*! + * \brief Set the detailed body text + */ + void setBody(const QString& body); + + /*! + * \brief Set an icon to display + * \param iconName Name of the icon + */ + void setIcon(const QString& iconName); + + /*! + * \brief Set action buttons for the notification. Whenever an action is + * activated, the actionActivated() signal is emitted with the list + * index of the activated action. + * \param actions List of action button titles + * \param defaultAction Index of the default action which gets activated + * when the notification body is clicked + * \sa actionActivated() + */ + void setActions(const QStringList& actions, int defaultAction = -1); + + /*! + * \brief Set the timeout for the notification + * \param timeout Milliseconds for timeout, or zero to never time out. + */ + void setTimeout(int timeout); + + /*! + * \brief Set notification hint. + * \note For description of Hints, see http://developer.gnome.org/notification-spec/#hints + * \note For D-Bus-to-Qt mappings, see https://qt-project.org/doc/qdbustypesystem.html + * \param hint Hint name + * \param value The hint data + */ + void setHint(const QString& hint, const QVariant& value); + + /*! + * \brief Set the "urgency" hint + * \param urgency + */ + void setUrgencyHint(Urgency urgency); + + /*! + * \brief Remove all hints that were set + * \sa setHint() + */ + void clearHints(); + + /*! + * \brief returns a list of optional capabilities supported by the server. + * For the list, see http://developer.gnome.org/notification-spec/#commands + */ + QStringList getCapabilities(); + + /*! + * \brief Returns information about the notifications server + * \note This call may block for up to 25s (default dbus timeout) if the notification server + * is not running and the info wasn't previously queried. + * \sa queryServerInfo() + */ + const ServerInfo serverInfo(); + + /*! + * \brief Performs an asyncronous query of the notifications server information. + * Use serverInfoReady signal to get notified (no pun intended) when the + * info will be received. + * \sa serverInfo() + * \sa serverInfoReady() + */ + void queryServerInfo(); + + /*! + * \brief Convenience function to create and display a notification for the most common + * cases. For anything more complex, create a Notification object, set the + * desired properties and call update(). (That's what this does internally.) + * \sa Notification() + */ + static void notify(const QString& summary, + const QString& body = QString(), + const QString& iconName = QString() + ); + +public Q_SLOTS: + /*! + * \brief Display the notification or update it if it's already visible + */ + void update(); + + /*! + * \brief Causes a notification to be forcefully closed and removed from the user's view. + * It can be used, for example, in the event that what the notification pertains to + * is no longer relevant, or to cancel a notification with no expiration time. + */ + void close(); + +Q_SIGNALS: + /*! + * \brief Emitted when the notification is closed + * \param reason How notification was closed + */ + void notificationClosed(LXQt::Notification::CloseReason reason); + + /*! + * \brief Emitted when an action button is activated. + * \param actionNumber Index of the actions array for the activated button. + * \sa setActions() + */ + void actionActivated(int actionNumber); + + /*! + * \brief Emitted when queried server info is received + * \sa queryServerInfo() + */ + void serverInfoReady(); + +private: + Q_DECLARE_PRIVATE(Notification) + NotificationPrivate* const d_ptr; +}; + +} // namespace LXQt +#endif // LXQTNOTIFICATION_H diff --git a/LibLXQT/lxqtnotification_p.h b/LibLXQT/lxqtnotification_p.h new file mode 100644 index 0000000000..617390801a --- /dev/null +++ b/LibLXQT/lxqtnotification_p.h @@ -0,0 +1,71 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2012 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTNOTIFICATION_P_H +#define LXQTNOTIFICATION_P_H + +#include "lxqtnotification.h" +#include "notifications_interface.h" + +namespace LXQt +{ + +class NotificationPrivate : public QObject +{ + Q_OBJECT +public: + NotificationPrivate(const QString& summary, Notification* parent); + ~NotificationPrivate() override; + + void update(); + void close(); + void setActions(QStringList actions, int defaultAction); + const Notification::ServerInfo serverInfo(); + void queryServerInfo(bool async=1); + +public Q_SLOTS: + void handleAction(uint id, const QString& key); + void notificationClosed(uint, uint); + +private: + OrgFreedesktopNotificationsInterface* mInterface; + uint mId; + + QString mSummary; + QString mBody; + QString mIconName; + QStringList mActions; + QVariantMap mHints; + int mDefaultAction; + int mTimeout; + + static Notification::ServerInfo sServerInfo; + static bool sIsServerInfoQuried; + + Notification* const q_ptr; + Q_DECLARE_PUBLIC(Notification) +}; + +} // namespace LXQt +#endif // LXQTNOTIFICATION_P_H diff --git a/LibLXQT/lxqtplugininfo.cpp b/LibLXQT/lxqtplugininfo.cpp new file mode 100644 index 0000000000..c2aa368ddb --- /dev/null +++ b/LibLXQT/lxqtplugininfo.cpp @@ -0,0 +1,180 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 "lxqtplugininfo.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace LXQt; + +/************************************************ + + ************************************************/ +PluginInfo::PluginInfo(): + XdgDesktopFile() +{ + +} + + +/************************************************ + + ************************************************/ +bool PluginInfo::load(const QString& fileName) +{ + XdgDesktopFile::load(fileName); + mId = QFileInfo(fileName).completeBaseName(); + return isValid(); +} + + +/************************************************ + + ************************************************/ +bool PluginInfo::isValid() const +{ + return XdgDesktopFile::isValid(); +} + + +/************************************************ + + ************************************************/ +QLibrary* PluginInfo::loadLibrary(const QString& libDir) const +{ + const QFileInfo fi = QFileInfo(fileName()); + const QString path = fi.canonicalPath(); + const QString baseName = value(QL1S("X-LXQt-Library"), fi.completeBaseName()).toString(); + + const QString soPath = QDir(libDir).filePath(QString::fromLatin1("lib%2.so").arg(baseName)); + QLibrary* library = new QLibrary(soPath); + + if (!library->load()) + { + qWarning() << QString::fromLatin1("Can't load plugin lib \"%1\"").arg(soPath) << library->errorString(); + delete library; + return nullptr; + } + + const QString locale = QLocale::system().name(); + QTranslator* translator = new QTranslator(library); + + translator->load(QString::fromLatin1("%1/%2/%2_%3.qm").arg(path, baseName, locale)); + qApp->installTranslator(translator); + + return library; +} + + +/************************************************ + + ************************************************/ +PluginInfoList PluginInfo::search(const QStringList& desktopFilesDirs, const QString& serviceType, const QString& nameFilter) +{ + QList res; + QSet processed; + + for (const QString &desktopFilesDir : desktopFilesDirs) + { + const QDir dir(desktopFilesDir); + const QFileInfoList files = dir.entryInfoList(QStringList(nameFilter), QDir::Files | QDir::Readable); + for (const QFileInfo &file : files) + { + if (processed.contains(file.fileName())) + continue; + + processed << file.fileName(); + + PluginInfo item; + item.load(file.canonicalFilePath()); + + if (item.isValid() && item.serviceType() == serviceType) + res.append(item); + } + } + return res; +} + + +/************************************************ + + ************************************************/ +PluginInfoList PluginInfo::search(const QString& desktopFilesDir, const QString& serviceType, const QString& nameFilter) +{ + return search(QStringList(desktopFilesDir), serviceType, nameFilter); +} + + +/************************************************ + + ************************************************/ +QDebug operator<<(QDebug dbg, const LXQt::PluginInfo &pluginInfo) +{ + dbg.nospace() << QString::fromLatin1("%1").arg(pluginInfo.id()); + return dbg.space(); +} + + +/************************************************ + + ************************************************/ +QDebug operator<<(QDebug dbg, const LXQt::PluginInfo * const pluginInfo) +{ + return operator<<(std::move(dbg), *pluginInfo); +} + + +/************************************************ + + ************************************************/ +QDebug operator<<(QDebug dbg, const PluginInfoList& list) +{ + dbg.nospace() << QL1C('('); + for (int i=0; i + * + * 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 LXQTPLUGININFO_H +#define LXQTPLUGININFO_H + +#include +#include + +#include +#include +#include +#include "lxqtglobals.h" + +#include + +class QLibrary; + +namespace LXQt +{ + +/*! +Every plugin needs a .desktop file that describes it. The basename of this file must +be same as the basename of the plugin library. + +lxqtpanel_clock2.desktop file + +[Desktop Entry] + Type=Service + ServiceTypes=LXQtPanel/Plugin + Name=Clock + Comment=Clock and calendar + +PluginInfo class gives the interface for reading the values from the plugin .desktop file. +This is a pure virtual class, you must implement libraryDir(), translationDir(), and instance() methods. +*/ +class LXQT_API PluginInfo: public XdgDesktopFile +{ +public: + /// Constructs a PluginInfo object for accessing the info stored in the .desktop file. + explicit PluginInfo(); + + //! Reimplemented from XdgDesktopFile. + bool load(const QString& fileName) override; + + + //! Reimplemented from XdgDesktopFile. + //PluginInfo& operator=(const PluginInfo& other); + + + //! Returns identification string of this plugin, identified plugin type. Now id is part of the filename. + QString id() const { return mId; } + + //! This function is provided for convenience. It's equivalent to calling value("ServiceTypes").toString(). + QString serviceType() const { return value(QL1S("ServiceTypes")).toString(); } + + //! Reimplemented from XdgDesktopFile. + virtual bool isValid() const; + + /*! Loads the library and returns QLibrary object if the library was loaded successfully; otherwise returns 0. + @parm libDir directory where placed the plugin .so file. */ + QLibrary* loadLibrary(const QString& libDir) const; + + + /*! Returns a list of PluginInfo objects for the matched files in the directories. + @param desktopFilesDirs - scanned directories names. + @param serviceType - type of the plugin, for example "LXQtPanel/Plugin". + @param nameFilter - wildcard filter that understands * and ? wildcards. + + If the same filename is located under multiple directories only the first file should be used. + */ + static QList search(const QStringList& desktopFilesDirs, const QString& serviceType, const QString& nameFilter = QLatin1String("*")); + + /// This function is provided for convenience. It's equivalent to new calling search(QString(desktopFilesDir), serviceType, nameFilter) + static QList search(const QString& desktopFilesDir, const QString& serviceType, const QString& nameFilter = QLatin1String("*")); + +private: + QString mId; +}; + +typedef QList PluginInfoList; + +} // namespace LXQt + +QDebug operator<<(QDebug dbg, const LXQt::PluginInfo& pi); +QDebug operator<<(QDebug dbg, const LXQt::PluginInfo* const pi); + +QDebug operator<<(QDebug dbg, const LXQt::PluginInfoList& list); +QDebug operator<<(QDebug dbg, const LXQt::PluginInfoList* const pluginInfoList); + +#endif // LXQTPLUGININFO_H diff --git a/LibLXQT/lxqtpower/lxqtpower.cpp b/LibLXQT/lxqtpower/lxqtpower.cpp new file mode 100644 index 0000000000..a0fbf8c745 --- /dev/null +++ b/LibLXQT/lxqtpower/lxqtpower.cpp @@ -0,0 +1,98 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 "lxqtpower.h" +#include "lxqtpowerproviders.h" +#include +#include + +using namespace LXQt; + +Power::Power(bool useLxqtSessionProvider, QObject * parent /*= nullptr*/) : + QObject(parent) +{ + mProviders.append(new CustomProvider(this)); + if (useLxqtSessionProvider) + mProviders.append(new LXQtProvider(this)); + mProviders.append(new SystemdProvider(this)); + mProviders.append(new UPowerProvider(this)); + mProviders.append(new ConsoleKitProvider(this)); + mProviders.append(new LxSessionProvider(this)); +} + +Power::Power(QObject * parent /*= nullptr*/) + : Power(true, parent) +{ +} + + +Power::~Power() = default; + + +bool Power::canAction(Power::Action action) const +{ + for(const PowerProvider* provider : qAsConst(mProviders)) + { + if (provider->canAction(action)) + return true; + } + + return false; +} + + +bool Power::doAction(Power::Action action) +{ + for(PowerProvider* provider : qAsConst(mProviders)) + { + if (provider->canAction(action) && + provider->doAction(action) + ) + { + return true; + } + } + return false; +} + + +bool Power::canLogout() const { return canAction(PowerLogout); } +bool Power::canHibernate() const { return canAction(PowerHibernate); } +bool Power::canReboot() const { return canAction(PowerReboot); } +bool Power::canShutdown() const { return canAction(PowerShutdown); } +bool Power::canSuspend() const { return canAction(PowerSuspend); } +bool Power::canMonitorOff() const { return canAction(PowerMonitorOff); } +bool Power::canShowLeaveDialog() const { return canAction(PowerShowLeaveDialog); } + +bool Power::logout() { return doAction(PowerLogout); } +bool Power::hibernate() { return doAction(PowerHibernate); } +bool Power::reboot() { return doAction(PowerReboot); } +bool Power::shutdown() { return doAction(PowerShutdown); } +bool Power::suspend() { return doAction(PowerSuspend); } +bool Power::monitorOff() { return doAction(PowerMonitorOff); } +bool Power::showLeaveDialog() { return doAction(PowerShowLeaveDialog); } diff --git a/LibLXQT/lxqtpower/lxqtpower.h b/LibLXQT/lxqtpower/lxqtpower.h new file mode 100644 index 0000000000..01d337250f --- /dev/null +++ b/LibLXQT/lxqtpower/lxqtpower.h @@ -0,0 +1,129 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTPOWER_H +#define LXQTPOWER_H + +#include +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + + +class PowerProvider; + +/*! Power class provides an interface to control system-wide power and session management. + It allows logout from the user session, hibernate, reboot, shutdown and suspend computer. + This is a wrapper class. All the real work is done in the PowerWorker classes. +*/ +class LXQT_API Power : public QObject +{ + Q_OBJECT +public: + /// Power can perform next actions: + enum Action{ + PowerLogout, /// Close the current user session. + PowerHibernate, /// Hibernate the comupter + PowerReboot, /// Reboot the computer + PowerShutdown, /// Shutdown the computer + PowerSuspend, /// Suspend the computer + PowerMonitorOff, /// Turn off the monitor(s) + PowerShowLeaveDialog /// Show the lxqt-leave dialog + }; + + /*! + * Constructs the Power object. + * \param useLxqtSessionProvider indicates if the DBus methods + * provided by lxqt-session should be considered. This is useful to + * avoid recursion if the lxqt-session wants to provide some of the + * methods by itself with internal use of this object. + */ + explicit Power(bool useLxqtSessionProvider, QObject *parent = nullptr); + /// Constructs a Power with using the lxqt-session provider. + explicit Power(QObject *parent = nullptr); + + /// Destroys the object. + ~Power() override; + + /// Returns true if the Power can perform action. + bool canAction(Action action) const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerLogout). + bool canLogout() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerHibernate). + bool canHibernate() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerReboot). + bool canReboot() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerShutdown). + bool canShutdown() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerSuspend). + bool canSuspend() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerMonitorOff). + bool canMonitorOff() const; + + //! This function is provided for convenience. It's equivalent to calling canAction(PowerShowLeaveDialog). + bool canShowLeaveDialog() const; + +public Q_SLOTS: + /// Performs the requested action. + bool doAction(Action action); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerLogout). + bool logout(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerHibernate). + bool hibernate(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerReboot). + bool reboot(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerShutdown). + bool shutdown(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerSuspend). + bool suspend(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerMonitorOff). + bool monitorOff(); + + //! This function is provided for convenience. It's equivalent to calling doAction(PowerShowLeaveDialog). + bool showLeaveDialog(); + +private: + QList mProviders; +}; + +} // namespace LXQt +#endif // LXQTPOWER_H diff --git a/LibLXQT/lxqtpower/lxqtpowerproviders.cpp b/LibLXQT/lxqtpower/lxqtpowerproviders.cpp new file mode 100644 index 0000000000..4f6aa4c230 --- /dev/null +++ b/LibLXQT/lxqtpower/lxqtpowerproviders.cpp @@ -0,0 +1,696 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * 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 "lxqtpowerproviders.h" +#include +#include +#include +#include "lxqtnotification.h" +#include // for kill() + +#define UPOWER_SERVICE "org.freedesktop.UPower" +#define UPOWER_PATH "/org/freedesktop/UPower" +#define UPOWER_INTERFACE UPOWER_SERVICE + +#define CONSOLEKIT_SERVICE "org.freedesktop.ConsoleKit" +#define CONSOLEKIT_PATH "/org/freedesktop/ConsoleKit/Manager" +#define CONSOLEKIT_INTERFACE "org.freedesktop.ConsoleKit.Manager" + +#define SYSTEMD_SERVICE "org.freedesktop.login1" +#define SYSTEMD_PATH "/org/freedesktop/login1" +#define SYSTEMD_INTERFACE "org.freedesktop.login1.Manager" + +#define LXQT_SERVICE "org.lxqt.session" +#define LXQT_PATH "/LXQtSession" +#define LXQT_INTERFACE "org.lxqt.session" + +#define PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties" + +using namespace LXQt; + +/************************************************ + Helper func + ************************************************/ +void printDBusMsg(const QDBusMessage &msg) +{ + qWarning() << "** Dbus error **************************"; + qWarning() << "Error name " << msg.errorName(); + qWarning() << "Error msg " << msg.errorMessage(); + qWarning() << "****************************************"; +} + + +/************************************************ + Helper func + ************************************************/ +static bool dbusCall(const QString &service, + const QString &path, + const QString &interface, + const QDBusConnection &connection, + const QString & method, + PowerProvider::DbusErrorCheck errorCheck = PowerProvider::CheckDBUS + ) +{ + QDBusInterface dbus(service, path, interface, connection); + if (!dbus.isValid()) + { + qWarning() << "dbusCall: QDBusInterface is invalid" << service << path << interface << method; + if (errorCheck == PowerProvider::CheckDBUS) + { + Notification::notify( + QObject::tr("Power Manager Error"), + QObject::tr("QDBusInterface is invalid") + QL1S("\n\n") + service + QL1C(' ') + path + QL1C(' ') + interface + QL1C(' ') + method, + QL1S("lxqt-logo.png")); + } + return false; + } + + QDBusMessage msg = dbus.call(method); + + if (!msg.errorName().isEmpty()) + { + printDBusMsg(msg); + if (errorCheck == PowerProvider::CheckDBUS) + { + Notification::notify( + QObject::tr("Power Manager Error (D-BUS call)"), + msg.errorName() + QL1S("\n\n") + msg.errorMessage(), + QL1S("lxqt-logo.png")); + } + } + + // If the method no returns value, we believe that it was successful. + return msg.arguments().isEmpty() || + msg.arguments().constFirst().isNull() || + msg.arguments().constFirst().toBool(); +} + +/************************************************ + Helper func + + Just like dbusCall(), except that systemd + returns a string instead of a bool, and it takes + an "interactivity boolean" as an argument. + ************************************************/ +static bool dbusCallSystemd(const QString &service, + const QString &path, + const QString &interface, + const QDBusConnection &connection, + const QString &method, + bool needBoolArg, + PowerProvider::DbusErrorCheck errorCheck = PowerProvider::CheckDBUS + ) +{ + QDBusInterface dbus(service, path, interface, connection); + if (!dbus.isValid()) + { + qWarning() << "dbusCall: QDBusInterface is invalid" << service << path << interface << method; + if (errorCheck == PowerProvider::CheckDBUS) + { + Notification::notify( + QObject::tr("Power Manager Error"), + QObject::tr("QDBusInterface is invalid") + QL1S("\n\n") + service + QL1C(' ') + path + QL1C(' ')+ interface + QL1C(' ') + method, + QL1S("lxqt-logo.png")); + } + return false; + } + + QDBusMessage msg = needBoolArg ? dbus.call(method, QVariant(true)) : dbus.call(method); + + if (!msg.errorName().isEmpty()) + { + printDBusMsg(msg); + if (errorCheck == PowerProvider::CheckDBUS) + { + Notification::notify( + QObject::tr("Power Manager Error (D-BUS call)"), + msg.errorName() + QL1S("\n\n") + msg.errorMessage(), + QL1S("lxqt-logo.png")); + } + } + + // If the method no returns value, we believe that it was successful. + if (msg.arguments().isEmpty() || msg.arguments().constFirst().isNull()) + return true; + + QString response = msg.arguments().constFirst().toString(); + qDebug() << "systemd:" << method << "=" << response; + return response == QL1S("yes") || response == QL1S("challenge"); +} + + +/************************************************ + Helper func + ************************************************/ +bool dbusGetProperty(const QString &service, + const QString &path, + const QString &interface, + const QDBusConnection &connection, + const QString & property + ) +{ + QDBusInterface dbus(service, path, interface, connection); + if (!dbus.isValid()) + { + qWarning() << "dbusGetProperty: QDBusInterface is invalid" << service << path << interface << property; +// Notification::notify(QObject::tr("LXQt Power Manager"), +// "lxqt-logo.png", +// QObject::tr("Power Manager Error"), +// QObject::tr("QDBusInterface is invalid")+ "\n\n" + service +" " + path +" " + interface +" " + property); + + return false; + } + + QDBusMessage msg = dbus.call(QL1S("Get"), dbus.interface(), property); + + if (!msg.errorName().isEmpty()) + { + printDBusMsg(msg); +// Notification::notify(QObject::tr("LXQt Power Manager"), +// "lxqt-logo.png", +// QObject::tr("Power Manager Error (Get Property)"), +// msg.errorName() + "\n\n" + msg.errorMessage()); + } + + return !msg.arguments().isEmpty() && + msg.arguments().constFirst().value().variant().toBool(); +} + + + + +/************************************************ + PowerProvider + ************************************************/ +PowerProvider::PowerProvider(QObject *parent): + QObject(parent) +{ +} + + +PowerProvider::~PowerProvider() = default; + + + +/************************************************ + UPowerProvider + ************************************************/ +UPowerProvider::UPowerProvider(QObject *parent): + PowerProvider(parent) +{ +} + + +UPowerProvider::~UPowerProvider() = default; + + +bool UPowerProvider::canAction(Power::Action action) const +{ + QString command; + QString property; + switch (action) + { + case Power::PowerHibernate: + property = QL1S("CanHibernate"); + command = QL1S("HibernateAllowed"); + break; + + case Power::PowerSuspend: + property = QL1S("CanSuspend"); + command = QL1S("SuspendAllowed"); + break; + + default: + return false; + } + + return dbusGetProperty( // Whether the system is able to hibernate. + QL1S(UPOWER_SERVICE), + QL1S(UPOWER_PATH), + QL1S(PROPERTIES_INTERFACE), + QDBusConnection::systemBus(), + property + ) + && + dbusCall( // Check if the caller has (or can get) the PolicyKit privilege to call command. + QL1S(UPOWER_SERVICE), + QL1S(UPOWER_PATH), + QL1S(UPOWER_INTERFACE), + QDBusConnection::systemBus(), + command, + // canAction should be always silent because it can freeze + // g_main_context_iteration Qt event loop in QMessageBox + // on panel startup if there is no DBUS running. + PowerProvider::DontCheckDBUS + ); +} + + +bool UPowerProvider::doAction(Power::Action action) +{ + QString command; + + switch (action) + { + case Power::PowerHibernate: + command = QL1S("Hibernate"); + break; + + case Power::PowerSuspend: + command = QL1S("Suspend"); + break; + + default: + return false; + } + + + return dbusCall(QL1S(UPOWER_SERVICE), + QL1S(UPOWER_PATH), + QL1S(UPOWER_INTERFACE), + QDBusConnection::systemBus(), + command ); +} + + + +/************************************************ + ConsoleKitProvider + ************************************************/ +ConsoleKitProvider::ConsoleKitProvider(QObject *parent): + PowerProvider(parent) +{ +} + + +ConsoleKitProvider::~ConsoleKitProvider() = default; + + +bool ConsoleKitProvider::canAction(Power::Action action) const +{ + QString command; + switch (action) + { + case Power::PowerReboot: + command = QL1S("CanReboot"); + break; + + case Power::PowerShutdown: + command = QL1S("CanPowerOff"); + break; + + case Power::PowerHibernate: + command = QL1S("CanHibernate"); + break; + + case Power::PowerSuspend: + command = QL1S("CanSuspend"); + break; + + default: + return false; + } + + return dbusCallSystemd(QL1S(CONSOLEKIT_SERVICE), + QL1S(CONSOLEKIT_PATH), + QL1S(CONSOLEKIT_INTERFACE), + QDBusConnection::systemBus(), + command, + false, + // canAction should be always silent because it can freeze + // g_main_context_iteration Qt event loop in QMessageBox + // on panel startup if there is no DBUS running. + PowerProvider::DontCheckDBUS + ); +} + + +bool ConsoleKitProvider::doAction(Power::Action action) +{ + QString command; + switch (action) + { + case Power::PowerReboot: + command = QL1S("Reboot"); + break; + + case Power::PowerShutdown: + command = QL1S("PowerOff"); + break; + + case Power::PowerHibernate: + command = QL1S("Hibernate"); + break; + + case Power::PowerSuspend: + command = QL1S("Suspend"); + break; + + default: + return false; + } + + return dbusCallSystemd(QL1S(CONSOLEKIT_SERVICE), + QL1S(CONSOLEKIT_PATH), + QL1S(CONSOLEKIT_INTERFACE), + QDBusConnection::systemBus(), + command, + true + ); +} + +/************************************************ + SystemdProvider + + http://www.freedesktop.org/wiki/Software/systemd/logind + ************************************************/ + +SystemdProvider::SystemdProvider(QObject *parent): + PowerProvider(parent) +{ +} + + +SystemdProvider::~SystemdProvider() = default; + + +bool SystemdProvider::canAction(Power::Action action) const +{ + QString command; + + switch (action) + { + case Power::PowerReboot: + command = QL1S("CanReboot"); + break; + + case Power::PowerShutdown: + command = QL1S("CanPowerOff"); + break; + + case Power::PowerSuspend: + command = QL1S("CanSuspend"); + break; + + case Power::PowerHibernate: + command = QL1S("CanHibernate"); + break; + + default: + return false; + } + + return dbusCallSystemd(QL1S(SYSTEMD_SERVICE), + QL1S(SYSTEMD_PATH), + QL1S(SYSTEMD_INTERFACE), + QDBusConnection::systemBus(), + command, + false, + // canAction should be always silent because it can freeze + // g_main_context_iteration Qt event loop in QMessageBox + // on panel startup if there is no DBUS running. + PowerProvider::DontCheckDBUS + ); +} + + +bool SystemdProvider::doAction(Power::Action action) +{ + QString command; + + switch (action) + { + case Power::PowerReboot: + command = QL1S("Reboot"); + break; + + case Power::PowerShutdown: + command = QL1S("PowerOff"); + break; + + case Power::PowerSuspend: + command = QL1S("Suspend"); + break; + + case Power::PowerHibernate: + command = QL1S("Hibernate"); + break; + + default: + return false; + } + + return dbusCallSystemd(QL1S(SYSTEMD_SERVICE), + QL1S(SYSTEMD_PATH), + QL1S(SYSTEMD_INTERFACE), + QDBusConnection::systemBus(), + command, + true + ); +} + + +/************************************************ + LXQtProvider + ************************************************/ +LXQtProvider::LXQtProvider(QObject *parent): + PowerProvider(parent) +{ +} + + +LXQtProvider::~LXQtProvider() = default; + + +bool LXQtProvider::canAction(Power::Action action) const +{ + QString command; + switch (action) + { + case Power::PowerLogout: + command = QL1S("canLogout"); + break; + case Power::PowerReboot: + command = QL1S("canReboot"); + break; + case Power::PowerShutdown: + command = QL1S("canPowerOff"); + break; + default: + return false; + } + + // there can be case when lxqtsession-session does not run + return dbusCall(QL1S(LXQT_SERVICE), QL1S(LXQT_PATH), QL1S(LXQT_INTERFACE), + QDBusConnection::sessionBus(), command, + PowerProvider::DontCheckDBUS); +} + + +bool LXQtProvider::doAction(Power::Action action) +{ + QString command; + switch (action) + { + case Power::PowerLogout: + command = QL1S("logout"); + break; + case Power::PowerReboot: + command = QL1S("reboot"); + break; + case Power::PowerShutdown: + command = QL1S("powerOff"); + break; + default: + return false; + } + + return dbusCall(QL1S(LXQT_SERVICE), + QL1S(LXQT_PATH), + QL1S(LXQT_INTERFACE), + QDBusConnection::sessionBus(), + command + ); +} + +/************************************************ + LxSessionProvider + ************************************************/ +LxSessionProvider::LxSessionProvider(QObject *parent): + PowerProvider(parent) +{ + pid = (Q_PID)qgetenv("_LXSESSION_PID").toLong(); +} + + +LxSessionProvider::~LxSessionProvider() = default; + + +bool LxSessionProvider::canAction(Power::Action action) const +{ + switch (action) + { + case Power::PowerLogout: + return pid != 0; + default: + return false; + } +} + + +bool LxSessionProvider::doAction(Power::Action action) +{ + switch (action) + { + case Power::PowerLogout: + if(pid) + ::kill(pid, SIGTERM); + break; + default: + return false; + } + + return true; +} + + +/************************************************ + HalProvider + ************************************************/ +HalProvider::HalProvider(QObject *parent): + PowerProvider(parent) +{ +} + + +HalProvider::~HalProvider() = default; + + +bool HalProvider::canAction(Power::Action action) const +{ + Q_UNUSED(action) + return false; +} + + +bool HalProvider::doAction(Power::Action action) +{ + Q_UNUSED(action) + return false; +} + + +/************************************************ + CustomProvider + ************************************************/ +CustomProvider::CustomProvider(QObject *parent): + PowerProvider(parent), + mSettings(QL1S("power")) +{ +} + +CustomProvider::~CustomProvider() = default; + +bool CustomProvider::canAction(Power::Action action) const +{ + switch (action) + { + case Power::PowerShutdown: + return mSettings.contains(QL1S("shutdownCommand")); + + case Power::PowerReboot: + return mSettings.contains(QL1S("rebootCommand")); + + case Power::PowerHibernate: + return mSettings.contains(QL1S("hibernateCommand")); + + case Power::PowerSuspend: + return mSettings.contains(QL1S("suspendCommand")); + + case Power::PowerLogout: + return mSettings.contains(QL1S("logoutCommand")); + + case Power::PowerMonitorOff: + return mSettings.contains(QL1S("monitorOffCommand")); + + case Power::PowerShowLeaveDialog: + return mSettings.contains(QL1S("showLeaveDialogCommand")); + + default: + return false; + } +} + +bool CustomProvider::doAction(Power::Action action) +{ + QString command; + + switch(action) + { + case Power::PowerShutdown: + command = mSettings.value(QL1S("shutdownCommand")).toString(); + break; + + case Power::PowerReboot: + command = mSettings.value(QL1S("rebootCommand")).toString(); + break; + + case Power::PowerHibernate: + command = mSettings.value(QL1S("hibernateCommand")).toString(); + break; + + case Power::PowerSuspend: + command = mSettings.value(QL1S("suspendCommand")).toString(); + break; + + case Power::PowerLogout: + command = mSettings.value(QL1S("logoutCommand")).toString(); + break; + + case Power::PowerMonitorOff: + command = mSettings.value(QL1S("monitorOffCommand")).toString(); + break; + + case Power::PowerShowLeaveDialog: + command = mSettings.value(QL1S("showLeaveDialogCommand")).toString(); + break; + + default: + return false; + } + + QStringList args = QProcess::splitCommand(command); + if (args.isEmpty()) + return false; + + QProcess process; + process.setProgram(args.takeFirst()); + process.setArguments(args); + return process.startDetached(); +} diff --git a/LibLXQT/lxqtpower/lxqtpowerproviders.h b/LibLXQT/lxqtpower/lxqtpowerproviders.h new file mode 100644 index 0000000000..5d5554d507 --- /dev/null +++ b/LibLXQT/lxqtpower/lxqtpowerproviders.h @@ -0,0 +1,159 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTPOWER_PROVIDERS_H +#define LXQTPOWER_PROVIDERS_H + +#include +#include +#include "lxqtpower.h" +#include // for PID_T + +namespace LXQt +{ + + +class PowerProvider: public QObject +{ + Q_OBJECT +public: + + enum DbusErrorCheck { + CheckDBUS, + DontCheckDBUS + }; + + explicit PowerProvider(QObject *parent = nullptr); + ~PowerProvider() override; + + /*! Returns true if the Power can perform action. + This is a pure virtual function, and must be reimplemented in subclasses. */ + virtual bool canAction(Power::Action action) const = 0 ; + +public Q_SLOTS: + /*! Performs the requested action. + This is a pure virtual function, and must be reimplemented in subclasses. */ + virtual bool doAction(Power::Action action) = 0; +}; + + +class UPowerProvider: public PowerProvider +{ + Q_OBJECT +public: + UPowerProvider(QObject *parent = nullptr); + ~UPowerProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +}; + + +class ConsoleKitProvider: public PowerProvider +{ + Q_OBJECT +public: + ConsoleKitProvider(QObject *parent = nullptr); + ~ConsoleKitProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +}; + + +class SystemdProvider: public PowerProvider +{ + Q_OBJECT +public: + SystemdProvider(QObject *parent = nullptr); + ~SystemdProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +}; + + +class LXQtProvider: public PowerProvider +{ + Q_OBJECT +public: + LXQtProvider(QObject *parent = nullptr); + ~LXQtProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +}; + +class LxSessionProvider: public PowerProvider +{ + Q_OBJECT +public: + LxSessionProvider(QObject *parent = nullptr); + ~LxSessionProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +private: + Q_PID pid; +}; + +class HalProvider: public PowerProvider +{ + Q_OBJECT +public: + HalProvider(QObject *parent = nullptr); + ~HalProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; +}; + + +class CustomProvider: public PowerProvider +{ + Q_OBJECT +public: + CustomProvider(QObject *parent = nullptr); + ~CustomProvider() override; + bool canAction(Power::Action action) const override; + +public Q_SLOTS: + bool doAction(Power::Action action) override; + +private: + Settings mSettings; +}; + +} // namespace LXQt +#endif // LXQTPOWER_PROVIDERS_H diff --git a/LibLXQT/lxqtpowermanager.cpp b/LibLXQT/lxqtpowermanager.cpp new file mode 100644 index 0000000000..0687476de6 --- /dev/null +++ b/LibLXQT/lxqtpowermanager.cpp @@ -0,0 +1,205 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 "lxqtpowermanager.h" +#include "lxqtpower/lxqtpower.h" +#include +#include +#include +#include +#include +#include +#include "lxqttranslator.h" +#include "lxqtglobals.h" +#include "lxqtsettings.h" +#include + +namespace LXQt { + +class LXQT_API MessageBox: public QMessageBox +{ + Q_DECLARE_TR_FUNCTIONS(LXQt::MessageBox) + +public: + explicit MessageBox(QWidget *parent = nullptr): QMessageBox(parent) {} + + static QWidget *parentWidget() + { + const QWidgetList widgets = QApplication::topLevelWidgets(); + + if (widgets.count()) + return widgets.at(0); + else + return nullptr; + } + + static bool question(const QString& title, const QString& text) + { + MessageBox msgBox(parentWidget()); + msgBox.setWindowTitle(title); + msgBox.setText(text); + msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + msgBox.setDefaultButton(QMessageBox::Yes); + + return (msgBox.exec() == QMessageBox::Yes); + } + + + static void warning(const QString& title, const QString& text) + { + Q_UNUSED(title) + Q_UNUSED(text) + QMessageBox::warning(parentWidget(), tr("LXQt Power Manager Error"), tr("Hibernate failed.")); + } +}; + +PowerManager::PowerManager(QObject * parent, bool skipWarning) + : QObject(parent), + m_skipWarning(skipWarning) +{ + m_power = new Power(this); +// connect(m_power, SIGNAL(suspendFail()), this, SLOT(suspendFailed())); +// connect(m_power, SIGNAL(hibernateFail()), this, SLOT(hibernateFailed())); +// connect(m_power, SIGNAL(monitoring(const QString &)), +// this, SLOT(monitoring(const QString&))); + + QString sessionConfig(QFile::decodeName(qgetenv("LXQT_SESSION_CONFIG"))); + Settings settings(sessionConfig.isEmpty() ? QL1S("session") : sessionConfig); + m_skipWarning = settings.value(QL1S("leave_confirmation")).toBool() ? false : true; +} + +PowerManager::~PowerManager() +{ +// delete m_power; +} + +QList PowerManager::availableActions() +{ + QList ret; + QAction * act; + + // TODO/FIXME: icons + if (m_power->canHibernate()) + { + act = new QAction(XdgIcon::fromTheme(QL1S("system-suspend-hibernate")), tr("Hibernate"), this); + connect(act, &QAction::triggered, this, &PowerManager::hibernate); + ret.append(act); + } + + if (m_power->canSuspend()) + { + act = new QAction(XdgIcon::fromTheme(QL1S("system-suspend")), tr("Suspend"), this); + connect(act, &QAction::triggered, this, &PowerManager::suspend); + ret.append(act); + } + + if (m_power->canReboot()) + { + act = new QAction(XdgIcon::fromTheme(QL1S("system-reboot")), tr("Reboot"), this); + connect(act, &QAction::triggered, this, &PowerManager::reboot); + ret.append(act); + } + + if (m_power->canShutdown()) + { + act = new QAction(XdgIcon::fromTheme(QL1S("system-shutdown")), tr("Shutdown"), this); + connect(act, &QAction::triggered, this, &PowerManager::shutdown); + ret.append(act); + } + + if (m_power->canLogout()) + { + act = new QAction(XdgIcon::fromTheme(QL1S("system-log-out")), tr("Logout"), this); + connect(act, &QAction::triggered, this, &PowerManager::logout); + ret.append(act); + } + + return ret; +} + + +void PowerManager::suspend() +{ + if (m_skipWarning || + MessageBox::question(tr("LXQt Session Suspend"), + tr("Do you want to really suspend your computer?

Suspends the computer into a low power state. System state is not preserved if the power is lost."))) + { + m_power->suspend(); + } +} + +void PowerManager::hibernate() +{ + if (m_skipWarning || + MessageBox::question(tr("LXQt Session Hibernate"), + tr("Do you want to really hibernate your computer?

Hibernates the computer into a low power state. System state is preserved if the power is lost."))) + { + m_power->hibernate(); + } +} + +void PowerManager::reboot() +{ + if (m_skipWarning || + MessageBox::question(tr("LXQt Session Reboot"), + tr("Do you want to really restart your computer? All unsaved work will be lost..."))) + { + m_power->reboot(); + } +} + +void PowerManager::shutdown() +{ + if (m_skipWarning || + MessageBox::question(tr("LXQt Session Shutdown"), + tr("Do you want to really switch off your computer? All unsaved work will be lost..."))) + { + m_power->shutdown(); + } +} + +void PowerManager::logout() +{ + if (m_skipWarning || + MessageBox::question(tr("LXQt Session Logout"), + tr("Do you want to really logout? All unsaved work will be lost..."))) + { + m_power->logout(); + } +} + +void PowerManager::hibernateFailed() +{ + MessageBox::warning(tr("LXQt Power Manager Error"), tr("Hibernate failed.")); +} + +void PowerManager::suspendFailed() +{ + MessageBox::warning(tr("LXQt Power Manager Error"), tr("Suspend failed.")); +} + +} // namespace LXQt diff --git a/LibLXQT/lxqtpowermanager.h b/LibLXQT/lxqtpowermanager.h new file mode 100644 index 0000000000..347f72c976 --- /dev/null +++ b/LibLXQT/lxqtpowermanager.h @@ -0,0 +1,73 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTPOWERMANAGER_H +#define LXQTPOWERMANAGER_H + +#include +#include +#include "lxqtglobals.h" + +namespace LXQt +{ +class Power; + +/*! QAction centric menu aware wrapper around lxqtpower +*/ +class LXQT_API PowerManager : public QObject +{ + Q_OBJECT + +public: + PowerManager(QObject * parent, bool skipWarning = false); + ~PowerManager() override; + QList availableActions(); + +public Q_SLOTS: + // power management + void suspend(); + void hibernate(); + void reboot(); + void shutdown(); + // lxqt session + void logout(); + +public: + bool skipWarning() const { return m_skipWarning; } + +private: + LXQt::Power * m_power; + bool m_skipWarning; + +private Q_SLOTS: + void hibernateFailed(); + void suspendFailed(); +}; + +} // namespace LXQt + +#endif // LXQTPOWERMANAGER_H diff --git a/LibLXQT/lxqtprogramfinder.cpp b/LibLXQT/lxqtprogramfinder.cpp new file mode 100644 index 0000000000..ddb8f1968a --- /dev/null +++ b/LibLXQT/lxqtprogramfinder.cpp @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2013 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtprogramfinder.h" +#include +#include +#include + +using namespace LXQt; + +LXQT_API bool ProgramFinder::programExists(const QString& command) +{ + const QString program = programName(command); + if (program[0] == QL1C('/')) + { + QFileInfo fi(program); + return fi.isExecutable() && fi.isFile(); + } + + const QString path = QFile::decodeName(qgetenv("PATH")); + const QStringList dirs = path.split(QL1C(':'), Qt::SkipEmptyParts); + for (const QString& dirName : dirs) + { + const QFileInfo fi(QDir(dirName), program); + if (fi.isExecutable() && fi.isFile()) + return true; + } + return false; +} + +LXQT_API QStringList ProgramFinder::findPrograms(const QStringList& commands) +{ + QStringList availPrograms; + for (const QString& program : commands) + if (programExists(program)) + availPrograms.append(program); + return availPrograms; +} + +LXQT_API QString ProgramFinder::programName(const QString& command) +{ + wordexp_t we; + if (wordexp(command.toLocal8Bit().constData(), &we, WRDE_NOCMD) == 0) + if (we.we_wordc > 0) + return QString::fromLocal8Bit(we.we_wordv[0]); + return QString(); +} diff --git a/LibLXQT/lxqtprogramfinder.h b/LibLXQT/lxqtprogramfinder.h new file mode 100644 index 0000000000..f4c63d5d00 --- /dev/null +++ b/LibLXQT/lxqtprogramfinder.h @@ -0,0 +1,61 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright (C) 2013 Alec Moskvin + * + * 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTPROGRAMFINDER_H +#define LXQTPROGRAMFINDER_H + +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +namespace ProgramFinder +{ + /*! + * \brief programExists Checks if the program needed to execute the given + * command is installed + * \param command + * \return True if the program exists + */ + LXQT_API bool programExists(const QString& command); + + /*! + * \brief findPrograms Filters a list of commands (with arguments) based on + * which programs are installed + * \param commands Commands to check + * \return List of commands which are installed + */ + LXQT_API QStringList findPrograms(const QStringList& commands); + + /*! + * \brief programName Returns the program name given a command + * \param command + * \return + */ + LXQT_API QString programName(const QString& command); +} + +} // namespace LXQt +#endif // LXQTPROGRAMFINDER_H diff --git a/LibLXQT/lxqtrotatedwidget.cpp b/LibLXQT/lxqtrotatedwidget.cpp new file mode 100644 index 0000000000..da8e99c622 --- /dev/null +++ b/LibLXQT/lxqtrotatedwidget.cpp @@ -0,0 +1,326 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2013 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 "lxqtrotatedwidget.h" + +#include +#include + +#include + +#include + +#ifndef QT_NO_WHEELEVENT +#include +#endif + +#include + +using namespace LXQt; + +RotatedWidget::RotatedWidget(QWidget &content, QWidget *parent, Qt::WindowFlags f) + : QWidget(parent, f) + , mContent(&content) + , mOrigin(Qt::TopLeftCorner) + , mTransferMousePressEvent(false) + , mTransferMouseReleaseEvent(false) + , mTransferMouseDoubleClickEvent(false) + , mTransferMouseMoveEvent(false) +#ifndef QT_NO_WHEELEVENT + , mTransferWheelEvent(false) +#endif + , mTransferEnterEvent(false) + , mTransferLeaveEvent(false) +{ + mContent->setParent(this); +} + +Qt::Corner RotatedWidget::origin() const +{ + return mOrigin; +} + +void RotatedWidget::setOrigin(Qt::Corner newOrigin) +{ + if (mOrigin != newOrigin) + { + if (mOrigin == Qt::TopLeftCorner) + mContent->hide(); + + mOrigin = newOrigin; + adjustContentSize(); + update(); + + if (mOrigin == Qt::TopLeftCorner) + mContent->show(); + } +} + +QWidget * RotatedWidget::content() const +{ + return mContent; +} + +void RotatedWidget::adjustContentSize() +{ + mContent->adjustSize(); + + const QSize before = size(); + + adjustSize(); + + if (before != size()) + updateGeometry(); +} + +QSize RotatedWidget::adjustedSize(QSize size) const +{ + switch (mOrigin) + { + case Qt::TopLeftCorner: + case Qt::BottomRightCorner: + break; + + case Qt::TopRightCorner: + case Qt::BottomLeftCorner: + size.transpose(); + break; + } + + return size; +} + +QPointF RotatedWidget::adjustedPoint(QPointF point) const +{ + switch (mOrigin) + { + case Qt::TopLeftCorner: + case Qt::BottomRightCorner: + break; + + case Qt::TopRightCorner: + case Qt::BottomLeftCorner: + point = QPointF(point.y(), point.x()); + break; + } + + return point; +} + +QSize RotatedWidget::minimumSizeHint() const +{ + return adjustedSize(mContent->minimumSizeHint()); +} + +QSize RotatedWidget::sizeHint() const +{ + return adjustedSize(mContent->sizeHint()); +} + +void RotatedWidget::paintEvent(QPaintEvent */*event*/) +{ + if (mOrigin == Qt::TopLeftCorner) + return; + + const QSize sz = mContent->size(); + + QPainter painter(this); + + 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.height()); + 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.width(), 0.0); + break; + } + painter.setTransform(transform); + mContent->render(&painter, originPoint, QRegion(), RenderFlags(DrawChildren)); +} + +void RotatedWidget::mousePressEvent(QMouseEvent *event) +{ + if (!mTransferMousePressEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QMouseEvent contentEvent(event->type(), adjustedPoint(event->pos()), event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} + +void RotatedWidget::mouseReleaseEvent(QMouseEvent *event) +{ + if (!mTransferMouseReleaseEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QMouseEvent contentEvent(event->type(), adjustedPoint(event->pos()), event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} + +void RotatedWidget::mouseDoubleClickEvent(QMouseEvent *event) +{ + if (!mTransferMouseDoubleClickEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QMouseEvent contentEvent(event->type(), adjustedPoint(event->pos()), event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} + +void RotatedWidget::mouseMoveEvent(QMouseEvent *event) +{ + if (!mTransferMouseMoveEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QMouseEvent contentEvent(event->type(), adjustedPoint(event->pos()), event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} + +#ifndef QT_NO_WHEELEVENT +void RotatedWidget::wheelEvent(QWheelEvent *event) +{ + if (!mTransferWheelEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QWheelEvent contentEvent(adjustedPoint(event->position()), event->globalPosition(), event->pixelDelta(), event->angleDelta(), event->buttons(), event->modifiers(), event->phase(), false); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} +#endif + +void RotatedWidget::enterEvent(QEvent *event) +{ + if (!mTransferEnterEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QApplication::sendEvent(mContent, event); + + cascadeCall = false; +} + +void RotatedWidget::leaveEvent(QEvent *event) +{ + if (!mTransferLeaveEvent) + { + event->ignore(); + return; + } + + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QApplication::sendEvent(mContent, event); + + cascadeCall = false; +} + +void RotatedWidget::resizeEvent(QResizeEvent *event) +{ + static bool cascadeCall = false; + if (cascadeCall) + return; + cascadeCall = true; + + QResizeEvent contentEvent(adjustedSize(event->size()), adjustedSize(event->oldSize())); + QApplication::sendEvent(mContent, &contentEvent); + + cascadeCall = false; +} diff --git a/LibLXQT/lxqtrotatedwidget.h b/LibLXQT/lxqtrotatedwidget.h new file mode 100644 index 0000000000..7acb1182c5 --- /dev/null +++ b/LibLXQT/lxqtrotatedwidget.h @@ -0,0 +1,126 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2013 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 LXQTROTATED_WIDGET_H +#define LXQTROTATED_WIDGET_H + +#include +#include "lxqtglobals.h" + +namespace LXQt +{ + +class LXQT_API RotatedWidget: public QWidget +{ + Q_OBJECT + + Q_PROPERTY(Qt::Corner origin READ origin WRITE setOrigin) + + Q_PROPERTY(bool transferMousePressEvent READ transferMousePressEvent WRITE setTransferMousePressEvent) + Q_PROPERTY(bool transferMouseReleaseEvent READ transferMouseReleaseEvent WRITE setTransferMouseReleaseEvent) + Q_PROPERTY(bool transferMouseDoubleClickEvent READ transferMouseDoubleClickEvent WRITE setTransferMouseDoubleClickEvent) + Q_PROPERTY(bool transferMouseMoveEvent READ transferMouseMoveEvent WRITE setTransferMouseMoveEvent) +#ifndef QT_NO_WHEELEVENT + Q_PROPERTY(bool transferWheelEvent READ transferWheelEvent WRITE setTransferWheelEvent) +#endif + + Q_PROPERTY(bool transferEnterEvent READ transferEnterEvent WRITE setTransferEnterEvent) + Q_PROPERTY(bool transferLeaveEvent READ transferLeaveEvent WRITE setTransferLeaveEvent) + +public: + explicit RotatedWidget(QWidget &content, QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); + + Qt::Corner origin() const; + void setOrigin(Qt::Corner); + + QWidget * content() const; + + void adjustContentSize(); + + QSize minimumSizeHint() const override; + QSize sizeHint() const override; + + QSize adjustedSize(QSize) const; + QPointF adjustedPoint(QPointF) const; + + + bool transferMousePressEvent() const { return mTransferMousePressEvent; } + void setTransferMousePressEvent(bool value) { mTransferMousePressEvent = value; } + + bool transferMouseReleaseEvent() const { return mTransferMouseReleaseEvent; } + void setTransferMouseReleaseEvent(bool value) { mTransferMouseReleaseEvent = value; } + + bool transferMouseDoubleClickEvent() const { return mTransferMouseDoubleClickEvent; } + void setTransferMouseDoubleClickEvent(bool value) { mTransferMouseDoubleClickEvent = value; } + + bool transferMouseMoveEvent() const { return mTransferMouseMoveEvent; } + void setTransferMouseMoveEvent(bool value) { mTransferMouseMoveEvent = value; } + +#ifndef QT_NO_WHEELEVENT + bool transferWheelEvent() const { return mTransferWheelEvent; } + void setTransferWheelEvent(bool value) { mTransferWheelEvent = value; } +#endif + + bool transferEnterEvent() const { return mTransferEnterEvent; } + void setTransferEnterEvent(bool value) { mTransferEnterEvent = value; } + + bool transferLeaveEvent() const { return mTransferLeaveEvent; } + void setTransferLeaveEvent(bool value) { mTransferLeaveEvent = value; } + +protected: + void paintEvent(QPaintEvent *) override; + + // Transition event handlers + void mousePressEvent(QMouseEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mouseDoubleClickEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; +#ifndef QT_NO_WHEELEVENT + void wheelEvent(QWheelEvent *) override; +#endif + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; + + void resizeEvent(QResizeEvent *) override; + +private: + QWidget *mContent; + Qt::Corner mOrigin; + + bool mTransferMousePressEvent; + bool mTransferMouseReleaseEvent; + bool mTransferMouseDoubleClickEvent; + bool mTransferMouseMoveEvent; +#ifndef QT_NO_WHEELEVENT + bool mTransferWheelEvent; +#endif + bool mTransferEnterEvent; + bool mTransferLeaveEvent; +}; + +} // namespace LXQt +#endif // LXQTROTATEDWIDGET_H diff --git a/LibLXQT/lxqtscreensaver.cpp b/LibLXQT/lxqtscreensaver.cpp new file mode 100644 index 0000000000..7801921167 --- /dev/null +++ b/LibLXQT/lxqtscreensaver.cpp @@ -0,0 +1,266 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * Copyright (c) 2016 Luís Pereira + * Copyright (c) 2012 The Chromium Authors. All rights reserved. + * + * 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 "lxqtscreensaver.h" +#include "lxqttranslator.h" + +#include + +#include +#include +#include +#include +#include +#include // for Q_DECLARE_TR_FUNCTIONS +#include +#include + +#include + +// Avoid polluting everything with X11/Xlib.h: +typedef struct _XDisplay Display; + +typedef unsigned long XAtom; +typedef unsigned long XID; + +extern "C" { +int XFree(void*); +} + +template +struct XObjectDeleter { + inline void operator()(void* ptr) const { F(static_cast(ptr)); } +}; + +template > +using XScopedPtr = std::unique_ptr; + + +namespace LXQt { + +static bool GetProperty(XID window, const std::string& property_name, long max_length, + Atom* type, int* format, unsigned long* num_items, + unsigned char** property); + + +static bool GetIntArrayProperty(XID window, + const std::string& property_name, + std::vector* value); + + +static bool GetProperty(XID window, const std::string& property_name, long max_length, + Atom* type, int* format, unsigned long* num_items, + unsigned char** property) +{ + Atom property_atom = XInternAtom(QX11Info::display(), property_name.c_str(), false); + unsigned long remaining_bytes = 0; + return XGetWindowProperty(QX11Info::display(), + window, + property_atom, + 0, // offset into property data to read + max_length, // max length to get + False, // deleted + AnyPropertyType, + type, + format, + num_items, + &remaining_bytes, + property); +} + +static bool GetIntArrayProperty(XID window, + const std::string& property_name, + std::vector* value) +{ + Atom type = None; + int format = 0; // size in bits of each item in 'property' + unsigned long num_items = 0; + unsigned char* properties = nullptr; + + int result = GetProperty(window, property_name, + (~0L), // (all of them) + &type, &format, &num_items, &properties); + XScopedPtr scoped_properties(properties); + if (result != Success) + return false; + + if (format != 32) + return false; + + long* int_properties = reinterpret_cast(properties); + value->clear(); + for (unsigned long i = 0; i < num_items; ++i) + { + value->push_back(static_cast(int_properties[i])); + } + return true; +} + +class ScreenSaverPrivate +{ + Q_DECLARE_TR_FUNCTIONS(LXQt::ScreenSaver) + Q_DECLARE_PUBLIC(ScreenSaver) + ScreenSaver* const q_ptr; + +public: + ScreenSaverPrivate(ScreenSaver *q) : q_ptr(q) { + QSettings settings(QSettings::UserScope, QLatin1String("lxqt"), QLatin1String("lxqt")); + + settings.beginGroup(QLatin1String("Screensaver")); + lock_command = settings.value(QLatin1String("lock_command"), QLatin1String("xdg-screensaver lock")).toString(); + settings.endGroup(); + } + + void reportLockProcessError(); + void _l_lockProcess_finished(int, QProcess::ExitStatus); + void _l_lockProcess_errorOccurred(QProcess::ProcessError); + bool isScreenSaverLocked(); + + QPointer m_lockProcess; + + QString lock_command; +}; + +void ScreenSaverPrivate::reportLockProcessError() +{ + QMessageBox box; + box.setIcon(QMessageBox::Warning); + box.setWindowTitle(tr("Screen Saver Error")); + QString message; + // contains() instead of startsWith() as the command might be "env FOO=bar xdg-screensaver lock" + // (e.g., overwrite $XDG_CURRENT_DESKTOP for some different behaviors) + if (lock_command.contains(QLatin1String("xdg-screensaver"))) { + message = tr("Failed to run \"%1\". " + "Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running." + ); + } else { + message = tr("Failed to run \"%1\". " + "Ensure the specified locker/screensaver is installed and running." + ); + } + box.setText(message.arg(lock_command)); + box.exec(); +} + +void ScreenSaverPrivate::_l_lockProcess_finished(int err, QProcess::ExitStatus status) +{ + Q_UNUSED(status) + Q_Q(ScreenSaver); + if (err == 0) + Q_EMIT q->activated(); + else + { + reportLockProcessError(); + } + + Q_EMIT q->done(); +} + +void ScreenSaverPrivate::_l_lockProcess_errorOccurred(QProcess::ProcessError) +{ + reportLockProcessError(); +} + +bool ScreenSaverPrivate::isScreenSaverLocked() +{ + XScreenSaverInfo *info = nullptr; + Display *display = QX11Info::display(); + XID window = DefaultRootWindow(display); + info = XScreenSaverAllocInfo(); + + XScreenSaverQueryInfo(QX11Info::display(), window, info); + const int state = info->state; + XFree(info); + if (state == ScreenSaverOn) + return true; + + // Ironically, xscreensaver does not conform to the XScreenSaver protocol, so + // info.state == ScreenSaverOff or info.state == ScreenSaverDisabled does not + // necessarily mean that a screensaver is not active, so add a special check + // for xscreensaver. + XAtom lock_atom = XInternAtom(display, "LOCK", false); + std::vector atom_properties; + if (GetIntArrayProperty(window, "_SCREENSAVER_STATUS", &atom_properties) && + atom_properties.size() > 0) + { + if (atom_properties[0] == static_cast(lock_atom)) + return true; + } + + return false; +} + +ScreenSaver::ScreenSaver(QObject * parent) + : QObject(parent), + d_ptr(new ScreenSaverPrivate(this)) +{ + Q_D(ScreenSaver); + d->m_lockProcess = new QProcess(this); + connect(d->m_lockProcess, QOverload::of(&QProcess::finished), + [=](int exitCode, QProcess::ExitStatus exitStatus){ d->_l_lockProcess_finished(exitCode, exitStatus); }); + connect(d->m_lockProcess, &QProcess::errorOccurred, + [=](QProcess::ProcessError error) { d->_l_lockProcess_errorOccurred(error); }); +} + +ScreenSaver::~ScreenSaver() +{ + delete d_ptr; +} + +QList ScreenSaver::availableActions() +{ + QList ret; + QAction * act; + + act = new QAction(XdgIcon::fromTheme(QL1S("system-lock-screen"), QL1S("lock")), tr("Lock Screen"), this); + connect(act, &QAction::triggered, this, &ScreenSaver::lockScreen); + ret.append(act); + + return ret; +} + +void ScreenSaver::lockScreen() +{ + Q_D(ScreenSaver); + if (!d->isScreenSaverLocked()) { + QStringList args = QProcess::splitCommand(d->lock_command); + if (args.isEmpty()) { + qWarning() << Q_FUNC_INFO << "Empty screen lock_command"; + return; + } + const QString program = args.takeFirst(); + d->m_lockProcess->start(program, args, QIODevice::ReadWrite); + } +} + +} // namespace LXQt + +#include "moc_lxqtscreensaver.cpp" diff --git a/LibLXQT/lxqtscreensaver.h b/LibLXQT/lxqtscreensaver.h new file mode 100644 index 0000000000..404aaea7ed --- /dev/null +++ b/LibLXQT/lxqtscreensaver.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Petr Vanek + * + * Copyright (c) 2016 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 SCREENSAVER_H +#define SCREENSAVER_H + +#include "lxqtglobals.h" +#include +#include + +namespace LXQt +{ + +class ScreenSaverPrivate; + +class LXQT_API ScreenSaver : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ScreenSaver) + Q_DISABLE_COPY(ScreenSaver) + +public: + ScreenSaver(QObject * parent=nullptr); + ~ScreenSaver() override; + + QList availableActions(); + +Q_SIGNALS: + void activated(); + void done(); +public Q_SLOTS: + void lockScreen(); + +private: + ScreenSaverPrivate* const d_ptr; +}; + +} // namespace LXQt +#endif + diff --git a/LibLXQT/lxqtsettings.cpp b/LibLXQT/lxqtsettings.cpp new file mode 100644 index 0000000000..2037929874 --- /dev/null +++ b/LibLXQT/lxqtsettings.cpp @@ -0,0 +1,709 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * 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 "lxqtsettings.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace LXQt; + +class LXQt::SettingsPrivate +{ +public: + SettingsPrivate(Settings* parent): + mFileChangeTimer(0), + mAppChangeTimer(0), + mAddWatchTimer(0), + mParent(parent) + { + // HACK: we need to ensure that the user (~/.config/lxqt/.conf) + // exists to have functional mWatcher + if (!mParent->contains(QL1S("__userfile__"))) + { + mParent->setValue(QL1S("__userfile__"), true); + mParent->sync(); + } + mWatcher.addPath(mParent->fileName()); + QObject::connect(&(mWatcher), &QFileSystemWatcher::fileChanged, mParent, &Settings::_fileChanged); + } + + QString localizedKey(const QString& key) const; + + QFileSystemWatcher mWatcher; + int mFileChangeTimer; + int mAppChangeTimer; + int mAddWatchTimer; + +private: + Settings* mParent; +}; + + +LXQtTheme* LXQtTheme::mInstance = nullptr; + +class LXQt::LXQtThemeData: public QSharedData { +public: + LXQtThemeData(): mValid(false) {} + QString loadQss(const QString& qssFile) const; + QString findTheme(const QString &themeName); + + QString mName; + QString mPath; + QString mPreviewImg; + bool mValid; + +}; + + +class LXQt::GlobalSettingsPrivate +{ +public: + GlobalSettingsPrivate(GlobalSettings *parent): + mParent(parent), + mThemeUpdated(0ull) + { + + } + + GlobalSettings *mParent; + QString mIconTheme; + QString mLXQtTheme; + qlonglong mThemeUpdated; + +}; + + +/************************************************ + + ************************************************/ +Settings::Settings(const QString& module, QObject* parent) : + QSettings(QL1S("lxqt"), module, parent), + d_ptr(new SettingsPrivate(this)) +{ +} + + +/************************************************ + + ************************************************/ +Settings::Settings(const QString &fileName, QSettings::Format format, QObject *parent): + QSettings(fileName, format, parent), + d_ptr(new SettingsPrivate(this)) +{ +} + + +/************************************************ + + ************************************************/ +Settings::Settings(const QSettings* parentSettings, const QString& subGroup, QObject* parent): + QSettings(parentSettings->organizationName(), parentSettings->applicationName(), parent), + d_ptr(new SettingsPrivate(this)) +{ + beginGroup(subGroup); +} + + +/************************************************ + + ************************************************/ +Settings::Settings(const QSettings& parentSettings, const QString& subGroup, QObject* parent): + QSettings(parentSettings.organizationName(), parentSettings.applicationName(), parent), + d_ptr(new SettingsPrivate(this)) +{ + beginGroup(subGroup); +} + + +/************************************************ + + ************************************************/ +Settings::~Settings() +{ + // because in the Settings::Settings(const QString& module, QObject* parent) + // constructor there is no beginGroup() called... + if (!group().isEmpty()) + endGroup(); + + delete d_ptr; +} + +bool Settings::event(QEvent *event) +{ + if (event->type() == QEvent::UpdateRequest) + { + // delay the settingsChanged* signal emitting for: + // - checking in _fileChanged + // - merging emitting the signals + if(d_ptr->mAppChangeTimer) + killTimer(d_ptr->mAppChangeTimer); + d_ptr->mAppChangeTimer = startTimer(100); + } + else if (event->type() == QEvent::Timer) + { + const int timer = static_cast(event)->timerId(); + killTimer(timer); + if (timer == d_ptr->mFileChangeTimer) + { + d_ptr->mFileChangeTimer = 0; + fileChanged(); // invoke the real fileChanged() handler. + } else if (timer == d_ptr->mAppChangeTimer) + { + d_ptr->mAppChangeTimer = 0; + // do emit the signals + Q_EMIT settingsChangedByApp(); + Q_EMIT settingsChanged(); + } else if (timer == d_ptr->mAddWatchTimer) + { + d_ptr->mAddWatchTimer = 0; + //try to re-add filename for watching + addWatchedFile(fileName()); + } + } + + return QSettings::event(event); +} + +void Settings::fileChanged() +{ + sync(); + Q_EMIT settingsChangedFromExternal(); + Q_EMIT settingsChanged(); +} + +void Settings::_fileChanged(const QString& path) +{ + // check if the file isn't changed by our logic + // FIXME: this is poor implementation; should we rather compute some hash of values if changed by external? + if (0 == d_ptr->mAppChangeTimer) + { + // delay the change notification for 100 ms to avoid + // unnecessary repeated loading of the same config file if + // the file is changed for several times rapidly. + if(d_ptr->mFileChangeTimer) + killTimer(d_ptr->mFileChangeTimer); + d_ptr->mFileChangeTimer = startTimer(1000); + } + + addWatchedFile(path); +} + +void Settings::addWatchedFile(QString const & path) +{ + // D*mn! yet another Qt 5.4 regression!!! + // See the bug report: https://github.com/lxqt/lxqt/issues/441 + // Since Qt 5.4, QSettings uses QSaveFile to save the config files. + // https://github.com/qtproject/qtbase/commit/8d15068911d7c0ba05732e2796aaa7a90e34a6a1#diff-e691c0405f02f3478f4f50a27bdaecde + // QSaveFile will save the content to a new temp file, and replace the old file later. + // Hence the existing config file is not changed. Instead, it's deleted and then replaced. + // This new behaviour unfortunately breaks QFileSystemWatcher. + // After file deletion, we can no longer receive any new change notifications. + // The most ridiculous thing is, QFileSystemWatcher does not provide a + // way for us to know if a file is deleted. WT*? + // Luckily, I found a workaround: If the file path no longer exists + // in the watcher's files(), this file is deleted. + if(!d_ptr->mWatcher.files().contains(path)) + // in some situations adding fails because of non-existing file (e.g. editting file in external program) + if (!d_ptr->mWatcher.addPath(path) && 0 == d_ptr->mAddWatchTimer) + d_ptr->mAddWatchTimer = startTimer(100); + +} + + +/************************************************ + + ************************************************/ +const GlobalSettings *Settings::globalSettings() +{ + static QMutex mutex; + static GlobalSettings *instance = nullptr; + if (!instance) + { + mutex.lock(); + + if (!instance) + instance = new GlobalSettings(); + + mutex.unlock(); + } + + return instance; +} + + +/************************************************ + LC_MESSAGES value Possible keys in order of matching + lang_COUNTRY@MODIFIER lang_COUNTRY@MODIFIER, lang_COUNTRY, lang@MODIFIER, lang, + default value + lang_COUNTRY lang_COUNTRY, lang, default value + lang@MODIFIER lang@MODIFIER, lang, default value + lang lang, default value + ************************************************/ +QString SettingsPrivate::localizedKey(const QString& key) const +{ + + QString lang = QString::fromLocal8Bit(qgetenv("LC_MESSAGES")); + + if (lang.isEmpty()) + lang = QString::fromLocal8Bit(qgetenv("LC_ALL")); + + if (lang.isEmpty()) + lang = QString::fromLocal8Bit(qgetenv("LANG")); + + + QString modifier = lang.section(QL1C('@'), 1); + if (!modifier.isEmpty()) + lang.truncate(lang.length() - modifier.length() - 1); + + QString encoding = lang.section(QL1C('.'), 1); + if (!encoding.isEmpty()) + lang.truncate(lang.length() - encoding.length() - 1); + + + QString country = lang.section(QL1C('_'), 1); + if (!country.isEmpty()) + lang.truncate(lang.length() - country.length() - 1); + + + + //qDebug() << "LC_MESSAGES: " << getenv("LC_MESSAGES"); + //qDebug() << "Lang:" << lang; + //qDebug() << "Country:" << country; + //qDebug() << "Encoding:" << encoding; + //qDebug() << "Modifier:" << modifier; + + if (!modifier.isEmpty() && !country.isEmpty()) + { + QString k = QString::fromLatin1("%1[%2_%3@%4]").arg(key, lang, country, modifier); + //qDebug() << "\t try " << k << mParent->contains(k); + if (mParent->contains(k)) + return k; + } + + if (!country.isEmpty()) + { + QString k = QString::fromLatin1("%1[%2_%3]").arg(key, lang, country); + //qDebug() << "\t try " << k << mParent->contains(k); + if (mParent->contains(k)) + return k; + } + + if (!modifier.isEmpty()) + { + QString k = QString::fromLatin1("%1[%2@%3]").arg(key, lang, modifier); + //qDebug() << "\t try " << k << mParent->contains(k); + if (mParent->contains(k)) + return k; + } + + QString k = QString::fromLatin1("%1[%2]").arg(key, lang); + //qDebug() << "\t try " << k << mParent->contains(k); + if (mParent->contains(k)) + return k; + + + //qDebug() << "\t try " << key << mParent->contains(key); + return key; +} + +/************************************************ + + ************************************************/ +QVariant Settings::localizedValue(const QString& key, const QVariant& defaultValue) const +{ + Q_D(const Settings); + return value(d->localizedKey(key), defaultValue); +} + + +/************************************************ + + ************************************************/ +void Settings::setLocalizedValue(const QString &key, const QVariant &value) +{ + Q_D(const Settings); + setValue(d->localizedKey(key), value); +} + + +/************************************************ + + ************************************************/ +LXQtTheme::LXQtTheme(): + d(new LXQtThemeData) +{ +} + + +/************************************************ + + ************************************************/ +LXQtTheme::LXQtTheme(const QString &path): + d(new LXQtThemeData) +{ + if (path.isEmpty()) + return; + + QFileInfo fi(path); + if (fi.isAbsolute()) + { + d->mPath = path; + d->mName = fi.fileName(); + d->mValid = fi.isDir(); + } + else + { + d->mName = path; + d->mPath = d->findTheme(path); + d->mValid = !(d->mPath.isEmpty()); + } + + if (QDir(path).exists(QL1S("preview.png"))) + d->mPreviewImg = path + QL1S("/preview.png"); +} + + +/************************************************ + + ************************************************/ +QString LXQtThemeData::findTheme(const QString &themeName) +{ + if (themeName.isEmpty()) + return QString(); + + QStringList paths; + QLatin1String fallback(LXQT_INSTALL_PREFIX); + + paths << XdgDirs::dataHome(false); + paths << XdgDirs::dataDirs(); + + if (!paths.contains(fallback)) + paths << fallback; + + for(const QString &path : qAsConst(paths)) + { + QDir dir(QString::fromLatin1("%1/lxqt/themes/%2").arg(path, themeName)); + if (dir.isReadable()) + return dir.absolutePath(); + } + + return QString(); +} + + +/************************************************ + + ************************************************/ +LXQtTheme::LXQtTheme(const LXQtTheme &other): + d(other.d) +{ +} + + +/************************************************ + + ************************************************/ +LXQtTheme::~LXQtTheme() = default; + + +/************************************************ + + ************************************************/ +LXQtTheme& LXQtTheme::operator=(const LXQtTheme &other) +{ + if (this != &other) + d = other.d; + + return *this; +} + + +/************************************************ + + ************************************************/ +bool LXQtTheme::isValid() const +{ + return d->mValid; +} + + +/************************************************ + + ************************************************/ +QString LXQtTheme::name() const +{ + return d->mName; +} + +/************************************************ + + ************************************************/ +QString LXQtTheme::path() const +{ + return d->mPath; +} + + +/************************************************ + + ************************************************/ +QString LXQtTheme::previewImage() const +{ + return d->mPreviewImg; +} + + +/************************************************ + + ************************************************/ +QString LXQtTheme::qss(const QString& module) const +{ + return d->loadQss(QStringLiteral("%1/%2.qss").arg(d->mPath, module)); +} + + +/************************************************ + + ************************************************/ +QString LXQtThemeData::loadQss(const QString& qssFile) const +{ + QFile f(qssFile); + if (! f.open(QIODevice::ReadOnly | QIODevice::Text)) + { + return QString(); + } + + QString qss = QString::fromLocal8Bit(f.readAll()); + f.close(); + + if (qss.isEmpty()) + return QString(); + + // handle relative paths + QString qssDir = QFileInfo(qssFile).canonicalPath(); + qss.replace(QRegExp(QL1S("url.[ \\t\\s]*"), Qt::CaseInsensitive, QRegExp::RegExp2), QL1S("url(") + qssDir + QL1C('/')); + + return qss; +} + + +/************************************************ + + ************************************************/ +QString LXQtTheme::desktopBackground(int screen) const +{ + QString wallpaperCfgFileName = QString::fromLatin1("%1/wallpaper.cfg").arg(d->mPath); + + if (wallpaperCfgFileName.isEmpty()) + return QString(); + + QSettings s(wallpaperCfgFileName, QSettings::IniFormat); + QString themeDir = QFileInfo(wallpaperCfgFileName).absolutePath(); + // There is something strange... If I remove next line the wallpapers array is not found... + s.childKeys(); + s.beginReadArray(QL1S("wallpapers")); + + s.setArrayIndex(screen - 1); + if (s.contains(QL1S("file"))) + return QString::fromLatin1("%1/%2").arg(themeDir, s.value(QL1S("file")).toString()); + + s.setArrayIndex(0); + if (s.contains(QL1S("file"))) + return QString::fromLatin1("%1/%2").arg(themeDir, s.value(QL1S("file")).toString()); + + return QString(); +} + + +/************************************************ + + ************************************************/ +const LXQtTheme &LXQtTheme::currentTheme() +{ + static LXQtTheme theme; + QString name = Settings::globalSettings()->value(QL1S("theme")).toString(); + if (theme.name() != name) + { + theme = LXQtTheme(name); + } + return theme; +} + + +/************************************************ + + ************************************************/ +QList LXQtTheme::allThemes() +{ + QList ret; + QSet processed; + + QStringList paths; + paths << XdgDirs::dataHome(false); + paths << XdgDirs::dataDirs(); + + for(const QString &path : qAsConst(paths)) + { + QDir dir(QString::fromLatin1("%1/lxqt/themes").arg(path)); + const QFileInfoList dirs = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot); + + for(const QFileInfo &dir : dirs) + { + if (!processed.contains(dir.fileName()) && + QDir(dir.absoluteFilePath()).exists(QL1S("lxqt-panel.qss"))) + { + processed << dir.fileName(); + ret << LXQtTheme(dir.absoluteFilePath()); + } + + } + } + + return ret; +} + + +/************************************************ + + ************************************************/ +SettingsCache::SettingsCache(QSettings &settings) : + mSettings(settings) +{ + loadFromSettings(); +} + + +/************************************************ + + ************************************************/ +SettingsCache::SettingsCache(QSettings *settings) : + mSettings(*settings) +{ + loadFromSettings(); +} + + +/************************************************ + + ************************************************/ +void SettingsCache::loadFromSettings() +{ + const QStringList keys = mSettings.allKeys(); + + const int N = keys.size(); + for (int i = 0; i < N; ++i) { + mCache.insert(keys.at(i), mSettings.value(keys.at(i))); + } +} + + +/************************************************ + + ************************************************/ +void SettingsCache::loadToSettings() +{ + QHash::const_iterator i = mCache.constBegin(); + + while(i != mCache.constEnd()) + { + mSettings.setValue(i.key(), i.value()); + ++i; + } + + mSettings.sync(); +} + + +/************************************************ + + ************************************************/ +GlobalSettings::GlobalSettings(): + Settings(QL1S("lxqt")), + d_ptr(new GlobalSettingsPrivate(this)) +{ + if (value(QL1S("icon_theme")).toString().isEmpty()) + { + qWarning() << QString::fromLatin1("Icon Theme not set. Fallbacking to Oxygen, if installed"); + const QString fallback(QLatin1String("oxygen")); + + const QDir dir(QLatin1String(LXQT_DATA_DIR) + QLatin1String("/icons")); + if (dir.exists(fallback)) + { + setValue(QL1S("icon_theme"), fallback); + sync(); + } + else + { + qWarning() << QString::fromLatin1("Fallback Icon Theme (Oxygen) not found"); + } + } + + fileChanged(); +} + +GlobalSettings::~GlobalSettings() +{ + delete d_ptr; +} + + +/************************************************ + + ************************************************/ +void GlobalSettings::fileChanged() +{ + Q_D(GlobalSettings); + sync(); + + + QString it = value(QL1S("icon_theme")).toString(); + if (d->mIconTheme != it) + { + Q_EMIT iconThemeChanged(); + } + + QString rt = value(QL1S("theme")).toString(); + qlonglong themeUpdated = value(QL1S("__theme_updated__")).toLongLong(); + if ((d->mLXQtTheme != rt) || (d->mThemeUpdated != themeUpdated)) + { + d->mLXQtTheme = rt; + Q_EMIT lxqtThemeChanged(); + } + + Q_EMIT settingsChangedFromExternal(); + Q_EMIT settingsChanged(); +} + diff --git a/LibLXQT/lxqtsettings.h b/LibLXQT/lxqtsettings.h new file mode 100644 index 0000000000..cffdbeb3ba --- /dev/null +++ b/LibLXQT/lxqtsettings.h @@ -0,0 +1,217 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.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 LXQTSETTINGS_H +#define LXQTSETTINGS_H + +#include +#include +#include +#include "lxqtglobals.h" + +class QEvent; + +namespace LXQt +{ + +class SettingsPrivate; +class GlobalSettings; + +/*! \brief User settings handling */ +class LXQT_API Settings : public QSettings +{ + Q_OBJECT +public: + + /*! \brief Constructs a Settings object for accessing settings of the module called module, and with parent parent. + Settings can be accessed using the standard interface provided by QSettings, but it also provides some convenience functions and signals. + + \param module a base name of the config file. It's a name without + the extension. For example: if you want to open settings for + panel create it as Settings("panel"). + The function will create all parent directories necessary to create + the file. + \param parent It's no need to delete this class manually if it's set. + */ + explicit Settings(const QString& module, QObject* parent = nullptr); + //explicit Settings(QObject* parent=0); + explicit Settings(const QSettings* parentSettings, const QString& subGroup, QObject* parent=nullptr); + explicit Settings(const QSettings& parentSettings, const QString& subGroup, QObject* parent=nullptr); + Settings(const QString &fileName, QSettings::Format format, QObject *parent = nullptr); + ~Settings() override; + + static const GlobalSettings *globalSettings(); + + + /*! Returns the localized value for key. In the desktop file keys may be postfixed by [LOCALE]. If the + localized value doesn't exist, returns non lokalized value. If non localized value doesn't exist, returns defaultValue. + LOCALE must be of the form lang_COUNTRY.ENCODING@MODIFIER, where _COUNTRY, .ENCODING, and @MODIFIER may be omitted. + + If no default value is specified, a default QVariant is returned. */ + QVariant localizedValue(const QString& key, const QVariant& defaultValue = QVariant()) const; + + /*! Sets the value of setting key to value. If a localized version of the key already exists, the previous value is + overwritten. Otherwise, it overwrites the the un-localized version. */ + void setLocalizedValue(const QString &key, const QVariant &value); + +Q_SIGNALS: + /*! /brief signal for backward compatibility (emitted whenever settingsChangedFromExternal() or settingsChangedByApp() is emitted) + */ + void settingsChanged(); + /*! /brief signal emitted when the settings file is changed by external application + */ + void settingsChangedFromExternal(); + /*! /brief signal emitted when any setting is changed by this object + */ + void settingsChangedByApp(); + +protected: + bool event(QEvent *event) override; + +protected Q_SLOTS: + /*! Called when the config file is changed */ + virtual void fileChanged(); + +private Q_SLOTS: + void _fileChanged(const QString& path); + +private: + void addWatchedFile(QString const & path); + +private: + Q_DISABLE_COPY(Settings) + + SettingsPrivate* const d_ptr; + Q_DECLARE_PRIVATE(Settings) +}; + + +class LXQtThemeData; + +/*! \brief QSS theme handling */ +class LXQT_API LXQtTheme +{ +public: + /// Constructs a null theme. + LXQtTheme(); + + /*! Constructs an theme from the dir with the given path. If path not absolute + (i.e. the theme name only) the relevant dir must be found relative to the + $XDG_DATA_HOME + $XDG_DATA_DIRS directories. */ + LXQtTheme(const QString &path); + + /// Constructs a copy of other. This is very fast. + LXQtTheme(const LXQtTheme &other); + + LXQtTheme& operator=(const LXQtTheme &other); + ~LXQtTheme(); + + /// Returns the name of the theme. + QString name() const; + + QString path() const; + + QString previewImage() const; + + /// Returns true if this theme is valid; otherwise returns false. + bool isValid() const; + + /*! \brief Returns StyleSheet text (not file name, but real text) of the module called module. + Paths in url() C/QSS functions are parsed to be real values for the theme, + relative to full path + */ + QString qss(const QString& module) const; + + /*! \brief A full path to image used as a wallpaper + \param screen is an ID of the screen like in Qt. -1 means default (any) screen. + Any other value greater than -1 is the exact screen (in dualhead). + In themes the index starts from 1 (ix 1 means 1st screen). + \retval QString a file name (including path). + */ + QString desktopBackground(int screen=-1) const; + + /// Returns the current lxqt theme. + static const LXQtTheme ¤tTheme(); + + /// Returns the all themes found in the system. + static QList allThemes(); + +private: + static LXQtTheme* mInstance; + QSharedDataPointer d; +}; + +/*! +A global pointer referring to the unique LXQtTheme object. +It is equivalent to the pointer returned by the LXQtTheme::instance() function. +Only one theme object can be created. !*/ + +#define lxqtTheme LXQtTheme::currentTheme() + + +class LXQT_API SettingsCache +{ +public: + explicit SettingsCache(QSettings &settings); + explicit SettingsCache(QSettings *settings); + virtual ~SettingsCache() {} + + void loadFromSettings(); + void loadToSettings(); + +private: + QSettings &mSettings; + QHash mCache; +}; + +class GlobalSettingsPrivate; + +class LXQT_API GlobalSettings : public Settings +{ + Q_OBJECT +public: + GlobalSettings(); + ~GlobalSettings() override; + +Q_SIGNALS: + /// Signal emitted when the icon theme has changed. + void iconThemeChanged(); + + /// Signal emitted when the lxqt theme has changed. + void lxqtThemeChanged(); + +protected Q_SLOTS: + void fileChanged() override; + +private: + GlobalSettingsPrivate* const d_ptr; + Q_DECLARE_PRIVATE(GlobalSettings) +}; + +} // namespace LXQt +#endif // LXQTSETTINGS_H diff --git a/LibLXQT/lxqtsingleapplication.cpp b/LibLXQT/lxqtsingleapplication.cpp new file mode 100644 index 0000000000..dac9ba8630 --- /dev/null +++ b/LibLXQT/lxqtsingleapplication.cpp @@ -0,0 +1,108 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2014 LXQt 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 */ + +#include "lxqtsingleapplication.h" +#include "singleapplicationadaptor.h" +#include +#include +#include +#include +#include + +using namespace LXQt; + +SingleApplication::SingleApplication(int &argc, char **argv, StartOptions options) + : Application(argc, argv, true), + mActivationWindow(nullptr) +{ + QString service = + QString::fromLatin1("org.lxqt.%1").arg(QApplication::applicationName()); + + QDBusConnection bus = QDBusConnection::sessionBus(); + + if (!bus.isConnected()) { + QLatin1String errorMessage("Can't connect to the D-Bus session bus\n" + "Make sure the D-Bus daemon is running"); + + /* ExitOnDBusFailure is the default. Any value other than + NoExitOnDBusFailure will be taken as ExitOnDBusFailure (the default). + */ + if (options == NoExitOnDBusFailure) { + qDebug() << Q_FUNC_INFO << errorMessage; + return; + } else { + qCritical() << Q_FUNC_INFO << errorMessage; + QTimer::singleShot(0, [this] { exit(1); }); + } + } + + bool registered = (bus.registerService(service) == + QDBusConnectionInterface::ServiceRegistered); + if (registered) { // We are the primary instance + SingleApplicationAdaptor *mAdaptor = new SingleApplicationAdaptor(this); + QLatin1String objectPath("/"); + bus.registerObject(objectPath, mAdaptor, + QDBusConnection::ExportAllSlots); + } else { // We are the second outstance + QDBusMessage msg = QDBusMessage::createMethodCall(service, + QStringLiteral("/"), + QStringLiteral("org.lxqt.SingleApplication"), + QStringLiteral("activateWindow")); + QDBusConnection::sessionBus().send(msg); + + QTimer::singleShot(0, [this] { exit(0); }); + } +} + +SingleApplication::~SingleApplication() = default; + +void SingleApplication::setActivationWindow(QWidget *w) +{ + mActivationWindow = w; +} + +QWidget *SingleApplication::activationWindow() const +{ + return mActivationWindow; +} + +void SingleApplication::activateWindow() +{ + if (mActivationWindow) { + mActivationWindow->show(); + WId window = mActivationWindow->effectiveWinId(); + + KWindowInfo info(window, KWindowSystem::WMDesktop); + int windowDesktop = info.desktop(); + + if (windowDesktop != KWindowSystem::currentDesktop()) + KWindowSystem::setCurrentDesktop(windowDesktop); + KWindowSystem::activateWindow(window); + } else { + qDebug() << Q_FUNC_INFO << "activationWindow not set or null"; + } +} diff --git a/LibLXQT/lxqtsingleapplication.h b/LibLXQT/lxqtsingleapplication.h new file mode 100644 index 0000000000..489cea8a42 --- /dev/null +++ b/LibLXQT/lxqtsingleapplication.h @@ -0,0 +1,158 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2014 LXQt 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 LXQTSINGLEAPPLICATION_H +#define LXQTSINGLEAPPLICATION_H + +#include "lxqtapplication.h" + +class QWidget; + +namespace LXQt { + +/*! \class SingleApplication + * \brief The SingleApplication class provides an single instance Application. + * + * This class allows the user to create applications where only one instance + * is allowed to be running at an given time. If the user tries to launch + * another instance, the already running instance will be activated instead. + * + * The user has to set the activation window with setActivationWindow. If it + * doesn't the second instance will quietly exit without activating the first + * instance window. In any case only one instance is allowed. + * + * These classes depend on D-Bus and KF5::WindowSystem + * + * \code + * + * // Original code + * int main(int argc, char **argv) + * { + * LXQt::Application app(argc, argv); + * + * MainWidget w; + * w.show(); + * + * return app.exec(); + * } + * + * // Using the library + * int main(int argc, char **argv) + * { + * LXQt::SingleApplication app(argc, argv); + * + * MainWidget w; + * app.setActivationWindow(&w); + * w.show(); + * + * return app.exec(); + * } + * \endcode + * \sa SingleApplication + */ + +class LXQT_API SingleApplication : public Application { + Q_OBJECT + +public: + /*! + * \brief Options to control the D-Bus failure related application behaviour + * + * By default (ExitOnDBusFailure) if an instance can't connect to the D-Bus + * session bus, that instance calls ::exit(1). Not even the first instance + * will run. Connecting to the D-Bus session bus is an condition to + * guarantee that only one instance will run. + * + * If an user wants to allow an application to run without D-Bus, it must + * use the NoExitOnDBusFailure option. + * + * ExitOnDBusFailure is the default. + */ + enum StartOptions { + /** Exit if the connection to the D-Bus session bus fails. + * It's the default + */ + ExitOnDBusFailure, + /** Don't exit if the connection to the D-Bus session bus fails.*/ + NoExitOnDBusFailure + }; + Q_ENUM(StartOptions) + + /*! + * \brief Construct a LXQt SingleApplication object. + * \param argc standard argc as in QApplication + * \param argv standard argv as in QApplication + * \param options Control the on D-Bus failure application behaviour + * + * \sa StartOptions. + */ + SingleApplication(int &argc, char **argv, StartOptions options = ExitOnDBusFailure); + ~SingleApplication() override; + + /*! + * \brief Sets the activation window. + * \param w activation window. + * + * Sets the activation window of this application to w. The activation + * window is the widget that will be activated by \a activateWindow(). + * + * \sa activationWindow() \sa activateWindow(); + */ + void setActivationWindow(QWidget *w); + + /*! + * \brief Gets the current activation window. + * \return The current activation window. + * + * \sa setActivationWindow(); + */ + QWidget *activationWindow() const; + +public Q_SLOTS: + /*! + * \brief Activates this application activation window. + * + * Changes to the desktop where this applications is. It then de-minimizes, + * raises and activates the application's activation window. + * If no activation window has been set, this function does nothing. + * + * \sa setActivationWindow(); + */ + void activateWindow(); + +private: + QWidget *mActivationWindow; +}; + +#if defined(lxqtSingleApp) +#undef lxqtSingleApp +#endif +#define lxqtSingleApp (static_cast(qApp)) + +} // namespace LXQt + +#endif // LXQTSINGLEAPPLICATION_H diff --git a/LibLXQT/lxqttranslator.cpp b/LibLXQT/lxqttranslator.cpp new file mode 100644 index 0000000000..710f8891c8 --- /dev/null +++ b/LibLXQT/lxqttranslator.cpp @@ -0,0 +1,186 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2013 LXQt team + * Authors: + * Alexander Sokoloff + 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 */ + +#include "lxqttranslator.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace LXQt; + +bool translate(const QString &name, const QString &owner = QString()); +/************************************************ + + ************************************************/ +QStringList *getSearchPaths() +{ + static QStringList *searchPath = nullptr; + + if (searchPath == nullptr) + { + searchPath = new QStringList(); + *searchPath << XdgDirs::dataDirs(QL1C('/') + QL1S(LXQT_RELATIVE_SHARE_TRANSLATIONS_DIR)); + *searchPath << QL1S(LXQT_SHARE_TRANSLATIONS_DIR); + searchPath->removeDuplicates(); + } + + return searchPath; +} + + +/************************************************ + + ************************************************/ +QStringList LXQt::Translator::translationSearchPaths() +{ + return *(getSearchPaths()); +} + + +/************************************************ + + ************************************************/ +void Translator::setTranslationSearchPaths(const QStringList &paths) +{ + QStringList *p = getSearchPaths(); + p->clear(); + *p << paths; +} + + +/************************************************ + + ************************************************/ +bool translate(const QString &name, const QString &owner) +{ + const QString locale = QLocale::system().name(); + QTranslator *appTranslator = new QTranslator(qApp); + + QStringList *paths = getSearchPaths(); + for(const QString &path : qAsConst(*paths)) + { + QStringList subPaths; + + if (!owner.isEmpty()) + { + subPaths << path + QL1C('/') + owner + QL1C('/') + name; + } + else + { + subPaths << path + QL1C('/') + name; + subPaths << path; + } + + for(const QString &p : qAsConst(subPaths)) + { + if (appTranslator->load(name + QL1C('_') + locale, p)) + { + QCoreApplication::installTranslator(appTranslator); + return true; + } + else if (locale == QLatin1String("C") || + locale.startsWith(QLatin1String("en"))) + { + // English is the default. Even if there isn't an translation + // file, we return true. It's translated anyway. + delete appTranslator; + return true; + } + } + } + + // If we got here, no translation was loaded. appTranslator has no use. + delete appTranslator; + return false; +} + + +/************************************************ + + ************************************************/ +bool Translator::translateApplication(const QString &applicationName) +{ + const QString locale = QLocale::system().name(); + QTranslator *qtTranslator = new QTranslator(qApp); + + if (qtTranslator->load(QL1S("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + { + qApp->installTranslator(qtTranslator); + } + else + { + delete qtTranslator; + } + + if (!applicationName.isEmpty()) + return translate(applicationName); + else + return translate(QFileInfo(QCoreApplication::applicationFilePath()).baseName()); +} + + +/************************************************ + + ************************************************/ +bool Translator::translateLibrary(const QString &libraryName) +{ + static QSet loadedLibs; + + if (loadedLibs.contains(libraryName)) + return true; + + loadedLibs.insert(libraryName); + + return translate(libraryName); +} + +bool Translator::translatePlugin(const QString &pluginName, const QString& type) +{ + static QSet loadedPlugins; + + const QString fullName = type % QL1C('/') % pluginName; + if (loadedPlugins.contains(fullName)) + return true; + + loadedPlugins.insert(pluginName); + return translate(pluginName, type); +} + +static void loadSelfTranslation() +{ + Translator::translateLibrary(QLatin1String("liblxqt")); +} + +Q_COREAPP_STARTUP_FUNCTION(loadSelfTranslation) diff --git a/LibLXQT/lxqttranslator.h b/LibLXQT/lxqttranslator.h new file mode 100644 index 0000000000..3d4605eaaa --- /dev/null +++ b/LibLXQT/lxqttranslator.h @@ -0,0 +1,72 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * https://lxqt.org + * + * Copyright: 2013 LXQt team + * Authors: + * Alexander Sokoloff + 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 LXQTTRANSLATOR_H +#define LXQTTRANSLATOR_H + +#include +#include "lxqtglobals.h" + +namespace LXQt +{ +/** + The Translator class provides internationalization support for application and librarioes. + **/ +class LXQT_API Translator +{ +public: + /** + Returns a list of paths that the application will search translations files. + **/ + static QStringList translationSearchPaths(); + + /** + Sets the list of directories to search translations. All existing paths + will be deleted and the path list will consist of the paths given in paths. + **/ + static void setTranslationSearchPaths(const QStringList &paths); + + /** + Loads translations for application. If applicationName is not specified, + then basename of QCoreApplication::applicationFilePath() is used. + Returns true if the translation is successfully loaded; otherwise returns false. + **/ + static bool translateApplication(const QString &applicationName = QString()); + + /** + Loads translations for application. If applicationName is not specified, + then basename of QCoreApplication::applicationFilePath() is used. + Returns true if the translation is successfully loaded; otherwise returns false. + **/ + static bool translateLibrary(const QString &libraryName = QString()); + + static bool translatePlugin(const QString &pluginName, const QString& type); +}; + +} // namespace LXQt +#endif // LXQTTRANSLATOR_H diff --git a/LibLXQT/polkit/org.lxqt.backlight.pkexec.policy.in b/LibLXQT/polkit/org.lxqt.backlight.pkexec.policy.in new file mode 100644 index 0000000000..bf07b6ca63 --- /dev/null +++ b/LibLXQT/polkit/org.lxqt.backlight.pkexec.policy.in @@ -0,0 +1,15 @@ + + + + Authentication is required to Change Brightness + battery + + no + no + yes + + ${CMAKE_INSTALL_PREFIX}/bin/lxqt-backlight_backend + + diff --git a/LibLXQT/resources/power.conf b/LibLXQT/resources/power.conf new file mode 100644 index 0000000000..17339aeb42 --- /dev/null +++ b/LibLXQT/resources/power.conf @@ -0,0 +1,3 @@ +[General] +monitorOffCommand=xset dpms force off +showLeaveDialogCommand=lxqt-leave diff --git a/LibLXQT/translations/CMakeLists.txt b/LibLXQT/translations/CMakeLists.txt new file mode 100644 index 0000000000..443d80b0bd --- /dev/null +++ b/LibLXQT/translations/CMakeLists.txt @@ -0,0 +1,3 @@ +project(liblxqt) + +build_component("." "") diff --git a/LibLXQT/translations/liblxqt.ts b/LibLXQT/translations/liblxqt.ts new file mode 100644 index 0000000000..08798fb502 --- /dev/null +++ b/LibLXQT/translations/liblxqt.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_ar.ts b/LibLXQT/translations/liblxqt_ar.ts new file mode 100644 index 0000000000..d9f1c18bbd --- /dev/null +++ b/LibLXQT/translations/liblxqt_ar.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + حواريّ + + + + LXQt::MessageBox + + + LXQt Power Manager Error + خطأ في مدير لكسكيوت للطاقة + + + + Hibernate failed. + فشل الإسبات. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + احتياطي الإخطارات + + + + LXQt::PowerManager + + + Hibernate + أسبِت + + + + Suspend + علّق + + + + Reboot + أعِد الإقلاع + + + + Shutdown + أطفِئ + + + + Logout + اخرج + + + + LXQt Session Suspend + تعليق جلسة لكسكيوت + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + أمتأكد من تعليق الحاسوب؟<p>هذا سيُعلّق الحاسوب في وضع طاقة منخفض. لن تُحفظ حالة النظام إن فُقدت الطاقة. + + + + LXQt Session Hibernate + إسبات جلسة لكسكيوت + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + أمتأكد من إسبات الحاسوب؟<p>هذا سيُسبت الحاسوب في وضع طاقة منخفض. تُحفظ حالة النّظام إن فُقدت الطاقة. + + + + LXQt Session Reboot + إعادة إقلاع جلسة لكسكيوت + + + + Do you want to really restart your computer? All unsaved work will be lost... + أمتأكد من إعادة إقلاع الحاسوب؟ ستفقد كل عملك غير المحفوظ… + + + + LXQt Session Shutdown + إطفاء جلسة لكسكيوت + + + + Do you want to really switch off your computer? All unsaved work will be lost... + أمتأكد من إطفاء الحاسوب؟ ستفقد كل عملك غير المحفوظ… + + + + LXQt Session Logout + الخروج من جلسة لكسكيوت + + + + Do you want to really logout? All unsaved work will be lost... + أمتأكد من الخروج؟ ستفقد كل عملك غير المحفوظ… + + + + + LXQt Power Manager Error + خطأ في مدير لكسكيوت للطاقة + + + + Hibernate failed. + فشل الإسبات. + + + + Suspend failed. + فشل التعليق. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + اقفل الشاشة + + + + Screen Saver Error + خطأ في حافظ الشاشة + + + + QCoreApplication + + + Choose the page to be shown. + اختر الصفحة التي ستُعرض. + + + + QObject + + + + Power Manager Error + خطأ في مدير الطاقة + + + + + QDBusInterface is invalid + ‏QDBusInterface غير صالح + + + + + Power Manager Error (D-BUS call) + خطأ في مدير الطاقة (نداء D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_arn.ts b/LibLXQT/translations/liblxqt_arn.ts new file mode 100644 index 0000000000..372c73699e --- /dev/null +++ b/LibLXQT/translations/liblxqt_arn.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_ast.ts b/LibLXQT/translations/liblxqt_ast.ts new file mode 100644 index 0000000000..19c1ffe027 --- /dev/null +++ b/LibLXQT/translations/liblxqt_ast.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_bg.ts b/LibLXQT/translations/liblxqt_bg.ts new file mode 100644 index 0000000000..30b6c31da7 --- /dev/null +++ b/LibLXQT/translations/liblxqt_bg.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Диалог + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Грешка в LXQt Управление на захранването + + + + Hibernate failed. + Хибернацията неуспешна. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Предупреждение за известия + + + + LXQt::PowerManager + + + Hibernate + Хибернация + + + + Suspend + Приспиване + + + + Reboot + Рестартиране + + + + Shutdown + Изключване + + + + Logout + Напускане на сесията + + + + LXQt Session Suspend + Приспиване + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Наистина ли искате да приспите компютъра си? <p> Компютърът преминава в режим на ниско енергийно потребление. Състоянието на системата не се запазва, ако захранването се прекъсне. + + + + LXQt Session Hibernate + Хибернация + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Наистина ли искате да спрете компютъра си? <p> Компютърът записва текущата сесия на диска и се изключва. Сесията се възстановява отново при стартиране. + + + + LXQt Session Reboot + Рестартиране + + + + Do you want to really restart your computer? All unsaved work will be lost... + Наистина ли искате да рестартирате компютъра си? <p> Всичката незапазена информация се загубва... + + + + LXQt Session Shutdown + Изключване + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Наистина ли искате да изключите компютъра си? <p> Всичката незапазена информация се загубва... + + + + LXQt Session Logout + Излизане от сесията + + + + Do you want to really logout? All unsaved work will be lost... + Наистина ли искате да напуснете сесията? <p> Всичката незапазена информация се загубва... + + + + + LXQt Power Manager Error + Грешка в LXQt Управление на захранването + + + + Hibernate failed. + Хибернацията неуспешна. + + + + Suspend failed. + Приспиването неуспешно. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Неуспешно стартиране на „% 1“. Уверете се, че имате инсталиран и работещ скрийнсейвър, съвместим с xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Неуспешно стартиране на „% 1“. Уверете се, че зададеният скрийнсейвър е инсталиран и работещ. + + + + Lock Screen + Заключване на екрана + + + + Screen Saver Error + Грешка на скрийнсейвъра + + + + QCoreApplication + + + Choose the page to be shown. + Избери страницата за показване. + + + + QObject + + + + Power Manager Error + Грешка в управление на захранването + + + + + QDBusInterface is invalid + QDBusInterface е невалиден + + + + + Power Manager Error (D-BUS call) + Грешка в управление на захранването (D-BUS call) + + + diff --git a/LibLXQT/translations/liblxqt_ca.ts b/LibLXQT/translations/liblxqt_ca.ts new file mode 100644 index 0000000000..86c6dc8e2e --- /dev/null +++ b/LibLXQT/translations/liblxqt_ca.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Diàleg + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Error del gestor d'energia de LXQt + + + + Hibernate failed. + Ha falla la hibernació. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Replegament de les notificacions + + + + LXQt::PowerManager + + + Hibernate + Hiberna + + + + Suspend + Suspèn + + + + Reboot + Reinicia + + + + Shutdown + Apaga + + + + Logout + Tanca la sessió + + + + LXQt Session Suspend + Suspensió de la sessió LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Esteu segur que voleu posar en suspensió el vostre ordinador?<p>Suspèn l'ordinador a un estat de baix consum. L'estat del sistema no es preserva si es perd l'alimentació. + + + + LXQt Session Hibernate + Hibernació de la sessió LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Esteu segur que voleu posar en hibernació el vostre ordinador?<p>Hiberna l'ordinador a un estat de baix consum. L'estat del sistema no es preserva si es perd l'alimentació. + + + + LXQt Session Reboot + Reinici de la sessió LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Esteu segur que voleu reiniciar el vostre ordinador? Es perdran tots els treballs que no s'hagin desat... + + + + LXQt Session Shutdown + Aturada de la sessió LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Esteu segur que voleu apagar el vostre ordinador? Es perdran tots els treballs que no s'hagin desat... + + + + LXQt Session Logout + Tancament de la sessió LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Esteu segur que voleu tancar la sessió? Es perdrà tot aquell treball que no s'hagi desat... + + + + + LXQt Power Manager Error + Error del gestor d'energia de LXQt + + + + Hibernate failed. + Ha fallat la hibernació. + + + + Suspend failed. + Ha fallat la suspensió. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Bloqueja la pantalla + + + + Screen Saver Error + Error de l'estalvi de pantalla + + + + QCoreApplication + + + Choose the page to be shown. + Trieu la pàgina a mostrar. + + + + QObject + + + + Power Manager Error + Error del gestor d'energia + + + + + QDBusInterface is invalid + QDBusInterface no és vàlid + + + + + Power Manager Error (D-BUS call) + Error del gestor d'energia (crida de D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_cs.ts b/LibLXQT/translations/liblxqt_cs.ts new file mode 100644 index 0000000000..ffdaa66690 --- /dev/null +++ b/LibLXQT/translations/liblxqt_cs.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Chyba LXQt správy napájení + + + + Hibernate failed. + Uspání na disk se nezdařilo. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Náhradní oznamování + + + + LXQt::PowerManager + + + Hibernate + Hibernovat + + + + Suspend + Uspat + + + + Reboot + Restartovat + + + + Shutdown + Vypnout + + + + Logout + Odhlásit se + + + + LXQt Session Suspend + LXQt sezení – uspat + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Opravdu chcete svůj počítač uspat do operační paměti?<p>Uvede ho to do stavu s nízkým odběrem elektrické energie. Při ztrátě napájení nebude stav systému zachován. + + + + LXQt Session Hibernate + LXQt sezení – hibernovat + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Opravdu chcete počítač uspat na disk?<p>Uvede ho to do stavu s nejnižším odběrem elektrické energie. I při ztrátě napájení bude stav systému zachován. + + + + LXQt Session Reboot + LXQt sezení – restartovat + + + + Do you want to really restart your computer? All unsaved work will be lost... + Opravdu chcete svůj počítač restartovat?<p>Jakákoli neuložená práce bude ztracena… + + + + LXQt Session Shutdown + LXQt sezení – vypnutí + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Opravdu chcete svůj počítač vypnout?<p>Jakákoli neuložená práce bude ztracena… + + + + LXQt Session Logout + LXQt sezení ‒ odhlášení + + + + Do you want to really logout? All unsaved work will be lost... + Opravdu se chcete odhlásit?<p>Jakákoli neuložená práce bude ztracena… + + + + + LXQt Power Manager Error + Chyba LXQt správy napájení + + + + Hibernate failed. + Hibernace se nezdařila. + + + + Suspend failed. + Uspání se nezdařilo. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nepodařilo se spustit „%1“. Zajistěte, aby byl nainstalován nástroj pro zamykání / šetřič obrazovky, kompatibilní se specifikací xdg-screensaver a byl spuštěný. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nepodařilo se spustit „%1“. Zajistěte, aby byl nainstalovaný určený nástroj pro zamykání / šetřič obrazovky a byl spuštěný. + + + + Lock Screen + Zamknout obrazovku + + + + Screen Saver Error + Chyba šetřiče obrazovky + + + + QCoreApplication + + + Choose the page to be shown. + Zvolte stránku kterou zobrazit. + + + + QObject + + + + Power Manager Error + Chyba správy napájení + + + + + QDBusInterface is invalid + QDBusInterface není platné + + + + + Power Manager Error (D-BUS call) + Chyba správy napájení (volání D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_cy.ts b/LibLXQT/translations/liblxqt_cy.ts new file mode 100644 index 0000000000..abcf18e97b --- /dev/null +++ b/LibLXQT/translations/liblxqt_cy.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_da.ts b/LibLXQT/translations/liblxqt_da.ts new file mode 100644 index 0000000000..fc949a46ec --- /dev/null +++ b/LibLXQT/translations/liblxqt_da.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Fejl ved LXQt strømstyring + + + + Hibernate failed. + Dvaletilstand mislykkedes. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Reserve for underretninger + + + + LXQt::PowerManager + + + Hibernate + Dvale + + + + Suspend + Hvile + + + + Reboot + Genstart + + + + Shutdown + Luk ned + + + + Logout + Log ud + + + + LXQt Session Suspend + Hviletilstand af LXQt-session + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Vil du virkelig sætte din computer i hviletilstand?<p>Hviletilstand sætter computeren i energisparetilstand. Systemtilstanden mistes hvis strømmen forsvinder. + + + + LXQt Session Hibernate + LXQt Session Dvale + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Vil du virkelig sætte din computer i dvaletilstand?<p>Dvaletilstand sætter computeren i energisparetilstand. Systemtilstanden bibeholdes hvis strømmen forsvinder. + + + + LXQt Session Reboot + Genstart af LXQt-session + + + + Do you want to really restart your computer? All unsaved work will be lost... + Vil du virkelig genstarte din computer? Alt arbejde der ikke er blevet gemt, vil gå tabt... + + + + LXQt Session Shutdown + Nedlukning af LXQt-session + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Vil du virkelig slukke din computer? Alt arbejde der ikke er blevet gemt, vil gå tabt... + + + + LXQt Session Logout + Udlogning af LXQt-session + + + + Do you want to really logout? All unsaved work will be lost... + Vil du virkelig logge ud? Alt arbejde der ikke er blevet gemt, vil gå tabt... + + + + + LXQt Power Manager Error + Fejl ved LXQt strømstyring + + + + Hibernate failed. + Dvaletilstand mislykkedes. + + + + Suspend failed. + Hviletilstand mislykkedes. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Kunne ikke køre "%1". Sørg for at du har en låser/pauseskærm som er installeret og kører som er kompatibel med xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Kunne ikke køre "%1". Sørg for at den angivne låser/pauseskærm er installeret og kører. + + + + Lock Screen + Lås skærm + + + + Screen Saver Error + Fejl ved pauseskærm + + + + QCoreApplication + + + Choose the page to be shown. + Vælg siden som skal vises. + + + + QObject + + + + Power Manager Error + Fejl ved strømstyring + + + + + QDBusInterface is invalid + QDBusInterface er ugyldig + + + + + Power Manager Error (D-BUS call) + Fejl ved strømstyring (D-BUS-kald) + + + diff --git a/LibLXQT/translations/liblxqt_de.ts b/LibLXQT/translations/liblxqt_de.ts new file mode 100644 index 0000000000..7604514df0 --- /dev/null +++ b/LibLXQT/translations/liblxqt_de.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt-Energieverwaltung Fehler + + + + Hibernate failed. + Ruhezustand fehlgeschlagen. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Benachrichtigung Fallback + + + + LXQt::PowerManager + + + Hibernate + Ruhezustand + + + + Suspend + Bereitschaft + + + + Reboot + Neustart + + + + Shutdown + Herunterfahren + + + + Logout + Abmelden + + + + LXQt Session Suspend + LXQT-Sitzung Bereitschaft + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Möchten Sie ihren Computer in Bereitschaft versetzen?<p>Der Computer wird in einen Energiesparmodus versetzt. Der Systemzustand geht verloren, wenn die Energiezufuhr abbricht. + + + + LXQt Session Hibernate + LXQT-Sitzung Ruhezustand + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Möchten Sie ihren Computer in Ruhezustand versetzen?<p>Dies versetzt ihren Computer in einen Energiesparmodus. Der Systemzustand bleibt erhalten, wenn die Energiezufuhr abbricht. + + + + LXQt Session Reboot + LXQT-Sitzung Neustart + + + + Do you want to really restart your computer? All unsaved work will be lost... + Möchten Sie ihren Computer wirklich neustarten? Alle ungespeicherten Arbeiten gehen verloren… + + + + LXQt Session Shutdown + LXQT-Sitzung Herunterfahren + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Möchten Sie ihren Computer wirklich herunterfahren? Alle ungespeicherten Arbeiten gehen verloren… + + + + LXQt Session Logout + LXQT-Sitzung Abmelden + + + + Do you want to really logout? All unsaved work will be lost... + Möchten Sie sich wirklich abmelden? Alle ungespeicherten Arbeiten gehen verloren… + + + + + LXQt Power Manager Error + LXQt-Energieverwaltung Fehler + + + + Hibernate failed. + Ruhezustand fehlgeschlagen. + + + + Suspend failed. + Bereitschaft fehlgeschlagen. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Fehler beim Ausführen von &quot;% 1&quot; Stellen Sie sicher, dass Sie einen mit xdg-screensaver kompatiblen Locker/Bildschirmschoner installiert haben. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Fehler beim Ausführen von &quot;% 1&quot; Stellen Sie sicher, dass der ausgewählte Locker/Bildschirmschoner installiert ist und läuft.. + + + + Lock Screen + Bildschirm sperren + + + + Screen Saver Error + Bildschirmschoner Fehler + + + + QCoreApplication + + + Choose the page to be shown. + Wählen Sie die anzuzeigende Seite. + + + + QObject + + + + Power Manager Error + Energieverwaltungsfehler + + + + + QDBusInterface is invalid + QDBusInterface ist ungültig + + + + + Power Manager Error (D-BUS call) + Energieverwaltungsfehler (D-BUS-Aufruf) + + + diff --git a/LibLXQT/translations/liblxqt_el.ts b/LibLXQT/translations/liblxqt_el.ts new file mode 100644 index 0000000000..4060d1d695 --- /dev/null +++ b/LibLXQT/translations/liblxqt_el.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Διάλογος + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Σφάλμα διαχείρισης ενέργειας LXQt + + + + Hibernate failed. + Αποτυχία νάρκωσης. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Ανακατεύθυνση ειδοποιήσεων + + + + LXQt::PowerManager + + + Hibernate + Νάρκη + + + + Suspend + Αναστολή + + + + Reboot + Επανεκκίνηση + + + + Shutdown + Τερματισμός + + + + Logout + Αποσύνδεση + + + + LXQt Session Suspend + Αναστολή της συνεδρίας LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Θέλετε πραγματικά να γίνει αναστολή του υπολογιστή;<p>Θέτει τον υπολογιστή σε κατάσταση χαμηλής κατανάλωσης. Η κατάσταση του συστήματος δεν διατηρείται εάν διακοπεί η παροχή ρεύματος. + + + + LXQt Session Hibernate + Νάρκωση της συνεδρίας LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Θέλετε πραγματικά να τεθεί σε νάρκη ο υπολογιστής;<p>Θέτει τον υπολογιστή σε κατάσταση χαμηλής κατανάλωσης. Η κατάσταση του συστήματος διατηρείται εάν διακοπεί η παροχή ρεύματος. + + + + LXQt Session Reboot + Επανεκκίνηση συνεδρίας LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Θέλετε πραγματικά να επανεκκινήσετε τον υπολογιστή; Όλες οι μη αποθηκευμένες εργασίες σας θα χαθούν... + + + + LXQt Session Shutdown + Τερματισμός συνεδρίας LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Θέλετε πραγματικά να τερματίσετε τον υπολογιστή; Όλες οι μη αποθηκευμένες εργασίες σας θα χαθούν... + + + + LXQt Session Logout + Αποσύνδεση της συνεδρίας LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Θέλετε πραγματικά να αποσυνδεθείτε; Όλες οι μη αποθηκευμένες εργασίες σας θα χαθούν... + + + + + LXQt Power Manager Error + Σφάλμα διαχείρισης της ενέργειας LXQt + + + + Hibernate failed. + Αποτυχία νάρκωσης. + + + + Suspend failed. + Αποτυχία αναστολής. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Αποτυχία εκτέλεσης του «%1». Σιγουρευτείτε ότι έχετε μια προστασία/κλείδωμα οθόνης συμβατή με xdg-screensaver εγκατεστημένη και ενεργή. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Αποτυχία εκτέλεσης του «%1». Σιγουρευτείτε ότι η καθορισμένη προστασία/κλείδωμα οθόνης είναι εγκατεστημένη και ενεργή. + + + + Lock Screen + Κλείδωμα οθόνης + + + + Screen Saver Error + Σφάλμα της προστασίας οθόνης + + + + QCoreApplication + + + Choose the page to be shown. + Επιλέξτε την σελίδα προς προβολή. + + + + QObject + + + + Power Manager Error + Σφάλμα διαχείρισης ενέργειας + + + + + QDBusInterface is invalid + Το QDBusInterface δεν είναι έγκυρο + + + + + Power Manager Error (D-BUS call) + Σφάλμα διαχείρισης ενέργειας (κλήση D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_en_GB.ts b/LibLXQT/translations/liblxqt_en_GB.ts new file mode 100644 index 0000000000..004d0d613c --- /dev/null +++ b/LibLXQT/translations/liblxqt_en_GB.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_eo.ts b/LibLXQT/translations/liblxqt_eo.ts new file mode 100644 index 0000000000..7bb7935973 --- /dev/null +++ b/LibLXQT/translations/liblxqt_eo.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + Pasivumigo fiaskis. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + Pasivumigi + + + + Suspend + Prokrasti + + + + Reboot + Restartigi + + + + Shutdown + Elŝalti + + + + Logout + Elsaluti + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + Pasivumigo fiaskis. + + + + Suspend failed. + Prokrasto fiaskis. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Ŝlosi ekranon + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + QDBusInterface nevalidas + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_es.ts b/LibLXQT/translations/liblxqt_es.ts new file mode 100644 index 0000000000..66b60ff025 --- /dev/null +++ b/LibLXQT/translations/liblxqt_es.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Diálogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Error del gestor de energía de LXQt + + + + Hibernate failed. + Fallo al hibernar. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Alternativa para notificaciones + + + + LXQt::PowerManager + + + Hibernate + Hibernar + + + + Suspend + Suspender + + + + Reboot + Reiniciar + + + + Shutdown + Apagar + + + + Logout + Cerrar la sesión + + + + LXQt Session Suspend + Suspender la sesión LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + ¿Realmente desea suspender el sistema?<p>Suspende el sistema a un estado de bajo consumo. El estado del sistema no se preserva si se agota la energía. + + + + LXQt Session Hibernate + Hibernar la sesión LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + ¿Realmente desea hibernar su PC?<p>Hiberna la PC a un estado de bajo consumo. El estado del sistema se preserva si se agota la energía. + + + + LXQt Session Reboot + Reiniciar la sesión LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + ¿Realmente desea reiniciar su PC? Todo el trabajo sin guardar se perderá... + + + + LXQt Session Shutdown + Apagar la sesión LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + ¿Realmente desea apagar su PC? Todo el trabajo sin guardar se perderá... + + + + LXQt Session Logout + Cerrar la sesión LXQt + + + + Do you want to really logout? All unsaved work will be lost... + ¿Realmente desea cerrar la sesión? Todo el trabajo sin guardar se perderá... + + + + + LXQt Power Manager Error + Error del gestor de energía de LXQt + + + + Hibernate failed. + Fallo al hibernar. + + + + Suspend failed. + Fallo al suspender. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Error al ejecutar "%1". Asegúrese de tener un bloqueador de pantalla/salvapantallas compatible con xdg-screensaver instalado y funcionando. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Error al ejecutar "%1". Asegúrese de que el bloqueador de pantalla/salvapantallas está instalado y funcionando. + + + + Lock Screen + Bloquear la pantalla + + + + Screen Saver Error + Error del salvapantallas + + + + QCoreApplication + + + Choose the page to be shown. + Elija la página que se muestra. + + + + QObject + + + + Power Manager Error + Error del administrador de energía + + + + + QDBusInterface is invalid + QDBusInterface es inválido + + + + + Power Manager Error (D-BUS call) + Error en el adminstrador de energía (llamada a D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_es_VE.ts b/LibLXQT/translations/liblxqt_es_VE.ts new file mode 100644 index 0000000000..bf6ac53237 --- /dev/null +++ b/LibLXQT/translations/liblxqt_es_VE.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Error en Gestión de Energía de LXQt + + + + Hibernate failed. + Hibernación ha fallado. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Delegacion de notificaciones + + + + LXQt::PowerManager + + + Hibernate + Hibernar + + + + Suspend + Suspender + + + + Reboot + Reiniciar + + + + Shutdown + Apagar + + + + Logout + Salirse + + + + LXQt Session Suspend + Sesión LXQt Suspendida + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Quiere usted realmente suspender su computador?<p>Suspenderá el computador en un estado de baja energía. El estado del sistema operativo no se preservara ante la perdida o caída de energía. + + + + LXQt Session Hibernate + Hibernar Sesión LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Quiere usted realmente hibernar su computador?<p>Hibernara el computador en un estado de baja energia y lo guardara en el disco. El estado del sistema si se preservara ante la perdida o caida de energia. + + + + LXQt Session Reboot + Reinicio del sistema por LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Quiere usted realmente reiniciar su computador? Todo el trabajo realizado se perdera si no lo ha guardado, dado que se cerrara... + + + + LXQt Session Shutdown + Apagado del sistema por LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Quiere usted realmente apagar su computador?<p> Todo el trabajo realizado se perdera si no lo ha guardado, dado que se apagara... + + + + LXQt Session Logout + Cierre de la sesion por LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Quiere realmente cerar su sesion? Todo el trabajo realizado se perdera si no lo ha guardado, dado que se cerrara... + + + + + LXQt Power Manager Error + Error en Gestion de energia de LXQt + + + + Hibernate failed. + Hibernacion ha fallado. + + + + Suspend failed. + Suspensión ha fallado. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Bloquear Pantalla + + + + Screen Saver Error + Error de Salvapantalla + + + + QCoreApplication + + + Choose the page to be shown. + Elija la página a mostrar. + + + + QObject + + + + Power Manager Error + Error del manejador de energia + + + + + QDBusInterface is invalid + La interfaz Dbus Qt es invalida + + + + + Power Manager Error (D-BUS call) + Error del manejador de energia (llamada Dbus) + + + diff --git a/LibLXQT/translations/liblxqt_et.ts b/LibLXQT/translations/liblxqt_et.ts new file mode 100644 index 0000000000..3663f92f12 --- /dev/null +++ b/LibLXQT/translations/liblxqt_et.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Valikuaken + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt toitehalduri viga + + + + Hibernate failed. + Talveunne jäämine ei õnnestunud. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Teavituste tagavaralahendus + + + + LXQt::PowerManager + + + Hibernate + Talveunne + + + + Suspend + Uinakusse + + + + Reboot + Taaskäivita + + + + Shutdown + Seiska + + + + Logout + Logi välja + + + + LXQt Session Suspend + LXQt sessiooni talletamine mällu + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Kas sa kindlasti soovid oma arvuti sessiooni talletada mällu?<p>Tegemist on vähese voolutarbega olekuga, kuid toite kadumisel kaovad ka andmed. + + + + LXQt Session Hibernate + LXQt sessioni salvetamine andmekandjale + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Kas sa kindlasti soovid oma arvuti sessiooni talletada andmekandjale?<p>Tegemist on vähese voolutarbega olekuga ja toite kadumisel ei kaovad salvestatud andmed. + + + + LXQt Session Reboot + LXQt sessioni taaskäivitus + + + + Do you want to really restart your computer? All unsaved work will be lost... + Kas sa kindlasti soovid arvuti uuesti käivitada? Kõik salvestamata töö läheb kaotsi... + + + + LXQt Session Shutdown + LXQt sessiooni seiskamine + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Kas sa kindlasti soovid arvuti sulgeda? Kõik salvestamata töö läheb kaotsi... + + + + LXQt Session Logout + Väljalogimine LXQt sessioonist + + + + Do you want to really logout? All unsaved work will be lost... + Kas sa kindlasti soovid välja logida? Kõik salvestamata töö läheb kaotsi... + + + + + LXQt Power Manager Error + LXQt toitehalduri viga + + + + Hibernate failed. + Talveunne jäämine ei õnnestunud. + + + + Suspend failed. + Sessiooni salvestamine mällu ei õnnestunud. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + „%1“ käivitamine ei õnnestunud. Kontrolli, et arvutisse on paigaldatud xdg-screensaver standardit järgiv ekraanilukustaja/ekraanisäästja ja töötab ka. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + „%1“ käivitamine ei õnnestunud. Kontrolli, et arvutisse on paigaldatud määratletud ekraanilukustaja/ekraanisäästja ning ta töötab ka. + + + + Lock Screen + Lukusta ekraan + + + + Screen Saver Error + Ekraanisäästja viga + + + + QCoreApplication + + + Choose the page to be shown. + Vali näidatav leht. + + + + QObject + + + + Power Manager Error + Toitehalduri viga + + + + + QDBusInterface is invalid + QDBusInterface on vigane + + + + + Power Manager Error (D-BUS call) + Toitehalduri viga (D-BUS'i päring) + + + diff --git a/LibLXQT/translations/liblxqt_eu.ts b/LibLXQT/translations/liblxqt_eu.ts new file mode 100644 index 0000000000..ff8ace88f1 --- /dev/null +++ b/LibLXQT/translations/liblxqt_eu.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Elkarrizketa-koadroa + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt energia-kudeatzailearen errorea + + + + Hibernate failed. + Hibernatzeak huts egin du. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Ordezko jakinarazpenak + + + + LXQt::PowerManager + + + Hibernate + Hibernatu + + + + Suspend + Eseki + + + + Reboot + Berrabiarazi + + + + Shutdown + Itzali + + + + Logout + Amaitu saioa + + + + LXQt Session Suspend + LXQt saioa eseki + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Ziur zaude ordenagailua eseki nahi duzula?<p>Energia baxuko egoera batetara esekitzen du ordenagailua. Sistemaren egoera ez da mantentzen korrontea eteten bada. + + + + LXQt Session Hibernate + LXQt saioa hibernatu + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Ziur zaude ordenagailua hibernatu nahi duzula?<p>Energia baxuko egoera batetara hibernatzen du ordenagailua. Sistemaren egoera mantentzen da korrontea eteten bada. + + + + LXQt Session Reboot + LXQt saioa berrabiarazi + + + + Do you want to really restart your computer? All unsaved work will be lost... + Ziur zaude ordenagailua berrabiarazi nahi duzula? Gorde gabeko lan guztiak galduko dira... + + + + LXQt Session Shutdown + LXQt saioa itzali + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Ziur zaude ordenagailua itzali nahi duzula? Gorde gabeko lan guztiak galduko dira... + + + + LXQt Session Logout + LXQt saioa amaitu + + + + Do you want to really logout? All unsaved work will be lost... + Ziur zaude saioa amaitu nahi duzula? Gorde gabeko lan guztiak galduko dira... + + + + + LXQt Power Manager Error + LXQt energia-kudeatzailearen errorea + + + + Hibernate failed. + Hibernatzeak huts egin du. + + + + Suspend failed. + Esekitzeak huts egin du. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Blokeatu pantaila + + + + Screen Saver Error + Pantaila babeslearen errorea + + + + QCoreApplication + + + Choose the page to be shown. + Aukeratu erakutsi nahi duzun orria. + + + + QObject + + + + Power Manager Error + Energia-kudeatzailearen errorea + + + + + QDBusInterface is invalid + QDBusInterface baliogabea da + + + + + Power Manager Error (D-BUS call) + Energia-kudeatzailearen errorea (D-BUS deia) + + + diff --git a/LibLXQT/translations/liblxqt_fi.ts b/LibLXQT/translations/liblxqt_fi.ts new file mode 100644 index 0000000000..a7c3e9ad05 --- /dev/null +++ b/LibLXQT/translations/liblxqt_fi.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Valintaikkuna + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt Virranhallintavirhe + + + + Hibernate failed. + Lepotilaan siirtyminen epäonnistui. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Ilmoitusten varavaihtoehto + + + + LXQt::PowerManager + + + Hibernate + Lepotila + + + + Suspend + Valmiustila + + + + Reboot + Käynnistä uudelleen + + + + Shutdown + Sammuta + + + + Logout + Kirjaudu ulos + + + + LXQt Session Suspend + LXQt-istunnon valmiustila + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Oletko varma, että halua siirtää tietokoneesi valmiustilaan?<p>Siirtää tietokoneen matalan virrankäytön tilaan. Virtakatkon sattuessa järjestelmän tilaa ei ole tallennettu. + + + + LXQt Session Hibernate + LXQt-istunnon lepotila + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Oletko varma, että haluat siirtää tietokoneesi lepotilaan?<p>Siirtää tietokoneen matalan virrankäytön tilaan. Virtakatkon sattuessa järjestelmän tila on tallennettu. + + + + LXQt Session Reboot + LXQt-istunnon uudelleenkäynnistys + + + + Do you want to really restart your computer? All unsaved work will be lost... + Haluatko varmasti käynnistää tietokoneen uudelleen? Kaikki tallentamaton tieto menetetään... + + + + LXQt Session Shutdown + LXQt-istunnon sammutus + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Haluatko varmasti sammuttaa tietokoneen? Kaikki tallentamaton tieto menetetään... + + + + LXQt Session Logout + LXQt-istunnon uloskirjaus + + + + Do you want to really logout? All unsaved work will be lost... + Haluatko varmasti kirjautua ulos? Kaikki tallentamaton tieto menetetään... + + + + + LXQt Power Manager Error + LXQt Virranhallintavirhe + + + + Hibernate failed. + Lepotilaan siirtyminen epäonnistui. + + + + Suspend failed. + Valmiustilaan siirtyminen epäonnistui. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Ohjelman "%1" käynnistäminen epäonnistui. Varmista, että järjestelmässä on xdg-screensaver yhteensopiva näytönsäästäjä/näytönlukitsija asennettuna sekä käynnissä. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Ohjelman "%1" käynnistäminen epäonnistui. Varmista, että valittu näytönsäästäjä/näytönlukitsija on asennettu sekä käynnissä. + + + + Lock Screen + Lukitse näyttö + + + + Screen Saver Error + Näytönsäästäjän virhe + + + + QCoreApplication + + + Choose the page to be shown. + Valitse näytettävä sivu. + + + + QObject + + + + Power Manager Error + Virranhallinnan virhe + + + + + QDBusInterface is invalid + QDBusInterface on virheellinen + + + + + Power Manager Error (D-BUS call) + Virranhallinnan virhe (D-BUS-kutsu) + + + diff --git a/LibLXQT/translations/liblxqt_fr.ts b/LibLXQT/translations/liblxqt_fr.ts new file mode 100644 index 0000000000..28b5a3bb6d --- /dev/null +++ b/LibLXQT/translations/liblxqt_fr.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialogue + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Erreur du gestionnaire d'alimentation de LXQt + + + + Hibernate failed. + Échec de la mise en hibernation. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Notifications de secours + + + + LXQt::PowerManager + + + Hibernate + Hiberner + + + + Suspend + Mettre en veille + + + + Reboot + Redémarrer + + + + Shutdown + Arrêter + + + + Logout + Déconnexion + + + + LXQt Session Suspend + Mettre la session LXQt en veille + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Souhaitez-vous vraiment mettre en veille votre ordinateur ?<p>Votre ordinateur consommera un peu d'énergie. L'état du système ne sera pas préservé en cas de coupure de courant. + + + + LXQt Session Hibernate + Mettre la session LXQt en hibernation + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Souhaitez-vous vraiment hiberner votre ordinateur ?<p>Votre ordinateur consommera un peu d'énergie. L'état du système sera préservé en cas de coupure de courant. + + + + LXQt Session Reboot + Redémarrer la session LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Voulez-vous vraiment redémarrer votre ordinateur ? Tout travail non sauvegardé sera perdu... + + + + LXQt Session Shutdown + Arrêter la session LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Voulez-vous vraiment éteindre votre ordinateur ? Tout travail non sauvegardé sera perdu... + + + + LXQt Session Logout + Déconnexion de la session LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Voulez-vous vraiment vous déconnecter ? Tout travail non sauvegardé sera perdu... + + + + + LXQt Power Manager Error + Erreur du gestionnaire d'alimentation de LXQt + + + + Hibernate failed. + Échec de la mise en hibernation. + + + + Suspend failed. + Échec de mise en veille. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Erreur lors du démarrage de "%1". Vérifiez que vous avez un écran de verouillage/veille compatible avec xdg-screensaver installé et démarré. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Erreur lors du démarrage de "%1". Vérifiez que le verouillage/écran de veille est installé et démarré. + + + + Lock Screen + Verrouiller l'écran + + + + Screen Saver Error + Erreur de l'économiseur d'écran + + + + QCoreApplication + + + Choose the page to be shown. + Choisir la page à afficher. + + + + QObject + + + + Power Manager Error + Erreur du gestionnaire d'alimentation de LXQt + + + + + QDBusInterface is invalid + L'interface QDBus est invalide + + + + + Power Manager Error (D-BUS call) + Erreur du gestionnaire d'alimentation de LXQt (appel de D-Bus) + + + diff --git a/LibLXQT/translations/liblxqt_gl.ts b/LibLXQT/translations/liblxqt_gl.ts new file mode 100644 index 0000000000..18873a17d9 --- /dev/null +++ b/LibLXQT/translations/liblxqt_gl.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Diálogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Produciuse un erro no xestor de enerxía de LXQt + + + + Hibernate failed. + Produciuse un fallo na posta en hibernación. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Notificacións de retorno + + + + LXQt::PowerManager + + + Hibernate + Hibernar + + + + Suspend + Suspender + + + + Reboot + Reiniciar + + + + Shutdown + Apagar + + + + Logout + Pechar a sesión + + + + LXQt Session Suspend + Suspender a sesión LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Confirma que quere suspender o sistema?<p>Suspende o computador a un estado de baixo consumo. O estado do sistema non se conserva se se esgota a enerxía. + + + + LXQt Session Hibernate + Hibernar a sesión LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Confirma que quere hibernar o computador?<p>Hiberna o computador a un estado de baixo consumo. O estado do sistema conservarase aínda que se esgote a enerxía. + + + + LXQt Session Reboot + Reiniciar a sesión LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Confirma que quere reiniciar o seu computador? Perderase todo o traballo que non teña gardado... + + + + LXQt Session Shutdown + Apagar a sesión LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Confirma que quere apagar o seu computador? Perderase todo o traballo que non teña gardado... + + + + LXQt Session Logout + Pechar a sesión de LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Confirma que quere pechar a sesión? Perderase todo o traballo que non teña gardado... + + + + + LXQt Power Manager Error + Produciuse un erro no xestor de enerxía de LXQt + + + + Hibernate failed. + Produciuse un fallo na posta en hibernación. + + + + Suspend failed. + Produciuse un fallo na posta en suspensión. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Produciuse un fallo ao executar «%1». Asegúrese de ter un bloqueador/salva pantallas compatíbel co xdg-screensaver instalado e en execución. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Produciuse un fallo ao executar «%1». Asegúrese de que o bloqueador/salva pantallas está instalado e en execución. + + + + Lock Screen + Bloquear a pantalla + + + + Screen Saver Error + Produciuse un erro no salva pantallas + + + + QCoreApplication + + + Choose the page to be shown. + Escolla a páxina que amosar. + + + + QObject + + + + Power Manager Error + Produciuse un erro no xestor de enerxía + + + + + QDBusInterface is invalid + QDBusInterface non é válido + + + + + Power Manager Error (D-BUS call) + Produciuse un erro no xestor de enerxía (chamada a D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_he.ts b/LibLXQT/translations/liblxqt_he.ts new file mode 100644 index 0000000000..5a6bd6d241 --- /dev/null +++ b/LibLXQT/translations/liblxqt_he.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + תיבת דו־שיח + + + + LXQt::MessageBox + + + LXQt Power Manager Error + שגיאה במנהל צריכת החשמל של LXQt + + + + Hibernate failed. + התרדמת נכשלה. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + עתודת התראות + + + + LXQt::PowerManager + + + Hibernate + תרדמת + + + + Suspend + השהיה + + + + Reboot + הפעלה מחדש + + + + Shutdown + כיבוי + + + + Logout + יציאה + + + + LXQt Session Suspend + השהיית הפעלת LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + להשהות את המחשב שלך?<p>המחשב יושהה למצב חסכוני בחשמל. מצב המערכת לא נשמר אם החשמל מנותק. + + + + LXQt Session Hibernate + הרדמת הפעלה של LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + להרדים את המחשב שלך?<p>המחשב יירדם למצב חסכוני בחשמל. מצב המערכת נשמר גם אם החשמל מנותק. + + + + LXQt Session Reboot + הפעלה מחדש של LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + להפעיל מחדש את המחשב? כל העבודה שלא שמרת תלך לאיבוד… + + + + LXQt Session Shutdown + כיבוי של LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + לכבות את המחשב? כל העבודה שלא שמרת תלך לאיבוד… + + + + LXQt Session Logout + יציאה מהפעלה של LXQt + + + + Do you want to really logout? All unsaved work will be lost... + לצאת מהמערכת? כל העבודה שלא שמרת תלך לאיבוד… + + + + + LXQt Power Manager Error + שגיאה במנהל צריכת החשמל של LXQt + + + + Hibernate failed. + התרדמת נכשלה. + + + + Suspend failed. + ההשהיה נכשלה. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + ההרצה של „%1” נכשלה. נא לוודא שמותקן ומופעל במחשב נועל/שומר המסך תואם ל־xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + ההרצה של „%1” נכשלה. נא לוודא שנועל/שומר המסך מותקן ופעיל. + + + + Lock Screen + נעילת המסך + + + + Screen Saver Error + שגיאת שומר מסך + + + + QCoreApplication + + + Choose the page to be shown. + נא לבחור את העמוד להצגה. + + + + QObject + + + + Power Manager Error + שגיאה במנהל צריכת חשמל + + + + + QDBusInterface is invalid + QDBusInterface שגוי + + + + + Power Manager Error (D-BUS call) + שגיאת מנהל צריכת חשמל (קריאת D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_hr.ts b/LibLXQT/translations/liblxqt_hr.ts new file mode 100644 index 0000000000..9fdf0c68be --- /dev/null +++ b/LibLXQT/translations/liblxqt_hr.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dijalog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Greška LXQt upravljanja energijom + + + + Hibernate failed. + Stanje mirovanja neuspjelo. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Rezervne obavijesti + + + + LXQt::PowerManager + + + Hibernate + Stanje mirovanja + + + + Suspend + Pripravno stanje + + + + Reboot + Ponovno pokretanje + + + + Shutdown + Isključi računalo + + + + Logout + Odjava + + + + LXQt Session Suspend + LXQt sesija – pripravno stanje + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Stvarno želiš postaviti računalo u pripravno stanje?<p>Računalo se postavlja u stanje male potrošnje energije. Stanje sustava se gubi, ako nestane struje. + + + + LXQt Session Hibernate + LXQt sesija – stanje mirovanja + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Stvarno želiš postaviti računalo u stanje mirovanja?<p>Računalo se postavlja u stanje male potrošnje energije. Stanje sustava se gubi, ako nestane struje. + + + + LXQt Session Reboot + LXQt sesija – ponovno pokretanje + + + + Do you want to really restart your computer? All unsaved work will be lost... + Stvarno želiš ponovo pokrenuti računalo? Izgubit češ sve nespremljene radove … + + + + LXQt Session Shutdown + LXQt sesija – isključivanje računala + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Stvarno želiš isključiti računalo? Izgubit češ sve nespremljene radove … + + + + LXQt Session Logout + LXQt sesija – odjava + + + + Do you want to really logout? All unsaved work will be lost... + Stvarno se želiš odjaviti? Izgubit češ sve nespremljene radove … + + + + + LXQt Power Manager Error + LXQt upravljanja energijom – greška + + + + Hibernate failed. + Stanje mirovanja neuspjelo. + + + + Suspend failed. + Pripravno stanje neuspjelo. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nije bilo moguće pokrenuti „%1”. Uvjeri se da je modul za zaključavanje/zaštitu ekrana (kompatibilan s xdg-screensaver) instaliran i pokrenut. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nije bilo moguće pokrenuti „%1”. Uvjeri se da je modul za zaključavanje/zaštitu ekrana instaliran i pokrenut. + + + + Lock Screen + Zaključaj ekran + + + + Screen Saver Error + Greška zaštite ekrana + + + + QCoreApplication + + + Choose the page to be shown. + Odaberi stranicu za prikaz. + + + + QObject + + + + Power Manager Error + Greška upravljanja energijom + + + + + QDBusInterface is invalid + QDBusInterface je neispravan + + + + + Power Manager Error (D-BUS call) + Greška upravljanja energijom (D-BUS pozivanje) + + + diff --git a/LibLXQT/translations/liblxqt_hu.ts b/LibLXQT/translations/liblxqt_hu.ts new file mode 100644 index 0000000000..02a86fbcdb --- /dev/null +++ b/LibLXQT/translations/liblxqt_hu.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Párbeszédpanel + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt energiakezelő hiba + + + + Hibernate failed. + A hibernálás sikertelen. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Tartalék értesítések + + + + LXQt::PowerManager + + + Hibernate + Hibernálás + + + + Suspend + Készenlét + + + + Reboot + Újraindítás + + + + Shutdown + Leállítás + + + + Logout + Kijelentkezés + + + + LXQt Session Suspend + Készenlét + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Biztos készenléti állapotba szeretné helyezni a számítógépet?<p>A rendszer állapotát nem lehet megőrizni áramkimaradáskor. + + + + LXQt Session Hibernate + Hibernálás + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Biztos hibernálni szeretné a számítógépet?<p>Áramkimaradáskor a rendszer állapota megmarad. + + + + LXQt Session Reboot + Újraindítás + + + + Do you want to really restart your computer? All unsaved work will be lost... + Biztos újra szeretné indítani a számítógépet? Minden mentetlen munka elvész... + + + + LXQt Session Shutdown + Leállítás + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Biztos le szeretné állítani a számítógépet? Minden mentetlen munka elvész... + + + + LXQt Session Logout + Kijelentkezés + + + + Do you want to really logout? All unsaved work will be lost... + Biztos ki szeretne jelentkezni? Minden mentetlen munka elvész... + + + + + LXQt Power Manager Error + LXQt energiakezelő hiba + + + + Hibernate failed. + A hibernálás sikertelen. + + + + Suspend failed. + A készenlét sikertelen. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nem sikerült elindítani: "%1". Győződjön meg arról, hogy telepítve van és fut egy xdg-screensaver kompatibilis zároló/képernyővédő. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nem sikerült futtatni: "%1". Győződjön meg róla, hogy a megfelelő zároló alkalmazás/képernyővédő telepítve van és fut. + + + + Lock Screen + Zárolás + + + + Screen Saver Error + Képernyővédő hiba + + + + QCoreApplication + + + Choose the page to be shown. + Megjelenítendő oldal kiválasztása. + + + + QObject + + + + Power Manager Error + Energiakezelő hiba + + + + + QDBusInterface is invalid + A QDBusInterface érvénytelen + + + + + Power Manager Error (D-BUS call) + Energiakezelő hiba (D-BUS hívás) + + + diff --git a/LibLXQT/translations/liblxqt_ia.ts b/LibLXQT/translations/liblxqt_ia.ts new file mode 100644 index 0000000000..8ec34949aa --- /dev/null +++ b/LibLXQT/translations/liblxqt_ia.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_id.ts b/LibLXQT/translations/liblxqt_id.ts new file mode 100644 index 0000000000..c7a7c71fa7 --- /dev/null +++ b/LibLXQT/translations/liblxqt_id.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Kesalahan Manajer Daya LXQt + + + + Hibernate failed. + Hibernasi gagal. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Fallback Notifikasi + + + + LXQt::PowerManager + + + Hibernate + Hibernasi + + + + Suspend + Suspensi + + + + Reboot + Muat ulang + + + + Shutdown + Matikan + + + + Logout + Keluar + + + + LXQt Session Suspend + Suspensi Sesi LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Apakah Anda ingin mensuspensi komputer Anda?<p>Suspensi komputer ke kondisi daya rendah. Kondisi sistem tidak disimpan jika daya hilang. + + + + LXQt Session Hibernate + Hibernasi Sesi LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Apakah Anda ingin menghibernasi komputer Anda?<p>Hibernasi kompeter ke kondisi daya rendah. Kondisi sistem akan disimpan jika daya hilang. + + + + LXQt Session Reboot + Jalankan Ulang Sesi LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Apakah Anda ingin menjalankan ulang komputer? Semua pekerjaan yang belum disimpan akan hilang.... + + + + LXQt Session Shutdown + Matikan Sesi LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Apakah Anda ingin mematikan komputer? Semua pekerjaan yang belum disimpan akan hilang.... + + + + LXQt Session Logout + Keluar Sesi LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Apakah Anda ingin keluar? Semua pekerjaan yang belum disimpan akan hilang... + + + + + LXQt Power Manager Error + Kesalahan Manajer Daya LXQt + + + + Hibernate failed. + Hibernasi gagal. + + + + Suspend failed. + Suspensi gagal. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Gagal untuk menjalankan "%1". Pastikan Anda memiliki sebuah pengunci/screensaver yang kompatibel dengan xdg-screensaver yang terinstall dan dijalankan. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Gagal untuk menjalankan "%1". Pastikan pengunci/screensaver yang ditentukan telah terpasang dan bekerja. + + + + Lock Screen + Kunci Layar + + + + Screen Saver Error + Kesalahan Screen Saver + + + + QCoreApplication + + + Choose the page to be shown. + Pilih halaman yang akan ditampilkan. + + + + QObject + + + + Power Manager Error + Kesalahan Manajer Daya + + + + + QDBusInterface is invalid + QDBusInterface tidak valid + + + + + Power Manager Error (D-BUS call) + Kesalahan Manajer Daya (D-BUS call) + + + diff --git a/LibLXQT/translations/liblxqt_it.ts b/LibLXQT/translations/liblxqt_it.ts new file mode 100644 index 0000000000..9640dd4a19 --- /dev/null +++ b/LibLXQT/translations/liblxqt_it.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Finestra + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Errore del gestore energetico di LXQt + + + + Hibernate failed. + L'ibernazione non è riuscita. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Notifiche di ripiego + + + + LXQt::PowerManager + + + Hibernate + Ibernazione + + + + Suspend + Sospensione + + + + Reboot + Riavvia + + + + Shutdown + Spegni + + + + Logout + Esci + + + + LXQt Session Suspend + Sospendi la sessione di LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Vuoi davvero sospendere il computer?<p>Sospende il computer in uno stato a minore consumo energetico. Lo stato del sistema non viene preservato se la batteria si esaurisce o il pc non è collegato all'alimentazione. + + + + LXQt Session Hibernate + Iberna la sessione di LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Vuoi davvero ibernare il computer?<p>Iberna il computer in uno stato a minore consumo energetico. Lo stato del sistema viene preservato se la batteria si esaurisce o il pc non è collegato all'alimentazione. + + + + LXQt Session Reboot + Riavvia la sessione di LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Vuoi davvero riavviare il computer? Tutto il lavoro non salvato sarà perso... + + + + LXQt Session Shutdown + Spegnimento dalla sessione di LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Vuoi davvero spegnere il computer? Tutto il lavoro non salvato sarà perso... + + + + LXQt Session Logout + Uscita dalla sessione di LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Vuoi davvero chiudere la sessione? Tutto il lavoro non salvato verrà perso... + + + + + LXQt Power Manager Error + Errore del gestore energetico di LXQt + + + + Hibernate failed. + L'ibernazione non è riuscita. + + + + Suspend failed. + La sospensione non è riuscita. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Impossibile eseguire "%1". Assicurati che un salva/blocca-schermo compatibile con xdg-screensaver sia installato e in esecuzione. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Impossibile eseguire "%1". Assicurati che lo salvaschermo impostato sia installato ed in esecuzione. + + + + Lock Screen + Blocca schermo + + + + Screen Saver Error + Errore salvaschermo + + + + QCoreApplication + + + Choose the page to be shown. + Seleziona la pagina da mostrare. + + + + QObject + + + + Power Manager Error + Errore del gestore dell'energia + + + + + QDBusInterface is invalid + QDBusInterface non è valida + + + + + Power Manager Error (D-BUS call) + Errore del gestore dell'energia (chiamata D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_ja.ts b/LibLXQT/translations/liblxqt_ja.ts new file mode 100644 index 0000000000..a77e26f679 --- /dev/null +++ b/LibLXQT/translations/liblxqt_ja.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + ダイアログ + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt 電源管理のエラー + + + + Hibernate failed. + ハイバネートに失敗しました。 + + + + LXQt::NotificationPrivate + + + Notifications Fallback + 通知のフォールバック + + + + LXQt::PowerManager + + + Hibernate + ハイバネート + + + + Suspend + サスペンド + + + + Reboot + 再起動 + + + + Shutdown + シャットダウン + + + + Logout + ログアウト + + + + LXQt Session Suspend + LXQt セッション サスペンド + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + 本当にコンピューターをサスペンドしますか?<P>コンピューターを低消費電力状態にサスペンドします。電源が失われた場合にはシステムの状態が保持されません。 + + + + LXQt Session Hibernate + LXQt セッション ハイバネート + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + 本当にコンピューターをハイバネートしますか?<P>コンピューターを低消費電力状態で休止します。電源が失われた場合でもシステムの状態が保持されます。 + + + + LXQt Session Reboot + LXQt セッション 再起動 + + + + Do you want to really restart your computer? All unsaved work will be lost... + 本当にコンピューターを再起動しますか? 保存されていない作業は全て失われます... + + + + LXQt Session Shutdown + LXQt セッション シャットダウン + + + + Do you want to really switch off your computer? All unsaved work will be lost... + 本当にコンピューターの電源をオフしますか? 保存されていない作業は全て失われます... + + + + LXQt Session Logout + LXQt セッションのログアウト + + + + Do you want to really logout? All unsaved work will be lost... + 本当にログアウトしますか? 保存されていない作業は全て失われます... + + + + + LXQt Power Manager Error + LXQt 電源管理エラー + + + + Hibernate failed. + ハイバネートに失敗しました。 + + + + Suspend failed. + サスペンドに失敗しました。 + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + "%1" の実行に失敗しました。 xdg-screensaver 互換のロッカーまたはスクリーンセーバーがインストールされ、実行されているか確認して下さい。 + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + "%1" の実行に失敗しました。指定したロッカーまたはスクリーンセーバーがインストールされ、実行されているか確認して下さい。 + + + + Lock Screen + 画面ロック + + + + Screen Saver Error + スクリーンセーバーのエラー + + + + QCoreApplication + + + Choose the page to be shown. + 表示するページを選択して下さい。 + + + + QObject + + + + Power Manager Error + 電源管理のエラー + + + + + QDBusInterface is invalid + QDbusInterface が無効です + + + + + Power Manager Error (D-BUS call) + 電源管理のエラー(D-BUS コール) + + + diff --git a/LibLXQT/translations/liblxqt_ko.ts b/LibLXQT/translations/liblxqt_ko.ts new file mode 100644 index 0000000000..a84eddf8df --- /dev/null +++ b/LibLXQT/translations/liblxqt_ko.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + 대화 상자 + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt 전력 관리 오류 + + + + Hibernate failed. + 잠자기 실패. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + 대비책 알림 + + + + LXQt::PowerManager + + + Hibernate + 잠자기 + + + + Suspend + 대기 + + + + Reboot + 다시 시작 + + + + Shutdown + 끄기 + + + + Logout + 로그아웃 + + + + LXQt Session Suspend + LXQt 세션 대기 + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + 컴퓨터를 대기 상태로 만드실 건가요?<p>컴퓨터를 저전력 상태로 대기시킵니다. 전력을 잃으면 시스템 상태는 보존되지 않습니다. + + + + LXQt Session Hibernate + LXQt 세션 잠자기 + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + 컴퓨터를 잠자기 상태로 만드실 건가요?<p>컴퓨터를 잠자기 상태로 진입시킵니다. 전력을 잃으면 시스템 상태는 보존되지 않습니다. + + + + LXQt Session Reboot + LXQt 세션 다시 시작 + + + + Do you want to really restart your computer? All unsaved work will be lost... + 컴퓨터를 다시 시작하시겠습니다? 저장하지 않은 작업들은 모두 잃게 됩니다... + + + + LXQt Session Shutdown + LXQt 세션 끄기 + + + + Do you want to really switch off your computer? All unsaved work will be lost... + 컴퓨터를 끄시겠습니다? 저장하지 않은 작업들은 모두 잃게 됩니다... + + + + LXQt Session Logout + LXQt 세션 로그아웃 + + + + Do you want to really logout? All unsaved work will be lost... + 로그아웃 하시겠습니다? 저장하지 않은 작업들은 모두 잃게 됩니다... + + + + + LXQt Power Manager Error + LXQt 전력 관리 오류 + + + + Hibernate failed. + 잠자기 실패. + + + + Suspend failed. + 대기 실패. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + "% 1"을 (를) 실행하지 못했습니다. xdg-screensaver와 호환되는 로커 / 스크린 세이버가 설치되어 실행 중인지 확인하십시오. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + "% 1"을 (를) 실행하지 못했습니다. 지정된 사물함 / 스크린 세이버가 설치되어 실행 중인지 확인하십시오. + + + + Lock Screen + 화면 잠금 + + + + Screen Saver Error + 화면 보호기 오류 + + + + QCoreApplication + + + Choose the page to be shown. + 보일 페이지를 선택하세요. + + + + QObject + + + + Power Manager Error + 전력 관리 오류 + + + + + QDBusInterface is invalid + QDBusInterface에 이상이 있습니다 + + + + + Power Manager Error (D-BUS call) + 전력 관리 오류 (D-BUS call) + + + diff --git a/LibLXQT/translations/liblxqt_lt.ts b/LibLXQT/translations/liblxqt_lt.ts new file mode 100644 index 0000000000..6adb412607 --- /dev/null +++ b/LibLXQT/translations/liblxqt_lt.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialogas + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt maitinimo tvarkytuvės klaida + + + + Hibernate failed. + Užmigdymas nepavyko. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Pranešimų surogatas + + + + LXQt::PowerManager + + + Hibernate + Užmigdyti + + + + Suspend + Pristabdyti + + + + Reboot + Paleisti iš naujo + + + + Shutdown + Išjungti + + + + Logout + Atsijungti + + + + LXQt Session Suspend + LXQt seanso pristabdymas + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Ar tikrai norite pristabdyti savo kompiuterį?<p>Pristabdo kompiuterį į mažo energijos naudojimo būseną. Nutrūkus maitinimui, sistemos būsena nėra išsaugoma. + + + + LXQt Session Hibernate + LXQt seanso užmigdymas + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Ar tikrai norite užmigdyti savo kompiuterį?<p>Užmigdo kompiuterį į mažo energijos naudojimo būseną. Nutrūkus maitinimui, sistemos būsena yra išsaugoma. + + + + LXQt Session Reboot + LXQt seanso paleidimas iš naujo + + + + Do you want to really restart your computer? All unsaved work will be lost... + Ar tikrai norite paleisti savo kompiuterį iš naujo? Visas neįrašytas darbas bus prarastas... + + + + LXQt Session Shutdown + LXQt seanso išjungimas + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Ar tikrai norite išjungti savo kompiuterį? Visas neįrašytas darbas bus prarastas... + + + + LXQt Session Logout + LXQt seanso atjungimas + + + + Do you want to really logout? All unsaved work will be lost... + Ar tikrai norite atsijungti? Visas neįrašytas darbas bus prarastas... + + + + + LXQt Power Manager Error + LXQt maitinimo tvarkytuvės klaida + + + + Hibernate failed. + Užmigdymas nepavyko. + + + + Suspend failed. + Pristabdymas nepavyko. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nepavyko paleisti "%1". Įsitikinkite, kad esate įdiegę ir paleidę su xdg-screensaver suderinamą užrakto įrankį/ekrano užsklandą. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nepavyko paleisti "%1". Įsitikinkite, kad nurodytas užrakto įrankis/ekrano užsklanda yra įdiegta ir veikia. + + + + Lock Screen + Užrakinti ekraną + + + + Screen Saver Error + Ekrano užsklandos klaida + + + + QCoreApplication + + + Choose the page to be shown. + Pasirinkite puslapį, kuris bus rodomas. + + + + QObject + + + + Power Manager Error + Maitinimo tvarkytuvės klaida + + + + + QDBusInterface is invalid + QDBusInterface yra netaisyklinga + + + + + Power Manager Error (D-BUS call) + Maitinimo tvarkytuvės klaida (D-BUS iškvieta) + + + diff --git a/LibLXQT/translations/liblxqt_lv.ts b/LibLXQT/translations/liblxqt_lv.ts new file mode 100644 index 0000000000..31d92d9396 --- /dev/null +++ b/LibLXQT/translations/liblxqt_lv.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialogs + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt enerģijas menedžera ķibele + + + + Hibernate failed. + Iemidzināšana neizdevās. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Paziņojumu rezerves variants + + + + LXQt::PowerManager + + + Hibernate + Iemidzināt + + + + Suspend + Aizturēt (suspend) + + + + Reboot + Restartēt + + + + Shutdown + Izslēgt + + + + Logout + Izrakstīties/izlogoties + + + + LXQt Session Suspend + LXQt sesijas gaidrežīms (suspend) + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Vai tiešām vēlies pārslēgt datoru gaidrežīmā?<p>Pārslēdz datoru enerģijas maza patēriņa režīmā. Ja strāva tiks atslēgta, sistēmas stāvoklis nesaglabāsies. + + + + LXQt Session Hibernate + LXQt sesijas iemidzināšana (hibernācija) + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Vai tiešām vēlies iemidzināt/hibernēt datoru?<p>Pārslēdz datoru enerģijas maza patēriņa režīmā. Ja strāva tiks atslēgta, sistēmas stāvoklis saglabāsies. + + + + LXQt Session Reboot + LXQt sesijas restarts + + + + Do you want to really restart your computer? All unsaved work will be lost... + Vai tiešām vēlaties restartēt savu datoru? Viss nesaglabātais darbs tiks zaudēts... + + + + LXQt Session Shutdown + LXQt sesijas izslēgšana + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Vai tiešām vēlaties izslēgt datoru? Visas nesaglabātās izmaiņas tiks zaudētas... + + + + LXQt Session Logout + LXQt sesijas pabeigšana / izrakstīšanās + + + + Do you want to really logout? All unsaved work will be lost... + Vai tiešām vēlaties izrakstīties? Viss nesaglabātais darbs tiks pazaudēts... + + + + + LXQt Power Manager Error + LXQt enerģijas menedžera ķibele + + + + Hibernate failed. + Iemidzināšana neizdevās. + + + + Suspend failed. + Aizturēšana (suspends) neizdevās. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Neizdevās palaist "%1". Pārliecinieties, ka ekrānbloķētājs/ekrānsaudzētājs ir saderīgs ar instalēto un darbojošos xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Neizdevās palaist "%1". Pārliecinieties, ka norādītā ekrānbloķētājs/ekrānsaudzētājs ir uzstādīts un palaists. + + + + Lock Screen + Slēgt ekrānu + + + + Screen Saver Error + Ekrānsaudzēkļa ķibele + + + + QCoreApplication + + + Choose the page to be shown. + Izvēlieties lapu, kas tiks rādīta. + + + + QObject + + + + Power Manager Error + Enerģijas menedžera ķibele + + + + + QDBusInterface is invalid + QDBusInterface nav derīgs + + + + + Power Manager Error (D-BUS call) + Enerģijas menedžera ķibele (D-BUS izsaukums) + + + diff --git a/LibLXQT/translations/liblxqt_nb_NO.ts b/LibLXQT/translations/liblxqt_nb_NO.ts new file mode 100644 index 0000000000..77a550db85 --- /dev/null +++ b/LibLXQT/translations/liblxqt_nb_NO.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt Strømstyringsfeil + + + + Hibernate failed. + Dvale mislyktes. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Reserveløsning for varsler + + + + LXQt::PowerManager + + + Hibernate + Dvale + + + + Suspend + Hvile + + + + Reboot + Omstart + + + + Shutdown + Slå av + + + + Logout + Logg ut + + + + LXQt Session Suspend + LXQt hvile + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Vil du virkelig hvile maskinen?<p>Hviler maskinen. Datamaskinens tilstand kan gå tapt hvis strømmen går. + + + + LXQt Session Hibernate + LXQt dvale + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Vil du virkelig dvale maskinen?<p>Dvaler maskinen. Datamaskinens tilstand går ikke tapt om strømmen går. + + + + LXQt Session Reboot + LXQt omstart + + + + Do you want to really restart your computer? All unsaved work will be lost... + Vil du virkelig omstarte datamaskinen? Alt arbeid som ikke er lagret vil gå tapt... + + + + LXQt Session Shutdown + LXQt slå av + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Vil du virkelig slå av datamaskinen? Alt arbeid som ikke er lagret vil gå tapt... + + + + LXQt Session Logout + LXQt logg ut + + + + Do you want to really logout? All unsaved work will be lost... + Vil du virkelig logge ut? Alt arbeid som ikke er lagret vil gå tapt... + + + + + LXQt Power Manager Error + LXQt Strømstyringsfeil + + + + Hibernate failed. + Dvale mislyktes. + + + + Suspend failed. + Hvile mislyktes. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Mislyktes med å kjøre "%1". Pass på at du har en skjermlåser/-sparer kompatibel med xdg-screensaver installert som kjører. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Mislyktes med å kjøre "%1". Pass på at den nevnte skjermlåseren/-spareren er installert og kjører. + + + + Lock Screen + Lås skjerm + + + + Screen Saver Error + Skjermsparerfeil + + + + QCoreApplication + + + Choose the page to be shown. + Velg siden som skal vises. + + + + QObject + + + + Power Manager Error + Strømstyringsfeil + + + + + QDBusInterface is invalid + QDBusInterface er ugyldig + + + + + Power Manager Error (D-BUS call) + Strømstyringsfeil (D-BUS oppkall) + + + diff --git a/LibLXQT/translations/liblxqt_nl.ts b/LibLXQT/translations/liblxqt_nl.ts new file mode 100644 index 0000000000..73fb5f6418 --- /dev/null +++ b/LibLXQT/translations/liblxqt_nl.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialoogvenster + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Foutmelding van LXQt-energiebeheer + + + + Hibernate failed. + Slaapstand is mislukt. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Reserve-meldingensysteem + + + + LXQt::PowerManager + + + Hibernate + Slaapstand + + + + Suspend + Pauzestand + + + + Reboot + Herstarten + + + + Shutdown + Afsluiten + + + + Logout + Afmelden + + + + LXQt Session Suspend + LXQt-pauzestand + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Weet u zeker dat u uw computer in de pauzestand wilt zetten?<p>De pauzestand zet de computer in een energiespaarstand. Geopende programma's en bestanden worden niet bewaard als de stroomtoevoer wordt onderbroken. + + + + LXQt Session Hibernate + LXQt-slaapstand + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Weet u zeker dat u uw computer in de slaapstand wilt zetten?<p>De slaapstand zet de computer in een energiespaarstand. Geopende programma's en bestanden worden bewaard als de stroomtoevoer wordt onderbroken. + + + + LXQt Session Reboot + LXQt herstarten + + + + Do you want to really restart your computer? All unsaved work will be lost... + Weet u zeker dat u uw computer wilt herstarten? Al uw onopgeslagen werk wordt niet bewaard… + + + + LXQt Session Shutdown + LXQt afsluiten + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Weet u zeker dat u uw computer wilt afsluiten? Al uw onopgeslagen werk wordt niet bewaard… + + + + LXQt Session Logout + LXQt afmelden + + + + Do you want to really logout? All unsaved work will be lost... + Weet u zeker dat u wilt afmelden? Al uw onopgeslagen werk wordt niet bewaard… + + + + + LXQt Power Manager Error + Foutmelding van LXQt-energiebeheer + + + + Hibernate failed. + Slaapstand is mislukt. + + + + Suspend failed. + Pauzestand is mislukt. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + '%1' kan niet worden uitgevoerd. Zorg dat u over een schermbeveiliging beschikt die compatibel is met xdg-screensaver en dat deze actief is. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + '%1" kan niet worden uitgevoerd. Zorg dat de opgegeven schermbeveiliging geïnstalleerd en actief is. + + + + Lock Screen + Scherm vergrendelen + + + + Screen Saver Error + Schermbeveiligingsfout + + + + QCoreApplication + + + Choose the page to be shown. + Kies de te tonen pagina. + + + + QObject + + + + Power Manager Error + Energiebeheerfout + + + + + QDBusInterface is invalid + QDBusInterface is ongeldig + + + + + Power Manager Error (D-BUS call) + Energiebeheerfout (D-BUS-aanroep) + + + diff --git a/LibLXQT/translations/liblxqt_pl.ts b/LibLXQT/translations/liblxqt_pl.ts new file mode 100644 index 0000000000..f026889c69 --- /dev/null +++ b/LibLXQT/translations/liblxqt_pl.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Okno dialogowe + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Błąd zarządzania energią + + + + Hibernate failed. + Hibernacja nie powiodła się. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Rozwiązanie rezerwowe dla powiadomień + + + + LXQt::PowerManager + + + Hibernate + Hibernuj + + + + Suspend + Uśpij + + + + Reboot + Uruchom ponownie + + + + Shutdown + Wyłącz + + + + Logout + Wyloguj + + + + LXQt Session Suspend + Uśpij sesję + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Czy jesteś pewien, że chcesz uśpić swój komputer?<p>Przełącza komputer w stan niskiego poboru prądu. Stan systemu nie jest zabezpieczony przed utratą zasilania. + + + + LXQt Session Hibernate + Hibernuj sesję + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Czy jesteś pewien, że chcesz zahibernować swój komputer?<p>Przełącza komputer w stan niskiego poboru prądu. Stan systemu jest zabezpieczony przed utratą zasilania. + + + + LXQt Session Reboot + Uruchom ponownie + + + + Do you want to really restart your computer? All unsaved work will be lost... + Czy jesteś pewien, że chcesz ponownie uruchomić swój komputer?<p>Cała niezapisana praca zostanie utracona... + + + + LXQt Session Shutdown + Wyłącz + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Czy jesteś pewien, że chcesz wyłączyć swój komputer?<p>Cała niezapisana praca zostanie utracona... + + + + LXQt Session Logout + Wyloguj + + + + Do you want to really logout? All unsaved work will be lost... + Czy jesteś pewien, że chcesz się wylogować?<p>Cała niezapisana praca zostanie utracona... + + + + + LXQt Power Manager Error + Błąd zarządzania energią + + + + Hibernate failed. + Hibernacja nie powiodła się. + + + + Suspend failed. + Uśpienie nie powiodło się. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nie udało się uruchomić "%1". Upewnij się, że masz zainstalowany i uruchomiony ekran blokady lub wygaszacz ekranu kompatybilny z xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nie udało się uruchomić "%1". Upewnij się, że określony ekran blokady lub wygaszacz ekranu jest zainstalowany i uruchomiony. + + + + Lock Screen + Zablokuj ekran + + + + Screen Saver Error + Błąd wygaszacza ekranu + + + + QCoreApplication + + + Choose the page to be shown. + Wybierz stronę do wyświetlenia + + + + QObject + + + + Power Manager Error + Błąd menedżera zasilania + + + + + QDBusInterface is invalid + QDBusInterface jest nieprawidłowy + + + + + Power Manager Error (D-BUS call) + Błąd menedżera zasilania (D-BUS call) + + + diff --git a/LibLXQT/translations/liblxqt_pt.ts b/LibLXQT/translations/liblxqt_pt.ts new file mode 100644 index 0000000000..8236808c14 --- /dev/null +++ b/LibLXQT/translations/liblxqt_pt.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Caixa de diálogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Erro no gestor de energia LXQt + + + + Hibernate failed. + Falha ao hibernar. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Recurso para notificações + + + + LXQt::PowerManager + + + Hibernate + Hibernar + + + + Suspend + Suspender + + + + Reboot + Reiniciar + + + + Shutdown + Desligar + + + + Logout + Sair + + + + LXQt Session Suspend + Suspender sessão LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Tem a certeza de que deseja suspender o computador?<p>A suspensão deixa o computador num estado de baixa energia. O estado do sistema não é preservado se a energia for perdida. + + + + LXQt Session Hibernate + Hibernar sessão LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Tem a certeza de que deseja hibernar o computador?<p>A hibernação deixa o computador num estado de baixa energia. O estado do sistema é preservado se a energia for perdida. + + + + LXQt Session Reboot + Reiniciar sessão LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Tem a certeza de que deseja reiniciar o computador? Todos os trabalhos não guardados serão perdidos... + + + + LXQt Session Shutdown + Desligar sessão LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Tem a certeza de que deseja desligar o computador? Todos os trabalhos não guardados serão perdidos... + + + + LXQt Session Logout + Sair da sessão LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Tem a certeza de que deseja sair da sessão? Todos os trabalhos não guardados serão perdidos... + + + + + LXQt Power Manager Error + Erro no gestor de energia LXQt + + + + Hibernate failed. + Falha ao hibernar. + + + + Suspend failed. + Falha ao suspender. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Falha ao executar "%1". Certifique-se de que instalou e configurou corretamente um protetor de ecrã compatível com xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Falha ao executar "%1". Certifique-se de que instalou e configurou corretamente um protetor de ecrã. + + + + Lock Screen + Bloquear ecrã + + + + Screen Saver Error + Erro de proteção de ecrã + + + + QCoreApplication + + + Choose the page to be shown. + Escolha a página a ser mostrada. + + + + QObject + + + + Power Manager Error + Erro no gestor de energia + + + + + QDBusInterface is invalid + QDBusInterface é inválida + + + + + Power Manager Error (D-BUS call) + Erro no gestor de energia (chamada D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_pt_BR.ts b/LibLXQT/translations/liblxqt_pt_BR.ts new file mode 100644 index 0000000000..65db020b28 --- /dev/null +++ b/LibLXQT/translations/liblxqt_pt_BR.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Diálogo + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Erro no Gerenciador de Energia do LXQt + + + + Hibernate failed. + Falha ao hibernar. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Notificações de Contingência + + + + LXQt::PowerManager + + + Hibernate + Hibernar + + + + Suspend + Suspender + + + + Reboot + Reiniciar + + + + Shutdown + Desligar + + + + Logout + Encerrar sessão + + + + LXQt Session Suspend + Suspender sessão do LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Deseja realmente suspender o computador?<p>Suspende o computador em um estado de baixa energia. O estado do sistema não é preservado se a energia for perdida. + + + + LXQt Session Hibernate + Hibernar sessão do LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Deseja realmente hibernar o computador?<p>Hiberna o computador em um estado de baixa energia. O estado do sistema é preservado se a energia for perdida. + + + + LXQt Session Reboot + Reiniciar sessão do LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Deseja realmente reiniciar o computador? Todos os trabalhos não salvos serão perdidos... + + + + LXQt Session Shutdown + Desligar sessão do LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Deseja realmente desligar o computador? Todos os trabalhos não salvos serão perdidos... + + + + LXQt Session Logout + Encerrar sessão do LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Deseja realmente encerrar a sessão? Todos os trabalhos não salvos serão perdidos... + + + + + LXQt Power Manager Error + Erro no Gerenciador de Energia do LXQt + + + + Hibernate failed. + Falha ao hibernar. + + + + Suspend failed. + Falha ao suspender. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Falha ao executar "%1". Verifique se você possui um bloqueador/protetor de tela compatível com o xdg-screensaver instalado e em execução. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Falha ao executar "%1". Verifique se o bloqueador/protetor de tela especificado está instalado e funcionando. + + + + Lock Screen + Bloquear tela + + + + Screen Saver Error + Erro no Protetor de Tela + + + + QCoreApplication + + + Choose the page to be shown. + Escolha a página a ser exibida. + + + + QObject + + + + Power Manager Error + Erro no gerenciamento de energia + + + + + QDBusInterface is invalid + QDBusInterface é inválida + + + + + Power Manager Error (D-BUS call) + Erro no gerenciamento de energia (chamada D-Bus) + + + diff --git a/LibLXQT/translations/liblxqt_ro_RO.ts b/LibLXQT/translations/liblxqt_ro_RO.ts new file mode 100644 index 0000000000..43e726d37c --- /dev/null +++ b/LibLXQT/translations/liblxqt_ro_RO.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Eroare gestiune alimentare LXQt + + + + Hibernate failed. + Hibernarea a eșuat. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + Hibernare + + + + Suspend + Suspendare + + + + Reboot + Repornire + + + + Shutdown + Oprire + + + + Logout + Ieșire + + + + LXQt Session Suspend + Sesiune LXQt - suspendare + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Doriți să suspendați calculatorul?<p>Suspendă calculatorul într-o stare cu consum minim de energie. Starea sistemului nu va fi păstrată dacă se întrerupe alimentarea. + + + + LXQt Session Hibernate + Sesiune LXQt - hibernare + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Doriți să treceți calculatorul în stare de hibernare?<p>Calculatorul va trece într-o stare cu consum minim de energie. Starea sistemului va fi păstrată și dacă se întrerupe alimentarea. + + + + LXQt Session Reboot + Sesiune LXQt - repornire + + + + Do you want to really restart your computer? All unsaved work will be lost... + Doriți să reporniți calculatorul? Tot ce nu ați salvat se va pierde... + + + + LXQt Session Shutdown + Sesiune LXQt - oprire + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Doriți să opriți calculatorul? Tot ce nu ați salvat se va pierde... + + + + LXQt Session Logout + Sesiune LXQt - ieșire + + + + Do you want to really logout? All unsaved work will be lost... + Doriți să ieșiți din sesiune? Tot ce nu ați salvat se va pierde... + + + + + LXQt Power Manager Error + Eroare gestiune alimentare LXQt + + + + Hibernate failed. + Hibernarea a eșuat. + + + + Suspend failed. + Suspendarea a eșuat. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Blochează ecranul + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + Alege pagina ce trebuie afișată. + + + + QObject + + + + Power Manager Error + Eroare gestiune alimentare + + + + + QDBusInterface is invalid + QDBusInterface este incorect + + + + + Power Manager Error (D-BUS call) + Eroare gestiune alimentare (apel D-Bus) + + + diff --git a/LibLXQT/translations/liblxqt_ru.ts b/LibLXQT/translations/liblxqt_ru.ts new file mode 100644 index 0000000000..1b69fd5fa9 --- /dev/null +++ b/LibLXQT/translations/liblxqt_ru.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Диалог + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Ошибка управления энергопотреблением LXQt + + + + Hibernate failed. + Ошибка перехода в спящий режим. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Резервный вариант уведомлений + + + + LXQt::PowerManager + + + Hibernate + Спящий режим + + + + Suspend + Ждущий режим + + + + Reboot + Перезагрузить + + + + Shutdown + Выключить компьютер + + + + Logout + Завершить сеанс + + + + LXQt Session Suspend + Ждущий режим сеанса LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Перевести компьютер в ждущий режим?<p>Переводит компьютер в режим низкого энергопотребления. В случае отключения питания состояние системы будет потеряно. + + + + LXQt Session Hibernate + Спящий режим сеанса LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Перевести компьютер в спящий режим?<p>Переводит компьютер в режим низкого энергопотребления. Состояние системы будет сохранено при отключении питания. + + + + LXQt Session Reboot + Перезагрузка сеанса LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Перезагрузить компьютер? Все несохранённые изменения в документах будут потеряны... + + + + LXQt Session Shutdown + Выключение сеанса LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Выключить компьютер? Все несохранённые изменения в документах будут потеряны... + + + + LXQt Session Logout + Завершение сеанса LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Завершить сеанс? Все несохранённые изменения в документах будут потеряны... + + + + + LXQt Power Manager Error + Ошибка управления энергопотреблением LXQt + + + + Hibernate failed. + Ошибка перехода в спящий режим. + + + + Suspend failed. + Ошибка перехода в ждущий режим. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Не удалось запустить «%1». Убедитесь, что блокировщик/хранитель экрана совместим с установленным и запускаемым xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Не удалось запустить «%1». Убедитесь, что указанный блокировщик/хранитель экрана установлен и корректно запускается. + + + + Lock Screen + Заблокировать экран + + + + Screen Saver Error + Ошибка хранителя экрана + + + + QCoreApplication + + + Choose the page to be shown. + Выберите страницу, которая будет показана. + + + + QObject + + + + Power Manager Error + Ошибка управления энергопотреблением + + + + + QDBusInterface is invalid + Неправильный интерфейс доступа к шине DBus + + + + + Power Manager Error (D-BUS call) + Ошибка управления энергопотреблением (вызов D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_si.ts b/LibLXQT/translations/liblxqt_si.ts new file mode 100644 index 0000000000..d5a1240ce6 --- /dev/null +++ b/LibLXQT/translations/liblxqt_si.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + + + + + LXQt::MessageBox + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + + + + + Suspend + + + + + Reboot + + + + + Shutdown + + + + + Logout + + + + + LXQt Session Suspend + + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + + + + + LXQt Session Hibernate + + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + + + + + LXQt Session Reboot + + + + + Do you want to really restart your computer? All unsaved work will be lost... + + + + + LXQt Session Shutdown + + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + + + + + Hibernate failed. + + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_sk_SK.ts b/LibLXQT/translations/liblxqt_sk_SK.ts new file mode 100644 index 0000000000..bd335c0001 --- /dev/null +++ b/LibLXQT/translations/liblxqt_sk_SK.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialóg + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Chyba správcu napájania LXQt + + + + Hibernate failed. + Hibernácia sa nepodarila. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Náhradné oznámenia + + + + LXQt::PowerManager + + + Hibernate + Hibernovať + + + + Suspend + Úsporný režim + + + + Reboot + Reštartovať + + + + Shutdown + Vypnúť + + + + Logout + Odhlásiť sa + + + + LXQt Session Suspend + Úsporný režim relácie LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Skutočne chcete svoj počítač uviesť do úsporného režimu?<p>Uvedie počítač do stavu s nízkym odberom prúdu. Stav systému sa pri strate napájania nezachová. + + + + LXQt Session Hibernate + Hibernácia relácie LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Skutočne chcete svoj počítač hibernovať?<p>Uvedie počítač do stavu s nízkym odberom prúdu. Stav systému sa pri strate napájania zachová. + + + + LXQt Session Reboot + Reštart relácie LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Skutočne chcete svoj počítač reštartovať? Akákoľvek neuložená práca sa stratí... + + + + LXQt Session Shutdown + Vypnutie relácie LXQt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Skutočne chcete svoj počítač vypnúť? Akákoľvek neuložená práca sa stratí... + + + + LXQt Session Logout + Odhlásenie relácie LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Skutočne sa chcete odhlásiť z vášho počítača? Akákoľvek neuložená práca sa stratí... + + + + + LXQt Power Manager Error + Chyba správcu napájania LXQt + + + + Hibernate failed. + Hibernácia sa nepodarila. + + + + Suspend failed. + Uvedenie do úsporného režimu sa nepodarilo. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Nepodarilo sa spustiť„%1“. Zaistite, aby bol nainštalovaný nástroj na zamykanie/šetrič obrazovky, kompatibilný so špecifikáciou xdg-screensaver a bol aj spustený. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Nepodarilo sa spustiť „%1“. Zaistite, aby bol nainštalovaný a spustený príslušný nástroj pre zamykanie / šetrič obrazovky. + + + + Lock Screen + Zamknúť obrazovku + + + + Screen Saver Error + Chyba šetriča obrazovky + + + + QCoreApplication + + + Choose the page to be shown. + Vyberte si stránku na zobrazenie. + + + + QObject + + + + Power Manager Error + Chyba správcu napájania + + + + + QDBusInterface is invalid + QDBusInterface je nepoužiteľné + + + + + Power Manager Error (D-BUS call) + Chyba správcu napájania (volanie D-Bus) + + + diff --git a/LibLXQT/translations/liblxqt_sl.ts b/LibLXQT/translations/liblxqt_sl.ts new file mode 100644 index 0000000000..b3aa4b0f60 --- /dev/null +++ b/LibLXQT/translations/liblxqt_sl.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Pogovorno okno + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Napaka upravljalnika energije + + + + Hibernate failed. + Prehod v mirovanje ni uspel. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Zasilen prikaz obvestil + + + + LXQt::PowerManager + + + Hibernate + Mirovanje + + + + Suspend + V pripravljenost + + + + Reboot + Znova zaženi + + + + Shutdown + Izklopi + + + + Logout + Odjavi + + + + LXQt Session Suspend + Seja v pripravljenost + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Ali res želite v stanje pripravljenosti?<p>Računalnik gre v stanje nizke porabe energije. Morebitni odprti programi se v primeru izpada elektrike zaprejo. + + + + LXQt Session Hibernate + Seja v mirovanje + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Ali res želite računalnik preklopiti v stanje mirovanja?<p>Računalnik gre v stanje nizke porabe energije. Morebitni odprti programi se v primeru izpada elektrike ne zaprejo. + + + + LXQt Session Reboot + Ponovni zagon seje + + + + Do you want to really restart your computer? All unsaved work will be lost... + Ali res želite znova zagnati računalnik? Vse neshranjeno delo bo izgubljeno. + + + + LXQt Session Shutdown + Izklop seje + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Ali res želite izklopiti računalnik? Vse neshranjeno delo bo izgubljeno. + + + + LXQt Session Logout + Odjava seje + + + + Do you want to really logout? All unsaved work will be lost... + Ali se res želite odjaviti? Vse neshranjeno delo bo izgubljeno. + + + + + LXQt Power Manager Error + Napaka upravljalnika energije + + + + Hibernate failed. + Prehod v mirovanje ni uspel. + + + + Suspend failed. + Prehod v pripravljenost ni uspel. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Napaka pri zaganjanju "%1". Preverite, ali imate nameščen in zagnan ohranjevalnik zaslona, združljiv z xdg-screensaver. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Napaka pri zaganjanju "%1". Preverite, če je ohranjevalnik zaslona nameščen in zagnan. + + + + Lock Screen + Zakleni zaslon + + + + Screen Saver Error + Napaka ohranjevalnika zaslona + + + + QCoreApplication + + + Choose the page to be shown. + Izberite stran, ki bo prikazana. + + + + QObject + + + + Power Manager Error + Napaka upravljalnika energije + + + + + QDBusInterface is invalid + QDBusInterface ni veljaven + + + + + Power Manager Error (D-BUS call) + Napaka upravljalnika energije (klic D-Bus) + + + diff --git a/LibLXQT/translations/liblxqt_sr@latin.ts b/LibLXQT/translations/liblxqt_sr@latin.ts new file mode 100644 index 0000000000..e672e165d2 --- /dev/null +++ b/LibLXQT/translations/liblxqt_sr@latin.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Dialog + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQT Greska sa Upravljacem Napajanja + + + + Hibernate failed. + Hibernacija je neuspesna. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + Hibernacija + + + + Suspend + Obustavi + + + + Reboot + Ponovo Pokretanje + + + + Shutdown + Ugasi + + + + Logout + Odjavi se + + + + LXQt Session Suspend + LXQt sesija obustavljena + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Da li stvarno želite da obustavite računar?<p>Obustavlja računar kada je stanje male energije. Sistemski status nije sačuvan kada nema struje. + + + + LXQt Session Hibernate + LXQt Sesija Hibernacija + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Želite li zaista hibernirati svoj računar?<p>Hibernira računar u stanje male potrošnje. Stanje sistema je sačuvano ako nestane struja. + + + + LXQt Session Reboot + Ponovno pokretanje sesije LXQt + + + + Do you want to really restart your computer? All unsaved work will be lost... + Da li stvarno želite ponovo pokrenuti vas računar? Svi nespremljeni radovi će se izgubiti... + + + + LXQt Session Shutdown + LXQt ugasivanje sesije + + + + Do you want to really switch off your computer? All unsaved work will be lost... + + + + + LXQt Session Logout + + + + + Do you want to really logout? All unsaved work will be lost... + + + + + + LXQt Power Manager Error + LXQT Greska sa Upravljacem Napajanja + + + + Hibernate failed. + Hibernacija je neuspesna. + + + + Suspend failed. + + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_sr_RS.ts b/LibLXQT/translations/liblxqt_sr_RS.ts new file mode 100644 index 0000000000..5ca446b80f --- /dev/null +++ b/LibLXQT/translations/liblxqt_sr_RS.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Дијалог + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Грешка Рејзоровог менаџера напајања + + + + Hibernate failed. + Хибернација није успела. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + + + + + LXQt::PowerManager + + + Hibernate + Хибернирај + + + + Suspend + Суспендуј + + + + Reboot + Поново покрени + + + + Shutdown + Угаси + + + + Logout + Одјави се + + + + LXQt Session Suspend + Суспендовање Рејзорове сесије + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Желите ли заиста да суспендујете ваш рачунар?<p>Ово поставља ваш рачунар у стање смањене потрошње енергије. Стање система није очувано ако дође до нестанка струје. + + + + LXQt Session Hibernate + Хибернација Рејзорове сесије + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Желите ли заиста да хибернирате ваш рачунар?<p>Ово поставља ваш рачунар у стање смањене потрошње енергије. Стање система је очувано ако дође до нестанка струје. + + + + LXQt Session Reboot + Поновно покретање Рејзорове сесије + + + + Do you want to really restart your computer? All unsaved work will be lost... + Желите ли заиста да поново покренете ваш рачунар? Несачуван рад ће бити изгубљен... + + + + LXQt Session Shutdown + Гашење Рејзорове сесије + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Желите ли заиста да угасите ваш рачунар? Несачуван рад ће бити изгубљен... + + + + LXQt Session Logout + Одјава Рејзорове сесије + + + + Do you want to really logout? All unsaved work will be lost... + Желите ли заиста да се одјавите? Несачуван рад ће бити изгубљен... + + + + + LXQt Power Manager Error + Грешка Рејзоровог менаџера напајања + + + + Hibernate failed. + Хибернација није успела. + + + + Suspend failed. + Суспендовање није успело. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + Закључај екран + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + + + + + + QDBusInterface is invalid + + + + + + Power Manager Error (D-BUS call) + + + + diff --git a/LibLXQT/translations/liblxqt_th_TH.ts b/LibLXQT/translations/liblxqt_th_TH.ts new file mode 100644 index 0000000000..b52c3a5235 --- /dev/null +++ b/LibLXQT/translations/liblxqt_th_TH.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + กล่องโต้ตอบ + + + + LXQt::MessageBox + + + LXQt Power Manager Error + โปรแกรมจัดการพลังงานของ LXQt ขัดข้อง + + + + Hibernate failed. + จำศีลเครื่องล้มเหลว + + + + LXQt::NotificationPrivate + + + Notifications Fallback + การเตือนต่างๆ กรณีกันพลาด + + + + LXQt::PowerManager + + + Hibernate + จำศีลเครื่อง + + + + Suspend + พักเครื่อง + + + + Reboot + เริ่มระบบใหม่ + + + + Shutdown + ปิดเครื่อง + + + + Logout + ออกจากระบบ + + + + LXQt Session Suspend + พักการทำงานของ LXQt + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + คุณแน่ใจนะว่า ต้องการพักเครื่อง?<p>การพักเครื่องจะลดการใช้พลังงาน โปรดระวังด้วย หากไฟดับสถานะของระบบจะสูญหาย + + + + LXQt Session Hibernate + จำศีลการทำงานของ LXQt + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + คุณแน่ใจนะ ว่าต้องการจำศีลเครื่อง?<p>การจำศีลเครื่องจะลดการใช้พลังงาน ถึงแม้ว่าไฟดับ สถานะของระบบก็จะถูกรักษาไว้ + + + + LXQt Session Reboot + เริ่มการทำงานของ LXQt ใหม่ + + + + Do you want to really restart your computer? All unsaved work will be lost... + คุณแน่ใจนะ ว่าต้องการเริ่มระบบใหม่? งานที่ไม่ได้บันทึกไว้ทั้งหมดจะสูญหาย + + + + LXQt Session Shutdown + จบการทำงานของ lxqt + + + + Do you want to really switch off your computer? All unsaved work will be lost... + คุณแน่ใจนะ ว่าต้องการปิดเครื่อง? งานที่ไม่ได้บันทึกไว้ทั้งหมดจะสูญหาย + + + + LXQt Session Logout + ออกจากระบบ LXQt + + + + Do you want to really logout? All unsaved work will be lost... + คุณแน่ใจนะว่า ต้องการออกจากระบบ? งานที่ยังไม่ได้บันทึกทั้งหมดจะสูญหาย.. + + + + + LXQt Power Manager Error + โปรแกรมจัดการพลังงานของ LXQt ขัดข้อง + + + + Hibernate failed. + จำศีลเครื่องล้มเหลว + + + + Suspend failed. + พักเครื่องล้มเหลว + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + ล็อคหน้าจอ + + + + Screen Saver Error + + + + + QCoreApplication + + + Choose the page to be shown. + + + + + QObject + + + + Power Manager Error + โปรแกรมจัดการพลังงานขัดข้อง + + + + + QDBusInterface is invalid + เกิดการขัดข้องขณะเริ่มงานโปรแกรมรักษาหน้าจอ การเริ่มงานล้มเหลว ตรวจดูให้แน่ใจว่าคุณได้ติดตั้งและเริ่มงาน xscreensaver แล้ว + + + + + Power Manager Error (D-BUS call) + ตัวจัดการพลังงาน Error (D-BUS call) + + + diff --git a/LibLXQT/translations/liblxqt_tr.ts b/LibLXQT/translations/liblxqt_tr.ts new file mode 100644 index 0000000000..8a69a4ce4d --- /dev/null +++ b/LibLXQT/translations/liblxqt_tr.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Etkileşim + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt Güç Yöneticisi Hatası + + + + Hibernate failed. + Hazırda bekletme başarısız oldu. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Bildirimleri Geri Al + + + + LXQt::PowerManager + + + Hibernate + Hazırda Beklet + + + + Suspend + Askıya Al + + + + Reboot + Yeniden Başlat + + + + Shutdown + Bilgisayarı Kapat + + + + Logout + Oturumdan Çık + + + + LXQt Session Suspend + LXQt Oturumunu Askıya Al + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Bilgisayarınızı askıya almayı gerçekten istiyor musunuz?<p>Bilgisayarı düşük güç tüketiminde askıya alır. Güç biterse sistem durumu korunmaz. + + + + LXQt Session Hibernate + LXQt Oturumunu Hazırda Beklet + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Bilgisayarınızı hazırda bekletmeyi gerçekten istiyor musunuz?<p>Bilgisayarı düşük güç tüketiminde hazırda bekletir. Güç biterse sistem durumu korunur. + + + + LXQt Session Reboot + LXQt Oturumunu Yeniden Başlat + + + + Do you want to really restart your computer? All unsaved work will be lost... + Bilgisayarınızı yeniden başlatmayı gerçekten istiyor musunuz? Kaydedilmemiş veriler kaybolacaktır... + + + + LXQt Session Shutdown + LXQt Oturumunu Kapat + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Bilgisayarınızı kapatmayı gerçekten istiyor musunuz? Kaydedilmemiş veriler kaybolacaktır... + + + + LXQt Session Logout + LXQt Oturumundan Çık + + + + Do you want to really logout? All unsaved work will be lost... + Oturumdan çıkmayı gerçekten istiyor musunuz? Kaydedilmemiş veriler kaybolacaktır... + + + + + LXQt Power Manager Error + LXQt Güç Yöneticisi Hatası + + + + Hibernate failed. + Hazırda bekletme başarısız oldu. + + + + Suspend failed. + Askıya alma başarısız oldu. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + "%1" çalıştırması başarısız. xdg-screensaver ile uyumlu bir kilitleyici/ekran koruyucu yüklediğinizden ve çalıştırdığınızdan emin olunuz. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + "%1" çalıştırma başarısız. Belirli bir kilitleyicinin/ekran koruyucunun yüklendiğinden ve çalıştığından emin olunuz. + + + + Lock Screen + Ekranı Kilitle + + + + Screen Saver Error + Ekran Koruyucu Hatası + + + + QCoreApplication + + + Choose the page to be shown. + Gösterilecek sayfayı seçiniz. + + + + QObject + + + + Power Manager Error + Güç Yöneticisi Hatası + + + + + QDBusInterface is invalid + QDBusInterface geçersiz + + + + + Power Manager Error (D-BUS call) + Güç Yöneticisi Hatası (D-Bus çağrısı) + + + diff --git a/LibLXQT/translations/liblxqt_uk.ts b/LibLXQT/translations/liblxqt_uk.ts new file mode 100644 index 0000000000..7301d77184 --- /dev/null +++ b/LibLXQT/translations/liblxqt_uk.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + Діалог + + + + LXQt::MessageBox + + + LXQt Power Manager Error + Збій менеджера живлення LXQt + + + + Hibernate failed. + Не вдалося приспати. + + + + LXQt::NotificationPrivate + + + Notifications Fallback + Резервне сповіщення + + + + LXQt::PowerManager + + + Hibernate + Приспати + + + + Suspend + Призупинити + + + + Reboot + Перезавантажити + + + + Shutdown + Вимкнути + + + + Logout + Вийти + + + + LXQt Session Suspend + Призупинити комп’ютер + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + Дійсно призупинити комп’ютер?<p>Це переведе його в режим зниженого енергоспоживання. При втраті живлення стан системи не збережеться. + + + + LXQt Session Hibernate + Приспати комп’ютер + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + Дійсно приспати комп’ютер?<p>Це переведе його в режим зниженого енергоспоживання. За втрати живлення стан системи збережеться. + + + + LXQt Session Reboot + Перезавантажити комп’ютер + + + + Do you want to really restart your computer? All unsaved work will be lost... + Дійсно перезавантажити комп’ютер? Усю незбережену роботу буде втрачено... + + + + LXQt Session Shutdown + Вимкнути комп’ютер + + + + Do you want to really switch off your computer? All unsaved work will be lost... + Дійсно вимкнути комп’ютер? Усю незбережену роботу буде втрачено... + + + + LXQt Session Logout + Вийти з сеансу LXQt + + + + Do you want to really logout? All unsaved work will be lost... + Дійсно завершити сеанс? Усю незбережену роботу буде втрачено... + + + + + LXQt Power Manager Error + Збій менеджера живлення LXQt + + + + Hibernate failed. + Не вдалося приспати. + + + + Suspend failed. + Не вдалося призупинити. + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + Не вдалося запустити «%1». Переконайтеся, що встановлено та запущено заставку, сумісну з xdg-заставкою. + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + Не вдалося запустити «%1». Переконайтеся, що вказану заставку встановлено та запущено. + + + + Lock Screen + Заблокувати екран + + + + Screen Saver Error + Помилка зберігача екрана + + + + QCoreApplication + + + Choose the page to be shown. + Виберіть сторінку для показу. + + + + QObject + + + + Power Manager Error + Збій менеджера живлення + + + + + QDBusInterface is invalid + QDBusInterface недійсний + + + + + Power Manager Error (D-BUS call) + Збій менеджера живлення (виклик D-BUS) + + + diff --git a/LibLXQT/translations/liblxqt_zh_CN.ts b/LibLXQT/translations/liblxqt_zh_CN.ts new file mode 100644 index 0000000000..fa991feaa4 --- /dev/null +++ b/LibLXQT/translations/liblxqt_zh_CN.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + 对话框 + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt 电源管理器错误 + + + + Hibernate failed. + 休眠失败。 + + + + LXQt::NotificationPrivate + + + Notifications Fallback + 缺省消息通知 + + + + LXQt::PowerManager + + + Hibernate + 休眠 + + + + Suspend + 挂起 + + + + Reboot + 重启 + + + + Shutdown + 关机 + + + + Logout + 注销 + + + + LXQt Session Suspend + 挂起LXQt会话 + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + 你真的要挂起你的计算机吗?<p>挂起的计算机将进入低功耗状态。 电源丢失后系统状态不会被保存。 + + + + LXQt Session Hibernate + 休眠LXQt会话 + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + 你真的要将你的计算机休眠吗?<p>休眠的计算机将进入低功耗状态。 电源丢失后系统状态不会被保存。 + + + + LXQt Session Reboot + 重启LXQt会话 + + + + Do you want to really restart your computer? All unsaved work will be lost... + 你真的想要重启你的计算机吗? 所有未保存的任务都将丢失…… + + + + LXQt Session Shutdown + 关闭电源 + + + + Do you want to really switch off your computer? All unsaved work will be lost... + 你真的想要关闭你的计算机吗? 所有未保存的任务都将丢失…… + + + + LXQt Session Logout + 注销LXQt会话 + + + + Do you want to really logout? All unsaved work will be lost... + 你真的想要注销你的计算机吗? 所有未保存的任务都将丢失…… + + + + + LXQt Power Manager Error + LXQt 电源管理器错误 + + + + Hibernate failed. + 休眠失败。 + + + + Suspend failed. + 挂起失败。 + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + 运行"%1"失败。确保你已经安装并运行着一个与 xdg-screensaver 适配的屏保或锁屏。 + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + 运行 "%1"失败。请确保指定的锁屏或屏保已经安装并正在运行。 + + + + Lock Screen + 锁屏 + + + + Screen Saver Error + 屏幕保护程序错误 + + + + QCoreApplication + + + Choose the page to be shown. + 选择要显示的页。 + + + + QObject + + + + Power Manager Error + 电源管理错误 + + + + + QDBusInterface is invalid + QDBusInterface 不正确 + + + + + Power Manager Error (D-BUS call) + 电源管理错误 (D-BUS 调用) + + + diff --git a/LibLXQT/translations/liblxqt_zh_TW.ts b/LibLXQT/translations/liblxqt_zh_TW.ts new file mode 100644 index 0000000000..a7e805aafd --- /dev/null +++ b/LibLXQT/translations/liblxqt_zh_TW.ts @@ -0,0 +1,179 @@ + + + + + ConfigDialog + + + Dialog + 對話框 + + + + LXQt::MessageBox + + + LXQt Power Manager Error + LXQt電源管理員錯誤 + + + + Hibernate failed. + 休眠失敗。 + + + + LXQt::NotificationPrivate + + + Notifications Fallback + 後備通知 + + + + LXQt::PowerManager + + + Hibernate + 休眠 + + + + Suspend + 暫停 + + + + Reboot + 重新啟動 + + + + Shutdown + 關機 + + + + Logout + 登出 + + + + LXQt Session Suspend + 暫停LXQt會話 + + + + Do you want to really suspend your computer?<p>Suspends the computer into a low power state. System state is not preserved if the power is lost. + 你確定要讓您的電腦進入暫停模式嗎?<p>暫停主機可以節省耗能。切斷電源後系統狀況也將遺失。 + + + + LXQt Session Hibernate + 休眠LXQt會話 + + + + Do you want to really hibernate your computer?<p>Hibernates the computer into a low power state. System state is preserved if the power is lost. + 您確定要讓電腦進入休眠模式嗎?<p>休眠主機可以節省耗能。切斷電源後系統狀況也將遺失。 + + + + LXQt Session Reboot + 重新啟動LXQt會話 + + + + Do you want to really restart your computer? All unsaved work will be lost... + 您確定要重新啟動您的電腦嗎?所有未儲存工作將會遺失…… + + + + LXQt Session Shutdown + 關閉電源 + + + + Do you want to really switch off your computer? All unsaved work will be lost... + 您確定要關閉您的電腦嗎?所有未儲存工作將會遺失…… + + + + LXQt Session Logout + 登出LXQt會話 + + + + Do you want to really logout? All unsaved work will be lost... + 您確定要登出嗎?所有未儲存工作將會遺失…… + + + + + LXQt Power Manager Error + LXQt電源管理員錯誤 + + + + Hibernate failed. + 休眠失敗。 + + + + Suspend failed. + 暫停失敗。 + + + + LXQt::ScreenSaver + + + Failed to run "%1". Ensure you have a locker/screensaver compatible with xdg-screensaver installed and running. + + + + + Failed to run "%1". Ensure the specified locker/screensaver is installed and running. + + + + + Lock Screen + 螢幕上鎖 + + + + Screen Saver Error + 螢幕保護程式錯誤 + + + + QCoreApplication + + + Choose the page to be shown. + 選擇要顯示的頁面。 + + + + QObject + + + + Power Manager Error + 電源管理錯誤 + + + + + QDBusInterface is invalid + QDBus介面無效 + + + + + Power Manager Error (D-BUS call) + 電源管理錯誤(DBus通知) + + +