diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 513eaeb..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -*.kdev4 diff --git a/CMakeLists.txt b/CMakeLists.txt index dcd4d65..4d3dc45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) project(lxqt-panel) option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) @@ -10,6 +10,17 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(FATAL "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. C++11 support is required") +endif() + macro(setByDefault VAR_NAME VAR_VALUE) if(NOT DEFINED ${VAR_NAME}) set (${VAR_NAME} ${VAR_VALUE}) @@ -23,6 +34,8 @@ if (CMAKE_COMPILER_IS_GNUCXX) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-no-undefined") endif() +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + ######################################################################### add_definitions (-Wall) @@ -30,7 +43,9 @@ include(GNUInstallDirs) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5DBus REQUIRED) @@ -40,30 +55,17 @@ find_package(Qt5X11Extras REQUIRED) find_package(KF5WindowSystem REQUIRED) find_package(lxqt REQUIRED) -find_package(Qt5Xdg REQUIRED QUIET) find_package(lxqt-globalkeys REQUIRED) find_package(lxqt-globalkeys-ui REQUIRED) -include(${LXQT_USE_FILE}) -include(${QTXDG_USE_FILE}) -include(${LXQT_GLOBALKEYS_USE_FILE}) -include(${LXQT_GLOBALKEYS_UI_USE_FILE}) include(LXQtTranslate) -include_directories( - ${LXQT_INCLUDE_DIRS} - ${QTXDG_INCLUDE_DIRS} - ${Qt5X11Extras_INCLUDE_DIRS} -) - # Warning: This must be before add_subdirectory(panel). Move with caution. set(PLUGIN_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/lxqt-panel") add_definitions(-DPLUGIN_DIR=\"${PLUGIN_DIR}\") message(STATUS "Panel plugins location: ${PLUGIN_DIR}") -add_subdirectory(panel) - ######################################################################### # Plugin system @@ -73,17 +75,20 @@ add_subdirectory(panel) include("cmake/BuildPlugin.cmake") -set(ENABLED_PLUGINS) +set(ENABLED_PLUGINS) # list of enabled plugins +set(STATIC_PLUGINS) # list of statically linked plugins setByDefault(CLOCK_PLUGIN Yes) if(CLOCK_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Clock") + list(APPEND STATIC_PLUGINS "clock") + add_definitions(-DWITH_CLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "Clock") add_subdirectory(plugin-clock) endif() setByDefault(COLORPICKER_PLUGIN Yes) if(COLORPICKER_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Color Picker") + list(APPEND ENABLED_PLUGINS "Color Picker") add_subdirectory(plugin-colorpicker) endif() @@ -92,7 +97,7 @@ if(CPULOAD_PLUGIN) find_library(STATGRAB_LIB statgrab) if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Cpu Load") + list(APPEND ENABLED_PLUGINS "Cpu Load") add_subdirectory(plugin-cpuload) else() message(STATUS "") @@ -101,49 +106,57 @@ if(CPULOAD_PLUGIN) endif() endif() -setByDefault(DOM_PLUGIN Yes) +setByDefault(DIRECTORYMENU_PLUGIN Yes) +if(DIRECTORYMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Directory menu") + add_subdirectory(plugin-directorymenu) +endif() + +setByDefault(DOM_PLUGIN No) if(DOM_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "DOM") + list(APPEND ENABLED_PLUGINS "DOM") add_subdirectory(plugin-dom) endif(DOM_PLUGIN) setByDefault(DESKTOPSWITCH_PLUGIN Yes) if(DESKTOPSWITCH_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Desktop Switcher") + list(APPEND STATIC_PLUGINS "desktopswitch") + add_definitions(-DWITH_DESKTOPSWITCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Desktop Switcher") add_subdirectory(plugin-desktopswitch) endif() setByDefault(KBINDICATOR_PLUGIN Yes) if(KBINDICATOR_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Keyboard Indicator") + list(APPEND ENABLED_PLUGINS "Keyboard Indicator") add_subdirectory(plugin-kbindicator) endif(KBINDICATOR_PLUGIN) setByDefault(MAINMENU_PLUGIN Yes) if(MAINMENU_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Application menu") + list(APPEND STATIC_PLUGINS "mainmenu") + add_definitions(-DWITH_MAINMENU_PLUGIN) + list(APPEND ENABLED_PLUGINS "Application menu") add_subdirectory(plugin-mainmenu) endif() setByDefault(MOUNT_PLUGIN Yes) if(MOUNT_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Mount") - - find_package(lxqtmount REQUIRED) - include(${LXQTMOUNT_USE_FILE}) - + list(APPEND ENABLED_PLUGINS "Mount") add_subdirectory(plugin-mount) endif(MOUNT_PLUGIN) setByDefault(QUICKLAUNCH_PLUGIN Yes) if(QUICKLAUNCH_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Quicklaunch") + list(APPEND STATIC_PLUGINS "quicklaunch") + add_definitions(-DWITH_QUICKLAUNCH_PLUGIN) + list(APPEND ENABLED_PLUGINS "Quicklaunch") add_subdirectory(plugin-quicklaunch) endif() setByDefault(SCREENSAVER_PLUGIN Yes) if(SCREENSAVER_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Screensaver") + list(APPEND ENABLED_PLUGINS "Screensaver") add_subdirectory(plugin-screensaver) endif() @@ -152,7 +165,7 @@ if(SENSORS_PLUGIN) find_library(SENSORS_LIB sensors) if(NOT(${SENSORS_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Sensors") + list(APPEND ENABLED_PLUGINS "Sensors") add_subdirectory(plugin-sensors) else() message(STATUS "") @@ -163,7 +176,9 @@ endif() setByDefault(SHOWDESKTOP_PLUGIN Yes) if(SHOWDESKTOP_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Show Desktop") + list(APPEND STATIC_PLUGINS "showdesktop") + add_definitions(-DWITH_SHOWDESKTOP_PLUGIN) + list(APPEND ENABLED_PLUGINS "Show Desktop") add_subdirectory(plugin-showdesktop) endif() @@ -172,7 +187,7 @@ if(NETWORKMONITOR_PLUGIN) find_library(STATGRAB_LIB statgrab) if(NOT(${STATGRAB_LIB} MATCHES "NOTFOUND")) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Network Monitor") + list(APPEND ENABLED_PLUGINS "Network Monitor") add_subdirectory(plugin-networkmonitor) else() message(STATUS "") @@ -183,19 +198,31 @@ endif() setByDefault(SYSSTAT_PLUGIN Yes) if(SYSSTAT_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "System Stats") + list(APPEND ENABLED_PLUGINS "System Stats") add_subdirectory(plugin-sysstat) endif(SYSSTAT_PLUGIN) setByDefault(TASKBAR_PLUGIN Yes) if(TASKBAR_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Taskbar") + list(APPEND STATIC_PLUGINS "taskbar") + add_definitions(-DWITH_TASKBAR_PLUGIN) + list(APPEND ENABLED_PLUGINS "Taskbar") add_subdirectory(plugin-taskbar) endif() +setByDefault(STATUSNOTIFIER_PLUGIN Yes) +if(STATUSNOTIFIER_PLUGIN) + list(APPEND STATIC_PLUGINS "statusnotifier") + add_definitions(-DWITH_STATUSNOTIFIER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Status Notifier") + add_subdirectory(plugin-statusnotifier) +endif() + setByDefault(TRAY_PLUGIN Yes) if(TRAY_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "System Tray") + list(APPEND STATIC_PLUGINS "tray") + add_definitions(-DWITH_TRAY_PLUGIN) + list(APPEND ENABLED_PLUGINS "System Tray") add_subdirectory(plugin-tray) endif() @@ -212,7 +239,7 @@ if(VOLUME_PLUGIN) endif() if(PULSEAUDIO_FOUND OR ALSA_FOUND) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "Volume") + list(APPEND ENABLED_PLUGINS "Volume") message(STATUS "") message(STATUS "Volume plugin will be built") message(STATUS " ALSA: ${ALSA_FOUND}") @@ -230,10 +257,20 @@ endif() setByDefault(WORLDCLOCK_PLUGIN Yes) if(WORLDCLOCK_PLUGIN) - set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "World Clock") + list(APPEND STATIC_PLUGINS "worldclock") + add_definitions(-DWITH_WORLDCLOCK_PLUGIN) + list(APPEND ENABLED_PLUGINS "World Clock") add_subdirectory(plugin-worldclock) endif(WORLDCLOCK_PLUGIN) +setByDefault(SPACER_PLUGIN Yes) +if(SPACER_PLUGIN) + list(APPEND STATIC_PLUGINS "spacer") + add_definitions(-DWITH_SPACER_PLUGIN) + list(APPEND ENABLED_PLUGINS "Spacer") + add_subdirectory(plugin-spacer) +endif() + ######################################################################### message(STATUS "**************** The following plugins will be built ****************") @@ -242,6 +279,8 @@ foreach (PLUGIN_STR ${ENABLED_PLUGINS}) endforeach() message(STATUS "*********************************************************************") +add_subdirectory(panel) + # building tarball with CPack ------------------------------------------------- include(InstallRequiredSystemLibraries) set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION}) diff --git a/cmake/BuildPlugin.cmake b/cmake/BuildPlugin.cmake index cecbf74..a354255 100644 --- a/cmake/BuildPlugin.cmake +++ b/cmake/BuildPlugin.cmake @@ -33,9 +33,6 @@ MACRO (BUILD_LXQT_PLUGIN NAME) set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM}) endif (NOT DEFINED PLUGIN_DIR) - qt5_wrap_cpp(MOC_SOURCES ${MOCS}) - qt5_add_resources(QRC_SOURCES ${RESOURCES}) - qt5_wrap_ui(UI_SOURCES ${UIS}) set(QTX_LIBRARIES Qt5::Widgets) if(QT_USE_QTXML) set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::Xml) @@ -44,10 +41,16 @@ MACRO (BUILD_LXQT_PLUGIN NAME) set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::DBus) endif() - add_library(${NAME} MODULE ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${QRC_SOURCES} ${UIS} ${DESKTOP_FILES}) - target_link_libraries(${NAME} ${QTX_LIBRARIES} ${LXQT_LIBRARIES} ${LIBRARIES} KF5::WindowSystem) + list(FIND STATIC_PLUGINS ${NAME} IS_STATIC) + set(SRC ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES}) + if (${IS_STATIC} EQUAL -1) # not static + add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules + install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file + else() # static + add_library(${NAME} STATIC ${SRC}) # build statically linked lib + endif() + target_link_libraries(${NAME} ${QTX_LIBRARIES} lxqt ${LIBRARIES} KF5::WindowSystem) - install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) install(FILES ${CONFIG_FILES} DESTINATION ${PLUGIN_SHARE_DIR}) install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR}) diff --git a/panel/CMakeLists.txt b/panel/CMakeLists.txt index 1ef3a32..4e23b53 100644 --- a/panel/CMakeLists.txt +++ b/panel/CMakeLists.txt @@ -1,59 +1,54 @@ set(PROJECT lxqt-panel) -set(lxqt-panel_PRIV_H_FILES +set(PRIV_HEADERS + panelpluginsmodel.h lxqtpanel.h lxqtpanelapplication.h lxqtpanellayout.h - lxqtpanelpluginconfigdialog.h - config/configpaneldialog.h plugin.h lxqtpanellimits.h popupmenu.h pluginmoveprocessor.h + lxqtpanelpluginconfigdialog.h + config/configpaneldialog.h + config/configpanelwidget.h + config/configpluginswidget.h + config/addplugindialog.h ) # using LXQt namespace in the public headers. -set(lxqt-panel_PUB_H_FILES +set(PUB_HEADERS lxqtpanelglobals.h ilxqtpanelplugin.h ilxqtpanel.h ) -set(lxqt-panel_CPP_FILES +set(SOURCES main.cpp + panelpluginsmodel.cpp lxqtpanel.cpp lxqtpanelapplication.cpp lxqtpanellayout.cpp - lxqtpanelpluginconfigdialog.cpp - config/configpaneldialog.cpp plugin.cpp popupmenu.cpp pluginmoveprocessor.cpp + lxqtpanelpluginconfigdialog.cpp + config/configpaneldialog.cpp + config/configpanelwidget.cpp + config/configpluginswidget.cpp + config/addplugindialog.cpp ) -set(MOCS - lxqtpanel.h - lxqtpanelapplication.h - lxqtpanellayout.h - lxqtpanelpluginconfigdialog.h - config/configpaneldialog.h - plugin.h - pluginmoveprocessor.h +set(UI + config/configpanelwidget.ui + config/configpluginswidget.ui + config/addplugindialog.ui ) set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} -) - -set(RESOURCES "") - -set(lxqt-panel_UI_FILES - config/configpaneldialog.ui + lxqt ) -qt5_wrap_ui(UI_HEADERS ${lxqt-panel_UI_FILES}) - file(GLOB CONFIG_FILES resources/*.conf) ############################################ @@ -65,36 +60,38 @@ add_definitions(-DPLUGIN_DESKTOPS_DIR=\"${PLUGIN_DESKTOPS_DIR}\") project(${PROJECT}) -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${LXQT_INCLUDE_DIRS} - ${LXQT_INCLUDE_DIRS}/LXQt # FIXME: liblxqt seems to be broken, workaround it. -) - -qt5_wrap_cpp(MOC_SOURCES ${MOCS}) -qt5_wrap_ui(UI_HEADERS ${FORMS}) -qt5_add_resources(QRC_SOURCES ${RESOURCES}) set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus) # Translations -lxqt_translate_ts(lxqt-runner_QM_FILES SOURCES +lxqt_translate_ts(QM_FILES SOURCES UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} SOURCES - ${lxqt-panel_PUB_H_FILES} - ${lxqt-panel_PRIV_H_FILES} - ${lxqt-panel_CPP_FILES} - ${lxqt-panel_UI_FILES} + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${SOURCES} + ${UI} INSTALL_DIR "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}" ) -lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME}) +lxqt_app_translation_loader(SOURCES ${PROJECT_NAME}) +add_executable(${PROJECT} + ${PUB_HEADERS} + ${PRIV_HEADERS} + ${QM_FILES} + ${SOURCES} + ${UI} +) -add_executable(${PROJECT} ${lxqt-panel_PUB_H_FILES} ${lxqt-panel_PRIV_H_FILES} ${lxqt-panel_CPP_FILES} ${MOC_SOURCES} ${lxqt-runner_QM_FILES} ${QRC_SOURCES} ${UI_HEADERS} ${QM_LOADER}) -target_link_libraries(${PROJECT} ${LIBRARIES} ${QTX_LIBRARIES} KF5::WindowSystem) +target_link_libraries(${PROJECT} + ${LIBRARIES} + ${QTX_LIBRARIES} + KF5::WindowSystem + ${STATIC_PLUGINS} +) install(TARGETS ${PROJECT} RUNTIME DESTINATION bin) install(FILES ${CONFIG_FILES} DESTINATION ${LXQT_ETC_XDG_DIR}/lxqt) -install(FILES ${lxqt-panel_PUB_H_FILES} DESTINATION include/lxqt) +install(FILES ${PUB_HEADERS} DESTINATION include/lxqt) diff --git a/panel/config/addplugindialog.cpp b/panel/config/addplugindialog.cpp new file mode 100644 index 0000000..a604601 --- /dev/null +++ b/panel/config/addplugindialog.cpp @@ -0,0 +1,134 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "ui_addplugindialog.h" +#include "addplugindialog.h" +#include "plugin.h" +#include "../lxqtpanelapplication.h" + +#include +#include +#include + +#include +#include +#include +#include + +#define SEARCH_ROLE Qt::UserRole +#define INDEX_ROLE SEARCH_ROLE+1 + +AddPluginDialog::AddPluginDialog(QWidget *parent): + QDialog(parent), + ui(new Ui::AddPluginDialog) +{ + ui->setupUi(this); + + QStringList desktopFilesDirs; + desktopFilesDirs << QString(getenv("LXQT_PANEL_PLUGINS_DIR")).split(':', QString::SkipEmptyParts); + desktopFilesDirs << QString("%1/%2").arg(XdgDirs::dataHome(), "/lxqt/lxqt-panel"); + desktopFilesDirs << PLUGIN_DESKTOPS_DIR; + + mPlugins = LxQt::PluginInfo::search(desktopFilesDirs, QStringLiteral("LxQtPanel/Plugin"), QStringLiteral("*")); + std::sort(mPlugins.begin(), mPlugins.end(), [](const LxQt::PluginInfo &p1, const LxQt::PluginInfo &p2) { + return p1.name() < p2.name() || (p1.name() == p2.name() && p1.comment() < p2.comment()); + }); + + ui->pluginList->setItemDelegate(new LxQt::HtmlDelegate(QSize(32, 32), ui->pluginList)); + ui->pluginList->setContextMenuPolicy(Qt::CustomContextMenu); + + filter(); + + // search + mSearchTimer.setInterval(300); + mSearchTimer.setSingleShot(true); + connect(ui->searchEdit, &QLineEdit::textEdited, + &mSearchTimer, static_cast(&QTimer::start)); + connect(&mSearchTimer, &QTimer::timeout, this, &AddPluginDialog::filter); + connect(ui->pluginList, &QListWidget::doubleClicked, this, &AddPluginDialog::emitPluginSelected); + connect(ui->addButton, &QPushButton::clicked, this, &AddPluginDialog::emitPluginSelected); + + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginAdded + , this, &AddPluginDialog::filter); + connect(dynamic_cast(qApp), &LxQtPanelApplication::pluginRemoved + , this, &AddPluginDialog::filter); +} + +AddPluginDialog::~AddPluginDialog() +{ + delete ui; +} + +void AddPluginDialog::filter() +{ + QListWidget* pluginList = ui->pluginList; + + const int curr_item = 0 < pluginList->count() ? pluginList->currentRow() : 0; + pluginList->clear(); + + static QIcon fallIco = XdgIcon::fromTheme("preferences-plugin"); + + int pluginCount = mPlugins.length(); + for (int i = 0; i < pluginCount; ++i) + { + const LxQt::PluginInfo &plugin = mPlugins.at(i); + + QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(), + plugin.comment(), + plugin.value("Name").toString(), + plugin.value("Comment").toString()); + if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive)) + continue; + + QListWidgetItem* item = new QListWidgetItem(ui->pluginList); + // disable single-instances plugins already in use + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(plugin.id())) + { + item->setFlags(item->flags() & ~Qt::ItemIsEnabled); + item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text)); + item->setText(QStringLiteral("%1
%2
%3") + .arg(plugin.name(), plugin.comment(), tr("(only one instance can run at a time)"))); + } else + item->setText(QStringLiteral("%1
%2").arg(plugin.name(), plugin.comment())); + item->setIcon(plugin.icon(fallIco)); + item->setData(INDEX_ROLE, i); + } + + if (pluginCount > 0) + ui->pluginList->setCurrentRow(curr_item < pluginCount ? curr_item : pluginCount - 1); +} + +void AddPluginDialog::emitPluginSelected() +{ + QListWidget* pluginList = ui->pluginList; + if (pluginList->currentItem() && pluginList->currentItem()->isSelected()) + { + LxQt::PluginInfo plugin = mPlugins.at(pluginList->currentItem()->data(INDEX_ROLE).toInt()); + emit pluginSelected(plugin); + } +} + diff --git a/panel/config/addplugindialog.h b/panel/config/addplugindialog.h new file mode 100644 index 0000000..16f2ba2 --- /dev/null +++ b/panel/config/addplugindialog.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Alexander Sokoloff + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef LXQT_ADDPLUGINDIALOG_H +#define LXQT_ADDPLUGINDIALOG_H + +#include +#include +#include + +#define SEARCH_DELAY 125 + +namespace Ui { + class AddPluginDialog; +} + +class AddPluginDialog : public QDialog +{ + Q_OBJECT + +public: + AddPluginDialog(QWidget *parent = 0); + ~AddPluginDialog(); + +signals: + void pluginSelected(const LxQt::PluginInfo &plugin); + +private: + Ui::AddPluginDialog *ui; + LxQt::PluginInfoList mPlugins; + QTimer mSearchTimer; + +private slots: + void filter(); + void emitPluginSelected(); +}; + +#endif // LXQT_ADDPLUGINDIALOG_H diff --git a/panel/config/addplugindialog.ui b/panel/config/addplugindialog.ui new file mode 100644 index 0000000..57ab441 --- /dev/null +++ b/panel/config/addplugindialog.ui @@ -0,0 +1,144 @@ + + + AddPluginDialog + + + + 0 + 0 + 400 + 359 + + + + Add Plugins + + + + + + + + Search: + + + + + + + + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::Static + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + 0 + + + false + + + true + + + -1 + + + false + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add Widget + + + + + + + Close + + + false + + + true + + + + + + + + + pluginList + addButton + closeButton + searchEdit + + + + + closeButton + clicked() + AddPluginDialog + close() + + + 380 + 279 + + + 118 + 270 + + + + + diff --git a/panel/config/configpaneldialog.cpp b/panel/config/configpaneldialog.cpp index cb34770..32556b2 100644 --- a/panel/config/configpaneldialog.cpp +++ b/panel/config/configpaneldialog.cpp @@ -26,402 +26,33 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "configpaneldialog.h" -#include "ui_configpaneldialog.h" -#include "../lxqtpanel.h" -#include "../lxqtpanellimits.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace LxQt; - -struct ScreenPosition -{ - int screen; - ILxQtPanel::Position position; -}; -Q_DECLARE_METATYPE(ScreenPosition) - - - -/************************************************ - - ************************************************/ -ConfigPanelDialog *ConfigPanelDialog::exec(LxQtPanel *panel) -{ - ConfigPanelDialog *dialog = - panel->findChild(); - - if (!dialog) - { - dialog = new ConfigPanelDialog(panel, panel); - } - - dialog->show(); - dialog->raise(); - dialog->activateWindow(); - WId wid = dialog->windowHandle()->winId(); - - KWindowSystem::activateWindow(wid); - KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); - return dialog; -} - - -/************************************************ - - ************************************************/ ConfigPanelDialog::ConfigPanelDialog(LxQtPanel *panel, QWidget *parent): - LxQt::ConfigDialog(tr("Configure Panel"), panel->settings(), parent) + LxQt::ConfigDialog(tr("Configure Panel"), panel->settings(), parent), + mPanelPage(nullptr), + mPluginsPage(nullptr) { - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_DeleteOnClose); - ConfigPanelWidget* page = new ConfigPanelWidget(panel, this); - addPage(page, tr("Configure Panel")); - connect(this, SIGNAL(reset()), page, SLOT(reset())); - connect(this, SIGNAL(accepted()), panel, SLOT(saveSettings())); -} - - -/************************************************ - - ************************************************/ -ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) : - QWidget(parent), - ui(new Ui::ConfigPanelWidget), - mPanel(panel) -{ - ui->setupUi(this); - - fillComboBox_position(); - fillComboBox_alignment(); - - mOldPanelSize = mPanel->panelSize(); - mOldIconSize = mPanel->iconSize(); - mOldLineCount = mPanel->lineCount(); - - mOldLength = mPanel->length(); - mOldLengthInPercents = mPanel->lengthInPercents(); - - mOldAlignment = mPanel->alignment(); - - mOldScreenNum = mPanel->screenNum(); - mScreenNum = mOldScreenNum; - - mOldPosition = mPanel->position(); - mPosition = mOldPosition; - - ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE); - ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE); - - mOldFontColor = mPanel->fontColor(); - mFontColor = mOldFontColor; - mOldBackgroundColor = mPanel->backgroundColor(); - mBackgroundColor = mOldBackgroundColor; - mOldBackgroundImage = mPanel->backgroundImage(); - mOldOpacity = mPanel->opacity(); + mPanelPage = new ConfigPanelWidget(panel, this); + addPage(mPanelPage, tr("Panel"), QStringLiteral("configure")); + connect(this, &ConfigPanelDialog::reset, mPanelPage, &ConfigPanelWidget::reset); - reset(); + mPluginsPage = new ConfigPluginsWidget(panel, this); + addPage(mPluginsPage, tr("Widgets"), QStringLiteral("preferences-plugin")); + connect(this, &ConfigPanelDialog::reset, mPluginsPage, &ConfigPluginsWidget::reset); - connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - - connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); - connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged())); - - connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged())); - connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged())); - - connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor())); - connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor())); - connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged())); - connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged())); - connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage())); - connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged())); + connect(this, &ConfigPanelDialog::accepted, [panel] { + panel->saveSettings(); + }); } - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::reset() +void ConfigPanelDialog::showConfigPanelPage() { - ui->spinBox_panelSize->setValue(mOldPanelSize); - ui->spinBox_iconSize->setValue(mOldIconSize); - ui->spinBox_lineCount->setValue(mOldLineCount); - - ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition)); - - fillComboBox_alignment(); - ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1); - - ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1); - widthTypeChanged(); - ui->spinBox_length->setValue(mOldLength); - - mFontColor.setNamedColor(mOldFontColor.name()); - ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name())); - mBackgroundColor.setNamedColor(mOldBackgroundColor.name()); - ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name())); - ui->lineEdit_customBgImage->setText(mOldBackgroundImage); - ui->slider_opacity->setValue(mOldOpacity); - - ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid()); - ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid()); - ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists()); - - // update position - positionChanged(); + showPage(mPanelPage); } - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::fillComboBox_position() +void ConfigPanelDialog::showConfigPluginsPage() { - int screenCount = QApplication::desktop()->screenCount(); - if (screenCount == 1) - { - addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop); - addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft); - addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight); - addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom); - } - else - { - for (int screenNum = 0; screenNum < screenCount; screenNum++) - { - if (screenNum) - ui->comboBox_position->insertSeparator(9999); - - addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop); - addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft); - addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight); - addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom); - } - } -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::fillComboBox_alignment() -{ - ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft)); - ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter)); - ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight)); - - - if (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom) - { - ui->comboBox_alignment->setItemText(0, tr("Left")); - ui->comboBox_alignment->setItemText(1, tr("Center")); - ui->comboBox_alignment->setItemText(2, tr("Right")); - } - else - { - ui->comboBox_alignment->setItemText(0, tr("Top")); - ui->comboBox_alignment->setItemText(1, tr("Center")); - ui->comboBox_alignment->setItemText(2, tr("Bottom")); - }; -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position) -{ - if (LxQtPanel::canPlacedOn(screen, position)) - ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position})); -} - - -/************************************************ - - ************************************************/ -int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position) -{ - for (int i = 0; i < ui->comboBox_position->count(); i++) - { - ScreenPosition sp = ui->comboBox_position->itemData(i).value(); - if (screen == sp.screen && position == sp.position) - return i; - } - return -1; -} - - -/************************************************ - - ************************************************/ -ConfigPanelWidget::~ConfigPanelWidget() -{ - delete ui; -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::editChanged() -{ - mPanel->setPanelSize(ui->spinBox_panelSize->value(), true); - mPanel->setIconSize(ui->spinBox_iconSize->value(), true); - mPanel->setLineCount(ui->spinBox_lineCount->value(), true); - - mPanel->setLength(ui->spinBox_length->value(), - ui->comboBox_lenghtType->currentIndex() == 0, - true); - - LxQtPanel::Alignment align = LxQtPanel::Alignment( - ui->comboBox_alignment->itemData( - ui->comboBox_alignment->currentIndex() - ).toInt()); - - mPanel->setAlignment(align, true); - mPanel->setPosition(mScreenNum, mPosition, true); - - mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true); - if (ui->checkBox_customBgColor->isChecked()) - { - mPanel->setBackgroundColor(mBackgroundColor, true); - mPanel->setOpacity(ui->slider_opacity->value(), true); - } - else - { - mPanel->setBackgroundColor(QColor(), true); - mPanel->setOpacity(-1, true); - } - - QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); - mPanel->setBackgroundImage(image, true); -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::widthTypeChanged() -{ - int max = getMaxLength(); - - if (ui->comboBox_lenghtType->currentIndex() == 0) - { - // Percents ............................. - int v = ui->spinBox_length->value() * 100.0 / max; - ui->spinBox_length->setRange(1, 100); - ui->spinBox_length->setValue(v); - } - else - { - // Pixels ............................... - int v = max / 100.0 * ui->spinBox_length->value(); - ui->spinBox_length->setRange(-max, max); - ui->spinBox_length->setValue(v); - } -} - - -/************************************************ - - ************************************************/ -int ConfigPanelWidget::getMaxLength() -{ - QDesktopWidget* dw = QApplication::desktop(); - - if (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom) - return dw->screenGeometry(mScreenNum).width(); - else - return dw->screenGeometry(mScreenNum).height(); -} - - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::positionChanged() -{ - ScreenPosition sp = ui->comboBox_position->itemData( - ui->comboBox_position->currentIndex()).value(); - - bool updateAlig = (sp.position == ILxQtPanel::PositionTop || - sp.position == ILxQtPanel::PositionBottom) != - (mPosition == ILxQtPanel::PositionTop || - mPosition == ILxQtPanel::PositionBottom); - - int oldMax = getMaxLength(); - mPosition = sp.position; - mScreenNum = sp.screen; - int newMax = getMaxLength(); - - if (ui->comboBox_lenghtType->currentIndex() == 1 && - oldMax != newMax) - { - // Pixels ............................... - int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; - ui->spinBox_length->setMaximum(newMax); - ui->spinBox_length->setValue(v); - } - - if (updateAlig) - fillComboBox_alignment(); - - editChanged(); -} - -/************************************************ - * - ************************************************/ -void ConfigPanelWidget::pickFontColor() -{ - QColor newColor = QColorDialog::getColor(QColor(mFontColor.name()), this, tr("Pick color")); - if (newColor.isValid()) - { - mFontColor.setNamedColor(newColor.name()); - ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name())); - editChanged(); - } -} - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::pickBackgroundColor() -{ - QColor newColor = QColorDialog::getColor(QColor(mBackgroundColor.name()), this, tr("Pick color")); - if (newColor.isValid()) - { - mBackgroundColor.setNamedColor(newColor.name()); - ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name())); - editChanged(); - } -} - -/************************************************ - - ************************************************/ -void ConfigPanelWidget::pickBackgroundImage() -{ - QString picturesLocation; - picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); - - QString file = QFileDialog::getOpenFileName(this, - "Pick image", - picturesLocation, - tr("Images (*.png *.gif *.jpg)")); - ui->lineEdit_customBgImage->setText(file); + showPage(mPluginsPage); } diff --git a/panel/config/configpaneldialog.h b/panel/config/configpaneldialog.h index 605e005..52b51a6 100644 --- a/panel/config/configpaneldialog.h +++ b/panel/config/configpaneldialog.h @@ -28,82 +28,25 @@ #ifndef CONFIGPANELDIALOG_H #define CONFIGPANELDIALOG_H +#include "configpanelwidget.h" +#include "configpluginswidget.h" #include "../lxqtpanel.h" -#include -#include -#include - -class LxQtPanel; +#include class ConfigPanelDialog : public LxQt::ConfigDialog -{ - Q_OBJECT -public: - static ConfigPanelDialog *exec(LxQtPanel *panel); - - ConfigPanelDialog(LxQtPanel *panel, QWidget *parent = 0); -}; - -namespace Ui { -class ConfigPanelWidget; -} - -class ConfigPanelWidget : public QWidget { Q_OBJECT public: - explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0); - ~ConfigPanelWidget(); - - int screenNum() const { return mScreenNum; } - ILxQtPanel::Position position() const { return mPosition; } - - -signals: - void changed(); - -public slots: - void reset(); + ConfigPanelDialog(LxQtPanel *panel, QWidget *parent = 0); -private slots: - void editChanged(); - void widthTypeChanged(); - void positionChanged(); - void pickFontColor(); - void pickBackgroundColor(); - void pickBackgroundImage(); + void showConfigPanelPage(); + void showConfigPluginsPage(); private: - Ui::ConfigPanelWidget *ui; - LxQtPanel *mPanel; - int mScreenNum; - ILxQtPanel::Position mPosition; - - void addPosition(const QString& name, int screen, LxQtPanel::Position position); - void fillComboBox_position(); - void fillComboBox_alignment(); - int indexForPosition(int screen, ILxQtPanel::Position position); - int getMaxLength(); - - // new values - QColor mFontColor; - QColor mBackgroundColor; - - // For reset function - int mOldPanelSize; - int mOldIconSize; - int mOldLineCount; - int mOldLength; - bool mOldLengthInPercents; - LxQtPanel::Alignment mOldAlignment; - ILxQtPanel::Position mOldPosition; - int mOldScreenNum; - QColor mOldFontColor; - QColor mOldBackgroundColor; - QString mOldBackgroundImage; - int mOldOpacity; + ConfigPanelWidget *mPanelPage; + ConfigPluginsWidget *mPluginsPage; }; #endif // CONFIGPANELDIALOG_H diff --git a/panel/config/configpaneldialog.ui b/panel/config/configpaneldialog.ui deleted file mode 100644 index f72ca29..0000000 --- a/panel/config/configpaneldialog.ui +++ /dev/null @@ -1,474 +0,0 @@ - - - ConfigPanelWidget - - - - 0 - 0 - 365 - 462 - - - - - 0 - 0 - - - - Configure panel - - - - - - - 0 - 0 - - - - Size - - - false - - - - - - Size: - - - - - - - px - - - 24 - - - - - - - Icon size: - - - - - - - Length: - - - - - - - 1 - - - 20 - - - - - - - px - - - 10 - - - 128 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - - - 1 - - - 100 - - - - - - - - % - - - - - px - - - - - - - - - - - Rows count: - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 20 - - - - - - - - - - - - 0 - 0 - - - - Alignment && position - - - - - - 1 - - - - Left - - - - - Center - - - - - Right - - - - - - - - Alignment: - - - - - - - - - - Position: - - - - - - - - - - - 0 - 0 - - - - Styling - - - - - - Custom font color: - - - - - - - Custom background image: - - - - - - - false - - - - - - - Custom background color: - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 6 - - - 0 - - - - - false - - - Opacity - - - - - - - false - - - 100 - - - 5 - - - 100 - - - Qt::Horizontal - - - - - - - - - - - - - - - checkBox_customBgColor - toggled(bool) - pushButton_customBgColor - setEnabled(bool) - - - 144 - 332 - - - 350 - 350 - - - - - checkBox_customBgImage - toggled(bool) - lineEdit_customBgImage - setEnabled(bool) - - - 137 - 403 - - - 149 - 440 - - - - - checkBox_customBgImage - toggled(bool) - pushButton_customBgImage - setEnabled(bool) - - - 125 - 403 - - - 350 - 441 - - - - - checkBox_customFontColor - toggled(bool) - pushButton_customFontColor - setEnabled(bool) - - - 190 - 294 - - - 350 - 312 - - - - - checkBox_customBgColor - toggled(bool) - slider_opacity - setEnabled(bool) - - - 99 - 333 - - - 114 - 367 - - - - - checkBox_customBgColor - toggled(bool) - label_2 - setEnabled(bool) - - - 34 - 341 - - - 32 - 362 - - - - - diff --git a/panel/config/configpanelwidget.cpp b/panel/config/configpanelwidget.cpp new file mode 100644 index 0000000..e3797e7 --- /dev/null +++ b/panel/config/configpanelwidget.cpp @@ -0,0 +1,394 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpanelwidget.h" +#include "ui_configpanelwidget.h" + +#include "../lxqtpanellimits.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace LxQt; + +struct ScreenPosition +{ + int screen; + ILxQtPanel::Position position; +}; +Q_DECLARE_METATYPE(ScreenPosition) + +ConfigPanelWidget::ConfigPanelWidget(LxQtPanel *panel, QWidget *parent) : + QWidget(parent), + ui(new Ui::ConfigPanelWidget), + mPanel(panel) +{ + ui->setupUi(this); + + fillComboBox_position(); + fillComboBox_alignment(); + + mOldPanelSize = mPanel->panelSize(); + mOldIconSize = mPanel->iconSize(); + mOldLineCount = mPanel->lineCount(); + + mOldLength = mPanel->length(); + mOldLengthInPercents = mPanel->lengthInPercents(); + + mOldAlignment = mPanel->alignment(); + + mOldScreenNum = mPanel->screenNum(); + mScreenNum = mOldScreenNum; + + mOldPosition = mPanel->position(); + mPosition = mOldPosition; + + mOldHidable = mPanel->hidable(); + + ui->spinBox_panelSize->setMinimum(PANEL_MINIMUM_SIZE); + ui->spinBox_panelSize->setMaximum(PANEL_MAXIMUM_SIZE); + + mOldFontColor = mPanel->fontColor(); + mFontColor = mOldFontColor; + mOldBackgroundColor = mPanel->backgroundColor(); + mBackgroundColor = mOldBackgroundColor; + mOldBackgroundImage = mPanel->backgroundImage(); + mOldOpacity = mPanel->opacity(); + + // reset configurations from file + reset(); + + connect(ui->spinBox_panelSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_iconSize, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->spinBox_lineCount, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + + connect(ui->spinBox_length, SIGNAL(valueChanged(int)), this, SLOT(editChanged())); + connect(ui->comboBox_lenghtType, SIGNAL(activated(int)), this, SLOT(widthTypeChanged())); + + connect(ui->comboBox_alignment, SIGNAL(activated(int)), this, SLOT(editChanged())); + connect(ui->comboBox_position, SIGNAL(activated(int)), this, SLOT(positionChanged())); + connect(ui->checkBox_hidable, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + + connect(ui->checkBox_customFontColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customFontColor, SIGNAL(clicked(bool)), this, SLOT(pickFontColor())); + connect(ui->checkBox_customBgColor, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgColor, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundColor())); + connect(ui->checkBox_customBgImage, SIGNAL(toggled(bool)), this, SLOT(editChanged())); + connect(ui->lineEdit_customBgImage, SIGNAL(textChanged(QString)), this, SLOT(editChanged())); + connect(ui->pushButton_customBgImage, SIGNAL(clicked(bool)), this, SLOT(pickBackgroundImage())); + connect(ui->slider_opacity, SIGNAL(sliderReleased()), this, SLOT(editChanged())); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::reset() +{ + ui->spinBox_panelSize->setValue(mOldPanelSize); + ui->spinBox_iconSize->setValue(mOldIconSize); + ui->spinBox_lineCount->setValue(mOldLineCount); + + ui->comboBox_position->setCurrentIndex(indexForPosition(mOldScreenNum, mOldPosition)); + + ui->checkBox_hidable->setChecked(mOldHidable); + + fillComboBox_alignment(); + ui->comboBox_alignment->setCurrentIndex(mOldAlignment + 1); + + ui->comboBox_lenghtType->setCurrentIndex(mOldLengthInPercents ? 0 : 1); + widthTypeChanged(); + ui->spinBox_length->setValue(mOldLength); + + mFontColor.setNamedColor(mOldFontColor.name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mOldFontColor.name())); + mBackgroundColor.setNamedColor(mOldBackgroundColor.name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mOldBackgroundColor.name())); + ui->lineEdit_customBgImage->setText(mOldBackgroundImage); + ui->slider_opacity->setValue(mOldOpacity); + + ui->checkBox_customFontColor->setChecked(mOldFontColor.isValid()); + ui->checkBox_customBgColor->setChecked(mOldBackgroundColor.isValid()); + ui->checkBox_customBgImage->setChecked(QFileInfo(mOldBackgroundImage).exists()); + + // update position + positionChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_position() +{ + int screenCount = QApplication::desktop()->screenCount(); + if (screenCount == 1) + { + addPosition(tr("Top of desktop"), 0, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop"), 0, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop"), 0, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop"), 0, LxQtPanel::PositionBottom); + } + else + { + for (int screenNum = 0; screenNum < screenCount; screenNum++) + { + if (screenNum) + ui->comboBox_position->insertSeparator(9999); + + addPosition(tr("Top of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionTop); + addPosition(tr("Left of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionLeft); + addPosition(tr("Right of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionRight); + addPosition(tr("Bottom of desktop %1").arg(screenNum +1), screenNum, LxQtPanel::PositionBottom); + } + } +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::fillComboBox_alignment() +{ + ui->comboBox_alignment->setItemData(0, QVariant(LxQtPanel::AlignmentLeft)); + ui->comboBox_alignment->setItemData(1, QVariant(LxQtPanel::AlignmentCenter)); + ui->comboBox_alignment->setItemData(2, QVariant(LxQtPanel::AlignmentRight)); + + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + { + ui->comboBox_alignment->setItemText(0, tr("Left")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Right")); + } + else + { + ui->comboBox_alignment->setItemText(0, tr("Top")); + ui->comboBox_alignment->setItemText(1, tr("Center")); + ui->comboBox_alignment->setItemText(2, tr("Bottom")); + }; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::addPosition(const QString& name, int screen, LxQtPanel::Position position) +{ + if (LxQtPanel::canPlacedOn(screen, position)) + ui->comboBox_position->addItem(name, QVariant::fromValue((ScreenPosition){screen, position})); +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::indexForPosition(int screen, ILxQtPanel::Position position) +{ + for (int i = 0; i < ui->comboBox_position->count(); i++) + { + ScreenPosition sp = ui->comboBox_position->itemData(i).value(); + if (screen == sp.screen && position == sp.position) + return i; + } + return -1; +} + + +/************************************************ + * + ************************************************/ +ConfigPanelWidget::~ConfigPanelWidget() +{ + delete ui; +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::editChanged() +{ + mPanel->setPanelSize(ui->spinBox_panelSize->value(), true); + mPanel->setIconSize(ui->spinBox_iconSize->value(), true); + mPanel->setLineCount(ui->spinBox_lineCount->value(), true); + + mPanel->setLength(ui->spinBox_length->value(), + ui->comboBox_lenghtType->currentIndex() == 0, + true); + + LxQtPanel::Alignment align = LxQtPanel::Alignment( + ui->comboBox_alignment->itemData( + ui->comboBox_alignment->currentIndex() + ).toInt()); + + mPanel->setAlignment(align, true); + mPanel->setPosition(mScreenNum, mPosition, true); + mPanel->setHidable(ui->checkBox_hidable->isChecked(), true); + + mPanel->setFontColor(ui->checkBox_customFontColor->isChecked() ? mFontColor : QColor(), true); + if (ui->checkBox_customBgColor->isChecked()) + { + mPanel->setBackgroundColor(mBackgroundColor, true); + mPanel->setOpacity(ui->slider_opacity->value(), true); + } + else + { + mPanel->setBackgroundColor(QColor(), true); + mPanel->setOpacity(100, true); + } + + QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); + mPanel->setBackgroundImage(image, true); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::widthTypeChanged() +{ + int max = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 0) + { + // Percents ............................. + int v = ui->spinBox_length->value() * 100.0 / max; + ui->spinBox_length->setRange(1, 100); + ui->spinBox_length->setValue(v); + } + else + { + // Pixels ............................... + int v = max / 100.0 * ui->spinBox_length->value(); + ui->spinBox_length->setRange(-max, max); + ui->spinBox_length->setValue(v); + } +} + + +/************************************************ + * + ************************************************/ +int ConfigPanelWidget::getMaxLength() +{ + QDesktopWidget* dw = QApplication::desktop(); + + if (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom) + return dw->screenGeometry(mScreenNum).width(); + else + return dw->screenGeometry(mScreenNum).height(); +} + + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::positionChanged() +{ + ScreenPosition sp = ui->comboBox_position->itemData( + ui->comboBox_position->currentIndex()).value(); + + bool updateAlig = (sp.position == ILxQtPanel::PositionTop || + sp.position == ILxQtPanel::PositionBottom) != + (mPosition == ILxQtPanel::PositionTop || + mPosition == ILxQtPanel::PositionBottom); + + int oldMax = getMaxLength(); + mPosition = sp.position; + mScreenNum = sp.screen; + int newMax = getMaxLength(); + + if (ui->comboBox_lenghtType->currentIndex() == 1 && + oldMax != newMax) + { + // Pixels ............................... + int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; + ui->spinBox_length->setMaximum(newMax); + ui->spinBox_length->setValue(v); + } + + if (updateAlig) + fillComboBox_alignment(); + + editChanged(); +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickFontColor() +{ + QColorDialog d(QColor(mFontColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mFontColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customFontColor->setStyleSheet(QString("background: %1").arg(mFontColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundColor() +{ + QColorDialog d(QColor(mBackgroundColor.name()), this); + d.setWindowTitle(tr("Pick color")); + d.setWindowModality(Qt::WindowModal); + if (d.exec() && d.currentColor().isValid()) + { + mBackgroundColor.setNamedColor(d.currentColor().name()); + ui->pushButton_customBgColor->setStyleSheet(QString("background: %1").arg(mBackgroundColor.name())); + editChanged(); + } +} + +/************************************************ + * + ************************************************/ +void ConfigPanelWidget::pickBackgroundImage() +{ + QString picturesLocation; + picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + + QFileDialog* d = new QFileDialog(this, tr("Pick image"), picturesLocation, tr("Images (*.png *.gif *.jpg)")); + d->setAttribute(Qt::WA_DeleteOnClose); + d->setWindowModality(Qt::WindowModal); + connect(d, &QFileDialog::fileSelected, ui->lineEdit_customBgImage, &QLineEdit::setText); + d->show(); +} + diff --git a/panel/config/configpanelwidget.h b/panel/config/configpanelwidget.h new file mode 100644 index 0000000..3849a86 --- /dev/null +++ b/panel/config/configpanelwidget.h @@ -0,0 +1,99 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * + * Copyright: 2010-2011 Razor team + * Authors: + * Marat "Morion" Talipov + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPANELWIDGET_H +#define CONFIGPANELWIDGET_H + +#include "../lxqtpanel.h" +#include +#include +#include + +class LxQtPanel; + +namespace Ui { + class ConfigPanelWidget; +} + +class ConfigPanelWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ConfigPanelWidget(LxQtPanel *panel, QWidget *parent = 0); + ~ConfigPanelWidget(); + + int screenNum() const { return mScreenNum; } + ILxQtPanel::Position position() const { return mPosition; } + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void editChanged(); + void widthTypeChanged(); + void positionChanged(); + void pickFontColor(); + void pickBackgroundColor(); + void pickBackgroundImage(); + +private: + Ui::ConfigPanelWidget *ui; + LxQtPanel *mPanel; + int mScreenNum; + ILxQtPanel::Position mPosition; + + void addPosition(const QString& name, int screen, LxQtPanel::Position position); + void fillComboBox_position(); + void fillComboBox_alignment(); + int indexForPosition(int screen, ILxQtPanel::Position position); + int getMaxLength(); + + // new values + QColor mFontColor; + QColor mBackgroundColor; + + // old values for reset + int mOldPanelSize; + int mOldIconSize; + int mOldLineCount; + int mOldLength; + bool mOldLengthInPercents; + LxQtPanel::Alignment mOldAlignment; + ILxQtPanel::Position mOldPosition; + bool mOldHidable; + int mOldScreenNum; + QColor mOldFontColor; + QColor mOldBackgroundColor; + QString mOldBackgroundImage; + int mOldOpacity; +}; + +#endif diff --git a/panel/config/configpanelwidget.ui b/panel/config/configpanelwidget.ui new file mode 100644 index 0000000..f9abbcf --- /dev/null +++ b/panel/config/configpanelwidget.ui @@ -0,0 +1,619 @@ + + + ConfigPanelWidget + + + + 0 + 0 + 372 + 397 + + + + + 0 + 0 + + + + Configure panel + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Size + + + false + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + + 1 + + + 100 + + + + + + + Size: + + + + + + + Length: + + + + + + + + % + + + + + px + + + + + + + + px + + + 24 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + px + + + 10 + + + 128 + + + + + + + Icon size: + + + + + + + Rows count: + + + + + + + 1 + + + 20 + + + + + + + + + + + + + + 0 + 0 + + + + Alignment && position + + + + + + Position: + + + + + + + + + + Alignment: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + + Left + + + + + Center + + + + + Right + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 15 + 20 + + + + + + + + + 0 + 0 + + + + Auto-hide + + + + + + + + + + + + + + 0 + 0 + + + + Custom styling + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Font color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 5 + 20 + + + + + + + + Background color: + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + 6 + + + 6 + + + + + false + + + Background opacity: + + + + + + + false + + + 100 + + + 5 + + + 100 + + + Qt::Horizontal + + + + + + + + + + false + + + <small>Compositing is required for panel transparency.</small> + + + Qt::AlignCenter + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Background image: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + + + + + false + + + + + + + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + + + + + + + + + checkBox_customBgColor + toggled(bool) + pushButton_customBgColor + setEnabled(bool) + + + 144 + 332 + + + 350 + 350 + + + + + checkBox_customBgImage + toggled(bool) + lineEdit_customBgImage + setEnabled(bool) + + + 137 + 403 + + + 149 + 440 + + + + + checkBox_customBgImage + toggled(bool) + pushButton_customBgImage + setEnabled(bool) + + + 125 + 403 + + + 350 + 441 + + + + + checkBox_customFontColor + toggled(bool) + pushButton_customFontColor + setEnabled(bool) + + + 190 + 294 + + + 350 + 312 + + + + + checkBox_customBgColor + toggled(bool) + slider_opacity + setEnabled(bool) + + + 99 + 333 + + + 114 + 367 + + + + + checkBox_customBgColor + toggled(bool) + label_2 + setEnabled(bool) + + + 34 + 341 + + + 32 + 362 + + + + + checkBox_customBgColor + toggled(bool) + compositingL + setEnabled(bool) + + + diff --git a/panel/config/configpluginswidget.cpp b/panel/config/configpluginswidget.cpp new file mode 100644 index 0000000..cdae414 --- /dev/null +++ b/panel/config/configpluginswidget.cpp @@ -0,0 +1,119 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "configpluginswidget.h" +#include "ui_configpluginswidget.h" +#include "addplugindialog.h" +#include "panelpluginsmodel.h" +#include "../plugin.h" +#include "../ilxqtpanelplugin.h" + +#include +#include +#include + +ConfigPluginsWidget::ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent) : + QWidget(parent), + ui(new Ui::ConfigPluginsWidget), + mPanel(panel) +{ + ui->setupUi(this); + + PanelPluginsModel * plugins = mPanel->mPlugins.data(); + { + QScopedPointer m(ui->listView_plugins->selectionModel()); + ui->listView_plugins->setModel(plugins); + } + { + QScopedPointer d(ui->listView_plugins->itemDelegate()); + ui->listView_plugins->setItemDelegate(new LxQt::HtmlDelegate(QSize(16, 16), ui->listView_plugins)); + } + + resetButtons(); + + connect(ui->listView_plugins, &QListView::activated, plugins, &PanelPluginsModel::onActivatedIndex); + connect(ui->listView_plugins->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &ConfigPluginsWidget::resetButtons); + + connect(ui->pushButton_moveUp, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginUp); + connect(ui->pushButton_moveDown, &QToolButton::clicked, plugins, &PanelPluginsModel::onMovePluginDown); + + connect(ui->pushButton_addPlugin, &QPushButton::clicked, this, &ConfigPluginsWidget::showAddPluginDialog); + connect(ui->pushButton_removePlugin, &QToolButton::clicked, plugins, &PanelPluginsModel::onRemovePlugin); + + connect(ui->pushButton_pluginConfig, &QToolButton::clicked, plugins, &PanelPluginsModel::onConfigurePlugin); + + connect(plugins, &PanelPluginsModel::pluginAdded, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginRemoved, this, &ConfigPluginsWidget::resetButtons); + connect(plugins, &PanelPluginsModel::pluginMoved, this, &ConfigPluginsWidget::resetButtons); +} + +ConfigPluginsWidget::~ConfigPluginsWidget() +{ + delete ui; +} + +void ConfigPluginsWidget::reset() +{ + +} + +void ConfigPluginsWidget::showAddPluginDialog() +{ + if (mAddPluginDialog.isNull()) + { + mAddPluginDialog.reset(new AddPluginDialog); + connect(mAddPluginDialog.data(), &AddPluginDialog::pluginSelected, + mPanel->mPlugins.data(), &PanelPluginsModel::addPlugin); + } + mAddPluginDialog->show(); + mAddPluginDialog->raise(); + mAddPluginDialog->activateWindow(); +} + +void ConfigPluginsWidget::resetButtons() +{ + PanelPluginsModel *model = mPanel->mPlugins.data(); + QItemSelectionModel *selectionModel = ui->listView_plugins->selectionModel(); + bool hasSelection = selectionModel->hasSelection(); + bool isFirstSelected = selectionModel->isSelected(model->index(0)); + bool isLastSelected = selectionModel->isSelected(model->index(model->rowCount() - 1)); + + bool hasConfigDialog = false; + if (hasSelection) + { + Plugin const * plugin + = ui->listView_plugins->model()->data(selectionModel->currentIndex(), Qt::UserRole).value(); + if (nullptr != plugin) + hasConfigDialog = plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::HaveConfigDialog); + } + + ui->pushButton_removePlugin->setEnabled(hasSelection); + ui->pushButton_moveUp->setEnabled(hasSelection && !isFirstSelected); + ui->pushButton_moveDown->setEnabled(hasSelection && !isLastSelected); + ui->pushButton_pluginConfig->setEnabled(hasSelection && hasConfigDialog); +} diff --git a/panel/config/configpluginswidget.h b/panel/config/configpluginswidget.h new file mode 100644 index 0000000..344169f --- /dev/null +++ b/panel/config/configpluginswidget.h @@ -0,0 +1,64 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef CONFIGPLUGINSWIDGET_H +#define CONFIGPLUGINSWIDGET_H + +#include "../lxqtpanel.h" + +#include + +namespace Ui { + class ConfigPluginsWidget; +} +class AddPluginDialog; + +class ConfigPluginsWidget : public QWidget +{ + Q_OBJECT + +public: + ConfigPluginsWidget(LxQtPanel *panel, QWidget* parent = 0); + ~ConfigPluginsWidget(); + +signals: + void changed(); + +public slots: + void reset(); + +private slots: + void showAddPluginDialog(); + void resetButtons(); + +private: + Ui::ConfigPluginsWidget *ui; + QScopedPointer mAddPluginDialog; + LxQtPanel *mPanel; +}; + +#endif diff --git a/panel/config/configpluginswidget.ui b/panel/config/configpluginswidget.ui new file mode 100644 index 0000000..413584c --- /dev/null +++ b/panel/config/configpluginswidget.ui @@ -0,0 +1,213 @@ + + + ConfigPluginsWidget + + + + 0 + 0 + 339 + 220 + + + + Configure Plugins + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QAbstractScrollArea::AdjustToContents + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QListView::TopToBottom + + + QListView::Adjust + + + 0 + + + false + + + true + + + + + + + Note: changes made in this page cannot be reset. + + + true + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Move up + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Move down + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Add + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Remove + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Horizontal + + + + + + + Configure + + + ... + + + + ../../../../../.designer/backup../../../../../.designer/backup + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + diff --git a/panel/ilxqtpanel.h b/panel/ilxqtpanel.h index 39c3e07..a64cb69 100644 --- a/panel/ilxqtpanel.h +++ b/panel/ilxqtpanel.h @@ -72,6 +72,7 @@ public: Helper functions for calculating global screen position of some popup window with windowSize size. If you need to show some popup window, you can use it, to get global screen position for the new window. **/ + virtual QRect calculatePopupWindowPos(const QPoint &absolutePos, const QSize &windowSize) const = 0; virtual QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const = 0; }; diff --git a/panel/ilxqtpanelplugin.h b/panel/ilxqtpanelplugin.h index 683d2a0..cefcf53 100644 --- a/panel/ilxqtpanelplugin.h +++ b/panel/ilxqtpanelplugin.h @@ -81,7 +81,9 @@ public: otherwise plugin prefer left (like main menu). This flag is used only at the first start, later positions of all plugins saved in a config, and this saved information is used. */ - HaveConfigDialog = 2 ///< The plugin have a configuration dialog. + HaveConfigDialog = 2, ///< The plugin have a configuration dialog. + SingleInstance = 4, ///< The plugin allows only one instance to run. + NeedsHandle = 8 ///< The plugin needs a handle for the context menu }; Q_DECLARE_FLAGS(Flags, Flag) @@ -220,7 +222,7 @@ public: /** Returns the root component object of the plugin. When the library is finally unloaded, the root component will automatically be deleted. **/ - virtual ILxQtPanelPlugin* instance(const ILxQtPanelPluginStartupInfo &startupInfo) = 0; + virtual ILxQtPanelPlugin* instance(const ILxQtPanelPluginStartupInfo &startupInfo) const = 0; }; diff --git a/panel/lxqtpanel.cpp b/panel/lxqtpanel.cpp index 9115d12..9b66994 100644 --- a/panel/lxqtpanel.cpp +++ b/panel/lxqtpanel.cpp @@ -34,7 +34,7 @@ #include "config/configpaneldialog.h" #include "popupmenu.h" #include "plugin.h" -#include +#include "panelpluginsmodel.h" #include #include @@ -48,8 +48,14 @@ #include #include -#include -#include +#include +#include + +// Turn on this to show the time required to load each plugin during startup +// #define DEBUG_PLUGIN_LOADTIME +#ifdef DEBUG_PLUGIN_LOADTIME +#include +#endif // Config keys and groups #define CFG_KEY_SCREENNUM "desktop" @@ -65,6 +71,7 @@ #define CFG_KEY_BACKGROUNDIMAGE "background-image" #define CFG_KEY_OPACITY "opacity" #define CFG_KEY_PLUGINS "plugins" +#define CFG_KEY_HIDABLE "hidable" /************************************************ Returns the Position by the string. @@ -108,12 +115,16 @@ QString LxQtPanel::positionToStr(ILxQtPanel::Position position) LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : QFrame(parent), mConfigGroup(configGroup), + mPlugins{nullptr}, mPanelSize(0), mIconSize(0), mLineCount(0), mLength(0), mAlignment(AlignmentLeft), - mPosition(ILxQtPanel::PositionBottom) + mPosition(ILxQtPanel::PositionBottom), + mScreenNum(0), //whatever (avoid conditional on uninitialized value) + mHidable(false), + mHidden(false) { Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; @@ -133,6 +144,7 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : setAttribute(Qt::WA_X11NetWmWindowTypeDock); setAttribute(Qt::WA_AlwaysShowToolTips); setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_AcceptDrops); setWindowTitle("LxQt Panel"); setObjectName(QString("LxQtPanel %1").arg(configGroup)); @@ -140,12 +152,12 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : LxQtPanelWidget = new QFrame(this); LxQtPanelWidget->setObjectName("BackgroundWidget"); QGridLayout* lav = new QGridLayout(); - lav->setContentsMargins(QMargins(0,0,0,0)); + lav->setMargin(0); setLayout(lav); this->layout()->addWidget(LxQtPanelWidget); mLayout = new LxQtPanelLayout(LxQtPanelWidget); - connect(mLayout, SIGNAL(pluginMoved()), this, SLOT(pluginMoved())); + connect(mLayout, &LxQtPanelLayout::pluginMoved, this, &LxQtPanel::pluginMoved); LxQtPanelWidget->setLayout(mLayout); mLayout->setLineCount(mLineCount); @@ -153,7 +165,11 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : mDelaySave.setInterval(SETTINGS_SAVE_DELAY); connect(&mDelaySave, SIGNAL(timeout()), this, SLOT(saveSettings())); - connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(realign())); + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(PANEL_HIDE_DELAY); + connect(&mHideTimer, SIGNAL(timeout()), this, SLOT(hidePanelWork())); + + connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(realign())); connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(ensureVisible())); connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update())); connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign())); @@ -166,8 +182,14 @@ LxQtPanel::LxQtPanel(const QString &configGroup, QWidget *parent) : loadPlugins(); show(); -} + // show it the first first time, despite setting + if (mHidable) + { + showPanel(); + QTimer::singleShot(PANEL_HIDE_FIRST_TIME, this, SLOT(hidePanel())); + } +} /************************************************ @@ -177,6 +199,11 @@ void LxQtPanel::readSettings() // Read settings ...................................... mSettings->beginGroup(mConfigGroup); + // Let Hidability be the first thing we read + // so that every call to realign() is without side-effect + mHidable = mSettings->value(CFG_KEY_HIDABLE, mHidable).toBool(); + mHidden = mHidable; + // By default we are using size & count from theme. setPanelSize(mSettings->value(CFG_KEY_PANELSIZE, PANEL_DEFAULT_SIZE).toInt(), false); setIconSize(mSettings->value(CFG_KEY_ICONSIZE, PANEL_DEFAULT_ICON_SIZE).toInt(), false); @@ -205,7 +232,6 @@ void LxQtPanel::readSettings() if (!image.isEmpty()) setBackgroundImage(image, false); - mSettings->endGroup(); } @@ -222,14 +248,10 @@ void LxQtPanel::saveSettings(bool later) return; } - QStringList pluginsList; - mSettings->beginGroup(mConfigGroup); - foreach (const Plugin *plugin, mPlugins) - pluginsList << plugin->settingsGroup(); - - mSettings->setValue(CFG_KEY_PLUGINS, (pluginsList.isEmpty() ? "" : QVariant(pluginsList))); + //Note: save/load of plugin names is completely handled by mPlugins object + //mSettings->setValue(CFG_KEY_PLUGINS, mPlugins->pluginNames()); mSettings->setValue(CFG_KEY_PANELSIZE, mPanelSize); mSettings->setValue(CFG_KEY_ICONSIZE, mIconSize); @@ -248,6 +270,8 @@ void LxQtPanel::saveSettings(bool later) mSettings->setValue(CFG_KEY_BACKGROUNDIMAGE, QFileInfo(mBackgroundImage).exists() ? mBackgroundImage : QString()); mSettings->setValue(CFG_KEY_OPACITY, mOpacity); + mSettings->setValue(CFG_KEY_HIDABLE, mHidable); + mSettings->endGroup(); } @@ -272,7 +296,6 @@ LxQtPanel::~LxQtPanel() { mLayout->setEnabled(false); // do not save settings because of "user deleted panel" functionality saveSettings(); - qDeleteAll(mPlugins); } @@ -304,82 +327,38 @@ QStringList pluginDesktopDirs() ************************************************/ void LxQtPanel::loadPlugins() { - QStringList desktopDirs = pluginDesktopDirs(); - mSettings->beginGroup(mConfigGroup); - QStringList sections = mSettings->value(CFG_KEY_PLUGINS).toStringList(); - mSettings->endGroup(); - - foreach (QString sect, sections) - { - QString type = mSettings->value(sect+"/type").toString(); - if (type.isEmpty()) - { - qWarning() << QString("Section \"%1\" not found in %2.").arg(sect, mSettings->fileName()); - continue; - } - - LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type)); - if( !list.count()) - { - qWarning() << QString("Plugin \"%1\" not found.").arg(type); - continue; - } - - loadPlugin(list.first(), sect); - } + QString names_key(mConfigGroup); + names_key += '/'; + names_key += QLatin1String(CFG_KEY_PLUGINS); + mPlugins.reset(new PanelPluginsModel(this, names_key, pluginDesktopDirs())); + + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, mLayout, &LxQtPanelLayout::addPlugin); + connect(mPlugins.data(), &PanelPluginsModel::pluginMovedUp, mLayout, &LxQtPanelLayout::moveUpPlugin); + //reemit signals + connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, this, &LxQtPanel::pluginAdded); + connect(mPlugins.data(), &PanelPluginsModel::pluginRemoved, this, &LxQtPanel::pluginRemoved); + + for (auto const & plugin : mPlugins->plugins()) + mLayout->addPlugin(plugin); } - /************************************************ ************************************************/ -Plugin *LxQtPanel::loadPlugin(const LxQt::PluginInfo &desktopFile, const QString &settingsGroup) +int LxQtPanel::getReserveDimension() { - Plugin *plugin = new Plugin(desktopFile, mSettings->fileName(), settingsGroup, this); - if (plugin->isLoaded()) - { - mPlugins.append(plugin); - connect(plugin, SIGNAL(startMove()), mLayout, SLOT(startMovePlugin())); - connect(plugin, SIGNAL(remove()), this, SLOT(removePlugin())); - connect(this, SIGNAL(realigned()), plugin, SLOT(realign())); - mLayout->addWidget(plugin); - return plugin; - } - - delete plugin; - return 0; + return mHidable ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize); } - -/************************************************ - - ************************************************/ -void LxQtPanel::realign() +void LxQtPanel::setPanelGeometry() { - if (!isVisible()) - return; -#if 0 - qDebug() << "** Realign *********************"; - qDebug() << "PanelSize: " << mPanelSize; - qDebug() << "IconSize: " << mIconSize; - qDebug() << "LineCount: " << mLineCount; - qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px"); - qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right")); - qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum; - qDebug() << "Plugins count: " << mPlugins.count(); -#endif - const QRect currentScreen = QApplication::desktop()->screenGeometry(mScreenNum); - QSize size = sizeHint(); QRect rect; if (isHorizontal()) { // Horiz panel *************************** - size.setHeight(mPanelSize); - - // Size ....................... - rect.setHeight(qMax(PANEL_MINIMUM_SIZE, size.height())); + rect.setHeight(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); if (mLengthInPercents) rect.setWidth(currentScreen.width() * mLength / 100.0); else @@ -417,10 +396,7 @@ void LxQtPanel::realign() else { // Vert panel *************************** - size.setWidth(mPanelSize); - - // Size ....................... - rect.setWidth(qMax(PANEL_MINIMUM_SIZE, size.width())); + rect.setWidth(mHidden ? PANEL_HIDE_SIZE : qMax(PANEL_MINIMUM_SIZE, mPanelSize)); if (mLengthInPercents) rect.setHeight(currentScreen.height() * mLength / 100.0); else @@ -455,11 +431,31 @@ void LxQtPanel::realign() else rect.moveRight(currentScreen.right()); } + mLayout->setMargin(mHidden ? PANEL_HIDE_MARGIN : 0); if (rect != geometry()) { setGeometry(rect); setFixedSize(rect.size()); } +} + +void LxQtPanel::realign() +{ + if (!isVisible()) + return; +#if 0 + qDebug() << "** Realign *********************"; + qDebug() << "PanelSize: " << mPanelSize; + qDebug() << "IconSize: " << mIconSize; + qDebug() << "LineCount: " << mLineCount; + qDebug() << "Length: " << mLength << (mLengthInPercents ? "%" : "px"); + qDebug() << "Alignment: " << (mAlignment == 0 ? "center" : (mAlignment < 0 ? "left" : "right")); + qDebug() << "Position: " << positionToStr(mPosition) << "on" << mScreenNum; + qDebug() << "Plugins count: " << mPlugins.count(); +#endif + + setPanelGeometry(); + // Reserve our space on the screen .......... // It's possible that our geometry is not changed, but screen resolution is changed, // so resetting WM_STRUT is still needed. To make it simple, we always do it. @@ -474,8 +470,6 @@ void LxQtPanel::updateWmStrut() if(wid == 0 || !isVisible()) return; - const QRect wholeScreen = QApplication::desktop()->geometry(); - // qDebug() << "wholeScreen" << wholeScreen; const QRect rect = geometry(); // NOTE: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html // Quote from the EWMH spec: " Note that the strut is relative to the screen edge, and not the edge of the xinerama monitor." @@ -488,7 +482,7 @@ void LxQtPanel::updateWmStrut() KWindowSystem::setExtendedStrut(wid, /* Left */ 0, 0, 0, /* Right */ 0, 0, 0, - /* Top */ height(), rect.left(), rect.right(), + /* Top */ getReserveDimension(), rect.left(), rect.right(), /* Bottom */ 0, 0, 0 ); break; @@ -498,13 +492,13 @@ void LxQtPanel::updateWmStrut() /* Left */ 0, 0, 0, /* Right */ 0, 0, 0, /* Top */ 0, 0, 0, - /* Bottom */ wholeScreen.bottom() - rect.y(), rect.left(), rect.right() + /* Bottom */ getReserveDimension(), rect.left(), rect.right() ); break; case LxQtPanel::PositionLeft: KWindowSystem::setExtendedStrut(wid, - /* Left */ width(), rect.top(), rect.bottom(), + /* Left */ getReserveDimension(), rect.top(), rect.bottom(), /* Right */ 0, 0, 0, /* Top */ 0, 0, 0, /* Bottom */ 0, 0, 0 @@ -515,7 +509,7 @@ void LxQtPanel::updateWmStrut() case LxQtPanel::PositionRight: KWindowSystem::setExtendedStrut(wid, /* Left */ 0, 0, 0, - /* Right */ wholeScreen.right() - rect.x(), rect.top(), rect.bottom(), + /* Right */ getReserveDimension(), rect.top(), rect.bottom(), /* Top */ 0, 0, 0, /* Bottom */ 0, 0, 0 ); @@ -588,50 +582,36 @@ int LxQtPanel::findAvailableScreen(LxQtPanel::Position position) ************************************************/ void LxQtPanel::showConfigDialog() { - ConfigPanelDialog::exec(this); -} - - -/************************************************ - - ************************************************/ -void LxQtPanel::showAddPluginDialog() -{ - LxQt::AddPluginDialog *dialog = findChild(); - - if (!dialog) - { - dialog = new LxQt::AddPluginDialog(pluginDesktopDirs(), "LxQtPanel/Plugin", "*", this); - dialog->setWindowTitle(tr("Add Panel Widgets")); - dialog->setAttribute(Qt::WA_DeleteOnClose); - connect(dialog, SIGNAL(pluginSelected(const LxQt::PluginInfo&)), this, SLOT(addPlugin(const LxQt::PluginInfo&))); - connect(this, SIGNAL(pluginAdded(QString)), dialog, SLOT(pluginAdded(const QString &))); - connect(this, SIGNAL(pluginRemoved(QString)), dialog, SLOT(pluginRemoved(const QString &))); - } + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); - QStringList pluginsInUseIDs; - foreach (Plugin *i, mPlugins) - pluginsInUseIDs << i->desktopFile().id(); - dialog->setPluginsInUse(pluginsInUseIDs); + mConfigDialog->showConfigPanelPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); - dialog->show(); - KWindowSystem::setOnDesktop(dialog->effectiveWinId(), KWindowSystem::currentDesktop()); + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); } /************************************************ ************************************************/ -void LxQtPanel::addPlugin(const LxQt::PluginInfo &desktopFile) +void LxQtPanel::showAddPluginDialog() { - QString settingsGroup = findNewPluginSettingsGroup(desktopFile.id()); - loadPlugin(desktopFile, settingsGroup); - saveSettings(true); + if (mConfigDialog.isNull()) + mConfigDialog = new ConfigPanelDialog(this, nullptr /*make it top level window*/); - realign(); - emit realigned(); + mConfigDialog->showConfigPluginsPage(); + mConfigDialog->show(); + mConfigDialog->raise(); + mConfigDialog->activateWindow(); + WId wid = mConfigDialog->windowHandle()->winId(); - emit pluginAdded(desktopFile.id()); + KWindowSystem::activateWindow(wid); + KWindowSystem::setOnDesktop(wid, KWindowSystem::currentDesktop()); } @@ -641,8 +621,8 @@ void LxQtPanel::addPlugin(const LxQt::PluginInfo &desktopFile) void LxQtPanel::updateStyleSheet() { QStringList sheet; - sheet << QString("Plugin > * { qproperty-iconSize: %1px %1px; }").arg(mIconSize); - sheet << QString("Plugin > * > * { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + sheet << QString("Plugin > QAbstractButton, LxQtTray { qproperty-iconSize: %1px %1px; }").arg(mIconSize); + sheet << QString("Plugin > * > QAbstractButton, TrayIcon { qproperty-iconSize: %1px %1px; }").arg(mIconSize); if (mFontColor.isValid()) sheet << QString("Plugin * { color: " + mFontColor.name() + "; }"); @@ -676,7 +656,6 @@ void LxQtPanel::setPanelSize(int value, bool save) { mPanelSize = value; realign(); - emit realigned(); if (save) saveSettings(true); @@ -700,7 +679,6 @@ void LxQtPanel::setIconSize(int value, bool save) saveSettings(true); realign(); - emit realigned(); } } @@ -721,7 +699,6 @@ void LxQtPanel::setLineCount(int value, bool save) saveSettings(true); realign(); - emit realigned(); } } @@ -742,7 +719,6 @@ void LxQtPanel::setLength(int length, bool inPercents, bool save) saveSettings(true); realign(); - emit realigned(); } @@ -785,7 +761,6 @@ void LxQtPanel::setPosition(int screen, ILxQtPanel::Position position, bool save } realign(); - emit realigned(); } /************************************************ @@ -802,7 +777,6 @@ void LxQtPanel::setAlignment(Alignment value, bool save) saveSettings(true); realign(); - emit realigned(); } /************************************************ @@ -876,7 +850,6 @@ bool LxQtPanel::event(QEvent *event) break; case QEvent::LayoutRequest: - realign(); emit realigned(); break; @@ -893,14 +866,25 @@ bool LxQtPanel::event(QEvent *event) // Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5 // See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887 - // Let's do it manually - NETWinInfo info(QX11Info::connection(), effectiveWinId(), QX11Info::appRootWindow(), NET::WMWindowType, 0); - info.setWindowType(NET::Dock); + // Let's use KWindowSystem for that + KWindowSystem::setType(effectiveWinId(), NET::Dock); updateWmStrut(); // reserve screen space for the panel KWindowSystem::setOnAllDesktops(effectiveWinId(), true); break; } + case QEvent::DragEnter: + event->ignore(); + //no break intentionally + case QEvent::Enter: + showPanel(); + break; + + case QEvent::Leave: + case QEvent::DragLeave: + hidePanel(); + break; + default: break; } @@ -916,7 +900,6 @@ void LxQtPanel::showEvent(QShowEvent *event) { QFrame::showEvent(event); realign(); - emit realigned(); } @@ -925,10 +908,10 @@ void LxQtPanel::showEvent(QShowEvent *event) ************************************************/ void LxQtPanel::showPopupMenu(Plugin *plugin) { - QList pluginsMenus; - PopupMenu menu(tr("Panel")); + PopupMenu * menu = new PopupMenu(tr("Panel"), this); + menu->setAttribute(Qt::WA_DeleteOnClose); - menu.setIcon(XdgIcon::fromTheme("configure-toolbars")); + menu->setIcon(XdgIcon::fromTheme("configure-toolbars")); // Plugin Menu .............................. if (plugin) @@ -937,96 +920,85 @@ void LxQtPanel::showPopupMenu(Plugin *plugin) if (m) { - menu.addTitle(plugin->windowTitle()); - menu.addActions(m->actions()); - pluginsMenus << m; + menu->addTitle(plugin->windowTitle()); + menu->addActions(m->actions()); + qobject_cast(m)->setParent(menu); } } // Panel menu ............................... - menu.addTitle(QIcon(), tr("Panel")); + menu->addTitle(QIcon(), tr("Panel")); - menu.addAction(XdgIcon::fromTheme(QStringLiteral("configure")), - tr("Configure Panel..."), + menu->addAction(XdgIcon::fromTheme(QStringLiteral("configure")), + tr("Configure Panel"), this, SLOT(showConfigDialog()) ); - menu.addAction(XdgIcon::fromTheme("preferences-plugin"), - tr("Add Panel Widgets..."), + menu->addAction(XdgIcon::fromTheme("preferences-plugin"), + tr("Manage Widgets"), this, SLOT(showAddPluginDialog()) ); LxQtPanelApplication *a = reinterpret_cast(qApp); - menu.addAction(XdgIcon::fromTheme(QLatin1String("list-add")), + menu->addAction(XdgIcon::fromTheme(QLatin1String("list-add")), tr("Add Panel"), a, SLOT(addNewPanel()) ); if (a->count() > 1) { - menu.addAction(XdgIcon::fromTheme(QStringLiteral("list-remove")), + menu->addAction(XdgIcon::fromTheme(QStringLiteral("list-remove")), tr("Remove Panel"), this, SLOT(userRequestForDeletion()) ); } #ifdef DEBUG - menu.addSeparator(); - menu.addAction("Exit (debug only)", qApp, SLOT(quit())); + menu->addSeparator(); + menu->addAction("Exit (debug only)", qApp, SLOT(quit())); #endif - menu.exec(QCursor::pos()); - qDeleteAll(pluginsMenus); + /* Note: in multihead & multipanel setup the QMenu::popup/exec places the window + * sometimes wrongly (it seems that this bug is somehow connected to misinterpretation + * of QDesktopWidget::availableGeometry) + */ + menu->setGeometry(calculatePopupWindowPos(QCursor::pos(), menu->sizeHint())); + menu->show(); } - -/************************************************ - - ************************************************/ -Plugin *LxQtPanel::findPlugin(const ILxQtPanelPlugin *iPlugin) const +Plugin* LxQtPanel::findPlugin(const ILxQtPanelPlugin* iPlugin) const { - foreach(Plugin *plugin, mPlugins) - { - if (plugin->iPlugin() == iPlugin) - return plugin; - } - - return 0; + Plugin *plugin = nullptr; + for (Plugin *plug : mPlugins->plugins()) + if (plug->iPlugin() == iPlugin) + plugin = plug; + return plugin; } - /************************************************ ************************************************/ -QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const +QRect LxQtPanel::calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const { - Plugin *panelPlugin = findPlugin(plugin); - if (!plugin) - return QRect(); - - int x=0, y=0; + int x = absolutePos.x(), y = absolutePos.y(); switch (position()) { case ILxQtPanel::PositionTop: - x = panelPlugin->mapToGlobal(QPoint(0, 0)).x(); y = globalGometry().bottom(); break; case ILxQtPanel::PositionBottom: - x = panelPlugin->mapToGlobal(QPoint(0, 0)).x(); y = globalGometry().top() - windowSize.height(); break; case ILxQtPanel::PositionLeft: x = globalGometry().right(); - y = panelPlugin->mapToGlobal(QPoint(0, 0)).y(); break; case ILxQtPanel::PositionRight: x = globalGometry().left() - windowSize.width(); - y = panelPlugin->mapToGlobal(QPoint(0, 0)).y(); break; } @@ -1052,62 +1024,50 @@ QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const Q return res; } - /************************************************ ************************************************/ -QString LxQtPanel::qssPosition() const -{ - return positionToStr(position()); -} - - -/************************************************ - - ************************************************/ -QString LxQtPanel::findNewPluginSettingsGroup(const QString &pluginType) const +QRect LxQtPanel::calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const { - QStringList groups = mSettings->childGroups(); - groups.sort(); + Plugin *panel_plugin = findPlugin(plugin); + if (nullptr == panel_plugin) + return QRect(); - // Generate new section name - for (int i = 2; true; ++i) - if (!groups.contains(QString("%1%2").arg(pluginType).arg(i))) - return QString("%1%2").arg(pluginType).arg(i); + return calculatePopupWindowPos(panel_plugin->mapToGlobal(QPoint(0, 0)), windowSize); } /************************************************ ************************************************/ -void LxQtPanel::removePlugin() +QString LxQtPanel::qssPosition() const { - Plugin *plugin = qobject_cast(sender()); - QString id; - if (plugin) - { - mSettings->remove(plugin->settingsGroup()); - id = mPlugins.takeAt(mPlugins.indexOf(plugin))->desktopFile().id(); - } - - saveSettings(); - emit pluginRemoved(id); + return positionToStr(position()); } - /************************************************ ************************************************/ -void LxQtPanel::pluginMoved() +void LxQtPanel::pluginMoved(Plugin * plug) { - mPlugins.clear(); + //get new position of the moved plugin + bool found{false}; + QString plug_is_before; for (int i=0; icount(); ++i) { Plugin *plugin = qobject_cast(mLayout->itemAt(i)->widget()); if (plugin) - mPlugins << plugin; + { + if (found) + { + //we found our plugin in previous cycle -> is before this (or empty as last) + plug_is_before = plugin->settingsGroup(); + break; + } else + found = (plug == plugin); + } } - saveSettings(); + mPlugins->movePlugin(plug, plug_is_before); } @@ -1128,3 +1088,56 @@ void LxQtPanel::userRequestForDeletion() emit deletedByUser(this); } + +void LxQtPanel::showPanel() +{ + if (mHidable) + { + mHideTimer.stop(); + if (mHidden) + { + mHidden = false; + setPanelGeometry(); + } + } +} + +void LxQtPanel::hidePanel() +{ + if (mHidable && !mHidden) + mHideTimer.start(); +} + +void LxQtPanel::hidePanelWork() +{ + if (mHidable && !mHidden && !geometry().contains(QCursor::pos())) + { + mHidden = true; + setPanelGeometry(); + } else + { + mHideTimer.start(); + } +} + +void LxQtPanel::setHidable(bool hidable, bool save) +{ + if (mHidable == hidable) + return; + + mHidable = mHidden = hidable; + + if (save) + saveSettings(true); + + realign(); +} + +bool LxQtPanel::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + Plugin const * plugin = mPlugins->pluginByID(pluginId); + if (nullptr == plugin) + return false; + else + return plugin->iPlugin()->flags().testFlag(ILxQtPanelPlugin::SingleInstance); +} diff --git a/panel/lxqtpanel.h b/panel/lxqtpanel.h index f1b2123..06aa608 100644 --- a/panel/lxqtpanel.h +++ b/panel/lxqtpanel.h @@ -32,17 +32,21 @@ #include #include #include +#include #include "ilxqtpanel.h" #include "lxqtpanelglobals.h" class QMenu; class Plugin; +class QAbstractItemModel; namespace LxQt { class Settings; class PluginInfo; } class LxQtPanelLayout; +class ConfigPanelDialog; +class PanelPluginsModel; /*! \brief The LxQtPanel class provides a single lxqt-panel. */ @@ -52,6 +56,10 @@ class LXQT_PANEL_API LxQtPanel : public QFrame, public ILxQtPanel Q_PROPERTY(QString position READ qssPosition) + // for configuration dialog + friend class ConfigPanelWidget; + friend class ConfigPluginsWidget; + public: enum Alignment { AlignmentLeft = -1, @@ -71,6 +79,8 @@ public: // ILxQtPanel ......................... ILxQtPanel::Position position() const { return mPosition; } QRect globalGometry() const; + Plugin *findPlugin(const ILxQtPanelPlugin *iPlugin) const; + QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const; QRect calculatePopupWindowPos(const ILxQtPanelPlugin *plugin, const QSize &windowSize) const; // For QSS properties .................. @@ -92,11 +102,17 @@ public: QColor backgroundColor() const { return mBackgroundColor; }; QString backgroundImage() const { return mBackgroundImage; }; int opacity() const { return mOpacity; }; + bool hidable() const { return mHidable; } LxQt::Settings *settings() const { return mSettings; } + bool isPluginSingletonAndRunnig(QString const & pluginId) const; + public slots: void show(); + void showPanel(); + void hidePanel(); + void hidePanelWork(); // Settings void setPanelSize(int value, bool save); @@ -109,6 +125,7 @@ public slots: void setBackgroundColor(QColor color, bool save); void setBackgroundImage(QString path, bool save); void setOpacity(int opacity, bool save); + void setHidable(bool hidable, bool save); void saveSettings(bool later=false); void ensureVisible(); @@ -116,21 +133,19 @@ public slots: signals: void realigned(); void deletedByUser(LxQtPanel *self); - - void pluginAdded(QString id); - void pluginRemoved(QString id); + void pluginAdded(); + void pluginRemoved(); protected: bool event(QEvent *event); void showEvent(QShowEvent *event); -private slots: - void addPlugin(const LxQt::PluginInfo &desktopFile); +public slots: void showConfigDialog(); +private slots: void showAddPluginDialog(); void realign(); - void removePlugin(); - void pluginMoved(); + void pluginMoved(Plugin * plug); void userRequestForDeletion(); private: @@ -138,16 +153,15 @@ private: LxQt::Settings *mSettings; QFrame *LxQtPanelWidget; QString mConfigGroup; - QList mPlugins; + QScopedPointer mPlugins; int findAvailableScreen(LxQtPanel::Position position); void updateWmStrut(); void loadPlugins(); - Plugin *loadPlugin(const LxQt::PluginInfo &desktopFile, const QString &settingsGroup); - Plugin *findPlugin(const ILxQtPanelPlugin *iPlugin) const; - QString findNewPluginSettingsGroup(const QString &pluginType) const; + void setPanelGeometry(); + int getReserveDimension(); int mPanelSize; int mIconSize; @@ -161,12 +175,16 @@ private: ILxQtPanel::Position mPosition; int mScreenNum; QTimer mDelaySave; + bool mHidable; + bool mHidden; + QTimer mHideTimer; QColor mFontColor; QColor mBackgroundColor; QString mBackgroundImage; // 0 to 100 int mOpacity; + QPointer mConfigDialog; void updateStyleSheet(); }; diff --git a/panel/lxqtpanelapplication.cpp b/panel/lxqtpanelapplication.cpp index 4e0fa14..d5c140a 100644 --- a/panel/lxqtpanelapplication.cpp +++ b/panel/lxqtpanelapplication.cpp @@ -34,12 +34,31 @@ #include #include #include +#include -LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString &configFile) - : LxQt::Application(argc, argv) +LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv) + : LxQt::Application(argc, argv, true) { + QCoreApplication::setApplicationName(QStringLiteral("lxqt-panel")); + QCoreApplication::setApplicationVersion(LXQT_VERSION); + + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt panel")); + parser.addHelpOption(); + parser.addVersionOption(); + + QCommandLineOption configFileOption(QStringList() + << QStringLiteral("c") << QStringLiteral("config") << QStringLiteral("configfile"), + QCoreApplication::translate("main", "Use alternate configuration file."), + QCoreApplication::translate("main", "Configuration file")); + parser.addOption(configFileOption); + + parser.process(*this); + + const QString configFile = parser.value(configFileOption); + if (configFile.isEmpty()) - mSettings = new LxQt::Settings("panel", this); + mSettings = new LxQt::Settings(QStringLiteral("panel"), this); else mSettings = new LxQt::Settings(configFile, QSettings::IniFormat, this); @@ -49,6 +68,8 @@ LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString connect(screen, &QScreen::destroyed, this, &LxQtPanelApplication::screenDestroyed); } connect(this, &QGuiApplication::screenAdded, this, &LxQtPanelApplication::handleScreenAdded); + connect(this, &QCoreApplication::aboutToQuit, this, &LxQtPanelApplication::cleanup); + QStringList panels = mSettings->value("panels").toStringList(); @@ -64,6 +85,10 @@ LxQtPanelApplication::LxQtPanelApplication(int& argc, char** argv, const QString } LxQtPanelApplication::~LxQtPanelApplication() +{ +} + +void LxQtPanelApplication::cleanup() { qDeleteAll(mPanels); } @@ -77,7 +102,7 @@ void LxQtPanelApplication::addNewPanel() mSettings->setValue("panels", panels); // Poupup the configuration dialog to allow user configuration right away - ConfigPanelDialog::exec(p); + p->showConfigDialog(); } LxQtPanel* LxQtPanelApplication::addPanel(const QString& name) @@ -86,6 +111,10 @@ LxQtPanel* LxQtPanelApplication::addPanel(const QString& name) mPanels << panel; connect(panel, SIGNAL(deletedByUser(LxQtPanel*)), this, SLOT(removePanel(LxQtPanel*))); + //reemit signals + connect(panel, &LxQtPanel::pluginAdded, this, &LxQtPanelApplication::pluginAdded); + connect(panel, &LxQtPanel::pluginRemoved, this, &LxQtPanelApplication::pluginRemoved); + return panel; } @@ -186,3 +215,12 @@ void LxQtPanelApplication::removePanel(LxQtPanel* panel) panel->deleteLater(); } + +bool LxQtPanelApplication::isPluginSingletonAndRunnig(QString const & pluginId) const +{ + for (auto const & panel : mPanels) + if (panel->isPluginSingletonAndRunnig(pluginId)) + return true; + + return false; +} diff --git a/panel/lxqtpanelapplication.h b/panel/lxqtpanelapplication.h index 0b5f258..55d13ca 100644 --- a/panel/lxqtpanelapplication.h +++ b/panel/lxqtpanelapplication.h @@ -43,15 +43,20 @@ class LxQtPanelApplication : public LxQt::Application { Q_OBJECT public: - explicit LxQtPanelApplication(int& argc, char** argv, const QString &configFile); + explicit LxQtPanelApplication(int& argc, char** argv); ~LxQtPanelApplication(); int count() { return mPanels.count(); } LxQt::Settings *settings() { return mSettings; } + bool isPluginSingletonAndRunnig(QString const & pluginId) const; public slots: void addNewPanel(); +signals: + void pluginAdded(); + void pluginRemoved(); + private: QList mPanels; @@ -63,6 +68,7 @@ private slots: void handleScreenAdded(QScreen* newScreen); void screenDestroyed(QObject* screenObj); void reloadPanelsAsNeeded(); + void cleanup(); private: LxQt::Settings *mSettings; diff --git a/panel/lxqtpanelglobals.h b/panel/lxqtpanelglobals.h index b3550d8..36da6a7 100644 --- a/panel/lxqtpanelglobals.h +++ b/panel/lxqtpanelglobals.h @@ -24,7 +24,7 @@ * Boston, MA 02110-1301 USA * * END_COMMON_COPYRIGHT_HEADER */ - + #ifndef __LXQT_PANEL_GLOBALS_H__ #define __LXQT_PANEL_GLOBALS_H__ diff --git a/panel/lxqtpanellayout.cpp b/panel/lxqtpanellayout.cpp index 4cabdb1..6416bca 100644 --- a/panel/lxqtpanellayout.cpp +++ b/panel/lxqtpanellayout.cpp @@ -542,7 +542,11 @@ void LxQtPanelLayout::moveItem(int from, int to, bool withAnimation) { QLayoutItem *item = fromGrid->takeAt(fromIdx); toGrid->addItem(item); - toGrid->moveItem(toGrid->count()-1, toIdx); + //recalculate position because we removed from one and put to another grid + LayoutItemGrid *toGridAux=0; + globalIndexToLocal(to, &toGridAux, &toIdx); + Q_ASSERT(toGrid == toGridAux); //grid must be the same (if not something is wrong with our logic) + toGrid->moveItem(toGridAux->count()-1, toIdx); } } @@ -589,16 +593,18 @@ void LxQtPanelLayout::setGeometry(const QRect &geometry) if (!mRightGrid->isValid()) mRightGrid->update(); + QRect my_geometry{geometry}; + my_geometry -= contentsMargins(); if (count()) { if (isHorizontal()) - setGeometryHoriz(geometry); + setGeometryHoriz(my_geometry); else - setGeometryVert(geometry); + setGeometryVert(my_geometry); } mAnimate = false; - QLayout::setGeometry(geometry); + QLayout::setGeometry(my_geometry); } @@ -639,9 +645,12 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) // Calc baselines for plugins like button. QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); { - int bh = (geometry.height() / baseLines.count()) / 2; - for (int i=0; i> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bh) + { + *i = base; + } } #if 0 @@ -682,7 +691,8 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(0, baseLines[c])); rect.moveLeft(left); } @@ -719,7 +729,8 @@ void LxQtPanelLayout::setGeometryHoriz(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(0, baseLines[c])); rect.moveRight(right); } @@ -750,9 +761,12 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) // Calc baselines for plugins like button. QVector baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount())); { - int bw = (geometry.width() / baseLines.count()) / 2; - for (int i=0; i> 1); + for (auto i = baseLines.begin(), i_e = baseLines.end(); i_e != i; ++i, base += bw) + { + *i = base; + } } #if 0 @@ -792,7 +806,8 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(baseLines[c], 0)); rect.moveTop(top); } @@ -829,7 +844,8 @@ void LxQtPanelLayout::setGeometryVert(const QRect &geometry) } else { - rect.setSize(info.geometry.size()); + rect.setHeight(qMin(info.geometry.height(), geometry.height())); + rect.setWidth(qMin(info.geometry.width(), geometry.width())); rect.moveCenter(QPoint(baseLines[c], 0)); rect.moveBottom(bottom); } @@ -960,6 +976,32 @@ void LxQtPanelLayout::finishMovePlugin() Plugin *plugin = moveProcessor->plugin(); int n = indexOf(plugin); plugin->setAlignment(ncount() ? Plugin::AlignLeft : Plugin::AlignRight); - emit pluginMoved(); + emit pluginMoved(plugin); } } + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::moveUpPlugin(Plugin * plugin) +{ + const int i = indexOf(plugin); + if (0 < i) + moveItem(i, i - 1, true); +} + +/************************************************ + + ************************************************/ +void LxQtPanelLayout::addPlugin(Plugin * plugin) +{ + connect(plugin, &Plugin::startMove, this, &LxQtPanelLayout::startMovePlugin); + + const int prev_count = count(); + addWidget(plugin); + + //check actual position + const int pos = indexOf(plugin); + if (prev_count > pos) + moveItem(pos, prev_count, false); +} diff --git a/panel/lxqtpanellayout.h b/panel/lxqtpanellayout.h index e3b950b..c833647 100644 --- a/panel/lxqtpanellayout.h +++ b/panel/lxqtpanellayout.h @@ -75,11 +75,13 @@ public: static bool itemIsSeparate(QLayoutItem *item); signals: - void pluginMoved(); + void pluginMoved(Plugin * plugin); public slots: void startMovePlugin(); void finishMovePlugin(); + void moveUpPlugin(Plugin * plugin); + void addPlugin(Plugin * plugin); private: mutable QSize mMinPluginSize; diff --git a/panel/lxqtpanellimits.h b/panel/lxqtpanellimits.h index ffc7dea..0dfff4f 100644 --- a/panel/lxqtpanellimits.h +++ b/panel/lxqtpanellimits.h @@ -31,11 +31,16 @@ #define PANEL_DEFAULT_SIZE 32 #define PANEL_MINIMUM_SIZE 16 #define PANEL_MAXIMUM_SIZE 200 +#define PANEL_HIDE_SIZE 4 +#define PANEL_HIDE_MARGIN (PANEL_HIDE_SIZE / 2) #define PANEL_DEFAULT_ICON_SIZE 22 #define PANEL_DEFAULT_LINE_COUNT 1 #define PANEL_DEFAULT_BACKGROUND_COLOR "#CCCCCC" +#define PANEL_HIDE_DELAY 500 +#define PANEL_HIDE_FIRST_TIME (5000 - PANEL_HIDE_DELAY) + #define SETTINGS_SAVE_DELAY 3000 #endif // LXQTPANELLIMITS_H diff --git a/panel/main.cpp b/panel/main.cpp index c5ec668..53d6921 100644 --- a/panel/main.cpp +++ b/panel/main.cpp @@ -26,15 +26,7 @@ * END_COMMON_COPYRIGHT_HEADER */ -#include -#include -#include -#include -#include -#include - #include "lxqtpanelapplication.h" -#include "lxqtpanel.h" /*! The lxqt-panel is the panel of LXDE-Qt. Usage: lxqt-panel [CONFIG_ID] @@ -42,74 +34,9 @@ (default main) */ -void termSignalHandler(int) -{ - qApp->quit(); -} - - -void printHelp() -{ - QTextStream out(stdout); - out << "Usage: lxqt-panel [options]" << endl; - out << endl; - out << "Start lxde-qt panel and its plugins" << endl; - out << endl; - out << "Options:" << endl; - out << " -h, --help Show help about options" << endl; - out << " --version Show version information" << endl; - out << " -c, --configfile=CONFIGFILE Use alternate configuration file" << endl; -} - - -void printVersion() -{ - QTextStream out(stdout); - out << "lxqt-panel " << LXQT_VERSION << endl; -} - - int main(int argc, char *argv[]) { - QString configFile; - for (int i=1; i < argc; ++i) - { - QString arg = QString::fromLocal8Bit(argv[i]); - - if (arg == "--help" || arg == "-h") - { - printHelp(); - return 0; - } - - if (arg == "--version") - { - printVersion(); - return 0; - } - - if (arg == "-c" || arg.startsWith("--conf")) - { - if (i+1 < argc) - { - configFile = QString::fromLocal8Bit(argv[i+1]); - } - } - } - - LxQtPanelApplication *app = new LxQtPanelApplication(argc, argv, configFile); - - - //Setup Unix signal handlers - struct sigaction term; - term.sa_handler = termSignalHandler; - sigemptyset(&term.sa_mask); - term.sa_flags |= SA_RESTART; - sigaction(SIGTERM, &term, 0); - sigaction(SIGINT, &term, 0); - - bool res = app->exec(); + LxQtPanelApplication app(argc, argv); - app->deleteLater(); - return res; + return app.exec(); } diff --git a/panel/man/lxqt-panel.1 b/panel/man/lxqt-panel.1 index 1eb6416..c3eb14a 100644 --- a/panel/man/lxqt-panel.1 +++ b/panel/man/lxqt-panel.1 @@ -1,6 +1,6 @@ -.TH lxqt-panel "1" "September 2012" "LxQt\-qt\ 0.5.0" "LxQt\-qt\ Module" +.TH lxqt-panel "1" "September 2012" "LXQt\ 0.5.0" "LXQt\ Module" .SH NAME -lxqt-panel \- Panel of \fBLXDE-Qt\fR: the faster and lighter QT Desktop Environment +lxqt-panel \- Panel of \fBLXQt\fR: the faster and lighter QT Desktop Environment .SH SYNOPSIS .B lxqt-panel .br @@ -8,10 +8,10 @@ lxqt-panel \- Panel of \fBLXDE-Qt\fR: the faster and lighter QT Desktop Environm This module adds a panel to the desktop. .P .P -The \fBLXDE-Qt modules\fR are desktop independent tools, +The \fBLXQt modules\fR are desktop independent tools, and operate as daemons for the local user for desktop specific operations. .P -\fBLXDE-Qt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt +\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt technologies, ships several core desktop components, all of which are optional: .P * Panel \fI(this)\fR @@ -25,7 +25,7 @@ technologies, ships several core desktop components, all of which are optional: .P These components perform similar actions to those available in other desktop environments, and their name is self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLxQt\-qt\fR session in the Display +by hand but automatically, when choosing a \fBLXQt\fR session in the Display Manager. .SH BEHAVIOR The module can be run standard alone, and also autostarted at logon. Show a bar panel @@ -37,21 +37,21 @@ Several plugins are loaded by default, the desktop menu and windows workspaces c .SH CONFIGURATIONS By right clickin over there show config setting options for each plugins and also panel itsefl. .SH AUTOSTART -The module only are showed on \fBLXDE-Qt\fR desktop environment, but you can create an autostart action +The module only are showed on \fBLXQt\fR desktop environment, but you can create an autostart action for you prefered desktop environment. .SH "REPORTING BUGS" -Report bugs to https://github.com/LXDE-Qt/LXDE-Qt/issues +Report bugs to https://github.com/LXDE/LXQt/issues .SH "SEE ALSO" -\fBLXDE-Qt\fR it has been tailored for users who value simplicity, speed, and +\fBLXQt\fR it has been tailored for users who value simplicity, speed, and an intuitive interface, also intended for less powerful machines. See: .\" any module must refers to session app, for more info on start it .P -\fBlxqt-session.1\fR LXDE-Qt for manage LXDE-Qt complete environment +\fBlxqt-session.1\fR LXQt for manage LXQt complete environment .P -\fBstart-lxqt.1\fR LXDE-Qt display management independient starup. +\fBstart-lxqt.1\fR LXQt display management independient starup. .P -\fBlxqt-config.1\fR LXDE-Qt config center application for performing settings +\fBlxqt-config.1\fR LXQt config center application for performing settings .P .SH AUTHOR This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR -for \fBLXDE-Qt\fR project and VENENUX GNU/Linux but can be used by others. +for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others. diff --git a/panel/panelpluginsmodel.cpp b/panel/panelpluginsmodel.cpp new file mode 100644 index 0000000..9e87f34 --- /dev/null +++ b/panel/panelpluginsmodel.cpp @@ -0,0 +1,331 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "panelpluginsmodel.h" +#include "plugin.h" +#include "ilxqtpanelplugin.h" +#include "lxqtpanel.h" +#include "lxqtpanelapplication.h" +#include +#include +#include + +#include + +PanelPluginsModel::PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent/* = nullptr*/) + : QAbstractListModel{parent}, + mNamesKey(namesKey), + mPanel(panel) +{ + loadPlugins(desktopDirs); +} + +PanelPluginsModel::~PanelPluginsModel() +{ + qDeleteAll(plugins()); +} + +int PanelPluginsModel::rowCount(const QModelIndex & parent/* = QModelIndex()*/) const +{ + return QModelIndex() == parent ? mPlugins.size() : 0; +} + + +QVariant PanelPluginsModel::data(const QModelIndex & index, int role/* = Qt::DisplayRole*/) const +{ + Q_ASSERT(QModelIndex() == index.parent() + && 0 == index.column() + && mPlugins.size() > index.row() + ); + + pluginslist_t::const_reference plugin = mPlugins[index.row()]; + QVariant ret; + switch (role) + { + case Qt::DisplayRole: + if (plugin.second.isNull()) + ret = QStringLiteral("Unknown (%1)").arg(plugin.first); + else + ret = QStringLiteral("%1 (%2)").arg(plugin.second->name(), plugin.first); + break; + case Qt::DecorationRole: + if (plugin.second.isNull()) + ret = XdgIcon::fromTheme("preferences-plugin"); + else + ret = plugin.second->desktopFile().icon(XdgIcon::fromTheme("preferences-plugin")); + break; + case Qt::UserRole: + ret = QVariant::fromValue(const_cast(plugin.second.data())); + break; + } + return ret; +} + +Qt::ItemFlags PanelPluginsModel::flags(const QModelIndex & index) const +{ + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemNeverHasChildren; +} + +QStringList PanelPluginsModel::pluginNames() const +{ + QStringList names; + for (auto const & p : mPlugins) + names.append(p.first); + return std::move(names); +} + +QList PanelPluginsModel::plugins() const +{ + QList plugins; + for (auto const & p : mPlugins) + if (!p.second.isNull()) + plugins.append(p.second.data()); + return std::move(plugins); +} + +Plugin* PanelPluginsModel::pluginByName(QString name) const +{ + for (auto const & p : mPlugins) + if (p.first == name) + return p.second.data(); + return nullptr; +} + +Plugin const * PanelPluginsModel::pluginByID(QString id) const +{ + for (auto const & p : mPlugins) + { + Plugin *plugin = p.second.data(); + if (plugin && plugin->desktopFile().id() == id) + return plugin; + } + return nullptr; +} + +void PanelPluginsModel::addPlugin(const LxQt::PluginInfo &desktopFile) +{ + if (dynamic_cast(qApp)->isPluginSingletonAndRunnig(desktopFile.id())) + return; + + QString name = findNewPluginSettingsGroup(desktopFile.id()); + + QPointer plugin = loadPlugin(desktopFile, name); + if (plugin.isNull()) + return; + + beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size()); + mPlugins.append({name, plugin}); + endInsertRows(); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + emit pluginAdded(plugin.data()); +} + +void PanelPluginsModel::removePlugin(pluginslist_t::iterator plugin) +{ + if (mPlugins.end() != plugin) + { + mPanel->settings()->remove(plugin->first); + Plugin * p = plugin->second.data(); + const int row = plugin - mPlugins.begin(); + beginRemoveRows(QModelIndex(), row, row); + mPlugins.erase(plugin); + endRemoveRows(); + mActive = mPlugins.isEmpty() ? QModelIndex() : createIndex(mPlugins.size() > row ? row : row - 1, 0); + emit pluginRemoved(p); // p can be nullptr + mPanel->settings()->setValue(mNamesKey, pluginNames()); + if (nullptr != p) + p->deleteLater(); + } +} + +void PanelPluginsModel::removePlugin() +{ + Plugin * p = qobject_cast(sender()); + auto plugin = std::find_if(mPlugins.begin(), mPlugins.end(), + [p] (pluginslist_t::const_reference obj) { return p == obj.second; }); + removePlugin(std::move(plugin)); +} + +void PanelPluginsModel::movePlugin(Plugin * plugin, QString const & nameAfter) +{ + //merge list of plugins (try to preserve original position) + const int from = + std::find_if(mPlugins.begin(), mPlugins.end(), [plugin] (pluginslist_t::const_reference obj) { return plugin == obj.second.data(); }) + - mPlugins.begin(); + const int to = + std::find_if(mPlugins.begin(), mPlugins.end(), [nameAfter] (pluginslist_t::const_reference obj) { return nameAfter == obj.first; }) + - mPlugins.begin(); + const int to_plugins = from < to ? to - 1 : to; + + if (from != to && from != to_plugins) + { + beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + mPlugins.move(from, to_plugins); + endMoveRows(); + emit pluginMoved(plugin); + mPanel->settings()->setValue(mNamesKey, pluginNames()); + } +} + +void PanelPluginsModel::loadPlugins(QStringList const & desktopDirs) +{ + QStringList plugin_names = mPanel->settings()->value(mNamesKey).toStringList(); + +#ifdef DEBUG_PLUGIN_LOADTIME + QElapsedTimer timer; + timer.start(); + qint64 lastTime = 0; +#endif + for (auto const & name : plugin_names) + { + pluginslist_t::iterator i = mPlugins.insert(mPlugins.end(), {name, nullptr}); + QString type = mPanel->settings()->value(name + "/type").toString(); + if (type.isEmpty()) + { + qWarning() << QString("Section \"%1\" not found in %2.").arg(name, mPanel->settings()->fileName()); + continue; + } + + LxQt::PluginInfoList list = LxQt::PluginInfo::search(desktopDirs, "LxQtPanel/Plugin", QString("%1.desktop").arg(type)); + if( !list.count()) + { + qWarning() << QString("Plugin \"%1\" not found.").arg(type); + continue; + } + + i->second = loadPlugin(list.first(), name); +#ifdef DEBUG_PLUGIN_LOADTIME + qDebug() << "load plugin" << type << "takes" << (timer.elapsed() - lastTime) << "ms"; + lastTime = timer.elapsed(); +#endif + } +} + +QPointer PanelPluginsModel::loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup) +{ + std::unique_ptr plugin(new Plugin(desktopFile, mPanel->settings()->fileName(), settingsGroup, mPanel)); + if (plugin->isLoaded()) + { + connect(mPanel, &LxQtPanel::realigned, plugin.get(), &Plugin::realign); + connect(plugin.get(), &Plugin::remove, + this, static_cast(&PanelPluginsModel::removePlugin)); + return plugin.release(); + } + + return nullptr; +} + +QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType) const +{ + QStringList groups = mPanel->settings()->childGroups(); + groups.sort(); + + // Generate new section name + for (int i = 2; true; ++i) + if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i))) + return QStringLiteral("%1%2").arg(pluginType).arg(i); +} + +void PanelPluginsModel::onActivatedIndex(QModelIndex const & index) +{ + mActive = index; +} + +bool PanelPluginsModel::isActiveIndexValid() const +{ + return mActive.isValid() && QModelIndex() == mActive.parent() + && 0 == mActive.column() && mPlugins.size() > mActive.row(); +} + +void PanelPluginsModel::onMovePluginUp() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (0 >= row) + return; //can't move up + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1); + mPlugins.swap(row - 1, row); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row - 1]; + pluginslist_t::const_reference prev_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !prev_plugin.second.isNull()) + emit pluginMovedUp(moved_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onMovePluginDown() +{ + if (!isActiveIndexValid()) + return; + + const int row = mActive.row(); + if (mPlugins.size() <= row + 1) + return; //can't move down + + beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2); + mPlugins.swap(row, row + 1); + endMoveRows(); + pluginslist_t::const_reference moved_plugin = mPlugins[row + 1]; + pluginslist_t::const_reference next_plugin = mPlugins[row]; + + emit pluginMoved(moved_plugin.second.data()); + //emit signal for layout only in case both plugins are loaded/displayed + if (!moved_plugin.second.isNull() && !next_plugin.second.isNull()) + emit pluginMovedUp(next_plugin.second.data()); + + mPanel->settings()->setValue(mNamesKey, pluginNames()); +} + +void PanelPluginsModel::onConfigurePlugin() +{ + if (!isActiveIndexValid()) + return; + + Plugin * const plugin = mPlugins[mActive.row()].second.data(); + if (nullptr != plugin && (ILxQtPanelPlugin::HaveConfigDialog & plugin->iPlugin()->flags())) + plugin->showConfigureDialog(); +} + +void PanelPluginsModel::onRemovePlugin() +{ + if (!isActiveIndexValid()) + return; + + auto plugin = mPlugins.begin() + mActive.row(); + if (plugin->second.isNull()) + removePlugin(std::move(plugin)); + else + plugin->second->requestRemove(); +} diff --git a/panel/panelpluginsmodel.h b/panel/panelpluginsmodel.h new file mode 100644 index 0000000..ed9a8a3 --- /dev/null +++ b/panel/panelpluginsmodel.h @@ -0,0 +1,104 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef PANELPLUGINSMODEL_H +#define PANELPLUGINSMODEL_H + +#include +#include + +namespace LxQt +{ + class PluginInfo; + struct PluginData; +} + +class LxQtPanel; +class Plugin; + +class PanelPluginsModel : public QAbstractListModel +{ + Q_OBJECT +public: + PanelPluginsModel(LxQtPanel * panel, + QString const & namesKey, + QStringList const & desktopDirs, + QObject * parent = nullptr); + ~PanelPluginsModel(); + + virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override; + virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; + virtual Qt::ItemFlags flags(const QModelIndex & index) const override; + + QStringList pluginNames() const; + QList plugins() const; + Plugin *pluginByName(QString name) const; + Plugin const *pluginByID(QString id) const; + + /*! + * \param plugin plugin that has been moved + * \param nameAfter name of plugin that is right after moved plugin + */ + void movePlugin(Plugin * plugin, QString const & nameAfter); + +signals: + void pluginAdded(Plugin * plugin); + void pluginRemoved(Plugin * plugin); + void pluginMoved(Plugin * plugin); //plugin can be nullptr in case of move of not loaded plugin + /*! + * Emiting only move-up for simplification of using (and problematic layout/list move) + */ + void pluginMovedUp(Plugin * plugin); + +public slots: + void addPlugin(const LxQt::PluginInfo &desktopFile); + void removePlugin(); + + // slots for configuration dialog + void onActivatedIndex(QModelIndex const & index); + void onMovePluginUp(); + void onMovePluginDown(); + void onConfigurePlugin(); + void onRemovePlugin(); + +private: + typedef QList > > pluginslist_t; + +private: + void loadPlugins(QStringList const & desktopDirs); + QPointer loadPlugin(LxQt::PluginInfo const & desktopFile, QString const & settingsGroup); + QString findNewPluginSettingsGroup(const QString &pluginType) const; + bool isActiveIndexValid() const; + void removePlugin(pluginslist_t::iterator plugin); + + const QString mNamesKey; + pluginslist_t mPlugins; + LxQtPanel * mPanel; + QPersistentModelIndex mActive; +}; + +Q_DECLARE_METATYPE(Plugin const *) + +#endif // PANELPLUGINSMODEL_H diff --git a/panel/plugin.cpp b/panel/plugin.cpp index e561c5b..b6f930b 100644 --- a/panel/plugin.cpp +++ b/panel/plugin.cpp @@ -42,11 +42,24 @@ #include #include #include +#include #include #include #include +// statically linked built-in plugins +#include "../plugin-clock/lxqtclock.h" // clock +#include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch +#include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu +#include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch +#include "../plugin-showdesktop/showdesktop.h" // showdesktop +#include "../plugin-spacer/spacer.h" // spacer +#include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier +#include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar +#include "../plugin-tray/lxqttrayplugin.h" // tray +#include "../plugin-worldclock/lxqtworldclock.h" // worldclock + QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255); /************************************************ @@ -76,24 +89,32 @@ Plugin::Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, dirs << QProcessEnvironment::systemEnvironment().value("LXQTPANEL_PLUGIN_PATH").split(":"); dirs << PLUGIN_DIR; - QString baseName = QString("lib%1.so").arg(desktopFile.id()); bool found = false; - foreach(QString dirName, dirs) + if(ILxQtPanelPluginLibrary const * pluginLib = findStaticPlugin(desktopFile.id())) { - QFileInfo fi(QDir(dirName), baseName); - - if (fi.exists()) + // this is a static plugin + found = true; + loadLib(pluginLib); + } + else { + // this plugin is a dynamically loadable module + QString baseName = QString("lib%1.so").arg(desktopFile.id()); + foreach(QString dirName, dirs) { - found = true; - if (loadLib(fi.absoluteFilePath())) - break; + QFileInfo fi(QDir(dirName), baseName); + if (fi.exists()) + { + found = true; + if (loadModule(fi.absoluteFilePath())) + break; + } } } if (!isLoaded()) { if (!found) - qWarning() << QString("Plugin %1 not found in the").arg(baseName) << dirs; + qWarning() << QString("Plugin %1 not found in the").arg(desktopFile.id()) << dirs; return; } @@ -102,6 +123,10 @@ Plugin::Plugin(const LxQt::PluginInfo &desktopFile, const QString &settingsFile, LxQt::Translator::translatePlugin(desktopFile.id(), QLatin1String("lxqt-panel")); setObjectName(mPlugin->themeId() + "Plugin"); + + // plugin handle for easy context menu + setProperty("NeedsHandle", mPlugin->flags().testFlag(ILxQtPanelPlugin::NeedsHandle)); + QString s = mSettings->value("alignment").toString(); // Retrun default value @@ -156,31 +181,72 @@ void Plugin::setAlignment(Plugin::Alignment alignment) /************************************************ ************************************************/ -bool Plugin::loadLib(const QString &libraryName) +namespace { - mPluginLoader = new QPluginLoader(libraryName); - - if (!mPluginLoader->load()) - { - qWarning() << mPluginLoader->errorString(); - return false; - } - - QObject *obj = mPluginLoader->instance(); - if (!obj) + //helper types for static plugins storage & binary search + typedef std::unique_ptr plugin_ptr_t; + typedef std::pair plugin_pair_t; + + //NOTE: Please keep the plugins sorted by name while adding new plugins. + static plugin_pair_t const static_plugins[] = { +#if defined(WITH_CLOCK_PLUGIN) + { QStringLiteral("clock"), plugin_ptr_t{new LxQtClockPluginLibrary} },// clock +#endif +#if defined(WITH_DESKTOPSWITCH_PLUGIN) + { QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary} },// desktopswitch +#endif +#if defined(WITH_MAINMENU_PLUGIN) + { QStringLiteral("mainmenu"), plugin_ptr_t{new LxQtMainMenuPluginLibrary} },// mainmenu +#endif +#if defined(WITH_QUICKLAUNCH_PLUGIN) + { QStringLiteral("quicklaunch"), plugin_ptr_t{new LxQtQuickLaunchPluginLibrary} },// quicklaunch +#endif +#if defined(WITH_SHOWDESKTOP_PLUGIN) + { QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary} },// showdesktop +#endif +#if defined(WITH_SPACER_PLUGIN) + { QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary} },// spacer +#endif +#if defined(WITH_STATUSNOTIFIER_PLUGIN) + { QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary} },// statusnotifier +#endif +#if defined(WITH_TASKBAR_PLUGIN) + { QStringLiteral("taskbar"), plugin_ptr_t{new LxQtTaskBarPluginLibrary} },// taskbar +#endif +#if defined(WITH_TRAY_PLUGIN) + { QStringLiteral("tray"), plugin_ptr_t{new LxQtTrayPluginLibrary} },// tray +#endif +#if defined(WITH_WORLDCLOCK_PLUGIN) + { QStringLiteral("worldclock"), plugin_ptr_t{new LxQtWorldClockLibrary} },// worldclock +#endif + }; + static constexpr plugin_pair_t const * const plugins_begin = static_plugins; + static constexpr plugin_pair_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]); + + struct assert_helper { - qWarning() << mPluginLoader->errorString(); - return false; - } + assert_helper() + { + Q_ASSERT(std::is_sorted(plugins_begin, plugins_end + , [] (plugin_pair_t const & p1, plugin_pair_t const & p2) -> bool { return p1.first < p2.first; })); + } + }; + static assert_helper h; +} - ILxQtPanelPluginLibrary* pluginLib= qobject_cast(obj); - if (!pluginLib) - { - qWarning() << QString("Can't load plugin \"%1\". Plugin is not a ILxQtPanelPluginLibrary.").arg(mPluginLoader->fileName()); - delete obj; - return false; - } +ILxQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName) +{ + // find a static plugin library by name -> binary search + plugin_pair_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName + , [] (plugin_pair_t const & plugin, QString const & name) -> bool { return plugin.first < name; }); + if (plugins_end != plugin && libraryName == plugin->first) + return plugin->second.get(); + return nullptr; +} +// load a plugin from a library +bool Plugin::loadLib(ILxQtPanelPluginLibrary const * pluginLib) +{ ILxQtPanelPluginStartupInfo startupInfo; startupInfo.settings = mSettings; startupInfo.desktopFile = &mDesktopFile; @@ -190,7 +256,6 @@ bool Plugin::loadLib(const QString &libraryName) if (!mPlugin) { qWarning() << QString("Can't load plugin \"%1\". Plugin can't build ILxQtPanelPlugin.").arg(mPluginLoader->fileName()); - delete obj; return false; } @@ -200,10 +265,37 @@ bool Plugin::loadLib(const QString &libraryName) mPluginWidget->setObjectName(mPlugin->themeId()); } this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - return true; } +// load dynamic plugin from a *.so module +bool Plugin::loadModule(const QString &libraryName) +{ + mPluginLoader = new QPluginLoader(libraryName); + + if (!mPluginLoader->load()) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + QObject *obj = mPluginLoader->instance(); + if (!obj) + { + qWarning() << mPluginLoader->errorString(); + return false; + } + + ILxQtPanelPluginLibrary* pluginLib= qobject_cast(obj); + if (!pluginLib) + { + qWarning() << QString("Can't load plugin \"%1\". Plugin is not a ILxQtPanelPluginLibrary.").arg(mPluginLoader->fileName()); + delete obj; + return false; + } + return loadLib(pluginLib); +} + /************************************************ diff --git a/panel/plugin.h b/panel/plugin.h index ca47c1f..d8eff78 100644 --- a/panel/plugin.h +++ b/panel/plugin.h @@ -67,9 +67,9 @@ public: void saveSettings(); QMenu* popupMenu() const; - ILxQtPanelPlugin * iPlugin() const { return mPlugin; } + const ILxQtPanelPlugin * iPlugin() const { return mPlugin; } - const LxQt::PluginInfo desktopFile() { return mDesktopFile; } + const LxQt::PluginInfo desktopFile() const { return mDesktopFile; } bool isSeparate() const; bool isExpandable() const; @@ -84,6 +84,8 @@ public: public slots: void realign(); + void showConfigureDialog(); + void requestRemove(); signals: void startMove(); @@ -96,7 +98,9 @@ protected: void showEvent(QShowEvent *event); private: - bool loadLib(const QString &libraryName); + bool loadLib(ILxQtPanelPluginLibrary const * pluginLib); + bool loadModule(const QString &libraryName); + ILxQtPanelPluginLibrary const * findStaticPlugin(const QString &libraryName); const LxQt::PluginInfo mDesktopFile; QByteArray calcSettingsHash(); @@ -113,8 +117,6 @@ private: private slots: void settingsChanged(); - void showConfigureDialog(); - void requestRemove(); }; diff --git a/panel/resources/panel.conf b/panel/resources/panel.conf index a423df9..59653f4 100644 --- a/panel/resources/panel.conf +++ b/panel/resources/panel.conf @@ -1,7 +1,7 @@ panels=panel1 [panel1] -plugins=mainmenu,desktopswitch,quicklaunch,taskbar,tray,mount,panelvolume,clock +plugins=mainmenu,desktopswitch,quicklaunch,taskbar,tray,statusnotifier,mount,volume,clock,showdesktop position=Bottom desktop=0 @@ -17,7 +17,6 @@ apps/size=5 apps/1/desktop=firefox.desktop apps/2/desktop=chromium-browser.desktop apps/3/desktop=pcmanfm-qt.desktop -apps/4/desktop=KMail.desktop apps/5/desktop=lxqt-config.desktop [taskbar] @@ -32,6 +31,14 @@ type=mount [clock] type=clock -[panelvolume] +[volume] device=0 -type=panelvolume +type=volume + +[showdesktop] +alignment=Right +type=showdesktop + +[statusnotifier] +alignment=Right +type=statusnotifier diff --git a/panel/translations/lxqt-panel.ts b/panel/translations/lxqt-panel.ts index 581fe61..29a35b1 100644 --- a/panel/translations/lxqt-panel.ts +++ b/panel/translations/lxqt-panel.ts @@ -1,219 +1,313 @@ - + + + AddPluginDialog + + + Add Plugins + + + + + Search: + + + + + Add Widget + + + + + Close + + + + + (only one instance can run at a time) + + + ConfigPanelDialog - - + Configure Panel + + + Panel + + + + + Widgets + + ConfigPanelWidget - + Configure panel - + Size - - Size: + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - - - px + + Size: - - Icon size: + + Length: - - Length: + + % - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + + px - - % + + + px - - px + + Icon size: - + Rows count: - + Alignment && position - - + + Position: + + + + + Alignment: + + + + + Left - - - + + + Center - - + + Right - - Alignment: + + Auto-hide - - Position: + + Custom styling - - Styling + + Font color: - - Custom font color: + + Background color: - - Custom background image: + + Background opacity: - - Custom background color: + + <small>Compositing is required for panel transparency.</small> - - Opacity + + Background image: - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + + Pick image + + + + Images (*.png *.gif *.jpg) - LxQtPanel + ConfigPluginsWidget + + + Configure Plugins + + + + + Note: changes made in this page cannot be reset. + + + + + Move up + + + + + + + + + ... + + - - Add Panel Widgets + + Move down - - + + Add + + + + + Remove + + + + + Configure + + + + + LxQtPanel + + + Panel - - Configure Panel... + + Configure Panel - - Add Panel Widgets... + + Manage Widgets - + Add Panel - + Remove Panel @@ -221,19 +315,32 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" + + main + + + Use alternate configuration file. + + + + + Configuration file + + + diff --git a/panel/translations/lxqt-panel_ar.ts b/panel/translations/lxqt-panel_ar.ts index 5b7564c..69084ec 100644 --- a/panel/translations/lxqt-panel_ar.ts +++ b/panel/translations/lxqt-panel_ar.ts @@ -154,20 +154,20 @@ - + Left اليسار - - + + Center الوسظ - + Right اليمين @@ -182,88 +182,93 @@ الموقع: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop أعلى سطح المكتب - + Left of desktop يسار سطح المكتب - + Right of desktop يمين سطح المكتب - + Bottom of desktop أسفل سطح المكتب - + Top of desktop %1 أعلى سطح المكتب %1 - + Left of desktop %1 يسار سطح المكتب %1 - + Right of desktop %1 يمين سطح المكتب %1 - + Bottom of desktop %1 أسفل سطح المكتب %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel قائمة التطبيقات - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_cs.ts b/panel/translations/lxqt-panel_cs.ts index debfd1f..81fe3e7 100644 --- a/panel/translations/lxqt-panel_cs.ts +++ b/panel/translations/lxqt-panel_cs.ts @@ -154,20 +154,20 @@ - + Left Zarovnat vlevo - - + + Center Zarovnat na střed - + Right Zarovnat vpravo @@ -182,88 +182,93 @@ Poloha: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Horní strana pracovní plochy - + Left of desktop Levá strana pracovní plochy - + Right of desktop Pravá strana pracovní plochy - + Bottom of desktop Dolní strana pracovní plochy - + Top of desktop %1 Horní strana pracovní plochy %1 - + Left of desktop %1 Levá strana pracovní plochy %1 - + Right of desktop %1 Pravá strana pracovní plochy %1 - + Bottom of desktop %1 Dolní strana pracovní plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_cs_CZ.ts b/panel/translations/lxqt-panel_cs_CZ.ts index 9652242..c3dc66e 100644 --- a/panel/translations/lxqt-panel_cs_CZ.ts +++ b/panel/translations/lxqt-panel_cs_CZ.ts @@ -154,20 +154,20 @@ - + Left Zarovnat vlevo - - + + Center Zarovnat na střed - + Right Zarovnat vpravo @@ -182,88 +182,93 @@ Poloha: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Horní strana pracovní plochy - + Left of desktop Levá strana pracovní plochy - + Right of desktop Pravá strana pracovní plochy - + Bottom of desktop Dolní strana pracovní plochy - + Top of desktop %1 Horní strana pracovní plochy %1 - + Left of desktop %1 Levá strana pracovní plochy %1 - + Right of desktop %1 Pravá strana pracovní plochy %1 - + Bottom of desktop %1 Dolní strana pracovní plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_da.ts b/panel/translations/lxqt-panel_da.ts index 2f55f13..38d7997 100644 --- a/panel/translations/lxqt-panel_da.ts +++ b/panel/translations/lxqt-panel_da.ts @@ -118,20 +118,20 @@ - + Left Venstre - - + + Center Midtpå - + Right Højre @@ -146,88 +146,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Toppen af skrivebordet - + Left of desktop Venstre side af skrivebordet - + Right of desktop Højre side af skrivebordet - + Bottom of desktop Bunden af skrivebordet - + Top of desktop %1 Toppen af skrivebord %1 - + Left of desktop %1 Venstre side af skrivebord %1 - + Right of desktop %1 Højre side af skrivebord %1 - + Bottom of desktop %1 Bunden af skrivebord %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -235,33 +240,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -319,17 +324,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_da_DK.ts b/panel/translations/lxqt-panel_da_DK.ts index 6f94773..f4d72d3 100644 --- a/panel/translations/lxqt-panel_da_DK.ts +++ b/panel/translations/lxqt-panel_da_DK.ts @@ -154,20 +154,20 @@ - + Left Venstrestillet - - + + Center Midterstillet - + Right Højrestillet @@ -182,88 +182,93 @@ Position: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Toppen af skrivebordet - + Left of desktop Venstre side af skrivebordet - + Right of desktop Højre side af skrivebordet - + Bottom of desktop Bunden af skrivebordet - + Top of desktop %1 Toppen af skrivebord %1 - + Left of desktop %1 Venstre side af skrivebord %1 - + Right of desktop %1 Højre side af skrivebord %1 - + Bottom of desktop %1 Bunden af skrivebord %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Hej Verden - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_de.ts b/panel/translations/lxqt-panel_de.ts index a333361..9d73207 100644 --- a/panel/translations/lxqt-panel_de.ts +++ b/panel/translations/lxqt-panel_de.ts @@ -2,352 +2,345 @@ - ConfigPanelDialog - - Configure panel - Panel konfigurieren - - - Panel size - Leistengröße - - - Size: - Höhe: - - - px - px - - - Use automatic sizing - Automatische Größe verwenden - + AddPluginDialog - Panel length && position - Leistenlänge und Position + + Add Plugins + Plugins hinzufügen - Left - Links + + Search: + Suchen: - Center - Zentriert + + Add Widget + Widget hinzufügen - Right - Rechts + + Close + Schließen - % - % - - - Alignment: - Ausrichtung: - - - Length: - Länge: - - - Position: - Position: - - - Top of desktop - Oben - - - Left of desktop - Links - - - Right of desktop - Rechts - - - Bottom of desktop - Unten - - - Top of desktop %1 - Oben %1 - - - Left of desktop %1 - Links %1 + + (only one instance can run at a time) + (es kann nur eine Instanz gleichzeitig ausgeführt werden) + + + ConfigPanelDialog - Right of desktop %1 - Rechts %1 + + Configure Panel + Leiste konfigurieren - Bottom of desktop %1 - Unten %1 + + Panel + Leiste - - - Configure Panel - + + Widgets + Widgets ConfigPanelWidget - + Configure panel - Panel konfigurieren + Leiste konfigurieren - + Size - + Größe - - Size: - Höhe: + + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> + <p>Negative Pixelwerte setzen die Leistenlänge auf den Wert verfügbare Größe minus angegebener Größe.</p><p/><p><i>Z.B. bei "Länge" gesetzt auf -100px und einer Bildschirmgröße von 1000px hat die Leiste eine Größe von 900 px.</i></p> - - - px - + + Size: + Größe: - - Icon size: - + + Length: + Länge: - - Length: - Länge: + + % + % - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + + px + px - - % - % + + + px + px - - px - px + + Icon size: + Symbolgröße: - + Rows count: - + Zeilenzahl: - + Alignment && position - + Ausrichtung und Position + + + + Position: + Position: - - + + Alignment: + Ausrichtung: + + + + Left - Links + Links - - - + + + Center - Zentriert + Mitte - - + + Right - Rechts + Rechts - - Alignment: - Ausrichtung: + + Auto-hide + Automatisch ausblenden - - Position: - Position: + + Custom styling + Eigener Stil - - Styling - + + Font color: + Schriftfarbe: - - Custom font color: - + + Background color: + Hintergrundfarbe: - - Custom background image: - + + Background opacity: + Deckkraft: - - Custom background color: - + + <small>Compositing is required for panel transparency.</small> + <small>Für Transparenzeffekt wird Compositing benötigt.</small> - - Opacity - + + Background image: + Hintergrundbild: - + Top of desktop - Oben + Oben auf der Arbeitsfläche - + Left of desktop - Links + Links auf der Arbeitsfläche - + Right of desktop - Rechts + Rechts auf der Arbeitsfläche - + Bottom of desktop - Unten + Unten auf der Arbeitsfläche - + Top of desktop %1 - Oben %1 + Oben auf Arbeitsfläche %1 - + Left of desktop %1 - Links %1 + Links auf Arbeitsfläche %1 - + Right of desktop %1 - Rechts %1 + Rechts auf Arbeitsfläche %1 - + Bottom of desktop %1 - Unten %1 + Unten auf Arbeitsfläche %1 - + Top - + Oben - + Bottom - + Unten - - + + Pick color - + Farbe auswählen + + + + Pick image + Bild auswählen - + Images (*.png *.gif *.jpg) - + Bilder (*.png *.gif *.jpg) - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - + + Configure Plugins + Plugins konfigurieren - - - Panel - LxQt Konfigurations Center + + Note: changes made in this page cannot be reset. + Hinweis: Hier gemachte Änderungen können nicht rückgängig gemacht werden. - - Configure Panel... - + + Move up + Nach oben schieben - - Add Panel Widgets... - + + + + + + ... + ... - - Add Panel - + + Move down + Nach unten schieben - - Remove Panel - + + Add + Hinzufügen - Configure panel... - Panel konfigurieren... + + Remove + Entfernen - Add plugins ... - Plugins hinzufügen ... + + Configure + Konfigurieren - LxQtPanelPlugin + LxQtPanel - Configure - Konfigurieren + + + Panel + Leiste - Move - Verschieben + + Configure Panel + Leiste konfigurieren - Remove - Entfernen + + Manage Widgets + Widgets verwalten - - - LxQtPanelPrivate - Configure panel - Panel konfigurieren + + Add Panel + Leiste hinzufügen + + + + Remove Panel + Leiste entfernen Plugin - + Configure "%1" - + "%1" konfigurieren - + Move "%1" - + "%1" verschieben - + Remove "%1" - + "%1" entfernen + + + + main + + + Use alternate configuration file. + Alternative Konfigurationsdatei verwenden. + + + + Configuration file + Konfigurationsdatei diff --git a/panel/translations/lxqt-panel_de_DE.ts b/panel/translations/lxqt-panel_de_DE.ts deleted file mode 100644 index 4f1c3dd..0000000 --- a/panel/translations/lxqt-panel_de_DE.ts +++ /dev/null @@ -1,353 +0,0 @@ - - - - - ConfigPanelDialog - - Configure panel - Panel konfigurieren - - - Panel size - Panelgröße - - - Size: - Größe: - - - px - px - - - Use automatic sizing - Größe automatisch anpassen - - - Panel length && position - Panel Länge && Position - - - Left - Links - - - Center - Mitte - - - Right - Rechts - - - % - % - - - Alignment: - Ausrichtung: - - - Length: - Länge: - - - Position: - Position: - - - Top of desktop - Oben auf dem Desktop - - - Left of desktop - Links auf dem Desktop - - - Right of desktop - Rechts auf dem Desktop - - - Bottom of desktop - Unten auf dem Desktop - - - Top of desktop %1 - Oben auf dem Desktop %1 - - - Left of desktop %1 - Links auf dem Desktop %1 - - - Right of desktop %1 - Rechts auf dem Desktop %1 - - - Bottom of desktop %1 - Unten auf dem Desktop %1 - - - - - Configure Panel - - - - - ConfigPanelWidget - - - Configure panel - Panel konfigurieren - - - - Size - - - - - Size: - Größe: - - - - - px - - - - - Icon size: - - - - - Length: - Länge: - - - - <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - - - - - % - % - - - - px - px - - - - Rows count: - - - - - Alignment && position - - - - - - Left - Links - - - - - - Center - Mitte - - - - - Right - Rechts - - - - Alignment: - Ausrichtung: - - - - Position: - Position: - - - - Styling - - - - - Custom font color: - - - - - Custom background image: - - - - - Custom background color: - - - - - Opacity - - - - - Top of desktop - Oben auf dem Desktop - - - - Left of desktop - Links auf dem Desktop - - - - Right of desktop - Rechts auf dem Desktop - - - - Bottom of desktop - Unten auf dem Desktop - - - - Top of desktop %1 - Oben auf dem Desktop %1 - - - - Left of desktop %1 - Links auf dem Desktop %1 - - - - Right of desktop %1 - Rechts auf dem Desktop %1 - - - - Bottom of desktop %1 - Unten auf dem Desktop %1 - - - - Top - - - - - Bottom - - - - - - Pick color - - - - - Images (*.png *.gif *.jpg) - - - - - LxQtPanel - - - Add Panel Widgets - - - - - - Panel - Anwendungsmenü - - - - Configure Panel... - - - - - Add Panel Widgets... - - - - - Add Panel - - - - - Remove Panel - - - - Configure panel... - Konfiguriere Panel... - - - Add plugins ... - Plugins hinzufügen ... - - - - LxQtPanelPlugin - - Configure - Konfigurieren - - - Move - Bewegen - - - Remove - Entfernen - - - - LxQtPanelPrivate - - Configure panel - Panel konfigurieren - - - - Plugin - - - Configure "%1" - - - - - Move "%1" - - - - - Remove "%1" - - - - diff --git a/panel/translations/lxqt-panel_el_GR.ts b/panel/translations/lxqt-panel_el_GR.ts index 30802d2..b0a3b99 100644 --- a/panel/translations/lxqt-panel_el_GR.ts +++ b/panel/translations/lxqt-panel_el_GR.ts @@ -154,20 +154,20 @@ - + Left Αριστερά - - + + Center Κέντρο - + Right Δεξιά @@ -182,88 +182,93 @@ Θέση: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Επάνω στην επιφάνεια εργασίας - + Left of desktop Αριστερά στην επιφάνεια εργασίας - + Right of desktop Δεξιά στην επιφάνεια εργασίας - + Bottom of desktop Κάτω στην επιφάνεια εργασίας - + Top of desktop %1 Επάνω στην επιφάνεια εργασίας %1 - + Left of desktop %1 Αριστερά στην επιφάνεια εργασίας %1 - + Right of desktop %1 Δεξιά στην επιφάνεια εργασίας %1 - + Bottom of desktop %1 Κάτω στην επιφάνεια εργασίας %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Πίνακας - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_eo.ts b/panel/translations/lxqt-panel_eo.ts index 61d265c..4cb2801 100644 --- a/panel/translations/lxqt-panel_eo.ts +++ b/panel/translations/lxqt-panel_eo.ts @@ -154,20 +154,20 @@ - + Left Maldekstre - - + + Center Centre - + Right Dekstre @@ -182,88 +182,93 @@ Loko: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Supre de labortablo - + Left of desktop Maldekstre de labortablo - + Right of desktop Dekstre de labortablo - + Bottom of desktop Malsupre de labortablo - + Top of desktop %1 Supre de labortablo %1 - + Left of desktop %1 Maldekstre de labortablo %1 - + Right of desktop %1 Dekstre de labortablo %1 - + Bottom of desktop %1 Malsupre de labortablo %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Agordoj de muso por LxQto - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_es.ts b/panel/translations/lxqt-panel_es.ts index c51e074..23fd321 100644 --- a/panel/translations/lxqt-panel_es.ts +++ b/panel/translations/lxqt-panel_es.ts @@ -154,20 +154,20 @@ - + Left Izquierda - - + + Center Centro - + Right Derecha @@ -182,88 +182,93 @@ Posición: - + + Auto-hide + Ocultar automáticamente + + + Styling Estilo - + Custom font color: Color de fuente personalizado: - + Custom background image: Imagen de fondo personalizada: - + Custom background color: Color de fondo personalizado: - + Opacity Opacidad - + Top of desktop Extremo superior del escritorio - + Left of desktop Extremo izquierdo del escritorio - + Right of desktop Extremo derecho del escritorio - + Bottom of desktop Extremo inferior del escritorio - + Top of desktop %1 Extremo superior del escritorio %1 - + Left of desktop %1 Extremo izquierdo del escritorio %1 - + Right of desktop %1 Extremo derecho del escritorio %1 - + Bottom of desktop %1 Extremo inferior del escritorio %1 - + Top Arriba - + Bottom Abajo - - + + Pick color Seleccione un color - + Images (*.png *.gif *.jpg) Imágenes (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets Agregar Widgets al Panel - - + + Panel Panel - + Configure Panel... Configurar Panel... - + Add Panel Widgets... Agregar Widgets al Panel... - + Add Panel Agregar Panel - + Remove Panel Eliminar Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" Configurar "%1" - + Move "%1" Mover "%1" - + Remove "%1" Eliminar "%1" diff --git a/panel/translations/lxqt-panel_es_UY.ts b/panel/translations/lxqt-panel_es_UY.ts index a7ff1c3..bb6c46e 100644 --- a/panel/translations/lxqt-panel_es_UY.ts +++ b/panel/translations/lxqt-panel_es_UY.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Arriba del escritorio - + Left of desktop A la izquierda del escritorio - + Right of desktop A la derecha del escritorio - + Bottom of desktop Abajo del escritorio - + Top of desktop %1 Arriba del escritorio %1 - + Left of desktop %1 A la izquierda del escritorio %1 - + Right of desktop %1 A la derecha del excritorio %1 - + Bottom of desktop %1 Abajo del escritorio %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -252,17 +257,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_es_VE.ts b/panel/translations/lxqt-panel_es_VE.ts index 2b3e6ec..999c321 100644 --- a/panel/translations/lxqt-panel_es_VE.ts +++ b/panel/translations/lxqt-panel_es_VE.ts @@ -154,20 +154,20 @@ - + Left Izquierda - - + + Center Centrado - + Right Derecha @@ -182,88 +182,93 @@ Posicion: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Tope del escritorio - + Left of desktop Izquierda del escritorio - + Right of desktop Derecha del escritorio - + Bottom of desktop Inferior del escritorio - + Top of desktop %1 Tope del escritorio %1 - + Left of desktop %1 Izquierda del escritorio %1 - + Right of desktop %1 Derecha del escritorio %1 - + Bottom of desktop %1 Inferior del escritorio %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_eu.ts b/panel/translations/lxqt-panel_eu.ts index a23e5d7..6c1ef09 100644 --- a/panel/translations/lxqt-panel_eu.ts +++ b/panel/translations/lxqt-panel_eu.ts @@ -154,20 +154,20 @@ - + Left Ezkerra - - + + Center Erdia - + Right Eskuina @@ -182,88 +182,93 @@ Posizioa: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Mahaigainaren goialdea - + Left of desktop Mahaigainaren ezkerraldea - + Right of desktop Mahaigainaren eskuinaldea - + Bottom of desktop Mahaigainaren behealdea - + Top of desktop %1 %1 mahaigainaren goialdea - + Left of desktop %1 %1 mahaigainaren ezkerraldea - + Right of desktop %1 %1 mahaigainaren eskuinaldea - + Bottom of desktop %1 %1 mahaigainaren behealdea - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panela - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_fi.ts b/panel/translations/lxqt-panel_fi.ts index e948b50..615991e 100644 --- a/panel/translations/lxqt-panel_fi.ts +++ b/panel/translations/lxqt-panel_fi.ts @@ -154,20 +154,20 @@ - + Left Vasemmalla - - + + Center Keskellä - + Right Oikealla @@ -182,88 +182,93 @@ Sijainti: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Työpöydän yläosassa - + Left of desktop Työpöydän vasemmassa laidassa - + Right of desktop Työpöydän oikeassa laidassa - + Bottom of desktop Työpöydän alaosassa - + Top of desktop %1 Työpöydän %1 yläosassa - + Left of desktop %1 Työpöydän %1 vasemmassa laidassa - + Right of desktop %1 Työpöydän %1 oikeassa laidassa - + Bottom of desktop %1 Työpöydän %1 alaosassa - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Paneeli - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_fr_FR.ts b/panel/translations/lxqt-panel_fr_FR.ts index 1313fcc..18f34f9 100644 --- a/panel/translations/lxqt-panel_fr_FR.ts +++ b/panel/translations/lxqt-panel_fr_FR.ts @@ -154,20 +154,20 @@ - + Left Gauche - - + + Center Centre - + Right Droite @@ -182,88 +182,93 @@ Position : - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Haut du bureau - + Left of desktop Gauche du bureau - + Right of desktop Droite du bureau - + Bottom of desktop Bas du bureau - + Top of desktop %1 Haut du bureau %1 - + Left of desktop %1 Gauche du bureau %1 - + Right of desktop %1 Droite du bureau %1 - + Bottom of desktop %1 Bas du bureau %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Bloc-notes - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_hu.ts b/panel/translations/lxqt-panel_hu.ts index dbb708e..2927d16 100644 --- a/panel/translations/lxqt-panel_hu.ts +++ b/panel/translations/lxqt-panel_hu.ts @@ -1,97 +1,45 @@ - + ConfigPanelDialog - - Configure panel - Panelbeállítás - - - Panel size - Panelméret - - - Size: - Méret: - - - px - px - - - Use automatic sizing - Automatikus méretezés - - - Panel length && position - Panelhossz és elhelyezkedés - - - Left - Balra - - - Center - Középre - - - Right - Jobbra - - - % - % - - - Alignment: - Igazítás: - - - Length: - Hossz: - - - Position: - Pozíció: - Top of desktop - Az asztal tetején + Az asztal tetejére Left of desktop - Az asztal bal oldalán + Az asztal bal oldalára Right of desktop - Az asztal jobb oldalán + Az asztal jobb oldalára Bottom of desktop - Az asztal alján + Az asztal aljára Top of desktop %1 - A(z) %1. asztal tetején + A(z) %1. asztal tetejére Left of desktop %1 - A(z) %1. asztal bal oldalán + A(z) %1. asztal bal oldalára Right of desktop %1 - A(z) %1. asztal jobb oldalán + A(z) %1. asztal jobb oldalára Bottom of desktop %1 - A(z) %1. asztal alján + A(z) %1. asztal aljára Configure Panel - + Panelbeállítás @@ -99,255 +47,234 @@ Configure panel - Panelbeállítás + Panelbeállítás Size - + Méret Size: - Méret: + Méret: px - + pixel Icon size: - + Ikonméret: Length: - Hossz: + Hossz: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p % - % + px - px + pixel Rows count: - + Sorszámláló: Alignment && position - + Igazítás && helyzet - + Left - Balra + Balra - - + + Center - Középre + Középre - + Right - Jobbra + Jobbra Alignment: - Igazítás: + Igazítás: Position: - Pozíció: + Pozíció: + + + + Auto-hide + Automata elrejtés - + Styling - + Hangolás - + Custom font color: - + Egyéni betűszín: - + Custom background image: - + Egyéni háttérkép: - + Custom background color: - + Egyéni háttérszín: - + Opacity - + Áttetszőség - + Top of desktop - Az asztal tetején + Az asztal tetejére - + Left of desktop - Az asztal bal oldalán + Az asztal bal oldalára - + Right of desktop - Az asztal jobb oldalán + Az asztal jobb oldalára - + Bottom of desktop - Az asztal alján + Az asztal aljára - + Top of desktop %1 - A(z) %1. asztal tetején + A(z) %1. asztal tetejére - + Left of desktop %1 - A(z) %1. asztal bal oldalán + A(z) %1. asztal bal oldalára - + Right of desktop %1 - A(z) %1. asztal jobb oldalán + A(z) %1. asztal jobb oldalára - + Bottom of desktop %1 - A(z) %1. asztal alján + A(z) %1. asztal aljára - + Top - + Fenn - + Bottom - + Lenn - - + + Pick color - + Színválasztás - + Images (*.png *.gif *.jpg) - + Képek (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Panelelem hozzáadás - - + + Panel - Alkalmazásmenü + Panel - + Configure Panel... - + Panel beállítása… - + Add Panel Widgets... - + Panelelem hozzáadás... - + Add Panel - + Panel hozzáadás - + Remove Panel - - - - Configure panel... - Panel beállítása… + Panel törlése Add plugins ... - Bővítmények hozzáadása… - - - - LxQtPanelPlugin - - Configure - Beállítás - - - Move - Mozgatás - - - Remove - Eltávolítás - - - - LxQtPanelPrivate - - Configure panel - Panelbeállítás + Bővítmények hozzáadása… Plugin - + Configure "%1" - + "%1" beállítása - + Move "%1" - + "%1" mozgatása - + Remove "%1" - + "%1" törlése diff --git a/panel/translations/lxqt-panel_hu_HU.ts b/panel/translations/lxqt-panel_hu_HU.ts index 7a409b6..36e03e1 100644 --- a/panel/translations/lxqt-panel_hu_HU.ts +++ b/panel/translations/lxqt-panel_hu_HU.ts @@ -1,45 +1,45 @@ - + ConfigPanelDialog Top of desktop - Az asztal tetejére + Az asztal tetejére Left of desktop - Az asztal bal oldalára + Az asztal bal oldalára Right of desktop - Az asztal jobb oldalára + Az asztal jobb oldalára Bottom of desktop - Az asztal aljára + Az asztal aljára Top of desktop %1 - A(z) %1. asztal tetejére + A(z) %1. asztal tetejére Left of desktop %1 - A(z) %1. asztal bal oldalára + A(z) %1. asztal bal oldalára Right of desktop %1 - A(z) %1. asztal jobb oldalára + A(z) %1. asztal jobb oldalára Bottom of desktop %1 - A(z) %1. asztal aljára + A(z) %1. asztal aljára Configure Panel - + Panelbeállítás @@ -47,229 +47,234 @@ Configure panel - + Panelbeállítás Size - + Méret Size: - + Méret: px - + pixel Icon size: - + Ikonméret: Length: - + Hossz: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Negatív pixel érték azt jelöli, hogy mennyivel rövidebb a panel a képernyőnél.</p><p/><p><i>Például -100px érték esetén az 1000px széles képernyőnél a panel hossza 900px.</i></p % - + px - + pixel Rows count: - + Sorszámláló: Alignment && position - + Igazítás && helyzet - + Left - + Balra - - + + Center - + Középre - + Right - + Jobbra Alignment: - + Igazítás: Position: - + Pozíció: + + + + Auto-hide + Automata elrejtés - + Styling - + Hangolás - + Custom font color: - + Egyéni betűszín: - + Custom background image: - + Egyéni háttérkép: - + Custom background color: - + Egyéni háttérszín: - + Opacity - + Áttetszőség - + Top of desktop - Az asztal tetejére + Az asztal tetejére - + Left of desktop - Az asztal bal oldalára + Az asztal bal oldalára - + Right of desktop - Az asztal jobb oldalára + Az asztal jobb oldalára - + Bottom of desktop - Az asztal aljára + Az asztal aljára - + Top of desktop %1 - A(z) %1. asztal tetejére + A(z) %1. asztal tetejére - + Left of desktop %1 - A(z) %1. asztal bal oldalára + A(z) %1. asztal bal oldalára - + Right of desktop %1 - A(z) %1. asztal jobb oldalára + A(z) %1. asztal jobb oldalára - + Bottom of desktop %1 - A(z) %1. asztal aljára + A(z) %1. asztal aljára - + Top - + Fenn - + Bottom - + Lenn - - + + Pick color - + Színválasztás - + Images (*.png *.gif *.jpg) - + Képek (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Panelelem hozzáadás - - + + Panel Panel - + Configure Panel... - + Panel beállítása… - + Add Panel Widgets... - + Panelelem hozzáadás... - + Add Panel - + Panel hozzáadás - + Remove Panel - + Panel törlése Add plugins ... - Bővítmények hozzáadása… + Bővítmények hozzáadása… Plugin - + Configure "%1" - + "%1" beállítása - + Move "%1" - + "%1" mozgatása - + Remove "%1" - + "%1" törlése diff --git a/panel/translations/lxqt-panel_ia.ts b/panel/translations/lxqt-panel_ia.ts index df840bf..d6eee7d 100644 --- a/panel/translations/lxqt-panel_ia.ts +++ b/panel/translations/lxqt-panel_ia.ts @@ -78,20 +78,20 @@ - + Left - - + + Center - + Right @@ -106,88 +106,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -195,33 +200,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -229,17 +234,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_id_ID.ts b/panel/translations/lxqt-panel_id_ID.ts index d96a9ce..9798e2f 100644 --- a/panel/translations/lxqt-panel_id_ID.ts +++ b/panel/translations/lxqt-panel_id_ID.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Hell World - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_it.ts b/panel/translations/lxqt-panel_it.ts index bf4acf0..8af869e 100644 --- a/panel/translations/lxqt-panel_it.ts +++ b/panel/translations/lxqt-panel_it.ts @@ -91,7 +91,7 @@ Configure Panel - + Configura panello @@ -99,207 +99,213 @@ Configure panel - + Configura panello Size - + Dimensione Size: - Dimensione: + Dimensione: px - + Icon size: - + Dimensione icone: Length: - Lunghezza: + Lunghezza: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> % - % + % px - px + px Rows count: - + Numero righe: Alignment && position - + Allineamento e posizione - + Left - Sinistra + Sinistra - - + + Center - Centro + Centro - + Right - Destra + Destra Alignment: - Allineamento: + Allineamento: Position: - Posizione: + Posizione: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Aspetto + Custom font color: + Colore carattere personalizzato: + + + Custom background image: - + Immagine sfondo: - + Custom background color: - + Colore sfondo personalizzato: - + Opacity - + Trasparenza - + Top of desktop - Alto del desktop + Alto del desktop - + Left of desktop - Sinistra del desktop + Sinistra del desktop - + Right of desktop - Destra del desktop + Destra del desktop - + Bottom of desktop - Basso del desktop + Basso del desktop - + Top of desktop %1 - Alto del desktop %1 + Alto del desktop %1 - + Left of desktop %1 - Sinistra del desktop %1 + Sinistra del desktop %1 - + Right of desktop %1 - Destra del desktop %1 + Destra del desktop %1 - + Bottom of desktop %1 - Basso del desktop %1 + Basso del desktop %1 - + Top - + In cima - + Bottom - + In fondo - - + + Pick color - + Scegli colore - + Images (*.png *.gif *.jpg) - + Immagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Aggiungi elementi - - + + Panel - Centro di Configurazione LxQt + Panello - + Configure Panel... - + Configura pannello... - + Add Panel Widgets... - + Call them "plugins" better? + Aggiungi elementi... - + Add Panel - + Aggiungi panello - + Remove Panel - + Rimuovi panello Configure panel... @@ -335,19 +341,19 @@ Plugin - + Configure "%1" - + Configura "%1" - + Move "%1" - + Sposta "%1" - + Remove "%1" - + Rimuovi "%1" diff --git a/panel/translations/lxqt-panel_it_IT.ts b/panel/translations/lxqt-panel_it_IT.ts index ebdc5ba..c5e4236 100644 --- a/panel/translations/lxqt-panel_it_IT.ts +++ b/panel/translations/lxqt-panel_it_IT.ts @@ -9,7 +9,7 @@ Panel size - Dimensione del pannello + Dimensione pannello Size: @@ -21,11 +21,11 @@ Use automatic sizing - Utilizza il dimensionamento automatico + Usa dimensionamento automatico Panel length && position - Posizione e larghezza del pannello + Lunghezza e posizione del pannello Left @@ -49,7 +49,7 @@ Length: - Larghezza: + Lunghezza: Position: @@ -57,41 +57,41 @@ Top of desktop - In alto nel desktop + Alto del desktop Left of desktop - A sinistra nel desktop + Sinistra del desktop Right of desktop - A destra nel desktop + Destra del desktop Bottom of desktop - In basso nel desktop + Basso del desktop Top of desktop %1 - In alto nel desktop %1 + Alto del desktop %1 Left of desktop %1 - A sinistra nel desktop %1 + Sinistra del desktop %1 Right of desktop %1 - A destra nel desktop %1 + Destra del desktop %1 Bottom of desktop %1 - In basso nel desktop %1 + Basso del desktop %1 Configure Panel - + Configura panello @@ -99,215 +99,221 @@ Configure panel - Configura il pannello + Configura panello Size - + Dimensione Size: - Dimensione: + Dimensione: px - + Icon size: - + Dimensione icone: Length: - Larghezza: + Lunghezza: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Valori negativi impongano una lunghezza del panello di quel numero di pixel meno dello spazio disponibile. </p><p/><p><i>Esempio: -100px e schermo di 1280px = 1180px</i></p> % - % + % px - px + px Rows count: - + Numero righe: Alignment && position - + Allineamento e posizione - + Left - Sinistra + Sinistra - - + + Center - Centro + Centro - + Right - Destra + Destra Alignment: - Allineamento: + Allineamento: Position: - Posizione: + Posizione: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Aspetto + Custom font color: + Colore carattere personalizzato: + + + Custom background image: - + Immagine sfondo: - + Custom background color: - + Colore sfondo personalizzato: - + Opacity - + Trasparenza - + Top of desktop - In alto nel desktop + Alto del desktop - + Left of desktop - A sinistra nel desktop + Sinistra del desktop - + Right of desktop - A destra nel desktop + Destra del desktop - + Bottom of desktop - In basso nel desktop + Basso del desktop - + Top of desktop %1 - In alto nel desktop %1 + Alto del desktop %1 - + Left of desktop %1 - A sinistra nel desktop %1 + Sinistra del desktop %1 - + Right of desktop %1 - A destra nel desktop %1 + Destra del desktop %1 - + Bottom of desktop %1 - In basso nel desktop %1 + Basso del desktop %1 - + Top - + In cima - + Bottom - + In fondo - - + + Pick color - + Scegli colore - + Images (*.png *.gif *.jpg) - + Immagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + Aggiungi elementi - - + + Panel - Esci + Panello - + Configure Panel... - + Configura pannello... - + Add Panel Widgets... - + Call them "plugins" better? + Aggiungi elementi... - + Add Panel - + Aggiungi panello - + Remove Panel - + Rimuovi panello Configure panel... - Configura il pannello... + Configura pannello... Add plugins ... - Aggiungi plugin ... + Aggiungi plugin... @@ -329,25 +335,25 @@ LxQtPanelPrivate Configure panel - Configura il pannello + Configura pannello Plugin - + Configure "%1" - + Configura "%1" - + Move "%1" - + Sposta "%1" - + Remove "%1" - + Rimuovi "%1" diff --git a/panel/translations/lxqt-panel_ja.ts b/panel/translations/lxqt-panel_ja.ts index 2392f5a..8cd0fbd 100644 --- a/panel/translations/lxqt-panel_ja.ts +++ b/panel/translations/lxqt-panel_ja.ts @@ -70,20 +70,20 @@ - + Left 左寄せ - - + + Center 中央 - + Right 右寄せ @@ -98,88 +98,93 @@ 場所: - + + Auto-hide + + + + Styling 見た目 - + Custom font color: フォントの色を変更: - + Custom background image: 背景画像を指定 - + Custom background color: 背景の色を変更: - + Opacity 透明度 - + Top of desktop デスクトップの上 - + Left of desktop デスクトップの左 - + Right of desktop デスクトップの右 - + Bottom of desktop デスクトップの下 - + Top of desktop %1 デスクトップ %1 の上 - + Left of desktop %1 デスクトップ %1 の左 - + Right of desktop %1 デスクトップ %1 の右 - + Bottom of desktop %1 デスクトップ %1 の下 - + Top - + Bottom - - + + Pick color 色を選ぶ - + Images (*.png *.gif *.jpg) 画像 (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets パネルウィジェットを追加 - - + + Panel パネル - + Configure Panel... パネルの設定 - + Add Panel Widgets... ウィジェットを追加 - + Add Panel パネルを追加 - + Remove Panel パネルを削除 @@ -221,17 +226,17 @@ Plugin - + Configure "%1" "%1" を設定 - + Move "%1" "%1" を移動 - + Remove "%1" "%1" を削除 diff --git a/panel/translations/lxqt-panel_ko.ts b/panel/translations/lxqt-panel_ko.ts index b7217b5..50f62a4 100644 --- a/panel/translations/lxqt-panel_ko.ts +++ b/panel/translations/lxqt-panel_ko.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_lt.ts b/panel/translations/lxqt-panel_lt.ts index 3aacd0b..5798d13 100644 --- a/panel/translations/lxqt-panel_lt.ts +++ b/panel/translations/lxqt-panel_lt.ts @@ -154,20 +154,20 @@ - + Left Kairinė - - + + Center Centrinė - + Right Dešininė @@ -182,88 +182,93 @@ Padėtis: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Darbalaukio viršuje - + Left of desktop Darbalaukio kairėje - + Right of desktop Darbalaukio dešinėje - + Bottom of desktop Darbalaukio apačioje - + Top of desktop %1 %1 darbalaukio viršuje - + Left of desktop %1 %1 darbalaukio kairėje - + Right of desktop %1 %1 darbalaukio dešinėje - + Bottom of desktop %1 %1 darbalaukio apačioje - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Qlipper - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_nl.ts b/panel/translations/lxqt-panel_nl.ts index d3801de..cc219c0 100644 --- a/panel/translations/lxqt-panel_nl.ts +++ b/panel/translations/lxqt-panel_nl.ts @@ -154,20 +154,20 @@ - + Left Links - - + + Center Midden - + Right Rechts @@ -182,88 +182,93 @@ Positie: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Bovenaan bureaublad - + Left of desktop Linkerzijkant van bureaublad - + Right of desktop Rechterzijkant van bureaublad - + Bottom of desktop Onderkant van bureaublad - + Top of desktop %1 Bovenkant van bureaublad %1 - + Left of desktop %1 Linkerzijkant van bureaublad %1 - + Right of desktop %1 Rechterzijkant van bureaublad %1 - + Bottom of desktop %1 Onderkant van bureaublad %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Paneel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pl.ts b/panel/translations/lxqt-panel_pl.ts index 4087d11..5663502 100644 --- a/panel/translations/lxqt-panel_pl.ts +++ b/panel/translations/lxqt-panel_pl.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Menu - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pl_PL.ts b/panel/translations/lxqt-panel_pl_PL.ts index 2246317..a7b9e3c 100644 --- a/panel/translations/lxqt-panel_pl_PL.ts +++ b/panel/translations/lxqt-panel_pl_PL.ts @@ -91,7 +91,7 @@ Configure Panel - + KOnfiguruj Panel @@ -99,207 +99,212 @@ Configure panel - Konfiguruj panel + Konfiguruj panel Size - + Rozmiar Size: - Rozmiar: + Rozmiar: px - + px Icon size: - + Rozmiar ikon: Length: - Długość: + Długość: <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Ujemna ilość pikseli powoduje zmniejszenie panelu .</p><p/><p><i>Np. "Długość" ustawiona na -100px, rozmiar ekranu 1000px, długość panelu wyniesie 900 px.</i></p> % - % + % px - px + px Rows count: - + Ilość wierszy: Alignment && position - + Wyrównanie i pozycja - + Left - Lewa + Lewa - - + + Center - Środek + Środek - + Right - Prawa + Prawa Alignment: - Wyrównanie: + Wyrównanie: Position: - Pozycja: + Pozycja: - - Styling + + Auto-hide - - Custom font color: - + + Styling + Wygląd + Custom font color: + Własny kolor czcionki: + + + Custom background image: - + Własny obrazek tła: - + Custom background color: - + Własny kolor tła: - + Opacity - + Przezroczystość - + Top of desktop - Górna krawędź pulpitu + Górna krawędź pulpitu - + Left of desktop - Lewa krawędź pulpitu + Lewa krawędź pulpitu - + Right of desktop - Prawa krawędź pulpitu + Prawa krawędź pulpitu - + Bottom of desktop - Dolna krawędź pulpitu + Dolna krawędź pulpitu - + Top of desktop %1 - Górna krawędź pulpitu %1 + Górna krawędź pulpitu %1 - + Left of desktop %1 - Lewa krawędź pulpitu %1 + Lewa krawędź pulpitu %1 - + Right of desktop %1 - Prawa krawędź pulpitu %1 + Prawa krawędź pulpitu %1 - + Bottom of desktop %1 - Dolna krawędź pulpitu %1 + Dolna krawędź pulpitu %1 - + Top - + Góra - + Bottom - + Dół - - + + Pick color - + Wybierz kolor - + Images (*.png *.gif *.jpg) - + Obrazki (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - + DOdaj Widgety - - + + Panel Panel - + Configure Panel... - + Konfiguruj Panel... - + Add Panel Widgets... - + Dodaj Widgety... - + Add Panel - + Dodaj Panel - + Remove Panel - + Usuń panel Configure panel... @@ -335,19 +340,19 @@ Plugin - + Configure "%1" - + Konfiguruj "%1" - + Move "%1" - + Przesuń "%1" - + Remove "%1" - + Usuń "%1" diff --git a/panel/translations/lxqt-panel_pt.ts b/panel/translations/lxqt-panel_pt.ts index f78691c..fa48398 100644 --- a/panel/translations/lxqt-panel_pt.ts +++ b/panel/translations/lxqt-panel_pt.ts @@ -154,20 +154,20 @@ - + Left À esquerda - - + + Center Ao centro - + Right À direita @@ -182,88 +182,93 @@ Posição: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Em cima - + Left of desktop À esquerda - + Right of desktop À direita - + Bottom of desktop Em baixo - + Top of desktop %1 Em cima, área de trabalho %1 - + Left of desktop %1 À esquerda, área de trabalho %1 - + Right of desktop %1 À direita, área de trabalho %1 - + Bottom of desktop %1 Em baixo, área de trabalho %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Painel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_pt_BR.ts b/panel/translations/lxqt-panel_pt_BR.ts index f15d600..b39ddf3 100644 --- a/panel/translations/lxqt-panel_pt_BR.ts +++ b/panel/translations/lxqt-panel_pt_BR.ts @@ -154,20 +154,20 @@ - + Left Esquerda - - + + Center Centro - + Right Direita @@ -182,88 +182,93 @@ Posição: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Na parte superior da área de trabalho - + Left of desktop À esquerda da área de trabalho - + Right of desktop À direita da área de trabalho - + Bottom of desktop Na parte inferior da área de trabalho - + Top of desktop %1 Na parte superior da área de trabalho %1 - + Left of desktop %1 A esquerda da área de trabalho %1 - + Right of desktop %1 À direita da área de trabalho %1 - + Bottom of desktop %1 Na parte inferior da área de trabalho %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Suspender Automaticamente - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_ro_RO.ts b/panel/translations/lxqt-panel_ro_RO.ts index 80a4b1c..a23cd5d 100644 --- a/panel/translations/lxqt-panel_ro_RO.ts +++ b/panel/translations/lxqt-panel_ro_RO.ts @@ -25,7 +25,7 @@ Panel length && position - Lungime și &poziție panou + Lungime && poziție panou Left @@ -91,7 +91,7 @@ Configure Panel - + Configurează panoul @@ -104,7 +104,7 @@ Size - + Dimensiune @@ -115,12 +115,12 @@ px - + px Icon size: - + Dimensiune pictograme: @@ -130,7 +130,7 @@ <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> - + <p>Pentru valori negative, dimensiunea panoului va fi calculată ca diferenta dintre marimea disponibilă a ecranului și valoarea introdusă.</p><p/><p><i>De ex. introducând o "lungime" de -100 px si o dimensiune a ecranului de 1000 px, dimensiunea reala a panoului va fi de 900 px.</i></p> @@ -145,29 +145,29 @@ Rows count: - + Număr coloane: Alignment && position - + Aliniere și poziție - + Left Stânga - - + + Center Centru - + Right Dreapta @@ -182,124 +182,129 @@ Poziție: - + + Auto-hide + Auto-ascundere + + + Styling - + Stil - + Custom font color: - + Culoare de font personalizată - + Custom background image: - + Imagine de fundal personalizată - + Custom background color: - + Culoare de fundal personalizată - + Opacity - + Opacitate - + Top of desktop Partea de sus a ecranului - + Left of desktop Stânga ecranului - + Right of desktop Dreapta ecranului - + Bottom of desktop Partea de jos a ecranului - + Top of desktop %1 Partea de sus a ecranului %1 - + Left of desktop %1 Stânga ecranului %1 - + Right of desktop %1 Dreapta ecranului %1 - + Bottom of desktop %1 Partea de jos a ecranului %1 - + Top - + Sus - + Bottom - + Jos - - + + Pick color - + Alege culoare - + Images (*.png *.gif *.jpg) - + Imagini (*.png *.gif *.jpg) LxQtPanel - + Add Panel Widgets - - + + Panel - Părăsește + Panou - + Configure Panel... - + Configurează panoul... - + Add Panel Widgets... - + Adaugă widget de panou - + Add Panel - + Adaugă panou - + Remove Panel - + Îndepărtează panou Configure panel... @@ -322,7 +327,7 @@ Remove - Elimină + Îndepărtează @@ -335,19 +340,19 @@ Plugin - + Configure "%1" - + Configurează "%1" - + Move "%1" - + Mută "%1" - + Remove "%1" - + Îndepărtează "%1" diff --git a/panel/translations/lxqt-panel_ru.ts b/panel/translations/lxqt-panel_ru.ts index 5bfb9f4..e5b72a8 100644 --- a/panel/translations/lxqt-panel_ru.ts +++ b/panel/translations/lxqt-panel_ru.ts @@ -1,219 +1,313 @@ + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + ConfigPanelDialog - - + Configure Panel Настроить панель + + + Panel + Панель + + + + Widgets + Виджеты + ConfigPanelWidget - + Configure panel Настроить панель - + px пикс - + Rows count: Количество строк: - + Icon size: Размер иконок: - + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> - - + + Left Слева - - - + + + Center По центру - - + + Right Справа - + % % - + Size Размер - + Size: Размер: - - + + px пикс - + Alignment && position Выравнивание && расположение - + Alignment: Выравнивание: - - Styling - Стиль + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: - - Custom font color: - Свой цвет шрифта: + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> - - Custom background image: - Своё фоновое изображение: + + Background image: + Фоновое изображение: - - Custom background color: - Свой цвет фона: + + Background color: + Цвет фона: - - Opacity - Непрозрачность + + Auto-hide + Автоматически скрывать - + Length: Длина: - + Position: Расположение: - + Top of desktop Вверху - + Left of desktop Слева - + Right of desktop Справа - + Bottom of desktop Внизу - + Top of desktop %1 Вверху %1 рабочего стола - + Left of desktop %1 Слева на %1 рабочем столе - + Right of desktop %1 Справа на %1 рабочем столе - + Bottom of desktop %1 Внизу %1 рабочего стола - + Top Вверху - + Bottom Внизу - - + + Pick color Выбрать цвет - + Images (*.png *.gif *.jpg) Изображения (*.png *.gif *.jpg) + + + Pick image + Выберите изображение + - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - Добавить виджеты на панель + + Configure Plugins + Настроить плагины - - + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + Panel Панель - - Configure Panel... - Настроить панель… + + Configure Panel + Настроить панель - - Add Panel Widgets... - Добавить виджеты на панель… + + Manage Widgets + Управление виджетами - + Add Panel Добавить панель - + Remove Panel Удалить панель @@ -221,19 +315,32 @@ Plugin - + Configure "%1" Настроить «%1» - + Move "%1" Переместить «%1» - + Remove "%1" Удалить «%1» + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + diff --git a/panel/translations/lxqt-panel_ru_RU.ts b/panel/translations/lxqt-panel_ru_RU.ts index 4e5738a..a5ad7a3 100644 --- a/panel/translations/lxqt-panel_ru_RU.ts +++ b/panel/translations/lxqt-panel_ru_RU.ts @@ -1,219 +1,313 @@ + + AddPluginDialog + + + Add Plugins + Добавить плагины + + + + Search: + Найти: + + + + Add Widget + Добавить виджет + + + + Close + Закрыть + + + + (only one instance can run at a time) + (только одна копия может быть запущена за раз) + + ConfigPanelDialog - - + Configure Panel Настроить панель + + + Panel + Панель + + + + Widgets + Виджеты + ConfigPanelWidget - + Configure panel Настроить панель - + px пикс - + Rows count: Количество строк: - + Icon size: Размер иконок: - + <p>Negative pixel value sets the panel length to that many pixels less than available screen space.</p><p/><p><i>E.g. "Length" set to -100px, screen size is 1000px, then real panel length will be 900 px.</i></p> <p>Отрицательное число пикселей устанавливает длину панели на столько же пикселей меньше, чем доступное место экрана.</p><p/><p><i>Т.е. «Длина» выставленная на -100 пикс, размер экрана 1000 пикс, тогда реальная длина панели будет 900 пикс.</i></p> - - + + Left Слева - - - + + + Center По центру - - + + Right Справа - + % % - + Size Размер - + Size: Размер: - - + + px пикс - + Alignment && position Выравнивание && расположение - + Alignment: Выравнивание: - - Styling - Стиль + + Custom styling + Пользовательский стиль + + + + Font color: + Цвет шрифта: + + + + Background opacity: + Непрозрачность фона: - - Custom font color: - Свой цвет шрифта: + + <small>Compositing is required for panel transparency.</small> + <small>Композиция необходима для прозрачности панели.</small> - - Custom background image: - Своё фоновое изображение: + + Background image: + Фоновое изображение: - - Custom background color: - Свой цвет фона: + + Background color: + Цвет фона: - - Opacity - Непрозрачность + + Auto-hide + Автоматически скрывать - + Length: Длина: - + Position: Расположение: - + Top of desktop Вверху - + Left of desktop Слева - + Right of desktop Справа - + Bottom of desktop Внизу - + Top of desktop %1 Вверху %1 рабочего стола - + Left of desktop %1 Слева на %1 рабочем столе - + Right of desktop %1 Справа на %1 рабочем столе - + Bottom of desktop %1 Внизу %1 рабочего стола - + Top Вверху - + Bottom Внизу - - + + Pick color Выбрать цвет - + Images (*.png *.gif *.jpg) Изображения (*.png *.gif *.jpg) + + + Pick image + Выберите изображение + - LxQtPanel + ConfigPluginsWidget - - Add Panel Widgets - Добавить виджеты на панель + + Configure Plugins + Настроить плагины - - + + Note: changes made in this page cannot be reset. + Примечание: изменения, сделанные на этой странице, нельзя сбросить. + + + + Move up + Переместить выше + + + + + + + + ... + + + + + Move down + Переместить ниже + + + + Add + Добавить + + + + Remove + Удалить + + + + Configure + Настроить + + + + LxQtPanel + + + Panel Панель - - Configure Panel... - Настроить панель… + + Configure Panel + Настроить панель - - Add Panel Widgets... - Добавить виджеты на панель… + + Manage Widgets + Управление виджетами - + Add Panel Добавить панель - + Remove Panel Удалить панель @@ -221,19 +315,32 @@ Plugin - + Configure "%1" Настроить «%1» - + Move "%1" Переместить «%1» - + Remove "%1" Удалить «%1» + + main + + + Use alternate configuration file. + Использовать альтернативный конфигурационный файл. + + + + Configuration file + Файл настроек + + diff --git a/panel/translations/lxqt-panel_sk_SK.ts b/panel/translations/lxqt-panel_sk_SK.ts index 75bda96..f60ceb5 100644 --- a/panel/translations/lxqt-panel_sk_SK.ts +++ b/panel/translations/lxqt-panel_sk_SK.ts @@ -126,20 +126,20 @@ - + Left Vľavo - - + + Center Stred - + Right Vpravo @@ -154,88 +154,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Vrch plochy - + Left of desktop Ľavá strana plochy - + Right of desktop Pravá strana plochy - + Bottom of desktop Spodok plochy - + Top of desktop %1 Vrch plochy %1 - + Left of desktop %1 Ľavá strana plochy %1 - + Right of desktop %1 Pravá strana plochy %1 - + Bottom of desktop %1 Spodok plochy %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -243,33 +248,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Panel - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -288,17 +293,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sl.ts b/panel/translations/lxqt-panel_sl.ts index 05f7bad..c8c880a 100644 --- a/panel/translations/lxqt-panel_sl.ts +++ b/panel/translations/lxqt-panel_sl.ts @@ -154,20 +154,20 @@ - + Left Levo - - + + Center Na sredini - + Right Desno @@ -182,88 +182,93 @@ Položaj: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Vrh namizja - + Left of desktop Leva stran namizja - + Right of desktop Desna stran namizja - + Bottom of desktop Dno namizja - + Top of desktop %1 Vrh namizja %1 - + Left of desktop %1 Leva stran namizja %1 - + Right of desktop %1 Desna stran namizja %1 - + Bottom of desktop %1 Dno namizja %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Pult - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr@latin.ts b/panel/translations/lxqt-panel_sr@latin.ts index 82a2bfc..ec6115e 100644 --- a/panel/translations/lxqt-panel_sr@latin.ts +++ b/panel/translations/lxqt-panel_sr@latin.ts @@ -70,20 +70,20 @@ - + Left - - + + Center - + Right @@ -98,88 +98,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop - + Left of desktop - + Right of desktop - + Bottom of desktop - + Top of desktop %1 - + Left of desktop %1 - + Right of desktop %1 - + Bottom of desktop %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -187,33 +192,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Automatsko suspendovanje - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -221,17 +226,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr_BA.ts b/panel/translations/lxqt-panel_sr_BA.ts index e584b21..d2f3456 100644 --- a/panel/translations/lxqt-panel_sr_BA.ts +++ b/panel/translations/lxqt-panel_sr_BA.ts @@ -118,20 +118,20 @@ - + Left Лијево - - + + Center Центар - + Right Десно @@ -146,88 +146,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop врху површи - + Left of desktop лијевој страни површи - + Right of desktop десној страни површи - + Bottom of desktop дну површи - + Top of desktop %1 врху површи %1 - + Left of desktop %1 лијевој страни површи %1 - + Right of desktop %1 десној страни површи %1 - + Bottom of desktop %1 дну површи %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -235,33 +240,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панел - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -319,17 +324,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_sr_RS.ts b/panel/translations/lxqt-panel_sr_RS.ts index 6cf98ee..f44a87f 100644 --- a/panel/translations/lxqt-panel_sr_RS.ts +++ b/panel/translations/lxqt-panel_sr_RS.ts @@ -142,20 +142,20 @@ - + Left Лево - - + + Center Центар - + Right Десно @@ -170,88 +170,93 @@ - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop врху површи - + Left of desktop левој страни површи - + Right of desktop десној страни површи - + Bottom of desktop дну површи - + Top of desktop %1 врху површи %1 - + Left of desktop %1 левој страни површи %1 - + Right of desktop %1 десној страни површи %1 - + Bottom of desktop %1 дну површи %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -259,33 +264,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панел - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -315,17 +320,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_th_TH.ts b/panel/translations/lxqt-panel_th_TH.ts index d64e24c..fcd59a2 100644 --- a/panel/translations/lxqt-panel_th_TH.ts +++ b/panel/translations/lxqt-panel_th_TH.ts @@ -154,20 +154,20 @@ - + Left ทางซ้าย - - + + Center ตรงกลาง - + Right ทางขวา @@ -182,88 +182,93 @@ ตำแหน่ง: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop ด้านบนของหน้าจอ - + Left of desktop ด้านซ้ายของหน้าจอ - + Right of desktop ด้านขวาของหน้าจอ - + Bottom of desktop ด้านล่างของหน้าจอ - + Top of desktop %1 ด้านบนของหน้าจอ %1 - + Left of desktop %1 ด้านซ้ายของหน้าจอ %1 - + Right of desktop %1 ด้านขวาของหน้าจอ %1 - + Bottom of desktop %1 ด้านล่างของหน้าจอ %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel พาเนล - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_tr.ts b/panel/translations/lxqt-panel_tr.ts index b2e5d13..fe15170 100644 --- a/panel/translations/lxqt-panel_tr.ts +++ b/panel/translations/lxqt-panel_tr.ts @@ -154,20 +154,20 @@ - + Left Sol - - + + Center Merkez - + Right Sağ @@ -182,88 +182,93 @@ Konum: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Masasüstünün üst kısmı - + Left of desktop Masaüstünün sol kısmı - + Right of desktop Masaüstünün sağ kısmı - + Bottom of desktop Masaüstünün alt kısmı - + Top of desktop %1 Masaüstünün üst kısmı %1 - + Left of desktop %1 Masaüstünün sol kısmı %1 - + Right of desktop %1 Masaüstünün sağ kısmı %1 - + Bottom of desktop %1 Masaüstünün alt kısmı %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Not Defteri - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_uk.ts b/panel/translations/lxqt-panel_uk.ts index 4c0a3ea..30af3eb 100644 --- a/panel/translations/lxqt-panel_uk.ts +++ b/panel/translations/lxqt-panel_uk.ts @@ -154,20 +154,20 @@ - + Left Зліва - - + + Center Посередині - + Right Справа @@ -182,88 +182,93 @@ Місце: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop Згори стільниці - + Left of desktop Зліва стільниці - + Right of desktop Справа стільниці - + Bottom of desktop Знизу стільниці - + Top of desktop %1 Згори стільниці %1 - + Left of desktop %1 Зліва стільниці %1 - + Right of desktop %1 Справа стільниці %1 - + Bottom of desktop %1 Знизу стільниці %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel Панель - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_zh_CN.ts b/panel/translations/lxqt-panel_zh_CN.ts index 860a8ef..8aa41d3 100644 --- a/panel/translations/lxqt-panel_zh_CN.ts +++ b/panel/translations/lxqt-panel_zh_CN.ts @@ -154,20 +154,20 @@ - + Left - - + + Center 居中 - + Right @@ -182,88 +182,93 @@ 位置: - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop 桌面顶部 - + Left of desktop 桌面左侧 - + Right of desktop 桌面右侧 - + Bottom of desktop 桌面底部 - + Top of desktop %1 桌面顶部 %1 - + Left of desktop %1 桌面左侧 %1 - + Right of desktop %1 左面右侧 %1 - + Bottom of desktop %1 桌面底部 %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel qxkb - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/panel/translations/lxqt-panel_zh_TW.ts b/panel/translations/lxqt-panel_zh_TW.ts index 221c7ce..9c329bb 100644 --- a/panel/translations/lxqt-panel_zh_TW.ts +++ b/panel/translations/lxqt-panel_zh_TW.ts @@ -154,20 +154,20 @@ - + Left 向左 - - + + Center 中間 - + Right 向右 @@ -182,88 +182,93 @@ 位置 : - + + Auto-hide + + + + Styling - + Custom font color: - + Custom background image: - + Custom background color: - + Opacity - + Top of desktop 桌面頂端 - + Left of desktop 桌面左方 - + Right of desktop 桌面右方 - + Bottom of desktop 桌面底端 - + Top of desktop %1 桌面頂端 %1 - + Left of desktop %1 桌面左方 %1 - + Right of desktop %1 桌面右方 %1 - + Bottom of desktop %1 桌面底端 %1 - + Top - + Bottom - - + + Pick color - + Images (*.png *.gif *.jpg) @@ -271,33 +276,33 @@ LxQtPanel - + Add Panel Widgets - - + + Panel LxQt滑鼠設定 - + Configure Panel... - + Add Panel Widgets... - + Add Panel - + Remove Panel @@ -335,17 +340,17 @@ Plugin - + Configure "%1" - + Move "%1" - + Remove "%1" diff --git a/plugin-clock/CMakeLists.txt b/plugin-clock/CMakeLists.txt index 57ad575..d044761 100644 --- a/plugin-clock/CMakeLists.txt +++ b/plugin-clock/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES calendarpopup.cpp ) -set(MOCS - lxqtclock.h - lxqtclockconfiguration.h - calendarpopup.h -) - set(UIS lxqtclockconfiguration.ui ) diff --git a/plugin-clock/calendarpopup.cpp b/plugin-clock/calendarpopup.cpp index fec20cf..6866302 100644 --- a/plugin-clock/calendarpopup.cpp +++ b/plugin-clock/calendarpopup.cpp @@ -28,7 +28,6 @@ #include "calendarpopup.h" #include #include -#include CalendarPopup::CalendarPopup(QWidget *parent): QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) @@ -37,7 +36,6 @@ CalendarPopup::CalendarPopup(QWidget *parent): layout()->setMargin(1); cal = new QCalendarWidget(this); - cal->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); layout()->addWidget(cal); adjustSize(); } @@ -60,3 +58,8 @@ bool CalendarPopup::event(QEvent *event) return QDialog::event(event); } + +void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday) +{ + cal->setFirstDayOfWeek(wday); +} diff --git a/plugin-clock/calendarpopup.h b/plugin-clock/calendarpopup.h index bc33c61..cf52392 100644 --- a/plugin-clock/calendarpopup.h +++ b/plugin-clock/calendarpopup.h @@ -38,6 +38,7 @@ class CalendarPopup : public QDialog public: CalendarPopup(QWidget *parent = 0); ~CalendarPopup(); + void setFirstDayOfWeek(Qt::DayOfWeek wday); void show(); diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp index dca028e..47bc42f 100644 --- a/plugin-clock/lxqtclock.cpp +++ b/plugin-clock/lxqtclock.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -41,6 +40,8 @@ #include #include #include +#include +#include #include @@ -51,17 +52,40 @@ * @author Kuzma Shapran */ +class DownscaleFontStyle : public QProxyStyle +{ + using QProxyStyle::QProxyStyle; +public: + + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override + { + while (1 < painter->font().pointSize() + && !(rect.size() - painter->fontMetrics().boundingRect(text).size()).isValid()) + { + QFont f{painter->font()}; + f.setPointSize(f.pointSize() - 1); + painter->setFont(f); + } + return QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } +}; + /** * @brief constructor */ LxQtClock::LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), - mAutoRotate(true) + mAutoRotate(true), + mTextStyle{new DownscaleFontStyle}, + mCurrentCharCount(0) { mMainWidget = new QWidget(); mRotatedWidget = new LxQt::RotatedWidget(*(new QWidget()), mMainWidget); mContent = mRotatedWidget->content(); + mContent->setStyle(mTextStyle.data()); mTimeLabel = new QLabel(mContent); mDateLabel = new QLabel(mContent); @@ -76,21 +100,14 @@ LxQtClock::LxQtClock(const ILxQtPanelPluginStartupInfo &startupInfo): mTimeLabel->setAlignment(Qt::AlignCenter); mDateLabel->setAlignment(Qt::AlignCenter); - QVBoxLayout *contentLayout = new QVBoxLayout(mContent); - contentLayout->setContentsMargins(0, 0, 0, 0); - contentLayout->setSpacing(1); - contentLayout->addWidget(mTimeLabel, 0, Qt::AlignCenter); - contentLayout->addWidget(mDateLabel, 0, Qt::AlignCenter); - mContent->setLayout(contentLayout); - - mTimeLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mDateLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mContent->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mRotatedWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - mMainWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - + mContent->setLayout(new QVBoxLayout{mContent}); + mContent->layout()->setContentsMargins(0, 0, 0, 0); + mContent->layout()->setSpacing(0); + mContent->layout()->addWidget(mTimeLabel); + mContent->layout()->addWidget(mDateLabel); mClockTimer = new QTimer(this); + mClockTimer->setTimerType(Qt::PreciseTimer); connect (mClockTimer, SIGNAL(timeout()), SLOT(updateTime())); mClockFormat = "hh:mm"; @@ -120,43 +137,58 @@ QDateTime LxQtClock::currentDateTime() */ void LxQtClock::updateTime() { - QDateTime now = currentDateTime(); + //XXX: do we need this with PreciseTimer ? + if (currentDateTime().time().msec() > 500) + restartTimer(); - if (now.time().msec() > 500) - restartTimer(now); - - showTime(now); + showTime(); } -void LxQtClock::showTime(const QDateTime &now) +void LxQtClock::showTime() { + QDateTime now{currentDateTime()}; + int new_char_count; if (mDateOnNewLine) { - mTimeLabel->setText(QLocale::system().toString(now, mTimeFormat)); - mDateLabel->setText(QLocale::system().toString(now, mDateFormat)); + QString new_time = QLocale::system().toString(now, mTimeFormat); + QString new_date = QLocale::system().toString(now, mDateFormat); + new_char_count = qMax(new_time.size(), new_date.size()); + mTimeLabel->setText(new_time); + mDateLabel->setText(new_date); } else { - mTimeLabel->setText(QLocale::system().toString(now, mClockFormat)); + QString new_time = QLocale::system().toString(now, mClockFormat); + new_char_count = new_time.size(); + mTimeLabel->setText(new_time); } - mRotatedWidget->adjustContentSize(); - - mRotatedWidget->update(); + if (mCurrentCharCount != new_char_count) + { + mCurrentCharCount = new_char_count; + realign(); + } } -void LxQtClock::restartTimer(const QDateTime &now) +void LxQtClock::restartTimer() { if (mClockTimer->isActive()) mClockTimer->stop(); int updateInterval = mClockTimer->interval(); - int delay = static_cast((updateInterval + 100 /* ms after time change */ - ((now.time().msec() + now.time().second() * 1000) % updateInterval)) % updateInterval); - QTimer::singleShot(delay, this, SLOT(updateTime())); - QTimer::singleShot(delay, mClockTimer, SLOT(start())); + QDateTime now{currentDateTime()}; + int delay = updateInterval - ((now.time().msec() + now.time().second() * 1000) % updateInterval); + QTimer::singleShot(delay, Qt::PreciseTimer, mClockTimer, SLOT(start())); + QTimer::singleShot(delay, Qt::PreciseTimer, this, SLOT(updateTime())); } void LxQtClock::settingsChanged() { + mFirstDayOfWeek = settings()->value("firstDayOfWeek", -1).toInt(); + if (-1 == mFirstDayOfWeek) + mCalendarPopup->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); + else + mCalendarPopup->setFirstDayOfWeek(static_cast(mFirstDayOfWeek)); + mTimeFormat = settings()->value("timeFormat", QLocale::system().timeFormat(QLocale::ShortFormat).toUpper().contains("AP") ? "h:mm AP" : "HH:mm").toString(); mUseUTC = settings()->value("UTC", false).toBool(); @@ -169,13 +201,7 @@ void LxQtClock::settingsChanged() bool dateAfterTime = (settings()->value("showDate", "no").toString().toLower() == "after"); mDateOnNewLine = (settings()->value("showDate", "no").toString().toLower() == "below"); - bool autoRotate = settings()->value("autoRotate", true).toBool(); - if (autoRotate != mAutoRotate) - { - mAutoRotate = autoRotate; - realign(); - } - + mAutoRotate = settings()->value("autoRotate", true).toBool(); if (dateBeforeTime) mClockFormat = QString("%1 %2").arg(mDateFormat).arg(mTimeFormat); @@ -184,143 +210,71 @@ void LxQtClock::settingsChanged() else mClockFormat = mTimeFormat; - mDateLabel->setVisible(mDateOnNewLine); - - updateMinWidth(); + mDateLabel->setHidden(!mDateOnNewLine); // mDateFormat usually does not contain time portion, but since it's possible to use custom date format - it has to be supported. [Kuzma Shapran] int updateInterval = QString(mTimeFormat + " " + mDateFormat).replace(QRegExp("'[^']*'"),"").contains("s") ? 1000 : 60000; QDateTime now = currentDateTime(); - showTime(now); + showTime(); if (mClockTimer->interval() != updateInterval) { mClockTimer->setInterval(updateInterval); - restartTimer(now); + restartTimer(); } } void LxQtClock::realign() { - if (mAutoRotate) + QSize size{QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}; + Qt::Corner origin = Qt::TopLeftCorner; + if (mAutoRotate || panel()->isHorizontal()) + { switch (panel()->position()) { case ILxQtPanel::PositionTop: case ILxQtPanel::PositionBottom: - mRotatedWidget->setOrigin(Qt::TopLeftCorner); + origin = Qt::TopLeftCorner; break; case ILxQtPanel::PositionLeft: - mRotatedWidget->setOrigin(Qt::BottomLeftCorner); + origin = Qt::BottomLeftCorner; break; case ILxQtPanel::PositionRight: - mRotatedWidget->setOrigin(Qt::TopRightCorner); + origin = Qt::TopRightCorner; break; } - else - mRotatedWidget->setOrigin(Qt::TopLeftCorner); -} -static QDate getMaxDate(const QFontMetrics &metrics, const QString &format) -{ - QDate d(QDate::currentDate().year(), 1, 1); - QDateTime dt(d); - QDate res; - - int maxWidth = 0; - while (dt.date().year() == d.year()) + //set minwidth + QFontMetrics metrics{mTimeLabel->font()}; + //Note: using a constant string of reasonably wide characters for computing the width + // (not the current text as width of text can differ for each particular string (based on font)) + size.setWidth(metrics.boundingRect(QString{mCurrentCharCount, 'A'}).width()); + } else if (!panel()->isHorizontal()) { - int w = metrics.boundingRect(dt.toString(format)).width(); - //qDebug() << "*" << dt.toString(format) << w; - if (w > maxWidth) - { - res = dt.date(); - maxWidth = w; - } - dt = dt.addDays(1); + size.setWidth(panel()->globalGometry().width()); } - //qDebug() << "Max date:" << res.toString(format); - return res; -} - - -static QTime getMaxTime(const QFontMetrics &metrics, const QString &format) -{ - int maxMinSec = 0; - for (int width=0, i=0; i<60; ++i) - { - int w = metrics.boundingRect(QString("%1").arg(i, 2, 10, QChar('0'))).width(); - if (w > width) - { - maxMinSec = i; - width = w; - } - } + mTimeLabel->setFixedWidth(size.width()); + mDateLabel->setFixedWidth(size.width()); - QTime res; - QDateTime dt(QDate(1, 1, 1), QTime(0, maxMinSec, maxMinSec)); + int label_height = mTimeLabel->sizeHint().height(); + size.setHeight(mDateOnNewLine ? label_height * 2 : label_height); - int maxWidth = 0; - while (dt.date().day() == 1) - { - int w = metrics.boundingRect(dt.toString(format)).width(); - //qDebug() << "*" << dt.toString(format) << w; - if (w > maxWidth) - { - res = dt.time(); - maxWidth = w; - } - dt = dt.addSecs(3600); - } + const bool changed = mContent->maximumSize() != size || mRotatedWidget->origin() != origin; - //qDebug() << "Max time:" << res.toString(); - return res; -} + mContent->setFixedSize(size); + mRotatedWidget->setOrigin(origin); -/************************************************ - Issue #18: Panel clock plugin changes your size - ************************************************/ -void LxQtClock::updateMinWidth() -{ - QFontMetrics timeLabelMetrics(mTimeLabel->font()); - QFontMetrics dateLabelMetrics(mDateLabel->font()); - QDate maxDate = getMaxDate(mDateOnNewLine ? dateLabelMetrics : timeLabelMetrics, mDateFormat); - QTime maxTime = getMaxTime(timeLabelMetrics, mTimeFormat); - QDateTime dt(maxDate, maxTime); - - //qDebug() << "T:" << metrics.boundingRect(dt.toString(mTimeFormat)).width(); - //qDebug() << "C:" << metrics.boundingRect(QTime::currentTime().toString(mTimeFormat)).width() << QTime::currentTime().toString(mTimeFormat); - //qDebug() << "D:" << metrics.boundingRect(dt.toString(mDateFormat)).width(); - - int width; - int height; - if (mDateOnNewLine) - { - QRect rect1(timeLabelMetrics.boundingRect(dt.toString(mTimeFormat))); - mTimeLabel->setMinimumSize(rect1.size()); - QRect rect2(dateLabelMetrics.boundingRect(dt.toString(mDateFormat))); - mDateLabel->setMinimumSize(rect2.size()); - width = qMax(rect1.width(), rect2.width()); - height = rect1.height() + rect2.height(); -// qDebug() << "LxQtClock Recalc size" << width << height << dt.toString(mTimeFormat) << dt.toString(mDateFormat); - } - else + if (changed) { - QRect rect(timeLabelMetrics.boundingRect(dt.toString(mClockFormat))); - mTimeLabel->setMinimumSize(rect.size()); - mDateLabel->setMinimumSize(0, 0); - width = rect.width(); - height = rect.height(); -// qDebug() << "LxQtClock Recalc size" << width << height << dt.toString(mClockFormat); + mRotatedWidget->adjustContentSize(); + mRotatedWidget->update(); } - - - mContent->setMinimumSize(width, height); } void LxQtClock::activated(ActivationReason reason) diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index 8912ee8..b3ac0b7 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -41,6 +41,7 @@ class QLabel; class QDialog; class QTimer; +class QProxyStyle; class LxQtClock : public QObject, public ILxQtPanelPlugin { @@ -80,25 +81,24 @@ private: QString mDateFormat; bool mDateOnNewLine; bool mUseUTC; - Qt::DayOfWeek mFirstDayOfWeek; + int mFirstDayOfWeek; bool mAutoRotate; + QScopedPointer mTextStyle; + int mCurrentCharCount; QDateTime currentDateTime(); - void showTime(const QDateTime &); - void restartTimer(const QDateTime&); - -private slots: - void updateMinWidth(); + void showTime(); + void restartTimer(); }; class LxQtClockPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtClock(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtClock(startupInfo);} }; diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp index 82a86b1..ef401a3 100644 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ b/plugin-clock/lxqtclockconfiguration.cpp @@ -27,11 +27,54 @@ #include +#include +#include #include "lxqtclockconfiguration.h" #include "ui_lxqtclockconfiguration.h" +namespace +{ + class FirstDayCombo : public QStandardItemModel + { + public: + FirstDayCombo() + { + QStandardItem* item = 0; + int row = 0; + item = new QStandardItem; + item->setData(-1, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(tr(""), Qt::DisplayRole); + setItem(row, 1, item); + ++row; + for (int wday = Qt::Monday; Qt::Sunday >= wday; ++wday, ++row) + { + item = new QStandardItem; + item->setData(wday, Qt::UserRole); + setItem(row, 0, item); + item = new QStandardItem; + item->setData(QLocale::system().dayName(wday), Qt::DisplayRole); + setItem(row, 1, item); + } + } + + int findIndex(int wday) + { + int i = rowCount() - 1; + for ( ; 0 <= i; --i) + { + if (item(i)->data(Qt::UserRole).toInt() == wday) + break; + } + return i; + } + + }; +} + LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *parent) : QDialog(parent), ui(new Ui::LxQtClockConfiguration), @@ -45,6 +88,9 @@ LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *par connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + ui->firstDayOfWeekCB->setModel(new FirstDayCombo); + ui->firstDayOfWeekCB->setModelColumn(1); + loadSettings(); /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly change of state */ @@ -60,6 +106,7 @@ LxQtClockConfiguration::LxQtClockConfiguration(QSettings &settings, QWidget *par connect(ui->showDateBelowTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); connect(ui->autorotateCB, SIGNAL(clicked()), SLOT(saveSettings())); + connect(ui->firstDayOfWeekCB, SIGNAL(activated(int)), SLOT(saveSettings())); } LxQtClockConfiguration::~LxQtClockConfiguration() @@ -187,6 +234,7 @@ void LxQtClockConfiguration::loadSettings() mOldIndex = ui->dateFormatCOB->currentIndex(); ui->autorotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); + ui->firstDayOfWeekCB->setCurrentIndex(dynamic_cast(*(ui->firstDayOfWeekCB->model())).findIndex(mSettings.value("firstDayOfWeek", -1).toInt())); } void LxQtClockConfiguration::saveSettings() @@ -212,6 +260,7 @@ void LxQtClockConfiguration::saveSettings() mSettings.setValue("dateFormat", ui->dateFormatCOB->itemData(ui->dateFormatCOB->currentIndex())); mSettings.setValue("autoRotate", ui->autorotateCB->isChecked()); + mSettings.setValue("firstDayOfWeek", dynamic_cast(*ui->firstDayOfWeekCB->model()).item(ui->firstDayOfWeekCB->currentIndex(), 0)->data(Qt::UserRole)); } void LxQtClockConfiguration::dialogButtonsAction(QAbstractButton *btn) diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui index 0e728b2..2eb731e 100644 --- a/plugin-clock/lxqtclockconfiguration.ui +++ b/plugin-clock/lxqtclockconfiguration.ui @@ -7,7 +7,7 @@ 0 0 330 - 433 + 447 @@ -101,6 +101,20 @@ + + + + First day of week in calendar + + + firstDayOfWeekCB + + + + + + + diff --git a/plugin-clock/translations/clock.ts b/plugin-clock/translations/clock.ts index 6f817e7..7914ecd 100644 --- a/plugin-clock/translations/clock.ts +++ b/plugin-clock/translations/clock.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -49,12 +57,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ar.ts b/plugin-clock/translations/clock_ar.ts index 19a0bfe..1086869 100644 --- a/plugin-clock/translations/clock_ar.ts +++ b/plugin-clock/translations/clock_ar.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ مائل - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_cs.ts b/plugin-clock/translations/clock_cs.ts index a83c320..4841169 100644 --- a/plugin-clock/translations/clock_cs.ts +++ b/plugin-clock/translations/clock_cs.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kurzíva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_cs_CZ.ts b/plugin-clock/translations/clock_cs_CZ.ts index f37ec65..42c09e5 100644 --- a/plugin-clock/translations/clock_cs_CZ.ts +++ b/plugin-clock/translations/clock_cs_CZ.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kurzíva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_da.ts b/plugin-clock/translations/clock_da.ts index 7011668..3a5030c 100644 --- a/plugin-clock/translations/clock_da.ts +++ b/plugin-clock/translations/clock_da.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -93,12 +106,12 @@ Datoformat - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_da_DK.ts b/plugin-clock/translations/clock_da_DK.ts index 36848c1..3c6ef0e 100644 --- a/plugin-clock/translations/clock_da_DK.ts +++ b/plugin-clock/translations/clock_da_DK.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursiv - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_de.desktop b/plugin-clock/translations/clock_de.desktop index 50e99aa..f24f08e 100644 --- a/plugin-clock/translations/clock_de.desktop +++ b/plugin-clock/translations/clock_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Date & time -Comment=Displays the current time. Comes with a calendar. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Uhr und Kalender -Name[de]=Uhr +Name[de]=Uhr und Kalender +Comment[de]=Zeigt die aktuelle Uhrzeit. Ein Kalender ist auch enthalten. diff --git a/plugin-clock/translations/clock_de.ts b/plugin-clock/translations/clock_de.ts index d24f7d2..af939b0 100644 --- a/plugin-clock/translations/clock_de.ts +++ b/plugin-clock/translations/clock_de.ts @@ -2,15 +2,19 @@ - LxQtClockConfiguration + FirstDayCombo - LxQt Clock Settings - LxQt Uhr Einstellungen + + <locale based> + <Basierend auf lokale Datumseinstellungen> + + + LxQtClockConfiguration Clock Settings - + Uhr-Einstellungen @@ -20,85 +24,70 @@ &Show seconds - + &Sekunden anzeigen 12 &hour style - + 12 Stunden U&hr-Stil &Use UTC - + &UTC verwenden + + + + Date + Datum Date &format - + Datums&format &Do not show date - + &Datum nicht anzeigen Show date &before time - + Datum &vor Zeit anzeigen Show date &after time - + Datum hinter Uhrzeit &anzeigen Show date below time on new &line - - - - - Orientation - - - - - Auto&rotate when the panel is vertical - + Datum unterha&lb Uhrzeit anzeigen - Show seconds - Zeige Sekunden + + First day of week in calendar + Erster Wochentag im Kalender - 12 hour style - 12-Stunden-Format - - - - Date - Datum - - - Show date - Zeige Datum - - - Show date in new line - Zeige Datum in einer neuen Zeile + + Orientation + Ausrichtung - Date format - Datumsformat + + Auto&rotate when the panel is vertical + Automatisch d&rehen bei vertikaler Leiste - + Input custom date format - + Eigenes Datumsformat - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -118,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Interpretierte Datumsformatsequenzen sind: + +d Tag als Zahl ohne führende Null (1 bis 31) +dd Tag als Zahl mit führender Null (01 bis 31) +ddd abgekürzter lokalisierter Tagesname (d.h. 'Mon' bis 'Son'). +dddd ganzer lokalisierter Tagesname (d.h. 'Montag' bis 'Sonntag'). +M Monat als Zahl ohne führende Null (1-12) +MM Monat als Zahl mit führender Null (01-12) +MMM abgekürzter lokalisierter Monatsname (d.h. 'Jan' bis 'Dez'). +MMMM ganzer lokalisierter Monatsname (d.h. 'Januar' bis 'Dezember'). +yy Jahr als zweistellige Zahl (00-99) +yyyy Jahr als vierstellige Zahl + +Alle anderen Zeichen werden als Text behandelt. +Jede Zeichenfolge, die in einfachen Hochkommas eingeschlossen ist ('), +wird ebenfalls als Text behandelt und nicht als Ausdruck benutzt. + + +Eigenes Datumsformat: diff --git a/plugin-clock/translations/clock_de_DE.desktop b/plugin-clock/translations/clock_de_DE.desktop deleted file mode 100644 index ee59172..0000000 --- a/plugin-clock/translations/clock_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Date & time -Comment=Displays the current time. Comes with a calendar. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Uhr und Kalender -Name[de_DE]=Uhr diff --git a/plugin-clock/translations/clock_de_DE.ts b/plugin-clock/translations/clock_de_DE.ts deleted file mode 100644 index e211e6e..0000000 --- a/plugin-clock/translations/clock_de_DE.ts +++ /dev/null @@ -1,168 +0,0 @@ - - - - - LxQtClockConfiguration - - LxQt Clock Settings - LxQt-Uhr Einstellungen - - - - Clock Settings - - - - - Time - Zeit - - - - &Show seconds - &Sekunden anzeigen - - - - 12 &hour style - 12 Stunden U&hr-Stil - - - - &Use UTC - - - - - Date &format - - - - - &Do not show date - - - - - Show date &before time - - - - - Show date &after time - - - - - Show date below time on new &line - - - - - Orientation - - - - - Auto&rotate when the panel is vertical - - - - &Font - &Font - - - Font - Schriftart - - - - Date - Datum - - - Show &date - Zeige &Datum - - - D&ate format - D&atumsformat - - - Fon&t - Schriftar&t - - - Show date in &new line - Datum in &neuer Zeile zeigen - - - &Use theme fonts - Ben&utze System-Schriftart - - - Time font - Zeit Schriftart - - - Date font - Datum Schriftart - - - Ultra light - Ultra light - - - Light - Light - - - Ultra black - Ultra schwarz - - - Black - Schwarz - - - Bold - Fett - - - Demi bold - Halbfett - - - Italic - Kursiv - - - - Input custom date format - - - - - Interpreted sequences of date format are: - -d the day as number without a leading zero (1 to 31) -dd the day as number with a leading zero (01 to 31) -ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). -dddd the long localized day name (e.g. 'Monday' to 'Sunday'). -M the month as number without a leading zero (1-12) -MM the month as number with a leading zero (01-12) -MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). -MMMM the long localized month name (e.g. 'January' to 'December'). -yy the year as two digit number (00-99) -yyyy the year as four digit number - -All other input characters will be treated as text. -Any sequence of characters that are enclosed in single quotes (') -will also be treated as text and not be used as an expression. - - -Custom date format: - - - - diff --git a/plugin-clock/translations/clock_el_GR.ts b/plugin-clock/translations/clock_el_GR.ts index 3bc2875..c549c03 100644 --- a/plugin-clock/translations/clock_el_GR.ts +++ b/plugin-clock/translations/clock_el_GR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Πλάγια - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_eo.ts b/plugin-clock/translations/clock_eo.ts index f5a3967..e6ed7ae 100644 --- a/plugin-clock/translations/clock_eo.ts +++ b/plugin-clock/translations/clock_eo.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursive - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es.ts b/plugin-clock/translations/clock_es.ts index 3e4df0d..bbfa100 100644 --- a/plugin-clock/translations/clock_es.ts +++ b/plugin-clock/translations/clock_es.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Cursiva - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es_UY.ts b/plugin-clock/translations/clock_es_UY.ts index 81fd031..ed6fe8d 100644 --- a/plugin-clock/translations/clock_es_UY.ts +++ b/plugin-clock/translations/clock_es_UY.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Fecha - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_es_VE.ts b/plugin-clock/translations/clock_es_VE.ts index 294e378..7e34690 100644 --- a/plugin-clock/translations/clock_es_VE.ts +++ b/plugin-clock/translations/clock_es_VE.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Italica - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_eu.ts b/plugin-clock/translations/clock_eu.ts index 76c7dba..eed3552 100644 --- a/plugin-clock/translations/clock_eu.ts +++ b/plugin-clock/translations/clock_eu.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Etzana - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_fi.ts b/plugin-clock/translations/clock_fi.ts index b4779e7..8c1281a 100644 --- a/plugin-clock/translations/clock_fi.ts +++ b/plugin-clock/translations/clock_fi.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Kursivoitu - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_fr_FR.ts b/plugin-clock/translations/clock_fr_FR.ts index 0006d4e..8ed0b11 100644 --- a/plugin-clock/translations/clock_fr_FR.ts +++ b/plugin-clock/translations/clock_fr_FR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -85,12 +98,12 @@ Italique - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_hu.ts b/plugin-clock/translations/clock_hu.ts index cae89c4..1a4cd0e 100644 --- a/plugin-clock/translations/clock_hu.ts +++ b/plugin-clock/translations/clock_hu.ts @@ -1,80 +1,93 @@ - + + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration Clock Settings - + Órabeállítás Time - + Idő &Show seconds - + Má&sodpercek 12 &hour style - + 12 órás &stílus &Use UTC - - - - - Date &format - + &UTC használat &Do not show date - + Ne legyen &dátum Show date &before time - + &Dátum az óra előtt Show date &after time - + Dátum &az óra után Show date below time on new &line - + Dátum az órával új sorban - + + First day of week in calendar + A hét első napja + + + Orientation - + Helyzet - + Auto&rotate when the panel is vertical - + Függélyes panelnél automata görgetés Date - + Dátum - + + Date &format + Dá&tumalak + + + Input custom date format - + Egyéni dátumalak - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -94,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: diff --git a/plugin-clock/translations/clock_hu_HU.ts b/plugin-clock/translations/clock_hu_HU.ts index 98f0d04..cd65f86 100644 --- a/plugin-clock/translations/clock_hu_HU.ts +++ b/plugin-clock/translations/clock_hu_HU.ts @@ -2,15 +2,19 @@ - LxQtClockConfiguration + FirstDayCombo - LxQt Clock Settings - LXDE-Qt - Órabeállítás + + <locale based> + + + + LxQtClockConfiguration Clock Settings - + Órabeállítás @@ -20,52 +24,52 @@ &Show seconds - + Má&sodpercek 12 &hour style - + 12 órás &stílus &Use UTC - - - - - Date &format - + &UTC használat &Do not show date - + Ne legyen &dátum Show date &before time - + &Dátum az óra előtt Show date &after time - + Dátum &az óra után Show date below time on new &line - + Dátum az órával új sorban + + + + First day of week in calendar + A hét első napja - + Orientation - + Helyzet - + Auto&rotate when the panel is vertical - + Függélyes panelnél automata görgetés @@ -73,12 +77,17 @@ Dátum - + + Date &format + Dá&tumalak + + + Input custom date format - + Egyéni dátumalak - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -98,7 +107,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Értelmezett dátumformázások: + +d a nap számként bevezető nulla nélkül (1 - 31) +dd a nap számként bevezető nullával (01 - 31) +ddd a nap rövid neve (e.g. 'Mon' to 'Sun'). +dddd a nap hosszú neve (e.g. 'Monday' to 'Sunday'). +M a hónap számként bevezető nulla nélkül (1-12) +MM a hónap számként bevezető nullával (01-12) +MMM a hónap rövid neve (e.g. 'Jan' to 'Dec'). +MMMM a hónap hosszú neve (e.g. 'January' to 'December'). +yy az év két számjeggyel (00-99) +yyyy az év négy számjeggyel + +MInden más karakter szövegként értelmeződik. +Sima zárójelbe (') tett karaktersorozat szövegként van kezelve, +tehát az nem kifejezés. + + +Egyéni dátumalak: diff --git a/plugin-clock/translations/clock_ia.ts b/plugin-clock/translations/clock_ia.ts index ab27126..e75a468 100644 --- a/plugin-clock/translations/clock_ia.ts +++ b/plugin-clock/translations/clock_ia.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_id_ID.ts b/plugin-clock/translations/clock_id_ID.ts index 7316a31..3c7ecab 100644 --- a/plugin-clock/translations/clock_id_ID.ts +++ b/plugin-clock/translations/clock_id_ID.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Tanggal - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_it_IT.ts b/plugin-clock/translations/clock_it_IT.ts index ded6702..e9585d5 100644 --- a/plugin-clock/translations/clock_it_IT.ts +++ b/plugin-clock/translations/clock_it_IT.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Impostazioni orologio @@ -30,42 +38,47 @@ &Use UTC - + &Usa UTC Date &format - + Formato &data &Do not show date - + &Non mostrare la data Show date &before time - + Prima la &data Show date &after time - + Prima l'&ora Show date below time on new &line + Mostra la data su una seconda riga + + + + First day of week in calendar - + Orientation - + Orientamento - + Auto&rotate when the panel is vertical - + Ruota automaticamente se il panello è verticale &Font @@ -137,12 +150,12 @@ Corsivo - + Input custom date format - + Formato personalizzato - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ja.ts b/plugin-clock/translations/clock_ja.ts index 383d054..11b263b 100644 --- a/plugin-clock/translations/clock_ja.ts +++ b/plugin-clock/translations/clock_ja.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ 時刻の下に日付(&L) - + + First day of week in calendar + + + + Orientation 回転 - + Auto&rotate when the panel is vertical パネルが縦のときに自動回転(&R) @@ -69,12 +82,12 @@ 日付 - + Input custom date format 日付の表示形式を指定 - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ko.ts b/plugin-clock/translations/clock_ko.ts index 1269b4a..cd7fe2f 100644 --- a/plugin-clock/translations/clock_ko.ts +++ b/plugin-clock/translations/clock_ko.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_lt.ts b/plugin-clock/translations/clock_lt.ts index fb0004e..5fc25b6 100644 --- a/plugin-clock/translations/clock_lt.ts +++ b/plugin-clock/translations/clock_lt.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Pasviręs - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_nl.ts b/plugin-clock/translations/clock_nl.ts index 3f4874d..809e602 100644 --- a/plugin-clock/translations/clock_nl.ts +++ b/plugin-clock/translations/clock_nl.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Schuin - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pl_PL.ts b/plugin-clock/translations/clock_pl_PL.ts index 1a8738d..13d814a 100644 --- a/plugin-clock/translations/clock_pl_PL.ts +++ b/plugin-clock/translations/clock_pl_PL.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Ustawienia zegara @@ -30,42 +38,47 @@ &Use UTC - + &Użyj UTC Date &format - + &Format daty &Do not show date - + &Nie pokazuj daty Show date &before time - + Poka&ż datę przed godziną Show date &after time - + Pokaż datę &za godziną Show date below time on new &line + Pokaż datę pod godziną w nowej &linii + + + + First day of week in calendar - + Orientation - + Orientacja - + Auto&rotate when the panel is vertical - + Ob&róć gdy panel jest pionowy &Font @@ -137,12 +150,12 @@ Kursywa - + Input custom date format - + Własny format daty - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pt.ts b/plugin-clock/translations/clock_pt.ts index 20619b4..d542707 100644 --- a/plugin-clock/translations/clock_pt.ts +++ b/plugin-clock/translations/clock_pt.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Itálico - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_pt_BR.ts b/plugin-clock/translations/clock_pt_BR.ts index 3732985..8b11d95 100644 --- a/plugin-clock/translations/clock_pt_BR.ts +++ b/plugin-clock/translations/clock_pt_BR.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Itálico - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ro_RO.desktop b/plugin-clock/translations/clock_ro_RO.desktop index ce729cf..8962abd 100644 --- a/plugin-clock/translations/clock_ro_RO.desktop +++ b/plugin-clock/translations/clock_ro_RO.desktop @@ -8,5 +8,5 @@ Comment=Displays the current time. Comes with a calendar. # Translations -Comment[ro_RO]=Ceas și calendar -Name[ro_RO]=Ceas +Comment[ro_RO]=Afișează ora curentă incluzând și un calendar. +Name[ro_RO]=Data și ora diff --git a/plugin-clock/translations/clock_ro_RO.ts b/plugin-clock/translations/clock_ro_RO.ts index 5903de0..02d159a 100644 --- a/plugin-clock/translations/clock_ro_RO.ts +++ b/plugin-clock/translations/clock_ro_RO.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + <bazat pe localizare> + + LxQtClockConfiguration @@ -10,7 +18,7 @@ Clock Settings - + Setări ceas @@ -30,42 +38,47 @@ &Use UTC - + &Utilizează UTC Date &format - + &Formatul datei &Do not show date - + &Nu afișa data Show date &before time - + Afișează data &înaintea orei Show date &after time - + Afișează data &după timp Show date below time on new &line - + Afișează data pe un &rând nou sub oră + + + + First day of week in calendar + Prima zi a săptămânii - + Orientation - + Orientare - + Auto&rotate when the panel is vertical - + Rotire automată când panoul e vertical @@ -85,12 +98,12 @@ Afișează data pe rând &nou - + Input custom date format - + Format de dată personalizat - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) @@ -110,7 +123,25 @@ will also be treated as text and not be used as an expression. Custom date format: - + Secvențe interpretate pentru formatarea datei sunt: + +d numărul zilei fără zero în față (între 1 și 31) +dd numărul zilei cu zero în față (între 01 și 31) +ddd numele abreviat al zilei (de ex. 'Lu' până 'Du'). +dddd numele lung al zilei (de ex. 'Luni' până 'Duminică'). +M numărul lunii fără zero în față (1-12) +MM numărul lunii cu zero în față (01-12) +MMM numele abreviat și localizat al lunii (de ex. 'Ian' - 'Dec'). +MMMM numele lung și localizat al lunii (de ex. 'Ianuarie' - 'December'). +yy anul ca un număr din 2 cifre (00-99) +yyyy anul ca un număr din 4 cifre + +Orice alt caracter introdus va fi tratat ca text. +Orice secvență de caractere intre ghilimele simple (') +vor fi la fel tratate ca text si nu vor fi interpretate in expresie. + + +Format de dată personalizat: diff --git a/plugin-clock/translations/clock_ru.ts b/plugin-clock/translations/clock_ru.ts index 93229f9..a42c171 100644 --- a/plugin-clock/translations/clock_ru.ts +++ b/plugin-clock/translations/clock_ru.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -59,22 +67,27 @@ Показывать дату под временем новой &строкой - + + First day of week in calendar + + + + Orientation Ориентация - + Auto&rotate when the panel is vertical Авто&поворот для вертикальной панели - + Input custom date format Введите свой формат даты - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_ru_RU.ts b/plugin-clock/translations/clock_ru_RU.ts index 51a51a0..3a7d645 100644 --- a/plugin-clock/translations/clock_ru_RU.ts +++ b/plugin-clock/translations/clock_ru_RU.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -59,22 +67,27 @@ Показывать дату под временем новой &строкой - + + First day of week in calendar + + + + Orientation Ориентация - + Auto&rotate when the panel is vertical Авто&поворот для вертикальной панели - + Input custom date format Введите свой формат даты - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sk_SK.ts b/plugin-clock/translations/clock_sk_SK.ts index 0aa8fca..7b18d0f 100644 --- a/plugin-clock/translations/clock_sk_SK.ts +++ b/plugin-clock/translations/clock_sk_SK.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Dátum - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sl.ts b/plugin-clock/translations/clock_sl.ts index 38dc1a5..8d4578e 100644 --- a/plugin-clock/translations/clock_sl.ts +++ b/plugin-clock/translations/clock_sl.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Ležeče - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr@latin.ts b/plugin-clock/translations/clock_sr@latin.ts index 0afbda2..e5388d4 100644 --- a/plugin-clock/translations/clock_sr@latin.ts +++ b/plugin-clock/translations/clock_sr@latin.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -54,12 +62,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -69,12 +82,12 @@ - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr_BA.ts b/plugin-clock/translations/clock_sr_BA.ts index 4083314..47959f0 100644 --- a/plugin-clock/translations/clock_sr_BA.ts +++ b/plugin-clock/translations/clock_sr_BA.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -93,12 +106,12 @@ Формат датума - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_sr_RS.ts b/plugin-clock/translations/clock_sr_RS.ts index 95103bf..0bd4928 100644 --- a/plugin-clock/translations/clock_sr_RS.ts +++ b/plugin-clock/translations/clock_sr_RS.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -73,12 +86,12 @@ Датум - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_th_TH.ts b/plugin-clock/translations/clock_th_TH.ts index 0f7da89..82b7b13 100644 --- a/plugin-clock/translations/clock_th_TH.ts +++ b/plugin-clock/translations/clock_th_TH.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ ตัวเอียง - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_tr.ts b/plugin-clock/translations/clock_tr.ts index a41141d..5d767f1 100644 --- a/plugin-clock/translations/clock_tr.ts +++ b/plugin-clock/translations/clock_tr.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Eğik - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_uk.ts b/plugin-clock/translations/clock_uk.ts index 531c003..c209093 100644 --- a/plugin-clock/translations/clock_uk.ts +++ b/plugin-clock/translations/clock_uk.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ Нахилений - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_zh_CN.ts b/plugin-clock/translations/clock_zh_CN.ts index eb201f9..93a07c5 100644 --- a/plugin-clock/translations/clock_zh_CN.ts +++ b/plugin-clock/translations/clock_zh_CN.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ 斜体 - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-clock/translations/clock_zh_TW.ts b/plugin-clock/translations/clock_zh_TW.ts index d2d9c90..bc16a59 100644 --- a/plugin-clock/translations/clock_zh_TW.ts +++ b/plugin-clock/translations/clock_zh_TW.ts @@ -1,6 +1,14 @@ + + FirstDayCombo + + + <locale based> + + + LxQtClockConfiguration @@ -58,12 +66,17 @@ - + + First day of week in calendar + + + + Orientation - + Auto&rotate when the panel is vertical @@ -137,12 +150,12 @@ 斜體 - + Input custom date format - + Interpreted sequences of date format are: d the day as number without a leading zero (1 to 31) diff --git a/plugin-colorpicker/CMakeLists.txt b/plugin-colorpicker/CMakeLists.txt index ae983ba..8d6484e 100644 --- a/plugin-colorpicker/CMakeLists.txt +++ b/plugin-colorpicker/CMakeLists.txt @@ -8,15 +8,10 @@ set(SOURCES colorpicker.cpp ) -set(MOCS - colorpicker.h -) - set(UIS "") set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-colorpicker/colorpicker.cpp b/plugin-colorpicker/colorpicker.cpp index 305cb42..e5da880 100644 --- a/plugin-colorpicker/colorpicker.cpp +++ b/plugin-colorpicker/colorpicker.cpp @@ -25,10 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "colorpicker.h" #include #include -#include "colorpicker.h" ColorPicker::ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo) : QObject(), @@ -37,6 +37,7 @@ ColorPicker::ColorPicker(const ILxQtPanelPluginStartupInfo &startupInfo) : realign(); } + ColorPicker::~ColorPicker() { } @@ -69,10 +70,12 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent): } + ColorPickerWidget::~ColorPickerWidget() { } + void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) { if (!mCapturing) @@ -90,6 +93,7 @@ void ColorPickerWidget::mouseReleaseEvent(QMouseEvent *event) releaseMouse(); } + void ColorPickerWidget::captureMouse() { grabMouse(Qt::CrossCursor); diff --git a/plugin-colorpicker/colorpicker.h b/plugin-colorpicker/colorpicker.h index 7d249de..de63a48 100644 --- a/plugin-colorpicker/colorpicker.h +++ b/plugin-colorpicker/colorpicker.h @@ -28,14 +28,13 @@ #ifndef LXQT_COLORPICKER_H #define LXQT_COLORPICKER_H +#include "../panel/ilxqtpanelplugin.h" #include -#include #include +#include +#include #include #include -#include - -#include "../panel/ilxqtpanelplugin.h" #include @@ -87,7 +86,7 @@ class ColorPickerLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new ColorPicker(startupInfo); } diff --git a/plugin-colorpicker/translations/colorpicker_de.desktop b/plugin-colorpicker/translations/colorpicker_de.desktop new file mode 100644 index 0000000..cc441ce --- /dev/null +++ b/plugin-colorpicker/translations/colorpicker_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Farbwähler +Comment[de]=Wählt Farbe unter dem Cursor. Für Webentwickler. diff --git a/plugin-colorpicker/translations/colorpicker_de_DE.desktop b/plugin-colorpicker/translations/colorpicker_hu.desktop similarity index 63% rename from plugin-colorpicker/translations/colorpicker_de_DE.desktop rename to plugin-colorpicker/translations/colorpicker_hu.desktop index 17f8972..4ac60b7 100644 --- a/plugin-colorpicker/translations/colorpicker_de_DE.desktop +++ b/plugin-colorpicker/translations/colorpicker_hu.desktop @@ -6,5 +6,5 @@ Comment=Get the color under the cursor. For web developers. # Translations -Comment[de_DE]=Wählt Farbe unter dem Cursor. Für Webentwickler. -Name[de_DE]=Farbwähler +Comment[hu]=Színszippantó. Fejlesztőknek. +Name[hu]=Színválasztó diff --git a/plugin-colorpicker/translations/colorpicker_pl_PL.desktop b/plugin-colorpicker/translations/colorpicker_pl_PL.desktop index 36fd463..54f8b77 100644 --- a/plugin-colorpicker/translations/colorpicker_pl_PL.desktop +++ b/plugin-colorpicker/translations/colorpicker_pl_PL.desktop @@ -6,5 +6,5 @@ Comment=Get the color under the cursor. For web developers. # Translations -Comment[pl_PL]=Otrzymaj kolor z pod kursora. Dla webdeveloperów. +Comment[pl_PL]=Pobierz kolor spod kursora. Dla webdeveloperów. Name[pl_PL]=Wybieracz kolorów diff --git a/plugin-cpuload/CMakeLists.txt b/plugin-cpuload/CMakeLists.txt index 1a4880e..4017b67 100644 --- a/plugin-cpuload/CMakeLists.txt +++ b/plugin-cpuload/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtcpuloadconfiguration.cpp ) -set(MOCS - lxqtcpuloadplugin.h - lxqtcpuload.h - lxqtcpuloadconfiguration.h -) - set(UIS lxqtcpuloadconfiguration.ui ) diff --git a/plugin-cpuload/lxqtcpuload.cpp b/plugin-cpuload/lxqtcpuload.cpp index 97c5184..1e08ac3 100644 --- a/plugin-cpuload/lxqtcpuload.cpp +++ b/plugin-cpuload/lxqtcpuload.cpp @@ -50,94 +50,98 @@ extern "C" { LxQtCpuLoad::LxQtCpuLoad(ILxQtPanelPlugin* plugin, QWidget* parent): QFrame(parent), mPlugin(plugin), - m_showText(false), + m_showText(false), + m_barWidth(20), m_barOrientation(TopDownBar), m_timerID(-1) { setObjectName("LxQtCpuLoad"); QHBoxLayout *layout = new QHBoxLayout(this); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(&m_stuff); - /* Initialise statgrab */ + /* Initialise statgrab */ #ifdef STATGRAB_NEWER_THAN_0_90 - sg_init(0); + sg_init(0); #else - sg_init(); + sg_init(); #endif - /* Drop setuid/setgid privileges. */ - if (sg_drop_privileges() != 0) { - perror("Error. Failed to drop privileges"); - } + /* Drop setuid/setgid privileges. */ + if (sg_drop_privileges() != 0) { + perror("Error. Failed to drop privileges"); + } - m_font.setPointSizeF(8); + m_font.setPointSizeF(8); - settingsChanged(); + settingsChanged(); } LxQtCpuLoad::~LxQtCpuLoad() { } -void LxQtCpuLoad::resizeEvent(QResizeEvent *) +void LxQtCpuLoad::setSizes() { if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) { - m_stuff.setMinimumHeight(18); - m_stuff.setMaximumHeight(18); + m_stuff.setFixedHeight(m_barWidth); m_stuff.setMinimumWidth(24); } else { - m_stuff.setMinimumWidth(18); - m_stuff.setMaximumWidth(18); + m_stuff.setFixedWidth(m_barWidth); m_stuff.setMinimumHeight(24); } +} - update(); +void LxQtCpuLoad::resizeEvent(QResizeEvent *) +{ + setSizes(); + update(); } double LxQtCpuLoad::getLoadCpu() const { - #ifdef STATGRAB_NEWER_THAN_0_90 - size_t count; - sg_cpu_percents* cur = sg_get_cpu_percents(&count); +#ifdef STATGRAB_NEWER_THAN_0_90 + size_t count; + sg_cpu_percents* cur = sg_get_cpu_percents(&count); #else - sg_cpu_percents* cur = sg_get_cpu_percents(); + sg_cpu_percents* cur = sg_get_cpu_percents(); #endif - return (cur->user + cur->kernel + cur->nice); + return (cur->user + cur->kernel + cur->nice); } void LxQtCpuLoad::timerEvent(QTimerEvent *event) { - double avg = getLoadCpu(); - if ( qAbs(m_avg-avg)>1 ) - { - m_avg = avg; + double avg = getLoadCpu(); + if ( qAbs(m_avg-avg)>1 ) + { + m_avg = avg; setToolTip(tr("CPU load %1%").arg(m_avg)); - update(); - } + update(); + } } void LxQtCpuLoad::paintEvent ( QPaintEvent * ) { - QPainter p(this); - QPen pen; - pen.setWidth(2); - p.setPen(pen); - p.setRenderHint(QPainter::Antialiasing, true); - const double w = 20; + QPainter p(this); + QPen pen; + pen.setWidth(2); + p.setPen(pen); + p.setRenderHint(QPainter::Antialiasing, true); - p.setFont(m_font); - QRectF r = rect(); + p.setFont(m_font); + QRectF r = rect(); QRectF r1; QLinearGradient shade(0,0,1,1); if (m_barOrientation == RightToLeftBar || m_barOrientation == LeftToRightBar) { - float vo = (r.height() - w )/2.0; + float vo = (r.height() - static_cast(m_barWidth))/2.0; float ho = r.width()*(1-m_avg*0.01); if (m_barOrientation == RightToLeftBar) @@ -153,7 +157,7 @@ void LxQtCpuLoad::paintEvent ( QPaintEvent * ) else // BottomUpBar || TopDownBar { float vo = r.height()*(1-m_avg*0.01); - float ho = (r.width() - w )/2.0; + float ho = (r.width() - static_cast(m_barWidth) )/2.0; if (m_barOrientation == TopDownBar) { @@ -166,14 +170,14 @@ void LxQtCpuLoad::paintEvent ( QPaintEvent * ) shade.setFinalStop(r1.width(), 0); } - shade.setSpread(QLinearGradient::ReflectSpread); - shade.setColorAt(0, QColor(0, 196, 0, 128)); - shade.setColorAt(0.5, QColor(0, 128, 0, 255) ); - shade.setColorAt(1, QColor(0, 196, 0 , 128)); + shade.setSpread(QLinearGradient::ReflectSpread); + shade.setColorAt(0, QColor(0, 196, 0, 128)); + shade.setColorAt(0.5, QColor(0, 128, 0, 255) ); + shade.setColorAt(1, QColor(0, 196, 0 , 128)); - p.fillRect(r1, shade); + p.fillRect(r1, shade); - if (m_showText) + if (m_showText) { p.setPen(fontColor); p.drawText(rect(), Qt::AlignCenter, QString::number(m_avg)); @@ -187,6 +191,7 @@ void LxQtCpuLoad::settingsChanged() killTimer(m_timerID); m_showText = mPlugin->settings()->value("showText", false).toBool(); + m_barWidth = mPlugin->settings()->value("barWidth", 20).toInt(); m_updateInterval = mPlugin->settings()->value("updateInterval", 1000).toInt(); QString barOrientation = mPlugin->settings()->value("barOrientation", BAR_ORIENT_BOTTOMUP).toString(); @@ -199,6 +204,7 @@ void LxQtCpuLoad::settingsChanged() else m_barOrientation = BottomUpBar; - m_timerID = startTimer(m_updateInterval); - update(); + m_timerID = startTimer(m_updateInterval); + setSizes(); + update(); } diff --git a/plugin-cpuload/lxqtcpuload.h b/plugin-cpuload/lxqtcpuload.h index f16c324..ca35e1d 100644 --- a/plugin-cpuload/lxqtcpuload.h +++ b/plugin-cpuload/lxqtcpuload.h @@ -33,8 +33,8 @@ class ILxQtPanelPlugin; class LxQtCpuLoad: public QFrame { - Q_OBJECT - + Q_OBJECT + Q_PROPERTY(QColor fontColor READ getFontColor WRITE setFontColor) public: @@ -49,7 +49,7 @@ public: }; LxQtCpuLoad(ILxQtPanelPlugin *plugin, QWidget* parent = 0); - ~LxQtCpuLoad(); + ~LxQtCpuLoad(); void settingsChanged(); @@ -58,26 +58,28 @@ public: QColor getFontColor() const { return fontColor; } protected: - void virtual timerEvent(QTimerEvent *event); - void virtual paintEvent ( QPaintEvent * event ); - void virtual resizeEvent(QResizeEvent *); + void virtual timerEvent(QTimerEvent *event); + void virtual paintEvent ( QPaintEvent * event ); + void virtual resizeEvent(QResizeEvent *); private: - double getLoadCpu() const; + double getLoadCpu() const; + void setSizes(); ILxQtPanelPlugin *mPlugin; - QWidget m_stuff; + QWidget m_stuff; - //! average load - int m_avg; + //! average load + int m_avg; - bool m_showText; + bool m_showText; + int m_barWidth; BarOrientation m_barOrientation; int m_updateInterval; int m_timerID; - QFont m_font; - + QFont m_font; + QColor fontColor; }; diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.cpp b/plugin-cpuload/lxqtcpuloadconfiguration.cpp index 7f507e2..c52e1a2 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.cpp +++ b/plugin-cpuload/lxqtcpuloadconfiguration.cpp @@ -34,24 +34,26 @@ #define BAR_ORIENT_RIGHTLEFT "rightLeft" LxQtCpuLoadConfiguration::LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent) : - QDialog(parent), - ui(new Ui::LxQtCpuLoadConfiguration), - mSettings(settings), - mOldSettings(settings) + QDialog(parent), + ui(new Ui::LxQtCpuLoadConfiguration), + mSettings(settings), + mOldSettings(settings) { - setAttribute(Qt::WA_DeleteOnClose); - setObjectName("CpuLoadConfigurationWindow"); - ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("CpuLoadConfigurationWindow"); + ui->setupUi(this); fillBarOrientations(); - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); - loadSettings(); + loadSettings(); - connect(ui->showTextCB, SIGNAL(toggled(bool)), + connect(ui->showTextCB, SIGNAL(toggled(bool)), this, SLOT(showTextChanged(bool))); + connect(ui->barWidthSB, SIGNAL(valueChanged(int)), + this, SLOT(barWidthChanged(int))); connect(ui->updateIntervalSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateIntervalChanged(double))); connect(ui->barOrientationCOB, SIGNAL(currentIndexChanged(int)), @@ -60,7 +62,7 @@ LxQtCpuLoadConfiguration::LxQtCpuLoadConfiguration(QSettings *settings, QWidget LxQtCpuLoadConfiguration::~LxQtCpuLoadConfiguration() { - delete ui; + delete ui; } void LxQtCpuLoadConfiguration::fillBarOrientations() @@ -74,6 +76,7 @@ void LxQtCpuLoadConfiguration::fillBarOrientations() void LxQtCpuLoadConfiguration::loadSettings() { ui->showTextCB->setChecked(mSettings->value("showText", false).toBool()); + ui->barWidthSB->setValue(mSettings->value("barWidth", 20).toInt()); ui->updateIntervalSpinBox->setValue(mSettings->value("updateInterval", 1000).toInt() / 1000.0); int boIndex = ui->barOrientationCOB->findData( @@ -95,6 +98,10 @@ void LxQtCpuLoadConfiguration::showTextChanged(bool value) mSettings->setValue("showText", value); } +void LxQtCpuLoadConfiguration::barWidthChanged(int value) +{ + mSettings->setValue("barWidth", value); +} void LxQtCpuLoadConfiguration::updateIntervalChanged(double value) { @@ -108,14 +115,14 @@ void LxQtCpuLoadConfiguration::barOrientationChanged(int index) void LxQtCpuLoadConfiguration::dialogButtonsAction(QAbstractButton *btn) { - if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) - { - mOldSettings.loadToSettings(); - loadSettings(); - } - else - { - close(); - } + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } } diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.h b/plugin-cpuload/lxqtcpuloadconfiguration.h index 3a0116e..c1a4336 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.h +++ b/plugin-cpuload/lxqtcpuloadconfiguration.h @@ -37,21 +37,21 @@ class QSettings; class QAbstractButton; namespace Ui { - class LxQtCpuLoadConfiguration; + class LxQtCpuLoadConfiguration; } class LxQtCpuLoadConfiguration : public QDialog { - Q_OBJECT + Q_OBJECT public: explicit LxQtCpuLoadConfiguration(QSettings *settings, QWidget *parent = 0); - ~LxQtCpuLoadConfiguration(); + ~LxQtCpuLoadConfiguration(); private: - Ui::LxQtCpuLoadConfiguration *ui; + Ui::LxQtCpuLoadConfiguration *ui; QSettings *mSettings; - LxQt::SettingsCache mOldSettings; + LxQt::SettingsCache mOldSettings; /* Fills Bar orientation combobox @@ -59,12 +59,13 @@ private: void fillBarOrientations(); private slots: - /* - Saves settings in conf file. - */ - void loadSettings(); - void dialogButtonsAction(QAbstractButton *btn); - void showTextChanged(bool value); + /* + Saves settings in conf file. + */ + void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); + void showTextChanged(bool value); + void barWidthChanged(int value); void updateIntervalChanged(double value); void barOrientationChanged(int index); diff --git a/plugin-cpuload/lxqtcpuloadconfiguration.ui b/plugin-cpuload/lxqtcpuloadconfiguration.ui index 85fbf0c..b578503 100644 --- a/plugin-cpuload/lxqtcpuloadconfiguration.ui +++ b/plugin-cpuload/lxqtcpuloadconfiguration.ui @@ -75,6 +75,26 @@ + + + + Bar width: + + + + + + + 4 + + + 2048 + + + 20 + + + diff --git a/plugin-cpuload/lxqtcpuloadplugin.cpp b/plugin-cpuload/lxqtcpuloadplugin.cpp index 1019566..24c16ef 100644 --- a/plugin-cpuload/lxqtcpuloadplugin.cpp +++ b/plugin-cpuload/lxqtcpuloadplugin.cpp @@ -57,7 +57,7 @@ QWidget *LxQtCpuLoadPlugin::widget() QDialog *LxQtCpuLoadPlugin::configureDialog() { - return new LxQtCpuLoadConfiguration(settings(), mContent); + return new LxQtCpuLoadConfiguration(settings()); } void LxQtCpuLoadPlugin::settingsChanged() diff --git a/plugin-cpuload/lxqtcpuloadplugin.h b/plugin-cpuload/lxqtcpuloadplugin.h index a205a5c..9f60712 100644 --- a/plugin-cpuload/lxqtcpuloadplugin.h +++ b/plugin-cpuload/lxqtcpuloadplugin.h @@ -63,7 +63,7 @@ class LxQtCpuLoadPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtCpuLoadPlugin(startupInfo); } diff --git a/plugin-cpuload/translations/cpuload.ts b/plugin-cpuload/translations/cpuload.ts index 3c6bd00..24f94e7 100644 --- a/plugin-cpuload/translations/cpuload.ts +++ b/plugin-cpuload/translations/cpuload.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_ar.ts b/plugin-cpuload/translations/cpuload_ar.ts index 668e879..21c7afa 100644 --- a/plugin-cpuload/translations/cpuload_ar.ts +++ b/plugin-cpuload/translations/cpuload_ar.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_cs.ts b/plugin-cpuload/translations/cpuload_cs.ts index 50a1257..f2a68b6 100644 --- a/plugin-cpuload/translations/cpuload_cs.ts +++ b/plugin-cpuload/translations/cpuload_cs.ts @@ -8,7 +8,7 @@ Vytížení procesoru %1% - + CPU load %1% @@ -50,22 +50,27 @@ Směr pruhu - + + Bar width: + + + + Bottom up Zdola nahoru - + Top down Shora dolů - + Left to right Zleva doprava - + Right to left Zprava doleva diff --git a/plugin-cpuload/translations/cpuload_cs_CZ.ts b/plugin-cpuload/translations/cpuload_cs_CZ.ts index 65afbb2..4353ca8 100644 --- a/plugin-cpuload/translations/cpuload_cs_CZ.ts +++ b/plugin-cpuload/translations/cpuload_cs_CZ.ts @@ -8,7 +8,7 @@ Vytížení procesoru %1% - + CPU load %1% @@ -50,22 +50,27 @@ Směr pruhu - + + Bar width: + + + + Bottom up Zdola nahoru - + Top down Shora dolů - + Left to right Zleva doprava - + Right to left Zprava doleva diff --git a/plugin-cpuload/translations/cpuload_da_DK.ts b/plugin-cpuload/translations/cpuload_da_DK.ts index 12bc305..85f499f 100644 --- a/plugin-cpuload/translations/cpuload_da_DK.ts +++ b/plugin-cpuload/translations/cpuload_da_DK.ts @@ -8,7 +8,7 @@ CPU belastning %1% - + CPU load %1% @@ -50,22 +50,27 @@ Bjælkens orientering: - + + Bar width: + + + + Bottom up Nedefra - + Top down Oppefra - + Left to right Venstre mod højre - + Right to left Højre mod venstre diff --git a/plugin-cpuload/translations/cpuload_de.desktop b/plugin-cpuload/translations/cpuload_de.desktop index 6d216d5..11579ac 100644 --- a/plugin-cpuload/translations/cpuload_de.desktop +++ b/plugin-cpuload/translations/cpuload_de.desktop @@ -1,13 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Cpu monitor -Comment=Displays the current CPU load. - - - - -# Translations -Comment[de]=Prozesslast-Monitor -Name[de]=Prozessauslastung +Name[de]=Prozessorauslastung +Comment[de]=Prozessorlast-Monitor diff --git a/plugin-cpuload/translations/cpuload_de.ts b/plugin-cpuload/translations/cpuload_de.ts index f3c6733..f1dc15b 100644 --- a/plugin-cpuload/translations/cpuload_de.ts +++ b/plugin-cpuload/translations/cpuload_de.ts @@ -4,25 +4,17 @@ LxQtCpuLoad - Cpu load %1% - Prozessorauslastung %1% - - - + CPU load %1% - + Prozessorauslastung %1% LxQtCpuLoadConfiguration - - LxQt Cpu Load settings - LxQt Prozessorauslastung Einstellungen - CPU Load Settings - + Einstellungen zur Prozessorlast-Anzeige @@ -42,30 +34,35 @@ sec - Sek. + s Bar orientation: - Anzeigeausrichtung: + Balkenrichtung: + + + + Bar width: + Balkenbreite: - + Bottom up von unten nach oben - + Top down von oben nach unten - + Left to right von links nach rechts - + Right to left von rechts nach links diff --git a/plugin-cpuload/translations/cpuload_de_DE.desktop b/plugin-cpuload/translations/cpuload_de_DE.desktop deleted file mode 100644 index b6df13b..0000000 --- a/plugin-cpuload/translations/cpuload_de_DE.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Cpu monitor -Comment=Displays the current CPU load. - - - - -# Translations -Comment[de_DE]=Cpu -Name[de_DE]=CPU-Auslastung diff --git a/plugin-cpuload/translations/cpuload_el_GR.ts b/plugin-cpuload/translations/cpuload_el_GR.ts index 4925099..f0f61cd 100644 --- a/plugin-cpuload/translations/cpuload_el_GR.ts +++ b/plugin-cpuload/translations/cpuload_el_GR.ts @@ -8,7 +8,7 @@ Φορτίο ΚΜΕ %1% - + CPU load %1% @@ -50,22 +50,27 @@ Προσανατολισμός γραμμής: - + + Bar width: + + + + Bottom up Κάτω προς τα πάνω - + Top down Πάνω προς τα κάτω - + Left to right Αριστερά προς δεξιά - + Right to left Δεξιά προς αριστερά diff --git a/plugin-cpuload/translations/cpuload_eo.ts b/plugin-cpuload/translations/cpuload_eo.ts index 9814a82..9ae1913 100644 --- a/plugin-cpuload/translations/cpuload_eo.ts +++ b/plugin-cpuload/translations/cpuload_eo.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_es.ts b/plugin-cpuload/translations/cpuload_es.ts index 30e3363..e005744 100644 --- a/plugin-cpuload/translations/cpuload_es.ts +++ b/plugin-cpuload/translations/cpuload_es.ts @@ -8,7 +8,7 @@ Carga de CPU %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientación de la barra: - + + Bar width: + + + + Bottom up De Abajo hacia Arriba - + Top down De Arriba hacia Abajo - + Left to right De Izquierda a Derecha - + Right to left De Derecha a Izquierda diff --git a/plugin-cpuload/translations/cpuload_es_VE.ts b/plugin-cpuload/translations/cpuload_es_VE.ts index a05394b..16bdb99 100644 --- a/plugin-cpuload/translations/cpuload_es_VE.ts +++ b/plugin-cpuload/translations/cpuload_es_VE.ts @@ -8,7 +8,7 @@ Cpu al %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientacion barra - + + Bar width: + + + + Bottom up Abajo a Arriba - + Top down Arriba a abajo - + Left to right Izquierda a derecha - + Right to left Derecha a izquierda diff --git a/plugin-cpuload/translations/cpuload_eu.ts b/plugin-cpuload/translations/cpuload_eu.ts index aaca681..5450df6 100644 --- a/plugin-cpuload/translations/cpuload_eu.ts +++ b/plugin-cpuload/translations/cpuload_eu.ts @@ -8,7 +8,7 @@ PUZaren karga %%1 - + CPU load %1% @@ -50,22 +50,27 @@ Barraren orientazioa: - + + Bar width: + + + + Bottom up Behetik gora - + Top down Goitik behera - + Left to right Ezkerretik eskuinera - + Right to left Eskuinetik ezkerrera diff --git a/plugin-cpuload/translations/cpuload_fi.ts b/plugin-cpuload/translations/cpuload_fi.ts index de1a719..bb69382 100644 --- a/plugin-cpuload/translations/cpuload_fi.ts +++ b/plugin-cpuload/translations/cpuload_fi.ts @@ -8,7 +8,7 @@ Suoritinkuorma %1% - + CPU load %1% @@ -50,22 +50,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_fr_FR.ts b/plugin-cpuload/translations/cpuload_fr_FR.ts index 345f7f0..5d8199f 100644 --- a/plugin-cpuload/translations/cpuload_fr_FR.ts +++ b/plugin-cpuload/translations/cpuload_fr_FR.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_hr.ts b/plugin-cpuload/translations/cpuload_hr.ts new file mode 100644 index 0000000..12ae080 --- /dev/null +++ b/plugin-cpuload/translations/cpuload_hr.ts @@ -0,0 +1,70 @@ + + + + + LxQtCpuLoad + + + CPU load %1% + Učitavanje procesora %1 + + + + LxQtCpuLoadConfiguration + + + CPU Load Settings + Postavke učitavanja procesora + + + + General + Općenito + + + + Show text + Pokaži tekst + + + + Update interval: + Interval ažuriranja: + + + + sec + sek + + + + Bar orientation: + Orijentacija trake: + + + + Bar width: + Duljina trake: + + + + Bottom up + Odozdo gore + + + + Top down + Odozgo dolje + + + + Left to right + S lijeva na desno + + + + Right to left + S desna na lijevo + + + diff --git a/plugin-cpuload/translations/cpuload_de_DE.ts b/plugin-cpuload/translations/cpuload_hu.ts similarity index 67% rename from plugin-cpuload/translations/cpuload_de_DE.ts rename to plugin-cpuload/translations/cpuload_hu.ts index 6001586..e7f92b8 100644 --- a/plugin-cpuload/translations/cpuload_de_DE.ts +++ b/plugin-cpuload/translations/cpuload_hu.ts @@ -1,24 +1,16 @@ - + LxQtCpuLoad - Cpu load %1% - Cpu Last %1% - - - + CPU load %1% LxQtCpuLoadConfiguration - - LxQt Cpu Load settings - LxQt Cpu Last Einstellungen - CPU Load Settings @@ -27,47 +19,52 @@ General - Allgemein + Általános Show text - Zeige Text + Szöveg megjelenítése Update interval: - Aktualisierungs Intervall: + Frissítési köz: sec - Sek + mp Bar orientation: - Balken Orientierung + Sáv irány: + + + + Bar width: + Sáv szélesség: - + Bottom up - Von unten nach oben + Felfele - + Top down - Von oben nach unten + Lefele - + Left to right - Von Links nach Rechts + Jobbra - + Right to left - Von Rechts nach Links + Balra diff --git a/plugin-cpuload/translations/cpuload_hu_HU.ts b/plugin-cpuload/translations/cpuload_hu_HU.ts index 7683cac..62ec026 100644 --- a/plugin-cpuload/translations/cpuload_hu_HU.ts +++ b/plugin-cpuload/translations/cpuload_hu_HU.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -29,37 +29,42 @@ Update interval: - + Frissítési köz: sec - + mp Bar orientation: - + Sáv irány: - + + Bar width: + Sáv szélesség: + + + Bottom up - + Felfele - + Top down - + Lefele - + Left to right - + Jobbra - + Right to left - + Balra diff --git a/plugin-cpuload/translations/cpuload_it_IT.ts b/plugin-cpuload/translations/cpuload_it_IT.ts index f90b0b0..5d46003 100644 --- a/plugin-cpuload/translations/cpuload_it_IT.ts +++ b/plugin-cpuload/translations/cpuload_it_IT.ts @@ -8,7 +8,7 @@ Carico del processore %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientamento della barra: - + + Bar width: + + + + Bottom up Dal basso all'alto - + Top down Dall'alto al basso - + Left to right Da sinistra a destra - + Right to left Da destra a sinistra diff --git a/plugin-cpuload/translations/cpuload_ja.ts b/plugin-cpuload/translations/cpuload_ja.ts index 8deb413..b86f71b 100644 --- a/plugin-cpuload/translations/cpuload_ja.ts +++ b/plugin-cpuload/translations/cpuload_ja.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% CPU負荷 %1% @@ -42,22 +42,27 @@ バーの向き: - + + Bar width: + + + + Bottom up 下から上へ - + Top down 上から下へ - + Left to right 左から右へ - + Right to left 右から左へ diff --git a/plugin-cpuload/translations/cpuload_lt.ts b/plugin-cpuload/translations/cpuload_lt.ts index acec6ae..ffd5557 100644 --- a/plugin-cpuload/translations/cpuload_lt.ts +++ b/plugin-cpuload/translations/cpuload_lt.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% @@ -42,22 +42,27 @@ - + + Bar width: + + + + Bottom up - + Top down - + Left to right - + Right to left diff --git a/plugin-cpuload/translations/cpuload_nl.ts b/plugin-cpuload/translations/cpuload_nl.ts index 08c5bfa..b7bc8eb 100644 --- a/plugin-cpuload/translations/cpuload_nl.ts +++ b/plugin-cpuload/translations/cpuload_nl.ts @@ -8,7 +8,7 @@ Cpu-belasting %1% - + CPU load %1% @@ -50,22 +50,27 @@ Balkoriëntatie: - + + Bar width: + + + + Bottom up Van beneden naar boven - + Top down Van boven naar beneden - + Left to right Van links naar rechts - + Right to left Van rechts naar links diff --git a/plugin-cpuload/translations/cpuload_pl_PL.ts b/plugin-cpuload/translations/cpuload_pl_PL.ts index 8a0c975..9ebbfab 100644 --- a/plugin-cpuload/translations/cpuload_pl_PL.ts +++ b/plugin-cpuload/translations/cpuload_pl_PL.ts @@ -8,9 +8,9 @@ Obciążenie CPU %1% - + CPU load %1% - + Obciążenie procesora %1% @@ -22,7 +22,7 @@ CPU Load Settings - + Obciążenie procesora - ustawienia @@ -50,22 +50,27 @@ Orientacja paska stanu - + + Bar width: + + + + Bottom up Z dołu do góry - + Top down Z góry na dół - + Left to right Lewo na prawo - + Right to left Prawo na lewo diff --git a/plugin-cpuload/translations/cpuload_pt.ts b/plugin-cpuload/translations/cpuload_pt.ts index dc1b188..1061704 100644 --- a/plugin-cpuload/translations/cpuload_pt.ts +++ b/plugin-cpuload/translations/cpuload_pt.ts @@ -8,7 +8,7 @@ Carga do cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientação da barra: - + + Bar width: + + + + Bottom up De baixo para cima - + Top down De cima para baixo - + Left to right Da esquerda para a direita - + Right to left Da direita para a esquerda diff --git a/plugin-cpuload/translations/cpuload_pt_BR.ts b/plugin-cpuload/translations/cpuload_pt_BR.ts index 00caf8a..c3b67e7 100644 --- a/plugin-cpuload/translations/cpuload_pt_BR.ts +++ b/plugin-cpuload/translations/cpuload_pt_BR.ts @@ -8,7 +8,7 @@ Carga da Cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Orientação da barra: - + + Bar width: + + + + Bottom up De baixo para cima - + Top down De cima para baixo - + Left to right Da esquerda para a direita - + Right to left Da direita para a esquerda diff --git a/plugin-cpuload/translations/cpuload_ro_RO.desktop b/plugin-cpuload/translations/cpuload_ro_RO.desktop index 5e01855..d0cdb2d 100644 --- a/plugin-cpuload/translations/cpuload_ro_RO.desktop +++ b/plugin-cpuload/translations/cpuload_ro_RO.desktop @@ -10,4 +10,4 @@ Comment=Displays the current CPU load. # Translations Comment[ro_RO]=Monitor de încărcare a procesorului -Name[ro_RO]=Grad de încărcare al procesorului +Name[ro_RO]=Afișează gradul de încărcare al procesorului diff --git a/plugin-cpuload/translations/cpuload_ro_RO.ts b/plugin-cpuload/translations/cpuload_ro_RO.ts index 2c73400..2709dad 100644 --- a/plugin-cpuload/translations/cpuload_ro_RO.ts +++ b/plugin-cpuload/translations/cpuload_ro_RO.ts @@ -8,9 +8,9 @@ Încărcare procesor %1% - + CPU load %1% - + Încărcare procesor @@ -22,7 +22,7 @@ CPU Load Settings - + Setări încărcare procesor @@ -50,22 +50,27 @@ Orientare bară: - + + Bar width: + Lățime bară: + + + Bottom up De jos în sus - + Top down De sus în jos - + Left to right De la stânga la dreapta - + Right to left De la dreapta la stânga diff --git a/plugin-cpuload/translations/cpuload_ru.ts b/plugin-cpuload/translations/cpuload_ru.ts index f2dc482..31ab786 100644 --- a/plugin-cpuload/translations/cpuload_ru.ts +++ b/plugin-cpuload/translations/cpuload_ru.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% Загрузка процессора %1% @@ -42,22 +42,27 @@ Расположение панели: - + + Bar width: + + + + Bottom up Снизу вверх - + Top down Сверху вниз - + Left to right Слева направо - + Right to left Справа налево diff --git a/plugin-cpuload/translations/cpuload_ru_RU.ts b/plugin-cpuload/translations/cpuload_ru_RU.ts index 14f211e..b40c0ff 100644 --- a/plugin-cpuload/translations/cpuload_ru_RU.ts +++ b/plugin-cpuload/translations/cpuload_ru_RU.ts @@ -4,7 +4,7 @@ LxQtCpuLoad - + CPU load %1% Загрузка процессора %1% @@ -42,22 +42,27 @@ Расположение панели: - + + Bar width: + + + + Bottom up Снизу вверх - + Top down Сверху вниз - + Left to right Слева направо - + Right to left Справа налево diff --git a/plugin-cpuload/translations/cpuload_sl.ts b/plugin-cpuload/translations/cpuload_sl.ts index 6e16702..99a7356 100644 --- a/plugin-cpuload/translations/cpuload_sl.ts +++ b/plugin-cpuload/translations/cpuload_sl.ts @@ -8,7 +8,7 @@ Uporaba CPE: %1 % - + CPU load %1% @@ -50,22 +50,27 @@ Usmerjenost vrstice: - + + Bar width: + + + + Bottom up Od spodaj navzgor - + Top down Od zgoraj navzdol - + Left to right Iz leve proti desni - + Right to left Iz desne proti levi diff --git a/plugin-cpuload/translations/cpuload_th_TH.ts b/plugin-cpuload/translations/cpuload_th_TH.ts index 6ec9922..0345d68 100644 --- a/plugin-cpuload/translations/cpuload_th_TH.ts +++ b/plugin-cpuload/translations/cpuload_th_TH.ts @@ -8,7 +8,7 @@ Cpu โหลด %1% - + CPU load %1% @@ -50,22 +50,27 @@ การจัดเรียง: - + + Bar width: + + + + Bottom up ล่างขึ้นบน - + Top down บนลงล่าง - + Left to right ซ้ายไปขวา - + Right to left ขวาไปซ้าย diff --git a/plugin-cpuload/translations/cpuload_tr.ts b/plugin-cpuload/translations/cpuload_tr.ts index f5dcd03..602b644 100644 --- a/plugin-cpuload/translations/cpuload_tr.ts +++ b/plugin-cpuload/translations/cpuload_tr.ts @@ -8,7 +8,7 @@ İşlemci yükü %1% - + CPU load %1% @@ -50,22 +50,27 @@ Çubuk yönelimi: - + + Bar width: + + + + Bottom up Aşağıdan yukarı - + Top down Yukarıdan aşağı - + Left to right Soldan sağa - + Right to left Sağdan sola diff --git a/plugin-cpuload/translations/cpuload_uk.ts b/plugin-cpuload/translations/cpuload_uk.ts index 3e13478..2145c8e 100644 --- a/plugin-cpuload/translations/cpuload_uk.ts +++ b/plugin-cpuload/translations/cpuload_uk.ts @@ -8,7 +8,7 @@ Завантаження Cpu %1% - + CPU load %1% @@ -50,22 +50,27 @@ Напрямок планки: - + + Bar width: + + + + Bottom up Знизу вверх - + Top down Зверху вниз - + Left to right Зліва направо - + Right to left Зправа наліво diff --git a/plugin-cpuload/translations/cpuload_zh_CN.ts b/plugin-cpuload/translations/cpuload_zh_CN.ts index 9448095..149c8f8 100644 --- a/plugin-cpuload/translations/cpuload_zh_CN.ts +++ b/plugin-cpuload/translations/cpuload_zh_CN.ts @@ -8,7 +8,7 @@ Cpu 负载 %1% - + CPU load %1% @@ -50,22 +50,27 @@ 状态栏方向: - + + Bar width: + + + + Bottom up 自下而上 - + Top down 自上而下 - + Left to right 从左到右 - + Right to left 从右到左 diff --git a/plugin-cpuload/translations/cpuload_zh_TW.ts b/plugin-cpuload/translations/cpuload_zh_TW.ts index 52054bc..b3893db 100644 --- a/plugin-cpuload/translations/cpuload_zh_TW.ts +++ b/plugin-cpuload/translations/cpuload_zh_TW.ts @@ -8,7 +8,7 @@ CPU使用率 %1% - + CPU load %1% @@ -50,22 +50,27 @@ 進度條方向 - + + Bar width: + + + + Bottom up 由下至上 - + Top down 由上至下 - + Left to right 由左至右 - + Right to left 由右至左 diff --git a/plugin-desktopswitch/CMakeLists.txt b/plugin-desktopswitch/CMakeLists.txt index dbb3ae7..6f3b792 100644 --- a/plugin-desktopswitch/CMakeLists.txt +++ b/plugin-desktopswitch/CMakeLists.txt @@ -1,20 +1,22 @@ set(PLUGIN "desktopswitch") set(HEADERS - desktopswitch.h + desktopswitch.h desktopswitchbutton.h + desktopswitchconfiguration.h ) set(SOURCES desktopswitch.cpp desktopswitchbutton.cpp + desktopswitchconfiguration.cpp ) -set(MOCS - desktopswitch.h - desktopswitchbutton.h +set(UIS + desktopswitchconfiguration.ui ) -set(LIBRARIES ${LIBRARIES} ${LXQT_LIBRARIES} ${LXQT_GLOBALKEYS_LIBRARIES} ) + +set(LIBRARIES ${LIBRARIES} lxqt lxqt-globalkeys) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-desktopswitch/desktopswitch.cpp b/plugin-desktopswitch/desktopswitch.cpp index dfe4217..26c9434 100644 --- a/plugin-desktopswitch/desktopswitch.cpp +++ b/plugin-desktopswitch/desktopswitch.cpp @@ -30,69 +30,139 @@ #include #include #include +#include #include #include -#include +#include +#include +#include -#include #include "desktopswitch.h" #include "desktopswitchbutton.h" +#include "desktopswitchconfiguration.h" + +#define DEFAULT_SHORTCUT_TEMPLATE QStringLiteral("Control+F%1") DesktopSwitch::DesktopSwitch(const ILxQtPanelPluginStartupInfo &startupInfo) : QObject(), ILxQtPanelPlugin(startupInfo), m_pSignalMapper(new QSignalMapper(this)), - m_desktopCount(KWindowSystem::numberOfDesktops()) + m_desktopCount(KWindowSystem::numberOfDesktops()), + mRows(-1), + mDesktops(new NETRootInfo(QX11Info::connection(), NET::NumberOfDesktops | NET::CurrentDesktop | NET::DesktopNames, NET::WM2DesktopLayout)), + mLabelType(static_cast(-1)) { m_buttons = new QButtonGroup(this); connect (m_pSignalMapper, SIGNAL(mapped(int)), this, SLOT(setDesktop(int))); mLayout = new LxQt::GridLayout(&mWidget); mWidget.setLayout(mLayout); - setup(); + + settingsChanged(); + + onCurrentDesktopChanged(KWindowSystem::currentDesktop()); + QTimer::singleShot(0, this, SLOT(registerShortcuts())); + + connect(m_buttons, SIGNAL(buttonClicked(int)), this, SLOT(setDesktop(int))); connect(KWindowSystem::self(), SIGNAL(numberOfDesktopsChanged(int)), SLOT(onNumberOfDesktopsChanged(int))); connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), SLOT(onCurrentDesktopChanged(int))); connect(KWindowSystem::self(), SIGNAL(desktopNamesChanged()), SLOT(onDesktopNamesChanged())); + + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged), + this, &DesktopSwitch::onWindowChanged); } -void DesktopSwitch::setup() +void DesktopSwitch::registerShortcuts() { - // clear current state - foreach (QAbstractButton * b, m_buttons->buttons()) + // Register shortcuts to change desktop + GlobalKeyShortcut::Action * gshortcut; + QString path; + QString description; + for (int i = 0; i < 12; ++i) { - // TODO/FIXME: maybe it has to be removed from layout too? - m_pSignalMapper->removeMappings(b); - m_buttons->removeButton(b); -// dynamic_cast(b)->unregisterShortcut(); - delete b; + path = QString("/panel/%1/desktop_%2").arg(settings()->group()).arg(i + 1); + description = tr("Switch to desktop %1").arg(i + 1); + + gshortcut = GlobalKeyShortcut::Client::instance()->addAction(QStringLiteral(), path, description, this); + if (nullptr != gshortcut) + { + m_keys << gshortcut; + connect(gshortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); + connect(gshortcut, SIGNAL(activated()), m_pSignalMapper, SLOT(map())); + m_pSignalMapper->setMapping(gshortcut, i); + } } +} + +void DesktopSwitch::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + disconnect(shortcut, &GlobalKeyShortcut::Action::registrationFinished, this, &DesktopSwitch::shortcutRegistered); - // create new desktop layout - for (int i = 0; i < m_desktopCount; ++i) + const int i = m_keys.indexOf(shortcut); + Q_ASSERT(-1 != i); + + if (shortcut->shortcut().isEmpty()) { - QString path = QString("/panel/%1/desktop_%2").arg(settings()->group()).arg(i + 1); - QString shortcut = QString("Control+F%1").arg(i + 1); - - DesktopSwitchButton * m = new DesktopSwitchButton(&mWidget, i, path, shortcut, - KWindowSystem::desktopName(i + 1).isEmpty() ? - tr("Desktop %1").arg(i + 1) : - KWindowSystem::desktopName(i + 1)); - m_pSignalMapper->setMapping(m, i); - connect(m, SIGNAL(activated()), m_pSignalMapper, SLOT(map())) ; - mWidget.layout()->addWidget(m); - m_buttons->addButton(m, i); + shortcut->changeShortcut(DEFAULT_SHORTCUT_TEMPLATE.arg(i + 1)); } +} - int activeDesk = KWindowSystem::currentDesktop(); - QAbstractButton * button = m_buttons->button(activeDesk - 1); - if (button) - button->setChecked(true); +void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2) +{ + if (properties.testFlag(NET::WMState)) + { + KWindowInfo info = KWindowInfo(id, NET::WMDesktop | NET::WMState); + int desktop = info.desktop(); + if (!info.valid() || info.onAllDesktops()) + return; + else + { + DesktopSwitchButton *button = static_cast(m_buttons->button(desktop - 1)); + if(button) + button->setUrgencyHint(id, info.hasState(NET::DemandsAttention)); + } + } +} + +void DesktopSwitch::refresh() +{ + QList btns = m_buttons->buttons(); + + int i = 0; + const int current_cnt = btns.count(); + const int border = qMin(btns.count(), m_desktopCount); + //update existing buttons + for ( ; i < border; ++i) + { + ((DesktopSwitchButton*)m_buttons->button(i))->update(i, mLabelType, + KWindowSystem::desktopName(i + 1).isEmpty() ? + tr("Desktop %1").arg(i + 1) : + KWindowSystem::desktopName(i + 1)); + } - connect(m_buttons, SIGNAL(buttonClicked(int)), - this, SLOT(setDesktop(int))); + //create new buttons (if neccessary) + QAbstractButton *b; + for ( ; i < m_desktopCount; ++i) + { + b = new DesktopSwitchButton(&mWidget, i, mLabelType, + KWindowSystem::desktopName(i+1).isEmpty() ? + tr("Desktop %1").arg(i+1) : + KWindowSystem::desktopName(i+1)); + mWidget.layout()->addWidget(b); + m_buttons->addButton(b, i); + } - realign(); + //delete unneeded buttons (if neccessary) + for ( ; i < current_cnt; ++i) + { + b = m_buttons->buttons().last(); + m_buttons->removeButton(b); + mWidget.layout()->removeWidget(b); + delete b; + } } DesktopSwitch::~DesktopSwitch() @@ -106,13 +176,9 @@ void DesktopSwitch::setDesktop(int desktop) void DesktopSwitch::onNumberOfDesktopsChanged(int count) { - if (m_desktopCount != count) - { - qDebug() << "Desktop count changed from" << m_desktopCount << "to" << count; - m_desktopCount = count; - onDesktopNamesChanged(); - setup(); - } + qDebug() << "Desktop count changed from" << m_desktopCount << "to" << count; + m_desktopCount = count; + refresh(); } void DesktopSwitch::onCurrentDesktopChanged(int current) @@ -124,46 +190,73 @@ void DesktopSwitch::onCurrentDesktopChanged(int current) void DesktopSwitch::onDesktopNamesChanged() { - QStringList names; - const int count = KWindowSystem::numberOfDesktops(); - for (int i = 0; i < count; ++i) - names << KWindowSystem::desktopName(i + 1); - m_desktopNames = names; - setup(); + refresh(); +} + +void DesktopSwitch::settingsChanged() +{ + int value = settings()->value("rows", 1).toInt(); + if (mRows != value) + { + mRows = value; + realign(); + } + value = settings()->value("labelType", DesktopSwitchButton::LABEL_TYPE_NUMBER).toInt(); + if (mLabelType != static_cast(value)) + { + mLabelType = static_cast(value); + refresh(); + } } void DesktopSwitch::realign() { + int columns = static_cast(ceil(static_cast(m_desktopCount) / mRows)); mLayout->setEnabled(false); - if (panel()->isHorizontal()) { - mLayout->setRowCount(qMin(panel()->lineCount(), mLayout->count())); + mLayout->setRowCount(mRows); mLayout->setColumnCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, columns, mRows, NET::DesktopLayoutCornerTopLeft); } else { - mLayout->setColumnCount(qMin(panel()->lineCount(), mLayout->count())); + mLayout->setColumnCount(mRows); mLayout->setRowCount(0); + mDesktops->setDesktopLayout(NET::OrientationHorizontal, mRows, columns, NET::DesktopLayoutCornerTopLeft); } mLayout->setEnabled(true); } +QDialog *DesktopSwitch::configureDialog() +{ + return new DesktopSwitchConfiguration(settings()); +} + DesktopSwitchWidget::DesktopSwitchWidget(): - QFrame() + QFrame(), + m_mouseWheelThresholdCounter(0) { } void DesktopSwitchWidget::wheelEvent(QWheelEvent *e) { - int max = KWindowSystem::currentDesktop() - 1; + // Without some sort of threshold which has to be passed, scrolling is too sensitive + m_mouseWheelThresholdCounter -= e->delta(); + // If the user hasn't scrolled far enough in one direction (positive or negative): do nothing + if(abs(m_mouseWheelThresholdCounter) < 100) + return; + + int max = KWindowSystem::numberOfDesktops(); int delta = e->delta() < 0 ? 1 : -1; int current = KWindowSystem::currentDesktop() + delta; - if (current > max) - current = 0; - else if (current < 0) + if (current > max){ + current = 1; + } + else if (current < 1) current = max; + m_mouseWheelThresholdCounter = 0; KWindowSystem::setCurrentDesktop(current); } diff --git a/plugin-desktopswitch/desktopswitch.h b/plugin-desktopswitch/desktopswitch.h index ed3ed41..23ea20a 100644 --- a/plugin-desktopswitch/desktopswitch.h +++ b/plugin-desktopswitch/desktopswitch.h @@ -31,9 +31,14 @@ #include "../panel/ilxqtpanelplugin.h" #include +#include +#include + +#include "desktopswitchbutton.h" class QSignalMapper; class QButtonGroup; +class NETRootInfo; namespace LxQt { class GridLayout; } @@ -44,6 +49,9 @@ class DesktopSwitchWidget: public QFrame public: DesktopSwitchWidget(); +private: + int m_mouseWheelThresholdCounter; + protected: void wheelEvent(QWheelEvent* e); }; @@ -63,30 +71,40 @@ public: bool isSeparate() const { return true; } void realign(); + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + private: QButtonGroup * m_buttons; + QList m_keys; QSignalMapper* m_pSignalMapper; int m_desktopCount; - QStringList m_desktopNames; DesktopSwitchWidget mWidget; LxQt::GridLayout *mLayout; + int mRows; + QScopedPointer mDesktops; + DesktopSwitchButton::LabelType mLabelType; - void setup(); + void refresh(); private slots: void setDesktop(int desktop); void onNumberOfDesktopsChanged(int); void onCurrentDesktopChanged(int); void onDesktopNamesChanged(); + virtual void settingsChanged(); + void registerShortcuts(); + void shortcutRegistered(); + void onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2); }; class DesktopSwitchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new DesktopSwitch(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new DesktopSwitch(startupInfo);} }; #endif diff --git a/plugin-desktopswitch/desktopswitchbutton.cpp b/plugin-desktopswitch/desktopswitchbutton.cpp index 1cf26f7..b458780 100644 --- a/plugin-desktopswitch/desktopswitchbutton.cpp +++ b/plugin-desktopswitch/desktopswitchbutton.cpp @@ -27,43 +27,53 @@ #include -#include +#include +#include #include #include "desktopswitchbutton.h" -DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, const QString &path, const QString &shortcut, const QString &title) - : QToolButton(parent) - , m_shortcut(0) - , mIndex(index) +DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title) + : QToolButton(parent), + mUrgencyHint(false) { - setText(QString::number(index + 1)); + update(index, labelType, title); + setCheckable(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - - if (!shortcut.isEmpty()) +} + +void DesktopSwitchButton::update(int index, LabelType labelType, const QString &title) +{ + switch (labelType) { - QString description = tr("Switch to desktop %1").arg(index + 1); - if (!title.isEmpty()) - { - description.append(QString(" (%1)").arg(title)); - } - m_shortcut = GlobalKeyShortcut::Client::instance()->addAction(QString(), path, description, this); - if (m_shortcut) - { - if (m_shortcut->shortcut().isEmpty()) - m_shortcut->changeShortcut(shortcut); - connect(m_shortcut, SIGNAL(activated()), this, SIGNAL(activated())); - } + case LABEL_TYPE_NAME: + setText(title); + break; + + default: // LABEL_TYPE_NUMBER + setText(QString::number(index + 1)); } - + if (!title.isEmpty()) { setToolTip(title); } } -void DesktopSwitchButton::unregisterShortcut() +void DesktopSwitchButton::setUrgencyHint(WId id, bool urgent) { - GlobalKeyShortcut::Client::instance()->removeAction(QString("/desktop_switch/desktop_%1").arg(mIndex + 1)); + if (urgent) + mUrgentWIds.insert(id); + else + mUrgentWIds.remove(id); + + if (mUrgencyHint != !mUrgentWIds.empty()) + { + mUrgencyHint = !mUrgentWIds.empty(); + setProperty("urgent", mUrgencyHint); + style()->unpolish(this); + style()->polish(this); + QToolButton::update(); + } } diff --git a/plugin-desktopswitch/desktopswitchbutton.h b/plugin-desktopswitch/desktopswitchbutton.h index 911dbf6..18bebcc 100644 --- a/plugin-desktopswitch/desktopswitchbutton.h +++ b/plugin-desktopswitch/desktopswitchbutton.h @@ -30,7 +30,7 @@ #define DESKTOPSWITCHBUTTON_H #include - +#include namespace GlobalKeyShortcut { @@ -40,19 +40,23 @@ class Action; class DesktopSwitchButton : public QToolButton { Q_OBJECT - + public: - DesktopSwitchButton(QWidget * parent, int index, const QString &path, const QString &shortcut, const QString &title=QString()); + enum LabelType { // Must match with combobox indexes + LABEL_TYPE_NUMBER = 0, + LABEL_TYPE_NAME = 1 + }; -public slots: - void unregisterShortcut(); + DesktopSwitchButton(QWidget * parent, int index, LabelType labelType, const QString &title=QString()); + void update(int index, LabelType labelType, const QString &title); -signals: - void activated(); + void setUrgencyHint(WId, bool); private: - GlobalKeyShortcut::Action * m_shortcut; - int mIndex; + + // for urgency hint handling + bool mUrgencyHint; + QSet mUrgentWIds; }; #endif diff --git a/plugin-desktopswitch/desktopswitchconfiguration.cpp b/plugin-desktopswitch/desktopswitchconfiguration.cpp new file mode 100644 index 0000000..62457b6 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "desktopswitchconfiguration.h" +#include "ui_desktopswitchconfiguration.h" +#include +#include + +DesktopSwitchConfiguration::DesktopSwitchConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::DesktopSwitchConfiguration) + , mSettings(settings) + , mOldSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DesktopSwitchConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + + connect(ui->rowsSB, SIGNAL(valueChanged(int)), this, SLOT(rowsChanged(int))); + connect(ui->labelTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(labelTypeChanged(int))); + + loadDesktopsNames(); +} + +DesktopSwitchConfiguration::~DesktopSwitchConfiguration() +{ + delete ui; +} + +void DesktopSwitchConfiguration::loadSettings() +{ + ui->rowsSB->setValue(mSettings->value("rows", 1).toInt()); + ui->labelTypeCB->setCurrentIndex(mSettings->value("labelType", 0).toInt()); +} + +void DesktopSwitchConfiguration::loadDesktopsNames() +{ + int n = KWindowSystem::numberOfDesktops(); + for (int i = 1; i <= n; i++) + { + QLineEdit *edit = new QLineEdit(KWindowSystem::desktopName(i), this); + ((QFormLayout *) ui->namesGroupBox->layout())->addRow(QString("Desktop %1:").arg(i), edit); + + // C++11 rocks! + QTimer *timer = new QTimer(this); + timer->setInterval(400); + timer->setSingleShot(true); + connect(timer, &QTimer::timeout, [=] { KWindowSystem::setDesktopName(i, edit->text()); }); + connect(edit, &QLineEdit::textEdited, [=] { timer->start(); }); + } +} + +void DesktopSwitchConfiguration::rowsChanged(int value) +{ + mSettings->setValue("rows", value); +} + +void DesktopSwitchConfiguration::labelTypeChanged(int type) +{ + mSettings->setValue("labelType", type); +} + +void DesktopSwitchConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + diff --git a/plugin-desktopswitch/desktopswitchconfiguration.h b/plugin-desktopswitch/desktopswitchconfiguration.h new file mode 100644 index 0000000..a2338c8 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.h @@ -0,0 +1,68 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DESKTOPSWITCHCERCONFIGURATION_H +#define DESKTOPSWITCHCERCONFIGURATION_H + +#include + +#include +#include +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class DesktopSwitchConfiguration; +} + +class DesktopSwitchConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit DesktopSwitchConfiguration(QSettings *settings, QWidget *parent = 0); + ~DesktopSwitchConfiguration(); + +private: + Ui::DesktopSwitchConfiguration *ui; + QSettings *mSettings; + LxQt::SettingsCache mOldSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void loadDesktopsNames(); + void dialogButtonsAction(QAbstractButton *btn); + void rowsChanged(int value); + void labelTypeChanged(int type); +}; + +#endif // DESKTOPSWITCHCERCONFIGURATION_H diff --git a/plugin-desktopswitch/desktopswitchconfiguration.ui b/plugin-desktopswitch/desktopswitchconfiguration.ui new file mode 100644 index 0000000..e387800 --- /dev/null +++ b/plugin-desktopswitch/desktopswitchconfiguration.ui @@ -0,0 +1,89 @@ + + + DesktopSwitchConfiguration + + + + 0 + 0 + 213 + 207 + + + + DesktopSwitch settings + + + + + + Rows + + + + + + 1 + + + 40 + + + 1 + + + + + + + Desktop labels: + + + + + + + Number of rows: + + + + + + + + Numbers + + + + + Names + + + + + + + + + + + Desktop names + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + diff --git a/plugin-desktopswitch/translations/desktopswitch.ts b/plugin-desktopswitch/translations/desktopswitch.ts index 7084f0a..8e780fe 100644 --- a/plugin-desktopswitch/translations/desktopswitch.ts +++ b/plugin-desktopswitch/translations/desktopswitch.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ar.ts b/plugin-desktopswitch/translations/desktopswitch_ar.ts index 49bcbf1..9b4b8c2 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ar.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ar.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 سطح المكتب %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_cs.ts b/plugin-desktopswitch/translations/desktopswitch_cs.ts index c8624ed..4ed8a99 100644 --- a/plugin-desktopswitch/translations/desktopswitch_cs.ts +++ b/plugin-desktopswitch/translations/desktopswitch_cs.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts b/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts index f8bb777..25bd4e7 100644 --- a/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts +++ b/plugin-desktopswitch/translations/desktopswitch_cs_CZ.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_da.ts b/plugin-desktopswitch/translations/desktopswitch_da.ts index d543e50..ec70c62 100644 --- a/plugin-desktopswitch/translations/desktopswitch_da.ts +++ b/plugin-desktopswitch/translations/desktopswitch_da.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Skrivebord %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_da_DK.ts b/plugin-desktopswitch/translations/desktopswitch_da_DK.ts index 97c3f81..4b7d15c 100644 --- a/plugin-desktopswitch/translations/desktopswitch_da_DK.ts +++ b/plugin-desktopswitch/translations/desktopswitch_da_DK.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Skrivebord %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_de.desktop b/plugin-desktopswitch/translations/desktopswitch_de.desktop index ffbaac2..d914d52 100644 --- a/plugin-desktopswitch/translations/desktopswitch_de.desktop +++ b/plugin-desktopswitch/translations/desktopswitch_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Desktop switcher -Comment=Allows easy switching between virtual desktops. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Erlaubt es zwichen den virtuellen Arbeitsflächen zu schalten Name[de]=Arbeitsflächenumschalter +Comment[de]=Zwischen den virtuellen Arbeitsflächen umschalten diff --git a/plugin-desktopswitch/translations/desktopswitch_de.ts b/plugin-desktopswitch/translations/desktopswitch_de.ts index fc29bc2..70e8cb8 100644 --- a/plugin-desktopswitch/translations/desktopswitch_de.ts +++ b/plugin-desktopswitch/translations/desktopswitch_de.ts @@ -4,17 +4,53 @@ DesktopSwitch - + + Switch to desktop %1 + Zu Arbeitsfläche %1 wechseln + + + + Desktop %1 Arbeitsfläche %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Arbeitsflächenumschalter - Einstellungen + + + + Rows + Zeilen + + + + Desktop labels: + Arbeitsflächenbezeichnungen: + + + + Number of rows: + Anzahl der Zeilen: + + + + Numbers + Ziffern + + + + Names + Namen + + + + Desktop names + Arbeitsflächenbezeichnungen diff --git a/plugin-desktopswitch/translations/desktopswitch_de_DE.desktop b/plugin-desktopswitch/translations/desktopswitch_de_DE.desktop deleted file mode 100644 index 6ba8d0b..0000000 --- a/plugin-desktopswitch/translations/desktopswitch_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Desktop switcher -Comment=Allows easy switching between virtual desktops. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Wechsel zwischen virtuellen Arbeitsflächen erlauben -Name[de_DE]=Arbeitsflächen-Umschalter diff --git a/plugin-desktopswitch/translations/desktopswitch_de_DE.ts b/plugin-desktopswitch/translations/desktopswitch_de_DE.ts deleted file mode 100644 index 763fc82..0000000 --- a/plugin-desktopswitch/translations/desktopswitch_de_DE.ts +++ /dev/null @@ -1,20 +0,0 @@ - - - - - DesktopSwitch - - - Desktop %1 - Arbeitsfläche %1 - - - - DesktopSwitchButton - - - Switch to desktop %1 - - - - diff --git a/plugin-desktopswitch/translations/desktopswitch_el_GR.ts b/plugin-desktopswitch/translations/desktopswitch_el_GR.ts index d1338eb..5324f55 100644 --- a/plugin-desktopswitch/translations/desktopswitch_el_GR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_el_GR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Επιφάνεια εργασίας %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_eo.ts b/plugin-desktopswitch/translations/desktopswitch_eo.ts index f121479..d22161e 100644 --- a/plugin-desktopswitch/translations/desktopswitch_eo.ts +++ b/plugin-desktopswitch/translations/desktopswitch_eo.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Labortablo %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es.ts b/plugin-desktopswitch/translations/desktopswitch_es.ts index 9d91f5b..d661b75 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es_UY.ts b/plugin-desktopswitch/translations/desktopswitch_es_UY.ts index af1163f..3139142 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es_UY.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es_UY.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_es_VE.ts b/plugin-desktopswitch/translations/desktopswitch_es_VE.ts index dac3da2..c936769 100644 --- a/plugin-desktopswitch/translations/desktopswitch_es_VE.ts +++ b/plugin-desktopswitch/translations/desktopswitch_es_VE.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Escritorio %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_eu.ts b/plugin-desktopswitch/translations/desktopswitch_eu.ts index 3fa883d..e23ee1b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_eu.ts +++ b/plugin-desktopswitch/translations/desktopswitch_eu.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 %1 mahaigaina - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_fi.ts b/plugin-desktopswitch/translations/desktopswitch_fi.ts index d495a34..5d78386 100644 --- a/plugin-desktopswitch/translations/desktopswitch_fi.ts +++ b/plugin-desktopswitch/translations/desktopswitch_fi.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Työpöytä %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts b/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts index 06369bd..884e24b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_fr_FR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Bureau %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_hr.ts b/plugin-desktopswitch/translations/desktopswitch_hr.ts new file mode 100644 index 0000000..68078e7 --- /dev/null +++ b/plugin-desktopswitch/translations/desktopswitch_hr.ts @@ -0,0 +1,46 @@ + + + + + DesktopSwitch + + + Switch to desktop %1 + Prebaci na radnu površinu %1 + + + + + Desktop %1 + Radna površina %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + Postavke prebacivaša radnih površina + + + + Number of rows: + Broj redaka: + + + + Desktop labels: + + + + + Numbers + Brojevi + + + + Names + Imena + + + diff --git a/plugin-desktopswitch/translations/desktopswitch_hu.ts b/plugin-desktopswitch/translations/desktopswitch_hu.ts index b348ad3..0c05cfb 100644 --- a/plugin-desktopswitch/translations/desktopswitch_hu.ts +++ b/plugin-desktopswitch/translations/desktopswitch_hu.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + %1. asztalra váltás + + + + Desktop %1 - + %1. asztal - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek diff --git a/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts b/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts index 26f5593..4c43b72 100644 --- a/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts +++ b/plugin-desktopswitch/translations/desktopswitch_hu_HU.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + %1. asztalra váltás + + + + Desktop %1 %1. asztal - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Asztalváltó beállítás + + + + Number of rows: + Sorok száma: + + + + Desktop labels: + Asztalazonosítók: + + + + Numbers + Számok + + + + Names + Nevek diff --git a/plugin-desktopswitch/translations/desktopswitch_ia.ts b/plugin-desktopswitch/translations/desktopswitch_ia.ts index ff357dd..053e80f 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ia.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ia.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_id_ID.ts b/plugin-desktopswitch/translations/desktopswitch_id_ID.ts index 7266de9..f5ff166 100644 --- a/plugin-desktopswitch/translations/desktopswitch_id_ID.ts +++ b/plugin-desktopswitch/translations/desktopswitch_id_ID.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_it_IT.ts b/plugin-desktopswitch/translations/desktopswitch_it_IT.ts index a558746..6d599e2 100644 --- a/plugin-desktopswitch/translations/desktopswitch_it_IT.ts +++ b/plugin-desktopswitch/translations/desktopswitch_it_IT.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ja.ts b/plugin-desktopswitch/translations/desktopswitch_ja.ts index eb256dd..6f5e4c9 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ja.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ja.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + デスクトップ%1に切り替える + + + + Desktop %1 デスクトップ %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - デスクトップ%1に切り替える + デスクトップ%1に切り替える + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_ko.ts b/plugin-desktopswitch/translations/desktopswitch_ko.ts index 8acf723..44ccfb1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ko.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ko.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_lt.ts b/plugin-desktopswitch/translations/desktopswitch_lt.ts index 784eb70..99c393c 100644 --- a/plugin-desktopswitch/translations/desktopswitch_lt.ts +++ b/plugin-desktopswitch/translations/desktopswitch_lt.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 %1 darbalaukis - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_nl.ts b/plugin-desktopswitch/translations/desktopswitch_nl.ts index d05a346..977987b 100644 --- a/plugin-desktopswitch/translations/desktopswitch_nl.ts +++ b/plugin-desktopswitch/translations/desktopswitch_nl.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Bureaublad %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts b/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts index 6092fd4..3e7c7f3 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pl_PL.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Pulpit %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pt.ts b/plugin-desktopswitch/translations/desktopswitch_pt.ts index 5884cf8..b71d7a6 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pt.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pt.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Área de trabalho %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts b/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts index 83b74ea..e7b91e9 100644 --- a/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts +++ b/plugin-desktopswitch/translations/desktopswitch_pt_BR.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Área de trabalho %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts b/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts index 57cde84..93055b1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ro_RO.ts @@ -4,17 +4,43 @@ DesktopSwitch - + + Switch to desktop %1 + Comutare la ecranul %1 + + + + Desktop %1 Ecranul %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 - + + DesktopSwitch settings + Setäri de comutare a ecranului + + + + Number of rows: + Numărul de rânduri: + + + + Desktop labels: + Etichetele ecranelor: + + + + Numbers + Numere + + + + Names + Nume diff --git a/plugin-desktopswitch/translations/desktopswitch_ru.ts b/plugin-desktopswitch/translations/desktopswitch_ru.ts index e703819..dead547 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ru.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ru.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + Desktop %1 Рабочий стол %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - Переключиться на рабочий стол %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts b/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts index 4affda1..95aa9c4 100644 --- a/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts +++ b/plugin-desktopswitch/translations/desktopswitch_ru_RU.ts @@ -4,7 +4,13 @@ DesktopSwitch - + + Switch to desktop %1 + Переключиться на рабочий стол %1 + + + + Desktop %1 Рабочий стол %1 @@ -12,9 +18,36 @@ DesktopSwitchButton - Switch to desktop %1 - Переключиться на рабочий стол %1 + Переключиться на рабочий стол %1 + + + + DesktopSwitchConfiguration + + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names + diff --git a/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts b/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts index 91e8d09..c5777c5 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sk_SK.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Plocha %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sl.ts b/plugin-desktopswitch/translations/desktopswitch_sl.ts index 41032f4..3b9d207 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sl.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sl.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Namizje %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts b/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts index 8bc31cc..1ab6a1d 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr@latin.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts b/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts index 3b8063b..bc8eaaa 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr_BA.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Површ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts b/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts index 18874be..5001657 100644 --- a/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts +++ b/plugin-desktopswitch/translations/desktopswitch_sr_RS.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Површ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_th_TH.ts b/plugin-desktopswitch/translations/desktopswitch_th_TH.ts index 275e04f..0f54e7a 100644 --- a/plugin-desktopswitch/translations/desktopswitch_th_TH.ts +++ b/plugin-desktopswitch/translations/desktopswitch_th_TH.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 พื้นโต๊ะ %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_tr.ts b/plugin-desktopswitch/translations/desktopswitch_tr.ts index b01f535..c088b69 100644 --- a/plugin-desktopswitch/translations/desktopswitch_tr.ts +++ b/plugin-desktopswitch/translations/desktopswitch_tr.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Masaüstü %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_uk.ts b/plugin-desktopswitch/translations/desktopswitch_uk.ts index 5f08b13..2d513d0 100644 --- a/plugin-desktopswitch/translations/desktopswitch_uk.ts +++ b/plugin-desktopswitch/translations/desktopswitch_uk.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 Стільниця %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts b/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts index 9e012da..96fe963 100644 --- a/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts +++ b/plugin-desktopswitch/translations/desktopswitch_zh_CN.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 桌面 %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts b/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts index ef6b347..430f5d1 100644 --- a/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts +++ b/plugin-desktopswitch/translations/desktopswitch_zh_TW.ts @@ -4,16 +4,42 @@ DesktopSwitch - + + Switch to desktop %1 + + + + + Desktop %1 桌面 %1 - DesktopSwitchButton + DesktopSwitchConfiguration - - Switch to desktop %1 + + DesktopSwitch settings + + + + + Number of rows: + + + + + Desktop labels: + + + + + Numbers + + + + + Names diff --git a/plugin-directorymenu/CMakeLists.txt b/plugin-directorymenu/CMakeLists.txt new file mode 100644 index 0000000..319b02d --- /dev/null +++ b/plugin-directorymenu/CMakeLists.txt @@ -0,0 +1,23 @@ +set(PLUGIN "directorymenu") + +set(HEADERS + directorymenu.h + directorymenuconfiguration.h +) + +set(SOURCES + directorymenu.cpp + directorymenuconfiguration.cpp +) + +set(UIS + directorymenuconfiguration.ui +) + +set(LIBRARIES + ${LIBRARIES} + Qt5Xdg +) + +include ("../cmake/BuildPlugin.cmake") +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-directorymenu/directorymenu.cpp b/plugin-directorymenu/directorymenu.cpp new file mode 100644 index 0000000..4ffee7f --- /dev/null +++ b/plugin-directorymenu/directorymenu.cpp @@ -0,0 +1,192 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is diinstributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#include "directorymenu.h" +#include +#include +#include +#include +#include + +#include + +DirectoryMenu::DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo), + mMenu(0), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + mOpenDirectorySignalMapper = new QSignalMapper(this); + mMenuSignalMapper = new QSignalMapper(this); + + mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + mButton.setIcon(XdgIcon::fromTheme("folder")); + + connect(&mButton, SIGNAL(clicked()), this, SLOT(showMenu())); + connect(mOpenDirectorySignalMapper, SIGNAL(mapped(QString)), this, SLOT(openDirectory(QString))); + connect(mMenuSignalMapper, SIGNAL(mapped(QString)), this, SLOT(addMenu(QString))); + + settingsChanged(); +} + +DirectoryMenu::~DirectoryMenu() +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } +} + +void DirectoryMenu::showMenu() +{ + if(mBaseDirectory.exists()) + { + buildMenu(mBaseDirectory.absolutePath()); + } + else + { + buildMenu(QDir::homePath()); + } + + + int x=0, y=0; + + switch (panel()->position()) + { + case ILxQtPanel::PositionTop: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().bottom(); + break; + + case ILxQtPanel::PositionBottom: + x = mButton.mapToGlobal(QPoint(0, 0)).x(); + y = panel()->globalGometry().top() - mMenu->sizeHint().height(); + break; + + case ILxQtPanel::PositionLeft: + x = panel()->globalGometry().right(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + + case ILxQtPanel::PositionRight: + x = panel()->globalGometry().left() - mMenu->sizeHint().width(); + y = mButton.mapToGlobal(QPoint(0, 0)).y(); + break; + } + + // Just using Qt`s activateWindow() won't work on some WMs like Kwin. + // Solution is to execute menu 1ms later using timer + mButton.activateWindow(); + mMenu->exec(QPoint(x, y)); +} + +void DirectoryMenu::buildMenu(const QString& path) +{ + if(mMenu) + { + delete mMenu; + mMenu = 0; + } + + mPathStrings.clear(); + + mMenu = new QMenu(); + + addActions(mMenu, path); +} + +void DirectoryMenu::openDirectory(const QString& path) +{ + QDesktopServices::openUrl(QUrl("file://" + QDir::toNativeSeparators(path))); +} + +void DirectoryMenu::addMenu(QString path) +{ + QSignalMapper* sender = (QSignalMapper* )QObject::sender(); + QMenu* parentMenu = (QMenu*) sender->mapping(path); + + if(parentMenu->isEmpty()) + { + addActions(parentMenu, path); + } +} + +void DirectoryMenu::addActions(QMenu* menu, const QString& path) +{ + mPathStrings.push_back(path); + + QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme("folder"), tr("Open")); + connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map())); + mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back()); + + menu->addSeparator(); + + QDir dir(path); + QFileInfoList list = dir.entryInfoList(); + + foreach (const QFileInfo& entry, list) + { + if(entry.isDir() && !entry.isHidden()) + { + mPathStrings.push_back(entry.fileName()); + + QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme("folder"), mPathStrings.back()); + + connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map())); + mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath()); + } + } +} + +QDialog* DirectoryMenu::configureDialog() +{ + return new DirectoryMenuConfiguration(*settings()); +} + +void DirectoryMenu::settingsChanged() +{ + mBaseDirectory.setPath(settings()->value("baseDirectory", QDir::homePath()).toString()); + + QString iconPath = settings()->value("icon", QString()).toString(); + QIcon icon = QIcon(iconPath); + + if(!icon.isNull()) + { + QIcon buttonIcon = QIcon(icon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + mButton.setIcon(buttonIcon); + return; + } + } + + mButton.setIcon(mDefaultIcon); +} diff --git a/plugin-directorymenu/directorymenu.h b/plugin-directorymenu/directorymenu.h new file mode 100644 index 0000000..a3825da --- /dev/null +++ b/plugin-directorymenu/directorymenu.h @@ -0,0 +1,94 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef DIRECTORYMENU_H +#define DIRECTORYMENU_H + +#include "../panel/ilxqtpanelplugin.h" + #include "directorymenuconfiguration.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +class DirectoryMenu : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + DirectoryMenu(const ILxQtPanelPluginStartupInfo &startupInfo); + ~DirectoryMenu(); + + virtual QWidget *widget() { return &mButton; } + virtual QString themeId() const { return "DirectoryMenu"; } + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + void settingsChanged(); + +private slots: + void showMenu(); + void openDirectory(const QString& path); + void addMenu(QString path); + +protected slots: + void buildMenu(const QString& path); + +private: + void addActions(QMenu* menu, const QString& path); + + QToolButton mButton; + QMenu *mMenu; + QSignalMapper *mOpenDirectorySignalMapper; + QSignalMapper *mMenuSignalMapper; + + QDir mBaseDirectory; + QIcon mDefaultIcon; + std::vector mPathStrings; +}; + +class DirectoryMenuLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new DirectoryMenu(startupInfo); + } +}; + + +#endif + diff --git a/plugin-directorymenu/directorymenuconfiguration.cpp b/plugin-directorymenu/directorymenuconfiguration.cpp new file mode 100644 index 0000000..501d585 --- /dev/null +++ b/plugin-directorymenu/directorymenuconfiguration.cpp @@ -0,0 +1,140 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2015 LXQt team + * Authors: + * Daniel Drzisga + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#include +#include +#include +#include + +#include + +#include "directorymenuconfiguration.h" +#include "ui_directorymenuconfiguration.h" + + +DirectoryMenuConfiguration::DirectoryMenuConfiguration(QSettings &settings, QWidget *parent) : + QDialog(parent), + ui(new Ui::DirectoryMenuConfiguration), + mSettings(settings), + mOldSettings(settings), + mBaseDirectory(QDir::homePath()), + mDefaultIcon(XdgIcon::fromTheme("folder")) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("DirectoryMenuConfigurationWindow"); + ui->setupUi(this); + + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); + + loadSettings(); + ui->baseDirectoryB->setIcon(mDefaultIcon); + + connect(ui->baseDirectoryB, SIGNAL(clicked()), SLOT(showDirectoryDialog())); + connect(ui->iconB, SIGNAL(clicked()), SLOT(showIconDialog())); +} + +DirectoryMenuConfiguration::~DirectoryMenuConfiguration() +{ + delete ui; +} + +void DirectoryMenuConfiguration::loadSettings() +{ + mBaseDirectory.setPath(mSettings.value("baseDirectory", QDir::homePath()).toString()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + mIcon = mSettings.value("icon", QString()).toString(); + if(!mIcon.isNull()) + { + QIcon buttonIcon = QIcon(mIcon); + if(!buttonIcon.pixmap(QSize(24,24)).isNull()) + { + ui->iconB->setIcon(buttonIcon); + return; + } + } + + ui->iconB->setIcon(mDefaultIcon); +} + +void DirectoryMenuConfiguration::saveSettings() +{ + mSettings.setValue("baseDirectory", mBaseDirectory.absolutePath()); + mSettings.setValue("icon", mIcon); +} + +void DirectoryMenuConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) + { + mOldSettings.loadToSettings(); + loadSettings(); + } + else + { + close(); + } +} + +void DirectoryMenuConfiguration::showDirectoryDialog() +{ + QFileDialog d(this, tr("Choose Base Directory"), mBaseDirectory.absolutePath()); + d.setFileMode(QFileDialog::Directory); + d.setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + mBaseDirectory.setPath(d.selectedFiles().front()); + ui->baseDirectoryB->setText(mBaseDirectory.dirName()); + + saveSettings(); + } +} + +void DirectoryMenuConfiguration::showIconDialog() +{ + QFileDialog d(this, tr("Choose Icon"), QDir::homePath(), tr("Icons (*.png *.xpm *.jpg)")); + d.setWindowModality(Qt::WindowModal); + + if(d.exec() && !d.selectedFiles().isEmpty()) + { + QIcon newIcon = QIcon(d.selectedFiles().front()); + + if(newIcon.pixmap(QSize(24,24)).isNull()) + { + QMessageBox::warning(this, tr("Directory Menu"), tr("An error occurred while loading the icon.")); + return; + } + + ui->iconB->setIcon(newIcon); + mIcon = d.selectedFiles().front(); + saveSettings(); + } +} diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.h b/plugin-directorymenu/directorymenuconfiguration.h similarity index 64% rename from plugin-kbindicator/lxqtkbindicatorconfiguration.h rename to plugin-directorymenu/directorymenuconfiguration.h index bcefc5c..9bdcca4 100644 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.h +++ b/plugin-directorymenu/directorymenuconfiguration.h @@ -3,10 +3,11 @@ * * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org + * http://lxqt.org * - * Copyright: 2012 Razor team + * Copyright: 2015 LXQt team * Authors: - * Kuzma Shapran + * Daniel Drzisga * * This program or library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser General Public @@ -26,34 +27,37 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQTKBINDICATORCONFIGURATION_H -#define LXQTKBINDICATORCONFIGURATION_H - -#include +#ifndef DIRECTORYMENUCONFIGURATION_H +#define DIRECTORYMENUCONFIGURATION_H #include #include +#include +#include +#include +#include +#include namespace Ui { - class LxQtKbIndicatorConfiguration; + class DirectoryMenuConfiguration; } -class LxQtKbIndicatorConfiguration : public QDialog +class DirectoryMenuConfiguration : public QDialog { Q_OBJECT public: - explicit LxQtKbIndicatorConfiguration(QSettings *settings, QWidget *parent = 0); - ~LxQtKbIndicatorConfiguration(); - -public slots: - void saveSettings(); + explicit DirectoryMenuConfiguration(QSettings &settings, QWidget *parent = 0); + ~DirectoryMenuConfiguration(); private: - Ui::LxQtKbIndicatorConfiguration *ui; - QSettings *mSettings; - LxQt::SettingsCache oldSettings; + Ui::DirectoryMenuConfiguration *ui; + QSettings &mSettings; + LxQt::SettingsCache mOldSettings; + QDir mBaseDirectory; + QString mIcon; + QIcon mDefaultIcon; /* Read settings from conf file and put data into controls. @@ -64,7 +68,12 @@ private slots: /* Saves settings in conf file. */ + void saveSettings(); void dialogButtonsAction(QAbstractButton *btn); + void showDirectoryDialog(); + void showIconDialog(); + +private: }; -#endif // LXQTKBINDICATORCONFIGURATION_H +#endif // DIRECTORYMENUCONFIGURATION_H diff --git a/plugin-directorymenu/directorymenuconfiguration.ui b/plugin-directorymenu/directorymenuconfiguration.ui new file mode 100644 index 0000000..6a592d2 --- /dev/null +++ b/plugin-directorymenu/directorymenuconfiguration.ui @@ -0,0 +1,113 @@ + + + DirectoryMenuConfiguration + + + + 0 + 0 + 342 + 168 + + + + Directory Menu Settings + + + + + + Appearance + + + + + + Base directory: + + + + + + + + 0 + 0 + + + + BaseDirectoryName + + + + + + + Icon: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Reset + + + + + + + + + buttons + accepted() + DirectoryMenuConfiguration + accept() + + + 214 + 350 + + + 157 + 274 + + + + + buttons + rejected() + DirectoryMenuConfiguration + reject() + + + 214 + 350 + + + 196 + 274 + + + + + diff --git a/plugin-directorymenu/resources/directorymenu.desktop.in b/plugin-directorymenu/resources/directorymenu.desktop.in new file mode 100644 index 0000000..c86b448 --- /dev/null +++ b/plugin-directorymenu/resources/directorymenu.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory +Icon=folder + +#TRANSLATIONS_DIR=../translations diff --git a/plugin-directorymenu/translations/directorymenu.ts b/plugin-directorymenu/translations/directorymenu.ts new file mode 100644 index 0000000..d27edc1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + + + + + Appearance + + + + + Base directory: + + + + + BaseDirectoryName + + + + + Icon: + + + + + Choose Base Directory + + + + + Choose Icon + + + + + Icons (*.png *.xpm *.jpg) + + + + + Directory Menu + + + + + An error occurred while loading the icon. + + + + diff --git a/plugin-directorymenu/translations/directorymenu_de.desktop b/plugin-directorymenu/translations/directorymenu_de.desktop new file mode 100644 index 0000000..4edd17a --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Ordnermenü +Comment[de]=Zeigt ein Menü mit dem Inhalt eines Ordners an diff --git a/plugin-directorymenu/translations/directorymenu_de.ts b/plugin-directorymenu/translations/directorymenu_de.ts new file mode 100644 index 0000000..415bc4e --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_de.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Öffnen + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Einstellungen des Verzeichnismenüs + + + + Appearance + Erscheinungsbild + + + + Base directory: + Basisverzeichnis: + + + + BaseDirectoryName + BasisVerzeichnisName + + + + Icon: + Symbol: + + + + Choose Base Directory + Basisverzeichnis auswählen + + + + Choose Icon + Symbol auswählen + + + + Icons (*.png *.xpm *.jpg) + Symbole (*.png *.xpm *.jpg) + + + + Directory Menu + Verzeichnismenü + + + + An error occurred while loading the icon. + Beim Laden des Symbols trat ein Fehler auf. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hr.ts b/plugin-directorymenu/translations/directorymenu_hr.ts new file mode 100644 index 0000000..8c7e6f1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hr.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Otvori + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Postavke izbornika direktorija + + + + Appearance + Izgled + + + + Base directory: + Osnovni direktorij: + + + + BaseDirectoryName + Ime osnovnog direktorija + + + + Icon: + Ikona: + + + + Choose Base Directory + Izaberite osnovni direktorij + + + + Choose Icon + Izaberite ikonu + + + + Icons (*.png *.xpm *.jpg) + Ikone (*.png *.xpm *.jpg) + + + + Directory Menu + Izbornik direktorija + + + + An error occurred while loading the icon. + Došlo je do greške pri učitavanju ikone. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hu.desktop b/plugin-directorymenu/translations/directorymenu_hu.desktop new file mode 100644 index 0000000..edc6c3b --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Directory Menu +Comment=Displays a menu showing the contents of a directory + +#TRANSLATIONS_DIR=../translations + + +# Translations +Comment[hu]=Egy könyvtár tartalmát mutató menü +Name[hu]=Könyvtármenü diff --git a/plugin-directorymenu/translations/directorymenu_hu.ts b/plugin-directorymenu/translations/directorymenu_hu.ts new file mode 100644 index 0000000..573fec1 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/plugin-directorymenu/translations/directorymenu_hu_HU.ts b/plugin-directorymenu/translations/directorymenu_hu_HU.ts new file mode 100644 index 0000000..3bac2f9 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_hu_HU.ts @@ -0,0 +1,65 @@ + + + + + DirectoryMenu + + + Open + Nyit + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Könyvtármenü beállítás + + + + Appearance + Kinézet + + + + Base directory: + Alapkönyvtár: + + + + BaseDirectoryName + Alapkönyvtárnév + + + + Icon: + Ikon: + + + + Choose Base Directory + Aapkönyvtár kijelölés + + + + Choose Icon + Ikon kijelölés + + + + Icons (*.png *.xpm *.jpg) + Ikomok (*.png *.xpm *.jpg) + + + + Directory Menu + Könyvtármenü + + + + An error occurred while loading the icon. + Az ikon betöltése sikertelen. + + + diff --git a/plugin-directorymenu/translations/directorymenu_ru.desktop b/plugin-directorymenu/translations/directorymenu_ru.desktop new file mode 100644 index 0000000..0ee5c98 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Меню папки +Comment[ru]=Показывает меню, отображающее содержимое папки diff --git a/plugin-directorymenu/translations/directorymenu_ru.ts b/plugin-directorymenu/translations/directorymenu_ru.ts new file mode 100644 index 0000000..b900d65 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/plugin-directorymenu/translations/directorymenu_ru_RU.desktop b/plugin-directorymenu/translations/directorymenu_ru_RU.desktop new file mode 100644 index 0000000..5a29599 --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Меню папки +Comment[ru_RU]=Показывает меню, отображающее содержимое папки diff --git a/plugin-directorymenu/translations/directorymenu_ru_RU.ts b/plugin-directorymenu/translations/directorymenu_ru_RU.ts new file mode 100644 index 0000000..00d70bb --- /dev/null +++ b/plugin-directorymenu/translations/directorymenu_ru_RU.ts @@ -0,0 +1,60 @@ + + + + + DirectoryMenu + + + Open + Открыть + + + + DirectoryMenuConfiguration + + + Directory Menu Settings + Настройки меню папки + + + + Appearance + Внешний вид + + + + Base directory: + Начальная папка: + + + + Icon: + Значок: + + + + Choose Base Directory + Выберите начальную папку + + + + Choose Icon + Выберите значок + + + + Icons (*.png *.xpm *.jpg) + Значки (*.png *.xpm *.jpg) + + + + Directory Menu + Меню папки + + + + An error occurred while loading the icon. + Произошла ошибка при загрузке значка. + + + diff --git a/plugin-dom/CMakeLists.txt b/plugin-dom/CMakeLists.txt index 19ea77b..8bddcb9 100644 --- a/plugin-dom/CMakeLists.txt +++ b/plugin-dom/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES domtreeitem.cpp ) -set(MOCS - domplugin.h - treewindow.h - domtreeitem.h -) - set(UIS treewindow.ui ) diff --git a/plugin-dom/domplugin.cpp b/plugin-dom/domplugin.cpp index 712dd97..e7b5551 100644 --- a/plugin-dom/domplugin.cpp +++ b/plugin-dom/domplugin.cpp @@ -25,12 +25,11 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "domplugin.h" #include "treewindow.h" - -#include #include +#include + DomPlugin::DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), @@ -41,6 +40,7 @@ DomPlugin::DomPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): connect(&mButton, SIGNAL(clicked()), this, SLOT(showDialog())); } + void DomPlugin::showDialog() { TreeWindow *dialog = mButton.findChild(); @@ -54,5 +54,3 @@ void DomPlugin::showDialog() dialog->show(); dialog->activateWindow(); } - - diff --git a/plugin-dom/domplugin.h b/plugin-dom/domplugin.h index 7a9db00..20c3e7b 100644 --- a/plugin-dom/domplugin.h +++ b/plugin-dom/domplugin.h @@ -32,6 +32,7 @@ #include "../panel/ilxqtpanelplugin.h" #include + class DomPlugin: public QObject, public ILxQtPanelPlugin { Q_OBJECT @@ -56,7 +57,7 @@ class DomPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new DomPlugin(startupInfo); } diff --git a/plugin-dom/domtreeitem.cpp b/plugin-dom/domtreeitem.cpp index 1b4d372..1782be3 100644 --- a/plugin-dom/domtreeitem.cpp +++ b/plugin-dom/domtreeitem.cpp @@ -25,17 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "domtreeitem.h" - -#include #include +#include #include #include -/************************************************ - ************************************************/ DomTreeItem::DomTreeItem(QTreeWidget *view, QWidget *widget): QTreeWidgetItem(view), mWidget(widget) @@ -46,9 +42,6 @@ DomTreeItem::DomTreeItem(QTreeWidget *view, QWidget *widget): } -/************************************************ - - ************************************************/ DomTreeItem::DomTreeItem(QTreeWidgetItem *parent, QWidget *widget): QTreeWidgetItem(parent), mWidget(widget) @@ -59,9 +52,6 @@ DomTreeItem::DomTreeItem(QTreeWidgetItem *parent, QWidget *widget): } -/************************************************ - - ************************************************/ void DomTreeItem::init() { QStringList hierarcy = widgetClassHierarcy(); @@ -92,9 +82,6 @@ void DomTreeItem::init() } -/************************************************ - - ************************************************/ void DomTreeItem::fill() { QList widgets = mWidget->findChildren(); @@ -109,9 +96,6 @@ void DomTreeItem::fill() } -/************************************************ - - ************************************************/ bool DomTreeItem::eventFilter(QObject *watched, QEvent *event) { if (watched == mWidget && @@ -136,18 +120,12 @@ bool DomTreeItem::eventFilter(QObject *watched, QEvent *event) } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetObjectName() const { return mWidget->objectName(); } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetText() const { QToolButton *toolButton = qobject_cast(mWidget); @@ -158,18 +136,12 @@ QString DomTreeItem::widgetText() const } -/************************************************ - - ************************************************/ QString DomTreeItem::widgetClassName() const { return mWidget->metaObject()->className(); } -/************************************************ - - ************************************************/ QStringList DomTreeItem::widgetClassHierarcy() const { QStringList hierarcy; @@ -183,11 +155,7 @@ QStringList DomTreeItem::widgetClassHierarcy() const } -/************************************************ - - ************************************************/ void DomTreeItem::widgetDestroyed() { deleteLater(); } - diff --git a/plugin-dom/domtreeitem.h b/plugin-dom/domtreeitem.h index 84cd389..3a2f8ec 100644 --- a/plugin-dom/domtreeitem.h +++ b/plugin-dom/domtreeitem.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef DOMTREEITEM_H #define DOMTREEITEM_H #include #include + class DomTreeItem: public QObject, public QTreeWidgetItem { Q_OBJECT diff --git a/plugin-dom/translations/dom.ts b/plugin-dom/translations/dom.ts index 5121128..6ffbe17 100644 --- a/plugin-dom/translations/dom.ts +++ b/plugin-dom/translations/dom.ts @@ -9,14 +9,30 @@ - + + Property - + Value + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_de.desktop b/plugin-dom/translations/dom_de.desktop new file mode 100644 index 0000000..52f901f --- /dev/null +++ b/plugin-dom/translations/dom_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Leiste DOM-Baum +Comment[de]=Zeigt einen DOM-Baum der LXQt-Leiste. diff --git a/plugin-dom/translations/dom_de.ts b/plugin-dom/translations/dom_de.ts new file mode 100644 index 0000000..c1b910d --- /dev/null +++ b/plugin-dom/translations/dom_de.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM-Baum der Leiste + + + + + Property + Eigenschaft + + + + Value + Wert + + + + All properties + Alle Eigenschaften + + + + Type + Typ + + + + String value + Zeichenkettenwert + + + diff --git a/plugin-dom/translations/dom_hu.desktop b/plugin-dom/translations/dom_hu.desktop new file mode 100644 index 0000000..83f6021 --- /dev/null +++ b/plugin-dom/translations/dom_hu.desktop @@ -0,0 +1,3 @@ +# Translations +Name[hu]=Panel DOM fa +Comment[hu]=DOM faszerkezet az LxQt panelen diff --git a/plugin-dom/translations/dom_hu.ts b/plugin-dom/translations/dom_hu.ts new file mode 100644 index 0000000..adfb252 --- /dev/null +++ b/plugin-dom/translations/dom_hu.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/plugin-dom/translations/dom_hu_HU.ts b/plugin-dom/translations/dom_hu_HU.ts new file mode 100644 index 0000000..47b5a63 --- /dev/null +++ b/plugin-dom/translations/dom_hu_HU.ts @@ -0,0 +1,38 @@ + + + + + TreeWindow + + + Panel DOM tree + DOM panel fa + + + + + Property + Tulajdonság + + + + Value + Érték + + + + All properties + Minden tulajdonság + + + + Type + Típus + + + + String value + Kifejezés + + + diff --git a/plugin-dom/translations/dom_ja.ts b/plugin-dom/translations/dom_ja.ts index 68617be..7bf60ed 100644 --- a/plugin-dom/translations/dom_ja.ts +++ b/plugin-dom/translations/dom_ja.ts @@ -9,14 +9,30 @@ パネルのDOMツリー - + + Property プロパティー - + Value + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_pt.ts b/plugin-dom/translations/dom_pt.ts index 957f3e0..17e1bbd 100644 --- a/plugin-dom/translations/dom_pt.ts +++ b/plugin-dom/translations/dom_pt.ts @@ -9,14 +9,30 @@ Árvore do painel DOM - + + Property Propriedade - + Value Valor + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_ru.desktop b/plugin-dom/translations/dom_ru.desktop index 7ef95e4..f97ba11 100644 --- a/plugin-dom/translations/dom_ru.desktop +++ b/plugin-dom/translations/dom_ru.desktop @@ -2,4 +2,4 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name[ru]=Дерево DOM панели. -Comment[ru]=Показать дерево DOM панели LXDE-Qt. +Comment[ru]=Показать дерево DOM панели LXQt. diff --git a/plugin-dom/translations/dom_ru.ts b/plugin-dom/translations/dom_ru.ts index d14b34f..219982a 100644 --- a/plugin-dom/translations/dom_ru.ts +++ b/plugin-dom/translations/dom_ru.ts @@ -9,14 +9,30 @@ Дерево DOM панели - + + Property Свойство - + Value Значение + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/translations/dom_ru_RU.desktop b/plugin-dom/translations/dom_ru_RU.desktop index d07ba5a..ddf0c19 100644 --- a/plugin-dom/translations/dom_ru_RU.desktop +++ b/plugin-dom/translations/dom_ru_RU.desktop @@ -2,4 +2,4 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name[ru_RU]=Дерево DOM панели. -Comment[ru_RU]=Показать дерево DOM панели LXDE-Qt. +Comment[ru_RU]=Показать дерево DOM панели LXQt. diff --git a/plugin-dom/translations/dom_ru_RU.ts b/plugin-dom/translations/dom_ru_RU.ts index d6e1a63..6d09d78 100644 --- a/plugin-dom/translations/dom_ru_RU.ts +++ b/plugin-dom/translations/dom_ru_RU.ts @@ -9,14 +9,30 @@ Дерево DOM панели - + + Property Свойство - + Value Значение + + + All properties + + + + + Type + + + + + String value + + diff --git a/plugin-dom/treewindow.cpp b/plugin-dom/treewindow.cpp index e930ec8..78426b9 100644 --- a/plugin-dom/treewindow.cpp +++ b/plugin-dom/treewindow.cpp @@ -29,9 +29,9 @@ #include "treewindow.h" #include "ui_treewindow.h" #include "domtreeitem.h" - #include #include +#include #define PROP_OBJECT_NAME 0 #define PROP_CLASS_NAME 1 @@ -39,9 +39,6 @@ #define PROP_CLASS_HIERARCY 3 -/************************************************ - - ************************************************/ TreeWindow::TreeWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::TreeWindow) @@ -72,21 +69,19 @@ TreeWindow::TreeWindow(QWidget *parent) : connect(ui->tree, SIGNAL(itemSelectionChanged()), this, SLOT(updatePropertiesView())); item->setSelected(true); + QHeaderView* h = new QHeaderView(Qt::Horizontal); + h->setStretchLastSection(true); + ui->allPropertiesView->setHorizontalHeader(h); + connect(h, &QHeaderView::sectionDoubleClicked, this, &TreeWindow::sectionDoubleClickedSlot); } -/************************************************ - - ************************************************/ TreeWindow::~TreeWindow() { delete ui; } -/************************************************ - - ************************************************/ void TreeWindow::initPropertiesView() { ui->propertiesView->viewport()->setAutoFillBackground(false); @@ -115,9 +110,6 @@ void TreeWindow::initPropertiesView() } -/************************************************ - - ************************************************/ void TreeWindow::updatePropertiesView() { if (ui->tree->selectedItems().isEmpty()) @@ -139,22 +131,42 @@ void TreeWindow::updatePropertiesView() ui->propertiesView->item(PROP_CLASS_NAME, 1)->setText(treeItem->widgetClassName()); ui->propertiesView->item(PROP_TEXT, 1)->setText(treeItem->widgetText()); ui->propertiesView->item(PROP_CLASS_HIERARCY, 1)->setText(treeItem->widgetClassHierarcy().join(" :: ")); -} + QString s; + QDebug out(&s); + QMetaObject const * const m = treeItem->widget()->metaObject(); + const int curr_cnt = ui->allPropertiesView->rowCount(); + ui->allPropertiesView->setRowCount(m->propertyCount()); + for (int i = 0, cnt = m->propertyCount(); cnt > i; ++i) + { + if (curr_cnt <= i) + { + ui->allPropertiesView->setItem(i, 0, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 1, new QTableWidgetItem); + ui->allPropertiesView->setItem(i, 2, new QTableWidgetItem); + } + QMetaProperty const & prop = m->property(i); + ui->allPropertiesView->item(i, 0)->setText(prop.name()); + ui->allPropertiesView->item(i, 1)->setText(prop.typeName()); + s.clear(); + out << prop.read(treeItem->widget()); + ui->allPropertiesView->item(i, 2)->setText(s); + } + for (int i = m->propertyCount(); curr_cnt > i; ++i) + ui->allPropertiesView->removeRow(i); +} -/************************************************ - ************************************************/ void TreeWindow::clearPropertiesView() { for (int i=0; ipropertiesView->rowCount(); ++i) ui->propertiesView->item(i, 1)->setText(""); + for (int i = ui->allPropertiesView->rowCount(); 0 <= i; --i) + ui->allPropertiesView->removeRow(i); + ui->allPropertiesView->setRowCount(0); } - - - - - - - +void TreeWindow::sectionDoubleClickedSlot(int column) +{ + ui->allPropertiesView->sortByColumn(column, Qt::AscendingOrder); +} diff --git a/plugin-dom/treewindow.h b/plugin-dom/treewindow.h index de0e7ab..e4c9f91 100644 --- a/plugin-dom/treewindow.h +++ b/plugin-dom/treewindow.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef TREEWINDOW_H #define TREEWINDOW_H #include #include + class QTreeWidgetItem; class QTreeWidget; class QEvent; @@ -41,11 +41,10 @@ class TreeWindow; } - class TreeWindow : public QMainWindow { Q_OBJECT - + public: explicit TreeWindow(QWidget *parent = 0); ~TreeWindow(); @@ -53,6 +52,7 @@ public: private slots: void updatePropertiesView(); void clearPropertiesView(); + void sectionDoubleClickedSlot(int column); private: Ui::TreeWindow *ui; diff --git a/plugin-dom/treewindow.ui b/plugin-dom/treewindow.ui index d27a7b3..042dda1 100644 --- a/plugin-dom/treewindow.ui +++ b/plugin-dom/treewindow.ui @@ -6,7 +6,7 @@ 0 0 - 601 + 800 424 @@ -33,26 +33,83 @@ - - - QFrame::NoFrame - - - Qt::DotLine + + + + 1 + 0 + - - true - - - - Property - - - - - Value - - + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + 1 + 0 + + + + true + + + + Property + + + + + Value + + + + + + + + All properties + + + + 0 + 0 + + + + + + + + QFrame::NoFrame + + + Qt::DotLine + + + + Property + + + + + Type + + + + + String value + + + + + + diff --git a/plugin-kbindicator/CMakeLists.txt b/plugin-kbindicator/CMakeLists.txt index 9b8f33a..e235b51 100644 --- a/plugin-kbindicator/CMakeLists.txt +++ b/plugin-kbindicator/CMakeLists.txt @@ -1,29 +1,64 @@ set(PLUGIN "kbindicator") -find_package(KF5GuiAddons REQUIRED) - set(HEADERS - lxqtkbindicator.h - lxqtkbindicatorconfiguration.h + src/kbdstate.h + src/settings.h + src/content.h + src/kbdlayout.h + src/kbdinfo.h + src/kbdkeeper.h + src/kbdwatcher.h + src/controls.h + src/kbdstateconfig.h ) set(SOURCES - lxqtkbindicator.cpp - lxqtkbindicatorconfiguration.cpp -) - -set(MOCS - lxqtkbindicator.h - lxqtkbindicatorconfiguration.h + kbindicator-plugin.cpp + src/kbdstate.cpp + src/settings.cpp + src/content.cpp + src/kbdkeeper.cpp + src/kbdwatcher.cpp + src/kbdstateconfig.cpp ) set(UIS - lxqtkbindicatorconfiguration.ui + src/kbdstateconfig.ui ) set(LIBRARIES - ${LIBRARIES} - KF5::GuiAddons ) +find_package(PkgConfig REQUIRED) +pkg_check_modules(XKB_COMMON REQUIRED xkbcommon) +pkg_check_modules(XKB_COMMON_X11 QUIET xkbcommon-x11) + +if(XKB_COMMON_X11_FOUND) + message(STATUS "XkbCommon X11 was found") + find_package(Qt5 COMPONENTS X11Extras Xml) + pkg_check_modules(XCB_XCB xcb-xkb) + + set(HEADERS + ${HEADERS} + src/x11/kbdlayout.h + ) + + set(SOURCES + ${SOURCES} + src/x11/kbdlayout.cpp + ) + + set(LIBRARIES + ${LIBRARIES} + ${XKB_COMMON_X11_LIBRARIES} + ${XCB_XCB_LIBRARIES} + Qt5::Xml + ) + + add_definitions(-DX11_ENABLED) +else() + message(FATAL_ERROR "No XkbCommon backend(X11) found!") +endif() + BUILD_LXQT_PLUGIN(${PLUGIN}) + diff --git a/plugin-kbindicator/kbindicator-plugin.cpp b/plugin-kbindicator/kbindicator-plugin.cpp new file mode 100644 index 0000000..c81ba00 --- /dev/null +++ b/plugin-kbindicator/kbindicator-plugin.cpp @@ -0,0 +1,18 @@ +#include +#include "src/kbdstate.h" +#include "../panel/ilxqtpanelplugin.h" + +class LxQtKbIndicatorPlugin: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + virtual ~LxQtKbIndicatorPlugin() + {} + + virtual ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { return new KbdState(startupInfo); } +}; + +#include "kbindicator-plugin.moc" diff --git a/plugin-kbindicator/lxqtkbindicator.cpp b/plugin-kbindicator/lxqtkbindicator.cpp deleted file mode 100644 index e6c6411..0000000 --- a/plugin-kbindicator/lxqtkbindicator.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Kuzma Shapran - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#include "lxqtkbindicator.h" -#include -#include -#include -#include - -LxQtKbIndicator::LxQtKbIndicator(const ILxQtPanelPluginStartupInfo &startupInfo): - QObject(), - ILxQtPanelPlugin(startupInfo), - mContent(new QWidget()) -{ - modifierInfo = new KModifierKeyInfo(this); - connect(modifierInfo, SIGNAL(keyLocked(Qt::Key, bool)), this, SLOT(modifierStateChanged(Qt::Key, bool))); - - QHBoxLayout *layout = new QHBoxLayout(mContent); - mContent->setLayout(layout); - - mCapsLock = new QLabel("C"); - mCapsLock->setObjectName("CapsLockLabel"); - mCapsLock->setAlignment(Qt::AlignCenter); - mCapsLock->installEventFilter(this); - mContent->layout()->addWidget(mCapsLock); - - mNumLock = new QLabel("N"); - mNumLock->setObjectName("NumLockLabel"); - mNumLock->setAlignment(Qt::AlignCenter); - mNumLock->installEventFilter(this); - mContent->layout()->addWidget(mNumLock); - - mScrollLock = new QLabel("S"); - mScrollLock->setObjectName("ScrollLockLabel"); - mScrollLock->setAlignment(Qt::AlignCenter); - mScrollLock->installEventFilter(this); - mContent->layout()->addWidget(mScrollLock); - - QTimer::singleShot(0, this, SLOT(delayedInit())); -} - -LxQtKbIndicator::~LxQtKbIndicator() -{ - delete mContent; -} - -void LxQtKbIndicator::delayedInit() -{ - settingsChanged(); - realign(); -} - -QWidget *LxQtKbIndicator::widget() -{ - return mContent; -} - -void LxQtKbIndicator::settingsChanged() -{ - mShowCapsLock = settings()->value("show_caps_lock", true).toBool(); - mShowNumLock = settings()->value("show_num_lock", true).toBool(); - mShowScrollLock = settings()->value("show_scroll_lock", true).toBool(); - - mCapsLock->setVisible(mShowCapsLock); - mNumLock->setVisible(mShowNumLock); - mScrollLock->setVisible(mShowScrollLock); - - mCapsLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_CapsLock)); - mNumLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_NumLock)); - mScrollLock->setEnabled(modifierInfo->isKeyLocked(Qt::Key_ScrollLock)); -} - -QDialog *LxQtKbIndicator::configureDialog() -{ - return new LxQtKbIndicatorConfiguration(settings()); -} - -void LxQtKbIndicator::realign() -{ - if (panel()->isHorizontal()) - mContent->setMinimumSize(0, panel()->iconSize()); - else - mContent->setMinimumSize(panel()->iconSize(), 0); -} - -void LxQtKbIndicator::modifierStateChanged(Qt::Key key, bool active) -{ - switch (key) - { - case Qt::Key_CapsLock: - mCapsLock->setEnabled(active); - break; - - case Qt::Key_NumLock: - mNumLock->setEnabled(active); - break; - - case Qt::Key_ScrollLock: - mScrollLock->setEnabled(active); - break; - - default: - break; - } -} - -bool LxQtKbIndicator::eventFilter(QObject *object, QEvent *event) -{ - if (event->type() == QEvent::QEvent::MouseButtonRelease) - { - if (object == mCapsLock) - modifierInfo->setKeyLocked(Qt::Key_CapsLock, !modifierInfo->isKeyLocked(Qt::Key_CapsLock)); - else if (object == mNumLock) - modifierInfo->setKeyLocked(Qt::Key_NumLock, !modifierInfo->isKeyLocked(Qt::Key_NumLock)); - else if (object == mScrollLock) - modifierInfo->setKeyLocked(Qt::Key_ScrollLock, !modifierInfo->isKeyLocked(Qt::Key_ScrollLock)); - - return true; - } - - return QObject::eventFilter(object, event); -} diff --git a/plugin-kbindicator/lxqtkbindicator.h b/plugin-kbindicator/lxqtkbindicator.h deleted file mode 100644 index 592e9bf..0000000 --- a/plugin-kbindicator/lxqtkbindicator.h +++ /dev/null @@ -1,83 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Kuzma Shapran - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef LXQTPANELKBINDICATOR_H -#define LXQTPANELKBINDICATOR_H - -#include "../panel/ilxqtpanelplugin.h" -#include "lxqtkbindicatorconfiguration.h" -#include - -class QLabel; - -class LxQtKbIndicator : public QObject, public ILxQtPanelPlugin -{ - Q_OBJECT -public: - LxQtKbIndicator(const ILxQtPanelPluginStartupInfo &startupInfo); - ~LxQtKbIndicator(); - - virtual QWidget *widget(); - virtual QString themeId() const { return "KbIndicator"; } - virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } - virtual bool isSeparate() const { return false; } - - QDialog *configureDialog(); - virtual void realign(); - virtual bool eventFilter(QObject *object, QEvent *event); - -protected slots: - void delayedInit(); - virtual void settingsChanged(); - void modifierStateChanged(Qt::Key key, bool active); - -private: - KModifierKeyInfo *modifierInfo; - QWidget *mContent; - - bool mShowCapsLock; - bool mShowNumLock; - bool mShowScrollLock; - - QLabel *mCapsLock; - QLabel *mNumLock; - QLabel *mScrollLock; -}; - -class LxQtKbIndicatorLibrary: public QObject, public ILxQtPanelPluginLibrary -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") - Q_INTERFACES(ILxQtPanelPluginLibrary) -public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) - { - return new LxQtKbIndicator(startupInfo); - } -}; - -#endif // LXQTPANELKBINDICATOR_H diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp b/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp deleted file mode 100644 index 7939b6a..0000000 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.org - * - * Copyright: 2012 Razor team - * Authors: - * Kuzma Shapran - * - * This program or library is free software; you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * END_COMMON_COPYRIGHT_HEADER */ - - -#include "lxqtkbindicatorconfiguration.h" -#include "ui_lxqtkbindicatorconfiguration.h" - - -LxQtKbIndicatorConfiguration::LxQtKbIndicatorConfiguration(QSettings *settings, QWidget *parent) : - QDialog(parent), - ui(new Ui::LxQtKbIndicatorConfiguration), - mSettings(settings), - oldSettings(settings) -{ - setAttribute(Qt::WA_DeleteOnClose); - setObjectName("KbIndicatorConfigurationWindow"); - ui->setupUi(this); - - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); - - connect(ui->capsLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->numLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->scrollLockCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - - loadSettings(); -} - -LxQtKbIndicatorConfiguration::~LxQtKbIndicatorConfiguration() -{ - delete ui; -} - -void LxQtKbIndicatorConfiguration::loadSettings() -{ - ui->capsLockCB->setChecked(mSettings->value("show_caps_lock", true).toBool()); - ui->numLockCB->setChecked(mSettings->value("show_num_lock", true).toBool()); - ui->scrollLockCB->setChecked(mSettings->value("show_scroll_lock", true).toBool()); -} - -void LxQtKbIndicatorConfiguration::saveSettings() -{ - mSettings->setValue("show_caps_lock", ui->capsLockCB->isChecked()); - mSettings->setValue("show_num_lock", ui->numLockCB->isChecked()); - mSettings->setValue("show_scroll_lock", ui->scrollLockCB->isChecked()); -} - -void LxQtKbIndicatorConfiguration::dialogButtonsAction(QAbstractButton *btn) -{ - if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) - { - oldSettings.loadToSettings(); - loadSettings(); - } - else - close(); -} diff --git a/plugin-kbindicator/lxqtkbindicatorconfiguration.ui b/plugin-kbindicator/lxqtkbindicatorconfiguration.ui deleted file mode 100644 index b68ba35..0000000 --- a/plugin-kbindicator/lxqtkbindicatorconfiguration.ui +++ /dev/null @@ -1,108 +0,0 @@ - - - LxQtKbIndicatorConfiguration - - - - 0 - 0 - 178 - 126 - - - - Keyboard Indicator Settings - - - - - - Caps Lock - - - - - - - Num Lock - - - - - - - Scroll Lock - - - - - - - Qt::Vertical - - - - 1 - 1 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::Reset - - - - - - - buttons - - - - - buttons - accepted() - LxQtKbIndicatorConfiguration - accept() - - - 86 - 244 - - - 97 - 253 - - - - - buttons - rejected() - LxQtKbIndicatorConfiguration - reject() - - - 67 - 244 - - - 62 - 253 - - - - - - maximumNetSpeedChanged(QString) - on_typeCOB_currentIndexChanged(int) - on_sourceCOB_currentIndexChanged(int) - on_maximumHS_valueChanged(int) - saveSettings() - - diff --git a/plugin-kbindicator/resources/kbindicator.desktop.in b/plugin-kbindicator/resources/kbindicator.desktop.in index fc9623a..1fa16db 100644 --- a/plugin-kbindicator/resources/kbindicator.desktop.in +++ b/plugin-kbindicator/resources/kbindicator.desktop.in @@ -1,8 +1,8 @@ [Desktop Entry] Type=Service ServiceTypes=LxQtPanel/Plugin -Name=Keyboard indicator -Comment=Keyboard indicator plugin. +Name=Keyboard state indicator +Comment=Keyboard state indicator and switcher plugin. Icon=input-keyboard #TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/src/content.cpp b/plugin-kbindicator/src/content.cpp new file mode 100644 index 0000000..3313a86 --- /dev/null +++ b/plugin-kbindicator/src/content.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include "kbdstate.h" +#include "content.h" + +Content::Content(bool layoutEnabled): + QWidget(), + m_layoutEnabled(layoutEnabled) +{ + QBoxLayout *box = new QBoxLayout(QBoxLayout::LeftToRight); + box->setContentsMargins(0, 0, 0, 0); + box->setSpacing(0); + setLayout(box); + + m_capsLock = new QLabel("C"); + m_capsLock->setObjectName("CapsLockLabel"); + m_capsLock->setAlignment(Qt::AlignCenter); + m_capsLock->installEventFilter(this); + layout()->addWidget(m_capsLock); + + m_numLock = new QLabel("N"); + m_numLock->setObjectName("NumLockLabel"); + m_numLock->setAlignment(Qt::AlignCenter); + m_numLock->installEventFilter(this); + layout()->addWidget(m_numLock); + + m_scrollLock = new QLabel("S"); + m_scrollLock->setObjectName("ScrollLockLabel"); + m_scrollLock->setAlignment(Qt::AlignCenter); + m_scrollLock->installEventFilter(this); + layout()->addWidget(m_scrollLock); + + m_layout = new QLabel; + m_layout->setObjectName("LayoutLabel"); + m_layout->setAlignment(Qt::AlignCenter); + m_layout->installEventFilter(this); + layout()->addWidget(m_layout); +} + +Content::~Content() +{} + +bool Content::setup() +{ + m_capsLock->setVisible(Settings::instance().showCapLock()); + m_numLock->setVisible(Settings::instance().showNumLock()); + m_scrollLock->setVisible(Settings::instance().showScrollLock()); + m_layout->setVisible(m_layoutEnabled && Settings::instance().showLayout()); + return true; +} + +void Content::layoutChanged(const QString & sym, const QString & name, const QString & variant) +{ + m_layout->setText(sym.toUpper()); + QString txt = QString("\ + \ + \ +
%1: %3
%2: %4
").arg(tr("Layout")).arg(tr("Variant")).arg(name).arg(variant); + m_layout->setToolTip(txt); +} + +void Content::modifierStateChanged(Controls mod, bool active) +{ + setEnabled(mod, active); +} + + +void Content::setEnabled(Controls cnt, bool enabled) +{ + widget(cnt)->setEnabled(enabled); +} + +QWidget* Content::widget(Controls cnt) const +{ + switch(cnt){ + case Caps: return m_capsLock; + case Num: return m_numLock; + case Scroll: return m_scrollLock; + case Layout: return m_layout; + } + return 0; +} + +bool Content::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::QEvent::MouseButtonRelease) + { + if (object == m_capsLock) + emit controlClicked(Controls::Caps); + else if (object == m_numLock) + emit controlClicked(Controls::Num); + else if (object == m_scrollLock) + emit controlClicked(Controls::Scroll); + else if(object == m_layout){ + emit controlClicked(Controls::Layout); + } + return true; + } + + return QObject::eventFilter(object, event); +} + +void Content::showHorizontal() +{ + qobject_cast(layout())->setDirection(QBoxLayout::LeftToRight); +} + +void Content::showVertical() +{ + qobject_cast(layout())->setDirection(QBoxLayout::TopToBottom); +} + diff --git a/plugin-kbindicator/src/content.h b/plugin-kbindicator/src/content.h new file mode 100644 index 0000000..5395d53 --- /dev/null +++ b/plugin-kbindicator/src/content.h @@ -0,0 +1,38 @@ +#ifndef _CONTENT_H_ +#define _CONTENT_H_ + +#include +#include "controls.h" + +class QLabel; + +class Content : public QWidget +{ + Q_OBJECT +public: + Content(bool layoutEnabled); + ~Content(); + +public: + void setEnabled(Controls cnt, bool enabled); + QWidget* widget(Controls cnt) const; + bool setup(); + + virtual bool eventFilter(QObject *object, QEvent *event); + + void showHorizontal(); + void showVertical(); +public slots: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); +signals: + void controlClicked(Controls cnt); +private: + bool m_layoutEnabled; + QLabel *m_capsLock; + QLabel *m_numLock; + QLabel *m_scrollLock; + QLabel *m_layout; +}; + +#endif diff --git a/plugin-kbindicator/src/controls.h b/plugin-kbindicator/src/controls.h new file mode 100644 index 0000000..b751619 --- /dev/null +++ b/plugin-kbindicator/src/controls.h @@ -0,0 +1,11 @@ +#ifndef _CONTROLS_H_ +#define _CONTROLS_H_ + +enum Controls { + Caps, + Num, + Scroll, + Layout +}; + +#endif diff --git a/plugin-kbindicator/src/kbdinfo.h b/plugin-kbindicator/src/kbdinfo.h new file mode 100644 index 0000000..24d4e71 --- /dev/null +++ b/plugin-kbindicator/src/kbdinfo.h @@ -0,0 +1,52 @@ +#ifndef _KBDINFO_H_ +#define _KBDINFO_H_ + +#include +#include + +class KbdInfo +{ +public: + KbdInfo() + {} + + struct Info + { + QString sym; + QString name; + QString variant; + }; + +public: + const QString & currentSym() const + { return m_keyboardInfo[m_current].sym; } + + const QString & currentName() const + { return m_keyboardInfo[m_current].name; } + + const QString & currentVariant() const + { return m_keyboardInfo[m_current].variant; } + + int currentGroup() const + { return m_current; } + + void setCurrentGroup(int group) + { m_current = group; } + + uint size() const + { return m_keyboardInfo.size(); } + + const Info & current() const + { return m_keyboardInfo[m_current]; } + + void clear() + { m_keyboardInfo.clear(); } + + void append(const Info & info) + { m_keyboardInfo.append(info); } +private: + QList m_keyboardInfo; + int m_current = 0; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdkeeper.cpp b/plugin-kbindicator/src/kbdkeeper.cpp new file mode 100644 index 0000000..251b552 --- /dev/null +++ b/plugin-kbindicator/src/kbdkeeper.cpp @@ -0,0 +1,160 @@ +#include +#include +#include +#include +#include "kbdkeeper.h" + +//-------------------------------------------------------------------------------------------------- + +KbdKeeper::KbdKeeper(const KbdLayout & layout, KeeperType type): + m_layout(layout), + m_type(type) +{ + m_layout.readKbdInfo(m_info); +} + +KbdKeeper::~KbdKeeper() +{} + +bool KbdKeeper::setup() +{ + connect(&m_layout, SIGNAL(keyboardChanged()), SLOT(keyboardChanged())); + connect(&m_layout, SIGNAL(layoutChanged(uint)), SLOT(layoutChanged(uint))); + connect(&m_layout, SIGNAL(checkState()), SLOT(checkState())); + + return true; +} + +void KbdKeeper::keyboardChanged() +{ + m_layout.readKbdInfo(m_info); + emit changed(); +} + +void KbdKeeper::layoutChanged(uint group) +{ + m_info.setCurrentGroup(group); + emit changed(); +} + +void KbdKeeper::checkState() +{} + +void KbdKeeper::switchToNext() +{ + uint index = m_info.currentGroup(); + if (index < m_info.size() - 1) + ++index; + else + index = 0; + + switchToGroup(index); +} + +void KbdKeeper::switchToGroup(uint group) +{ + m_layout.lockGroup(group); + emit changed(); +} + +//-------------------------------------------------------------------------------------------------- + +WinKbdKeeper::WinKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +WinKbdKeeper::~WinKbdKeeper() +{} + +void WinKbdKeeper::layoutChanged(uint group) +{ + WId win = KWindowSystem::activeWindow(); + + if (m_active == win){ + m_mapping[win] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + } + emit changed(); +} + +void WinKbdKeeper::checkState() +{ + WId win = KWindowSystem::activeWindow(); + + if (!m_mapping.contains(win)) + m_mapping.insert(win, 0); + m_layout.lockGroup(m_mapping[win]); + m_active = win; + m_info.setCurrentGroup(m_mapping[win]); + emit changed(); +} + +void WinKbdKeeper::switchToGroup(uint group) +{ + WId win = KWindowSystem::activeWindow(); + m_mapping[win] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} + + +//-------------------------------------------------------------------------------------------------- + +AppKbdKeeper::AppKbdKeeper(const KbdLayout & layout): + KbdKeeper(layout, KeeperType::Window) +{} + +AppKbdKeeper::~AppKbdKeeper() +{} + +void AppKbdKeeper::layoutChanged(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (m_active == app){ + m_mapping[app] = group; + m_info.setCurrentGroup(group); + } else { + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + } + emit changed(); +} + +void AppKbdKeeper::checkState() +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + if (!m_mapping.contains(app)) + m_mapping.insert(app, 0); + + m_layout.lockGroup(m_mapping[app]); + m_active = app; + m_info.setCurrentGroup(m_mapping[app]); + emit changed(); +} + + +void AppKbdKeeper::switchToGroup(uint group) +{ + KWindowInfo info = KWindowInfo(KWindowSystem::activeWindow(), 0, NET::WM2WindowClass); + QString app = info.windowClassName(); + + m_mapping[app] = group; + m_layout.lockGroup(group); + m_info.setCurrentGroup(group); + emit changed(); +} diff --git a/plugin-kbindicator/src/kbdkeeper.h b/plugin-kbindicator/src/kbdkeeper.h new file mode 100644 index 0000000..3b41630 --- /dev/null +++ b/plugin-kbindicator/src/kbdkeeper.h @@ -0,0 +1,80 @@ +#ifndef _KBDKEEPER_H_ +#define _KBDKEEPER_H_ + +#include +#include +#include "kbdlayout.h" +#include "kbdinfo.h" +#include "settings.h" + +//-------------------------------------------------------------------------------------------------- + +class KbdKeeper: public QObject +{ + Q_OBJECT +public: + KbdKeeper(const KbdLayout & layout, KeeperType type = KeeperType::Global); + virtual ~KbdKeeper(); + virtual bool setup(); + + const QString & sym() const + { return m_info.currentSym(); } + + const QString & name() const + { return m_info.currentName(); } + + const QString & variant() const + { return m_info.currentVariant(); } + + KeeperType type() const + { return m_type; } + + void switchToNext(); + virtual void switchToGroup(uint group); +protected slots: + virtual void keyboardChanged(); + virtual void layoutChanged(uint group); + virtual void checkState(); +signals: + void changed(); +protected: + const KbdLayout & m_layout; + KbdInfo m_info; + KeeperType m_type; +}; + +//-------------------------------------------------------------------------------------------------- + +class WinKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + WinKbdKeeper(const KbdLayout & layout); + virtual ~WinKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + WId m_active; +}; + +//-------------------------------------------------------------------------------------------------- + +class AppKbdKeeper: public KbdKeeper +{ + Q_OBJECT +public: + AppKbdKeeper(const KbdLayout & layout); + virtual ~AppKbdKeeper(); + virtual void switchToGroup(uint group); +protected slots: + virtual void layoutChanged(uint group); + virtual void checkState(); +private: + QHash m_mapping; + QString m_active; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdlayout.h b/plugin-kbindicator/src/kbdlayout.h new file mode 100644 index 0000000..cf95f61 --- /dev/null +++ b/plugin-kbindicator/src/kbdlayout.h @@ -0,0 +1,9 @@ +#ifndef _KBDLAYOUT_H_ +#define _KBDLAYOUT_H_ + +#ifdef X11_ENABLED +#include "x11/kbdlayout.h" +typedef X11Kbd KbdLayout; +#endif + +#endif diff --git a/plugin-kbindicator/src/kbdstate.cpp b/plugin-kbindicator/src/kbdstate.cpp new file mode 100644 index 0000000..157958b --- /dev/null +++ b/plugin-kbindicator/src/kbdstate.cpp @@ -0,0 +1,46 @@ +#include +#include + +#include "kbdstate.h" +#include "kbdkeeper.h" +#include "kbdstateconfig.h" +#include + +KbdState::KbdState(const ILxQtPanelPluginStartupInfo &startupInfo): + QObject(), + ILxQtPanelPlugin(startupInfo), + m_content(m_watcher.isLayoutEnabled()) +{ + Settings::instance().init(settings()); + + connect(&m_content, &Content::controlClicked, &m_watcher, &KbdWatcher::controlClicked); + connect(&m_watcher, &KbdWatcher::layoutChanged, &m_content, &Content::layoutChanged); + connect(&m_watcher, &KbdWatcher::modifierStateChanged, &m_content, &Content::modifierStateChanged); + + settingsChanged(); +} + +KbdState::~KbdState() +{} + +void KbdState::settingsChanged() +{ + m_content.setup(); + m_watcher.setup(); +} + +QDialog *KbdState::configureDialog() +{ + return new KbdStateConfig(&m_content); +} + +void KbdState::realign() +{ + if (panel()->isHorizontal()){ + m_content.setMinimumSize(0, panel()->iconSize()); + m_content.showHorizontal(); + } else { + m_content.setMinimumSize(panel()->iconSize(), 0); + m_content.showVertical(); + } +} diff --git a/plugin-kbindicator/src/kbdstate.h b/plugin-kbindicator/src/kbdstate.h new file mode 100644 index 0000000..f958eed --- /dev/null +++ b/plugin-kbindicator/src/kbdstate.h @@ -0,0 +1,49 @@ +#ifndef _KDBSTATE_H_ +#define _KDBSTATE_H_ + +#include "../panel/ilxqtpanelplugin.h" +#include "settings.h" +#include "content.h" +#include "kbdwatcher.h" + +class QLabel; + +class KbdState : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + KbdState(const ILxQtPanelPluginStartupInfo &startupInfo); + virtual ~KbdState(); + + virtual QString themeId() const + { return "KbIndicator"; } + + virtual ILxQtPanelPlugin::Flags flags() const + { return PreferRightAlignment | HaveConfigDialog; } + + virtual bool isSeparate() const + { return false; } + + virtual QWidget *widget() + { return &m_content; } + + QDialog *configureDialog(); + virtual void realign(); + + const Settings & prefs() const + { return m_settings; } + + Settings & prefs() + { return m_settings; } + +protected slots: + virtual void settingsChanged(); + +private: + Settings m_settings; + KbdWatcher m_watcher; + Content m_content; +}; + + +#endif diff --git a/plugin-kbindicator/src/kbdstateconfig.cpp b/plugin-kbindicator/src/kbdstateconfig.cpp new file mode 100644 index 0000000..5a08447 --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.cpp @@ -0,0 +1,84 @@ +#include +#include +#include "kbdstateconfig.h" +#include "ui_kbdstateconfig.h" +#include "settings.h" + +KbdStateConfig::KbdStateConfig(QWidget *parent) : + QDialog(parent), + m_ui(new Ui::KbdStateConfig) +{ + setAttribute(Qt::WA_DeleteOnClose); + m_ui->setupUi(this); + + connect(m_ui->showCaps, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showNum, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showScroll, &QCheckBox::clicked, this, &KbdStateConfig::save); + connect(m_ui->showLayout, &QCheckBox::clicked, this, &KbdStateConfig::save); + + connect(m_ui->modes, static_cast(&QButtonGroup::buttonClicked), + [this](int){ + KbdStateConfig::save(); + } + ); + + connect(m_ui->showLayout, &QCheckBox::stateChanged, [this](int checked){ + //m_ui->showFlags->setEnabled(checked); //TODO: Country flags support + m_ui->switchGlobal->setEnabled(checked); + m_ui->switchWindow->setEnabled(checked); + m_ui->switchApplication->setEnabled(checked); + }); + + connect(m_ui->configureLayouts, &QPushButton::clicked, this, &KbdStateConfig::configureLayouts); + + load(); +} + +KbdStateConfig::~KbdStateConfig() +{ + delete m_ui; +} + +void KbdStateConfig::load() +{ + Settings & sets = Settings::instance(); + + m_ui->showCaps->setChecked(sets.showCapLock()); + m_ui->showNum->setChecked(sets.showNumLock()); + m_ui->showScroll->setChecked(sets.showScrollLock()); + m_ui->showLayout->setChecked(sets.showLayout()); + + switch(sets.keeperType()){ + case KeeperType::Global: + m_ui->switchGlobal->setChecked(true); + break; + case KeeperType::Window: + m_ui->switchWindow->setChecked(true); + break; + case KeeperType::Application: + m_ui->switchApplication->setChecked(true); + break; + } +} + +void KbdStateConfig::save() +{ + Settings & sets = Settings::instance(); + + sets.setShowCapLock(m_ui->showCaps->isChecked()); + sets.setShowNumLock(m_ui->showNum->isChecked()); + sets.setShowScrollLock(m_ui->showScroll->isChecked()); + sets.setShowLayout(m_ui->showLayout->isChecked()); + + if (m_ui->switchGlobal->isChecked()) + sets.setKeeperType(KeeperType::Global); + if (m_ui->switchWindow->isChecked()) + sets.setKeeperType(KeeperType::Window); + if (m_ui->switchApplication->isChecked()) + sets.setKeeperType(KeeperType::Application); +} + +void KbdStateConfig::configureLayouts() +{ + QProcess::startDetached(QStringLiteral("lxqt-config-input")); +} diff --git a/plugin-kbindicator/src/kbdstateconfig.h b/plugin-kbindicator/src/kbdstateconfig.h new file mode 100644 index 0000000..b01972d --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.h @@ -0,0 +1,26 @@ +#ifndef _KBDSTATECONFIG_H_ +#define _KBDSTATECONFIG_H_ + +#include + +namespace Ui { +class KbdStateConfig; +} + +class KbdStateConfig : public QDialog +{ + Q_OBJECT + +public: + explicit KbdStateConfig(QWidget *parent = 0); + ~KbdStateConfig(); +private: + void save(); + void load(); + + void configureLayouts(); +private: + Ui::KbdStateConfig *m_ui; +}; + +#endif diff --git a/plugin-kbindicator/src/kbdstateconfig.ui b/plugin-kbindicator/src/kbdstateconfig.ui new file mode 100644 index 0000000..932933c --- /dev/null +++ b/plugin-kbindicator/src/kbdstateconfig.ui @@ -0,0 +1,222 @@ + + + KbdStateConfig + + + + 0 + 0 + 249 + 390 + + + + Dialog + + + + + + Leds + + + + + + Show Caps Lock + + + + + + + Show Num Lock + + + + + + + Show Scroll Lock + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + Show keyboard layout + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Show flags instead labels + + + + + + + Layout mode: + + + + + + + false + + + Global + + + modes + + + + + + + false + + + Window + + + modes + + + + + + + false + + + Application + + + modes + + + + + + + Configure layouts + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + btns + accepted() + KbdStateConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + btns + rejected() + KbdStateConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + + + + diff --git a/plugin-kbindicator/src/kbdwatcher.cpp b/plugin-kbindicator/src/kbdwatcher.cpp new file mode 100644 index 0000000..539f31d --- /dev/null +++ b/plugin-kbindicator/src/kbdwatcher.cpp @@ -0,0 +1,58 @@ +#include +#include "kbdwatcher.h" + +KbdWatcher::KbdWatcher() +{ + connect(&m_layout, SIGNAL(modifierChanged(Controls,bool)), SIGNAL(modifierStateChanged(Controls,bool))); + m_layout.init(); +} + +void KbdWatcher::setup() +{ + emit modifierStateChanged(Controls::Caps, m_layout.isModifierLocked(Controls::Caps)); + emit modifierStateChanged(Controls::Num, m_layout.isModifierLocked(Controls::Num)); + emit modifierStateChanged(Controls::Scroll, m_layout.isModifierLocked(Controls::Scroll)); + + if (!m_keeper || m_keeper->type() != Settings::instance().keeperType()){ + createKeeper(Settings::instance().keeperType()); + } +} + +void KbdWatcher::createKeeper(KeeperType type) +{ + switch(type) + { + case KeeperType::Global: + m_keeper.reset(new KbdKeeper(m_layout)); + break; + case KeeperType::Window: + m_keeper.reset(new WinKbdKeeper(m_layout)); + break; + case KeeperType::Application: + m_keeper.reset(new AppKbdKeeper(m_layout)); + break; + } + + connect(m_keeper.data(), SIGNAL(changed()), this, SLOT(keeperChanged())); + + m_keeper->setup(); + keeperChanged(); +} + +void KbdWatcher::keeperChanged() +{ + emit layoutChanged(m_keeper->sym(), m_keeper->name(), m_keeper->variant()); +} + +void KbdWatcher::controlClicked(Controls cnt) +{ + switch(cnt){ + case Controls::Layout: + m_keeper->switchToNext(); + break; + default: + m_layout.lockModifier(cnt, !m_layout.isModifierLocked(cnt)); + break; + } + +} diff --git a/plugin-kbindicator/src/kbdwatcher.h b/plugin-kbindicator/src/kbdwatcher.h new file mode 100644 index 0000000..17f580b --- /dev/null +++ b/plugin-kbindicator/src/kbdwatcher.h @@ -0,0 +1,38 @@ +#ifndef _KBDWATCHER_H_ +#define _KBDWATCHER_H_ + +#include "kbdlayout.h" +#include "controls.h" +#include "kbdkeeper.h" + +class KbdKeeper; + +class KbdWatcher: public QObject +{ + Q_OBJECT +public: + KbdWatcher(); + + void setup(); + const KbdLayout & kbdLayout() const + { return m_layout; } + + bool isLayoutEnabled() const + { return m_layout.isEnabled(); } +public slots: + void controlClicked(Controls cnt); +signals: + void layoutChanged(const QString & sym, const QString & name, const QString & variant); + void modifierStateChanged(Controls mod, bool active); + +private: + void createKeeper(KeeperType type); +private slots: + void keeperChanged(); + +private: + KbdLayout m_layout; + QScopedPointer m_keeper; +}; + +#endif diff --git a/plugin-kbindicator/src/settings.cpp b/plugin-kbindicator/src/settings.cpp new file mode 100644 index 0000000..49fab1c --- /dev/null +++ b/plugin-kbindicator/src/settings.cpp @@ -0,0 +1,65 @@ +#include +#include "settings.h" + +Settings::Settings() +{} + +Settings & Settings::instance() +{ + static Settings _instance; + return _instance; +} + +void Settings::init(QSettings *settings) +{ m_settings = settings; } + +bool Settings::showCapLock() const +{ return m_settings->value("show_caps_lock", true).toBool(); } + +bool Settings::showNumLock() const +{ return m_settings->value("show_num_lock", true).toBool(); } + +bool Settings::showScrollLock() const +{ return m_settings->value("show_scroll_lock", true).toBool(); } + +bool Settings::showLayout() const +{ return m_settings->value("show_layout", true).toBool(); } + +void Settings::setShowCapLock(bool show) +{ m_settings->setValue("show_caps_lock", show); } + +void Settings::setShowNumLock(bool show) +{ m_settings->setValue("show_num_lock", show); } + +void Settings::setShowScrollLock(bool show) +{ m_settings->setValue("show_scroll_lock", show); } + +void Settings::setShowLayout(bool show) +{ m_settings->setValue("show_layout", show); } + +KeeperType Settings::keeperType() const +{ + QString type = m_settings->value("keeper_type", "application").toString(); + if(type == "global") + return KeeperType::Global; + if(type == "window") + return KeeperType::Window; + if(type == "application") + return KeeperType::Application; + return KeeperType::Application; +} + +void Settings::setKeeperType(KeeperType type) const +{ + switch (type) { + case KeeperType::Global: + m_settings->setValue("keeper_type", "global"); + break; + case KeeperType::Window: + m_settings->setValue("keeper_type", "window"); + break; + case KeeperType::Application: + m_settings->setValue("keeper_type", "application"); + break; + } +} diff --git a/plugin-kbindicator/src/settings.h b/plugin-kbindicator/src/settings.h new file mode 100644 index 0000000..49e6a56 --- /dev/null +++ b/plugin-kbindicator/src/settings.h @@ -0,0 +1,37 @@ +#ifndef _SETTINGS_H_ +#define _SETTINGS_H_ + +class QSettings; + +enum class KeeperType +{ + Global, + Window, + Application +}; + +class Settings +{ +public: + Settings(); + static Settings & instance(); + + void init(QSettings *settings); + +public: + bool showCapLock() const; + bool showNumLock() const; + bool showScrollLock() const; + bool showLayout() const; + KeeperType keeperType() const; +public: + void setShowCapLock(bool show); + void setShowNumLock(bool show); + void setShowScrollLock(bool show); + void setShowLayout(bool show); + void setKeeperType(KeeperType type) const; +private: + QSettings *m_settings = 0; +}; + +#endif diff --git a/plugin-kbindicator/src/x11/kbdlayout.cpp b/plugin-kbindicator/src/x11/kbdlayout.cpp new file mode 100644 index 0000000..0ddccbb --- /dev/null +++ b/plugin-kbindicator/src/x11/kbdlayout.cpp @@ -0,0 +1,292 @@ +#include +#include +#include +#include +#include +#include "kbdlayout.h" + +#include +#include +#define explicit _explicit +#include +#include "../kbdinfo.h" +#include "../controls.h" + +namespace pimpl { + +struct LangInfo +{ + QString name; + QString syn; + QString variant; +}; + +class X11Kbd: public QAbstractNativeEventFilter +{ +public: + X11Kbd(::X11Kbd *pub): + m_pub(pub) + {} + + bool init() + { + m_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + m_connection = xcb_connect(0, 0); + + if (!m_connection || xcb_connection_has_error(m_connection)){ + qWarning() << "Couldn't connect to X server: error code" + << (m_connection ? xcb_connection_has_error(m_connection) : -1); + return false; + } + + xkb_x11_setup_xkb_extension(m_connection, + XKB_X11_MIN_MAJOR_XKB_VERSION, + XKB_X11_MIN_MINOR_XKB_VERSION, + XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS, + NULL, NULL, &m_eventType, NULL + ); + + m_deviceId = xkb_x11_get_core_keyboard_device_id(m_connection); + qApp->installNativeEventFilter(this); + + readState(); + return true; + } + + virtual ~X11Kbd() + { + xkb_state_unref(m_state); + xkb_keymap_unref(m_keymap); + xcb_disconnect(m_connection); + xkb_context_unref(m_context); + } + + bool isEnabled() const + { return true; } + + virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *) + { + if (eventType != "xcb_generic_event_t") + return false; + + xcb_generic_event_t *event = static_cast(message); + if ((event->response_type & ~0x80) == m_eventType){ + xcb_xkb_state_notify_event_t *sevent = reinterpret_cast(event); + switch(sevent->xkbType){ + case XCB_XKB_STATE_NOTIFY: + xkb_state_update_mask(m_state, + sevent->baseMods, + sevent->latchedMods, + sevent->lockedMods, + sevent->baseGroup, + sevent->latchedGroup, + sevent->lockedGroup + ); + + if(sevent->changed & XCB_XKB_STATE_PART_GROUP_STATE){ + emit m_pub->layoutChanged(sevent->group); + } + + if(sevent->changed & XCB_XKB_STATE_PART_MODIFIER_LOCK){ + for(Controls cnt: m_modifiers.keys()){ + bool oldState = m_modifiers[cnt]; + bool newState = xkb_state_led_name_is_active(m_state, modName(cnt)); + if(oldState != newState){ + m_modifiers[cnt] = newState; + emit m_pub->modifierChanged(cnt, newState); + } + } + } + break; + case XCB_XKB_NEW_KEYBOARD_NOTIFY: + readState(); + break; + } + } + + emit m_pub->checkState(); + return false; + } + + void readKbdInfo(KbdInfo & info) const + { + info.clear(); + xkb_layout_index_t count = xkb_keymap_num_layouts(m_keymap); + for(xkb_layout_index_t i = 0; i < count; ++i){ + QString name = xkb_keymap_layout_get_name(m_keymap, i); + const LangInfo & linfo = names(name); + info.append({linfo.syn, linfo.name, linfo.variant}); + if (xkb_state_layout_index_is_active(m_state, i, XKB_STATE_LAYOUT_EFFECTIVE)) + info.setCurrentGroup(i); + } + } + + void lockGroup(uint group) + { + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, 0, 0, 1, group, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + void lockModifier(Controls cnt, bool locked) + { + quint8 mask = fetchMask(cnt); + quint8 curMask = locked ? mask : 0; + xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state(m_connection, m_deviceId, mask, curMask, 0, 0, 0, 0, 0); + xcb_generic_error_t *error = xcb_request_check(m_connection, cookie); + if (error){ + qWarning() << "Lock group error: " << error->error_code; + } + } + + bool isModifierLocked(Controls cnt) const + { return m_modifiers[cnt]; } + +private: + quint8 fetchMask(Controls cnt) const + { + static QHash masks; + if (masks.contains(cnt)) + return masks[cnt]; + + xkb_mod_index_t index = xkb_keymap_led_get_index(m_keymap, modName(cnt)); + + xcb_generic_error_t *error = 0; + quint8 mask = 0; + + xcb_xkb_get_indicator_map_cookie_t cookie = xcb_xkb_get_indicator_map(m_connection, m_deviceId, 1 << index); + xcb_xkb_get_indicator_map_reply_t *reply = xcb_xkb_get_indicator_map_reply(m_connection, cookie, &error); + + + if (!reply || error){ + qWarning() << "Cannot fetch mask " << error->error_code; + return mask; + } + + xcb_xkb_indicator_map_t *map = xcb_xkb_get_indicator_map_maps(reply); + + mask = map->mods; + masks[cnt] = mask; + + free(reply); + return mask; + } + + const char * modName(Controls cnt) const + { + switch(cnt){ + case Controls::Caps: + return XKB_LED_NAME_CAPS; + case Controls::Num: + return XKB_LED_NAME_NUM; + case Controls::Scroll: + return XKB_LED_NAME_SCROLL; + default: + return 0; + } + } + + void readState() + { + if (m_keymap) + xkb_keymap_unref(m_keymap); + m_keymap = xkb_x11_keymap_new_from_device(m_context, m_connection, m_deviceId, (xkb_keymap_compile_flags)0); + + if (m_state) + xkb_state_unref(m_state); + m_state = xkb_x11_state_new_from_device(m_keymap, m_connection, m_deviceId); + + for(Controls cnt: m_modifiers.keys()){ + m_modifiers[cnt] = xkb_state_led_name_is_active(m_state, modName(cnt)); + } + emit m_pub->keyboardChanged(); + } + + const LangInfo & names(const QString & langName) const + { + static LangInfo def{"Unknown", "??", "None"}; + static QHash names; + if (names.empty()){ + if(QFile::exists("/usr/share/X11/xkb/rules/evdev.xml")){ + QDomDocument doc; + + QFile file("/usr/share/X11/xkb/rules/evdev.xml"); + if (file.open(QIODevice::ReadOnly)){ + if (doc.setContent(&file)) { + QDomElement docElem = doc.documentElement(); + + auto layout= docElem.firstChildElement("layoutList"); + for(int i = 0; i < layout.childNodes().count(); ++i){ + auto conf = layout.childNodes().at(i).firstChildElement("configItem"); + names.insert( + conf.firstChildElement("description").firstChild().toText().data(),{ + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + "None" + } + ); + auto variants = layout.childNodes().at(i).firstChildElement("variantList"); + for(int j = 0; j < variants.childNodes().count(); ++j){ + auto var = variants.childNodes().at(j).firstChildElement("configItem"); + names.insert( + var.firstChildElement("description").firstChild().toText().data(), { + conf.firstChildElement("description").firstChild().toText().data(), + conf.firstChildElement("name").firstChild().toText().data(), + var.firstChildElement("name").firstChild().toText().data() + } + ); + } + } + } + file.close(); + } + } + } + if (names.contains(langName)) + return names[langName]; + return def; + } + +private: + struct xkb_context *m_context = 0; + xcb_connection_t *m_connection = 0; + int32_t m_deviceId; + uint8_t m_eventType; + xkb_state *m_state = 0; + xkb_keymap *m_keymap = 0; + ::X11Kbd *m_pub; + QHash m_modifiers = { + {Controls::Caps, false}, + {Controls::Num, false}, + {Controls::Scroll, false}, + }; +}; + +} + +X11Kbd::X11Kbd(): + m_priv(new pimpl::X11Kbd(this)) +{} + +X11Kbd::~X11Kbd() +{} + +bool X11Kbd::init() +{ return m_priv->init(); } + +bool X11Kbd::isEnabled() const +{ return true; } + +void X11Kbd::readKbdInfo(KbdInfo & info) const +{ m_priv->readKbdInfo(info); } + +void X11Kbd::lockGroup(uint layId) const +{ m_priv->lockGroup(layId); } + +void X11Kbd::lockModifier(Controls cnt, bool locked) +{ m_priv->lockModifier(cnt, locked); } + +bool X11Kbd::isModifierLocked(Controls cnt) const +{ return m_priv->isModifierLocked(cnt); } diff --git a/plugin-kbindicator/src/x11/kbdlayout.h b/plugin-kbindicator/src/x11/kbdlayout.h new file mode 100644 index 0000000..2e11b73 --- /dev/null +++ b/plugin-kbindicator/src/x11/kbdlayout.h @@ -0,0 +1,34 @@ +#ifndef _X11KBD_H_ +#define _X11KBD_H_ + +#include +#include "../controls.h" + +class KbdInfo; + +namespace pimpl +{ class X11Kbd; } + +class X11Kbd: public QObject +{ + Q_OBJECT +public: + X11Kbd(); + virtual ~X11Kbd(); + + bool init(); + bool isEnabled() const; + void readKbdInfo(KbdInfo & info) const; + void lockGroup(uint layId) const; + void lockModifier(Controls cnt, bool locked); + bool isModifierLocked(Controls cnt) const; +signals: + void layoutChanged(uint layId); + void modifierChanged(Controls cnt, bool locked); + void checkState(); + void keyboardChanged(); +private: + QScopedPointer m_priv; +}; + +#endif diff --git a/plugin-kbindicator/translations/kbindicator.ts b/plugin-kbindicator/translations/kbindicator.ts index 27054fb..26dc157 100644 --- a/plugin-kbindicator/translations/kbindicator.ts +++ b/plugin-kbindicator/translations/kbindicator.ts @@ -1,26 +1,79 @@ - + - LxQtKbIndicatorConfiguration + Content - - Keyboard Indicator Settings + + Layout - - Caps Lock + + Variant + + + + + KbdStateConfig + + + Dialog + + + + + Leds + + + + + Show Caps Lock + + + + + Show Num Lock + + + + + Show Scroll Lock + + + + + Show keyboard layout + + + + + Show flags instead labels + + + + + Layout mode: + + + + + Global + + + + + Window - - Num Lock + + Application - - Scroll Lock + + Configure layouts diff --git a/plugin-kbindicator/translations/kbindicator_de.desktop b/plugin-kbindicator/translations/kbindicator_de.desktop new file mode 100644 index 0000000..6852c6b --- /dev/null +++ b/plugin-kbindicator/translations/kbindicator_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Tastatur-LED-Anzeige +Comment[de]=Plugin zum Anzeigen der Tastatur-LEDs und Umschalten des Layouts. diff --git a/plugin-kbindicator/translations/kbindicator_de.ts b/plugin-kbindicator/translations/kbindicator_de.ts new file mode 100644 index 0000000..e0060a8 --- /dev/null +++ b/plugin-kbindicator/translations/kbindicator_de.ts @@ -0,0 +1,80 @@ + + + + + Content + + + Layout + Layout + + + + Variant + Variante + + + + KbdStateConfig + + + Dialog + Tastatur + + + + Leds + LEDs + + + + Show Caps Lock + Feststelltaste anzeigen + + + + Show Num Lock + NumLock-Taste anzeigen + + + + Show Scroll Lock + Rollen-Taste anzeigen + + + + Show keyboard layout + Tastatur-Layout anzeigen + + + + Show flags instead labels + Flaggen statt Kennung anzeigen + + + + Layout mode: + Layout-Modus: + + + + Global + Global + + + + Window + Fenster + + + + Application + Anwendung + + + + Configure layouts + Layout konfigurieren... + + + diff --git a/plugin-kbindicator/translations/kbindicator_ja.desktop b/plugin-kbindicator/translations/kbindicator_ja.desktop deleted file mode 100644 index 4ad41d9..0000000 --- a/plugin-kbindicator/translations/kbindicator_ja.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ja]=キーボードインジケーター -Comment[ja]=キーボードインジケーターのプラグイン - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ja.ts b/plugin-kbindicator/translations/kbindicator_ja.ts deleted file mode 100644 index dc8363b..0000000 --- a/plugin-kbindicator/translations/kbindicator_ja.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - キーボードインジケーターの設定 - - - - Caps Lock - Caps Lock - - - - Num Lock - Num Lock - - - - Scroll Lock - Scroll Lock - - - diff --git a/plugin-kbindicator/translations/kbindicator_pt.desktop b/plugin-kbindicator/translations/kbindicator_pt.desktop deleted file mode 100644 index d15b8a1..0000000 --- a/plugin-kbindicator/translations/kbindicator_pt.desktop +++ /dev/null @@ -1,3 +0,0 @@ -#Translations -Name[pt]=Indicador de teclado -Comment[pt]=Plugin indicador do teclado diff --git a/plugin-kbindicator/translations/kbindicator_pt.ts b/plugin-kbindicator/translations/kbindicator_pt.ts deleted file mode 100644 index a6979e2..0000000 --- a/plugin-kbindicator/translations/kbindicator_pt.ts +++ /dev/null @@ -1,55 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - LxQt Keyboard Indicator Settings - Definições do indicador de teclado do LxQt - - - &Caps lock - &Caps lock - - - &Num lock - &Num lock - - - &Scroll lock - &Scroll lock - - - &Advanced control - Controlo &avançado - - - &Bit - &Bits - - - &Text - &Texto - - - - Keyboard Indicator Settings - Definições do indicador de teclado - - - - Caps Lock - Caps Lock - - - - Num Lock - Num Lock - - - - Scroll Lock - Scroll Lock - - - diff --git a/plugin-kbindicator/translations/kbindicator_ru.desktop b/plugin-kbindicator/translations/kbindicator_ru.desktop deleted file mode 100644 index db61346..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ru]=Индикатор раскладки -Comment[ru]=Плагин, отображающий раскладку. - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ru.ts b/plugin-kbindicator/translations/kbindicator_ru.ts deleted file mode 100644 index e2a08a6..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - Настройки индикатора клавиатуры - - - - Caps Lock - - - - - Num Lock - - - - - Scroll Lock - - - - diff --git a/plugin-kbindicator/translations/kbindicator_ru_RU.desktop b/plugin-kbindicator/translations/kbindicator_ru_RU.desktop deleted file mode 100644 index fecc593..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru_RU.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name[ru_RU]=Индикатор раскладки -Comment[ru_RU]=Плагин, отображающий раскладку. - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-kbindicator/translations/kbindicator_ru_RU.ts b/plugin-kbindicator/translations/kbindicator_ru_RU.ts deleted file mode 100644 index d5ac6f7..0000000 --- a/plugin-kbindicator/translations/kbindicator_ru_RU.ts +++ /dev/null @@ -1,27 +0,0 @@ - - - - - LxQtKbIndicatorConfiguration - - - Keyboard Indicator Settings - Настройки индикатора клавиатуры - - - - Caps Lock - - - - - Num Lock - - - - - Scroll Lock - - - - diff --git a/plugin-mainmenu/CMakeLists.txt b/plugin-mainmenu/CMakeLists.txt index 047e0cc..1d2e683 100644 --- a/plugin-mainmenu/CMakeLists.txt +++ b/plugin-mainmenu/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtmainmenuconfiguration.cpp ) -set(MOCS - lxqtmainmenu.h - menustyle.h - lxqtmainmenuconfiguration.h -) - set(UIS lxqtmainmenuconfiguration.ui ) @@ -39,10 +33,9 @@ if(MENU_CACHE_FOUND) endif() set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${LXQT_GLOBALKEYS_UI_LIBRARIES} + lxqt + lxqt-globalkeys + lxqt-globalkeys-ui ${MENU_CACHE_LIBRARIES} ) diff --git a/plugin-mainmenu/lxqtmainmenu.cpp b/plugin-mainmenu/lxqtmainmenu.cpp index e4805ba..a14d5d2 100644 --- a/plugin-mainmenu/lxqtmainmenu.cpp +++ b/plugin-mainmenu/lxqtmainmenu.cpp @@ -28,6 +28,7 @@ #include "lxqtmainmenu.h" #include "lxqtmainmenuconfiguration.h" +#include "../panel/lxqtpanel.h" #include #include #include @@ -41,8 +42,8 @@ #include #include #include -#include #include // for find_if() +#include #include #include @@ -73,11 +74,13 @@ LxQtMainMenu::LxQtMainMenu(const ILxQtPanelPluginStartupInfo &startupInfo): mDelayedPopup.setSingleShot(true); mDelayedPopup.setInterval(250); connect(&mDelayedPopup, &QTimer::timeout, this, &LxQtMainMenu::showHideMenu); + mHideTimer.setSingleShot(true); + mHideTimer.setInterval(250); mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); mButton.installEventFilter(this); - connect(&mButton, &QToolButton::clicked, this, &LxQtMainMenu::showMenu); + connect(&mButton, &QToolButton::clicked, this, &LxQtMainMenu::showHideMenu); settingsChanged(); @@ -107,7 +110,8 @@ LxQtMainMenu::~LxQtMainMenu() ************************************************/ void LxQtMainMenu::showHideMenu() { - if (mMenu && mMenu->isVisible()) + + if (mMenu && (mMenu->isVisible() || mHideTimer.isActive())) mMenu->hide(); else showMenu(); @@ -139,34 +143,9 @@ void LxQtMainMenu::showMenu() if (!mMenu) return; - int x=0, y=0; - - switch (panel()->position()) - { - case ILxQtPanel::PositionTop: - x = mButton.mapToGlobal(QPoint(0, 0)).x(); - y = panel()->globalGometry().bottom(); - break; - - case ILxQtPanel::PositionBottom: - x = mButton.mapToGlobal(QPoint(0, 0)).x(); - y = panel()->globalGometry().top() - mMenu->sizeHint().height(); - break; - - case ILxQtPanel::PositionLeft: - x = panel()->globalGometry().right(); - y = mButton.mapToGlobal(QPoint(0, 0)).y(); - break; - - case ILxQtPanel::PositionRight: - x = panel()->globalGometry().left() - mMenu->sizeHint().width(); - y = mButton.mapToGlobal(QPoint(0, 0)).y(); - break; - } - // Just using Qt`s activateWindow() won't work on some WMs like Kwin. // Solution is to execute menu 1ms later using timer - mMenu->exec(QPoint(x, y)); + mMenu->popup(calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); } #ifdef HAVE_MENU_CACHE @@ -198,35 +177,41 @@ void LxQtMainMenu::settingsChanged() mLogDir = settings()->value("log_dir", "").toString(); - QString mMenuFile = settings()->value("menu_file", "").toString(); - if (mMenuFile.isEmpty()) - mMenuFile = XdgMenu::getMenuFileName(); + QString menu_file = settings()->value("menu_file", "").toString(); + if (menu_file.isEmpty()) + menu_file = XdgMenu::getMenuFileName(); -#ifdef HAVE_MENU_CACHE - menu_cache_init(0); - if(mMenuCache) + if (mMenuFile != menu_file) { - menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); - menu_cache_unref(mMenuCache); - } - mMenuCache = menu_cache_lookup(mMenuFile.toLocal8Bit()); - mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this); + mMenuFile = menu_file; +#ifdef HAVE_MENU_CACHE + menu_cache_init(0); + if(mMenuCache) + { + menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify); + menu_cache_unref(mMenuCache); + } + mMenuCache = menu_cache_lookup(mMenuFile.toLocal8Bit()); + if (menu_cache_get_root_dir(mMenuCache)) + buildMenu(); + mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this); #else - mXdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LxQt"); - mXdgMenu.setLogDir(mLogDir); + mXdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LxQt"); + mXdgMenu.setLogDir(mLogDir); - bool res = mXdgMenu.read(mMenuFile); - connect(&mXdgMenu, SIGNAL(changed()), this, SLOT(buildMenu())); - if (res) - { - QTimer::singleShot(1000, this, SLOT(buildMenu())); - } - else - { - QMessageBox::warning(0, "Parse error", mXdgMenu.errorString()); - return; - } + bool res = mXdgMenu.read(mMenuFile); + connect(&mXdgMenu, SIGNAL(changed()), this, SLOT(buildMenu())); + if (res) + { + QTimer::singleShot(1000, this, SLOT(buildMenu())); + } + else + { + QMessageBox::warning(0, "Parse error", mXdgMenu.errorString()); + return; + } #endif + } QString shortcut = settings()->value("shortcut", DEFAULT_SHORTCUT).toString(); if (shortcut.isEmpty()) @@ -240,6 +225,8 @@ void LxQtMainMenu::settingsChanged() } mShortcutSeq = QKeySequence(shortcut); + setMenuFontSize(); + realign(); } @@ -266,17 +253,36 @@ void LxQtMainMenu::buildMenu() } menu->installEventFilter(this); + connect(menu, &QMenu::aboutToHide, &mHideTimer, static_cast(&QTimer::start)); + connect(menu, &QMenu::aboutToShow, &mHideTimer, &QTimer::stop); + // panel notification (needed in case of auto-hide) + connect(menu, &QMenu::aboutToHide, dynamic_cast(panel()), &LxQtPanel::hidePanel); QMenu *oldMenu = mMenu; mMenu = menu; if(oldMenu) delete oldMenu; + setMenuFontSize(); +} + +/************************************************ + + ************************************************/ +void LxQtMainMenu::setMenuFontSize() +{ + if (!mMenu) + return; + + QFont menuFont = mButton.font(); if(settings()->value("customFont", false).toBool()) { - QFont menuFont = mMenu->font(); + menuFont = mMenu->font(); menuFont.setPointSize(settings()->value("customFontSize").toInt()); + } + if (mMenu->font() != menuFont) + { mMenu->setFont(menuFont); QList subMenuList = mMenu->findChildren(); foreach (QMenu* subMenu, subMenuList) @@ -297,7 +303,7 @@ QDialog *LxQtMainMenu::configureDialog() /************************************************ ************************************************/ - + // functor used to match a QAction by prefix struct MatchAction { @@ -305,7 +311,7 @@ struct MatchAction bool operator()(QAction* action) { return action->text().startsWith(key_, Qt::CaseInsensitive); } QString key_; }; - + bool LxQtMainMenu::eventFilter(QObject *obj, QEvent *event) { if(obj == &mButton) diff --git a/plugin-mainmenu/lxqtmainmenu.h b/plugin-mainmenu/lxqtmainmenu.h index aa1e81f..9653809 100644 --- a/plugin-mainmenu/lxqtmainmenu.h +++ b/plugin-mainmenu/lxqtmainmenu.h @@ -77,6 +77,9 @@ public: protected: bool eventFilter(QObject *obj, QEvent *event); +private: + void setMenuFontSize(); + private: QToolButton mButton; QString mLogDir; @@ -95,7 +98,9 @@ private: bool mLockCascadeChanges; QTimer mDelayedPopup; + QTimer mHideTimer; QKeySequence mShortcutSeq; + QString mMenuFile; protected slots: @@ -111,10 +116,10 @@ private slots: class LxQtMainMenuPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtMainMenu(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtMainMenu(startupInfo);} }; #endif diff --git a/plugin-mainmenu/lxqtmainmenuconfiguration.cpp b/plugin-mainmenu/lxqtmainmenuconfiguration.cpp index 00d5825..2c78cb5 100644 --- a/plugin-mainmenu/lxqtmainmenuconfiguration.cpp +++ b/plugin-mainmenu/lxqtmainmenuconfiguration.cpp @@ -29,6 +29,7 @@ #include "lxqtmainmenuconfiguration.h" #include "ui_lxqtmainmenuconfiguration.h" #include +#include #include @@ -43,6 +44,8 @@ LxQtMainMenuConfiguration::LxQtMainMenuConfiguration(QSettings &settings, const setObjectName("MainMenuConfigurationWindow"); ui->setupUi(this); + ui->chooseMenuFilePB->setIcon(XdgIcon::fromTheme("folder")); + connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); loadSettings(); @@ -50,7 +53,11 @@ LxQtMainMenuConfiguration::LxQtMainMenuConfiguration(QSettings &settings, const connect(ui->showTextCB, SIGNAL(toggled(bool)), this, SLOT(showTextChanged(bool))); connect(ui->textLE, SIGNAL(textEdited(QString)), this, SLOT(textButtonChanged(QString))); connect(ui->chooseMenuFilePB, SIGNAL(clicked()), this, SLOT(chooseMenuFile())); - + connect(ui->menuFilePathLE, &QLineEdit::textChanged, [this] (QString const & file) + { + mSettings.setValue(QStringLiteral("menu_file"), file); + }); + connect(ui->shortcutEd, SIGNAL(shortcutGrabbed(QString)), this, SLOT(shortcutChanged(QString))); connect(ui->shortcutEd->addMenuAction(tr("Reset")), SIGNAL(triggered()), this, SLOT(shortcutReset())); @@ -97,12 +104,16 @@ void LxQtMainMenuConfiguration::showTextChanged(bool value) void LxQtMainMenuConfiguration::chooseMenuFile() { - QString path = QFileDialog::getOpenFileName(this, tr("Choose menu file"), "~", tr("Menu files (*.menu)")); - if (!path.isEmpty()) - { - ui->menuFilePathLE->setText(path); - mSettings.setValue("menu_file", path); - } + QFileDialog *d = new QFileDialog(this, + tr("Choose menu file"), + QStringLiteral("/etc/xdg/menus"), + tr("Menu files (*.menu)")); + d->setWindowModality(Qt::WindowModal); + d->setAttribute(Qt::WA_DeleteOnClose); + connect(d, &QFileDialog::fileSelected, [&] (const QString &file) { + ui->menuFilePathLE->setText(file); + }); + d->show(); } void LxQtMainMenuConfiguration::shortcutChanged(const QString &value) diff --git a/plugin-mainmenu/lxqtmainmenuconfiguration.ui b/plugin-mainmenu/lxqtmainmenuconfiguration.ui index d3f4e2c..7ba4d93 100644 --- a/plugin-mainmenu/lxqtmainmenuconfiguration.ui +++ b/plugin-mainmenu/lxqtmainmenuconfiguration.ui @@ -89,18 +89,10 @@ - - - true - - + - - - ... - - + diff --git a/plugin-mainmenu/translations/mainmenu.ts b/plugin-mainmenu/translations/mainmenu.ts index 1e26ea8..73d2fc8 100644 --- a/plugin-mainmenu/translations/mainmenu.ts +++ b/plugin-mainmenu/translations/mainmenu.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_ar.ts b/plugin-mainmenu/translations/mainmenu_ar.ts index 0c270c9..0577531 100644 --- a/plugin-mainmenu/translations/mainmenu_ar.ts +++ b/plugin-mainmenu/translations/mainmenu_ar.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - مغادرة + مغادرة diff --git a/plugin-mainmenu/translations/mainmenu_cs.ts b/plugin-mainmenu/translations/mainmenu_cs.ts index aa9ba2c..cf03517 100644 --- a/plugin-mainmenu/translations/mainmenu_cs.ts +++ b/plugin-mainmenu/translations/mainmenu_cs.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustit + Opustit diff --git a/plugin-mainmenu/translations/mainmenu_cs_CZ.ts b/plugin-mainmenu/translations/mainmenu_cs_CZ.ts index f1938fc..97ac808 100644 --- a/plugin-mainmenu/translations/mainmenu_cs_CZ.ts +++ b/plugin-mainmenu/translations/mainmenu_cs_CZ.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustit + Opustit diff --git a/plugin-mainmenu/translations/mainmenu_da.ts b/plugin-mainmenu/translations/mainmenu_da.ts index 61b3f69..60e01a5 100644 --- a/plugin-mainmenu/translations/mainmenu_da.ts +++ b/plugin-mainmenu/translations/mainmenu_da.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlad + Forlad diff --git a/plugin-mainmenu/translations/mainmenu_da_DK.ts b/plugin-mainmenu/translations/mainmenu_da_DK.ts index 36423dd..b1cacce 100644 --- a/plugin-mainmenu/translations/mainmenu_da_DK.ts +++ b/plugin-mainmenu/translations/mainmenu_da_DK.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlad + Forlad diff --git a/plugin-mainmenu/translations/mainmenu_de.desktop b/plugin-mainmenu/translations/mainmenu_de.desktop index 1402227..eaf499e 100644 --- a/plugin-mainmenu/translations/mainmenu_de.desktop +++ b/plugin-mainmenu/translations/mainmenu_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Application menu -Comment=A menu of all your applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Menü basierter Anwendungsstarter Name[de]=Anwendungsmenü +Comment[de]=Menübasierter Anwendungsstarter diff --git a/plugin-mainmenu/translations/mainmenu_de.ts b/plugin-mainmenu/translations/mainmenu_de.ts index d090de9..94cb85d 100644 --- a/plugin-mainmenu/translations/mainmenu_de.ts +++ b/plugin-mainmenu/translations/mainmenu_de.ts @@ -4,54 +4,37 @@ LxQtMainMenu - + Show/hide main menu - - - - - Leave - Verlassen + Hauptmenü anzeigen/verstecken LxQtMainMenuConfiguration - LxQt Main Menu settings - LxQt Hauptmenü-Einstellungen + + Main Menu settings + Hauptmenü-Einstellungen General Allgemein - - Show text - Text anzeigen - - - Button text - Knopf-Text - - - - Main Menu settings - - Button text: - + Schaltflächentext: Custom font size: - + Eigene Schriftgröße: pt - + pt @@ -61,35 +44,30 @@ Menu file: - - - - - ... - ... + Menü-Datei: - + Keyboard Shortcut - Tastaturkürzel + Tastenkürzel - + Click the button to record shortcut: - Klicken Sie auf die Schaltfläche, um ein Tastaturkürzel aufzunehmen: + Auf die Schaltfläche klicken, um ein Tastenkürzel aufzunehmen: - + Reset - + Zurücksetzen - + Choose menu file Menü-Datei auswählen - + Menu files (*.menu) Menü-Dateien (*.menu) diff --git a/plugin-mainmenu/translations/mainmenu_de_DE.desktop b/plugin-mainmenu/translations/mainmenu_de_DE.desktop deleted file mode 100644 index 790ac37..0000000 --- a/plugin-mainmenu/translations/mainmenu_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Application menu -Comment=A menu of all your applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Menü-basierter Anwendungsstarter -Name[de_DE]=Anwendungsmenü diff --git a/plugin-mainmenu/translations/mainmenu_el_GR.ts b/plugin-mainmenu/translations/mainmenu_el_GR.ts index bc87087..9ff8f32 100644 --- a/plugin-mainmenu/translations/mainmenu_el_GR.ts +++ b/plugin-mainmenu/translations/mainmenu_el_GR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Έξοδος + Έξοδος diff --git a/plugin-mainmenu/translations/mainmenu_eo.ts b/plugin-mainmenu/translations/mainmenu_eo.ts index ed22abe..400c5ac 100644 --- a/plugin-mainmenu/translations/mainmenu_eo.ts +++ b/plugin-mainmenu/translations/mainmenu_eo.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Forlasi + Forlasi diff --git a/plugin-mainmenu/translations/mainmenu_es.ts b/plugin-mainmenu/translations/mainmenu_es.ts index 75dc2ad..25f31f2 100644 --- a/plugin-mainmenu/translations/mainmenu_es.ts +++ b/plugin-mainmenu/translations/mainmenu_es.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_es_UY.ts b/plugin-mainmenu/translations/mainmenu_es_UY.ts index 058119e..e4c69eb 100644 --- a/plugin-mainmenu/translations/mainmenu_es_UY.ts +++ b/plugin-mainmenu/translations/mainmenu_es_UY.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_es_VE.ts b/plugin-mainmenu/translations/mainmenu_es_VE.ts index e642691..9c1628f 100644 --- a/plugin-mainmenu/translations/mainmenu_es_VE.ts +++ b/plugin-mainmenu/translations/mainmenu_es_VE.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Salir + Salir diff --git a/plugin-mainmenu/translations/mainmenu_eu.ts b/plugin-mainmenu/translations/mainmenu_eu.ts index a4acdd2..0fe6784 100644 --- a/plugin-mainmenu/translations/mainmenu_eu.ts +++ b/plugin-mainmenu/translations/mainmenu_eu.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Irten + Irten diff --git a/plugin-mainmenu/translations/mainmenu_fi.ts b/plugin-mainmenu/translations/mainmenu_fi.ts index 8b17a60..4d556a2 100644 --- a/plugin-mainmenu/translations/mainmenu_fi.ts +++ b/plugin-mainmenu/translations/mainmenu_fi.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Poistu + Poistu diff --git a/plugin-mainmenu/translations/mainmenu_fr_FR.ts b/plugin-mainmenu/translations/mainmenu_fr_FR.ts index de3f00e..f127304 100644 --- a/plugin-mainmenu/translations/mainmenu_fr_FR.ts +++ b/plugin-mainmenu/translations/mainmenu_fr_FR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Quitter + Quitter diff --git a/plugin-mainmenu/translations/mainmenu_de_DE.ts b/plugin-mainmenu/translations/mainmenu_hr.ts similarity index 60% rename from plugin-mainmenu/translations/mainmenu_de_DE.ts rename to plugin-mainmenu/translations/mainmenu_hr.ts index d83bd7a..e82b93c 100644 --- a/plugin-mainmenu/translations/mainmenu_de_DE.ts +++ b/plugin-mainmenu/translations/mainmenu_hr.ts @@ -1,42 +1,25 @@ - + LxQtMainMenu - + Show/hide main menu - - - - - Leave - Verlassen + Pokaži/sakrij glavni izbornik LxQtMainMenuConfiguration - - LxQt Main Menu settings - LxQt Hauptmenü Einstellungen - General - Allgemein - - - Show text - Zeige Text - - - Button text - Schaltflächen Text + Općenito Main Menu settings - + Postavke glavnoga izbornika @@ -46,52 +29,47 @@ Custom font size: - + Prilagođena veličina fonta: pt - + pt Menu file - Menü Datei + Datoteka izbornika Menu file: - + Datoteka izbornika: - - ... - ... - - - + Keyboard Shortcut - Tastenkürzel + Kratica tipkovnice - + Click the button to record shortcut: - Klicke um Tastenkürzel zu ändern: + - + Reset - + Choose menu file - Wähle Menü Datei + Izaberite datoteku izbornika - + Menu files (*.menu) - Menü Datei (*.menu) + diff --git a/plugin-mainmenu/translations/mainmenu_hu.ts b/plugin-mainmenu/translations/mainmenu_hu.ts index 2c15ba8..0958db1 100644 --- a/plugin-mainmenu/translations/mainmenu_hu.ts +++ b/plugin-mainmenu/translations/mainmenu_hu.ts @@ -1,24 +1,23 @@ - + LxQtMainMenu - + Show/hide main menu - + Menü láttatás/elrejtés - Leave - Kilépés + Leállítás LxQtMainMenuConfiguration LxQt Main Menu settings - A LxQt főmenü beállításai + LxQt főmenü beállítás @@ -27,31 +26,31 @@ Show text - Szöveg megjelenítése + Szöveg megjelenítése Button text - Gombszöveg + Gombszöveg Main Menu settings - + Menübeállítás Button text: - + Gombszöveg: Custom font size: - + Saját betűnagyság: pt - + .pont @@ -61,7 +60,7 @@ Menu file: - + Menüfájl: @@ -71,17 +70,17 @@ Keyboard Shortcut - Gyorsbillentyűk + Gyorsbillentyű Click the button to record shortcut: - Kattintson a gombra a gyorsbillentyű rögzítéséhez: + Billentyű nyomása a megjegyzéshez... Reset - + Visszaállít diff --git a/plugin-mainmenu/translations/mainmenu_hu_HU.ts b/plugin-mainmenu/translations/mainmenu_hu_HU.ts index ee38197..4514508 100644 --- a/plugin-mainmenu/translations/mainmenu_hu_HU.ts +++ b/plugin-mainmenu/translations/mainmenu_hu_HU.ts @@ -1,15 +1,14 @@ - + LxQtMainMenu - + Show/hide main menu - + Menü láttatás/elrejtés - Leave Leállítás @@ -18,7 +17,7 @@ LxQtMainMenuConfiguration LxQt Main Menu settings - LXDE-Qt - A főmen beállítása + LxQt főmenü beállítás @@ -27,31 +26,31 @@ Show text - Szöveg megjelenítése + Szöveg megjelenítése Button text - Gombszöveg + Gombszöveg Main Menu settings - + Menübeállítás Button text: - + Gombszöveg: Custom font size: - + Saját betűnagyság: pt - + .pont @@ -61,7 +60,7 @@ Menu file: - + Menüfájl: @@ -71,17 +70,17 @@ Keyboard Shortcut - + Gyorsbillentyű Click the button to record shortcut: - + Billentyű nyomása a megjegyzéshez... Reset - + Visszaállít diff --git a/plugin-mainmenu/translations/mainmenu_ia.ts b/plugin-mainmenu/translations/mainmenu_ia.ts index 16fa8cd..7cc16c2 100644 --- a/plugin-mainmenu/translations/mainmenu_ia.ts +++ b/plugin-mainmenu/translations/mainmenu_ia.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_id_ID.ts b/plugin-mainmenu/translations/mainmenu_id_ID.ts index ee9b4c9..095b42b 100644 --- a/plugin-mainmenu/translations/mainmenu_id_ID.ts +++ b/plugin-mainmenu/translations/mainmenu_id_ID.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_it_IT.ts b/plugin-mainmenu/translations/mainmenu_it_IT.ts index 7d8a59e..b3a286a 100644 --- a/plugin-mainmenu/translations/mainmenu_it_IT.ts +++ b/plugin-mainmenu/translations/mainmenu_it_IT.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - + Mostra/nascondi menu principale - Leave - Esci + Esci @@ -23,7 +22,7 @@ General - Generale + Generali Show text @@ -36,22 +35,22 @@ Main Menu settings - + Impostazioni del menu principale di LXQt Button text: - + Testo pulsante: Custom font size: - + Dimensione carattere personalizzato: pt - + @@ -61,7 +60,7 @@ Menu file: - + File del menu: @@ -71,17 +70,17 @@ Keyboard Shortcut - Scorciatoie da tastiera + Scorciatoia da tastiera Click the button to record shortcut: - Fai clic sul pulsante per registrare una scorciatoia: + Fai clic sul pulsante per impostare una scorciatoia: Reset - + Ripristina diff --git a/plugin-mainmenu/translations/mainmenu_ja.ts b/plugin-mainmenu/translations/mainmenu_ja.ts index f2cbaae..5f3b0d3 100644 --- a/plugin-mainmenu/translations/mainmenu_ja.ts +++ b/plugin-mainmenu/translations/mainmenu_ja.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu メインメニューを表示/隠す - Leave - 終了 + 終了 diff --git a/plugin-mainmenu/translations/mainmenu_ko.ts b/plugin-mainmenu/translations/mainmenu_ko.ts index 736872a..d1a91b9 100644 --- a/plugin-mainmenu/translations/mainmenu_ko.ts +++ b/plugin-mainmenu/translations/mainmenu_ko.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_lt.ts b/plugin-mainmenu/translations/mainmenu_lt.ts index 67b3adc..7f03949 100644 --- a/plugin-mainmenu/translations/mainmenu_lt.ts +++ b/plugin-mainmenu/translations/mainmenu_lt.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Išeiti + Išeiti diff --git a/plugin-mainmenu/translations/mainmenu_nl.ts b/plugin-mainmenu/translations/mainmenu_nl.ts index dab47c7..9724c07 100644 --- a/plugin-mainmenu/translations/mainmenu_nl.ts +++ b/plugin-mainmenu/translations/mainmenu_nl.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Verlaten + Verlaten diff --git a/plugin-mainmenu/translations/mainmenu_pl_PL.ts b/plugin-mainmenu/translations/mainmenu_pl_PL.ts index ebb304c..7ff8b07 100644 --- a/plugin-mainmenu/translations/mainmenu_pl_PL.ts +++ b/plugin-mainmenu/translations/mainmenu_pl_PL.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - + Pokaż/ukryj menu - Leave - Opuść + Opuść @@ -36,22 +35,22 @@ Main Menu settings - + Ustawienia Menu Button text: - + Tekst przycisku: Custom font size: - + Własny rozmiar czcionki: pt - + pt @@ -61,7 +60,7 @@ Menu file: - + Plik menu: @@ -81,7 +80,7 @@ Reset - + Zresetuj diff --git a/plugin-mainmenu/translations/mainmenu_pt.ts b/plugin-mainmenu/translations/mainmenu_pt.ts index a1f2782..f59075d 100644 --- a/plugin-mainmenu/translations/mainmenu_pt.ts +++ b/plugin-mainmenu/translations/mainmenu_pt.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Sair + Sair diff --git a/plugin-mainmenu/translations/mainmenu_pt_BR.ts b/plugin-mainmenu/translations/mainmenu_pt_BR.ts index 69d0e1b..90a5fd0 100644 --- a/plugin-mainmenu/translations/mainmenu_pt_BR.ts +++ b/plugin-mainmenu/translations/mainmenu_pt_BR.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Sair + Sair diff --git a/plugin-mainmenu/translations/mainmenu_ro_RO.ts b/plugin-mainmenu/translations/mainmenu_ro_RO.ts index c080071..20c0fa4 100644 --- a/plugin-mainmenu/translations/mainmenu_ro_RO.ts +++ b/plugin-mainmenu/translations/mainmenu_ro_RO.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Părăsește + Părăsește diff --git a/plugin-mainmenu/translations/mainmenu_ru.ts b/plugin-mainmenu/translations/mainmenu_ru.ts index d067af5..d9cf260 100644 --- a/plugin-mainmenu/translations/mainmenu_ru.ts +++ b/plugin-mainmenu/translations/mainmenu_ru.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu Показать/скрыть главное меню - - - Leave - Выход - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_ru_RU.ts b/plugin-mainmenu/translations/mainmenu_ru_RU.ts index 74c0440..b4a25ce 100644 --- a/plugin-mainmenu/translations/mainmenu_ru_RU.ts +++ b/plugin-mainmenu/translations/mainmenu_ru_RU.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu Показать/скрыть главное меню - - - Leave - Выход - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_sk_SK.ts b/plugin-mainmenu/translations/mainmenu_sk_SK.ts index 9d943dd..872a01b 100644 --- a/plugin-mainmenu/translations/mainmenu_sk_SK.ts +++ b/plugin-mainmenu/translations/mainmenu_sk_SK.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Opustiť + Opustiť diff --git a/plugin-mainmenu/translations/mainmenu_sl.ts b/plugin-mainmenu/translations/mainmenu_sl.ts index 30123c6..2d3f242 100644 --- a/plugin-mainmenu/translations/mainmenu_sl.ts +++ b/plugin-mainmenu/translations/mainmenu_sl.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Zapusti + Zapusti diff --git a/plugin-mainmenu/translations/mainmenu_sr@latin.ts b/plugin-mainmenu/translations/mainmenu_sr@latin.ts index 74b72f5..d1449a7 100644 --- a/plugin-mainmenu/translations/mainmenu_sr@latin.ts +++ b/plugin-mainmenu/translations/mainmenu_sr@latin.ts @@ -4,15 +4,10 @@ LxQtMainMenu - + Show/hide main menu - - - Leave - - LxQtMainMenuConfiguration diff --git a/plugin-mainmenu/translations/mainmenu_sr_BA.ts b/plugin-mainmenu/translations/mainmenu_sr_BA.ts index da70ee6..9582e30 100644 --- a/plugin-mainmenu/translations/mainmenu_sr_BA.ts +++ b/plugin-mainmenu/translations/mainmenu_sr_BA.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Напуштање + Напуштање diff --git a/plugin-mainmenu/translations/mainmenu_sr_RS.ts b/plugin-mainmenu/translations/mainmenu_sr_RS.ts index 0cdf1da..91a5d24 100644 --- a/plugin-mainmenu/translations/mainmenu_sr_RS.ts +++ b/plugin-mainmenu/translations/mainmenu_sr_RS.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Напуштање + Напуштање diff --git a/plugin-mainmenu/translations/mainmenu_th_TH.ts b/plugin-mainmenu/translations/mainmenu_th_TH.ts index 225db27..cf050cc 100644 --- a/plugin-mainmenu/translations/mainmenu_th_TH.ts +++ b/plugin-mainmenu/translations/mainmenu_th_TH.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - ออก + ออก diff --git a/plugin-mainmenu/translations/mainmenu_tr.ts b/plugin-mainmenu/translations/mainmenu_tr.ts index 1fac717..88516fc 100644 --- a/plugin-mainmenu/translations/mainmenu_tr.ts +++ b/plugin-mainmenu/translations/mainmenu_tr.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Çık + Çık diff --git a/plugin-mainmenu/translations/mainmenu_uk.ts b/plugin-mainmenu/translations/mainmenu_uk.ts index 29a99fe..1e21f47 100644 --- a/plugin-mainmenu/translations/mainmenu_uk.ts +++ b/plugin-mainmenu/translations/mainmenu_uk.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - Полишити + Полишити diff --git a/plugin-mainmenu/translations/mainmenu_zh_CN.ts b/plugin-mainmenu/translations/mainmenu_zh_CN.ts index efac34c..f9ddeee 100644 --- a/plugin-mainmenu/translations/mainmenu_zh_CN.ts +++ b/plugin-mainmenu/translations/mainmenu_zh_CN.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - 离开 + 离开 diff --git a/plugin-mainmenu/translations/mainmenu_zh_TW.ts b/plugin-mainmenu/translations/mainmenu_zh_TW.ts index 82cd2b2..5bc02fb 100644 --- a/plugin-mainmenu/translations/mainmenu_zh_TW.ts +++ b/plugin-mainmenu/translations/mainmenu_zh_TW.ts @@ -4,14 +4,13 @@ LxQtMainMenu - + Show/hide main menu - Leave - 離開 + 離開 diff --git a/plugin-mainmenu/xdgcachedmenu.h b/plugin-mainmenu/xdgcachedmenu.h index 8da3da3..4f380d1 100644 --- a/plugin-mainmenu/xdgcachedmenu.h +++ b/plugin-mainmenu/xdgcachedmenu.h @@ -1,21 +1,21 @@ /* * * Copyright (C) 2013 - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * */ #ifndef XDGCACHEDMENU_H diff --git a/plugin-mount/CMakeLists.txt b/plugin-mount/CMakeLists.txt index 9afd7ad..e9e2211 100644 --- a/plugin-mount/CMakeLists.txt +++ b/plugin-mount/CMakeLists.txt @@ -2,8 +2,8 @@ set(PLUGIN "mount") set(HEADERS lxqtmountplugin.h - lxqtmountconfiguration.h - mountbutton.h + configuration.h + button.h menudiskitem.h popup.h actions/deviceaction.h @@ -13,10 +13,9 @@ set(HEADERS ) set(SOURCES - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.cpp lxqtmountplugin.cpp - lxqtmountconfiguration.cpp - mountbutton.cpp + configuration.cpp + button.cpp menudiskitem.cpp popup.cpp actions/deviceaction.cpp @@ -25,24 +24,11 @@ set(SOURCES actions/deviceaction_nothing.cpp ) -set(MOCS - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.h - lxqtmountplugin.h - lxqtmountconfiguration.h - mountbutton.h - menudiskitem.h - popup.h - actions/deviceaction.h - actions/deviceaction_info.h - actions/deviceaction_menu.h - actions/deviceaction_nothing.h -) - set(UIS - lxqtmountconfiguration.ui + configuration.ui ) -include_directories(${LXQTMOUNT_INCLUDE_DIRS}) -set(LIBRARIES ${QTXDG_LIBRARIES} ${LXQTMOUNT_LIBRARIES}) +find_package(KF5Solid REQUIRED) +set(LIBRARIES Qt5Xdg KF5::Solid) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-mount/actions/deviceaction.cpp b/plugin-mount/actions/deviceaction.cpp index 1a21e18..1165d8c 100644 --- a/plugin-mount/actions/deviceaction.cpp +++ b/plugin-mount/actions/deviceaction.cpp @@ -25,15 +25,15 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction.h" #include "deviceaction_info.h" #include "deviceaction_menu.h" #include "deviceaction_nothing.h" - #include "../menudiskitem.h" #include "../lxqtmountplugin.h" +#include + #define ACT_NOTHING "nothing" #define ACT_INFO "showInfo" #define ACT_MENU "showMenu" @@ -80,19 +80,20 @@ QString DeviceAction::actionIdToString(DeviceAction::ActionId id) return ACT_INFO; } -void DeviceAction::deviceAdded(LxQt::MountDevice *device) +void DeviceAction::onDeviceAdded(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + Solid::Device device(udi); + if (device.is()) doDeviceAdded(device); } -void DeviceAction::deviceRemoved(LxQt::MountDevice *device) +void DeviceAction::onDeviceRemoved(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + Solid::Device device(udi); + if (device.is()) doDeviceRemoved(device); } - DeviceAction::ActionId DeviceAction::stringToActionId(const QString &string, ActionId defaultValue) { QString s = string.toUpper(); @@ -102,4 +103,3 @@ DeviceAction::ActionId DeviceAction::stringToActionId(const QString &string, Act return defaultValue; } - diff --git a/plugin-mount/actions/deviceaction.h b/plugin-mount/actions/deviceaction.h index 3cadbcf..58ecc27 100644 --- a/plugin-mount/actions/deviceaction.h +++ b/plugin-mount/actions/deviceaction.h @@ -25,45 +25,42 @@ * * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef DEVICEACTION_H -#define DEVICEACTION_H +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_H #include #include -#include - -namespace { -class MountDevice; -class MountManager; -} +#include class LxQtMountPlugin; class DeviceAction: public QObject { Q_OBJECT + public: - enum ActionId { + enum ActionId + { ActionNothing, ActionInfo, ActionMenu }; virtual ~DeviceAction(); + virtual ActionId Type() const throw () = 0; - static DeviceAction *create(ActionId id, LxQtMountPlugin *plugin, QObject *parent=0); + static DeviceAction *create(ActionId id, LxQtMountPlugin *plugin, QObject *parent = 0); static ActionId stringToActionId(const QString &string, ActionId defaultValue); static QString actionIdToString(ActionId id); public slots: - void deviceAdded(LxQt::MountDevice *device); - void deviceRemoved(LxQt::MountDevice *device); + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); protected: - explicit DeviceAction(LxQtMountPlugin *plugin, QObject *parent=0); - virtual void doDeviceAdded(LxQt::MountDevice *device) = 0; - virtual void doDeviceRemoved(LxQt::MountDevice *device) = 0; + explicit DeviceAction(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual void doDeviceAdded(Solid::Device device) = 0; + virtual void doDeviceRemoved(Solid::Device device) = 0; LxQtMountPlugin *mPlugin; }; diff --git a/plugin-mount/actions/deviceaction_info.cpp b/plugin-mount/actions/deviceaction_info.cpp index 725b408..5a5b4c7 100644 --- a/plugin-mount/actions/deviceaction_info.cpp +++ b/plugin-mount/actions/deviceaction_info.cpp @@ -25,37 +25,27 @@ * * END_COMMON_COPYRIGHT_HEADER */ - -#include "deviceaction_info.h" #include "../lxqtmountplugin.h" +#include "deviceaction_info.h" + #include -#include DeviceActionInfo::DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent): DeviceAction(plugin, parent) { - qDebug() << Q_FUNC_INFO; } - -void DeviceActionInfo::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionInfo::doDeviceAdded(Solid::Device device) { - qDebug() << Q_FUNC_INFO; - - showMessage(tr("The device \"%1\" is connected.").arg(device->label())); + showMessage(tr("The device \"%1\" is connected.").arg(device.description())); } - -void DeviceActionInfo::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionInfo::doDeviceRemoved(Solid::Device device) { - qDebug() << Q_FUNC_INFO; - - showMessage(tr("The device \"%1\" is removed.").arg(device->label())); + showMessage(tr("The device \"%1\" is removed.").arg(device.description())); } - void DeviceActionInfo::showMessage(const QString &text) { LxQt::Notification::notify(tr("Removable media/devices manager"), text, mPlugin->icon().name()); } - diff --git a/plugin-mount/actions/deviceaction_info.h b/plugin-mount/actions/deviceaction_info.h index d2ca884..99e8733 100644 --- a/plugin-mount/actions/deviceaction_info.h +++ b/plugin-mount/actions/deviceaction_info.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_INFO_H -#ifndef DEVICEACTION_INFO_H -#define DEVICEACTION_INFO_H +#include "deviceaction.h" #include #include -#include "deviceaction.h" class Popup; @@ -39,11 +39,12 @@ class DeviceActionInfo : public DeviceAction { Q_OBJECT public: - explicit DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionInfo(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionInfo; } protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); private: void showMessage(const QString &text); diff --git a/plugin-mount/actions/deviceaction_menu.cpp b/plugin-mount/actions/deviceaction_menu.cpp index 5b7c1cf..982834a 100644 --- a/plugin-mount/actions/deviceaction_menu.cpp +++ b/plugin-mount/actions/deviceaction_menu.cpp @@ -25,13 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction_menu.h" #include "../lxqtmountplugin.h" #include "../popup.h" -#include - DeviceActionMenu::DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent): DeviceAction(plugin, parent) { @@ -39,19 +36,15 @@ DeviceActionMenu::DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent): mHideTimer.setSingleShot(true); mHideTimer.setInterval(5000); - connect(&mHideTimer, SIGNAL(timeout()), mPopup, SLOT(hide())); + connect(&mHideTimer, &QTimer::timeout, mPopup, &Popup::hide); } - -void DeviceActionMenu::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionMenu::doDeviceAdded(Solid::Device device) { mHideTimer.start(); mPopup->show(); } - -void DeviceActionMenu::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionMenu::doDeviceRemoved(Solid::Device device) { - } - diff --git a/plugin-mount/actions/deviceaction_menu.h b/plugin-mount/actions/deviceaction_menu.h index 3813cb3..66a0244 100644 --- a/plugin-mount/actions/deviceaction_menu.h +++ b/plugin-mount/actions/deviceaction_menu.h @@ -25,13 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_MENU_H -#ifndef DEVICEACTIONMENU_H -#define DEVICEACTIONMENU_H +#include "deviceaction.h" #include #include -#include "deviceaction.h" class Popup; @@ -39,11 +39,12 @@ class DeviceActionMenu : public DeviceAction { Q_OBJECT public: - explicit DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionMenu(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionMenu; } protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); private: Popup *mPopup; diff --git a/plugin-mount/actions/deviceaction_nothing.cpp b/plugin-mount/actions/deviceaction_nothing.cpp index 77b1f3f..3e4bd9b 100644 --- a/plugin-mount/actions/deviceaction_nothing.cpp +++ b/plugin-mount/actions/deviceaction_nothing.cpp @@ -25,7 +25,6 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "deviceaction_nothing.h" DeviceActionNothing::DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent): @@ -33,13 +32,10 @@ DeviceActionNothing::DeviceActionNothing(LxQtMountPlugin *plugin, QObject *paren { } - -void DeviceActionNothing::doDeviceAdded(LxQt::MountDevice *device) +void DeviceActionNothing::doDeviceAdded(Solid::Device device) { } - -void DeviceActionNothing::doDeviceRemoved(LxQt::MountDevice *device) +void DeviceActionNothing::doDeviceRemoved(Solid::Device device) { } - diff --git a/plugin-mount/actions/deviceaction_nothing.h b/plugin-mount/actions/deviceaction_nothing.h index 4227e5f..105bf97 100644 --- a/plugin-mount/actions/deviceaction_nothing.h +++ b/plugin-mount/actions/deviceaction_nothing.h @@ -26,21 +26,23 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef DEVICEACTIONNOTHING_H -#define DEVICEACTIONNOTHING_H +#ifndef LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H +#define LXQT_PLUGIN_MOUNT_DEVICEACTION_NOTHING_H -#include #include "deviceaction.h" +#include class DeviceActionNothing : public DeviceAction { Q_OBJECT + public: - explicit DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent=0); + explicit DeviceActionNothing(LxQtMountPlugin *plugin, QObject *parent = 0); + virtual ActionId Type() const throw () { return ActionNothing; }; protected: - void doDeviceAdded(LxQt::MountDevice *device); - void doDeviceRemoved(LxQt::MountDevice *device); + void doDeviceAdded(Solid::Device device); + void doDeviceRemoved(Solid::Device device); }; #endif // DEVICEACTIONNOTHING_H diff --git a/plugin-mount/mountbutton.cpp b/plugin-mount/button.cpp similarity index 79% rename from plugin-mount/mountbutton.cpp rename to plugin-mount/button.cpp index fa709b6..962f438 100644 --- a/plugin-mount/mountbutton.cpp +++ b/plugin-mount/button.cpp @@ -26,27 +26,17 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include - +#include "button.h" #include -#include "mountbutton.h" -MountButton::MountButton(QWidget * parent) : +Button::Button(QWidget * parent) : QToolButton(parent) { - setIcon(XdgIcon::fromTheme(QStringList() << "device-notifier" << "drive-removable-media-usb" << "drive-removable-media")); - + setIcon(XdgIcon::fromTheme(QStringLiteral("drive-removable-media"))); setToolTip(tr("Removable media/devices manager")); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } - -MountButton::~MountButton() -{ -} - - -void MountButton::setDown(bool down) +Button::~Button() { - QToolButton::setDown(down); } diff --git a/plugin-mount/mountbutton.h b/plugin-mount/button.h similarity index 85% rename from plugin-mount/mountbutton.h rename to plugin-mount/button.h index 227da1b..2628cbc 100644 --- a/plugin-mount/mountbutton.h +++ b/plugin-mount/button.h @@ -26,20 +26,18 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef MOUNTBUTTON_H -#define MOUNTBUTTON_H +#ifndef LXQT_PLUGIN_MOUNT_BUTTON_H +#define LXQT_PLUGIN_MOUNT_BUTTON_H #include -class MountButton : public QToolButton + +class Button : public QToolButton { Q_OBJECT public: - MountButton(QWidget *parent = 0); - ~MountButton(); - -public slots: - void setDown(bool down); + Button(QWidget *parent = 0); + ~Button(); }; #endif diff --git a/plugin-mount/lxqtmountconfiguration.cpp b/plugin-mount/configuration.cpp similarity index 54% rename from plugin-mount/lxqtmountconfiguration.cpp rename to plugin-mount/configuration.cpp index 8351b3e..c7a92ac 100644 --- a/plugin-mount/lxqtmountconfiguration.cpp +++ b/plugin-mount/configuration.cpp @@ -26,44 +26,40 @@ * END_COMMON_COPYRIGHT_HEADER */ -#include "lxqtmountconfiguration.h" -#include "ui_lxqtmountconfiguration.h" +#include "configuration.h" +#include "ui_configuration.h" #include -#include +#include -#define ACT_SHOW_MENU "showMenu" -#define ACT_SHOW_INFO "showInfo" -#define ACT_NOTHING "nothing" - -LxQtMountConfiguration::LxQtMountConfiguration(QSettings &settings, QWidget *parent) : +Configuration::Configuration(QSettings &settings, QWidget *parent) : LxQtPanelPluginConfigDialog(settings, parent), - ui(new Ui::LxQtMountConfiguration) + ui(new Ui::Configuration) { ui->setupUi(this); - ui->devAddedCombo->addItem(tr("Popup menu"), ACT_SHOW_MENU); - ui->devAddedCombo->addItem(tr("Show info"), ACT_SHOW_INFO); - ui->devAddedCombo->addItem(tr("Do nothing"), ACT_NOTHING); + ui->devAddedCombo->addItem(tr("Popup menu"), QStringLiteral(ACT_SHOW_MENU)); + ui->devAddedCombo->addItem(tr("Show info"), QStringLiteral(ACT_SHOW_INFO)); + ui->devAddedCombo->addItem(tr("Do nothing"), QStringLiteral(ACT_NOTHING)); loadSettings(); - connect(ui->devAddedCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(devAddedChanged(int))); - connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(dialogButtonsAction(QAbstractButton*))); + connect(ui->devAddedCombo, static_cast(&QComboBox::currentIndexChanged), + this, &Configuration::devAddedChanged); + connect(ui->buttons, &QDialogButtonBox::clicked, this, &Configuration::dialogButtonsAction); } -LxQtMountConfiguration::~LxQtMountConfiguration() +Configuration::~Configuration() { delete ui; } - -void LxQtMountConfiguration::loadSettings() +void Configuration::loadSettings() { - setComboboxIndexByData(ui->devAddedCombo, settings().value("newDeviceAction", ACT_SHOW_INFO), 1); + QVariant value = settings().value(QStringLiteral(CFG_KEY_ACTION), QStringLiteral(ACT_SHOW_INFO)); + setComboboxIndexByData(ui->devAddedCombo, value, 1); } - -void LxQtMountConfiguration::devAddedChanged(int index) +void Configuration::devAddedChanged(int index) { QString s = ui->devAddedCombo->itemData(index).toString(); - settings().setValue("newDeviceAction", s); + settings().setValue(QStringLiteral(CFG_KEY_ACTION), s); } diff --git a/plugin-mount/lxqtmountconfiguration.h b/plugin-mount/configuration.h similarity index 74% rename from plugin-mount/lxqtmountconfiguration.h rename to plugin-mount/configuration.h index 7801b87..aadd967 100644 --- a/plugin-mount/lxqtmountconfiguration.h +++ b/plugin-mount/configuration.h @@ -25,32 +25,34 @@ * * END_COMMON_COPYRIGHT_HEADER */ - - -#ifndef LXQTMOUNTCONFIGURATION_H -#define LXQTMOUNTCONFIGURATION_H - +#ifndef LXQT_PLUGIN_MOUNT_CONFIGURATION_H +#define LXQT_PLUGIN_MOUNT_CONFIGURATION_H #include "../panel/lxqtpanelpluginconfigdialog.h" +#define CFG_KEY_ACTION "newDeviceAction" +#define ACT_SHOW_MENU "showMenu" +#define ACT_SHOW_INFO "showInfo" +#define ACT_NOTHING "nothing" + namespace Ui { - class LxQtMountConfiguration; + class Configuration; } -class LxQtMountConfiguration : public LxQtPanelPluginConfigDialog +class Configuration : public LxQtPanelPluginConfigDialog { Q_OBJECT public: - explicit LxQtMountConfiguration(QSettings &settings, QWidget *parent = 0); - ~LxQtMountConfiguration(); + explicit Configuration(QSettings &settings, QWidget *parent = 0); + ~Configuration(); protected slots: virtual void loadSettings(); void devAddedChanged(int index); private: - Ui::LxQtMountConfiguration *ui; + Ui::Configuration *ui; }; #endif // LXQTMOUNTCONFIGURATION_H diff --git a/plugin-mount/lxqtmountconfiguration.ui b/plugin-mount/configuration.ui similarity index 82% rename from plugin-mount/lxqtmountconfiguration.ui rename to plugin-mount/configuration.ui index ae6a546..2deef8c 100644 --- a/plugin-mount/lxqtmountconfiguration.ui +++ b/plugin-mount/configuration.ui @@ -1,13 +1,13 @@ - LxQtMountConfiguration - + Configuration + 0 0 - 313 - 144 + 407 + 129 @@ -19,15 +19,15 @@ Behaviour - - + + - When a device is connected + When a device is connected : - + @@ -63,7 +63,7 @@ buttons accepted() - LxQtMountConfiguration + Configuration accept() @@ -79,7 +79,7 @@ buttons rejected() - LxQtMountConfiguration + Configuration reject() diff --git a/plugin-mount/lxqtmountplugin.cpp b/plugin-mount/lxqtmountplugin.cpp index 379ed03..263a15d 100644 --- a/plugin-mount/lxqtmountplugin.cpp +++ b/plugin-mount/lxqtmountplugin.cpp @@ -25,92 +25,60 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtmountplugin.h" -#include "lxqtmountconfiguration.h" -#include -#include "actions/deviceaction.h" -#include "popup.h" -#include "mountbutton.h" +#include "configuration.h" -#include +#include LxQtMountPlugin::LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), - mPopup(NULL), - mMountManager(NULL), - mDeviceAction(0) + mPopup(nullptr), + mDeviceAction(nullptr) { - mButton = new MountButton(); - connect(mButton, SIGNAL(clicked(bool)), SLOT(buttonClicked())); -} + mButton = new Button; + mPopup = new Popup(this); + connect(mButton, &QToolButton::clicked, mPopup, &Popup::showHide); + connect(mPopup, &Popup::visibilityChanged, mButton, &QToolButton::setDown); +} LxQtMountPlugin::~LxQtMountPlugin() { delete mButton; - delete mDeviceAction; -} - - -QWidget *LxQtMountPlugin::widget() -{ - return mButton; -} - - -void LxQtMountPlugin::realign() -{ - if(mPopup) - mPopup->hide(); + delete mPopup; } - QDialog *LxQtMountPlugin::configureDialog() { - if(mPopup) + if (mPopup) mPopup->hide(); - LxQtMountConfiguration *configWindow = new LxQtMountConfiguration(*settings()); + + Configuration *configWindow = new Configuration(*settings()); configWindow->setAttribute(Qt::WA_DeleteOnClose, true); return configWindow; } - -QIcon LxQtMountPlugin::icon() const +void LxQtMountPlugin::realign() { - return mButton->icon(); + //nothing to do } - void LxQtMountPlugin::settingsChanged() { - QString s = settings()->value("newDeviceAction").toString(); + QString s = settings()->value(QStringLiteral(CFG_KEY_ACTION)).toString(); DeviceAction::ActionId actionId = DeviceAction::stringToActionId(s, DeviceAction::ActionMenu); - delete mDeviceAction; - mDeviceAction = DeviceAction::create(actionId, this); - - if(mMountManager) + if (mDeviceAction == nullptr || mDeviceAction->Type() != actionId) { - connect(mMountManager, SIGNAL(deviceAdded(LxQt::MountDevice*)), - mDeviceAction, SLOT(deviceAdded(LxQt::MountDevice*))); + delete mDeviceAction; + mDeviceAction = DeviceAction::create(actionId, this); - connect(mMountManager, SIGNAL(deviceRemoved(LxQt::MountDevice*)), - mDeviceAction, SLOT(deviceRemoved(LxQt::MountDevice*))); - } -} - -void LxQtMountPlugin::buttonClicked() -{ - if(!mMountManager) - { - mMountManager = new LxQt::MountManager(this); - mPopup = new Popup(mMountManager, this, mButton); - settingsChanged(); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + mDeviceAction, &DeviceAction::onDeviceAdded); - connect(mPopup, SIGNAL(visibilityChanged(bool)), mButton, SLOT(setDown(bool))); - mMountManager->update(); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + mDeviceAction, &DeviceAction::onDeviceRemoved); } - mPopup->showHide(); + } diff --git a/plugin-mount/lxqtmountplugin.h b/plugin-mount/lxqtmountplugin.h index a2e66b5..66d8e1c 100644 --- a/plugin-mount/lxqtmountplugin.h +++ b/plugin-mount/lxqtmountplugin.h @@ -25,25 +25,21 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTMOUNTPLUGIN_H #define LXQTMOUNTPLUGIN_H #include "../panel/ilxqtpanelplugin.h" #include "../panel/lxqtpanel.h" +#include "button.h" +#include "popup.h" +#include "actions/deviceaction.h" -namespace LxQt { -class MountManager; -} - -class Popup; -class MountButton; -class DeviceAction; -class QIcon; +#include /*! \author Petr Vanek */ + class LxQtMountPlugin : public QObject, public ILxQtPanelPlugin { Q_OBJECT @@ -52,36 +48,34 @@ public: LxQtMountPlugin(const ILxQtPanelPluginStartupInfo &startupInfo); ~LxQtMountPlugin(); - virtual QWidget *widget(); - virtual QString themeId() const { return "LxQtMount"; } - virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } - void realign(); - QDialog *configureDialog(); + virtual QWidget *widget() { return mButton; } + virtual QString themeId() const { return QStringLiteral("LxQtMount"); } + virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; } - LxQt::MountManager *mountManager() const { return mMountManager; } Popup *popup() { return mPopup; } + QIcon icon() { return mButton->icon(); }; + QDialog *configureDialog(); - QIcon icon() const; +public slots: + void realign(); protected slots: virtual void settingsChanged(); - void buttonClicked(); private: - MountButton *mButton; + Button *mButton; Popup *mPopup; - LxQt::MountManager *mMountManager; DeviceAction *mDeviceAction; }; - class LxQtMountPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) + public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtMountPlugin(startupInfo); } diff --git a/plugin-mount/menudiskitem.cpp b/plugin-mount/menudiskitem.cpp index 7f1de72..3f70618 100644 --- a/plugin-mount/menudiskitem.cpp +++ b/plugin-mount/menudiskitem.cpp @@ -25,162 +25,155 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include #include "menudiskitem.h" -#include +#include "popup.h" + +#include +#include +#include +#include +#include #include +#include +#include +#include #include -#include -#include -#include -#include -/************************************************ - - ************************************************/ -MenuDiskItem::MenuDiskItem(LxQt::MountDevice *device, QWidget *parent): - QFrame(parent), - mDevice(device) +MenuDiskItem::MenuDiskItem(Solid::Device device, Popup *popup): + QFrame(popup), + mPopup(popup), + mDevice(device), + mDiskButton(nullptr), + mEjectButton(nullptr), + mDiskButtonClicked(false), + mEjectButtonClicked(false) { + Solid::StorageAccess * const iface = device.as(); + Q_ASSERT(nullptr != iface); + mDiskButton = new QToolButton(this); mDiskButton->setObjectName("DiskButton"); mDiskButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mDiskButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); - connect(mDiskButton, SIGNAL(clicked()), this, SLOT(diskButtonClicked())); + connect(mDiskButton, &QToolButton::clicked, this, &MenuDiskItem::diskButtonClicked); - mEjectButton = new QToolButton(this); + mEjectButton = new QToolButton(this); mEjectButton->setObjectName("EjectButton"); - connect(mEjectButton, SIGNAL(clicked()), this, SLOT(ejectButtonClicked())); + mEjectButton->setIcon(XdgIcon::fromTheme("media-eject")); + connect(mEjectButton, &QToolButton::clicked, this, &MenuDiskItem::ejectButtonClicked); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(mDiskButton); layout->addWidget(mEjectButton); - this->setLayout(layout); - layout->setMargin(0); layout->setSpacing(0); + setLayout(layout); - mEjectButton->setIcon(XdgIcon::fromTheme("media-eject")); + connect(iface, &Solid::StorageAccess::setupDone, this, &MenuDiskItem::onMounted); + connect(iface, &Solid::StorageAccess::teardownDone, this, &MenuDiskItem::onUnmounted); + connect(iface, &Solid::StorageAccess::accessibilityChanged, [this] (bool accessible, QString const &) { + updateMountStatus(); + }); - connect(device, SIGNAL(destroyed()), - this, SLOT(free())); - - connect(device, SIGNAL(changed()), - this, SLOT(update())); - - connect(device, SIGNAL(mounted()), - this, SLOT(mounted())); - - connect(device, SIGNAL(unmounted()), - this, SLOT(unmounted())); - - update(); + updateMountStatus(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::free() +MenuDiskItem::~MenuDiskItem() { - this->deleteLater(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::update() +void MenuDiskItem::setMountStatus(bool mounted) { - mDiskButton->setIcon(XdgIcon::fromTheme(QStringList() - << mDevice->iconName() - << "drive-removable-media-usb" - )); - - QString label = mDevice->label(); - mDiskButton->setText(label); - - setMountStatus(mDevice->isMounted()); + mEjectButton->setEnabled(mounted); } - -/************************************************ - - ************************************************/ -bool MenuDiskItem::isUsableDevice(const LxQt::MountDevice *device) +void MenuDiskItem::updateMountStatus() { - switch (device->mediaType()) - { - case LxQt::MountDevice::MediaTypeFdd: - return true; + static const QIcon icon = XdgIcon::fromTheme(mDevice.icon(), QStringLiteral("drive-removable-media")); - case LxQt::MountDevice::MediaTypeOptical: - return true; - break; - - case LxQt::MountDevice::MediaTypePartition: - case LxQt::MountDevice::MediaTypeDrive: - return device->isExternal(); - break; + if (mDevice.isValid()) + { + mDiskButton->setIcon(icon); + mDiskButton->setText(mDevice.description()); - default: - return false; + setMountStatus(mDevice.as()->isAccessible() || !opticalParent().udi().isEmpty()); } - - return false; + else + emit invalid(mDevice.udi()); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::setMountStatus(bool is_mount) +Solid::Device MenuDiskItem::opticalParent() const { - mEjectButton->setEnabled(is_mount); + Solid::Device it; + if (mDevice.isValid()) + { + it = mDevice; + // search for parent drive + for (; !it.udi().isEmpty(); it = it.parent()) + if (it.is()) + break; + } + return it; } - -/************************************************ - - ************************************************/ void MenuDiskItem::diskButtonClicked() { - if (!mDevice->isMounted()) - mDevice->mount(); + mDiskButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (!di->isAccessible()) + di->setup(); else - mounted(); - - qobject_cast(parent())->hide(); -} - + onMounted(Solid::NoError, QString(), mDevice.udi()); -/************************************************ - - ************************************************/ -void MenuDiskItem::mounted() -{ - QDesktopServices::openUrl(QUrl(mDevice->mountPath())); + mPopup->hide(); } - -/************************************************ - - ************************************************/ void MenuDiskItem::ejectButtonClicked() { - mDevice->unmount(); - setMountStatus(mDevice->isMounted()); + mEjectButtonClicked = true; + Solid::StorageAccess* di = mDevice.as(); + if (di->isAccessible()) + di->teardown(); + else + onUnmounted(Solid::NoError, QString(), mDevice.udi()); - qobject_cast(parent())->hide(); + mPopup->hide(); } - -/************************************************ - - ************************************************/ -void MenuDiskItem::unmounted() +void MenuDiskItem::onMounted(Solid::ErrorType error, QVariant resultData, const QString &udi) { - if (mDevice->isEjectable()) - mDevice->eject(); + if (mDiskButtonClicked) + { + mDiskButtonClicked = false; + + if (Solid::NoError == error) + QDesktopServices::openUrl(QUrl(mDevice.as()->filePath())); + else + { + QString errorMsg = tr("Mounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } } +void MenuDiskItem::onUnmounted(Solid::ErrorType error, QVariant resultData, const QString &udi) +{ + if (mEjectButtonClicked) + { + mEjectButtonClicked = false; + + if (Solid::NoError == error) + { + Solid::Device opt_parent = opticalParent(); + if (!opt_parent.udi().isEmpty()) + opt_parent.as()->eject(); + } + else + { + QString errorMsg = tr("Unmounting of \"%1\" failed: %2"); + errorMsg = errorMsg.arg(mDevice.description()).arg(resultData.toString()); + LxQt::Notification::notify(tr("Removable media/devices manager"), errorMsg, mDevice.icon()); + } + } +} diff --git a/plugin-mount/menudiskitem.h b/plugin-mount/menudiskitem.h index 6e059ee..ccd26e7 100644 --- a/plugin-mount/menudiskitem.h +++ b/plugin-mount/menudiskitem.h @@ -25,43 +25,52 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef MENUDISKITEM_H -#define MENUDISKITEM_H +#ifndef LXQT_PLUGIN_MOUNT_MENUDISKITEM_H +#define LXQT_PLUGIN_MOUNT_MENUDISKITEM_H #include +#include +#include +#include -namespace LxQt { -class MountDevice; -} - -class QToolButton; +class Popup; class MenuDiskItem : public QFrame { Q_OBJECT public: - explicit MenuDiskItem(LxQt::MountDevice *device, QWidget *parent); + explicit MenuDiskItem(Solid::Device device, Popup *popup); + ~MenuDiskItem(); - void setMountStatus(bool is_mount); + QString deviceUdi() const { return mDevice.udi(); } + void setMountStatus(bool mounted); - static bool isUsableDevice(const LxQt::MountDevice *device); +private: + void updateMountStatus(); + Solid::Device opticalParent() const; signals: - void error(const QString &msg); + void invalid(QString const & udi); private slots: - void ejectButtonClicked(); void diskButtonClicked(); - void update(); - void free(); - void mounted(); - void unmounted(); + void ejectButtonClicked(); + + void onMounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); + void onUnmounted(Solid::ErrorType error, + QVariant resultData, + const QString &udi); private: - LxQt::MountDevice *mDevice; + Popup *mPopup; + Solid::Device mDevice; QToolButton *mDiskButton; QToolButton *mEjectButton; + bool mDiskButtonClicked; + bool mEjectButtonClicked; }; #endif // MENUDISKITEM_H diff --git a/plugin-mount/popup.cpp b/plugin-mount/popup.cpp index 3bd7979..6a6b76e 100644 --- a/plugin-mount/popup.cpp +++ b/plugin-mount/popup.cpp @@ -26,21 +26,38 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include -#include -#include -#include -#include "menudiskitem.h" #include "popup.h" +#include "../panel/ilxqtpanelplugin.h" +#include +#include +#include +#include +#include +#include + +// Paulo: I'm not sure what this is for +static bool hasRemovableParent(Solid::Device device) +{ + // qDebug() << "acess:" << device.udi(); + for ( ; !device.udi().isEmpty(); device = device.parent()) + { + Solid::StorageDrive* drive = device.as(); + if (drive && drive->isRemovable()) + { + // qDebug() << "removable parent drive:" << device.udi(); + return true; + } + } + return false; +} -Popup::Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* parent): +Popup::Popup(ILxQtPanelPlugin * plugin, QWidget* parent): QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint), - mManager(manager), mPlugin(plugin), + mPlaceholder(nullptr), mDisplayCount(0) { - setObjectName("LxQtMountPopup"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setLayout(new QVBoxLayout(this)); @@ -48,96 +65,103 @@ Popup::Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* par setAttribute(Qt::WA_AlwaysShowToolTips); - connect(mManager, SIGNAL(deviceAdded(LxQt::MountDevice*)), - this, SLOT(addItem(LxQt::MountDevice*))); - connect(mManager, SIGNAL(deviceRemoved(LxQt::MountDevice*)), - this, SLOT(removeItem(LxQt::MountDevice*))); - mPlaceholder = new QLabel(tr("No devices are available"), this); mPlaceholder->setObjectName("NoDiskLabel"); layout()->addWidget(mPlaceholder); - mPlaceholder->hide(); - foreach(LxQt::MountDevice *device, mManager->devices()) - { - addItem(device); - } + //Perform the potential long time operation after object construction + //Note: can't use QTimer::singleShot with lambda in pre QT 5.4 code + QTimer * aux_timer = new QTimer; + connect(aux_timer, &QTimer::timeout, [this, aux_timer] + { + delete aux_timer; //cleanup + for (Solid::Device device : Solid::Device::listFromType(Solid::DeviceInterface::StorageAccess)) + if (hasRemovableParent(device)) + addItem(device); + }); + aux_timer->setSingleShot(true); + aux_timer->start(0); + + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, + this, &Popup::onDeviceAdded); + connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, + this, &Popup::onDeviceRemoved); } +void Popup::showHide() +{ + setVisible(isHidden()); +} -MenuDiskItem *Popup::addItem(LxQt::MountDevice *device) +void Popup::onDeviceAdded(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) - { - MenuDiskItem *item = new MenuDiskItem(device, this); - layout()->addWidget(item); - item->setVisible(true); - mDisplayCount++; - if (mDisplayCount != 0) - mPlaceholder->hide(); - - if (isVisible()) - realign(); - return item; - } - else - { - return 0; - } + Solid::Device device(udi); + if (device.is() && hasRemovableParent(device)) + addItem(device); } -void Popup::removeItem(LxQt::MountDevice *device) +void Popup::onDeviceRemoved(QString const & udi) { - if (MenuDiskItem::isUsableDevice(device)) + MenuDiskItem* item = nullptr; + const int size = layout()->count() - 1; + for (int i = size; 0 <= i; --i) { - mDisplayCount--; + QWidget *w = layout()->itemAt(i)->widget(); + if (w == mPlaceholder) + continue; + + MenuDiskItem *it = static_cast(w); + if (udi == it->deviceUdi()) + { + item = it; + break; + } + } + + if (item != nullptr) + { + layout()->removeWidget(item); + item->deleteLater(); + + --mDisplayCount; if (mDisplayCount == 0) mPlaceholder->show(); } } -void Popup::resizeEvent(QResizeEvent *event) -{ - QWidget::resizeEvent(event); - realign(); -} - - void Popup::showEvent(QShowEvent *event) { - if (mDisplayCount == 0) - mPlaceholder->show(); - + mPlaceholder->setVisible(mDisplayCount == 0); realign(); - - this->setFocus(); - this->activateWindow(); + setFocus(); + activateWindow(); QWidget::showEvent(event); emit visibilityChanged(true); } - void Popup::hideEvent(QHideEvent *event) { - mPlaceholder->hide(); - QWidget::hideEvent(event); emit visibilityChanged(false); } - -void Popup::realign() +void Popup::addItem(Solid::Device device) { - updateGeometry(); - adjustSize(); + MenuDiskItem *item = new MenuDiskItem(device, this); + connect(item, &MenuDiskItem::invalid, this, &Popup::onDeviceRemoved); + item->setVisible(true); + layout()->addWidget(item); - QRect rect = mPlugin->calculatePopupWindowPos(size()); - setGeometry(rect); -} + mDisplayCount++; + if (mDisplayCount != 0) + mPlaceholder->hide(); + if (isVisible()) + realign(); +} -void Popup::showHide() +void Popup::realign() { - setHidden(!isHidden()); + adjustSize(); + setGeometry(mPlugin->calculatePopupWindowPos(sizeHint())); } - diff --git a/plugin-mount/popup.h b/plugin-mount/popup.h index b6395f9..63dd098 100644 --- a/plugin-mount/popup.h +++ b/plugin-mount/popup.h @@ -26,48 +26,45 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#ifndef LXQT_PLUGIN_MOUNT_POPUP_H +#define LXQT_PLUGIN_MOUNT_POPUP_H -#ifndef POPUP_H -#define POPUP_H +#include "menudiskitem.h" +#include #include -#include "../panel/ilxqtpanelplugin.h" +#include -namespace LxQt { -class MountManager; -class MountDevice; -} - -class MenuDiskItem; -class QLabel; +class ILxQtPanelPlugin; class Popup: public QDialog { Q_OBJECT + public: - explicit Popup(LxQt::MountManager *manager, ILxQtPanelPlugin *plugin, QWidget* parent = 0); + explicit Popup(ILxQtPanelPlugin * plugin, QWidget* parent = 0); + void realign(); public slots: void showHide(); +private slots: + void onDeviceAdded(QString const & udi); + void onDeviceRemoved(QString const & udi); + signals: void visibilityChanged(bool visible); protected: - void resizeEvent(QResizeEvent *event); void showEvent(QShowEvent *event); void hideEvent(QHideEvent *event); -private slots: - MenuDiskItem *addItem(LxQt::MountDevice *device); - void removeItem(LxQt::MountDevice *device); - private: - void realign(); - LxQt::MountManager *mManager; - ILxQtPanelPlugin *mPlugin; + ILxQtPanelPlugin * mPlugin; QLabel *mPlaceholder; int mDisplayCount; + + void addItem(Solid::Device device); }; #endif // POPUP_H diff --git a/plugin-mount/translations/mount.ts b/plugin-mount/translations/mount.ts index 0f667ce..50d142b 100644 --- a/plugin-mount/translations/mount.ts +++ b/plugin-mount/translations/mount.ts @@ -2,68 +2,87 @@ - DeviceActionInfo - - - The device <b><nobr>"%1"</nobr></b> is connected. - - - - - The device <b><nobr>"%1"</nobr></b> is removed. - - + Button - + Removable media/devices manager - LxQtMountConfiguration + Configuration - + Removable Media Settings - + Behaviour - - When a device is connected + + When a device is connected : - + Popup menu - + Show info - + Do nothing - MountButton + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + + + + + The device <b><nobr>"%1"</nobr></b> is removed. + + + + + Removable media/devices manager + + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + + - + + Removable media/devices manager + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ar.ts b/plugin-mount/translations/mount_ar.ts index 51cab99..bcb7bf3 100644 --- a/plugin-mount/translations/mount_ar.ts +++ b/plugin-mount/translations/mount_ar.ts @@ -66,11 +66,27 @@ Click to eject this disc. اضغط ﻹخراج هذا القرص. + + + + Removable media/devices manager + مدير الوسائط واﻷقراص القابلة للفصل + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager مدير الوسائط واﻷقراص القابلة للفصل @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_cs.ts b/plugin-mount/translations/mount_cs.ts index a3b8abd..2fed6e0 100644 --- a/plugin-mount/translations/mount_cs.ts +++ b/plugin-mount/translations/mount_cs.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klepněte pro vysunutí tohoto disku. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správce odstranitelných nosičů/zařízení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_cs_CZ.ts b/plugin-mount/translations/mount_cs_CZ.ts index 36ad87f..95a721b 100644 --- a/plugin-mount/translations/mount_cs_CZ.ts +++ b/plugin-mount/translations/mount_cs_CZ.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klepněte pro vysunutí tohoto disku. + + + + Removable media/devices manager + Správce odstranitelných nosičů/zařízení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správce odstranitelných nosičů/zařízení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_da.ts b/plugin-mount/translations/mount_da.ts index 682f84a..f0a9538 100644 --- a/plugin-mount/translations/mount_da.ts +++ b/plugin-mount/translations/mount_da.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klik for at skubbe disken ud. + + + + Removable media/devices manager + Håndtering af medier/enheder + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Håndtering af medier/enheder @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_da_DK.ts b/plugin-mount/translations/mount_da_DK.ts index 1f0ddfc..0c71bcf 100644 --- a/plugin-mount/translations/mount_da_DK.ts +++ b/plugin-mount/translations/mount_da_DK.ts @@ -66,11 +66,27 @@ Click to eject this disc. Skub ud. + + + + Removable media/devices manager + Håndtering af flytbare medier + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Håndtering af flytbare medier @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_de.desktop b/plugin-mount/translations/mount_de.desktop index e187fcc..71a2208 100644 --- a/plugin-mount/translations/mount_de.desktop +++ b/plugin-mount/translations/mount_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Removable media -Comment=Easy mounting and unmounting of USB and optical drives. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Wechseldatenträger Verwaltung (USB, CD, DVD, ...) Name[de]=Wechseldatenträger +Comment[de]=Wechseldatenträgerverwaltung (USB, CD, DVD, ...) diff --git a/plugin-mount/translations/mount_de.ts b/plugin-mount/translations/mount_de.ts index 1ab39e9..335269f 100644 --- a/plugin-mount/translations/mount_de.ts +++ b/plugin-mount/translations/mount_de.ts @@ -2,97 +2,89 @@ - DeviceActionInfo + Button - - The device <b><nobr>"%1"</nobr></b> is connected. - Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. - - - - The device <b><nobr>"%1"</nobr></b> is removed. - Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. - - - + Removable media/devices manager - Entfernbare Medien-/Geräteverwaltung + Entfernbare Medien-/Geräteverwaltung - LxQtMountConfiguration - - LxQt Removable media manager settings - LxQt entfernbare Medienverwaltung-Einstellungen - + Configuration - + Removable Media Settings - + Entfernbare Medien - Einstellungen - + Behaviour Verhalten - - When a device is connected - Wenn ein Gerät verbunden wurde + + When a device is connected : + Wenn ein Gerät verbunden ist: - + Popup menu Aufklapp-Menü - + Show info - Zeige Informationen + Informationen anzeigen - + Do nothing Nichts tun - MenuDiskItem + DeviceActionInfo - Click to access this device from other applications. - Klicken, um auf dieses Gerät von anderen Anwendungen aus zuzugreifen. + + The device <b><nobr>"%1"</nobr></b> is connected. + Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. - Click to eject this disc. - Klicken, um diese CD auszuwerfen. + + The device <b><nobr>"%1"</nobr></b> is removed. + Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. - - - MountButton - + Removable media/devices manager Entfernbare Medien-/Geräteverwaltung + + + MenuDiskItem - The device <b><nobr>"%1"</nobr></b> is connected. - Das Gerät <b><nobr>"%1"</nobr></b> wurde verbunden. + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Das Einbinden von <b><nobr>"%1"</nobr></b> ist fehlgeschlagen: %2 - The device <b><nobr>"%1"</nobr></b> is removed. - Das Gerät <b><nobr>"%1"</nobr></b> wurde entfernt. + + + Removable media/devices manager + Entfernbare Medien-/Geräteverwaltung - No devices Available. - Kein Gerät verfügbar. + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Das Lösen von <strong><nobr>"%1"</nobr></strong> ist fehlgeschlagen: %2 Popup - + No devices are available - + Keine Geräte verfügbar diff --git a/plugin-mount/translations/mount_de_DE.desktop b/plugin-mount/translations/mount_de_DE.desktop deleted file mode 100644 index 26aad74..0000000 --- a/plugin-mount/translations/mount_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Removable media -Comment=Easy mounting and unmounting of USB and optical drives. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Wechseldatenträger (USB, CD, DVD, ...) -Name[de_DE]=Entfernbare Wechseldatenträger diff --git a/plugin-mount/translations/mount_de_DE.ts b/plugin-mount/translations/mount_de_DE.ts deleted file mode 100644 index 2c6c7e0..0000000 --- a/plugin-mount/translations/mount_de_DE.ts +++ /dev/null @@ -1,98 +0,0 @@ - - - - - DeviceActionInfo - - - The device <b><nobr>"%1"</nobr></b> is connected. - Der Datenträger <br><nobr>"%1"</nobr></br> ist verbunden. - - - - The device <b><nobr>"%1"</nobr></b> is removed. - Der Datenträger <b><nobr>"%1"</nobr></br> ist entfernt. - - - - Removable media/devices manager - Wechseldatenträger Manager - - - - LxQtMountConfiguration - - LxQt Removable media manager settings - LxQt-Wechseldatenträger-Verwalter Einstellungen - - - - Removable Media Settings - - - - - Behaviour - Verhalten - - - - When a device is connected - Wenn ein Datenträger angeschlossen ist - - - - Popup menu - Popup Menü - - - - Show info - Zeige Informationen - - - - Do nothing - Mach nichts - - - - MenuDiskItem - - Click to access this device from other applications. - Klicke um von anderen Anwendungen auf diesen Datenträger zugreifen zu können. - - - Click to eject this disc. - Klicke um den Datenträger auszuwerfen. - - - - MountButton - - - Removable media/devices manager - Wechseldatenträger Manager - - - The device <b><nobr>"%1"</nobr></b> is connected. - Der Datenträger <br><nobr>"%1"</nobr></br> ist verbunden. - - - The device <b><nobr>"%1"</nobr></b> is removed. - Der Datenträger <b><nobr>"%1"</nobr></br> ist entfernt. - - - No devices Available. - Kein Datenträger verfügbar. - - - - Popup - - - No devices are available - - - - diff --git a/plugin-mount/translations/mount_el_GR.ts b/plugin-mount/translations/mount_el_GR.ts index 4240eca..ffdc669 100644 --- a/plugin-mount/translations/mount_el_GR.ts +++ b/plugin-mount/translations/mount_el_GR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Κλίκ για εξαγωγή αυτού του δίσκου. + + + + Removable media/devices manager + Διαχειριστής αφαιρούμενων μέσων/συσκευών + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Διαχειριστής αφαιρούμενων μέσων/συσκευών @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_eo.ts b/plugin-mount/translations/mount_eo.ts index b693a41..df1448d 100644 --- a/plugin-mount/translations/mount_eo.ts +++ b/plugin-mount/translations/mount_eo.ts @@ -66,11 +66,27 @@ Click to eject this disc. Alklaku por elĵeti ĉi tiun diskon. + + + + Removable media/devices manager + Mastrumilo de demeteblaj aparatoj + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Mastrumilo de demeteblaj aparatoj @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es.ts b/plugin-mount/translations/mount_es.ts index d6ecda5..f934515 100644 --- a/plugin-mount/translations/mount_es.ts +++ b/plugin-mount/translations/mount_es.ts @@ -66,11 +66,27 @@ Click to eject this disc. Haga clic para expulsar este disco. + + + + Removable media/devices manager + Gestor de medios y dispositivos extraíbles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestor de medios y dispositivos extraíbles @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es_UY.ts b/plugin-mount/translations/mount_es_UY.ts index 2fb2bf5..9adc366 100644 --- a/plugin-mount/translations/mount_es_UY.ts +++ b/plugin-mount/translations/mount_es_UY.ts @@ -66,11 +66,27 @@ Click to eject this disc. Presione para expulsar este disco. + + + + Removable media/devices manager + Administrador de dispositivos desmontables + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrador de dispositivos desmontables @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_es_VE.ts b/plugin-mount/translations/mount_es_VE.ts index 1f6554a..cce1821 100644 --- a/plugin-mount/translations/mount_es_VE.ts +++ b/plugin-mount/translations/mount_es_VE.ts @@ -66,11 +66,27 @@ Click to eject this disc. Presione para expulsar este disco. + + + + Removable media/devices manager + Administrador de medios y dispositivos + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrador de medios y dispositivos @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_eu.ts b/plugin-mount/translations/mount_eu.ts index 6515b0e..7f5d9bc 100644 --- a/plugin-mount/translations/mount_eu.ts +++ b/plugin-mount/translations/mount_eu.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klikatu diskoa egozteko. + + + + Removable media/devices manager + Eduki/gailu aldagarrien kudeatzailea + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Eduki/gailu aldagarrien kudeatzailea @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_fi.ts b/plugin-mount/translations/mount_fi.ts index 22fe06d..d5c7403 100644 --- a/plugin-mount/translations/mount_fi.ts +++ b/plugin-mount/translations/mount_fi.ts @@ -66,11 +66,27 @@ Click to eject this disc. Napsauta poistaaksesi tämän levyn. + + + + Removable media/devices manager + Irrotettavien laitteiden ja levyjen hallinta + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Irrotettavien laitteiden ja levyjen hallinta @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_fr_FR.ts b/plugin-mount/translations/mount_fr_FR.ts index 5706bbf..9e34d71 100644 --- a/plugin-mount/translations/mount_fr_FR.ts +++ b/plugin-mount/translations/mount_fr_FR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Cliquez pour éjecter ce disque. + + + + Removable media/devices manager + Gestionnaire de médias/périphériques amovibles + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestionnaire de médias/périphériques amovibles @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_hr.ts b/plugin-mount/translations/mount_hr.ts new file mode 100644 index 0000000..395f717 --- /dev/null +++ b/plugin-mount/translations/mount_hr.ts @@ -0,0 +1,90 @@ + + + + + Button + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Configuration + + + Removable Media Settings + Postavke uklonjivih medija + + + + Behaviour + Ponašanje + + + + When a device is connected : + + + + + Popup menu + + + + + Show info + Pokaži info + + + + Do nothing + Ne čini ništa + + + + DeviceActionInfo + + + The device <b><nobr>"%1"</nobr></b> is connected. + Uređaj <b><nobr>"%1"</nobr></b> je spojen. + + + + The device <b><nobr>"%1"</nobr></b> is removed. + Uređaj <b><nobr>"%1"</nobr></b> je uklonjen. + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + MenuDiskItem + + + Mounting of <b><nobr>"%1"</nobr></b> failed: %2 + Montiranje <b><nobr>"%1"</nobr></b> nije uspjelo: %2 + + + + + Removable media/devices manager + Upravitelj uklonjivim medijima/uređajima + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + Odmontiranje <strong><nobr>"%1"</nobr></strong> nije uspjelo: %2 + + + + Popup + + + No devices are available + Nije dostupan nijedan uređaj + + + diff --git a/plugin-mount/translations/mount_hu.ts b/plugin-mount/translations/mount_hu.ts index 52d99b0..6915125 100644 --- a/plugin-mount/translations/mount_hu.ts +++ b/plugin-mount/translations/mount_hu.ts @@ -1,71 +1,114 @@ - + DeviceActionInfo The device <b><nobr>"%1"</nobr></b> is connected. - + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. Removable media/devices manager - + Cserélhetőeszköz-kezelő LxQtMountConfiguration + + LxQt Removable media manager settings + A LxQt cserélhetőeszköz-kezelő beállításai + Removable Media Settings - + Cserélhető eszközbeállítás Behaviour - + Működés When a device is connected - + Ha az eszköz csatlakoztatva van Popup menu - + Felugró menü Show info - + Információ megjelenítése Do nothing - + Ne tegyen semmit + + + + MenuDiskItem + + Click to access this device from other applications. + Kattintson az eszköz más alkalmazásokból való eléréséhez. + + + Click to eject this disc. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 MountButton - + Removable media/devices manager - + Cserélhetőeszköz-kezelő + + + The device <b><nobr>"%1"</nobr></b> is connected. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + + + The device <b><nobr>"%1"</nobr></b> is removed. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + + + No devices Available. + Nem érhetők el eszközök. Popup - + No devices are available - + Nincs elérhető eszköz diff --git a/plugin-mount/translations/mount_hu_HU.ts b/plugin-mount/translations/mount_hu_HU.ts index 84c8f3d..1c1eb09 100644 --- a/plugin-mount/translations/mount_hu_HU.ts +++ b/plugin-mount/translations/mount_hu_HU.ts @@ -1,34 +1,34 @@ - + DeviceActionInfo The device <b><nobr>"%1"</nobr></b> is connected. - A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. Removable media/devices manager - Cserélhetőeszköz-kezelő + Cserélhetőeszköz-kezelő LxQtMountConfiguration LxQt Removable media manager settings - A LxQt cserélhetőeszköz-kezelő beállításai + A LxQt cserélhetőeszköz-kezelő beállításai Removable Media Settings - + Cserélhető eszközbeállítás @@ -60,39 +60,55 @@ MenuDiskItem Click to access this device from other applications. - Kattintson az eszköz más alkalmazásokból való eléréséhez. + Kattintson az eszköz más alkalmazásokból való eléréséhez. Click to eject this disc. - Kattintson a lemez kiadásához. + Kattintson a lemez kiadásához. + + + + + Removable media/devices manager + Cserélhetőeszköz-kezelő + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> csatolása sikertelen: %2 + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + A <strong><nobr>"%1"</nobr></strong> lecsatolása sikertelen: %2 MountButton - + Removable media/devices manager Cserélhetőeszköz-kezelő The device <b><nobr>"%1"</nobr></b> is connected. - A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. + A(z) <b><nobr>„%1”</nobr></b> eszköz csatlakoztatva. The device <b><nobr>"%1"</nobr></b> is removed. - A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. + A(z) <b><nobr>„%1”</nobr></b> eszköz eltávolítva. No devices Available. - Nem érhetők el eszközök. + Nem érhetők el eszközök. Popup - + No devices are available - + Nincs elérhető eszköz diff --git a/plugin-mount/translations/mount_ia.ts b/plugin-mount/translations/mount_ia.ts index 1f569ee..110a061 100644 --- a/plugin-mount/translations/mount_ia.ts +++ b/plugin-mount/translations/mount_ia.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_id_ID.ts b/plugin-mount/translations/mount_id_ID.ts index ea71dc0..943bfd6 100644 --- a/plugin-mount/translations/mount_id_ID.ts +++ b/plugin-mount/translations/mount_id_ID.ts @@ -62,11 +62,27 @@ Click to eject this disc. Klik untuk mengeluarkan disk ini. + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager @@ -74,7 +90,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_it_IT.ts b/plugin-mount/translations/mount_it_IT.ts index 50ec821..88d590f 100644 --- a/plugin-mount/translations/mount_it_IT.ts +++ b/plugin-mount/translations/mount_it_IT.ts @@ -66,11 +66,27 @@ Click to eject this disc. Fai clic per espellere il disco. + + + + Removable media/devices manager + Gestore dei dispositivi rimovibili + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gestore dei dispositivi rimovibili @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ja.ts b/plugin-mount/translations/mount_ja.ts index 4ceebac..f62b4dc 100644 --- a/plugin-mount/translations/mount_ja.ts +++ b/plugin-mount/translations/mount_ja.ts @@ -52,10 +52,29 @@ 何もしない + + MenuDiskItem + + + + Removable media/devices manager + リムーバルメディア/デバイスの管理 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager リムーバルメディア/デバイスの管理 @@ -63,7 +82,7 @@ Popup - + No devices are available 接続可能なデバイスはありません diff --git a/plugin-mount/translations/mount_ko.ts b/plugin-mount/translations/mount_ko.ts index 016e1d2..7f8db3b 100644 --- a/plugin-mount/translations/mount_ko.ts +++ b/plugin-mount/translations/mount_ko.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_lt.ts b/plugin-mount/translations/mount_lt.ts index 20b705a..6855c3e 100644 --- a/plugin-mount/translations/mount_lt.ts +++ b/plugin-mount/translations/mount_lt.ts @@ -66,11 +66,27 @@ Click to eject this disc. Norėdami išstumti diską, spragtelėkite. + + + + Removable media/devices manager + Pašalinamų įrenginių tvarkytuvė + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Pašalinamų įrenginių tvarkytuvė @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_nl.ts b/plugin-mount/translations/mount_nl.ts index 3fed200..5f2db72 100644 --- a/plugin-mount/translations/mount_nl.ts +++ b/plugin-mount/translations/mount_nl.ts @@ -66,11 +66,27 @@ Click to eject this disc. Klik om deze schijf uit te werpen. + + + + Removable media/devices manager + Beheerder van verwijderbare media/apparaten + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Beheerder van verwijderbare media/apparaten @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_pl_PL.ts b/plugin-mount/translations/mount_pl_PL.ts index 8119b92..5154fbc 100644 --- a/plugin-mount/translations/mount_pl_PL.ts +++ b/plugin-mount/translations/mount_pl_PL.ts @@ -6,17 +6,17 @@ The device <b><nobr>"%1"</nobr></b> is connected. - Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. + Nośnik <b><nobr>"%1"</nobr></b> jest podłączony. The device <b><nobr>"%1"</nobr></b> is removed. - Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. + Nośnik <b><nobr>"%1"</nobr></b> jest odłączony. Removable media/devices manager - Menedżer nośników wymiennych + Menedżer nośników wymiennych @@ -28,7 +28,7 @@ Removable Media Settings - + Ustawienia nośników wymiennych @@ -66,11 +66,27 @@ Click to eject this disc. Kliknij aby wysunąć ten dysk. + + + + Removable media/devices manager + Menedżer nośników wymiennych + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Menedżer nośników wymiennych @@ -90,9 +106,9 @@ Popup - + No devices are available - + Brak dostępnych urządzeń diff --git a/plugin-mount/translations/mount_pt.ts b/plugin-mount/translations/mount_pt.ts index 6c2ef05..9e96135 100644 --- a/plugin-mount/translations/mount_pt.ts +++ b/plugin-mount/translations/mount_pt.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clique para ejetar este disco. + + + + Removable media/devices manager + Gestor de discos e unidades amovíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + +
MountButton - + Removable media/devices manager Gestor de discos e unidades amovíveis @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_pt_BR.ts b/plugin-mount/translations/mount_pt_BR.ts index ca1cb04..d886a6d 100644 --- a/plugin-mount/translations/mount_pt_BR.ts +++ b/plugin-mount/translations/mount_pt_BR.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clique para ejetar este disco. + + + + Removable media/devices manager + Gerenciador de dispositivos/mídias removíveis + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Gerenciador de dispositivos/mídias removíveis @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ro_RO.ts b/plugin-mount/translations/mount_ro_RO.ts index dc7e5b7..b7fcad5 100644 --- a/plugin-mount/translations/mount_ro_RO.ts +++ b/plugin-mount/translations/mount_ro_RO.ts @@ -66,11 +66,27 @@ Click to eject this disc. Clic pentru a scoate acest disc. + + + + Removable media/devices manager + Administrator medii/dispozitive detașabile + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Administrator medii/dispozitive detașabile @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_ru.ts b/plugin-mount/translations/mount_ru.ts index 6ef7a60..836576d 100644 --- a/plugin-mount/translations/mount_ru.ts +++ b/plugin-mount/translations/mount_ru.ts @@ -52,10 +52,29 @@ Ничего не делать + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager Диспетчер съёмных медиа/устройств @@ -63,7 +82,7 @@ Popup - + No devices are available Нет доступных устройств diff --git a/plugin-mount/translations/mount_ru_RU.ts b/plugin-mount/translations/mount_ru_RU.ts index d7b461b..f6e59b4 100644 --- a/plugin-mount/translations/mount_ru_RU.ts +++ b/plugin-mount/translations/mount_ru_RU.ts @@ -52,10 +52,29 @@ Ничего не делать + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager Диспетчер съёмных медиа/устройств @@ -63,7 +82,7 @@ Popup - + No devices are available Нет доступных устройств diff --git a/plugin-mount/translations/mount_sk_SK.ts b/plugin-mount/translations/mount_sk_SK.ts index 16dfee4..742c1e6 100644 --- a/plugin-mount/translations/mount_sk_SK.ts +++ b/plugin-mount/translations/mount_sk_SK.ts @@ -66,11 +66,27 @@ Click to eject this disc. Kliknutím vysuniete tento disk. + + + + Removable media/devices manager + Správca prenosných médií a zariadení + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Správca prenosných médií a zariadení @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sl.ts b/plugin-mount/translations/mount_sl.ts index 411d01b..d325a6d 100644 --- a/plugin-mount/translations/mount_sl.ts +++ b/plugin-mount/translations/mount_sl.ts @@ -66,11 +66,27 @@ Click to eject this disc. Kliknite za izmet diska. + + + + Removable media/devices manager + Upravljalnik odstranljivih nosilcev/naprav + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Upravljalnik odstranljivih nosilcev/naprav @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr@latin.ts b/plugin-mount/translations/mount_sr@latin.ts index 7d26182..950b4ea 100644 --- a/plugin-mount/translations/mount_sr@latin.ts +++ b/plugin-mount/translations/mount_sr@latin.ts @@ -52,10 +52,29 @@ + + MenuDiskItem + + + + Removable media/devices manager + + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + MountButton - + Removable media/devices manager @@ -63,7 +82,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr_BA.ts b/plugin-mount/translations/mount_sr_BA.ts index 5398c9b..1d05e04 100644 --- a/plugin-mount/translations/mount_sr_BA.ts +++ b/plugin-mount/translations/mount_sr_BA.ts @@ -66,11 +66,27 @@ Click to eject this disc. Кликните да избаците диск. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Менаџер уклоњивих медија/уређаја @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_sr_RS.ts b/plugin-mount/translations/mount_sr_RS.ts index 5398c9b..1d05e04 100644 --- a/plugin-mount/translations/mount_sr_RS.ts +++ b/plugin-mount/translations/mount_sr_RS.ts @@ -66,11 +66,27 @@ Click to eject this disc. Кликните да избаците диск. + + + + Removable media/devices manager + Менаџер уклоњивих медија/уређаја + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Менаџер уклоњивих медија/уређаја @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_th_TH.ts b/plugin-mount/translations/mount_th_TH.ts index 0b728a3..00cb276 100644 --- a/plugin-mount/translations/mount_th_TH.ts +++ b/plugin-mount/translations/mount_th_TH.ts @@ -66,11 +66,27 @@ Click to eject this disc. คลิกเพื่อดันแผ่นดิสก์ออก + + + + Removable media/devices manager + ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager ตัดจัดการสื่อ/อุปกรณ์แบบถอดเสียบ @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_tr.ts b/plugin-mount/translations/mount_tr.ts index ba10fde..bae5385 100644 --- a/plugin-mount/translations/mount_tr.ts +++ b/plugin-mount/translations/mount_tr.ts @@ -66,11 +66,27 @@ Click to eject this disc. Bu diski çıkartmak için tıklayın. + + + + Removable media/devices manager + Çıkarılabilir ortam/aygıt yönetici + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Çıkarılabilir ortam/aygıt yönetici @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_uk.ts b/plugin-mount/translations/mount_uk.ts index bd50448..3838030 100644 --- a/plugin-mount/translations/mount_uk.ts +++ b/plugin-mount/translations/mount_uk.ts @@ -66,11 +66,27 @@ Click to eject this disc. Натисніть, щоб витягти диск. + + + + Removable media/devices manager + Керування знімними носіями + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager Керування знімними носіями @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_zh_CN.ts b/plugin-mount/translations/mount_zh_CN.ts index d5ccd0b..e01eac9 100644 --- a/plugin-mount/translations/mount_zh_CN.ts +++ b/plugin-mount/translations/mount_zh_CN.ts @@ -66,11 +66,27 @@ Click to eject this disc. 点击以弹出该存储卷。 + + + + Removable media/devices manager + 可移动存储设备管理器 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager 可移动存储设备管理器 @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-mount/translations/mount_zh_TW.ts b/plugin-mount/translations/mount_zh_TW.ts index 0fa80bd..81bf339 100644 --- a/plugin-mount/translations/mount_zh_TW.ts +++ b/plugin-mount/translations/mount_zh_TW.ts @@ -66,11 +66,27 @@ Click to eject this disc. 點擊以退出此磁片。 + + + + Removable media/devices manager + 可卸除式裝置管理員 + + + + Mounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + + + + Unmounting of <strong><nobr>"%1"</nobr></strong> failed: %2 + + MountButton - + Removable media/devices manager 可卸除式裝置管理員 @@ -90,7 +106,7 @@ Popup - + No devices are available diff --git a/plugin-networkmonitor/CMakeLists.txt b/plugin-networkmonitor/CMakeLists.txt index 6357384..f83b32f 100644 --- a/plugin-networkmonitor/CMakeLists.txt +++ b/plugin-networkmonitor/CMakeLists.txt @@ -12,12 +12,6 @@ set(SOURCES lxqtnetworkmonitorconfiguration.cpp ) -set(MOCS - lxqtnetworkmonitorplugin.h - lxqtnetworkmonitor.h - lxqtnetworkmonitorconfiguration.h -) - set(UIS lxqtnetworkmonitorconfiguration.ui ) diff --git a/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp b/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp index 77c2d00..ef73086 100644 --- a/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp +++ b/plugin-networkmonitor/lxqtnetworkmonitorplugin.cpp @@ -49,7 +49,7 @@ QWidget *LxQtNetworkMonitorPlugin::widget() QDialog *LxQtNetworkMonitorPlugin::configureDialog() { - return new LxQtNetworkMonitorConfiguration(settings(), mWidget); + return new LxQtNetworkMonitorConfiguration(settings()); } void LxQtNetworkMonitorPlugin::settingsChanged() diff --git a/plugin-networkmonitor/lxqtnetworkmonitorplugin.h b/plugin-networkmonitor/lxqtnetworkmonitorplugin.h index ff61eab..3441d60 100644 --- a/plugin-networkmonitor/lxqtnetworkmonitorplugin.h +++ b/plugin-networkmonitor/lxqtnetworkmonitorplugin.h @@ -62,7 +62,7 @@ class LxQtNetworkMonitorPluginLibrary: public QObject, public ILxQtPanelPluginLi Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtNetworkMonitorPlugin(startupInfo); } diff --git a/plugin-networkmonitor/translations/networkmonitor_ar.desktop b/plugin-networkmonitor/translations/networkmonitor_ar.desktop deleted file mode 100644 index a601163..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_ar.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[ar]=قائمة التطبيقات -Name[ar]=تهيئة وحدة جلسة ريزركيوت diff --git a/plugin-networkmonitor/translations/networkmonitor_ar.ts b/plugin-networkmonitor/translations/networkmonitor_ar.ts deleted file mode 100644 index 89c67af..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_ar.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - العامّ - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_cs.desktop b/plugin-networkmonitor/translations/networkmonitor_cs.desktop index 12596b2..4f23ddf 100644 --- a/plugin-networkmonitor/translations/networkmonitor_cs.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_cs.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[cs]=Nabídka -Name[cs]=Hlavní nabídka +Name[cs]=Monitor sítě +Comment[cs]=Zobrazuje stav a aktivity sítě diff --git a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop b/plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop deleted file mode 100644 index f07fba7..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[cs_CZ]=Nastavení LxQtu -Name[cs_CZ]=Nastavit moduly LXDE-Qt diff --git a/plugin-networkmonitor/translations/networkmonitor_da_DK.ts b/plugin-networkmonitor/translations/networkmonitor_da.ts similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_da_DK.ts rename to plugin-networkmonitor/translations/networkmonitor_da.ts diff --git a/plugin-networkmonitor/translations/networkmonitor_da_DK.desktop b/plugin-networkmonitor/translations/networkmonitor_da_DK.desktop deleted file mode 100644 index 0ccac82..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_da_DK.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[da_DK]=Netværksovervågning -Name[da_DK]=Netværksovervågning diff --git a/plugin-networkmonitor/translations/networkmonitor_de.desktop b/plugin-networkmonitor/translations/networkmonitor_de.desktop index d9dc91a..ba549f3 100644 --- a/plugin-networkmonitor/translations/networkmonitor_de.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_de.desktop @@ -1,10 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - -# Translations -Name[de]=Netzwerk Monitor +Name[de]=Netzwerkmonitor Comment[de]=Informationen zu Status und Aktivität des Netzwerks diff --git a/plugin-networkmonitor/translations/networkmonitor_de.ts b/plugin-networkmonitor/translations/networkmonitor_de.ts index 9b69205..a128522 100644 --- a/plugin-networkmonitor/translations/networkmonitor_de.ts +++ b/plugin-networkmonitor/translations/networkmonitor_de.ts @@ -51,14 +51,10 @@ LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - LxQt Netzwerkmonitor Einstellungen - Network Monitor settings - + Netzwerkmonitor-Einstellungen @@ -78,7 +74,7 @@ Monitor - Monitor + Bildschirm @@ -88,7 +84,7 @@ Wireless - drahtlos + Drahtlos diff --git a/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop b/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop deleted file mode 100644 index d9dc91a..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_de_DE.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - -# Translations -Name[de]=Netzwerk Monitor -Comment[de]=Informationen zu Status und Aktivität des Netzwerks diff --git a/plugin-networkmonitor/translations/networkmonitor_de_DE.ts b/plugin-networkmonitor/translations/networkmonitor_de_DE.ts deleted file mode 100644 index 602c7b3..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_de_DE.ts +++ /dev/null @@ -1,99 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - Netzwerk Schnittstelle <b>%1</b> - - - - Transmitted %1 - Gesendet %1 - - - - Received %1 - Empfangen %1 - - - - B - B - - - - KiB - KiB - - - - MiB - MiB - - - - GiB - GiB - - - - TiB - TiB - - - - PiB - PiB - - - - LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - LxQt Netzwerk Monitor Einstellungen - - - - Network Monitor settings - - - - - General - Allgemein - - - - Interface - Schnittstelle - - - - Modem - Modem - - - - Monitor - Monitor - - - - Network - Netzwerk - - - - Wireless - Drahtlos - - - - Icon - Icon - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_el_GR.desktop b/plugin-networkmonitor/translations/networkmonitor_el.desktop similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_el_GR.desktop rename to plugin-networkmonitor/translations/networkmonitor_el.desktop diff --git a/plugin-networkmonitor/translations/networkmonitor_el_GR.ts b/plugin-networkmonitor/translations/networkmonitor_el.ts similarity index 100% rename from plugin-networkmonitor/translations/networkmonitor_el_GR.ts rename to plugin-networkmonitor/translations/networkmonitor_el.ts diff --git a/plugin-networkmonitor/translations/networkmonitor_eo.desktop b/plugin-networkmonitor/translations/networkmonitor_eo.desktop index fe7f8d8..36c540d 100644 --- a/plugin-networkmonitor/translations/networkmonitor_eo.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_eo.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[eo]=Agordoj de muso por LxQto -Name[eo]=Agordi X11-muson +Name[eo]=Ret-observilo +Comment[eo]=Elmontras ret-staton kaj -aktivecon diff --git a/plugin-networkmonitor/translations/networkmonitor_eo.ts b/plugin-networkmonitor/translations/networkmonitor_eo.ts index 2713b62..a6fc9fa 100644 --- a/plugin-networkmonitor/translations/networkmonitor_eo.ts +++ b/plugin-networkmonitor/translations/networkmonitor_eo.ts @@ -1,95 +1,95 @@ - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Ĝenerala - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - + + LxQtNetworkMonitor + + + Network interface <b>%1</b> + Reta interfaco <b>%1</b> + + + + Transmitted %1 + Sendita %1 + + + + Received %1 + Ricevita %1 + + + + B + B + + + + KiB + KiB + + + + MiB + MiB + + + + GiB + GiB + + + + TiB + TiB + + + + PiB + PiB + + + + LxQtNetworkMonitorConfiguration + + + Network Monitor settings + Agordoj por ret-observilo + + + + General + Ĝenerala + + + + Interface + Interfaco + + + + Modem + Modemo + + + + Monitor + Observilo + + + + Network + Reto + + + + Wireless + Sendrata + + + + Icon + Bildsimbolo + + diff --git a/plugin-networkmonitor/translations/networkmonitor_es.desktop b/plugin-networkmonitor/translations/networkmonitor_es.desktop index bbc4755..5352d05 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_es.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[es]=Administrador de tareas -Name[es]=Entorno de escritorio Qt4 +Comment[es]=Despliega el estado y actividades de la red. +Name[es]=Monitor de redes diff --git a/plugin-networkmonitor/translations/networkmonitor_es.ts b/plugin-networkmonitor/translations/networkmonitor_es.ts index 034b630..6e06b39 100644 --- a/plugin-networkmonitor/translations/networkmonitor_es.ts +++ b/plugin-networkmonitor/translations/networkmonitor_es.ts @@ -53,12 +53,12 @@ LxQtNetworkMonitorConfiguration LxQt Network Monitor settings - Opciones del Monitor de Redes de LxQt + Configuración del monitor de redes de LxQt Network Monitor settings - + Configuración del monitor de redes @@ -73,7 +73,7 @@ Modem - Modem + Módem @@ -88,7 +88,7 @@ Wireless - Inalámbrico + Conexión inalámbrica diff --git a/plugin-networkmonitor/translations/networkmonitor_es_VE.desktop b/plugin-networkmonitor/translations/networkmonitor_es_VE.desktop deleted file mode 100644 index 7fe4c8e..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_es_VE.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[es_VE]=Monitor de red -Name[es_VE]=Monitor de red diff --git a/plugin-networkmonitor/translations/networkmonitor_es_VE.ts b/plugin-networkmonitor/translations/networkmonitor_es_VE.ts deleted file mode 100644 index 072a71a..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_es_VE.ts +++ /dev/null @@ -1,99 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - interfaz de red <b>%1</b> - - - - Transmitted %1 - Transmitido %1 - - - - Received %1 - Recivido %1 - - - - B - B - - - - KiB - KiB - - - - MiB - MiB - - - - GiB - GiB - - - - TiB - TiB - - - - PiB - PiB - - - - LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - Preferencias de LxQt Monitores de red - - - - Network Monitor settings - - - - - General - General - - - - Interface - Interface - - - - Modem - Modem - - - - Monitor - Monitor - - - - Network - Red - - - - Wireless - Wireless - - - - Icon - Icono - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_fr.desktop b/plugin-networkmonitor/translations/networkmonitor_fr.desktop new file mode 100644 index 0000000..5d2d242 --- /dev/null +++ b/plugin-networkmonitor/translations/networkmonitor_fr.desktop @@ -0,0 +1,3 @@ +# Translations +Name[fr_FR]=Moniteur Réseau +Comment[fr_FR]=Affiche le statut et l'activité du réseau diff --git a/plugin-networkmonitor/translations/networkmonitor_fr_FR.ts b/plugin-networkmonitor/translations/networkmonitor_fr.ts similarity index 75% rename from plugin-networkmonitor/translations/networkmonitor_fr_FR.ts rename to plugin-networkmonitor/translations/networkmonitor_fr.ts index 6df90db..3171548 100644 --- a/plugin-networkmonitor/translations/networkmonitor_fr_FR.ts +++ b/plugin-networkmonitor/translations/networkmonitor_fr.ts @@ -6,47 +6,47 @@ Network interface <b>%1</b> - + Interface réseau <b>%1</b> Transmitted %1 - + Transmis %1 Received %1 - + Reçu %1 B - + o KiB - + Ko MiB - + Mo GiB - + Go TiB - + To PiB - + Po @@ -54,7 +54,7 @@ Network Monitor settings - + Paramètres du moniteur réseau @@ -64,32 +64,32 @@ Interface - + Interface Modem - + Modem Monitor - + Moniteur Network - + Réseau Wireless - + Sans-Fil Icon - + Icône diff --git a/plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop b/plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop deleted file mode 100644 index 984118b..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_fr_FR.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[fr_FR]=Bloc-notes -Name[fr_FR]=Bloc-notes de l'écran diff --git a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts b/plugin-networkmonitor/translations/networkmonitor_hr.ts similarity index 71% rename from plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts rename to plugin-networkmonitor/translations/networkmonitor_hr.ts index a5213ba..e0bd49b 100644 --- a/plugin-networkmonitor/translations/networkmonitor_cs_CZ.ts +++ b/plugin-networkmonitor/translations/networkmonitor_hr.ts @@ -1,99 +1,95 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - Síťové rozhraní <b>%1</b> + Mrežno sučelje <b>%1</b> Transmitted %1 - Přeneseno %1 + Received %1 - Přijato %1 + Primljeno %1 B - B + B KiB - KiB + KiB MiB - MiB + MiB GiB - GiB + GiB TiB - TiB + TiB PiB - PiB + PiB LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - Nastavení sledování sítě - Network Monitor settings - + Postavke nadzora mreže General - Obecné + Općenito Interface - Rozhraní + Sučelje Modem - Modem + Modem Monitor - Sledování + Nadzor Network - Síť + Mreža Wireless - Bezdrátové + Bežično Icon - Ikona + Ikona diff --git a/plugin-networkmonitor/translations/networkmonitor_hu.desktop b/plugin-networkmonitor/translations/networkmonitor_hu.desktop index 06bf911..694cf7f 100644 --- a/plugin-networkmonitor/translations/networkmonitor_hu.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_hu.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[hu]=Alkalmazásmenü Name[hu]=Alkalmazásindító alapú menü +Comment[hu]=Alkalmazásmenü diff --git a/plugin-networkmonitor/translations/networkmonitor_sl.ts b/plugin-networkmonitor/translations/networkmonitor_hu.ts similarity index 78% rename from plugin-networkmonitor/translations/networkmonitor_sl.ts rename to plugin-networkmonitor/translations/networkmonitor_hu.ts index 53a37e1..b910bf5 100644 --- a/plugin-networkmonitor/translations/networkmonitor_sl.ts +++ b/plugin-networkmonitor/translations/networkmonitor_hu.ts @@ -1,22 +1,22 @@ - + LxQtNetworkMonitor Network interface <b>%1</b> - Omrežni vmesnik <b>%1</b> + Hálózati eszköz <b>%1</b> Transmitted %1 - Poslano: %1 + Küldött %1 Received %1 - Prejeto: %1 + Fogadott %1 @@ -41,59 +41,55 @@ TiB - TiB + Tib PiB - PiB + Pib LxQtNetworkMonitorConfiguration - - LxQt Network Monitor settings - Nastavitve nadzornika omrežja LXQt - Network Monitor settings - + Hálózatfigyelő beállítás General - Splošno + Általános Interface - Vmesnik + Eszköz Modem - Modem + Monitor - Zaslon + Network - Omrežje + Hálózat Wireless - Brezžično + Icon - Ikona + Ikon diff --git a/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts b/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts deleted file mode 100644 index 5573391..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_hu_HU.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Általános - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_id_ID.desktop b/plugin-networkmonitor/translations/networkmonitor_id_ID.desktop deleted file mode 100644 index 9674b64..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_id_ID.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[id_ID]=Hell World -Name[id_ID]=Sebuah Plugin "hello world". diff --git a/plugin-networkmonitor/translations/networkmonitor_it.desktop b/plugin-networkmonitor/translations/networkmonitor_it.desktop index 51106c2..d3e6e88 100644 --- a/plugin-networkmonitor/translations/networkmonitor_it.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_it.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[it]=Centro di Configurazione LxQt -Name[it]=Configura moduli di LXDE-Qt +Name[it]=Monitor di rete +Comment[it]=Mostra stato e attività della rete diff --git a/plugin-networkmonitor/translations/networkmonitor_it_IT.ts b/plugin-networkmonitor/translations/networkmonitor_it.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_it_IT.ts rename to plugin-networkmonitor/translations/networkmonitor_it.ts index c4e7ee6..90dfa3a 100644 --- a/plugin-networkmonitor/translations/networkmonitor_it_IT.ts +++ b/plugin-networkmonitor/translations/networkmonitor_it.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Impostazioni del monitor di rete diff --git a/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop b/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop deleted file mode 100644 index b41c335..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_it_IT.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[it_IT]=Esci -Name[it_IT]=Permette di passare ad altri desktop virtuali diff --git a/plugin-networkmonitor/translations/networkmonitor_lt.desktop b/plugin-networkmonitor/translations/networkmonitor_lt.desktop deleted file mode 100644 index c04f905..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_lt.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[lt]=Qlipper -Name[lt]="Sveikas pasauli" priedas diff --git a/plugin-networkmonitor/translations/networkmonitor_lt.ts b/plugin-networkmonitor/translations/networkmonitor_lt.ts deleted file mode 100644 index 482d885..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_lt.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - - - - - Transmitted %1 - - - - - Received %1 - - - - - B - - - - - KiB - - - - - MiB - - - - - GiB - - - - - TiB - - - - - PiB - - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - - - - - General - Pagrindinės - - - - Interface - - - - - Modem - - - - - Monitor - - - - - Network - - - - - Wireless - - - - - Icon - - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_nl.desktop b/plugin-networkmonitor/translations/networkmonitor_nl.desktop index 19787ef..a53f431 100644 --- a/plugin-networkmonitor/translations/networkmonitor_nl.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_nl.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[nl]=Notepad -Name[nl]=Scherm notepad +Name[nl]=Netwerkmonitor +Comment[nl]=Toont netwerkstatus en -activiteit diff --git a/plugin-networkmonitor/translations/networkmonitor_nl.ts b/plugin-networkmonitor/translations/networkmonitor_nl.ts index 243ae1b..da59450 100644 --- a/plugin-networkmonitor/translations/networkmonitor_nl.ts +++ b/plugin-networkmonitor/translations/networkmonitor_nl.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Netwerkmonitorinstellingen diff --git a/plugin-networkmonitor/translations/networkmonitor_pl.desktop b/plugin-networkmonitor/translations/networkmonitor_pl.desktop index c49b4e0..90348bf 100644 --- a/plugin-networkmonitor/translations/networkmonitor_pl.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_pl.desktop @@ -1,13 +1,10 @@ [Desktop Entry] Type=Service -ServiceTypes=LxQtPanel/Plugin +ServiceTypes=LXQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[pl]=Menu -Name[pl]=Główne menu +Name[pl]=monitor sieci +Comment[pl]=pokazuje stan i aktywność sieci. diff --git a/plugin-networkmonitor/translations/networkmonitor_pl_PL.ts b/plugin-networkmonitor/translations/networkmonitor_pl.ts similarity index 98% rename from plugin-networkmonitor/translations/networkmonitor_pl_PL.ts rename to plugin-networkmonitor/translations/networkmonitor_pl.ts index 073b64d..e402658 100644 --- a/plugin-networkmonitor/translations/networkmonitor_pl_PL.ts +++ b/plugin-networkmonitor/translations/networkmonitor_pl.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Ustawienia monitora sieci diff --git a/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop b/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop deleted file mode 100644 index 69163be..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_pl_PL.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[pl_PL]=Konfiguracja wyglądu LxQt -Name[pl_PL]=Środowisko graficzne Qt4 diff --git a/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop b/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop index 88e7a69..d98d904 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_ro_RO.desktop @@ -9,5 +9,5 @@ Comment=Displays network status and activity. # Translations -Comment[ro_RO]=Părăsește -Name[ro_RO]=Lansează aplicațiile favorite +Comment[ro_RO]=Afisează starea și activitatea rețelei +Name[ro_RO]=Monitor rețea diff --git a/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts b/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts index b333af7..e3d019f 100644 --- a/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts +++ b/plugin-networkmonitor/translations/networkmonitor_ro_RO.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Setări monitorizare rețea diff --git a/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop b/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop deleted file mode 100644 index 5e052b9..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_ru_RU.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[ru_RU]=Отображает сетевой статус и активность. -Name[ru_RU]=Сетевой Монитор \ No newline at end of file diff --git a/plugin-networkmonitor/translations/networkmonitor_ru_RU.ts b/plugin-networkmonitor/translations/networkmonitor_ru_RU.ts deleted file mode 100644 index 070c0d0..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_ru_RU.ts +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LxQtNetworkMonitor - - - Network interface <b>%1</b> - Сетевой интерфейс <b>%1</b> - - - - Transmitted %1 - Передано %1 - - - - Received %1 - Получено %1 - - - - B - Б - - - - KiB - Кб - - - - MiB - Мб - - - - GiB - Гб - - - - TiB - Тб - - - - PiB - Пб - - - - LxQtNetworkMonitorConfiguration - - - Network Monitor settings - Настройки сетевого монитора - - - - General - Общие - - - - Interface - Интерфейс - - - - Modem - Модем - - - - Monitor - Монитор - - - - Network - Сеть - - - - Wireless - Беспроводная сеть - - - - Icon - Значок - - - diff --git a/plugin-networkmonitor/translations/networkmonitor_sl.desktop b/plugin-networkmonitor/translations/networkmonitor_sl.desktop deleted file mode 100644 index 510b1b9..0000000 --- a/plugin-networkmonitor/translations/networkmonitor_sl.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin - -Name=Network monitor -Comment=Displays network status and activity. - - - - -# Translations -Comment[sl]=Nadzornik omrežja -Name[sl]=Nadzornik omrežja diff --git a/plugin-networkmonitor/translations/networkmonitor_tr.desktop b/plugin-networkmonitor/translations/networkmonitor_tr.desktop index 66e7f8e..db2f801 100644 --- a/plugin-networkmonitor/translations/networkmonitor_tr.desktop +++ b/plugin-networkmonitor/translations/networkmonitor_tr.desktop @@ -5,9 +5,6 @@ ServiceTypes=LxQtPanel/Plugin Name=Network monitor Comment=Displays network status and activity. - - - # Translations -Comment[tr]=Not Defteri -Name[tr]=Ekran not defteri +Name[tr]=Ağ izleme +Comment[tr]=Ağ iletişimi izleme ve yönetme diff --git a/plugin-networkmonitor/translations/networkmonitor_tr.ts b/plugin-networkmonitor/translations/networkmonitor_tr.ts index 758a3ab..903d363 100644 --- a/plugin-networkmonitor/translations/networkmonitor_tr.ts +++ b/plugin-networkmonitor/translations/networkmonitor_tr.ts @@ -58,7 +58,7 @@ Network Monitor settings - + Ağ İzleme Ayarları diff --git a/plugin-quicklaunch/CMakeLists.txt b/plugin-quicklaunch/CMakeLists.txt index 624c9b5..dd48bcf 100644 --- a/plugin-quicklaunch/CMakeLists.txt +++ b/plugin-quicklaunch/CMakeLists.txt @@ -14,15 +14,8 @@ set(SOURCES quicklaunchaction.cpp ) -set(MOCS - lxqtquicklaunchplugin.h - lxqtquicklaunch.h - quicklaunchbutton.h - quicklaunchaction.h -) - set(LIBRARIES - ${QTXDG_LIBRARIES} + Qt5Xdg ) include_directories( diff --git a/plugin-quicklaunch/lxqtquicklaunch.cpp b/plugin-quicklaunch/lxqtquicklaunch.cpp index 03f4edd..9a8c917 100644 --- a/plugin-quicklaunch/lxqtquicklaunch.cpp +++ b/plugin-quicklaunch/lxqtquicklaunch.cpp @@ -28,24 +28,22 @@ #include "lxqtquicklaunch.h" #include "quicklaunchbutton.h" -#include #include "quicklaunchaction.h" #include "../panel/ilxqtpanelplugin.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include + LxQtQuickLaunch::LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent) : QFrame(parent), @@ -112,20 +110,24 @@ LxQtQuickLaunch::LxQtQuickLaunch(ILxQtPanelPlugin *plugin, QWidget* parent) : realign(); } + LxQtQuickLaunch::~LxQtQuickLaunch() { } + int LxQtQuickLaunch::indexOfButton(QuickLaunchButton* button) const { return mLayout->indexOf(button); } + int LxQtQuickLaunch::countOfButtons() const { return mLayout->count(); } + void LxQtQuickLaunch::realign() { mLayout->setEnabled(false); @@ -152,6 +154,7 @@ void LxQtQuickLaunch::realign() mLayout->setEnabled(true); } + void LxQtQuickLaunch::addButton(QuickLaunchAction* action) { mLayout->setEnabled(false); @@ -170,6 +173,7 @@ void LxQtQuickLaunch::addButton(QuickLaunchAction* action) realign(); } + void LxQtQuickLaunch::dragEnterEvent(QDragEnterEvent *e) { // Getting URL from mainmenu... @@ -185,6 +189,7 @@ void LxQtQuickLaunch::dragEnterEvent(QDragEnterEvent *e) } } + void LxQtQuickLaunch::dropEvent(QDropEvent *e) { const QMimeData *mime = e->mimeData(); @@ -235,6 +240,7 @@ void LxQtQuickLaunch::switchButtons(QuickLaunchButton *button1, QuickLaunchButto saveSettings(); } + void LxQtQuickLaunch::buttonDeleted() { QuickLaunchButton *btn = qobject_cast(sender()); @@ -251,6 +257,7 @@ void LxQtQuickLaunch::buttonDeleted() realign(); } + void LxQtQuickLaunch::buttonMoveLeft() { QuickLaunchButton *btn = qobject_cast(sender()); @@ -309,6 +316,7 @@ void LxQtQuickLaunch::saveSettings() settings->endArray(); } + void LxQtQuickLaunch::showPlaceHolder() { if (!mPlaceHolder) diff --git a/plugin-quicklaunch/lxqtquicklaunch.h b/plugin-quicklaunch/lxqtquicklaunch.h index 4e11c24..624c428 100644 --- a/plugin-quicklaunch/lxqtquicklaunch.h +++ b/plugin-quicklaunch/lxqtquicklaunch.h @@ -34,6 +34,7 @@ #include #include + class XdgDesktopFile; class QuickLaunchAction; class QDragEnterEvent; @@ -45,6 +46,7 @@ namespace LxQt { class GridLayout; } + /*! \brief Loader for "quick launcher" icons in the panel. \author Petr Vanek */ @@ -80,5 +82,4 @@ private slots: void buttonMoveRight(); }; - #endif diff --git a/plugin-quicklaunch/lxqtquicklaunchplugin.cpp b/plugin-quicklaunch/lxqtquicklaunchplugin.cpp index bbc1f21..2242eec 100644 --- a/plugin-quicklaunch/lxqtquicklaunchplugin.cpp +++ b/plugin-quicklaunch/lxqtquicklaunchplugin.cpp @@ -25,10 +25,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtquicklaunchplugin.h" #include "lxqtquicklaunch.h" + LxQtQuickLaunchPlugin::LxQtQuickLaunchPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), diff --git a/plugin-quicklaunch/lxqtquicklaunchplugin.h b/plugin-quicklaunch/lxqtquicklaunchplugin.h index bbb2c17..88c7a3b 100644 --- a/plugin-quicklaunch/lxqtquicklaunchplugin.h +++ b/plugin-quicklaunch/lxqtquicklaunchplugin.h @@ -25,12 +25,13 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTQUICKLAUNCHPLUGIN_H #define LXQTQUICKLAUNCHPLUGIN_H #include "../panel/ilxqtpanelplugin.h" #include + + class LxQtQuickLaunch; class LxQtQuickLaunchPlugin: public QObject, public ILxQtPanelPlugin @@ -42,6 +43,7 @@ public: virtual QWidget *widget(); virtual QString themeId() const { return "QuickLaunch"; } + virtual Flags flags() const { return NeedsHandle; } void realign(); @@ -55,10 +57,10 @@ private: class LxQtQuickLaunchPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtQuickLaunchPlugin(startupInfo); } diff --git a/plugin-quicklaunch/quicklaunchaction.cpp b/plugin-quicklaunch/quicklaunchaction.cpp index 0d282a0..3b6e821 100644 --- a/plugin-quicklaunch/quicklaunchaction.cpp +++ b/plugin-quicklaunch/quicklaunchaction.cpp @@ -25,21 +25,18 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "quicklaunchaction.h" - -#include -#include -#include -#include #include #include #include - +#include +#include +#include #include #include #include + QuickLaunchAction::QuickLaunchAction(const QString & name, const QString & exec, const QString & icon, @@ -48,7 +45,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & name, m_valid(true) { m_type = ActionLegacy; - + m_settingsMap["name"] = name; m_settingsMap["exec"] = exec; m_settingsMap["icon"] = icon; @@ -68,7 +65,7 @@ QuickLaunchAction::QuickLaunchAction(const XdgDesktopFile * xdg, m_valid(true) { m_type = ActionXdg; - + m_settingsMap["desktop"] = xdg->fileName(); QString title(xdg->localizedValue("Name").toString()); @@ -90,7 +87,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & fileName, QWidget * parent) m_type = ActionFile; setText(fileName); setData(fileName); - + m_settingsMap["file"] = fileName; QFileInfo fi(fileName); @@ -105,7 +102,7 @@ QuickLaunchAction::QuickLaunchAction(const QString & fileName, QWidget * parent) XdgMimeType mi(db.mimeTypeForFile(fi)); setIcon(mi.icon()); } - + connect(this, SIGNAL(triggered()), this, SLOT(execAction())); } diff --git a/plugin-quicklaunch/quicklaunchaction.h b/plugin-quicklaunch/quicklaunchaction.h index 61d4793..423850c 100644 --- a/plugin-quicklaunch/quicklaunchaction.h +++ b/plugin-quicklaunch/quicklaunchaction.h @@ -25,12 +25,12 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef QUICKLAUNCHACTION_H #define QUICKLAUNCHACTION_H #include + class XdgDesktopFile; @@ -57,13 +57,13 @@ public: /*! Constructor for XDG desktop handlers. */ QuickLaunchAction(const XdgDesktopFile * xdg, QWidget * parent); - /*! Constructor for regular files + /*! Constructor for regular files */ QuickLaunchAction(const QString & fileName, QWidget * parent); //! Returns true if the action is valid (contains all required properties). bool isValid() { return m_valid; } - + QHash settingsMap() { return m_settingsMap; } public slots: diff --git a/plugin-quicklaunch/quicklaunchbutton.cpp b/plugin-quicklaunch/quicklaunchbutton.cpp index 59fdd79..7ba8055 100644 --- a/plugin-quicklaunch/quicklaunchbutton.cpp +++ b/plugin-quicklaunch/quicklaunchbutton.cpp @@ -25,17 +25,16 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "quicklaunchbutton.h" +#include "lxqtquicklaunch.h" #include +#include #include +#include #include #include -#include #include #include -#include - -#include "quicklaunchbutton.h" -#include "lxqtquicklaunch.h" #define MIMETYPE "x-lxqt/quicklaunch-button" @@ -74,11 +73,13 @@ QuickLaunchButton::QuickLaunchButton(QuickLaunchAction * act, QWidget * parent) this, SLOT(this_customContextMenuRequested(const QPoint&))); } + QuickLaunchButton::~QuickLaunchButton() { //m_act->deleteLater(); } + QHash QuickLaunchButton::settingsMap() { Q_ASSERT(mAct); @@ -95,11 +96,13 @@ void QuickLaunchButton::this_customContextMenuRequested(const QPoint & pos) mMenu->popup(mapToGlobal(pos)); } + void QuickLaunchButton::selfRemove() { emit buttonDeleted(); } + void QuickLaunchButton::paintEvent(QPaintEvent *) { // Do not paint that ugly "has menu" arrow @@ -110,6 +113,7 @@ void QuickLaunchButton::paintEvent(QPaintEvent *) p.drawComplexControl(QStyle::CC_ToolButton, opt); } + void QuickLaunchButton::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::LeftButton && e->modifiers() == Qt::ControlModifier) @@ -121,6 +125,7 @@ void QuickLaunchButton::mousePressEvent(QMouseEvent *e) QToolButton::mousePressEvent(e); } + void QuickLaunchButton::mouseMoveEvent(QMouseEvent *e) { if (!(e->buttons() & Qt::LeftButton)) @@ -152,6 +157,7 @@ void QuickLaunchButton::mouseMoveEvent(QMouseEvent *e) } } + void QuickLaunchButton::dragMoveEvent(QDragMoveEvent * e) { if (e->mimeData()->hasFormat(MIMETYPE)) @@ -160,6 +166,7 @@ void QuickLaunchButton::dragMoveEvent(QDragMoveEvent * e) e->ignore(); } + void QuickLaunchButton::dragEnterEvent(QDragEnterEvent *e) { const ButtonMimeData *mimeData = qobject_cast(e->mimeData()); @@ -168,4 +175,3 @@ void QuickLaunchButton::dragEnterEvent(QDragEnterEvent *e) emit switchButtons(mimeData->button(), this); } } - diff --git a/plugin-quicklaunch/quicklaunchbutton.h b/plugin-quicklaunch/quicklaunchbutton.h index 57f8136..cedaf4c 100644 --- a/plugin-quicklaunch/quicklaunchbutton.h +++ b/plugin-quicklaunch/quicklaunchbutton.h @@ -30,9 +30,9 @@ #ifndef LXQTQUICKLAUNCHBUTTON_H #define LXQTQUICKLAUNCHBUTTON_H -#include -#include #include "quicklaunchaction.h" +#include +#include class QuickLaunchButton : public QToolButton diff --git a/plugin-quicklaunch/translations/quicklaunch.ts b/plugin-quicklaunch/translations/quicklaunch.ts index e48df72..ca203d4 100644 --- a/plugin-quicklaunch/translations/quicklaunch.ts +++ b/plugin-quicklaunch/translations/quicklaunch.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_ar.ts b/plugin-quicklaunch/translations/quicklaunch_ar.ts index e460928..90f5092 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ar.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ar.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error خطاٌ في النَّقل - + File/URL '%1' cannot be embedded into QuickLaunch for now ﻻ يمكن تضمين الملف أو الرَّابط %1 في لوحة البدء السَّريع حاليَّاً - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left إلى اليسار - + Move right إلى اليمين - + Remove from quicklaunch إزالة من لوحة البدء السَّريع diff --git a/plugin-quicklaunch/translations/quicklaunch_cs.ts b/plugin-quicklaunch/translations/quicklaunch_cs.ts index 8a458bc..078d8a8 100644 --- a/plugin-quicklaunch/translations/quicklaunch_cs.ts +++ b/plugin-quicklaunch/translations/quicklaunch_cs.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Problém s upuštěním - + File/URL '%1' cannot be embedded into QuickLaunch for now Soubor/URL '%1' nyní nelze vložit do rychlého spuštění - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Přesunout vlevo - + Move right Přesunout vpravo - + Remove from quicklaunch Odstranit z rychlého spuštění diff --git a/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts b/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts index 9c9451d..1041dde 100644 --- a/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts +++ b/plugin-quicklaunch/translations/quicklaunch_cs_CZ.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Problém s upuštěním - + File/URL '%1' cannot be embedded into QuickLaunch for now Soubor/URL '%1' nyní nelze vložit do rychlého spuštění - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Přesunout vlevo - + Move right Přesunout vpravo - + Remove from quicklaunch Odstranit z rychlého spuštění diff --git a/plugin-quicklaunch/translations/quicklaunch_da.ts b/plugin-quicklaunch/translations/quicklaunch_da.ts index 1ef231f..1d96f01 100644 --- a/plugin-quicklaunch/translations/quicklaunch_da.ts +++ b/plugin-quicklaunch/translations/quicklaunch_da.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Slipfejl - + File/URL '%1' cannot be embedded into QuickLaunch for now Fil/URL '%1' kan ikke indlejres i HurtigStart lige nu - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Flyt mod venstre - + Move right Flyt mod højre - + Remove from quicklaunch Fjern fra Hurtigstart diff --git a/plugin-quicklaunch/translations/quicklaunch_da_DK.ts b/plugin-quicklaunch/translations/quicklaunch_da_DK.ts index 2dafd69..a270973 100644 --- a/plugin-quicklaunch/translations/quicklaunch_da_DK.ts +++ b/plugin-quicklaunch/translations/quicklaunch_da_DK.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Træk og slip fejl - + File/URL '%1' cannot be embedded into QuickLaunch for now Fil/URL '%1' kan ikke blive indlejret i QuickLaunch lige nu - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Flyt mod venstre - + Move right Flyt mod højre - + Remove from quicklaunch Fjern fra quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_de.desktop b/plugin-quicklaunch/translations/quicklaunch_de.desktop index 796f7af..1cfaefd 100644 --- a/plugin-quicklaunch/translations/quicklaunch_de.desktop +++ b/plugin-quicklaunch/translations/quicklaunch_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Quick launch -Comment=Easy access to your favourite applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Starten Sie Ihre lieblings Anwendungen Name[de]=Schnellstarter +Comment[de]=Starten Sie Ihre Lieblingsanwendungen diff --git a/plugin-quicklaunch/translations/quicklaunch_de.ts b/plugin-quicklaunch/translations/quicklaunch_de.ts index 2e006b1..1f15174 100644 --- a/plugin-quicklaunch/translations/quicklaunch_de.ts +++ b/plugin-quicklaunch/translations/quicklaunch_de.ts @@ -4,36 +4,37 @@ LxQtQuickLaunch - + Drop Error - Fehler fallen lassen + Fehler beim fallen lassen - + File/URL '%1' cannot be embedded into QuickLaunch for now - Datei/URL »%1« kann momentan nicht in die Schnellstartleiste eingebettet werden. + Datei/URL '%1' kann momentan nicht in die Schnellstartleiste eingebettet werden. - + Drop application icons here - + Anwendung/Symbol +hier fallen lassen QuickLaunchButton - + Move left Nach links verschieben - + Move right Nach rechts verschieben - + Remove from quicklaunch Aus der Schnellstartleiste entfernen diff --git a/plugin-quicklaunch/translations/quicklaunch_de_DE.desktop b/plugin-quicklaunch/translations/quicklaunch_de_DE.desktop deleted file mode 100644 index ea06f5e..0000000 --- a/plugin-quicklaunch/translations/quicklaunch_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Quick launch -Comment=Easy access to your favourite applications. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Starte deine Lieblingsanwendungen -Name[de_DE]=Schnellstarter diff --git a/plugin-quicklaunch/translations/quicklaunch_de_DE.ts b/plugin-quicklaunch/translations/quicklaunch_de_DE.ts deleted file mode 100644 index 74e8ad6..0000000 --- a/plugin-quicklaunch/translations/quicklaunch_de_DE.ts +++ /dev/null @@ -1,41 +0,0 @@ - - - - - LxQtQuickLaunch - - - Drop Error - Drop Error - - - - File/URL '%1' cannot be embedded into QuickLaunch for now - Datei/Pfad '%1' kann im moment nicht in den Schnellstarter integriert werden - - - - Drop application -icons here - - - - - QuickLaunchButton - - - Move left - Nach links bewegen - - - - Move right - Nach rechts bewegen - - - - Remove from quicklaunch - Aus dem Schnellstarter löschen - - - diff --git a/plugin-quicklaunch/translations/quicklaunch_el_GR.ts b/plugin-quicklaunch/translations/quicklaunch_el_GR.ts index e2fb17b..4501097 100644 --- a/plugin-quicklaunch/translations/quicklaunch_el_GR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_el_GR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Σφάλμα εναπόθεσης - + File/URL '%1' cannot be embedded into QuickLaunch for now Το αρχείο/η διεύθυνση "%1" δεν μπορεί να ενσωματωθεί για την ώρα στη γρήγορη εκκίνηση - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Μετακίνηση αριστερά - + Move right Μετακίνηση δεξιά - + Remove from quicklaunch Αφαίρεση από τη γρήγορη εκκίνηση diff --git a/plugin-quicklaunch/translations/quicklaunch_eo.ts b/plugin-quicklaunch/translations/quicklaunch_eo.ts index c212b88..2a148dc 100644 --- a/plugin-quicklaunch/translations/quicklaunch_eo.ts +++ b/plugin-quicklaunch/translations/quicklaunch_eo.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Eraro dum forigado - + File/URL '%1' cannot be embedded into QuickLaunch for now Dosiero/URL '%1' ne povas esti enkorpigita en rapidlanĉilo nun - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Movi maldekstren - + Move right Movi dekstren - + Remove from quicklaunch Forigi el rapidlanĉilo diff --git a/plugin-quicklaunch/translations/quicklaunch_es.ts b/plugin-quicklaunch/translations/quicklaunch_es.ts index 24a0f0e..48188b3 100644 --- a/plugin-quicklaunch/translations/quicklaunch_es.ts +++ b/plugin-quicklaunch/translations/quicklaunch_es.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Error al soltar - + File/URL '%1' cannot be embedded into QuickLaunch for now El archivo/URL '%1' por el momento no puede incrustarse en QuickLaunch - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover a la izquierda - + Move right Mover a la derecha - + Remove from quicklaunch Quitar de quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_es_VE.ts b/plugin-quicklaunch/translations/quicklaunch_es_VE.ts index 6ee4af4..e6596a5 100644 --- a/plugin-quicklaunch/translations/quicklaunch_es_VE.ts +++ b/plugin-quicklaunch/translations/quicklaunch_es_VE.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Error al remover - + File/URL '%1' cannot be embedded into QuickLaunch for now Archivo/URL '%1' no puede ser empotrado en la barra de lanzadores por ahora - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover a la izquierda - + Move right Mover a la derecha - + Remove from quicklaunch Remover de la barra de lanzadores diff --git a/plugin-quicklaunch/translations/quicklaunch_eu.ts b/plugin-quicklaunch/translations/quicklaunch_eu.ts index 4d25e4f..a1c8c3b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_eu.ts +++ b/plugin-quicklaunch/translations/quicklaunch_eu.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Errorea jaregitean - + File/URL '%1' cannot be embedded into QuickLaunch for now '%1' fitxategia/URLa ezin da QuickLaunch-en txertatu oraingoz - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mugitu ezkerrera - + Move right Mugitu eskuinera - + Remove from quicklaunch Kendu abio azkarretik diff --git a/plugin-quicklaunch/translations/quicklaunch_fi.ts b/plugin-quicklaunch/translations/quicklaunch_fi.ts index 5c6c769..287c0c2 100644 --- a/plugin-quicklaunch/translations/quicklaunch_fi.ts +++ b/plugin-quicklaunch/translations/quicklaunch_fi.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Poistovirhe - + File/URL '%1' cannot be embedded into QuickLaunch for now Tiedostoa/osoitetta '%1' ei toistaiseksi voi asettaa pikakäynnistykseen - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Siirrä vasemmalle - + Move right Siirrä oikealle - + Remove from quicklaunch Poista pikakäynnistyksestä diff --git a/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts b/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts index d1849d5..35c275e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_fr_FR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ne pas tenir compte de l'erreur - + File/URL '%1' cannot be embedded into QuickLaunch for now Le fichier/l'URL '%1' ne peut pas être inclus dans le lancement rapide pour l'instant - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Déplacer vers la gauche - + Move right Déplacer vers la droite - + Remove from quicklaunch Enlever du lancement rapide diff --git a/plugin-quicklaunch/translations/quicklaunch_hu.ts b/plugin-quicklaunch/translations/quicklaunch_hu.ts index 43ece95..9c7e2fe 100644 --- a/plugin-quicklaunch/translations/quicklaunch_hu.ts +++ b/plugin-quicklaunch/translations/quicklaunch_hu.ts @@ -1,41 +1,42 @@ - + LxQtQuickLaunch - + Drop Error - + Ejtési hiba - + File/URL '%1' cannot be embedded into QuickLaunch for now - + A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba - + Drop application icons here - + Ejts ide +indító ikont QuickLaunchButton - + Move left - + Balra - + Move right - + Jobbra - + Remove from quicklaunch - + Eltávolítás a gyorsindítóról diff --git a/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts b/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts index cd74faf..4c85f5b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts +++ b/plugin-quicklaunch/translations/quicklaunch_hu_HU.ts @@ -1,39 +1,40 @@ - + LxQtQuickLaunch - + Drop Error Ejtési hiba - + File/URL '%1' cannot be embedded into QuickLaunch for now A(z) „%1” fájl vagy URL nem ágyazható be a Gyorsindítóba - + Drop application icons here - + Ejts ide +indító ikont QuickLaunchButton - + Move left Balra - + Move right Jobbra - + Remove from quicklaunch Eltávolítás a gyorsindítóról diff --git a/plugin-quicklaunch/translations/quicklaunch_ia.ts b/plugin-quicklaunch/translations/quicklaunch_ia.ts index 5787b3e..8bfd4c4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ia.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ia.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_id_ID.ts b/plugin-quicklaunch/translations/quicklaunch_id_ID.ts index 2033904..d22169f 100644 --- a/plugin-quicklaunch/translations/quicklaunch_id_ID.ts +++ b/plugin-quicklaunch/translations/quicklaunch_id_ID.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_it_IT.ts b/plugin-quicklaunch/translations/quicklaunch_it_IT.ts index 61d89ed..fa3fabd 100644 --- a/plugin-quicklaunch/translations/quicklaunch_it_IT.ts +++ b/plugin-quicklaunch/translations/quicklaunch_it_IT.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Errore di spostamento - + File/URL '%1' cannot be embedded into QuickLaunch for now Il file/URL '%1' in questo momento non può essere inserito in Avvio rapido - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Sposta a sinistra - + Move right Sposta a destra - + Remove from quicklaunch Rimuovi da Avvio rapido diff --git a/plugin-quicklaunch/translations/quicklaunch_ja.ts b/plugin-quicklaunch/translations/quicklaunch_ja.ts index f45f58e..29d90a7 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ja.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ja.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error ドロップエラー - + File/URL '%1' cannot be embedded into QuickLaunch for now ファイル/URL '%1' は現在、クイック起動に埋め込むことができません - + Drop application icons here アプリケーションアイコンを @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left 左に移動 - + Move right 右に移動 - + Remove from quicklaunch クイック起動から削除 diff --git a/plugin-quicklaunch/translations/quicklaunch_ko.ts b/plugin-quicklaunch/translations/quicklaunch_ko.ts index e9f0a73..45bb56b 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ko.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ko.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_lt.ts b/plugin-quicklaunch/translations/quicklaunch_lt.ts index 1f724eb..498cf45 100644 --- a/plugin-quicklaunch/translations/quicklaunch_lt.ts +++ b/plugin-quicklaunch/translations/quicklaunch_lt.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Tempimo klaida - + File/URL '%1' cannot be embedded into QuickLaunch for now Failo/URL „%1“ šiuo metu negalima patalpinti greitajame paleidime - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Perkelti į kairę - + Move right Perkelti į dešinę - + Remove from quicklaunch Pašalinti diff --git a/plugin-quicklaunch/translations/quicklaunch_nl.ts b/plugin-quicklaunch/translations/quicklaunch_nl.ts index efa2742..41b819a 100644 --- a/plugin-quicklaunch/translations/quicklaunch_nl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_nl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Neerzetfout - + File/URL '%1' cannot be embedded into QuickLaunch for now Bestand/URL '%1' kan vooralsnog niet worden ingebed in de snelstartbalk - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Verplaats naar links - + Move right Verplaats naar rechts - + Remove from quicklaunch Verwijder uit snelstartbalk diff --git a/plugin-quicklaunch/translations/quicklaunch_pl.ts b/plugin-quicklaunch/translations/quicklaunch_pl.ts index 4d27521..5f441d6 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Przesuń w lewo - + Move right Przesuń w prawo - + Remove from quicklaunch Usuń z szybkiego uruchamiania diff --git a/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts b/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts index 2868ec3..a455735 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pl_PL.ts @@ -4,36 +4,36 @@ LxQtQuickLaunch - + Drop Error Problem dodawania - + File/URL '%1' cannot be embedded into QuickLaunch for now Plik/URL '%1' nie może zostać umiesczony na pasku szybkiego uruchamiania - + Drop application icons here - + Upuść ikonę aplikacji tutaj QuickLaunchButton - + Move left Przesuń w lewo - + Move right Przesuń w prawo - + Remove from quicklaunch Usuń z paska szybkiego uruchamiania diff --git a/plugin-quicklaunch/translations/quicklaunch_pt.ts b/plugin-quicklaunch/translations/quicklaunch_pt.ts index edbfdc2..a880dd4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pt.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pt.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Erro ao largar - + File/URL '%1' cannot be embedded into QuickLaunch for now Neste momento, não pode incluir o ficheiro/url '%1' no inicio rápido. - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover para a esquerda - + Move right Mover para a direita - + Remove from quicklaunch Remover do inicio rápido diff --git a/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts b/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts index a811b90..35db758 100644 --- a/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts +++ b/plugin-quicklaunch/translations/quicklaunch_pt_BR.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Erro de queda - + File/URL '%1' cannot be embedded into QuickLaunch for now O arquivo/URL '%1' não pôde ser incorporado ao lançador rápido - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mover para a esquerda - + Move right Mover para a direita - + Remove from quicklaunch Remover do lançador rápido diff --git a/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts b/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts index bda08e1..209c10a 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ro_RO.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now Fișierul/URL-ul '%1' nu poate fi inclus în lista de lansare rapidă momentan - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Mută spre stânga - + Move right Mută spre dreapta - + Remove from quicklaunch Îndepărtează din lista pentru lansare rapidă diff --git a/plugin-quicklaunch/translations/quicklaunch_ru.ts b/plugin-quicklaunch/translations/quicklaunch_ru.ts index 23c324d..d263e7e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ru.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ru.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ошибка бросания - + File/URL '%1' cannot be embedded into QuickLaunch for now Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас - + Drop application icons here Бросьте значки @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left Сдвинуть влево - + Move right Сдвинуть вправо - + Remove from quicklaunch Удалить из быстрого запуска diff --git a/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts b/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts index 9ad9f6a..5bfb41f 100644 --- a/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts +++ b/plugin-quicklaunch/translations/quicklaunch_ru_RU.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Ошибка бросания - + File/URL '%1' cannot be embedded into QuickLaunch for now Файл/URL-адрес '%1' не может быть встроен в быстрый запуск сейчас - + Drop application icons here Бросьте значки @@ -24,17 +24,17 @@ icons here QuickLaunchButton - + Move left Сдвинуть влево - + Move right Сдвинуть вправо - + Remove from quicklaunch Удалить из быстрого запуска diff --git a/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts b/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts index f984c15..9db0473 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sk_SK.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error CHyba pri pustení - + File/URL '%1' cannot be embedded into QuickLaunch for now Súbor/URL „%1“ nateraz nemožno vložiť do rýchleho spustenia - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Presunúť vľavo - + Move right Presunúť vpravo - + Remove from quicklaunch Odstrániť z rýchleho spustenia diff --git a/plugin-quicklaunch/translations/quicklaunch_sl.ts b/plugin-quicklaunch/translations/quicklaunch_sl.ts index 39e689b..0dee705 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sl.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sl.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Napaka spusta - + File/URL '%1' cannot be embedded into QuickLaunch for now Datoteke/lokacije »%1« trenutno ni bilo moč vstaviti v Hitri zagon - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Premakni levo - + Move right Premakni desno - + Remove from quicklaunch Odstrani iz hitrega zagona diff --git a/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts b/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts index b5a2b3a..793429e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr@latin.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error - + File/URL '%1' cannot be embedded into QuickLaunch for now - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left - + Move right - + Remove from quicklaunch diff --git a/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts b/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts index f015968..c067b5e 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr_BA.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Грешка испуштања - + File/URL '%1' cannot be embedded into QuickLaunch for now Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Помјери лијево - + Move right Помјери десно - + Remove from quicklaunch Уклони са брзог покретања diff --git a/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts b/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts index ae63a16..414e650 100644 --- a/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts +++ b/plugin-quicklaunch/translations/quicklaunch_sr_RS.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Грешка испуштања - + File/URL '%1' cannot be embedded into QuickLaunch for now Фајл/УРЛ „%1“ не може бити уграђен у Брзо Покретање за сада - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Помери лево - + Move right Помери десно - + Remove from quicklaunch Уклони са брзог покретања diff --git a/plugin-quicklaunch/translations/quicklaunch_th_TH.ts b/plugin-quicklaunch/translations/quicklaunch_th_TH.ts index ed51400..8f46cc4 100644 --- a/plugin-quicklaunch/translations/quicklaunch_th_TH.ts +++ b/plugin-quicklaunch/translations/quicklaunch_th_TH.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error การหย่อนขัดข้อง - + File/URL '%1' cannot be embedded into QuickLaunch for now แฟ้ม/URL '%1' ไม่สามารถฝังตัวไปยังตัวเรียกโปรแกรมด่วนได้ในตอนนี้ - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left ย้ายไปทางซ้าย - + Move right ย้ายไปทางขวา - + Remove from quicklaunch ลบออกจากตัวเรียกโปรแกรมด่วน diff --git a/plugin-quicklaunch/translations/quicklaunch_tr.ts b/plugin-quicklaunch/translations/quicklaunch_tr.ts index 9e8e501..59ab575 100644 --- a/plugin-quicklaunch/translations/quicklaunch_tr.ts +++ b/plugin-quicklaunch/translations/quicklaunch_tr.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Bırakma Hatası - + File/URL '%1' cannot be embedded into QuickLaunch for now Şimdilik '%1' dosyası/bağlantısı Hızlı Başlatıcı' ya eklenemiyor - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Sola kaydır - + Move right Sağa kaydır - + Remove from quicklaunch Hızlı başlatıcıdan kaldır diff --git a/plugin-quicklaunch/translations/quicklaunch_uk.ts b/plugin-quicklaunch/translations/quicklaunch_uk.ts index f66ff98..471e7b2 100644 --- a/plugin-quicklaunch/translations/quicklaunch_uk.ts +++ b/plugin-quicklaunch/translations/quicklaunch_uk.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error Збій при розміщенні - + File/URL '%1' cannot be embedded into QuickLaunch for now Не вдається додати "%1" до швидкого запуску - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left Посунути ліворуч - + Move right Посунути враворуч - + Remove from quicklaunch Вилучити зі швидкого запуску diff --git a/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts b/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts index 4cd8ee0..5006503 100644 --- a/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts +++ b/plugin-quicklaunch/translations/quicklaunch_zh_CN.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error 出现错误 - + File/URL '%1' cannot be embedded into QuickLaunch for now 文件/URL '%1' 暂时无法被嵌入到快速启动 - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left 左移 - + Move right 右移 - + Remove from quicklaunch 从快速启动删除 diff --git a/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts b/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts index 09fe3b0..67b6ace 100644 --- a/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts +++ b/plugin-quicklaunch/translations/quicklaunch_zh_TW.ts @@ -4,17 +4,17 @@ LxQtQuickLaunch - + Drop Error 移入錯誤 - + File/URL '%1' cannot be embedded into QuickLaunch for now 檔案位址'%1'現在無法嵌入至快速啟動 - + Drop application icons here @@ -23,17 +23,17 @@ icons here QuickLaunchButton - + Move left 往左移 - + Move right 往右移 - + Remove from quicklaunch 從快速啟動中移除 diff --git a/plugin-screensaver/CMakeLists.txt b/plugin-screensaver/CMakeLists.txt index 2412b03..e687a5d 100644 --- a/plugin-screensaver/CMakeLists.txt +++ b/plugin-screensaver/CMakeLists.txt @@ -8,13 +8,9 @@ set(SOURCES panelscreensaver.cpp ) -set(MOCS - panelscreensaver.h -) - set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} + lxqt-globalkeys ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-screensaver/panelscreensaver.cpp b/plugin-screensaver/panelscreensaver.cpp index 260dc7d..f0624ad 100644 --- a/plugin-screensaver/panelscreensaver.cpp +++ b/plugin-screensaver/panelscreensaver.cpp @@ -52,15 +52,19 @@ PanelScreenSaver::PanelScreenSaver(const ILxQtPanelPluginStartupInfo &startupInf mShortcutKey = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/lock").arg(settings()->group()), tr("Lock Screen"), this); if (mShortcutKey) { + connect(mShortcutKey, &GlobalKeyShortcut::Action::registrationFinished, this, &PanelScreenSaver::shortcutRegistered); connect(mShortcutKey, SIGNAL(activated()), mSaver, SLOT(lockScreen())); + } +} +void PanelScreenSaver::shortcutRegistered() +{ + if (mShortcutKey->shortcut().isEmpty()) + { + mShortcutKey->changeShortcut(DEFAULT_SHORTCUT); if (mShortcutKey->shortcut().isEmpty()) { - mShortcutKey->changeShortcut(DEFAULT_SHORTCUT); - if (mShortcutKey->shortcut().isEmpty()) - { - LxQt::Notification::notify(tr("Panel Screensaver: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); - } + LxQt::Notification::notify(tr("Panel Screensaver: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); } } } diff --git a/plugin-screensaver/panelscreensaver.h b/plugin-screensaver/panelscreensaver.h index a34d661..7926755 100644 --- a/plugin-screensaver/panelscreensaver.h +++ b/plugin-screensaver/panelscreensaver.h @@ -50,6 +50,9 @@ public: virtual QWidget *widget() { return &mButton; } virtual QString themeId() const { return "PanelScreenSaver"; } +private slots: + void shortcutRegistered(); + private: QToolButton mButton; LxQt::ScreenSaver * mSaver; @@ -62,7 +65,7 @@ class PanelScreenSaverLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new PanelScreenSaver(startupInfo); } diff --git a/plugin-screensaver/translations/screensaver.ts b/plugin-screensaver/translations/screensaver.ts index f6ec551..a7e5827 100644 --- a/plugin-screensaver/translations/screensaver.ts +++ b/plugin-screensaver/translations/screensaver.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ar.ts b/plugin-screensaver/translations/screensaver_ar.ts index 29e2f80..2669739 100644 --- a/plugin-screensaver/translations/screensaver_ar.ts +++ b/plugin-screensaver/translations/screensaver_ar.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_cs.ts b/plugin-screensaver/translations/screensaver_cs.ts index 4b73521..b2dac8e 100644 --- a/plugin-screensaver/translations/screensaver_cs.ts +++ b/plugin-screensaver/translations/screensaver_cs.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_cs_CZ.ts b/plugin-screensaver/translations/screensaver_cs_CZ.ts index f9257ea..434b079 100644 --- a/plugin-screensaver/translations/screensaver_cs_CZ.ts +++ b/plugin-screensaver/translations/screensaver_cs_CZ.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_da.ts b/plugin-screensaver/translations/screensaver_da.ts index 4622ac2..ec68690 100644 --- a/plugin-screensaver/translations/screensaver_da.ts +++ b/plugin-screensaver/translations/screensaver_da.ts @@ -17,7 +17,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_da_DK.ts b/plugin-screensaver/translations/screensaver_da_DK.ts index 2cfdde2..4259c72 100644 --- a/plugin-screensaver/translations/screensaver_da_DK.ts +++ b/plugin-screensaver/translations/screensaver_da_DK.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_de.desktop b/plugin-screensaver/translations/screensaver_de.desktop index 2e3ce17..72bad46 100644 --- a/plugin-screensaver/translations/screensaver_de.desktop +++ b/plugin-screensaver/translations/screensaver_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Launch screensaver -Comment=Activate a screensaver and/or lock the screen - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Aktiviere einen Bildschirmschoner und/oder sperre den Bildschirm Name[de]=Bildschirmschoner +Comment[de]=Bildschirmschoner aktivieren und/oder Bildschirm sperren diff --git a/plugin-screensaver/translations/screensaver_de.ts b/plugin-screensaver/translations/screensaver_de.ts index 88a309b..0638eda 100644 --- a/plugin-screensaver/translations/screensaver_de.ts +++ b/plugin-screensaver/translations/screensaver_de.ts @@ -3,23 +3,15 @@ PanelScreenSaver - - Global keyboard shortcut - Globales Tastaturkürzel - - - Panel Screensaver Global shortcut: '%1' cannot be registered - Globales Tastenkürzel für Bildschirmschoner: »%1« kann nicht registriert werden - Lock Screen - + Bildschirm sperren - + Panel Screensaver: Global shortcut '%1' cannot be registered - + Für den Bildschirmschoner kann das globale Tastenkürzel '%1' nicht registriert werden diff --git a/plugin-screensaver/translations/screensaver_de_DE.desktop b/plugin-screensaver/translations/screensaver_de_DE.desktop deleted file mode 100644 index dd6fd0e..0000000 --- a/plugin-screensaver/translations/screensaver_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Launch screensaver -Comment=Activate a screensaver and/or lock the screen - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Bildschirmschoner aktivieren und/oder Bildschirm sperren -Name[de_DE]=Bildschirmschoner starten diff --git a/plugin-screensaver/translations/screensaver_de_DE.ts b/plugin-screensaver/translations/screensaver_de_DE.ts deleted file mode 100644 index 195e5b6..0000000 --- a/plugin-screensaver/translations/screensaver_de_DE.ts +++ /dev/null @@ -1,21 +0,0 @@ - - - - - PanelScreenSaver - - Panel Screensaver Global shortcut: '%1' cannot be registered - Panel Bildschirmschoner globaler Tastenkürzel: '%1' kann nicht registriert wrden - - - - Lock Screen - - - - - Panel Screensaver: Global shortcut '%1' cannot be registered - - - - diff --git a/plugin-screensaver/translations/screensaver_el_GR.ts b/plugin-screensaver/translations/screensaver_el_GR.ts index 95c0230..311f26d 100644 --- a/plugin-screensaver/translations/screensaver_el_GR.ts +++ b/plugin-screensaver/translations/screensaver_el_GR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_eo.ts b/plugin-screensaver/translations/screensaver_eo.ts index 8b8b322..0488b02 100644 --- a/plugin-screensaver/translations/screensaver_eo.ts +++ b/plugin-screensaver/translations/screensaver_eo.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_es.ts b/plugin-screensaver/translations/screensaver_es.ts index 3ea4795..35bdb70 100644 --- a/plugin-screensaver/translations/screensaver_es.ts +++ b/plugin-screensaver/translations/screensaver_es.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_es_VE.ts b/plugin-screensaver/translations/screensaver_es_VE.ts index 6eee89d..5218d96 100644 --- a/plugin-screensaver/translations/screensaver_es_VE.ts +++ b/plugin-screensaver/translations/screensaver_es_VE.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_eu.ts b/plugin-screensaver/translations/screensaver_eu.ts index 78f8e43..699a6e3 100644 --- a/plugin-screensaver/translations/screensaver_eu.ts +++ b/plugin-screensaver/translations/screensaver_eu.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_fi.ts b/plugin-screensaver/translations/screensaver_fi.ts index 3ce87bc..7306c38 100644 --- a/plugin-screensaver/translations/screensaver_fi.ts +++ b/plugin-screensaver/translations/screensaver_fi.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_fr_FR.ts b/plugin-screensaver/translations/screensaver_fr_FR.ts index 193e360..0b0e649 100644 --- a/plugin-screensaver/translations/screensaver_fr_FR.ts +++ b/plugin-screensaver/translations/screensaver_fr_FR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_hu.ts b/plugin-screensaver/translations/screensaver_hu.ts index 0082b40..2f9a870 100644 --- a/plugin-screensaver/translations/screensaver_hu.ts +++ b/plugin-screensaver/translations/screensaver_hu.ts @@ -1,17 +1,21 @@ - + PanelScreenSaver + + Panel Screensaver Global shortcut: '%1' cannot be registered + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + Lock Screen - + Képernyőzár - + Panel Screensaver: Global shortcut '%1' cannot be registered - + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható diff --git a/plugin-screensaver/translations/screensaver_hu_HU.ts b/plugin-screensaver/translations/screensaver_hu_HU.ts index 1157bb8..7f6f9aa 100644 --- a/plugin-screensaver/translations/screensaver_hu_HU.ts +++ b/plugin-screensaver/translations/screensaver_hu_HU.ts @@ -1,21 +1,21 @@ - + PanelScreenSaver Panel Screensaver Global shortcut: '%1' cannot be registered - A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható Lock Screen - + Képernyőzár - + Panel Screensaver: Global shortcut '%1' cannot be registered - + A(z) „%1” gyorsbillentyű a panel képernyővédőjének megjelenítéséhez nem regisztrálható diff --git a/plugin-screensaver/translations/screensaver_ia.ts b/plugin-screensaver/translations/screensaver_ia.ts index 8455534..e7ca110 100644 --- a/plugin-screensaver/translations/screensaver_ia.ts +++ b/plugin-screensaver/translations/screensaver_ia.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_id_ID.ts b/plugin-screensaver/translations/screensaver_id_ID.ts index 8a1b8ce..2cb2530 100644 --- a/plugin-screensaver/translations/screensaver_id_ID.ts +++ b/plugin-screensaver/translations/screensaver_id_ID.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_it_IT.ts b/plugin-screensaver/translations/screensaver_it_IT.ts index 16d0b37..fe44c3d 100644 --- a/plugin-screensaver/translations/screensaver_it_IT.ts +++ b/plugin-screensaver/translations/screensaver_it_IT.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ja.ts b/plugin-screensaver/translations/screensaver_ja.ts index 206f11d..b5852b1 100644 --- a/plugin-screensaver/translations/screensaver_ja.ts +++ b/plugin-screensaver/translations/screensaver_ja.ts @@ -9,7 +9,7 @@ スクリーンをロック - + Panel Screensaver: Global shortcut '%1' cannot be registered スクリーンセーバー: グローバルショートカット '%1' を登録することができません diff --git a/plugin-screensaver/translations/screensaver_ko.ts b/plugin-screensaver/translations/screensaver_ko.ts index ea6e114..55a4faa 100644 --- a/plugin-screensaver/translations/screensaver_ko.ts +++ b/plugin-screensaver/translations/screensaver_ko.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_lt.ts b/plugin-screensaver/translations/screensaver_lt.ts index c757c9c..46f8737 100644 --- a/plugin-screensaver/translations/screensaver_lt.ts +++ b/plugin-screensaver/translations/screensaver_lt.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_nl.ts b/plugin-screensaver/translations/screensaver_nl.ts index 24831f3..ad59586 100644 --- a/plugin-screensaver/translations/screensaver_nl.ts +++ b/plugin-screensaver/translations/screensaver_nl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pl.ts b/plugin-screensaver/translations/screensaver_pl.ts index faa2b39..02ee63b 100644 --- a/plugin-screensaver/translations/screensaver_pl.ts +++ b/plugin-screensaver/translations/screensaver_pl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pl_PL.ts b/plugin-screensaver/translations/screensaver_pl_PL.ts index 936a1ce..92a3968 100644 --- a/plugin-screensaver/translations/screensaver_pl_PL.ts +++ b/plugin-screensaver/translations/screensaver_pl_PL.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pt.ts b/plugin-screensaver/translations/screensaver_pt.ts index dff3e84..a159d8a 100644 --- a/plugin-screensaver/translations/screensaver_pt.ts +++ b/plugin-screensaver/translations/screensaver_pt.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_pt_BR.ts b/plugin-screensaver/translations/screensaver_pt_BR.ts index 1d34988..3720191 100644 --- a/plugin-screensaver/translations/screensaver_pt_BR.ts +++ b/plugin-screensaver/translations/screensaver_pt_BR.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ro_RO.ts b/plugin-screensaver/translations/screensaver_ro_RO.ts index e55d8e5..4defc9f 100644 --- a/plugin-screensaver/translations/screensaver_ro_RO.ts +++ b/plugin-screensaver/translations/screensaver_ro_RO.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_ru.ts b/plugin-screensaver/translations/screensaver_ru.ts index 248ffbd..dbf9d50 100644 --- a/plugin-screensaver/translations/screensaver_ru.ts +++ b/plugin-screensaver/translations/screensaver_ru.ts @@ -9,7 +9,7 @@ Блокировать экран - + Panel Screensaver: Global shortcut '%1' cannot be registered Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано diff --git a/plugin-screensaver/translations/screensaver_ru_RU.ts b/plugin-screensaver/translations/screensaver_ru_RU.ts index b46dd45..742e0b7 100644 --- a/plugin-screensaver/translations/screensaver_ru_RU.ts +++ b/plugin-screensaver/translations/screensaver_ru_RU.ts @@ -9,7 +9,7 @@ Блокировать экран - + Panel Screensaver: Global shortcut '%1' cannot be registered Хранитель экрана панели: глобальное сочетание клавиш '%1' не может быть зарегистрировано diff --git a/plugin-screensaver/translations/screensaver_sk_SK.ts b/plugin-screensaver/translations/screensaver_sk_SK.ts index 48c02b0..3e35ca9 100644 --- a/plugin-screensaver/translations/screensaver_sk_SK.ts +++ b/plugin-screensaver/translations/screensaver_sk_SK.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sl.ts b/plugin-screensaver/translations/screensaver_sl.ts index 6d5b03c..c04b712 100644 --- a/plugin-screensaver/translations/screensaver_sl.ts +++ b/plugin-screensaver/translations/screensaver_sl.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr@latin.ts b/plugin-screensaver/translations/screensaver_sr@latin.ts index 4ca5aa5..061eab1 100644 --- a/plugin-screensaver/translations/screensaver_sr@latin.ts +++ b/plugin-screensaver/translations/screensaver_sr@latin.ts @@ -9,7 +9,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr_BA.ts b/plugin-screensaver/translations/screensaver_sr_BA.ts index 2c54c35..e32806b 100644 --- a/plugin-screensaver/translations/screensaver_sr_BA.ts +++ b/plugin-screensaver/translations/screensaver_sr_BA.ts @@ -17,7 +17,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_sr_RS.ts b/plugin-screensaver/translations/screensaver_sr_RS.ts index 91df10e..c8d4794 100644 --- a/plugin-screensaver/translations/screensaver_sr_RS.ts +++ b/plugin-screensaver/translations/screensaver_sr_RS.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_th_TH.ts b/plugin-screensaver/translations/screensaver_th_TH.ts index 14d3316..f014b66 100644 --- a/plugin-screensaver/translations/screensaver_th_TH.ts +++ b/plugin-screensaver/translations/screensaver_th_TH.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_tr.ts b/plugin-screensaver/translations/screensaver_tr.ts index 7d2b0f3..0d1e185 100644 --- a/plugin-screensaver/translations/screensaver_tr.ts +++ b/plugin-screensaver/translations/screensaver_tr.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_uk.ts b/plugin-screensaver/translations/screensaver_uk.ts index d7ed6dd..73d977e 100644 --- a/plugin-screensaver/translations/screensaver_uk.ts +++ b/plugin-screensaver/translations/screensaver_uk.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_zh_CN.ts b/plugin-screensaver/translations/screensaver_zh_CN.ts index 84f1b8b..988ad1c 100644 --- a/plugin-screensaver/translations/screensaver_zh_CN.ts +++ b/plugin-screensaver/translations/screensaver_zh_CN.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-screensaver/translations/screensaver_zh_TW.ts b/plugin-screensaver/translations/screensaver_zh_TW.ts index d0e5939..b03475a 100644 --- a/plugin-screensaver/translations/screensaver_zh_TW.ts +++ b/plugin-screensaver/translations/screensaver_zh_TW.ts @@ -13,7 +13,7 @@ - + Panel Screensaver: Global shortcut '%1' cannot be registered diff --git a/plugin-sensors/CMakeLists.txt b/plugin-sensors/CMakeLists.txt index 5e5a262..a7f7956 100644 --- a/plugin-sensors/CMakeLists.txt +++ b/plugin-sensors/CMakeLists.txt @@ -18,14 +18,8 @@ set(SOURCES sensors.cpp ) -set(MOCS - lxqtsensorsplugin.h - lxqtsensors.h - lxqtsensorsconfiguration.h -) - set(UIS - lxqtsensorsconfiguration.ui + lxqtsensorsconfiguration.ui ) set(LIBRARIES ${SENSORS_LIB}) diff --git a/plugin-sensors/chip.cpp b/plugin-sensors/chip.cpp index 03e7c7c..09379f9 100644 --- a/plugin-sensors/chip.cpp +++ b/plugin-sensors/chip.cpp @@ -28,6 +28,7 @@ #include "chip.h" #include + Chip::Chip(const sensors_chip_name* sensorsChipName) : mSensorsChipName(sensorsChipName) { @@ -49,11 +50,13 @@ Chip::Chip(const sensors_chip_name* sensorsChipName) } } + const QString& Chip::getName() const { return mName; } + const QList& Chip::getFeatures() const { return mFeatures; diff --git a/plugin-sensors/chip.h b/plugin-sensors/chip.h index d5fc896..2993e95 100644 --- a/plugin-sensors/chip.h +++ b/plugin-sensors/chip.h @@ -29,9 +29,10 @@ #define CHIP_H #include "feature.h" -#include +#include "sensors.h" #include -#include +#include + /** * @brief Chip class is providing RAII-style for lm_sensors library diff --git a/plugin-sensors/feature.cpp b/plugin-sensors/feature.cpp index 7267f46..169f253 100644 --- a/plugin-sensors/feature.cpp +++ b/plugin-sensors/feature.cpp @@ -28,6 +28,7 @@ #include "feature.h" #include + Feature::Feature(const sensors_chip_name* sensorsChipName, const sensors_feature* sensorsFeature) : mSensorsChipName(sensorsChipName), mSensorsFeature(sensorsFeature) @@ -44,11 +45,13 @@ Feature::Feature(const sensors_chip_name* sensorsChipName, const sensors_feature << "(" << mLabel << ")"; } + const QString& Feature::getLabel() const { return mLabel; } + double Feature::getValue(sensors_subfeature_type subfeature_type) const { double result = 0; @@ -66,6 +69,7 @@ double Feature::getValue(sensors_subfeature_type subfeature_type) const return result; } + sensors_feature_type Feature::getType() const { return mSensorsFeature->type; diff --git a/plugin-sensors/feature.h b/plugin-sensors/feature.h index 5b9cc62..1f6c620 100644 --- a/plugin-sensors/feature.h +++ b/plugin-sensors/feature.h @@ -28,10 +28,11 @@ #ifndef FEATURE_H #define FEATURE_H -#include #include +#include #include + /** * @brief Feature class is providing RAII-style for lm_sensors library */ diff --git a/plugin-sensors/lxqtsensors.cpp b/plugin-sensors/lxqtsensors.cpp index 162e212..78feb04 100644 --- a/plugin-sensors/lxqtsensors.cpp +++ b/plugin-sensors/lxqtsensors.cpp @@ -29,10 +29,10 @@ #include "lxqtsensorsconfiguration.h" #include "../panel/ilxqtpanelplugin.h" #include "../panel/ilxqtpanel.h" +#include +#include #include #include -#include -#include LxQtSensors::LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent): @@ -108,24 +108,25 @@ LxQtSensors::LxQtSensors(ILxQtPanelPlugin *plugin, QWidget* parent): updateSensorReadings(); // Run timer that will be updating sensor readings - mUpdateSensorReadingsTimer.setParent(this); connect(&mUpdateSensorReadingsTimer, SIGNAL(timeout()), this, SLOT(updateSensorReadings())); mUpdateSensorReadingsTimer.start(mSettings->value("updateInterval").toInt() * 1000); // Run timer that will be showin warning - mWarningAboutHighTemperatureTimer.setParent(this); + mWarningAboutHighTemperatureTimer.setInterval(500); connect(&mWarningAboutHighTemperatureTimer, SIGNAL(timeout()), this, SLOT(warningAboutHighTemperature())); if (mSettings->value("warningAboutHighTemperature").toBool()) { - mWarningAboutHighTemperatureTimer.start(mWarningAboutHighTemperatureTimerFreq); + mWarningAboutHighTemperatureTimer.start(); } } + LxQtSensors::~LxQtSensors() { } + void LxQtSensors::updateSensorReadings() { QString tooltip; @@ -230,6 +231,7 @@ void LxQtSensors::updateSensorReadings() update(); } + void LxQtSensors::warningAboutHighTemperature() { // Iterator for temperature progress bars @@ -313,7 +315,8 @@ void LxQtSensors::settingsChanged() // Update sensors readings to get the list of high temperature progress bars updateSensorReadings(); - mWarningAboutHighTemperatureTimer.start(mWarningAboutHighTemperatureTimerFreq); + if (!mWarningAboutHighTemperatureTimer.isActive()) + mWarningAboutHighTemperatureTimer.start(); } else if (mWarningAboutHighTemperatureTimer.isActive()) { @@ -327,6 +330,7 @@ void LxQtSensors::settingsChanged() update(); } + void LxQtSensors::realign() { // Default values for LxQtPanel::PositionBottom or LxQtPanel::PositionTop @@ -375,12 +379,14 @@ void LxQtSensors::realign() } } + double LxQtSensors::celsiusToFahrenheit(double celsius) { // Fahrenheit = 32 * (9/5) * Celsius return 32 + 1.8 * celsius; } + void LxQtSensors::initDefaultSettings() { if (!mSettings->contains("updateInterval")) @@ -435,11 +441,13 @@ void LxQtSensors::initDefaultSettings() } } + ProgressBar::ProgressBar(QWidget *parent): QProgressBar(parent) { } + QSize ProgressBar::sizeHint() const { return QSize(20, 20); diff --git a/plugin-sensors/lxqtsensors.h b/plugin-sensors/lxqtsensors.h index 45f6b7d..0769e53 100644 --- a/plugin-sensors/lxqtsensors.h +++ b/plugin-sensors/lxqtsensors.h @@ -30,10 +30,10 @@ #include "sensors.h" #include -#include #include -#include #include +#include + class ProgressBar: public QProgressBar { @@ -67,8 +67,6 @@ private: QBoxLayout *mLayout; QTimer mUpdateSensorReadingsTimer; QTimer mWarningAboutHighTemperatureTimer; - // How often warning time should fire in ms - int mWarningAboutHighTemperatureTimerFreq; Sensors mSensors; QList mDetectedChips; QList mTemperatureProgressBars; diff --git a/plugin-sensors/lxqtsensorsconfiguration.cpp b/plugin-sensors/lxqtsensorsconfiguration.cpp index efb7d34..013e894 100644 --- a/plugin-sensors/lxqtsensorsconfiguration.cpp +++ b/plugin-sensors/lxqtsensorsconfiguration.cpp @@ -25,14 +25,14 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtsensorsconfiguration.h" #include "ui_lxqtsensorsconfiguration.h" -#include -#include #include #include #include +#include +#include + LxQtSensorsConfiguration::LxQtSensorsConfiguration(QSettings *settings, QWidget *parent) : QDialog(parent), @@ -62,11 +62,13 @@ LxQtSensorsConfiguration::LxQtSensorsConfiguration(QSettings *settings, QWidget */ } + LxQtSensorsConfiguration::~LxQtSensorsConfiguration() { delete ui; } + void LxQtSensorsConfiguration::loadSettings() { ui->updateIntervalSB->setValue(mSettings->value("updateInterval").toInt()); @@ -99,6 +101,7 @@ void LxQtSensorsConfiguration::loadSettings() mSettings->value("warningAboutHighTemperature").toBool()); } + void LxQtSensorsConfiguration::saveSettings() { mSettings->setValue("updateInterval", ui->updateIntervalSB->value()); @@ -150,6 +153,7 @@ void LxQtSensorsConfiguration::saveSettings() ui->warningAboutHighTemperatureChB->isChecked()); } + void LxQtSensorsConfiguration::dialogButtonsAction(QAbstractButton *btn) { if (ui->buttons->buttonRole(btn) == QDialogButtonBox::ResetRole) @@ -163,6 +167,7 @@ void LxQtSensorsConfiguration::dialogButtonsAction(QAbstractButton *btn) } } + void LxQtSensorsConfiguration::changeProgressBarColor() { QAbstractButton* btn = qobject_cast(sender()); @@ -185,6 +190,7 @@ void LxQtSensorsConfiguration::changeProgressBarColor() } } + void LxQtSensorsConfiguration::detectedChipSelected(int index) { mSettings->beginGroup("chips"); @@ -244,4 +250,3 @@ void LxQtSensorsConfiguration::detectedChipSelected(int index) mSettings->endGroup(); } - diff --git a/plugin-sensors/lxqtsensorsconfiguration.h b/plugin-sensors/lxqtsensorsconfiguration.h index 0601e2d..d2823c0 100644 --- a/plugin-sensors/lxqtsensorsconfiguration.h +++ b/plugin-sensors/lxqtsensorsconfiguration.h @@ -25,18 +25,17 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #ifndef LXQTSENSORSCONFIGURATION_H #define LXQTSENSORSCONFIGURATION_H -#include #include #include -#include #include - +#include +#include #include + namespace Ui { class LxQtSensorsConfiguration; } diff --git a/plugin-sensors/lxqtsensorsplugin.cpp b/plugin-sensors/lxqtsensorsplugin.cpp index aa1e67a..f6e4ae6 100644 --- a/plugin-sensors/lxqtsensorsplugin.cpp +++ b/plugin-sensors/lxqtsensorsplugin.cpp @@ -25,11 +25,11 @@ * * END_COMMON_COPYRIGHT_HEADER */ - #include "lxqtsensorsplugin.h" #include "lxqtsensors.h" #include "lxqtsensorsconfiguration.h" + LxQtSensorsPlugin::LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), ILxQtPanelPlugin(startupInfo), @@ -37,26 +37,31 @@ LxQtSensorsPlugin::LxQtSensorsPlugin(const ILxQtPanelPluginStartupInfo &startupI { } + LxQtSensorsPlugin::~LxQtSensorsPlugin() { delete mWidget; } + QWidget *LxQtSensorsPlugin::widget() { return mWidget; } + QDialog *LxQtSensorsPlugin::configureDialog() { - return new LxQtSensorsConfiguration(settings(), mWidget); + return new LxQtSensorsConfiguration(settings()); } + void LxQtSensorsPlugin::realign() { mWidget->realign(); } + void LxQtSensorsPlugin::settingsChanged() { mWidget->settingsChanged(); diff --git a/plugin-sensors/lxqtsensorsplugin.h b/plugin-sensors/lxqtsensorsplugin.h index 749c32b..678bb2e 100644 --- a/plugin-sensors/lxqtsensorsplugin.h +++ b/plugin-sensors/lxqtsensorsplugin.h @@ -29,9 +29,10 @@ #ifndef LXQTSENSORSPLUGIN_H #define LXQTSENSORSPLUGIN_H - #include "../panel/ilxqtpanelplugin.h" #include + + class LxQtSensors; class LxQtSensorsPlugin: public QObject, public ILxQtPanelPlugin @@ -64,11 +65,10 @@ class LxQtSensorsPluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtSensorsPlugin(startupInfo); } }; - #endif // LXQTSENSORSPLUGIN_H diff --git a/plugin-sensors/sensors.cpp b/plugin-sensors/sensors.cpp index 6f486d8..a4c0a09 100644 --- a/plugin-sensors/sensors.cpp +++ b/plugin-sensors/sensors.cpp @@ -28,10 +28,12 @@ #include "sensors.h" #include + QList Sensors::mDetectedChips = QList(); int Sensors::mInstanceCounter = 0; bool Sensors::mSensorsInitialized = false; + Sensors::Sensors() { // Increase instance counter @@ -53,6 +55,7 @@ Sensors::Sensors() } } + Sensors::~Sensors() { // Decrease instance counter @@ -68,8 +71,8 @@ Sensors::~Sensors() } } + const QList& Sensors::getDetectedChips() const { return mDetectedChips; } - diff --git a/plugin-sensors/sensors.h b/plugin-sensors/sensors.h index 190fe38..43cd502 100644 --- a/plugin-sensors/sensors.h +++ b/plugin-sensors/sensors.h @@ -32,6 +32,9 @@ #include #include + +class Chip; + /** * @brief Sensors class is providing RAII-style for lm_sensors library */ diff --git a/plugin-sensors/translations/sensors.ts b/plugin-sensors/translations/sensors.ts index c2ea741..0509b2d 100644 --- a/plugin-sensors/translations/sensors.ts +++ b/plugin-sensors/translations/sensors.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_ca.ts b/plugin-sensors/translations/sensors_ca.ts index b0aa48d..2be5bef 100644 --- a/plugin-sensors/translations/sensors_ca.ts +++ b/plugin-sensors/translations/sensors_ca.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_cs.ts b/plugin-sensors/translations/sensors_cs.ts index f7bc3bc..1394911 100644 --- a/plugin-sensors/translations/sensors_cs.ts +++ b/plugin-sensors/translations/sensors_cs.ts @@ -68,17 +68,17 @@ Vlastnosti čipů: - + Enabled Povoleno - + Label Štítek - + Color Barva diff --git a/plugin-sensors/translations/sensors_cs_CZ.ts b/plugin-sensors/translations/sensors_cs_CZ.ts index a3b8685..d0cf8e5 100644 --- a/plugin-sensors/translations/sensors_cs_CZ.ts +++ b/plugin-sensors/translations/sensors_cs_CZ.ts @@ -68,17 +68,17 @@ Vlastnosti čipů: - + Enabled Povoleno - + Label Štítek - + Color Barva diff --git a/plugin-sensors/translations/sensors_da_DK.ts b/plugin-sensors/translations/sensors_da_DK.ts index 203eb1a..5194907 100644 --- a/plugin-sensors/translations/sensors_da_DK.ts +++ b/plugin-sensors/translations/sensors_da_DK.ts @@ -68,17 +68,17 @@ Chipsæt funktioner: - + Enabled Aktiveret - + Label Identifikation - + Color Farve diff --git a/plugin-sensors/translations/sensors_de.desktop b/plugin-sensors/translations/sensors_de.desktop new file mode 100644 index 0000000..f71d2a6 --- /dev/null +++ b/plugin-sensors/translations/sensors_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Sensoren +Comment[de]=Messwerte der Hardware-Sensoren anzeigen. diff --git a/plugin-sensors/translations/sensors_de_DE.ts b/plugin-sensors/translations/sensors_de.ts similarity index 82% rename from plugin-sensors/translations/sensors_de_DE.ts rename to plugin-sensors/translations/sensors_de.ts index 1a94761..eb1dea4 100644 --- a/plugin-sensors/translations/sensors_de_DE.ts +++ b/plugin-sensors/translations/sensors_de.ts @@ -1,16 +1,12 @@ - + LxQtSensorsConfiguration - - LxQt Sensors Settings - LxQt Sensor Einstellungen - Sensors Settings - + Sensor-Einstellungen @@ -20,12 +16,12 @@ Update interval (seconds) - Aktualisierungs Intervall (Sekunden) + Aktualisierungsintervall (Sekunden) Temperature bar width - Temperaturbalken Breite + Temperaturbalkenbreite @@ -50,7 +46,7 @@ Warning about high temperature - Warnung über zu hohe Temperaturen + Warnung bei zu hoher Temperatur @@ -60,25 +56,25 @@ Detected chips: - Erkannte Chips: + Erkannte Bausteine: Chip features: - Chip Eigenschaften: + Bausteineigenschaften: - + Enabled Aktiviert - + Label Bezeichnung - + Color Farbe diff --git a/plugin-sensors/translations/sensors_de_DE.desktop b/plugin-sensors/translations/sensors_de_DE.desktop deleted file mode 100644 index 34012ef..0000000 --- a/plugin-sensors/translations/sensors_de_DE.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Sensors -Comment=View readings from hardware sensors. - - -# Translations -Name[de_DE]=Sensoren -Comment[de_DE]=Zeige die Sensorwerte der Hardware-Sensoren (momentan lm_sensors) diff --git a/plugin-sensors/translations/sensors_el_GR.ts b/plugin-sensors/translations/sensors_el_GR.ts index 2a86807..9ab37bd 100644 --- a/plugin-sensors/translations/sensors_el_GR.ts +++ b/plugin-sensors/translations/sensors_el_GR.ts @@ -68,17 +68,17 @@ Χαρακτηριστικά κυκλώματος - + Enabled Ενεργοποιημένο - + Label Ετικέτα - + Color Χρώμα diff --git a/plugin-sensors/translations/sensors_es.ts b/plugin-sensors/translations/sensors_es.ts index 2106827..6b4036d 100644 --- a/plugin-sensors/translations/sensors_es.ts +++ b/plugin-sensors/translations/sensors_es.ts @@ -68,17 +68,17 @@ Características del chip: - + Enabled Habilitado - + Label Etiqueta - + Color Color diff --git a/plugin-sensors/translations/sensors_es_VE.ts b/plugin-sensors/translations/sensors_es_VE.ts index 5003fea..46578b1 100644 --- a/plugin-sensors/translations/sensors_es_VE.ts +++ b/plugin-sensors/translations/sensors_es_VE.ts @@ -68,17 +68,17 @@ Chips caracteristicas: - + Enabled Habilitado - + Label Etiqueta - + Color Color diff --git a/plugin-sensors/translations/sensors_eu.ts b/plugin-sensors/translations/sensors_eu.ts index 4529507..e247486 100644 --- a/plugin-sensors/translations/sensors_eu.ts +++ b/plugin-sensors/translations/sensors_eu.ts @@ -68,17 +68,17 @@ Txiparen ezaugarriak: - + Enabled Gaituta - + Label Etiketa - + Color Kolorea diff --git a/plugin-sensors/translations/sensors_fi.ts b/plugin-sensors/translations/sensors_fi.ts index 52fe6ae..483bf94 100644 --- a/plugin-sensors/translations/sensors_fi.ts +++ b/plugin-sensors/translations/sensors_fi.ts @@ -64,17 +64,17 @@ - + Enabled Käytössä - + Label Nimike - + Color Väri diff --git a/plugin-sensors/translations/sensors_fr_FR.ts b/plugin-sensors/translations/sensors_fr_FR.ts index 08edd39..e10e395 100644 --- a/plugin-sensors/translations/sensors_fr_FR.ts +++ b/plugin-sensors/translations/sensors_fr_FR.ts @@ -64,17 +64,17 @@ - + Enabled - + Label - + Color diff --git a/plugin-sensors/translations/sensors_hu.desktop b/plugin-sensors/translations/sensors_hu.desktop index fb4fb3f..0a041a6 100644 --- a/plugin-sensors/translations/sensors_hu.desktop +++ b/plugin-sensors/translations/sensors_hu.desktop @@ -6,5 +6,5 @@ Comment=View readings from hardware sensors. # Translations -Name[hu]=Szenzorok -Comment[hu]=Megjeleníti a hardver szenzorjainak értékeit. +Name[hu]=Érzékelők +Comment[hu]=Megjeleníti a gépbe épített érzékelők értékeit. diff --git a/plugin-sensors/translations/sensors_hu.ts b/plugin-sensors/translations/sensors_hu.ts new file mode 100644 index 0000000..610033c --- /dev/null +++ b/plugin-sensors/translations/sensors_hu.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/plugin-sensors/translations/sensors_hu_HU.ts b/plugin-sensors/translations/sensors_hu_HU.ts new file mode 100644 index 0000000..e0deadc --- /dev/null +++ b/plugin-sensors/translations/sensors_hu_HU.ts @@ -0,0 +1,82 @@ + + + + + LxQtSensorsConfiguration + + + Sensors Settings + Érzékelők beállítása + + + + Common + Általános + + + + Update interval (seconds) + Frissítési köz (másodperc) + + + + Temperature bar width + Hősáv szélesség + + + + Temperature scale + Hőfok skálaérték + + + + Celsius + + + + + Fahrenheit + + + + + Blink progress bars when the temperature is too high + A mutatósáv túl nagy hőfoknál villog + + + + Warning about high temperature + Nagy hőfoknál figyelmeztetés + + + + Sensors + Érzékelők + + + + Detected chips: + Észlelt érzékelők: + + + + Chip features: + Érzékelő jellemzői: + + + + Enabled + Engedélyezve + + + + Label + Felirat + + + + Color + Szín + + + diff --git a/plugin-sensors/translations/sensors_it_IT.ts b/plugin-sensors/translations/sensors_it_IT.ts index 35562ef..180f6be 100644 --- a/plugin-sensors/translations/sensors_it_IT.ts +++ b/plugin-sensors/translations/sensors_it_IT.ts @@ -68,17 +68,17 @@ Caratteristiche del chip: - + Enabled Attivato - + Label Etichetta - + Color Colore diff --git a/plugin-sensors/translations/sensors_ja.ts b/plugin-sensors/translations/sensors_ja.ts index deb64a8..4ede2b0 100644 --- a/plugin-sensors/translations/sensors_ja.ts +++ b/plugin-sensors/translations/sensors_ja.ts @@ -64,17 +64,17 @@ チップの機能: - + Enabled 有効 - + Label ラベル - + Color diff --git a/plugin-sensors/translations/sensors_pl_PL.ts b/plugin-sensors/translations/sensors_pl_PL.ts index 10a9450..1d616ca 100644 --- a/plugin-sensors/translations/sensors_pl_PL.ts +++ b/plugin-sensors/translations/sensors_pl_PL.ts @@ -68,17 +68,17 @@ Cechy chipu: - + Enabled Włączone - + Label Etykieta - + Color Kolor diff --git a/plugin-sensors/translations/sensors_pt.ts b/plugin-sensors/translations/sensors_pt.ts index 687b1d3..e16dcf6 100644 --- a/plugin-sensors/translations/sensors_pt.ts +++ b/plugin-sensors/translations/sensors_pt.ts @@ -68,17 +68,17 @@ Funcionalidades do circuito: - + Enabled Ativo - + Label Texto - + Color Cor diff --git a/plugin-sensors/translations/sensors_pt_BR.ts b/plugin-sensors/translations/sensors_pt_BR.ts index 69da076..355723a 100644 --- a/plugin-sensors/translations/sensors_pt_BR.ts +++ b/plugin-sensors/translations/sensors_pt_BR.ts @@ -68,17 +68,17 @@ Características do chips: - + Enabled Habilitado - + Label Rótulo - + Color Cor diff --git a/plugin-sensors/translations/sensors_ro_RO.ts b/plugin-sensors/translations/sensors_ro_RO.ts index 76c438c..c15eb19 100644 --- a/plugin-sensors/translations/sensors_ro_RO.ts +++ b/plugin-sensors/translations/sensors_ro_RO.ts @@ -64,17 +64,17 @@ - + Enabled - + Label Etichetă - + Color Culoare diff --git a/plugin-sensors/translations/sensors_ru.ts b/plugin-sensors/translations/sensors_ru.ts index c613473..292f093 100644 --- a/plugin-sensors/translations/sensors_ru.ts +++ b/plugin-sensors/translations/sensors_ru.ts @@ -64,17 +64,17 @@ Возможности чипов: - + Enabled Включён - + Label Метка - + Color Цвет diff --git a/plugin-sensors/translations/sensors_ru_RU.ts b/plugin-sensors/translations/sensors_ru_RU.ts index 86ee6b8..e71a227 100644 --- a/plugin-sensors/translations/sensors_ru_RU.ts +++ b/plugin-sensors/translations/sensors_ru_RU.ts @@ -64,17 +64,17 @@ Возможности чипов: - + Enabled Включён - + Label Метка - + Color Цвет diff --git a/plugin-sensors/translations/sensors_th_TH.ts b/plugin-sensors/translations/sensors_th_TH.ts index ec200bc..8e97b20 100644 --- a/plugin-sensors/translations/sensors_th_TH.ts +++ b/plugin-sensors/translations/sensors_th_TH.ts @@ -68,17 +68,17 @@ คุณสมบัติชิป: - + Enabled เปิดใช้ - + Label ป้าย - + Color สี diff --git a/plugin-sensors/translations/sensors_uk.ts b/plugin-sensors/translations/sensors_uk.ts index e75ea85..30d6a98 100644 --- a/plugin-sensors/translations/sensors_uk.ts +++ b/plugin-sensors/translations/sensors_uk.ts @@ -68,17 +68,17 @@ Особливості мікросхеми: - + Enabled Включено - + Label Позначка - + Color Колір diff --git a/plugin-sensors/translations/sensors_zh_CN.ts b/plugin-sensors/translations/sensors_zh_CN.ts index a44cfb8..e3b8010 100644 --- a/plugin-sensors/translations/sensors_zh_CN.ts +++ b/plugin-sensors/translations/sensors_zh_CN.ts @@ -68,17 +68,17 @@ 芯片功能: - + Enabled 已启用 - + Label 标注 - + Color 颜色 diff --git a/plugin-sensors/translations/sensors_zh_TW.ts b/plugin-sensors/translations/sensors_zh_TW.ts index 0f41acd..428d7c2 100644 --- a/plugin-sensors/translations/sensors_zh_TW.ts +++ b/plugin-sensors/translations/sensors_zh_TW.ts @@ -68,17 +68,17 @@ 晶片資訊 - + Enabled 允許 - + Label 標籤 - + Color 顏色 diff --git a/plugin-showdesktop/CMakeLists.txt b/plugin-showdesktop/CMakeLists.txt index e621065..8913718 100644 --- a/plugin-showdesktop/CMakeLists.txt +++ b/plugin-showdesktop/CMakeLists.txt @@ -8,14 +8,11 @@ set(SOURCES showdesktop.cpp ) -set(MOCS - showdesktop.h -) - set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt-globalkeys + Qt5Xdg + ${XCB_LIBRARIES} ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-showdesktop/showdesktop.cpp b/plugin-showdesktop/showdesktop.cpp index 2daa9cd..aa76831 100644 --- a/plugin-showdesktop/showdesktop.cpp +++ b/plugin-showdesktop/showdesktop.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include "showdesktop.h" // Still needed for lxde/lxqt#338 @@ -48,16 +48,8 @@ ShowDesktop::ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo) : m_key = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/show_hide").arg(settings()->group()), tr("Show desktop"), this); if (m_key) { + connect(m_key, &GlobalKeyShortcut::Action::registrationFinished, this, &ShowDesktop::shortcutRegistered); connect(m_key, SIGNAL(activated()), this, SLOT(toggleShowingDesktop())); - - if (m_key->shortcut().isEmpty()) - { - m_key->changeShortcut(DEFAULT_SHORTCUT); - if (m_key->shortcut().isEmpty()) - { - LxQt::Notification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); - } - } } QAction * act = new QAction(XdgIcon::fromTheme("user-desktop"), tr("Show Desktop"), this); @@ -67,35 +59,21 @@ ShowDesktop::ShowDesktop(const ILxQtPanelPluginStartupInfo &startupInfo) : mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } -void ShowDesktop::toggleShowingDesktop() +void ShowDesktop::shortcutRegistered() { - // Paulo: KWindowSystem is not working for Openbox here, see lxde/lxqt#338 - // KWindowSystem fix: https://git.reviewboard.kde.org/r/121667 - // NETRootInfo info(QX11Info::connection(), NET::WMDesktop); - // info.setShowingDesktop(!KWindowSystem::showingDesktop()); - - const char *atomStr = "_NET_SHOWING_DESKTOP"; - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), false, strlen(atomStr), atomStr); - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(QX11Info::connection(), cookie, 0); - xcb_atom_t showing_desktop_atom = reply->atom; - free(reply); - - uint32_t data[5] = { - uint32_t(KWindowSystem::showingDesktop() ? 0 : 1), 0, 0, 0, 0 - }; - - xcb_client_message_event_t event; - event.response_type = XCB_CLIENT_MESSAGE; - event.format = 32; - event.sequence = 0; - event.window = QX11Info::appRootWindow(); - event.type = showing_desktop_atom; - for (int i = 0; i < 5; i++) - event.data.data32[i] = data[i]; + if (m_key->shortcut().isEmpty()) + { + m_key->changeShortcut(DEFAULT_SHORTCUT); + if (m_key->shortcut().isEmpty()) + { + LxQt::Notification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT)); + } + } +} - xcb_send_event(QX11Info::connection(), false, QX11Info::appRootWindow(), - (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), - (const char *) &event); +void ShowDesktop::toggleShowingDesktop() +{ + KWindowSystem::setShowingDesktop(!KWindowSystem::showingDesktop()); } #undef DEFAULT_SHORTCUT diff --git a/plugin-showdesktop/showdesktop.h b/plugin-showdesktop/showdesktop.h index f7f73ef..4e1e9a1 100644 --- a/plugin-showdesktop/showdesktop.h +++ b/plugin-showdesktop/showdesktop.h @@ -52,6 +52,7 @@ private: private slots: void toggleShowingDesktop(); + void shortcutRegistered(); private: QToolButton mButton; @@ -60,10 +61,10 @@ private: class ShowDesktopLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new ShowDesktop(startupInfo); } diff --git a/plugin-showdesktop/translations/showdesktop.ts b/plugin-showdesktop/translations/showdesktop.ts index 8273cb2..a6c2691 100644 --- a/plugin-showdesktop/translations/showdesktop.ts +++ b/plugin-showdesktop/translations/showdesktop.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_ar.ts b/plugin-showdesktop/translations/showdesktop_ar.ts index f6cce6f..e2b1e08 100644 --- a/plugin-showdesktop/translations/showdesktop_ar.ts +++ b/plugin-showdesktop/translations/showdesktop_ar.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` - + Show Desktop إظهار سطح المكتب diff --git a/plugin-showdesktop/translations/showdesktop_cs.ts b/plugin-showdesktop/translations/showdesktop_cs.ts index 9b074ca..8093964 100644 --- a/plugin-showdesktop/translations/showdesktop_cs.ts +++ b/plugin-showdesktop/translations/showdesktop_cs.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Show Desktop Ukázat pracovní plochu diff --git a/plugin-showdesktop/translations/showdesktop_cs_CZ.ts b/plugin-showdesktop/translations/showdesktop_cs_CZ.ts index fc755f0..cdaae29 100644 --- a/plugin-showdesktop/translations/showdesktop_cs_CZ.ts +++ b/plugin-showdesktop/translations/showdesktop_cs_CZ.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Show Desktop Ukázat pracovní plochu diff --git a/plugin-showdesktop/translations/showdesktop_da.ts b/plugin-showdesktop/translations/showdesktop_da.ts index 53343be..ab2af5c 100644 --- a/plugin-showdesktop/translations/showdesktop_da.ts +++ b/plugin-showdesktop/translations/showdesktop_da.ts @@ -17,12 +17,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Vis skrivebord diff --git a/plugin-showdesktop/translations/showdesktop_da_DK.ts b/plugin-showdesktop/translations/showdesktop_da_DK.ts index ef1f519..158a56f 100644 --- a/plugin-showdesktop/translations/showdesktop_da_DK.ts +++ b/plugin-showdesktop/translations/showdesktop_da_DK.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Vis Skrivebord: Global genvej '%1' kan ikke registreres - + Show Desktop Vis Skrivebord diff --git a/plugin-showdesktop/translations/showdesktop_de.desktop b/plugin-showdesktop/translations/showdesktop_de.desktop index 83fc665..b79fdc3 100644 --- a/plugin-showdesktop/translations/showdesktop_de.desktop +++ b/plugin-showdesktop/translations/showdesktop_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Show desktop -Comment=Minimize all windows and show the desktop - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Minimiere alle Fenster und zeige den Desktop -Name[de]=Zeige Desktop +Name[de]=Arbeitsfläche anzeigen +Comment[de]=Alle Fenster minimieren und die Arbeitsfläche anzeigen diff --git a/plugin-showdesktop/translations/showdesktop_de.ts b/plugin-showdesktop/translations/showdesktop_de.ts index 50f630b..f00c7af 100644 --- a/plugin-showdesktop/translations/showdesktop_de.ts +++ b/plugin-showdesktop/translations/showdesktop_de.ts @@ -3,28 +3,20 @@ ShowDesktop - - Global keyboard shortcut - Globales Tastaturkürzel - - - Panel Show Desktop Global shortcut: '%1' cannot be registered - Globales Tastenkürzel für Arbeitsfläche anzeigen: »%1« kann nicht registriert werden - Show desktop - + Arbeitsfläche anzeigen - - Show Desktop: Global shortcut '%1' cannot be registered - + + Show Desktop + Arbeitsfläche anzeigen - - Show Desktop - Zeige Arbeitsoberfläche + + Show Desktop: Global shortcut '%1' cannot be registered + Das globale Tastaturkürzel zum Arbeitsfläche anzeigen '%1' kann nicht registriert werden diff --git a/plugin-showdesktop/translations/showdesktop_de_DE.desktop b/plugin-showdesktop/translations/showdesktop_de_DE.desktop deleted file mode 100644 index dbcc5c5..0000000 --- a/plugin-showdesktop/translations/showdesktop_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Show desktop -Comment=Minimize all windows and show the desktop - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Alle Fenster minimieren und Desktop anzeigen -Name[de_DE]=Desktop anzeigen diff --git a/plugin-showdesktop/translations/showdesktop_de_DE.ts b/plugin-showdesktop/translations/showdesktop_de_DE.ts deleted file mode 100644 index 19ac187..0000000 --- a/plugin-showdesktop/translations/showdesktop_de_DE.ts +++ /dev/null @@ -1,22 +0,0 @@ - - - - - ShowDesktop - - - Show desktop - - - - - Show Desktop: Global shortcut '%1' cannot be registered - Zeige Desktop: Globales Tastenkürzel '%1' kann nicht vergeben werden - - - - Show Desktop - Zeige Desktop - - - diff --git a/plugin-showdesktop/translations/showdesktop_el_GR.ts b/plugin-showdesktop/translations/showdesktop_el_GR.ts index 577e184..27c2144 100644 --- a/plugin-showdesktop/translations/showdesktop_el_GR.ts +++ b/plugin-showdesktop/translations/showdesktop_el_GR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" - + Show Desktop Εμφάνιση επιφάνειας εργασίας diff --git a/plugin-showdesktop/translations/showdesktop_eo.ts b/plugin-showdesktop/translations/showdesktop_eo.ts index bbe2112..c4bfe66 100644 --- a/plugin-showdesktop/translations/showdesktop_eo.ts +++ b/plugin-showdesktop/translations/showdesktop_eo.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Montri labortablon: ĉiea klavkombino '%1' ne registreblas - + Show Desktop Montri labortablon diff --git a/plugin-showdesktop/translations/showdesktop_es.ts b/plugin-showdesktop/translations/showdesktop_es.ts index ca96ae1..d947a16 100644 --- a/plugin-showdesktop/translations/showdesktop_es.ts +++ b/plugin-showdesktop/translations/showdesktop_es.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar Escritorio: Atajo global '%1' no puede ser registrado - + Show Desktop Mostrar Escritorio diff --git a/plugin-showdesktop/translations/showdesktop_es_VE.ts b/plugin-showdesktop/translations/showdesktop_es_VE.ts index 4e8b7ce..d310ccc 100644 --- a/plugin-showdesktop/translations/showdesktop_es_VE.ts +++ b/plugin-showdesktop/translations/showdesktop_es_VE.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse - + Show Desktop Mostrar Escritorio diff --git a/plugin-showdesktop/translations/showdesktop_eu.ts b/plugin-showdesktop/translations/showdesktop_eu.ts index e2e5ba8..65f79ca 100644 --- a/plugin-showdesktop/translations/showdesktop_eu.ts +++ b/plugin-showdesktop/translations/showdesktop_eu.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu - + Show Desktop Erakutsi mahaigaina diff --git a/plugin-showdesktop/translations/showdesktop_fi.ts b/plugin-showdesktop/translations/showdesktop_fi.ts index 0ffbe54..24025ec 100644 --- a/plugin-showdesktop/translations/showdesktop_fi.ts +++ b/plugin-showdesktop/translations/showdesktop_fi.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä - + Show Desktop Näytä työpöytä diff --git a/plugin-showdesktop/translations/showdesktop_fr_FR.ts b/plugin-showdesktop/translations/showdesktop_fr_FR.ts index 51d92a9..ebf9d2d 100644 --- a/plugin-showdesktop/translations/showdesktop_fr_FR.ts +++ b/plugin-showdesktop/translations/showdesktop_fr_FR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Montrer le bureau : le raccourci global '%1' ne peut pas être défini - + Show Desktop Montrer le bureau diff --git a/plugin-showdesktop/translations/showdesktop_hu.ts b/plugin-showdesktop/translations/showdesktop_hu.ts index 332cc7e..8975255 100644 --- a/plugin-showdesktop/translations/showdesktop_hu.ts +++ b/plugin-showdesktop/translations/showdesktop_hu.ts @@ -1,22 +1,22 @@ - + ShowDesktop Show desktop - + Asztalmegjelenítés - + Show Desktop: Global shortcut '%1' cannot be registered - + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható - + Show Desktop - + Asztalmegjelenítés diff --git a/plugin-showdesktop/translations/showdesktop_hu_HU.ts b/plugin-showdesktop/translations/showdesktop_hu_HU.ts index 139f771..a3dfb55 100644 --- a/plugin-showdesktop/translations/showdesktop_hu_HU.ts +++ b/plugin-showdesktop/translations/showdesktop_hu_HU.ts @@ -1,22 +1,22 @@ - + ShowDesktop Show desktop - + Asztalmegjelenítés - + Show Desktop: Global shortcut '%1' cannot be registered - + Asztalmegjelenítés: A '%1' gyorsbillentyű nem regisztrálható - + Show Desktop - Az asztal megjelenítése + Asztalmegjelenítés diff --git a/plugin-showdesktop/translations/showdesktop_ia.ts b/plugin-showdesktop/translations/showdesktop_ia.ts index b5e08da..e6ab8cb 100644 --- a/plugin-showdesktop/translations/showdesktop_ia.ts +++ b/plugin-showdesktop/translations/showdesktop_ia.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_id_ID.ts b/plugin-showdesktop/translations/showdesktop_id_ID.ts index 716c8ab..2b356d5 100644 --- a/plugin-showdesktop/translations/showdesktop_id_ID.ts +++ b/plugin-showdesktop/translations/showdesktop_id_ID.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Tampilkan Desktop diff --git a/plugin-showdesktop/translations/showdesktop_it_IT.ts b/plugin-showdesktop/translations/showdesktop_it_IT.ts index 3d47876..f879db9 100644 --- a/plugin-showdesktop/translations/showdesktop_it_IT.ts +++ b/plugin-showdesktop/translations/showdesktop_it_IT.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostra desktop: la scorciatoia globale '%1' non può essere registrata - + Show Desktop Mostra desktop diff --git a/plugin-showdesktop/translations/showdesktop_ja.ts b/plugin-showdesktop/translations/showdesktop_ja.ts index 4ca0e2f..19d0152 100644 --- a/plugin-showdesktop/translations/showdesktop_ja.ts +++ b/plugin-showdesktop/translations/showdesktop_ja.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered デスクトップの表示: グローバルなショートカット '%1' は登録できません - + Show Desktop デスクトップを表示 diff --git a/plugin-showdesktop/translations/showdesktop_ko.ts b/plugin-showdesktop/translations/showdesktop_ko.ts index 42a6b5c..bc35785 100644 --- a/plugin-showdesktop/translations/showdesktop_ko.ts +++ b/plugin-showdesktop/translations/showdesktop_ko.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_lt.ts b/plugin-showdesktop/translations/showdesktop_lt.ts index 12181ad..e15e2b0 100644 --- a/plugin-showdesktop/translations/showdesktop_lt.ts +++ b/plugin-showdesktop/translations/showdesktop_lt.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas - + Show Desktop Rodyti darbalaukį diff --git a/plugin-showdesktop/translations/showdesktop_nl.ts b/plugin-showdesktop/translations/showdesktop_nl.ts index 92a8190..bdaf9c0 100644 --- a/plugin-showdesktop/translations/showdesktop_nl.ts +++ b/plugin-showdesktop/translations/showdesktop_nl.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd - + Show Desktop Toon bureaublad diff --git a/plugin-showdesktop/translations/showdesktop_pl_PL.ts b/plugin-showdesktop/translations/showdesktop_pl_PL.ts index 4d592c0..9793ae5 100644 --- a/plugin-showdesktop/translations/showdesktop_pl_PL.ts +++ b/plugin-showdesktop/translations/showdesktop_pl_PL.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany - + Show Desktop Pokaż pulpit diff --git a/plugin-showdesktop/translations/showdesktop_pt.ts b/plugin-showdesktop/translations/showdesktop_pt.ts index 7413c63..1ae73d2 100644 --- a/plugin-showdesktop/translations/showdesktop_pt.ts +++ b/plugin-showdesktop/translations/showdesktop_pt.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Tecla de atalho global: '%1' não pode ser registada - + Show Desktop Mostrar área de trabalho diff --git a/plugin-showdesktop/translations/showdesktop_pt_BR.ts b/plugin-showdesktop/translations/showdesktop_pt_BR.ts index 40c910a..777d91f 100644 --- a/plugin-showdesktop/translations/showdesktop_pt_BR.ts +++ b/plugin-showdesktop/translations/showdesktop_pt_BR.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado - + Show Desktop Exibir a área de trabalho diff --git a/plugin-showdesktop/translations/showdesktop_ro_RO.ts b/plugin-showdesktop/translations/showdesktop_ro_RO.ts index b75723e..9deca7c 100644 --- a/plugin-showdesktop/translations/showdesktop_ro_RO.ts +++ b/plugin-showdesktop/translations/showdesktop_ro_RO.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Afișează desktopul diff --git a/plugin-showdesktop/translations/showdesktop_ru.ts b/plugin-showdesktop/translations/showdesktop_ru.ts index 20f4b52..10a1e7b 100644 --- a/plugin-showdesktop/translations/showdesktop_ru.ts +++ b/plugin-showdesktop/translations/showdesktop_ru.ts @@ -9,12 +9,12 @@ Показать рабочий стол - + Show Desktop: Global shortcut '%1' cannot be registered Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано - + Show Desktop Показать рабочий стол diff --git a/plugin-showdesktop/translations/showdesktop_ru_RU.ts b/plugin-showdesktop/translations/showdesktop_ru_RU.ts index ceaedf8..c6d4427 100644 --- a/plugin-showdesktop/translations/showdesktop_ru_RU.ts +++ b/plugin-showdesktop/translations/showdesktop_ru_RU.ts @@ -9,12 +9,12 @@ Показать рабочий стол - + Show Desktop: Global shortcut '%1' cannot be registered Показать рабочий стол: глобальное сочетание клавиш '%1' не может быть зарегистрировано - + Show Desktop Показать рабочий стол diff --git a/plugin-showdesktop/translations/showdesktop_sk_SK.ts b/plugin-showdesktop/translations/showdesktop_sk_SK.ts index 5b81bc1..9d31aa4 100644 --- a/plugin-showdesktop/translations/showdesktop_sk_SK.ts +++ b/plugin-showdesktop/translations/showdesktop_sk_SK.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Zobraziť plochu diff --git a/plugin-showdesktop/translations/showdesktop_sl.ts b/plugin-showdesktop/translations/showdesktop_sl.ts index 07c6e23..eb9b10a 100644 --- a/plugin-showdesktop/translations/showdesktop_sl.ts +++ b/plugin-showdesktop/translations/showdesktop_sl.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Prikaz namizja: globalne bližnjice »%1« ni moč registrirati - + Show Desktop Pokaži namizje diff --git a/plugin-showdesktop/translations/showdesktop_sr@latin.ts b/plugin-showdesktop/translations/showdesktop_sr@latin.ts index d9077f5..6a772ca 100644 --- a/plugin-showdesktop/translations/showdesktop_sr@latin.ts +++ b/plugin-showdesktop/translations/showdesktop_sr@latin.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop diff --git a/plugin-showdesktop/translations/showdesktop_sr_BA.ts b/plugin-showdesktop/translations/showdesktop_sr_BA.ts index 7cc7548..46543f8 100644 --- a/plugin-showdesktop/translations/showdesktop_sr_BA.ts +++ b/plugin-showdesktop/translations/showdesktop_sr_BA.ts @@ -17,12 +17,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Прикажи радну површ diff --git a/plugin-showdesktop/translations/showdesktop_sr_RS.ts b/plugin-showdesktop/translations/showdesktop_sr_RS.ts index e5f6a5f..c5e55e3 100644 --- a/plugin-showdesktop/translations/showdesktop_sr_RS.ts +++ b/plugin-showdesktop/translations/showdesktop_sr_RS.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered - + Show Desktop Прикажи радну површ diff --git a/plugin-showdesktop/translations/showdesktop_th_TH.ts b/plugin-showdesktop/translations/showdesktop_th_TH.ts index 228eec3..ca8ab32 100644 --- a/plugin-showdesktop/translations/showdesktop_th_TH.ts +++ b/plugin-showdesktop/translations/showdesktop_th_TH.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ - + Show Desktop แสดงพื้นโต๊ะ diff --git a/plugin-showdesktop/translations/showdesktop_tr.ts b/plugin-showdesktop/translations/showdesktop_tr.ts index 6b18a87..ed70e01 100644 --- a/plugin-showdesktop/translations/showdesktop_tr.ts +++ b/plugin-showdesktop/translations/showdesktop_tr.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Masaüstünü Göster: '%1' genel kısayolu kaydedilemiyor - + Show Desktop Masaüstünü Göster diff --git a/plugin-showdesktop/translations/showdesktop_uk.ts b/plugin-showdesktop/translations/showdesktop_uk.ts index 1e05001..0229e03 100644 --- a/plugin-showdesktop/translations/showdesktop_uk.ts +++ b/plugin-showdesktop/translations/showdesktop_uk.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' - + Show Desktop Показати стільницю diff --git a/plugin-showdesktop/translations/showdesktop_zh_CN.ts b/plugin-showdesktop/translations/showdesktop_zh_CN.ts index 41214a3..33da8b3 100644 --- a/plugin-showdesktop/translations/showdesktop_zh_CN.ts +++ b/plugin-showdesktop/translations/showdesktop_zh_CN.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered 显示桌面:无法注册全局快捷键'%1' - + Show Desktop 显示桌面 diff --git a/plugin-showdesktop/translations/showdesktop_zh_TW.ts b/plugin-showdesktop/translations/showdesktop_zh_TW.ts index 1cc3124..4190d5a 100644 --- a/plugin-showdesktop/translations/showdesktop_zh_TW.ts +++ b/plugin-showdesktop/translations/showdesktop_zh_TW.ts @@ -9,12 +9,12 @@ - + Show Desktop: Global shortcut '%1' cannot be registered 顯示桌面:全域快捷鍵'%1'無法被註冊 - + Show Desktop 顯示桌面 diff --git a/plugin-spacer/CMakeLists.txt b/plugin-spacer/CMakeLists.txt new file mode 100644 index 0000000..27cf663 --- /dev/null +++ b/plugin-spacer/CMakeLists.txt @@ -0,0 +1,17 @@ +set(PLUGIN "spacer") + +set(HEADERS + spacer.h + spacerconfiguration.h +) + +set(SOURCES + spacer.cpp + spacerconfiguration.cpp +) + +set(UIS + spacerconfiguration.ui +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-spacer/resources/spacer.desktop.in b/plugin-spacer/resources/spacer.desktop.in new file mode 100644 index 0000000..6654498 --- /dev/null +++ b/plugin-spacer/resources/spacer.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Spacer +Comment=Space between widgets +Icon=bookmark-new + +#TRANSLATIONS_DIR=../translations diff --git a/plugin-spacer/spacer.cpp b/plugin-spacer/spacer.cpp new file mode 100644 index 0000000..49ebad7 --- /dev/null +++ b/plugin-spacer/spacer.cpp @@ -0,0 +1,109 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacer.h" +#include "spacerconfiguration.h" +#include + +void SpacerWidget::setType(QString const & type) +{ + if (type != mType) + { + mType = type; + style()->unpolish(this); + style()->polish(this); + } +} + +void SpacerWidget::setOrientation(QString const & orientation) +{ + if (orientation != mOrientation) + { + mOrientation = orientation; + style()->unpolish(this); + style()->polish(this); + } +} + +/************************************************ + + ************************************************/ +Spacer::Spacer(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject() + , ILxQtPanelPlugin(startupInfo) + , mSize(8) +{ + settingsChanged(); +} + +/************************************************ + + ************************************************/ +void Spacer::settingsChanged() +{ + mSize = settings()->value("size", 8).toInt(); + mSpacer.setType(settings()->value("spaceType", SpacerConfiguration::msTypes[0]).toString()); + setSizes(); +} + +/************************************************ + + ************************************************/ +QDialog *Spacer::configureDialog() +{ + return new SpacerConfiguration(settings()); +} + +/************************************************ + + ************************************************/ +void Spacer::setSizes() +{ + if (panel()->isHorizontal()) + { + mSpacer.setOrientation("horizontal"); + mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + mSpacer.setFixedWidth(mSize); + mSpacer.setMinimumHeight(0); + mSpacer.setMaximumHeight(QWIDGETSIZE_MAX); + } + else + { + mSpacer.setOrientation("vertical"); + mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + mSpacer.setFixedHeight(mSize); + mSpacer.setMinimumWidth(0); + mSpacer.setMaximumWidth(QWIDGETSIZE_MAX); + } +} + +/************************************************ + + ************************************************/ +void Spacer::realign() +{ + setSizes(); +} diff --git a/plugin-spacer/spacer.h b/plugin-spacer/spacer.h new file mode 100644 index 0000000..9fec1e0 --- /dev/null +++ b/plugin-spacer/spacer.h @@ -0,0 +1,91 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACER_H +#define SPACER_H + +#include "../panel/ilxqtpanelplugin.h" +#include + + +class SpacerWidget : public QFrame +{ + Q_OBJECT + + Q_PROPERTY(QString type READ getType) + Q_PROPERTY(QString orientation READ getOrientation) + +public: + const QString& getType() const throw () { return mType; } + void setType(QString const & type); + const QString& getOrientation() const throw () { return mOrientation; } + void setOrientation(QString const & orientation); + +private: + QString mType; + QString mOrientation; +}; + +class Spacer : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT + +public: + Spacer(const ILxQtPanelPluginStartupInfo &startupInfo); + + virtual QWidget *widget() { return &mSpacer; } + virtual QString themeId() const { return "Spacer"; } + + bool isSeparate() const { return true; } + + virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } + QDialog *configureDialog(); + + virtual void realign(); + +private slots: + virtual void settingsChanged(); + +private: + void setSizes(); + +private: + SpacerWidget mSpacer; + int mSize; +}; + +class SpacerPluginLibrary: public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new Spacer(startupInfo);} +}; + +#endif + diff --git a/plugin-spacer/spacerconfiguration.cpp b/plugin-spacer/spacerconfiguration.cpp new file mode 100644 index 0000000..60002ae --- /dev/null +++ b/plugin-spacer/spacerconfiguration.cpp @@ -0,0 +1,77 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "spacerconfiguration.h" +#include "ui_spacerconfiguration.h" + + +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList SpacerConfiguration::msTypes = { + QStringLiteral(QT_TR_NOOP("lined")) + , QStringLiteral(QT_TR_NOOP("dotted")) + , QStringLiteral(QT_TR_NOOP("invisible")) +}; + +SpacerConfiguration::SpacerConfiguration(QSettings *settings, QWidget *parent) + : QDialog(parent) + , ui(new Ui::SpacerConfiguration) + , mSettings(settings) +{ + setAttribute(Qt::WA_DeleteOnClose); + setObjectName("SpacerConfigurationWindow"); + ui->setupUi(this); + + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msTypes) + ui->typeCB->addItem(tr(type.toStdString().c_str()), type); + + loadSettings(); + + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &SpacerConfiguration::sizeChanged); + connect(ui->typeCB, static_cast(&QComboBox::currentIndexChanged), this, &SpacerConfiguration::typeChanged); +} + +SpacerConfiguration::~SpacerConfiguration() +{ + delete ui; +} + +void SpacerConfiguration::loadSettings() +{ + ui->sizeSB->setValue(mSettings->value("size", 8).toInt()); + ui->typeCB->setCurrentIndex(ui->typeCB->findData(mSettings->value("spaceType", msTypes[0]).toString())); +} + +void SpacerConfiguration::sizeChanged(int value) +{ + mSettings->setValue("size", value); +} + +void SpacerConfiguration::typeChanged(int index) +{ + mSettings->setValue("spaceType", ui->typeCB->itemData(index, Qt::UserRole)); +} diff --git a/plugin-spacer/spacerconfiguration.h b/plugin-spacer/spacerconfiguration.h new file mode 100644 index 0000000..def3410 --- /dev/null +++ b/plugin-spacer/spacerconfiguration.h @@ -0,0 +1,66 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + + +#ifndef SPACERCONFIGURATION_H +#define SPACERCONFIGURATION_H + +#include + +#include + +class QSettings; +class QAbstractButton; + +namespace Ui { + class SpacerConfiguration; +} + +class SpacerConfiguration : public QDialog +{ + Q_OBJECT + +public: + explicit SpacerConfiguration(QSettings *settings, QWidget *parent = 0); + ~SpacerConfiguration(); + +public: + static const QStringList msTypes; + +private: + Ui::SpacerConfiguration *ui; + QSettings *mSettings; + +private slots: + /* + Saves settings in conf file. + */ + void loadSettings(); + void sizeChanged(int value); + void typeChanged(int index); +}; + +#endif // SPACERCONFIGURATION_H diff --git a/plugin-spacer/spacerconfiguration.ui b/plugin-spacer/spacerconfiguration.ui new file mode 100644 index 0000000..1ed809f --- /dev/null +++ b/plugin-spacer/spacerconfiguration.ui @@ -0,0 +1,70 @@ + + + SpacerConfiguration + + + + 0 + 0 + + + + Spacer Settings + + + + + + Space width: + + + + + + + 4 + + + 2048 + + + 8 + + + + + + + Space type: + + + + + + + false + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttons + clicked(QAbstractButton*) + SpacerConfiguration + close() + + + diff --git a/plugin-spacer/translations/spacer.ts b/plugin-spacer/translations/spacer.ts new file mode 100644 index 0000000..2f4886e --- /dev/null +++ b/plugin-spacer/translations/spacer.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + + + + + Space width: + + + + + Space type: + + + + + lined + + + + + dotted + + + + + invisible + + + + diff --git a/plugin-spacer/translations/spacer_de.desktop b/plugin-spacer/translations/spacer_de.desktop new file mode 100644 index 0000000..c58ea1e --- /dev/null +++ b/plugin-spacer/translations/spacer_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Spacer +Comment[de]=Stellt den Abstand zwischen den Widgets ein diff --git a/plugin-spacer/translations/spacer_de.ts b/plugin-spacer/translations/spacer_de.ts new file mode 100644 index 0000000..bea2914 --- /dev/null +++ b/plugin-spacer/translations/spacer_de.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Leerraum Einstellungen + + + + Space width: + Leerraumbreite: + + + + Space type: + Leerraumtyp: + + + + lined + liniert + + + + dotted + punktiert + + + + invisible + unsichtbar + + + diff --git a/plugin-spacer/translations/spacer_hu.desktop b/plugin-spacer/translations/spacer_hu.desktop new file mode 100644 index 0000000..0f5d07a --- /dev/null +++ b/plugin-spacer/translations/spacer_hu.desktop @@ -0,0 +1,2 @@ +Name[hu]=Távtartó +Comment[hu]=Elemek közötti távolságtartó diff --git a/plugin-spacer/translations/spacer_hu.ts b/plugin-spacer/translations/spacer_hu.ts new file mode 100644 index 0000000..9ee4d68 --- /dev/null +++ b/plugin-spacer/translations/spacer_hu.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/plugin-spacer/translations/spacer_hu_HU.ts b/plugin-spacer/translations/spacer_hu_HU.ts new file mode 100644 index 0000000..9394c6c --- /dev/null +++ b/plugin-spacer/translations/spacer_hu_HU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Távtartóbeállítás + + + + Space width: + Távolság: + + + + Space type: + Táv típus: + + + diff --git a/plugin-spacer/translations/spacer_ru.desktop b/plugin-spacer/translations/spacer_ru.desktop new file mode 100644 index 0000000..966c4d8 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Разделитель +Comment[ru]=Промежуток между виджетами diff --git a/plugin-spacer/translations/spacer_ru.ts b/plugin-spacer/translations/spacer_ru.ts new file mode 100644 index 0000000..23b35f2 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/plugin-spacer/translations/spacer_ru_RU.desktop b/plugin-spacer/translations/spacer_ru_RU.desktop new file mode 100644 index 0000000..b8c65bf --- /dev/null +++ b/plugin-spacer/translations/spacer_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Разделитель +Comment[ru_RU]=Промежуток между виджетами diff --git a/plugin-spacer/translations/spacer_ru_RU.ts b/plugin-spacer/translations/spacer_ru_RU.ts new file mode 100644 index 0000000..2730852 --- /dev/null +++ b/plugin-spacer/translations/spacer_ru_RU.ts @@ -0,0 +1,22 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Настройки разделителя + + + + Space width: + Ширина разделителя: + + + + Space type: + Тип разделителя: + + + diff --git a/plugin-spacer/translations/spacer_sk.ts b/plugin-spacer/translations/spacer_sk.ts new file mode 100644 index 0000000..4845e69 --- /dev/null +++ b/plugin-spacer/translations/spacer_sk.ts @@ -0,0 +1,37 @@ + + + + + SpacerConfiguration + + + Spacer Settings + Nastavenia medzery + + + + Space width: + Šírka medzery: + + + + Space type: + Typ medzery: + + + + lined + plná čiara + + + + dotted + bodkovaná čiara + + + + invisible + neviditeľná + + + diff --git a/plugin-statusnotifier/CMakeLists.txt b/plugin-statusnotifier/CMakeLists.txt new file mode 100644 index 0000000..42ea321 --- /dev/null +++ b/plugin-statusnotifier/CMakeLists.txt @@ -0,0 +1,35 @@ +set(PLUGIN "statusnotifier") + + +find_package(dbusmenu-qt5 REQUIRED QUIET) + +set(HEADERS + statusnotifier.h + dbustypes.h + statusnotifierbutton.h + statusnotifieriteminterface.h + statusnotifierwatcher.h + statusnotifierwidget.h +) + +set(SOURCES + statusnotifier.cpp + dbustypes.cpp + statusnotifierbutton.cpp + statusnotifieriteminterface.cpp + statusnotifierwatcher.cpp + statusnotifierwidget.cpp +) + +qt5_add_dbus_adaptor(SOURCES + org.kde.StatusNotifierItem.xml + statusnotifieriteminterface.h + StatusNotifierItemInterface +) + +set(LIBRARIES + lxqt + dbusmenu-qt5 +) + +BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-statusnotifier/dbustypes.cpp b/plugin-statusnotifier/dbustypes.cpp new file mode 100644 index 0000000..f4b345d --- /dev/null +++ b/plugin-statusnotifier/dbustypes.cpp @@ -0,0 +1,75 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "dbustypes.h" + +// Marshall the IconPixmap data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon) +{ + argument.beginStructure(); + argument << icon.width; + argument << icon.height; + argument << icon.bytes; + argument.endStructure(); + return argument; +} + +// Retrieve the ImageStruct data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon) +{ + argument.beginStructure(); + argument >> icon.width; + argument >> icon.height; + argument >> icon.bytes; + argument.endStructure(); + return argument; +} + +// Marshall the ToolTip data into a D-Bus argument +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip) +{ + argument.beginStructure(); + argument << toolTip.iconName; + argument << toolTip.iconPixmap; + argument << toolTip.title; + argument << toolTip.description; + argument.endStructure(); + return argument; +} + +// Retrieve the ToolTip data from the D-Bus argument +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip) +{ + argument.beginStructure(); + argument >> toolTip.iconName; + argument >> toolTip.iconPixmap; + argument >> toolTip.title; + argument >> toolTip.description; + argument.endStructure(); + return argument; +} diff --git a/plugin-statusnotifier/dbustypes.h b/plugin-statusnotifier/dbustypes.h new file mode 100644 index 0000000..ecdb220 --- /dev/null +++ b/plugin-statusnotifier/dbustypes.h @@ -0,0 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include + +#ifndef DBUSTYPES_H +#define DBUSTYPES_H + +struct IconPixmap { + int width; + int height; + QByteArray bytes; +}; + +typedef QList IconPixmapList; + +struct ToolTip { + QString iconName; + QList iconPixmap; + QString title; + QString description; +}; + +QDBusArgument &operator<<(QDBusArgument &argument, const IconPixmap &icon); +const QDBusArgument &operator>>(const QDBusArgument &argument, IconPixmap &icon); + +QDBusArgument &operator<<(QDBusArgument &argument, const ToolTip &toolTip); +const QDBusArgument &operator>>(const QDBusArgument &argument, ToolTip &toolTip); + +Q_DECLARE_METATYPE(IconPixmap) +Q_DECLARE_METATYPE(ToolTip) + +#endif // DBUSTYPES_H diff --git a/plugin-statusnotifier/org.kde.StatusNotifierItem.xml b/plugin-statusnotifier/org.kde.StatusNotifierItem.xml new file mode 100644 index 0000000..0a563c5 --- /dev/null +++ b/plugin-statusnotifier/org.kde.StatusNotifierItem.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugin-statusnotifier/resources/statusnotifier.desktop.in b/plugin-statusnotifier/resources/statusnotifier.desktop.in new file mode 100644 index 0000000..66a4bc0 --- /dev/null +++ b/plugin-statusnotifier/resources/statusnotifier.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Service +ServiceTypes=LxQtPanel/Plugin +Name=Status Notifier Plugin +Comment=Status Notifier Plugin +Icon=go-bottom diff --git a/plugin-statusnotifier/statusnotifier.cpp b/plugin-statusnotifier/statusnotifier.cpp new file mode 100644 index 0000000..0d80484 --- /dev/null +++ b/plugin-statusnotifier/statusnotifier.cpp @@ -0,0 +1,41 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifier.h" + +StatusNotifier::StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo) : + QObject(), + ILxQtPanelPlugin(startupInfo) +{ + m_widget = new StatusNotifierWidget(this); +} + +void StatusNotifier::realign() +{ + m_widget->realign(); +} diff --git a/plugin-statusnotifier/statusnotifier.h b/plugin-statusnotifier/statusnotifier.h new file mode 100644 index 0000000..93aed9e --- /dev/null +++ b/plugin-statusnotifier/statusnotifier.h @@ -0,0 +1,63 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIER_PLUGIN_H +#define STATUSNOTIFIER_PLUGIN_H + +#include "../panel/ilxqtpanelplugin.h" +#include "statusnotifierwidget.h" + +class StatusNotifier : public QObject, public ILxQtPanelPlugin +{ + Q_OBJECT +public: + StatusNotifier(const ILxQtPanelPluginStartupInfo &startupInfo); + + bool isSeparate() const { return true; } + void realign(); + QString themeId() const { return "StatusNotifier"; } + virtual Flags flags() const { return SingleInstance | NeedsHandle; } + QWidget *widget() { return m_widget; } + +private: + StatusNotifierWidget *m_widget; +}; + +class StatusNotifierLibrary : public QObject, public ILxQtPanelPluginLibrary +{ + Q_OBJECT +// Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + Q_INTERFACES(ILxQtPanelPluginLibrary) +public: + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const + { + return new StatusNotifier(startupInfo); + } +}; + +#endif // STATUSNOTIFIER_PLUGIN_H diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp new file mode 100644 index 0000000..525b043 --- /dev/null +++ b/plugin-statusnotifier/statusnotifierbutton.cpp @@ -0,0 +1,248 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierbutton.h" + +#include +#include +#include +#include "../panel/ilxqtpanelplugin.h" + + +StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent) + : QToolButton(parent), + mMenu(NULL), + mStatus(Passive), + mValid(true), + mFallbackIcon(QIcon::fromTheme("application-x-executable")), + mPlugin(plugin) +{ + interface = new org::kde::StatusNotifierItem(service, objectPath, QDBusConnection::sessionBus(), this); + + QString menuPath = interface->menu().path(); + if (!menuPath.isEmpty()) + { + mMenu = (new DBusMenuImporter(service, interface->menu().path(), this))->menu(); + dynamic_cast(*mMenu).setParent(this); + mMenu->setObjectName(QStringLiteral("StatusNotifierMenu")); + } + + // HACK: sni-qt creates some invalid items (like one for konversarion 1.5) + if (interface->title().isEmpty() && interface->id().isEmpty()) + mValid = false; + + if (mValid) + { + newToolTip(); + refetchIcon(Active); + refetchIcon(Passive); + refetchIcon(NeedsAttention); + newStatus(interface->status()); + resetIcon(); + + connect(interface, SIGNAL(NewIcon()), this, SLOT(newIcon())); + connect(interface, SIGNAL(NewOverlayIcon()), this, SLOT(newOverlayIcon())); + connect(interface, SIGNAL(NewAttentionIcon()), this, SLOT(newAttentionIcon())); + connect(interface, SIGNAL(NewToolTip()), this, SLOT(newToolTip())); + connect(interface, SIGNAL(NewStatus(QString)), this, SLOT(newStatus(QString))); + } +} + +StatusNotifierButton::~StatusNotifierButton() +{ +} + +void StatusNotifierButton::newIcon() +{ + refetchIcon(Passive); + resetIcon(); +} + +void StatusNotifierButton::newOverlayIcon() +{ + refetchIcon(Active); + resetIcon(); +} + +void StatusNotifierButton::newAttentionIcon() +{ + refetchIcon(NeedsAttention); + resetIcon(); +} + +void StatusNotifierButton::refetchIcon(Status status) +{ + QString iconName; + switch (status) + { + case Active: + iconName = interface->overlayIconName(); + break; + case NeedsAttention: + iconName = interface->attentionIconName(); + break; + case Passive: + iconName = interface->iconName(); + break; + } + + QIcon nextIcon; + if (!iconName.isEmpty()) + { + if (QIcon::hasThemeIcon(iconName)) + nextIcon = QIcon::fromTheme(iconName); + else + { + QDir themeDir(interface->iconThemePath()); + if (themeDir.exists()) + { + if (themeDir.exists(iconName + ".png")) + nextIcon.addFile(themeDir.filePath(iconName + ".png")); + + if (themeDir.cd("hicolor") || (themeDir.cd("icons") && themeDir.cd("hicolor"))) + { + QStringList sizes = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString dir, sizes) + { + QStringList dirs = QDir(themeDir.filePath(dir)).entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + foreach (QString innerDir, dirs) + { + QString file = themeDir.absolutePath() + "/" + dir + "/" + innerDir + "/" + iconName + ".png"; + if (QFile::exists(file)) + nextIcon.addFile(file); + } + } + } + } + } + } + else + { + IconPixmapList iconPixmaps; + switch (status) + { + case Active: + iconPixmaps = interface->overlayIconPixmap(); + break; + case NeedsAttention: + iconPixmaps = interface->attentionIconPixmap(); + break; + case Passive: + iconPixmaps = interface->iconPixmap(); + break; + } + + + if (!iconPixmaps.empty() && !iconPixmaps.first().bytes.isNull()) + { + IconPixmap iconPixmap = iconPixmaps.first(); + QImage image((uchar*) iconPixmap.bytes.data(), iconPixmap.width, iconPixmap.height, QImage::Format_ARGB32); + const uchar *end = image.constBits() + image.byteCount(); + uchar *dest = reinterpret_cast(iconPixmap.bytes.data()); + for (const uchar *src = image.constBits(); src < end; src += 4, dest += 4) + qToUnaligned(qToBigEndian(qFromUnaligned(src)), dest); + + QPixmap pixmap = QPixmap::fromImage(image); + nextIcon = QIcon(pixmap); + } + } + + switch (status) + { + case Active: + mOverlayIcon = nextIcon; + break; + case NeedsAttention: + mAttentionIcon = nextIcon; + break; + case Passive: + mIcon = nextIcon; + break; + } +} + +void StatusNotifierButton::newToolTip() +{ + QString toolTipTitle = interface->toolTip().title; + setToolTip(toolTipTitle.isEmpty() ? interface->title() : toolTipTitle); +} + +void StatusNotifierButton::newStatus(QString status) +{ + Status newStatus; + if (status == QStringLiteral("Passive")) + newStatus = Passive; + else if (status == QStringLiteral("Active")) + newStatus = Active; + else + newStatus = NeedsAttention; + + if (mStatus == newStatus) + return; + + mStatus = newStatus; + resetIcon(); +} + +void StatusNotifierButton::contextMenuEvent(QContextMenuEvent* event) +{ + //XXX: avoid showing of parent's context menu, we are (optionaly) providing context menu on mouseReleaseEvent + //QWidget::contextMenuEvent(event); +} + +void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + interface->Activate(QCursor::pos().x(), QCursor::pos().y()); + else if (event->button() == Qt::MidButton) + interface->SecondaryActivate(QCursor::pos().x(), QCursor::pos().y()); + else if (Qt::RightButton == event->button()) + mMenu->popup(mPlugin->calculatePopupWindowPos(mMenu->sizeHint()).topLeft()); + QToolButton::mouseReleaseEvent(event); +} + +void StatusNotifierButton::wheelEvent(QWheelEvent *event) +{ + interface->Scroll(event->delta(), "vertical"); +} + +void StatusNotifierButton::resetIcon() +{ + if (mStatus == Active && !mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (mStatus == NeedsAttention && !mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else if (!mIcon.isNull()) // mStatus == Passive + setIcon(mIcon); + else if (!mOverlayIcon.isNull()) + setIcon(mOverlayIcon); + else if (!mAttentionIcon.isNull()) + setIcon(mAttentionIcon); + else + setIcon(mFallbackIcon); +} diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h new file mode 100644 index 0000000..ea0da60 --- /dev/null +++ b/plugin-statusnotifier/statusnotifierbutton.h @@ -0,0 +1,95 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERBUTTON_H +#define STATUSNOTIFIERBUTTON_H + +#include +#include +#include +#include +#include +#include +#include + +#include "statusnotifieriteminterface.h" + +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +template inline T qFromUnaligned(const uchar *src) +{ + T dest; + const size_t size = sizeof(T); + memcpy(&dest, src, size); + return dest; +} +#endif + +class ILxQtPanelPlugin; + +class StatusNotifierButton : public QToolButton +{ + Q_OBJECT + +public: + StatusNotifierButton(QString service, QString objectPath, ILxQtPanelPlugin* plugin, QWidget *parent = 0); + ~StatusNotifierButton(); + + bool isValid() const { return mValid; } + + enum Status + { + Passive, Active, NeedsAttention + }; + +public slots: + void newIcon(); + void newAttentionIcon(); + void newOverlayIcon(); + void newToolTip(); + void newStatus(QString status); + +private: + org::kde::StatusNotifierItem *interface; + QMenu *mMenu; + Status mStatus; + bool mValid; + + QIcon mIcon, mOverlayIcon, mAttentionIcon, mFallbackIcon; + + ILxQtPanelPlugin* mPlugin; + +protected: + void contextMenuEvent(QContextMenuEvent * event); + void mouseReleaseEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent *event); + + void refetchIcon(Status status); + void resetIcon(); +}; + +#endif // STATUSNOTIFIERBUTTON_H diff --git a/plugin-statusnotifier/statusnotifieriteminterface.cpp b/plugin-statusnotifier/statusnotifieriteminterface.cpp new file mode 100644 index 0000000..ad8fbda --- /dev/null +++ b/plugin-statusnotifier/statusnotifieriteminterface.cpp @@ -0,0 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "statusnotifieriteminterface.h" + +/* + * Implementation of interface class StatusNotifierItemInterface + */ + +StatusNotifierItemInterface::StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +StatusNotifierItemInterface::~StatusNotifierItemInterface() +{ +} + diff --git a/plugin-statusnotifier/statusnotifieriteminterface.h b/plugin-statusnotifier/statusnotifieriteminterface.h new file mode 100644 index 0000000..a1417b1 --- /dev/null +++ b/plugin-statusnotifier/statusnotifieriteminterface.h @@ -0,0 +1,174 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -c StatusNotifierItemInterface -p statusnotifieriteminterface -i dbustypes.h dbus-ifaces/org.kde.StatusNotifierItem.xml + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef STATUSNOTIFIERITEMINTERFACE_H +#define STATUSNOTIFIERITEMINTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "dbustypes.h" + +/* + * Proxy class for interface org.kde.StatusNotifierItem + */ +class StatusNotifierItemInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.kde.StatusNotifierItem"; } + +public: + StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~StatusNotifierItemInterface(); + + Q_PROPERTY(QString AttentionIconName READ attentionIconName) + inline QString attentionIconName() const + { return qvariant_cast< QString >(property("AttentionIconName")); } + + Q_PROPERTY(IconPixmapList AttentionIconPixmap READ attentionIconPixmap) + inline IconPixmapList attentionIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("AttentionIconPixmap")); } + + Q_PROPERTY(QString AttentionMovieName READ attentionMovieName) + inline QString attentionMovieName() const + { return qvariant_cast< QString >(property("AttentionMovieName")); } + + Q_PROPERTY(QString Category READ category) + inline QString category() const + { return qvariant_cast< QString >(property("Category")); } + + Q_PROPERTY(QString IconName READ iconName) + inline QString iconName() const + { return qvariant_cast< QString >(property("IconName")); } + + Q_PROPERTY(IconPixmapList IconPixmap READ iconPixmap) + inline IconPixmapList iconPixmap() const + { return qvariant_cast< IconPixmapList >(property("IconPixmap")); } + + Q_PROPERTY(QString IconThemePath READ iconThemePath) + inline QString iconThemePath() const + { return qvariant_cast< QString >(property("IconThemePath")); } + + Q_PROPERTY(QString Id READ id) + inline QString id() const + { return qvariant_cast< QString >(property("Id")); } + + Q_PROPERTY(bool ItemIsMenu READ itemIsMenu) + inline bool itemIsMenu() const + { return qvariant_cast< bool >(property("ItemIsMenu")); } + + Q_PROPERTY(QDBusObjectPath Menu READ menu) + inline QDBusObjectPath menu() const + { return qvariant_cast< QDBusObjectPath >(property("Menu")); } + + Q_PROPERTY(QString OverlayIconName READ overlayIconName) + inline QString overlayIconName() const + { return qvariant_cast< QString >(property("OverlayIconName")); } + + Q_PROPERTY(IconPixmapList OverlayIconPixmap READ overlayIconPixmap) + inline IconPixmapList overlayIconPixmap() const + { return qvariant_cast< IconPixmapList >(property("OverlayIconPixmap")); } + + Q_PROPERTY(QString Status READ status) + inline QString status() const + { return qvariant_cast< QString >(property("Status")); } + + Q_PROPERTY(QString Title READ title) + inline QString title() const + { return qvariant_cast< QString >(property("Title")); } + + Q_PROPERTY(ToolTip ToolTip READ toolTip) + inline ToolTip toolTip() const + { return qvariant_cast< ToolTip >(property("ToolTip")); } + + Q_PROPERTY(int WindowId READ windowId) + inline int windowId() const + { return qvariant_cast< int >(property("WindowId")); } + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> Activate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList); + } + + inline QDBusPendingReply<> ContextMenu(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("ContextMenu"), argumentList); + } + + inline QDBusPendingReply<> Scroll(int delta, const QString &orientation) + { + QList argumentList; + argumentList << QVariant::fromValue(delta) << QVariant::fromValue(orientation); + return asyncCallWithArgumentList(QStringLiteral("Scroll"), argumentList); + } + + inline QDBusPendingReply<> SecondaryActivate(int x, int y) + { + QList argumentList; + argumentList << QVariant::fromValue(x) << QVariant::fromValue(y); + return asyncCallWithArgumentList(QStringLiteral("SecondaryActivate"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void NewAttentionIcon(); + void NewIcon(); + void NewOverlayIcon(); + void NewStatus(const QString &status); + void NewTitle(); + void NewToolTip(); +}; + +namespace org { + namespace kde { + typedef ::StatusNotifierItemInterface StatusNotifierItem; + } +} +#endif diff --git a/plugin-statusnotifier/statusnotifierwatcher.cpp b/plugin-statusnotifier/statusnotifierwatcher.cpp new file mode 100644 index 0000000..4fcfa2e --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwatcher.cpp @@ -0,0 +1,117 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwatcher.h" +#include +#include + +StatusNotifierWatcher::StatusNotifierWatcher(QObject *parent) : QObject(parent) +{ + qRegisterMetaType("IconPixmap"); + qDBusRegisterMetaType(); + qRegisterMetaType("IconPixmapList"); + qDBusRegisterMetaType(); + qRegisterMetaType("ToolTip"); + qDBusRegisterMetaType(); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + if (!dbus.registerService("org.kde.StatusNotifierWatcher")) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + if (!dbus.registerObject("/StatusNotifierWatcher", this, QDBusConnection::ExportScriptableContents)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new QDBusServiceWatcher(this); + mWatcher->setConnection(dbus); + mWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration); + + connect(mWatcher, &QDBusServiceWatcher::serviceUnregistered, this, &StatusNotifierWatcher::serviceUnregistered); +} + +StatusNotifierWatcher::~StatusNotifierWatcher() +{ + QDBusConnection::sessionBus().unregisterService("org.kde.StatusNotifierWatcher"); +} + +void StatusNotifierWatcher::RegisterStatusNotifierItem(const QString &serviceOrPath) +{ + QString service = serviceOrPath; + QString path = "/StatusNotifierItem"; + + // workaround for sni-qt + if (service.startsWith('/')) + { + path = service; + service = message().service(); + } + + QString notifierItemId = service + path; + + if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value() + && !mServices.contains(notifierItemId)) + { + mServices << notifierItemId; + mWatcher->addWatchedService(service); + emit StatusNotifierItemRegistered(notifierItemId); + } +} + +void StatusNotifierWatcher::RegisterStatusNotifierHost(const QString &service) +{ + if (!mHosts.contains(service)) + { + mHosts.append(service); + mWatcher->addWatchedService(service); + } +} + +void StatusNotifierWatcher::serviceUnregistered(const QString &service) +{ + qDebug() << "Service" << service << "unregistered"; + + mWatcher->removeWatchedService(service); + + if (mHosts.contains(service)) + { + mHosts.removeAll(service); + return; + } + + QString match = service + '/'; + QStringList::Iterator it = mServices.begin(); + while (it != mServices.end()) + { + if (it->startsWith(match)) + { + QString name = *it; + it = mServices.erase(it); + emit StatusNotifierItemUnregistered(name); + } + else + ++it; + } +} diff --git a/plugin-statusnotifier/statusnotifierwatcher.h b/plugin-statusnotifier/statusnotifierwatcher.h new file mode 100644 index 0000000..0c2be8a --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwatcher.h @@ -0,0 +1,73 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWATCHER_H +#define STATUSNOTIFIERWATCHER_H + +#include +#include +#include +#include +#include + +#include "dbustypes.h" + +class StatusNotifierWatcher : public QObject, protected QDBusContext +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.StatusNotifierWatcher") + Q_SCRIPTABLE Q_PROPERTY(bool IsStatusNotifierHostRegistered READ isStatusNotifierHostRegistered) + Q_SCRIPTABLE Q_PROPERTY(int ProtocolVersion READ protocolVersion) + Q_SCRIPTABLE Q_PROPERTY(QStringList RegisteredStatusNotifierItems READ RegisteredStatusNotifierItems) + +public: + explicit StatusNotifierWatcher(QObject *parent = 0); + ~StatusNotifierWatcher(); + + bool isStatusNotifierHostRegistered() { return mHosts.count() > 0; } + int protocolVersion() const { return 0; } + QStringList RegisteredStatusNotifierItems() const { return mServices; } + +signals: + Q_SCRIPTABLE void StatusNotifierItemRegistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierItemUnregistered(const QString &service); + Q_SCRIPTABLE void StatusNotifierHostRegistered(); + +public slots: + Q_SCRIPTABLE void RegisterStatusNotifierItem(const QString &serviceOrPath); + Q_SCRIPTABLE void RegisterStatusNotifierHost(const QString &service); + + void serviceUnregistered(const QString &service); + +private: + QStringList mServices; + QStringList mHosts; + QDBusServiceWatcher *mWatcher; +}; + +#endif // STATUSNOTIFIERWATCHER_H diff --git a/plugin-statusnotifier/statusnotifierwidget.cpp b/plugin-statusnotifier/statusnotifierwidget.cpp new file mode 100644 index 0000000..8a569ee --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwidget.cpp @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "statusnotifierwidget.h" +#include +#include "../panel/ilxqtpanelplugin.h" + +StatusNotifierWidget::StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent) : + QWidget(parent), + mPlugin(plugin) +{ + QString dbusName = QString("org.kde.StatusNotifierHost-%1-%2").arg(QApplication::applicationPid()).arg(1); + if (!QDBusConnection::sessionBus().registerService(dbusName)) + qDebug() << QDBusConnection::sessionBus().lastError().message(); + + mWatcher = new StatusNotifierWatcher; + mWatcher->RegisterStatusNotifierHost(dbusName); + + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemRegistered, + this, &StatusNotifierWidget::itemAdded); + connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemUnregistered, + this, &StatusNotifierWidget::itemRemoved); + + setLayout(new LxQt::GridLayout(this)); + realign(); + + qDebug() << mWatcher->RegisteredStatusNotifierItems(); + +} + +void StatusNotifierWidget::itemAdded(QString serviceAndPath) +{ + int slash = serviceAndPath.indexOf('/'); + QString serv = serviceAndPath.left(slash); + QString path = serviceAndPath.mid(slash); + StatusNotifierButton *button = new StatusNotifierButton(serv, path, mPlugin, this); + + if (!button->isValid()) + delete button; + else + { + mServices.insert(serviceAndPath, button); + layout()->addWidget(button); + layout()->setAlignment(button, Qt::AlignCenter); + button->show(); + } +} + +void StatusNotifierWidget::itemRemoved(const QString &serviceAndPath) +{ + StatusNotifierButton *button = mServices.value(serviceAndPath, NULL); + if (button) + { + button->deleteLater(); + layout()->removeWidget(button); + } +} + +void StatusNotifierWidget::realign() +{ + LxQt::GridLayout *layout = qobject_cast(this->layout()); + layout->setEnabled(false); + + ILxQtPanel *panel = mPlugin->panel(); + if (panel->isHorizontal()) + { + layout->setRowCount(panel->lineCount()); + layout->setColumnCount(0); + } + else + { + layout->setColumnCount(panel->lineCount()); + layout->setRowCount(0); + } + + layout->setEnabled(true); +} diff --git a/plugin-statusnotifier/statusnotifierwidget.h b/plugin-statusnotifier/statusnotifierwidget.h new file mode 100644 index 0000000..35e303a --- /dev/null +++ b/plugin-statusnotifier/statusnotifierwidget.h @@ -0,0 +1,61 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2015 LxQt team + * Authors: + * Balázs Béla + * Paulo Lieuthier + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef STATUSNOTIFIERWIDGET_H +#define STATUSNOTIFIERWIDGET_H + +#include + +#include + +#include "statusnotifierbutton.h" +#include "statusnotifierwatcher.h" + +class StatusNotifierWidget : public QWidget +{ + Q_OBJECT + +public: + StatusNotifierWidget(ILxQtPanelPlugin *plugin, QWidget *parent = 0); + +signals: + +public slots: + void itemAdded(QString serviceAndPath); + void itemRemoved(const QString &serviceAndPath); + + void realign(); + +private: + ILxQtPanelPlugin *mPlugin; + StatusNotifierWatcher *mWatcher; + + QHash mServices; +}; + +#endif // STATUSNOTIFIERWIDGET_H diff --git a/plugin-statusnotifier/translations/statusnotifier.ts b/plugin-statusnotifier/translations/statusnotifier.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugin-statusnotifier/translations/statusnotifier_de.desktop b/plugin-statusnotifier/translations/statusnotifier_de.desktop new file mode 100644 index 0000000..6f367a0 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Statusbenachrichtigungen +Comment[de]=Plugin für Statusbenachrichtigungen diff --git a/plugin-statusnotifier/translations/statusnotifier_ru.desktop b/plugin-statusnotifier/translations/statusnotifier_ru.desktop new file mode 100644 index 0000000..3b3766b --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_ru.desktop @@ -0,0 +1,2 @@ +Name[ru]=Плагин уведомлений +Comment[ru]=Плагин уведомлений diff --git a/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop b/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop new file mode 100644 index 0000000..5c5fc79 --- /dev/null +++ b/plugin-statusnotifier/translations/statusnotifier_ru_RU.desktop @@ -0,0 +1,2 @@ +Name[ru_RU]=Плагин уведомлений +Comment[ru_RU]=Плагин уведомлений diff --git a/plugin-sysstat/CMakeLists.txt b/plugin-sysstat/CMakeLists.txt index 1634635..6cb28e6 100644 --- a/plugin-sysstat/CMakeLists.txt +++ b/plugin-sysstat/CMakeLists.txt @@ -16,18 +16,11 @@ set(SOURCES lxqtsysstatutils.cpp ) -set(MOCS - lxqtsysstat.h - lxqtsysstatconfiguration.h - lxqtsysstatcolours.h -) - set(UIS lxqtsysstatconfiguration.ui lxqtsysstatcolours.ui ) -set(LIBRARIES ${SYSSTAT_LIBRARIES}) -include_directories("${SYSSTAT_INCLUDE_DIRS}") +set(LIBRARIES sysstat-qt5) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-sysstat/lxqtsysstat.cpp b/plugin-sysstat/lxqtsysstat.cpp index 7febd34..ee6c020 100644 --- a/plugin-sysstat/lxqtsysstat.cpp +++ b/plugin-sysstat/lxqtsysstat.cpp @@ -37,6 +37,7 @@ #include #include #include +#include LxQtSysStat::LxQtSysStat(const ILxQtPanelPluginStartupInfo &startupInfo): QObject(), @@ -231,7 +232,7 @@ void LxQtSysStatContent::updateSettings(const QSettings *settings) mTitleLabel = settings->value("title/label", QString()).toString(); // default to CPU monitoring - mDataType = settings->value("data/type", QString("CPU")).toString(); + mDataType = settings->value("data/type", LxQtSysStatConfiguration::msStatTypes[0]).toString(); mDataSource = settings->value("data/source", QString("cpu")).toString(); @@ -300,7 +301,10 @@ void LxQtSysStatContent::updateSettings(const QSettings *settings) if (dataTypeChanged) { if (mStat) + { mStat->deleteLater(); + mStat = nullptr; + } if (mDataType == "CPU") mStat = new SysStat::CpuStat(this); @@ -384,11 +388,20 @@ void LxQtSysStatContent::clearLine() void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other, float frequencyRate, uint) { - int y_system = clamp(static_cast(system * 100.0 * frequencyRate) , 0, 99); - int y_user = clamp(static_cast(user * 100.0 * frequencyRate) + y_system, 0, 99); - int y_nice = clamp(static_cast(nice * 100.0 * frequencyRate) + y_user , 0, 99); - int y_other = clamp(static_cast(other * 100.0 * frequencyRate) + y_nice , 0, 99); - int y_freq = clamp(static_cast( 100.0 * frequencyRate) , 0, 99); + int y_system = static_cast(system * 100.0 * frequencyRate); + int y_user = static_cast(user * 100.0 * frequencyRate); + int y_nice = static_cast(nice * 100.0 * frequencyRate); + int y_other = static_cast(other * 100.0 * frequencyRate); + int y_freq = static_cast( 100.0 * frequencyRate); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: %5%", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other).arg(y_freq)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user , 0, 99); + y_other = clamp(y_other, 0, 99); + y_freq = clamp(y_freq, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -425,10 +438,18 @@ void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float o void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float other) { - int y_system = clamp(static_cast(system * 100.0) , 0, 99); - int y_user = clamp(static_cast(user * 100.0) + y_system, 0, 99); - int y_nice = clamp(static_cast(nice * 100.0) + y_user , 0, 99); - int y_other = clamp(static_cast(other * 100.0) + y_nice , 0, 99); + int y_system = static_cast(system * 100.0); + int y_user = static_cast(user * 100.0); + int y_nice = static_cast(nice * 100.0); + int y_other = static_cast(other * 100.0); + + toolTipInfo(tr("system: %1%
user: %2%
nice: %3%
other: %4%
freq: n/a", "CPU tooltip information") + .arg(y_system).arg(y_user).arg(y_nice).arg(y_other)); + + y_system = clamp(y_system, 0, 99); + y_user = clamp(y_user + y_system, 0, 99); + y_nice = clamp(y_nice + y_user, 0, 99); + y_other = clamp(y_other + y_nice, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -460,9 +481,16 @@ void LxQtSysStatContent::cpuUpdate(float user, float nice, float system, float o void LxQtSysStatContent::memoryUpdate(float apps, float buffers, float cached) { - int y_apps = clamp(static_cast(apps * 100.0) , 0, 99); - int y_buffers = clamp(static_cast(buffers * 100.0) + y_apps , 0, 99); - int y_cached = clamp(static_cast(cached * 100.0) + y_buffers, 0, 99); + int y_apps = static_cast(apps * 100.0); + int y_buffers = static_cast(buffers * 100.0); + int y_cached = static_cast(cached * 100.0); + + toolTipInfo(tr("apps: %1%
buffers: %2%
cached: %3%", "Memory tooltip information") + .arg(y_apps).arg(y_buffers).arg(y_cached)); + + y_apps = clamp(y_apps, 0, 99); + y_buffers = clamp(y_buffers + y_apps, 0, 99); + y_cached = clamp(y_cached + y_buffers, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -489,7 +517,11 @@ void LxQtSysStatContent::memoryUpdate(float apps, float buffers, float cached) void LxQtSysStatContent::swapUpdate(float used) { - int y_used = clamp(static_cast(used * 100.0), 0, 99); + int y_used = static_cast(used * 100.0); + + toolTipInfo(tr("used: %1%", "Swap tooltip information").arg(y_used)); + + y_used = clamp(y_used, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -514,8 +546,13 @@ void LxQtSysStatContent::networkUpdate(unsigned received, unsigned transmitted) max_value = qLn(max_value * (mLogScaleMax - 1.0) + 1.0) / qLn(2.0) / static_cast(mLogScaleSteps); } - int y_min_value = clamp(static_cast(min_value * 100.0) , 0, 99); - int y_max_value = clamp(static_cast(max_value * 100.0) + y_min_value, 0, 99); + int y_min_value = static_cast(min_value * 100.0); + int y_max_value = static_cast(max_value * 100.0); + + toolTipInfo(tr("min: %1%
max: %2%", "Network tooltip information").arg(y_min_value).arg(y_max_value)); + + y_min_value = clamp(y_min_value, 0, 99); + y_max_value = clamp(y_max_value + y_min_value, 0, 99); clearLine(); QPainter painter(&mHistoryImage); @@ -580,3 +617,11 @@ void LxQtSysStatContent::paintEvent(QPaintEvent *event) p.drawLine(QPointF(0.0, y), QPointF(w, y)); } } + +void LxQtSysStatContent::toolTipInfo(QString const & tooltip) +{ + setToolTip(QStringLiteral("%1(%2)
%3") + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataType.toStdString().c_str())) + .arg(QCoreApplication::translate("LxQtSysStatConfiguration", mDataSource.toStdString().c_str())) + .arg(tooltip)); +} diff --git a/plugin-sysstat/lxqtsysstat.h b/plugin-sysstat/lxqtsysstat.h index d3ffaa7..6737fdb 100644 --- a/plugin-sysstat/lxqtsysstat.h +++ b/plugin-sysstat/lxqtsysstat.h @@ -143,7 +143,8 @@ protected slots: void swapUpdate(float used); void networkUpdate(unsigned received, unsigned transmitted); - +private: + void toolTipInfo(QString const & tooltip); private: ILxQtPanelPlugin *mPlugin; @@ -217,7 +218,7 @@ class LxQtSysStatLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtSysStat(startupInfo); } diff --git a/plugin-sysstat/lxqtsysstatcolours.cpp b/plugin-sysstat/lxqtsysstatcolours.cpp index 1db61d5..ce7cfbf 100644 --- a/plugin-sysstat/lxqtsysstatcolours.cpp +++ b/plugin-sysstat/lxqtsysstatcolours.cpp @@ -38,6 +38,7 @@ LxQtSysStatColours::LxQtSysStatColours(QWidget *parent) : ui(new Ui::LxQtSysStatColours), mSelectColourMapper(new QSignalMapper(this)) { + setWindowModality(Qt::WindowModal); ui->setupUi(this); mDefaultColours["grid"] = QColor("#808080"); diff --git a/plugin-sysstat/lxqtsysstatconfiguration.cpp b/plugin-sysstat/lxqtsysstatconfiguration.cpp index c6ca354..1723725 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.cpp +++ b/plugin-sysstat/lxqtsysstatconfiguration.cpp @@ -35,6 +35,52 @@ #include #include +//Note: strings can't actually be translated here (in static initialization time) +// the QT_TR_NOOP here is just for qt translate tools to get the strings for translation +const QStringList LxQtSysStatConfiguration::msStatTypes = { + QStringLiteral(QT_TR_NOOP("CPU")) + , QStringLiteral(QT_TR_NOOP("Memory")) + , QStringLiteral(QT_TR_NOOP("Network")) +}; + +namespace +{ + //Note: workaround for making source strings translatable + // (no need to ever call this function) + void localizationWorkaround(); + auto t = localizationWorkaround;//avoid unused function warning + void localizationWorkaround() + { + const char * loc; + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu1"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu2"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu3"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu4"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu5"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu6"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu7"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu8"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu9"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu11"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu12"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu13"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu14"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu15"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu16"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu17"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu18"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu19"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu20"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu21"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu22"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu23"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "cpu24"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "memory"); + loc = QT_TRANSLATE_NOOP("LxQtSysStatConfiguration", "swap"); + static_cast(t);//avoid unused variable warning + } +} LxQtSysStatConfiguration::LxQtSysStatConfiguration(QSettings *settings, QWidget *parent) : QDialog(parent), @@ -42,15 +88,27 @@ LxQtSysStatConfiguration::LxQtSysStatConfiguration(QSettings *settings, QWidget mSettings(settings), oldSettings(settings), mStat(NULL), - mLockSaving(false), mColoursDialog(NULL) { setAttribute(Qt::WA_DeleteOnClose); setObjectName("SysStatConfigurationWindow"); ui->setupUi(this); + //Note: translation is needed here in runtime (translator is attached already) + for (auto const & type : msStatTypes) + ui->typeCOB->addItem(tr(type.toStdString().c_str()), type); loadSettings(); + + connect(ui->typeCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->intervalSB, static_cast(&QDoubleSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->linesSB, static_cast(&QSpinBox::valueChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->titleLE, &QLineEdit::editingFinished, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useFrequencyCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->logarithmicCB, &QCheckBox::toggled, this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->sourceCOB, static_cast(&QComboBox::currentIndexChanged), this, &LxQtSysStatConfiguration::saveSettings); + connect(ui->useThemeColoursRB, &QRadioButton::toggled, this, &LxQtSysStatConfiguration::saveSettings); } LxQtSysStatConfiguration::~LxQtSysStatConfiguration() @@ -60,8 +118,6 @@ LxQtSysStatConfiguration::~LxQtSysStatConfiguration() void LxQtSysStatConfiguration::loadSettings() { - mLockSaving = true; - ui->intervalSB->setValue(mSettings->value("graph/updateInterval", 1.0).toDouble()); ui->sizeSB->setValue(mSettings->value("graph/minimalSize", 30).toInt()); @@ -69,11 +125,11 @@ void LxQtSysStatConfiguration::loadSettings() ui->titleLE->setText(mSettings->value("title/label", QString()).toString()); - int typeIndex = ui->typeCOB->findText(mSettings->value("data/type", QString("CPU")).toString()); + int typeIndex = ui->typeCOB->findData(mSettings->value("data/type", msStatTypes[0])); ui->typeCOB->setCurrentIndex((typeIndex >= 0) ? typeIndex : 0); on_typeCOB_currentIndexChanged(ui->typeCOB->currentIndex()); - int sourceIndex = ui->sourceCOB->findText(mSettings->value("data/source", QString()).toString()); + int sourceIndex = ui->sourceCOB->findData(mSettings->value("data/source", QString())); ui->sourceCOB->setCurrentIndex((sourceIndex >= 0) ? sourceIndex : 0); ui->useFrequencyCB->setChecked(mSettings->value("cpu/useFrequency", true).toBool()); @@ -86,15 +142,10 @@ void LxQtSysStatConfiguration::loadSettings() ui->useThemeColoursRB->setChecked(useThemeColours); ui->useCustomColoursRB->setChecked(!useThemeColours); ui->customColoursB->setEnabled(!useThemeColours); - - mLockSaving = false; } void LxQtSysStatConfiguration::saveSettings() { - if (mLockSaving) - return; - mSettings->setValue("graph/useThemeColours", ui->useThemeColoursRB->isChecked()); mSettings->setValue("graph/updateInterval", ui->intervalSB->value()); mSettings->setValue("graph/minimalSize", ui->sizeSB->value()); @@ -103,8 +154,12 @@ void LxQtSysStatConfiguration::saveSettings() mSettings->setValue("title/label", ui->titleLE->text()); - mSettings->setValue("data/type", ui->typeCOB->currentText()); - mSettings->setValue("data/source", ui->sourceCOB->currentText()); + //Note: + // need to make a realy deep copy of the msStatTypes[x] because of SEGFAULTs + // occuring in static finalization time (don't know the real reason...maybe ordering of static finalizers/destructors) + QString type = ui->typeCOB->itemData(ui->typeCOB->currentIndex(), Qt::UserRole).toString().toStdString().c_str(); + mSettings->setValue("data/type", type); + mSettings->setValue("data/source", ui->sourceCOB->itemData(ui->sourceCOB->currentIndex(), Qt::UserRole)); mSettings->setValue("cpu/useFrequency", ui->useFrequencyCB->isChecked()); @@ -143,16 +198,17 @@ void LxQtSysStatConfiguration::on_typeCOB_currentIndexChanged(int index) break; } + ui->sourceCOB->blockSignals(true); ui->sourceCOB->clear(); - ui->sourceCOB->addItems(mStat->sources()); + for (auto const & s : mStat->sources()) + ui->sourceCOB->addItem(tr(s.toStdString().c_str()), s); + ui->sourceCOB->blockSignals(false); ui->sourceCOB->setCurrentIndex(0); } void LxQtSysStatConfiguration::on_maximumHS_valueChanged(int value) { - emit maximumNetSpeedChanged(PluginSysStat::netSpeedToString(value)); - - saveSettings(); + ui->maximumValueL->setText(PluginSysStat::netSpeedToString(value)); } void LxQtSysStatConfiguration::coloursChanged() diff --git a/plugin-sysstat/lxqtsysstatconfiguration.h b/plugin-sysstat/lxqtsysstatconfiguration.h index ef26b90..e804bfc 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.h +++ b/plugin-sysstat/lxqtsysstatconfiguration.h @@ -64,6 +64,9 @@ public slots: void coloursChanged(); +public: + static const QStringList msStatTypes; + signals: void maximumNetSpeedChanged(QString); @@ -76,8 +79,6 @@ private: SysStat::BaseStat *mStat; - bool mLockSaving; - LxQtSysStatColours *mColoursDialog; }; diff --git a/plugin-sysstat/lxqtsysstatconfiguration.ui b/plugin-sysstat/lxqtsysstatconfiguration.ui index b97878e..346872f 100644 --- a/plugin-sysstat/lxqtsysstatconfiguration.ui +++ b/plugin-sysstat/lxqtsysstatconfiguration.ui @@ -278,29 +278,7 @@ - - - 0 - - - 3 - - - - CPU - - - - - Memory - - - - - Network - - - + @@ -463,150 +441,6 @@ - - LxQtSysStatConfiguration - maximumNetSpeedChanged(QString) - maximumValueL - setText(QString) - - - 704 - 158 - - - 251 - 260 - - - - - intervalSB - valueChanged(double) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 57 - - - 392 - 82 - - - - - sizeSB - valueChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 84 - - - 387 - 117 - - - - - linesSB - valueChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 111 - - - 390 - 187 - - - - - titleLE - editingFinished() - LxQtSysStatConfiguration - saveSettings() - - - 386 - 138 - - - 386 - 290 - - - - - useFrequencyCB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 346 - 256 - - - 387 - 244 - - - - - logarithmicCB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 146 - 287 - - - 392 - 214 - - - - - sourceCOB - currentIndexChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 231 - - - 704 - 105 - - - - - typeCOB - currentIndexChanged(int) - LxQtSysStatConfiguration - saveSettings() - - - 386 - 203 - - - 704 - 52 - - - useCustomColoursRB toggled(bool) @@ -623,29 +457,5 @@ - - useThemeColoursRB - toggled(bool) - LxQtSysStatConfiguration - saveSettings() - - - 32 - 337 - - - 2 - 335 - - - - - maximumNetSpeedChanged(QString) - on_typeCOB_currentIndexChanged(int) - on_sourceCOB_currentIndexChanged(int) - on_maximumHS_valueChanged(int) - saveSettings() - on_customColoursB_clicked() - diff --git a/plugin-sysstat/translations/sysstat_de.desktop b/plugin-sysstat/translations/sysstat_de.desktop new file mode 100644 index 0000000..b11a9a4 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Systemstatistiken +Comment[de]=Plugin zum Anzeigen von Systemstatistiken diff --git a/plugin-sysstat/translations/sysstat_de.ts b/plugin-sysstat/translations/sysstat_de.ts new file mode 100644 index 0000000..31ec36a --- /dev/null +++ b/plugin-sysstat/translations/sysstat_de.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Systemstatistik-Farben + + + + Graph + Graph + + + + &Grid + &Raster + + + + + + + + + + + + + + + + Change ... + ändern... + + + + T&itle + T&itel + + + + CPU + Prozessor + + + + &Nice + &Priorität + + + + Ot&her + A&ndere + + + + &Frequency + &Frequenz + + + + S&ystem + S&ystem + + + + &User + Ben&utzer + + + + Memory + Speicher + + + + Cache&d + Zwischenspei&cher + + + + S&wap + Ausge&lagert + + + + &Applications + &Anwendungen + + + + &Buffers + Puff&er + + + + Network + Netzwerk + + + + &Received + E&mpfangen + + + + &Transmitted + &Gesendet + + + + LxQtSysStatConfiguration + + + System Statistics Settings + Systemstatistik - Einstellungen + + + + Graph + Graph + + + + &Minimal size + &Mindestgröße + + + + Update &interval + Aktualisierungs&intervall + + + + &Title + &Titel + + + + &Grid lines + &Rasterlinien + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Mindestbreite bei horizontalem Panel.</p><p>Mindesthöhe bei vertikalem Panel.</p></body></html> + + + + px + px + + + + s + s + + + + Data + Daten + + + + Use &frequency + &Frequenz nutzen + + + + Ma&ximum + Ma&ximum + + + + XXX KBs + XXX KB/s + + + + Lo&garithmic scale + Lo&garithmische Skala + + + + steps + Schritte + + + + CPU + Prozessor + + + + Memory + Speicher + + + + Network + Netzwerk + + + + &Source + &Quelle + + + + T&ype + T&yp + + + + Colours + Farben + + + + Use t&heme colours + Farben des Farbsc&hemas + + + + Use c&ustom colours + &Eigene Farben + + + + Custom colour ... + auswählen... + + + diff --git a/plugin-sysstat/translations/sysstat_hu.desktop b/plugin-sysstat/translations/sysstat_hu.desktop new file mode 100644 index 0000000..d5211b8 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Rendszerstatisztika +Comment[pt]=Infó a rendszerállapotról diff --git a/plugin-sysstat/translations/sysstat_hu.ts b/plugin-sysstat/translations/sysstat_hu.ts new file mode 100644 index 0000000..1d07a6b --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/plugin-sysstat/translations/sysstat_hu_HU.ts b/plugin-sysstat/translations/sysstat_hu_HU.ts new file mode 100644 index 0000000..49bf4d9 --- /dev/null +++ b/plugin-sysstat/translations/sysstat_hu_HU.ts @@ -0,0 +1,237 @@ + + + + + LxQtSysStatColours + + + System Statistics Colors + Rendszerstatisztikai színek + + + + Graph + Grafikon + + + + &Grid + &Rács + + + + + + + + + + + + + + + + Change ... + Változtat... + + + + T&itle + Fel&irat + + + + CPU + Processzor + + + + &Nice + + + + + Ot&her + &Egyéb + + + + &Frequency + &Frekvencia + + + + S&ystem + Rend&szer + + + + &User + &Használó + + + + Memory + Memória + + + + Cache&d + &Gyorsított + + + + S&wap + &Lapozó + + + + &Applications + &Alkalmazások + + + + &Buffers + &Pufferek + + + + Network + Hálózat + + + + &Received + &Fogadott + + + + &Transmitted + &Küldött + + + + LxQtSysStatConfiguration + + + Graph + Grafikon + + + + px + pixel + + + + s + mp + + + + Data + Adatok + + + + System Statistics Settings + Rendszerstatisztika beállítás + + + + &Minimal size + Legkisebb &méret + + + + Update &interval + Fr&issítési köz + + + + &Title + Felira&t + + + + &Grid lines + &Rácsvonalak + + + + <html><head/><body><p>Minimal width if the panel is horizontal.</p><p>Minimal height is the panel is vertical.</p></body></html> + <html><head/><body><p>Vízszintes panelnál szélesség.</p><p>Függőleges panelnál magaság.</p></body></html> + + + + Use &frequency + &Frekvencia használat + + + + Ma&ximum + Ma&ximális + + + + Lo&garithmic scale + Lo&garitmikus skála + + + + CPU + Processzor + + + + Memory + Memória + + + + Network + Hálózat + + + + &Source + Forrá&s + + + + T&ype + &Típus + + + + Colours + Színek + + + + Use t&heme colours + &Rendszertémáé + + + + Use c&ustom colours + &Egyéni + + + + Custom colour ... + Egyéni színek... + + + + XXX KBs + + + + + steps + lépés + + + diff --git a/plugin-sysstat/translations/sysstat_pt.ts b/plugin-sysstat/translations/sysstat_pt.ts index dde326d..ae23b37 100644 --- a/plugin-sysstat/translations/sysstat_pt.ts +++ b/plugin-sysstat/translations/sysstat_pt.ts @@ -1,6 +1,6 @@ - + LxQtSysStatColours @@ -115,7 +115,7 @@ LxQtSysStatConfiguration LxQt SysStat Settings - Definições do LxQt SysStat + Definições do LxQt SysStat @@ -124,11 +124,11 @@ Update interval - Intervalo de atualização + Intervalo de atualização Minimal size - Tamanho mínimo + Tamanho mínimo @@ -142,31 +142,31 @@ Grid - Grelha + Grelha Lines - Linhas + Linhas Colour - Cor + Cor Change ... - Mudar... + Mudar... Title - Título + Título Label - Etiqueta + Etiqueta Font - Tipo de letra + Tipo de letra @@ -175,7 +175,7 @@ Type - Tipo + Tipo @@ -269,59 +269,59 @@ Source - Fonte + Fonte System - Sistema + Sistema User - Utilizador + Utilizador Nice - Aceitável + Aceitável Other - Outras + Outras Use Frequency - Utilizar frequência + Utilizar frequência Frequency - Frequência + Frequência Applications - Aplicações + Aplicações Buffers - Buffers + Buffers Cached - Cache + Cache Used - Utilizado + Utilizado Received - Recebido + Recebido Transmitted - Enviado + Enviado Maximum - Máximo + Máximo @@ -330,7 +330,7 @@ Logarithmic scale - Escala logarítmica + Escala logarítmica @@ -339,31 +339,31 @@ Ultra light - Ultra claro + Ultra claro Light - Claro + Claro Ultra black - Ultra escuro + Ultra escuro Black - Escuro + Escuro Bold - Negrito + Negrito Demi bold - Semi-negrito + Semi-negrito Italic - Itálico + Itálico diff --git a/plugin-taskbar/CMakeLists.txt b/plugin-taskbar/CMakeLists.txt index 7712eb3..3e646cc 100644 --- a/plugin-taskbar/CMakeLists.txt +++ b/plugin-taskbar/CMakeLists.txt @@ -5,6 +5,8 @@ set(HEADERS lxqttaskbutton.h lxqttaskbarconfiguration.h lxqttaskbarplugin.h + lxqttaskgroup.h + lxqtgrouppopup.h ) set(SOURCES @@ -12,13 +14,8 @@ set(SOURCES lxqttaskbutton.cpp lxqttaskbarconfiguration.cpp lxqttaskbarplugin.cpp -) - -set(MOCS - lxqttaskbar.h - lxqttaskbutton.h - lxqttaskbarconfiguration.h - lxqttaskbarplugin.h + lxqttaskgroup.cpp + lxqtgrouppopup.cpp ) set(UIS @@ -26,8 +23,8 @@ set(UIS ) set(LIBRARIES - ${LXQT_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt + Qt5Xdg ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-taskbar/lxqtgrouppopup.cpp b/plugin-taskbar/lxqtgrouppopup.cpp new file mode 100644 index 0000000..55eda7a --- /dev/null +++ b/plugin-taskbar/lxqtgrouppopup.cpp @@ -0,0 +1,171 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqtgrouppopup.h" +#include +#include +#include +#include +#include + +/************************************************ + this class is just a container of window buttons + the main purpose is showing window buttons in + vertical layout and drag&drop feature inside + group + ************************************************/ +LxQtGroupPopup::LxQtGroupPopup(LxQtTaskGroup *group): + QFrame(group), + mGroup(group) +{ + Q_ASSERT(group); + setAcceptDrops(true); + setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); + setAttribute(Qt::WA_AlwaysShowToolTips); + + setLayout(new QVBoxLayout); + layout()->setSpacing(3); + layout()->setMargin(3); + + connect(&mCloseTimer, &QTimer::timeout, this, &LxQtGroupPopup::closeTimerSlot); + mCloseTimer.setSingleShot(true); + mCloseTimer.setInterval(400); +} + +LxQtGroupPopup::~LxQtGroupPopup() +{ +} + +void LxQtGroupPopup::dropEvent(QDropEvent *event) +{ + qlonglong temp; + WId window; + QDataStream stream(event->mimeData()->data(LxQtTaskButton::mimeDataFormat())); + stream >> temp; + window = (WId) temp; + + LxQtTaskButton *button; + int oldIndex(0); + // get current position of the button being dragged + for (int i = 0; i < layout()->count(); i++) + { + LxQtTaskButton *b = qobject_cast(layout()->itemAt(i)->widget()); + if (b && b->windowId() == window) + { + button = b; + oldIndex = i; + break; + } + } + + int newIndex = -1; + // find the new position to place it in + for (int i = 0; i < oldIndex && newIndex == -1; i++) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 > event->pos().y()) + newIndex = i; + } + const int size = layout()->count(); + for (int i = size - 1; i > oldIndex && newIndex == -1; i--) + { + QWidget *w = layout()->itemAt(i)->widget(); + if (w && w->pos().y() + w->height() / 2 < event->pos().y()) + newIndex = i; + } + + if (newIndex == -1 || newIndex == oldIndex) + return; + + QVBoxLayout * l = qobject_cast(layout()); + l->takeAt(oldIndex); + l->insertWidget(newIndex, button); + l->invalidate(); +} + +void LxQtGroupPopup::dragEnterEvent(QDragEnterEvent *event) +{ + event->accept(); + QWidget::dragEnterEvent(event); +} + +void LxQtGroupPopup::dragLeaveEvent(QDragLeaveEvent *event) +{ + hide(false/*not fast*/); + QFrame::dragLeaveEvent(event); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::leaveEvent(QEvent *event) +{ + mCloseTimer.start(); +} + +/************************************************ + * + ************************************************/ +void LxQtGroupPopup::enterEvent(QEvent *event) +{ + mCloseTimer.stop(); +} + +void LxQtGroupPopup::hide(bool fast) +{ + if (fast) + close(); + else + mCloseTimer.start(); +} + +void LxQtGroupPopup::show() +{ + mCloseTimer.stop(); + QFrame::show(); +} + +void LxQtGroupPopup::closeTimerSlot() +{ + bool button_has_dnd_hover = false; + QLayout* l = layout(); + for (int i = 0; l->count() > i; ++i) + { + LxQtTaskButton const * const button = dynamic_cast(l->itemAt(i)->widget()); + if (0 != button && button->hasDragAndDropHover()) + { + button_has_dnd_hover = true; + break; + } + } + if (!button_has_dnd_hover) + close(); +} diff --git a/plugin-taskbar/lxqtgrouppopup.h b/plugin-taskbar/lxqtgrouppopup.h new file mode 100644 index 0000000..67f2d7d --- /dev/null +++ b/plugin-taskbar/lxqtgrouppopup.h @@ -0,0 +1,78 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKPOPUP_H +#define LXQTTASKPOPUP_H + +#include +#include +#include +#include +#include + +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +class LxQtGroupPopup: public QFrame +{ + Q_OBJECT + +public: + LxQtGroupPopup(LxQtTaskGroup *group); + ~LxQtGroupPopup(); + + void hide(bool fast = false); + void show(); + + // Layout + int indexOf(LxQtTaskButton *button) { return layout()->indexOf(button); } + int count() { return layout()->count(); } + QLayoutItem * itemAt(int i) { return layout()->itemAt(i); } + int spacing() { return layout()->spacing(); } + void addButton(LxQtTaskButton* button) { layout()->addWidget(button); } + void removeWidget(QWidget *button) { layout()->removeWidget(button); } + +protected: + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent *event); + void dropEvent(QDropEvent * event); + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + + void closeTimerSlot(); + +private: + LxQtTaskGroup *mGroup; + QTimer mCloseTimer; +}; + +#endif // LXQTTASKPOPUP_H diff --git a/plugin-taskbar/lxqttaskbar.cpp b/plugin-taskbar/lxqttaskbar.cpp index 542e066..06cd032 100644 --- a/plugin-taskbar/lxqttaskbar.cpp +++ b/plugin-taskbar/lxqttaskbar.cpp @@ -33,20 +33,19 @@ #include #include #include - -#include -#include #include #include -#include #include #include #include #include +#include + +#include +#include #include "lxqttaskbar.h" -#include "lxqttaskbutton.h" -#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskgroup.h" using namespace LxQt; @@ -56,33 +55,36 @@ using namespace LxQt; LxQtTaskBar::LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget *parent) : QFrame(parent), mButtonStyle(Qt::ToolButtonTextBesideIcon), - mCheckedBtn(NULL), mCloseOnMiddleClick(true), - mShowOnlyCurrentDesktopTasks(false), + mRaiseOnCurrentDesktop(true), + mShowOnlyOneDesktopTasks(false), + mShowDesktopNum(0), + mShowOnlyCurrentScreenTasks(false), + mShowOnlyMinimizedTasks(false), mAutoRotate(true), + mShowGroupOnHover(true), mPlugin(plugin), mPlaceHolder(new QWidget(this)), - mStyle(new ElidedButtonStyle()) + mStyle(new LeftAlignedTextStyle()) { + setStyle(mStyle); mLayout = new LxQt::GridLayout(this); setLayout(mLayout); mLayout->setMargin(0); + mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); realign(); - mPlaceHolder->setStyle(mStyle); mPlaceHolder->setMinimumSize(1, 1); mPlaceHolder->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); mPlaceHolder->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); mLayout->addWidget(mPlaceHolder); - settingsChanged(); + QTimer::singleShot(0, this, SLOT(settingsChanged())); setAcceptDrops(true); connect(KWindowSystem::self(), SIGNAL(stackingOrderChanged()), SLOT(refreshTaskList())); - connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), SLOT(refreshTaskList())); - connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId))); - connect(KWindowSystem::self(), SIGNAL(windowChanged(WId, NET::Properties, NET::Properties2)), - SLOT(windowChanged(WId, NET::Properties, NET::Properties2))); + connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged) + , this, &LxQtTaskBar::onWindowChanged); } /************************************************ @@ -93,31 +95,6 @@ LxQtTaskBar::~LxQtTaskBar() delete mStyle; } -/************************************************ - - ************************************************/ -LxQtTaskButton* LxQtTaskBar::buttonByWindow(WId window) const -{ - if (mButtonsHash.contains(window)) - return mButtonsHash.value(window); - return 0; -} - -/************************************************ - - ************************************************/ -bool LxQtTaskBar::windowOnActiveDesktop(WId window) const -{ - if (!mShowOnlyCurrentDesktopTasks) - return true; - - int desktop = KWindowInfo(window, NET::WMDesktop).desktop(); - if (desktop == NET::OnAllDesktops) - return true; - - return desktop == KWindowSystem::currentDesktop(); -} - /************************************************ ************************************************/ @@ -162,7 +139,7 @@ bool LxQtTaskBar::acceptWindow(WId window) const ************************************************/ void LxQtTaskBar::dragEnterEvent(QDragEnterEvent* event) { - if (event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) event->acceptProposedAction(); else event->ignore(); @@ -174,32 +151,50 @@ void LxQtTaskBar::dragEnterEvent(QDragEnterEvent* event) ************************************************/ void LxQtTaskBar::dropEvent(QDropEvent* event) { - if (!event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (!event->mimeData()->hasFormat(LxQtTaskGroup::mimeDataFormat())) + { + event->ignore(); return; + } - QDataStream stream(event->mimeData()->data("lxqt/lxqttaskbutton")); - // window id for dropped button - qlonglong temp; - stream >> temp; - WId droppedWid = (WId) temp; - qDebug() << QString("Dropped window: %1").arg(droppedWid); + QString data; + QDataStream stream(event->mimeData()->data(LxQtTaskGroup::mimeDataFormat())); + stream >> data; - int droppedIndex = mLayout->indexOf(mButtonsHash[droppedWid]); + LxQtTaskGroup *group = mGroupsHash.value(data, NULL); + if (!group) + { + qDebug() << "Dropped invalid"; + return; + } + + int droppedIndex = mLayout->indexOf(group); int newPos = -1; const int size = mLayout->count(); - for (int i = 0; i < droppedIndex && newPos == -1; i++) - if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) - newPos = i; + if (mPlugin->panel()->isHorizontal()) + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) + newPos = i; - for (int i = size - 1; i > droppedIndex && newPos == -1; i--) - if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x()) - newPos = i; + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x()) + newPos = i; + } + else + { + for (int i = 0; i < droppedIndex && newPos == -1; i++) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 > event->pos().y()) + newPos = i; + + for (int i = size - 1; i > droppedIndex && newPos == -1; i--) + if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 < event->pos().y()) + newPos = i; + } if (newPos == -1 || droppedIndex == newPos) return; - qDebug() << QString("Dropped button shoud go to position %1").arg(newPos); - mLayout->moveItem(droppedIndex, newPos); mLayout->invalidate(); @@ -209,42 +204,78 @@ void LxQtTaskBar::dropEvent(QDropEvent* event) /************************************************ ************************************************/ +void LxQtTaskBar::groupBecomeEmptySlot() +{ + //group now contains no buttons - clean up in hash and delete the group + LxQtTaskGroup *group = qobject_cast(sender()); + Q_ASSERT(group); + + mGroupsHash.erase(mGroupsHash.find(group->groupName())); + group->deleteLater(); +} + +/************************************************ + + ************************************************/ + +void LxQtTaskBar::addWindow(WId window, QString const & groupId) +{ + LxQtTaskGroup *group = mGroupsHash.value(groupId); + + if (!group) + { + group = new LxQtTaskGroup(groupId, KWindowSystem::icon(window), mPlugin, this); + connect(group, SIGNAL(groupBecomeEmpty(QString)), this, SLOT(groupBecomeEmptySlot())); + connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility())); + connect(group, &LxQtTaskGroup::popupShown, this, &LxQtTaskBar::groupPopupShown); + connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList())); + + mLayout->addWidget(group); + mGroupsHash.insert(groupId, group); + group->setToolButtonsStyle(mButtonStyle); + } + group->addWindow(window); +} +/************************************************ + + ************************************************/ + void LxQtTaskBar::refreshTaskList() { + // Just add new windows to groups, deleting is up to the groups QList tmp = KWindowSystem::stackingOrder(); - QMutableHashIterator i(mButtonsHash); - while (i.hasNext()) + Q_FOREACH (WId wnd, tmp) { - i.next(); - int n = tmp.removeAll(i.key()); - - if (!n) + if (acceptWindow(wnd)) { - // if the button we're removing is the currently selected app - if(i.value() == mCheckedBtn) - mCheckedBtn = NULL; - delete i.value(); - i.remove(); + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(wnd, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(wnd); + addWindow(wnd, id); } } - foreach (WId wnd, tmp) + refreshPlaceholderVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskBar::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + // If grouping disabled group behaves like regular button + QString id = mGroupingEnabled ? KWindowInfo(window, 0, NET::WM2WindowClass).windowClassClass() : QString("%1").arg(window); + LxQtTaskGroup *group = mGroupsHash.value(id); + + bool consumed{false}; + if (nullptr != group) { - if (acceptWindow(wnd)) - { - LxQtTaskButton* btn = new LxQtTaskButton(wnd, this); - btn->setStyle(mStyle); - btn->setToolButtonStyle(mButtonStyle); + consumed = group->onWindowChanged(window, prop, prop2); - mButtonsHash.insert(wnd, btn); - mLayout->addWidget(btn); - } } - refreshButtonVisibility(); - mLayout->invalidate(); - activeWindowChanged(); - realign(); + + if (!consumed && acceptWindow(window)) + addWindow(window, id); } /************************************************ @@ -255,28 +286,27 @@ void LxQtTaskBar::refreshButtonRotation() bool autoRotate = mAutoRotate && (mButtonStyle != Qt::ToolButtonIconOnly); ILxQtPanel::Position panelPosition = mPlugin->panel()->position(); - - QHashIterator i(mButtonsHash); - while (i.hasNext()) + QHashIterator j(mGroupsHash); + while(j.hasNext()) { - i.next(); - i.value()->setAutoRotation(autoRotate, panelPosition); + j.next(); + j.value()->setAutoRotation(autoRotate,panelPosition); } } + /************************************************ ************************************************/ - -void LxQtTaskBar::refreshButtonVisibility() +void LxQtTaskBar::refreshPlaceholderVisibility() { + // if no visible group button show placeholder widget bool haveVisibleWindow = false; - QHashIterator i(mButtonsHash); - while (i.hasNext()) + QHashIterator j(mGroupsHash); + while (j.hasNext()) { - i.next(); - bool isVisible = windowOnActiveDesktop(i.key()); - haveVisibleWindow |= isVisible; - i.value()->setVisible(isVisible); + j.next(); + if (j.value()->isVisible()) + haveVisibleWindow = true; } mPlaceHolder->setVisible(!haveVisibleWindow); if (haveVisibleWindow) @@ -294,83 +324,14 @@ void LxQtTaskBar::refreshButtonVisibility() ************************************************/ void LxQtTaskBar::refreshIconGeometry() { - // FIXME: sometimes we get wrong globalPos here, especially - // after changing the pos or size of the panel. - // this might be caused by bugs in lxqtpanel.cpp. - QHashIterator i(mButtonsHash); + QHashIterator i(mGroupsHash); while (i.hasNext()) { i.next(); - LxQtTaskButton* button = i.value(); - QRect rect = button->geometry(); - QPoint globalPos = mapToGlobal(button->pos()); - rect.moveTo(globalPos); - - NETWinInfo info(QX11Info::connection(), button->windowId(), - (WId) QX11Info::appRootWindow(), NET::WMIconGeometry, 0); - NETRect nrect; - nrect.pos.x = rect.x(); - nrect.pos.y = rect.y(); - nrect.size.height = rect.height(); - nrect.size.width = rect.width(); - info.setIconGeometry(nrect); + i.value()->refreshIconsGeometry(); } } -/************************************************ - - ************************************************/ -void LxQtTaskBar::activeWindowChanged(WId window) -{ - if (!window) - window = KWindowSystem::activeWindow(); - - LxQtTaskButton* btn = buttonByWindow(window); - - if (mCheckedBtn != btn) - { - if (mCheckedBtn) - mCheckedBtn->setChecked(false); - if (btn) - { - btn->setChecked(true); - if (btn->hasUrgencyHint()) - btn->setUrgencyHint(false); - } - mCheckedBtn = btn; - } -} - -/************************************************ - - ************************************************/ -void LxQtTaskBar::windowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) -{ - LxQtTaskButton* button = buttonByWindow(window); - if (!button) - return; - - // window changed virtual desktop - if (prop.testFlag(NET::WMDesktop)) - { - if (mShowOnlyCurrentDesktopTasks) - { - int desktop = button->desktopNum(); - button->setHidden(desktop != NET::OnAllDesktops && desktop != KWindowSystem::currentDesktop()); - } - } - - if (prop.testFlag(NET::WMVisibleName) || prop.testFlag(NET::WMName)) - button->updateText(); - - // FIXME: NET::WMIconGeometry is causing high CPU and memory usage - if (prop.testFlag(NET::WMIcon) /*|| prop.testFlag(NET::WMIconGeometry)*/) - button->updateIcon(); - - if (prop.testFlag(NET::WMState)) - button->setUrgencyHint(KWindowInfo(window, NET::WMState).hasState(NET::DemandsAttention)); -} - /************************************************ ************************************************/ @@ -378,11 +339,11 @@ void LxQtTaskBar::setButtonStyle(Qt::ToolButtonStyle buttonStyle) { mButtonStyle = buttonStyle; - QHashIterator i(mButtonsHash); + QHashIterator i(mGroupsHash); while (i.hasNext()) { i.next(); - i.value()->setToolButtonStyle(mButtonStyle); + i.value()->setToolButtonsStyle(buttonStyle); } } @@ -391,7 +352,14 @@ void LxQtTaskBar::setButtonStyle(Qt::ToolButtonStyle buttonStyle) ************************************************/ void LxQtTaskBar::settingsChanged() { + bool groupingEnabledOld = mGroupingEnabled; + bool showOnlyOneDesktopTasksOld = mShowOnlyOneDesktopTasks; + const int showDesktopNumOld = mShowDesktopNum; + bool showOnlyCurrentScreenTasksOld = mShowOnlyCurrentScreenTasks; + bool showOnlyMinimizedTasksOld = mShowOnlyMinimizedTasks; + mButtonWidth = mPlugin->settings()->value("buttonWidth", 400).toInt(); + mButtonHeight = mPlugin->settings()->value("buttonHeight", 100).toInt(); QString s = mPlugin->settings()->value("buttonStyle").toString().toUpper(); if (s == "ICON") @@ -401,9 +369,34 @@ void LxQtTaskBar::settingsChanged() else setButtonStyle(Qt::ToolButtonTextBesideIcon); - mShowOnlyCurrentDesktopTasks = mPlugin->settings()->value("showOnlyCurrentDesktopTasks", mShowOnlyCurrentDesktopTasks).toBool(); + mShowOnlyOneDesktopTasks = mPlugin->settings()->value("showOnlyOneDesktopTasks", mShowOnlyOneDesktopTasks).toBool(); + mShowDesktopNum = mPlugin->settings()->value("showDesktopNum", mShowDesktopNum).toInt(); + mShowOnlyCurrentScreenTasks = mPlugin->settings()->value("showOnlyCurrentScreenTasks", mShowOnlyCurrentScreenTasks).toBool(); + mShowOnlyMinimizedTasks = mPlugin->settings()->value("showOnlyMinimizedTasks", mShowOnlyMinimizedTasks).toBool(); mAutoRotate = mPlugin->settings()->value("autoRotate", true).toBool(); mCloseOnMiddleClick = mPlugin->settings()->value("closeOnMiddleClick", true).toBool(); + mRaiseOnCurrentDesktop = mPlugin->settings()->value("raiseOnCurrentDesktop", false).toBool(); + mGroupingEnabled = mPlugin->settings()->value("groupingEnabled",true).toBool(); + mShowGroupOnHover = mPlugin->settings()->value("showGroupOnHover",true).toBool(); + + // Delete all groups if grouping feature toggled and start over + if (groupingEnabledOld != mGroupingEnabled) + { + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash.values()) + { + mLayout->removeWidget(group); + group->deleteLater(); + } + mGroupsHash.clear(); + } + + if (showOnlyOneDesktopTasksOld != mShowOnlyOneDesktopTasks + || (mShowOnlyOneDesktopTasks && showDesktopNumOld != mShowDesktopNum) + || showOnlyCurrentScreenTasksOld != mShowOnlyCurrentScreenTasks + || showOnlyMinimizedTasksOld != mShowOnlyMinimizedTasks + ) + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); refreshTaskList(); } @@ -414,134 +407,56 @@ void LxQtTaskBar::settingsChanged() void LxQtTaskBar::realign() { mLayout->setEnabled(false); - refreshButtonRotation(); ILxQtPanel *panel = mPlugin->panel(); - QSize maxSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + QSize maxSize = QSize(mButtonWidth, mButtonHeight); QSize minSize = QSize(0, 0); bool rotated = false; + if (panel->isHorizontal()) { - if (mButtonStyle == Qt::ToolButtonIconOnly) - { - // Horizontal + Icons ************** - mLayout->setRowCount(panel->lineCount()); - mLayout->setColumnCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = mButtonWidth; - } - else - { - // Horizontal + Text *************** - mLayout->setRowCount(panel->lineCount()); - mLayout->setColumnCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = mButtonWidth; - } + mLayout->setRowCount(panel->lineCount()); + mLayout->setColumnCount(0); } else { + mLayout->setRowCount(0); + if (mButtonStyle == Qt::ToolButtonIconOnly) { - // Vertical + Icons **************** - mLayout->setRowCount(0); + // Vertical + Icons mLayout->setColumnCount(panel->lineCount()); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = QWIDGETSIZE_MAX; - } else { - if (mAutoRotate) - { - switch (panel->position()) - { - case ILxQtPanel::PositionLeft: - case ILxQtPanel::PositionRight: - rotated = true; - break; - - default:; - } - } + rotated = mAutoRotate && (panel->position() == ILxQtPanel::PositionLeft || panel->position() == ILxQtPanel::PositionRight); - // Vertical + Text ***************** + // Vertical + Text if (rotated) { - mLayout->setColumnCount(panel->lineCount()); - mLayout->setRowCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal | LxQt::GridLayout::StretchVertical); - - minSize.rheight() = 0; - minSize.rwidth() = 0; - + maxSize.rwidth() = mButtonHeight; maxSize.rheight() = mButtonWidth; - maxSize.rwidth() = QWIDGETSIZE_MAX; + + mLayout->setColumnCount(panel->lineCount()); } else { mLayout->setColumnCount(1); - mLayout->setRowCount(0); - mLayout->setStretch(LxQt::GridLayout::StretchHorizontal); - - minSize.rheight() = 0; - minSize.rwidth() = mButtonWidth; - - maxSize.rheight() = QWIDGETSIZE_MAX; - maxSize.rwidth() = QWIDGETSIZE_MAX; } } } mLayout->setCellMinimumSize(minSize); mLayout->setCellMaximumSize(maxSize); - mLayout->setDirection(rotated ? LxQt::GridLayout::TopToBottom : LxQt::GridLayout::LeftToRight); mLayout->setEnabled(true); - refreshIconGeometry(); -} - -/************************************************ - - ************************************************/ -void LxQtTaskBar::mousePressEvent(QMouseEvent *event) -{ - // close the app on mouse middle click - if (mCloseOnMiddleClick && event->button() == Qt::MidButton) - { - // find the button at current cursor pos - QHashIterator i(mButtonsHash); - while (i.hasNext()) - { - i.next(); - LxQtTaskButton* btn = i.value(); - if (btn->geometry().contains(event->pos()) && - (!mShowOnlyCurrentDesktopTasks || KWindowSystem::currentDesktop() == KWindowInfo(i.key(), NET::WMDesktop).desktop())) - { - btn->closeApplication(); - break; - } - } - } - QFrame::mousePressEvent(event); + //our placement on screen could have been changed + Q_FOREACH (LxQtTaskGroup *group, mGroupsHash) + group->showOnlySettingChanged(); + refreshIconGeometry(); } /************************************************ @@ -549,26 +464,47 @@ void LxQtTaskBar::mousePressEvent(QMouseEvent *event) ************************************************/ void LxQtTaskBar::wheelEvent(QWheelEvent* event) { - if (!mCheckedBtn) - return; - - int current = mLayout->indexOf(mCheckedBtn); - if (current == -1) + static int threshold = 0; + threshold += abs(event->delta()); + if (threshold < 300) return; + else + threshold = 0; int delta = event->delta() < 0 ? 1 : -1; - for (int ix = current + delta; 0 <= ix && ix < mLayout->count(); ix += delta) + + // create temporary list of visible groups in the same order like on the layout + QList list; + LxQtTaskGroup *group = NULL; + for (int i = 0; i < mLayout->count(); i++) { - QLayoutItem *item = mLayout->itemAt(ix); - if (!item) + QWidget * o = mLayout->itemAt(i)->widget(); + LxQtTaskGroup * g = qobject_cast(o); + if (!g) continue; - WId window = ((LxQtTaskButton *) item->widget())->windowId(); - if (acceptWindow(window) && windowOnActiveDesktop(window)) - { - KWindowSystem::activateWindow(window); - break; - } + if (g->isVisible()) + list.append(g); + if (g->isChecked()) + group = g; + } + + if (list.isEmpty()) + return; + + if (!group) + group = list.at(0); + + LxQtTaskButton *button = NULL; + + // switching between groups from temporary list in modulo addressing + while (!button) + { + button = group->getNextPrevChildButton(delta == 1, !(list.count() - 1)); + if (button) + button->raiseApplication(); + int idx = (list.indexOf(group) + delta + list.count()) % list.count(); + group = list.at(idx); } } @@ -593,3 +529,13 @@ void LxQtTaskBar::changeEvent(QEvent* event) QFrame::changeEvent(event); } + +void LxQtTaskBar::groupPopupShown(LxQtTaskGroup * const sender) +{ + //close all popups (should they be visible because of close delay) + for (auto group : mGroupsHash) + { + if (group->isVisible() && sender != group) + group->setPopupVisible(false, true/*fast*/); + } +} diff --git a/plugin-taskbar/lxqttaskbar.h b/plugin-taskbar/lxqttaskbar.h index 675284e..e672051 100644 --- a/plugin-taskbar/lxqttaskbar.h +++ b/plugin-taskbar/lxqttaskbar.h @@ -33,18 +33,22 @@ #ifndef LXQTTASKBAR_H #define LXQTTASKBAR_H +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" #include "lxqttaskbarconfiguration.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbutton.h" + #include #include #include #include "../panel/ilxqtpanel.h" -#include -#include -#include +#include +#include +#include class LxQtTaskButton; class ElidedButtonStyle; -class ILxQtPanelPlugin; namespace LxQt { class GridLayout; @@ -58,46 +62,68 @@ public: explicit LxQtTaskBar(ILxQtPanelPlugin *plugin, QWidget* parent = 0); virtual ~LxQtTaskBar(); - virtual void settingsChanged(); void realign(); + Qt::ToolButtonStyle buttonStyle() const { return mButtonStyle; } + int buttonWidth() const { return mButtonWidth; } + bool closeOnMiddleClick() const { return mCloseOnMiddleClick; } + bool raiseOnCurrentDesktop() const { return mRaiseOnCurrentDesktop; } + bool isShowOnlyOneDesktopTasks() const { return mShowOnlyOneDesktopTasks; } + int showDesktopNum() const { return mShowDesktopNum; } + bool isShowOnlyCurrentScreenTasks() const { return mShowOnlyCurrentScreenTasks; } + bool isShowOnlyMinimizedTasks() const { return mShowOnlyMinimizedTasks; } + bool isAutoRotate() const { return mAutoRotate; } + bool isGroupingEnabled() const { return mGroupingEnabled; } + bool isShowGroupOnHover() const { return mShowGroupOnHover; } + ILxQtPanel * panel() const { return mPlugin->panel(); } + public slots: - void windowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); - void activeWindowChanged(WId window = 0); - void refreshIconGeometry(); + void settingsChanged(); protected: virtual void dragEnterEvent(QDragEnterEvent * event); virtual void dropEvent(QDropEvent * event); private slots: + void refreshIconGeometry(); void refreshTaskList(); void refreshButtonRotation(); - void refreshButtonVisibility(); + void refreshPlaceholderVisibility(); + void groupBecomeEmptySlot(); + void groupPopupShown(LxQtTaskGroup * const sender); + void onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + +private: + void addWindow(WId window, QString const & groupId); private: - QHash mButtonsHash; + QHash mGroupsHash; LxQt::GridLayout *mLayout; + + // Settings Qt::ToolButtonStyle mButtonStyle; int mButtonWidth; - LxQtTaskButton* mCheckedBtn; + int mButtonHeight; bool mCloseOnMiddleClick; - bool mShowOnlyCurrentDesktopTasks; + bool mRaiseOnCurrentDesktop; + bool mShowOnlyOneDesktopTasks; + int mShowDesktopNum; + bool mShowOnlyCurrentScreenTasks; + bool mShowOnlyMinimizedTasks; bool mAutoRotate; + bool mGroupingEnabled; + bool mShowGroupOnHover; - LxQtTaskButton* buttonByWindow(WId window) const; - bool windowOnActiveDesktop(WId window) const; bool acceptWindow(WId window) const; void setButtonStyle(Qt::ToolButtonStyle buttonStyle); void wheelEvent(QWheelEvent* event); void changeEvent(QEvent* event); - void mousePressEvent(QMouseEvent *event); void resizeEvent(QResizeEvent *event); ILxQtPanelPlugin *mPlugin; QWidget *mPlaceHolder; - ElidedButtonStyle* mStyle; + LeftAlignedTextStyle *mStyle; }; #endif // LXQTTASKBAR_H diff --git a/plugin-taskbar/lxqttaskbarconfiguration.cpp b/plugin-taskbar/lxqttaskbarconfiguration.cpp index c849a25..23f90af 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.cpp +++ b/plugin-taskbar/lxqttaskbarconfiguration.cpp @@ -30,6 +30,7 @@ #include "lxqttaskbarconfiguration.h" #include "ui_lxqttaskbarconfiguration.h" +#include LxQtTaskbarConfiguration::LxQtTaskbarConfiguration(QSettings &settings, QWidget *parent): QDialog(parent), @@ -47,16 +48,29 @@ LxQtTaskbarConfiguration::LxQtTaskbarConfiguration(QSettings &settings, QWidget ui->buttonStyleCB->addItem(tr("Only icon"), "Icon"); ui->buttonStyleCB->addItem(tr("Only text"), "Text"); + ui->showDesktopNumCB->addItem(tr("Current"), 0); + //Note: in KWindowSystem desktops are numbered from 1..N + const int desk_cnt = KWindowSystem::numberOfDesktops(); + for (int i = 1; desk_cnt >= i; ++i) + ui->showDesktopNumCB->addItem(QStringLiteral("%1 - %2").arg(i).arg(KWindowSystem::desktopName(i)), i); + loadSettings(); + /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly change of state */ - connect(ui->fAllDesktopsCB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->fCurrentDesktopRB, SIGNAL(clicked()), this, SLOT(saveSettings())); - connect(ui->buttonStyleCB, SIGNAL(activated(int)), this, SLOT(updateControls(int))); + connect(ui->limitByDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByDesktopCB, &QCheckBox::stateChanged, ui->showDesktopNumCB, &QWidget::setEnabled); + connect(ui->showDesktopNumCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); + connect(ui->limitByScreenCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->limitByMinimizedCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->raiseOnCurrentDesktopCB, SIGNAL(clicked()), this, SLOT(saveSettings())); connect(ui->buttonStyleCB, SIGNAL(activated(int)), this, SLOT(saveSettings())); connect(ui->buttonWidthSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); + connect(ui->buttonHeightSB, SIGNAL(valueChanged(int)), this, SLOT(saveSettings())); connect(ui->autoRotateCB, SIGNAL(clicked()), this, SLOT(saveSettings())); connect(ui->middleClickCB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->groupingGB, SIGNAL(clicked()), this, SLOT(saveSettings())); + connect(ui->showGroupOnHoverCB, SIGNAL(clicked()), this, SLOT(saveSettings())); } LxQtTaskbarConfiguration::~LxQtTaskbarConfiguration() @@ -66,45 +80,37 @@ LxQtTaskbarConfiguration::~LxQtTaskbarConfiguration() void LxQtTaskbarConfiguration::loadSettings() { - if (mSettings.value("showOnlyCurrentDesktopTasks", false).toBool() == true) - { - ui->fCurrentDesktopRB->setChecked(true); - } - else - { - ui->fAllDesktopsCB->setChecked(true); - } + const bool showOnlyOneDesktopTasks = mSettings.value("showOnlyOneDesktopTasks", false).toBool(); + ui->limitByDesktopCB->setChecked(showOnlyOneDesktopTasks); + ui->showDesktopNumCB->setCurrentIndex(ui->showDesktopNumCB->findData(mSettings.value("showDesktopNum", 0).toInt())); + ui->showDesktopNumCB->setEnabled(showOnlyOneDesktopTasks); + ui->limitByScreenCB->setChecked(mSettings.value("showOnlyCurrentScreenTasks", false).toBool()); + ui->limitByMinimizedCB->setChecked(mSettings.value("showOnlyMinimizedTasks", false).toBool()); ui->autoRotateCB->setChecked(mSettings.value("autoRotate", true).toBool()); ui->middleClickCB->setChecked(mSettings.value("closeOnMiddleClick", true).toBool()); + ui->raiseOnCurrentDesktopCB->setChecked(mSettings.value("raiseOnCurrentDesktop", false).toBool()); ui->buttonStyleCB->setCurrentIndex(ui->buttonStyleCB->findData(mSettings.value("buttonStyle", "IconText"))); - updateControls(ui->buttonStyleCB->currentIndex()); - - /* Keep buttonWidth loading at the end of this method to prevent errors */ ui->buttonWidthSB->setValue(mSettings.value("buttonWidth", 400).toInt()); + ui->buttonHeightSB->setValue(mSettings.value("buttonHeight", 100).toInt()); + ui->groupingGB->setChecked(mSettings.value("groupingEnabled",true).toBool()); + ui->showGroupOnHoverCB->setChecked(mSettings.value("showGroupOnHover",true).toBool()); } void LxQtTaskbarConfiguration::saveSettings() { - mSettings.setValue("showOnlyCurrentDesktopTasks", ui->fCurrentDesktopRB->isChecked()); + mSettings.setValue("showOnlyOneDesktopTasks", ui->limitByDesktopCB->isChecked()); + mSettings.setValue("showDesktopNum", ui->showDesktopNumCB->itemData(ui->showDesktopNumCB->currentIndex())); + mSettings.setValue("showOnlyCurrentScreenTasks", ui->limitByScreenCB->isChecked()); + mSettings.setValue("showOnlyMinimizedTasks", ui->limitByMinimizedCB->isChecked()); mSettings.setValue("buttonStyle", ui->buttonStyleCB->itemData(ui->buttonStyleCB->currentIndex())); mSettings.setValue("buttonWidth", ui->buttonWidthSB->value()); + mSettings.setValue("buttonHeight", ui->buttonHeightSB->value()); mSettings.setValue("autoRotate", ui->autoRotateCB->isChecked()); mSettings.setValue("closeOnMiddleClick", ui->middleClickCB->isChecked()); -} - -void LxQtTaskbarConfiguration::updateControls(int index) -{ - if (ui->buttonStyleCB->itemData(index) == "Icon") - { - ui->buttonWidthSB->setEnabled(false); - ui->buttonWidthL->setEnabled(false); - } - else - { - ui->buttonWidthSB->setEnabled(true); - ui->buttonWidthL->setEnabled(true); - } + mSettings.setValue("raiseOnCurrentDesktop", ui->raiseOnCurrentDesktopCB->isChecked()); + mSettings.setValue("groupingEnabled",ui->groupingGB->isChecked()); + mSettings.setValue("showGroupOnHover",ui->showGroupOnHoverCB->isChecked()); } void LxQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) @@ -114,12 +120,12 @@ void LxQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) /* We have to disable signals for buttonWidthSB to prevent errors. Otherwise not all data could be restored */ ui->buttonWidthSB->blockSignals(true); + ui->buttonHeightSB->blockSignals(true); oldSettings.loadToSettings(); loadSettings(); ui->buttonWidthSB->blockSignals(false); + ui->buttonHeightSB->blockSignals(false); } else - { close(); - } } diff --git a/plugin-taskbar/lxqttaskbarconfiguration.h b/plugin-taskbar/lxqttaskbarconfiguration.h index 999882e..4ee8de6 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.h +++ b/plugin-taskbar/lxqttaskbarconfiguration.h @@ -58,7 +58,6 @@ private: private slots: void saveSettings(); void dialogButtonsAction(QAbstractButton *btn); - void updateControls(int index); }; #endif // LXQTTASKBARCONFIGURATION_H diff --git a/plugin-taskbar/lxqttaskbarconfiguration.ui b/plugin-taskbar/lxqttaskbarconfiguration.ui index 5c6767c..a18fce4 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.ui +++ b/plugin-taskbar/lxqttaskbarconfiguration.ui @@ -6,8 +6,8 @@ 0 0 - 354 - 316 + 401 + 484 @@ -17,27 +17,74 @@ - Taskbar Contents + General - + + + 0 + + + 0 + + + + + Show only windows from desktop + + + + + + + + + + - Show windows from current desktop + Show only windows from &panel's screen - - wlcB - - + - Show windows from all desktops + Show only minimized windows + + + + + + + Raise minimized windows on current desktop + + + + + + + Close on middle-click + + + + + + + + + + Window &grouping + + + true + + + + + + Show popup on mouse hover - - wlcB - @@ -46,9 +93,12 @@ - Taskbar Appearance + Appearance + + QFormLayout::AllNonFixedFieldsGrow + @@ -62,18 +112,47 @@ - Minimum button width + Maximum button width - + + 0 + 0 + + + + px + + + 1 + + + 500 + + + + + + + Maximum button height + + + + + + + 0 0 + + px + 1 @@ -82,7 +161,7 @@ - + Auto&rotate buttons when the panel is vertical @@ -92,13 +171,6 @@ - - - - Close on middle-click - - - @@ -133,8 +205,8 @@ accept() - 248 - 254 + 262 + 496 157 @@ -149,8 +221,8 @@ reject() - 316 - 260 + 330 + 496 286 @@ -159,7 +231,4 @@ - - - diff --git a/plugin-taskbar/lxqttaskbarplugin.h b/plugin-taskbar/lxqttaskbarplugin.h index bfe363c..4778175 100644 --- a/plugin-taskbar/lxqttaskbarplugin.h +++ b/plugin-taskbar/lxqttaskbarplugin.h @@ -43,7 +43,7 @@ public: ~LxQtTaskBarPlugin(); QString themeId() const { return "TaskBar"; } - virtual ILxQtPanelPlugin::Flags flags() const { return HaveConfigDialog ; } + virtual Flags flags() const { return HaveConfigDialog | NeedsHandle; } QWidget *widget() { return mTaskBar; } QDialog *configureDialog(); @@ -60,10 +60,10 @@ private: class LxQtTaskBarPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) { return new LxQtTaskBarPlugin(startupInfo);} + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtTaskBarPlugin(startupInfo);} }; #endif // LXQTTASKBARPLUGIN_H diff --git a/plugin-taskbar/lxqttaskbutton.cpp b/plugin-taskbar/lxqttaskbutton.cpp index 4d361d3..be30600 100644 --- a/plugin-taskbar/lxqttaskbutton.cpp +++ b/plugin-taskbar/lxqttaskbutton.cpp @@ -28,6 +28,9 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#include "lxqttaskbutton.h" +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" #include #include @@ -43,34 +46,44 @@ #include #include #include +#include #include "lxqttaskbutton.h" -#include +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" +#include // Necessary for closeApplication() -#include +#include #include +bool LxQtTaskButton::sDraggging = false; + /************************************************ ************************************************/ -void ElidedButtonStyle::drawItemText(QPainter* painter, const QRect& rect, - int flags, const QPalette & pal, bool enabled, - const QString & text, QPalette::ColorRole textRole) const +void LeftAlignedTextStyle::drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole) const { - QString s = painter->fontMetrics().elidedText(text, Qt::ElideRight, rect.width()); - QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, s, textRole); + return QProxyStyle::drawItemText(painter, rect, (flags & ~Qt::AlignHCenter) | Qt::AlignLeft, pal, enabled, text, textRole); } /************************************************ ************************************************/ -LxQtTaskButton::LxQtTaskButton(const WId window, QWidget *parent) : +LxQtTaskButton::LxQtTaskButton(const WId window, LxQtTaskBar * taskbar, QWidget *parent) : QToolButton(parent), mWindow(window), - mDrawPixmap(false) + mUrgencyHint(false), + mOrigin(Qt::TopLeftCorner), + mDrawPixmap(false), + mParentTaskBar(taskbar), + mDNDTimer(new QTimer(this)) { + Q_ASSERT(taskbar); + setCheckable(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -81,6 +94,10 @@ LxQtTaskButton::LxQtTaskButton(const WId window, QWidget *parent) : updateText(); updateIcon(); + + mDNDTimer->setSingleShot(true); + mDNDTimer->setInterval(700); + connect(mDNDTimer, SIGNAL(timeout()), this, SLOT(activateWithDraggable())); } /************************************************ @@ -109,10 +126,30 @@ void LxQtTaskButton::updateIcon() QIcon ico; QPixmap pix = KWindowSystem::icon(mWindow); ico.addPixmap(pix); - if (!pix.isNull()) - setIcon(ico); - else - setIcon(XdgIcon::defaultApplicationIcon()); + setIcon(!pix.isNull() ? ico : XdgIcon::defaultApplicationIcon()); +} + +/************************************************ + + ************************************************/ +void LxQtTaskButton::refreshIconGeometry(QRect const & geom) +{ + NETWinInfo info(QX11Info::connection(), + windowId(), + (WId) QX11Info::appRootWindow(), + NET::WMIconGeometry, + 0); + NETRect const curr = info.iconGeometry(); + if (curr.pos.x != geom.x() || curr.pos.y != geom.y() + || curr.size.width != geom.width() || curr.size.height != geom.height()) + { + NETRect nrect; + nrect.pos.x = geom.x(); + nrect.pos.y = geom.y(); + nrect.size.height = geom.height(); + nrect.size.width = geom.width(); + info.setIconGeometry(nrect); + } } /************************************************ @@ -120,22 +157,32 @@ void LxQtTaskButton::updateIcon() ************************************************/ void LxQtTaskButton::dragEnterEvent(QDragEnterEvent *event) { - if (event->mimeData()->hasFormat("lxqt/lxqttaskbutton")) + if (event->mimeData()->hasFormat(mimeDataFormat())) { event->ignore(); return; } - mDraggableMimeData = event->mimeData(); - QTimer::singleShot(1000, this, SLOT(activateWithDraggable())); -} + mDNDTimer->start(); -/************************************************ + // It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called + // on the other hand drop and dragmove events of parent widget won't be called + event->accept(); + QToolButton::dragEnterEvent(event); +} - ************************************************/ void LxQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) { - mDraggableMimeData = NULL; + mDNDTimer->stop(); + event->ignore(); + QToolButton::dragLeaveEvent(event); +} + +void LxQtTaskButton::dropEvent(QDropEvent *event) +{ + mDNDTimer->stop(); + event->ignore(); + QToolButton::dropEvent(event); } /************************************************ @@ -143,8 +190,13 @@ void LxQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) ************************************************/ void LxQtTaskButton::mousePressEvent(QMouseEvent* event) { - if (event->button() == Qt::LeftButton) + const Qt::MouseButton b = event->button(); + + if (Qt::LeftButton == b) mDragStartPosition = event->pos(); + else if (Qt::MidButton == b && parentTaskBar()->closeOnMiddleClick()) + closeApplication(); + QToolButton::mousePressEvent(event); } @@ -155,7 +207,6 @@ void LxQtTaskButton::mouseReleaseEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { - // qDebug() << "isChecked:" << isChecked(); if (isChecked()) minimizeApplication(); else @@ -164,6 +215,19 @@ void LxQtTaskButton::mouseReleaseEvent(QMouseEvent* event) QToolButton::mouseReleaseEvent(event); } +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskButton::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray ba; + QDataStream stream(&ba,QIODevice::WriteOnly); + stream << (qlonglong)(mWindow); + mimedata->setData(mimeDataFormat(), ba); + return mimedata; +} + /************************************************ ************************************************/ @@ -175,27 +239,29 @@ void LxQtTaskButton::mouseMoveEvent(QMouseEvent* event) if ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance()) return; - QMimeData *mime = new QMimeData; - QByteArray byteArray; - QDataStream stream(&byteArray, QIODevice::WriteOnly); - qDebug() << QString("Dragging window: %1").arg(mWindow); - stream << (qlonglong) mWindow; - mime->setData("lxqt/lxqttaskbutton", byteArray); - QDrag *drag = new QDrag(this); - drag->setMimeData(mime); + drag->setMimeData(mimeData()); + + //fixme when vertical panel, pixmap is empty QPixmap pixmap = grab(); drag->setPixmap(pixmap); drag->setHotSpot(QPoint(mapTo(this, event->pos()))); + + sDraggging = true; drag->exec(); + // if button is dropped out of panel (e.g. on desktop) + // it is not deleted automatically by Qt + drag->deleteLater(); + sDraggging = false; + QAbstractButton::mouseMoveEvent(event); } /************************************************ ************************************************/ -bool LxQtTaskButton::isAppHidden() const +bool LxQtTaskButton::isApplicationHidden() const { KWindowInfo info(mWindow, NET::WMState); return (info.state() & NET::Hidden); @@ -214,12 +280,10 @@ bool LxQtTaskButton::isApplicationActive() const ************************************************/ void LxQtTaskButton::activateWithDraggable() { - if (!mDraggableMimeData) - return; - // raise app in any time when there is a drag // in progress to allow drop it into an app raiseApplication(); + KWindowSystem::forceActiveWindow(mWindow); } /************************************************ @@ -227,10 +291,17 @@ void LxQtTaskButton::activateWithDraggable() ************************************************/ void LxQtTaskButton::raiseApplication() { - KWindowInfo info(mWindow, NET::WMDesktop); - int winDesktop = info.desktop(); - if (KWindowSystem::currentDesktop() != winDesktop) - KWindowSystem::setCurrentDesktop(winDesktop); + KWindowInfo info(mWindow, NET::WMDesktop | NET::WMState | NET::XAWMState); + if (parentTaskBar()->raiseOnCurrentDesktop() && info.isMinimized()) + { + KWindowSystem::setOnDesktop(mWindow, KWindowSystem::currentDesktop()); + } + else + { + int winDesktop = info.desktop(); + if (KWindowSystem::currentDesktop() != winDesktop) + KWindowSystem::setCurrentDesktop(winDesktop); + } KWindowSystem::activateWindow(mWindow); setUrgencyHint(false); @@ -268,6 +339,9 @@ void LxQtTaskButton::maximizeApplication() KWindowSystem::setState(mWindow, NET::Max); break; } + + if (!isApplicationActive()) + raiseApplication(); } /************************************************ @@ -276,6 +350,9 @@ void LxQtTaskButton::maximizeApplication() void LxQtTaskButton::deMaximizeApplication() { KWindowSystem::clearState(mWindow, NET::Max); + + if (!isApplicationActive()) + raiseApplication(); } /************************************************ @@ -364,7 +441,8 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) KWindowInfo info(mWindow, 0, NET::WM2AllowedActions); unsigned long state = KWindowInfo(mWindow, NET::WMState).state(); - QMenu menu(tr("Application")); + QMenu * menu = new QMenu(tr("Application")); + menu->setAttribute(Qt::WA_DeleteOnClose); QAction* a; /* KDE menu ******* @@ -397,7 +475,7 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) if (deskNum > 1) { int winDesk = KWindowInfo(mWindow, NET::WMDesktop).desktop(); - QMenu* deskMenu = menu.addMenu(tr("To &Desktop")); + QMenu* deskMenu = menu->addMenu(tr("To &Desktop")); a = deskMenu->addAction(tr("&All Desktops")); a->setData(NET::OnAllDesktops); @@ -414,58 +492,58 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) } int curDesk = KWindowSystem::currentDesktop(); - a = menu.addAction(tr("&To Current Desktop")); + a = menu->addAction(tr("&To Current Desktop")); a->setData(curDesk); a->setEnabled(curDesk != winDesk); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveApplicationToDesktop())); } /********** State menu **********/ - menu.addSeparator(); + menu->addSeparator(); - a = menu.addAction(tr("Ma&ximize")); - a->setEnabled(info.actionSupported(NET::ActionMax) && !(state & NET::Max)); + a = menu->addAction(tr("Ma&ximize")); + a->setEnabled(info.actionSupported(NET::ActionMax) && (!(state & NET::Max) || (state & NET::Hidden))); a->setData(NET::Max); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); if (event->modifiers() & Qt::ShiftModifier) { - a = menu.addAction(tr("Maximize vertically")); + a = menu->addAction(tr("Maximize vertically")); a->setEnabled(info.actionSupported(NET::ActionMaxVert) && !((state & NET::MaxVert) || (state & NET::Hidden))); a->setData(NET::MaxVert); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); - a = menu.addAction(tr("Maximize horizontally")); + a = menu->addAction(tr("Maximize horizontally")); a->setEnabled(info.actionSupported(NET::ActionMaxHoriz) && !((state & NET::MaxHoriz) || (state & NET::Hidden))); a->setData(NET::MaxHoriz); connect(a, SIGNAL(triggered(bool)), this, SLOT(maximizeApplication())); } - a = menu.addAction(tr("&Restore")); + a = menu->addAction(tr("&Restore")); a->setEnabled((state & NET::Hidden) || (state & NET::Max) || (state & NET::MaxHoriz) || (state & NET::MaxVert)); connect(a, SIGNAL(triggered(bool)), this, SLOT(deMaximizeApplication())); - a = menu.addAction(tr("Mi&nimize")); + a = menu->addAction(tr("Mi&nimize")); a->setEnabled(info.actionSupported(NET::ActionMinimize) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(minimizeApplication())); if (state & NET::Shaded) { - a = menu.addAction(tr("Roll down")); + a = menu->addAction(tr("Roll down")); a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(unShadeApplication())); } else { - a = menu.addAction(tr("Roll up")); + a = menu->addAction(tr("Roll up")); a->setEnabled(info.actionSupported(NET::ActionShade) && !(state & NET::Hidden)); connect(a, SIGNAL(triggered(bool)), this, SLOT(shadeApplication())); } /********** Layer menu **********/ - menu.addSeparator(); + menu->addSeparator(); - QMenu* layerMenu = menu.addMenu(tr("&Layer")); + QMenu* layerMenu = menu->addMenu(tr("&Layer")); a = layerMenu->addAction(tr("Always on &top")); // FIXME: There is no info.actionSupported(NET::ActionKeepAbove) @@ -486,10 +564,11 @@ void LxQtTaskButton::contextMenuEvent(QContextMenuEvent* event) connect(a, SIGNAL(triggered(bool)), this, SLOT(setApplicationLayer())); /********** Kill menu **********/ - menu.addSeparator(); - a = menu.addAction(XdgIcon::fromTheme("process-stop"), tr("&Close")); + menu->addSeparator(); + a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("&Close")); connect(a, SIGNAL(triggered(bool)), this, SLOT(closeApplication())); - menu.exec(mapToGlobal(event->pos())); + menu->setGeometry(mParentTaskBar->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); } /************************************************ @@ -513,9 +592,19 @@ void LxQtTaskButton::setUrgencyHint(bool set) /************************************************ ************************************************/ -int LxQtTaskButton::desktopNum() const +bool LxQtTaskButton::isOnDesktop(int desktop) const +{ + return KWindowInfo(mWindow, NET::WMDesktop).isOnDesktop(desktop); +} + +bool LxQtTaskButton::isOnCurrentScreen() const { - return KWindowInfo(mWindow, NET::WMDesktop).desktop(); + return QApplication::desktop()->screenGeometry(parentTaskBar()).intersects(KWindowInfo(mWindow, NET::WMFrameExtents).frameGeometry()); +} + +bool LxQtTaskButton::isMinimized() const +{ + return KWindowInfo(mWindow,NET::WMState | NET::XAWMState).isMinimized(); } Qt::Corner LxQtTaskButton::origin() const @@ -630,3 +719,8 @@ void LxQtTaskButton::paintEvent(QPaintEvent *event) mDrawPixmap = drawPixmapNextTime; } + +bool LxQtTaskButton::hasDragAndDropHover() const +{ + return mDNDTimer->isActive(); +} diff --git a/plugin-taskbar/lxqttaskbutton.h b/plugin-taskbar/lxqttaskbutton.h index 3b4fa85..419212a 100644 --- a/plugin-taskbar/lxqttaskbutton.h +++ b/plugin-taskbar/lxqttaskbutton.h @@ -39,15 +39,17 @@ class QPainter; class QPalette; class QMimeData; +class LxQtTaskGroup; +class LxQtTaskBar; -class ElidedButtonStyle: public QProxyStyle +class LeftAlignedTextStyle : public QProxyStyle { + using QProxyStyle::QProxyStyle; public: - ElidedButtonStyle(QStyle* style=0): QProxyStyle(style) {} - void drawItemText(QPainter* painter, const QRect& rect, int flags, - const QPalette & pal, bool enabled, const QString & text, - QPalette::ColorRole textRole = QPalette::NoRole ) const; + virtual void drawItemText(QPainter * painter, const QRect & rect, int flags + , const QPalette & pal, bool enabled, const QString & text + , QPalette::ColorRole textRole = QPalette::NoRole) const override; }; @@ -58,22 +60,34 @@ class LxQtTaskButton : public QToolButton Q_PROPERTY(Qt::Corner origin READ origin WRITE setOrigin) public: - explicit LxQtTaskButton(const WId window, QWidget *parent = 0); + explicit LxQtTaskButton(const WId window, LxQtTaskBar * taskBar, QWidget *parent = 0); virtual ~LxQtTaskButton(); - bool isAppHidden() const; + bool isApplicationHidden() const; bool isApplicationActive() const; WId windowId() const { return mWindow; } bool hasUrgencyHint() const { return mUrgencyHint; } void setUrgencyHint(bool set); - int desktopNum() const; + bool isOnDesktop(int desktop) const; + bool isOnCurrentScreen() const; + bool isMinimized() const; void updateText(); void updateIcon(); Qt::Corner origin() const; - void setAutoRotation(bool value, ILxQtPanel::Position position); + virtual void setAutoRotation(bool value, ILxQtPanel::Position position); + + LxQtTaskGroup * parentGroup(void) const {return mParentGroup;} + void setParentGroup(LxQtTaskGroup * group) {mParentGroup = group;} + LxQtTaskBar * parentTaskBar() const {return mParentTaskBar;} + + void refreshIconGeometry(QRect const & geom); + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); } + /*! \return true if this buttom received DragEnter event (and no DragLeave event yet) + * */ + bool hasDragAndDropHover() const; public slots: void raiseApplication(); @@ -89,25 +103,39 @@ public slots: void setOrigin(Qt::Corner); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dragLeaveEvent(QDragLeaveEvent *event); + virtual void dropEvent(QDropEvent *event); void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); - void contextMenuEvent(QContextMenuEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *event); void paintEvent(QPaintEvent *); + void setWindowId(WId wid) {mWindow = wid;} + virtual QMimeData * mimeData(); + static bool sDraggging; + private: WId mWindow; bool mUrgencyHint; - const QMimeData *mDraggableMimeData; QPoint mDragStartPosition; Qt::Corner mOrigin; QPixmap mPixmap; bool mDrawPixmap; + LxQtTaskGroup * mParentGroup; + LxQtTaskBar * mParentTaskBar; + + // Timer for when draggind something into a button (the button's window + // must be activated so that the use can continue dragging to the window + QTimer * mDNDTimer; private slots: void activateWithDraggable(); + +signals: + void dropped(QDropEvent * event); + void dragging(bool executing = false); }; typedef QHash LxQtTaskButtonHash; diff --git a/plugin-taskbar/lxqttaskgroup.cpp b/plugin-taskbar/lxqttaskgroup.cpp new file mode 100644 index 0000000..9be7a5d --- /dev/null +++ b/plugin-taskbar/lxqttaskgroup.cpp @@ -0,0 +1,657 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "lxqttaskgroup.h" +#include "lxqttaskbar.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/************************************************ + + ************************************************/ +LxQtTaskGroup::LxQtTaskGroup(const QString &groupName, QIcon icon, ILxQtPanelPlugin * plugin, LxQtTaskBar *parent) + : LxQtTaskButton(0, parent, parent), + mGroupName(groupName), + mPopup(new LxQtGroupPopup(this)), + mPlugin(plugin), + mPreventPopup(false) +{ + Q_ASSERT(parent); + + setObjectName(groupName); + setText(groupName); + setIcon(icon); + + connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool))); + connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(onDesktopChanged(int))); + connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(onWindowRemoved(WId))); + connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId))); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::contextMenuEvent(QContextMenuEvent *event) +{ + setPopupVisible(false, true); + mPreventPopup = true; + if (windowId()) + { + LxQtTaskButton::contextMenuEvent(event); + return; + } + + QMenu * menu = new QMenu(tr("Group")); + menu->setAttribute(Qt::WA_DeleteOnClose); + QAction *a = menu->addAction(XdgIcon::fromTheme("process-stop"), tr("Close group")); + connect(a, SIGNAL(triggered()), this, SLOT(closeGroup())); + connect(menu, &QMenu::aboutToHide, [this] { + mPreventPopup = false; + }); + menu->setGeometry(mPlugin->panel()->calculatePopupWindowPos(mapToGlobal(event->pos()), menu->sizeHint())); + menu->show(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::closeGroup() +{ + foreach (LxQtTaskButton * button, mButtonHash.values()) + if (button->isOnDesktop(KWindowSystem::currentDesktop())) + button->closeApplication(); +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::addWindow(WId id) +{ + if (mButtonHash.contains(id)) + return mButtonHash.value(id); + + LxQtTaskButton *btn = new LxQtTaskButton(id, parentTaskBar(), mPopup); + btn->setToolButtonStyle(toolButtonStyle()); + + if (btn->isApplicationActive()) + { + btn->setChecked(true); + setChecked(true); + } + + btn->setParentGroup(this); + + mButtonHash.insert(id, btn); + mPopup->addButton(btn); + + connect(btn, SIGNAL(clicked()), this, SLOT(onChildButtonClicked())); + refreshVisibility(); + + return btn; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::checkedButton() const +{ + foreach (LxQtTaskButton* button, mButtonHash.values()) + if (button->isChecked()) + return button; + + return NULL; +} + +/************************************************ + + ************************************************/ +LxQtTaskButton * LxQtTaskGroup::getNextPrevChildButton(bool next, bool circular) +{ + LxQtTaskButton *button = checkedButton(); + int idx = mPopup->indexOf(button); + int inc = next ? 1 : -1; + idx += inc; + + // if there is no cheked button, get the first one if next equals true + // or the last one if not + if (!button) + { + idx = -1; + if (next) + { + for (int i = 0; i < mPopup->count() && idx == -1; i++) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + else + { + for (int i = mPopup->count() - 1; i >= 0 && idx == -1; i--) + if (mPopup->itemAt(i)->widget()->isVisibleTo(mPopup)) + idx = i; + } + } + + if (circular) + idx = (idx + mButtonHash.count()) % mButtonHash.count(); + else if (mPopup->count() <= idx || idx < 0) + return NULL; + + // return the next or the previous child + QLayoutItem *item = mPopup->itemAt(idx); + if (item) + { + button = qobject_cast(item->widget()); + if (button->isVisibleTo(mPopup)) + return button; + } + + return NULL; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onActiveWindowChanged(WId window) +{ + LxQtTaskButton *button = mButtonHash.value(window, nullptr); + foreach (LxQtTaskButton *btn, mButtonHash.values()) + btn->setChecked(false); + + if (button) + { + button->setChecked(true); + if (button->hasUrgencyHint()) + button->setUrgencyHint(false); + } + setChecked(nullptr != button); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onDesktopChanged(int number) +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onWindowRemoved(WId window) +{ + if (mButtonHash.contains(window)) + { + LxQtTaskButton *button = mButtonHash.value(window); + mButtonHash.remove(window); + mPopup->removeWidget(button); + button->deleteLater(); + + if (mButtonHash.count()) + regroup(); + else + { + if (isVisible()) + emit visibilityChanged(false); + hide(); + emit groupBecomeEmpty(groupName()); + + } + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onChildButtonClicked() +{ + setPopupVisible(false, true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setToolButtonsStyle(Qt::ToolButtonStyle style) +{ + setToolButtonStyle(style); + for (auto & button : mButtonHash) + { + button->setToolButtonStyle(style); + } +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::buttonsCount() const +{ + return mButtonHash.count(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::visibleButtonsCount() const +{ + int i = 0; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + if (btn->isVisibleTo(mPopup)) + i++; + return i; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::draggingTimerTimeout() +{ + if (windowId()) + setPopupVisible(false); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::onClicked(bool) +{ + if (visibleButtonsCount() > 1) + { + setChecked(mButtonHash.contains(KWindowSystem::activeWindow())); + setPopupVisible(true); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::regroup() +{ + int cont = visibleButtonsCount(); + recalculateFrameIfVisible(); + + if (cont == 1) + { + // Get first visible button + LxQtTaskButton * button = NULL; + foreach (LxQtTaskButton *btn, mButtonHash.values()) + { + if (btn->isVisibleTo(mPopup)) + { + button = btn; + break; + } + } + + if (button) + { + setText(button->text()); + setToolTip(button->toolTip()); + setWindowId(button->windowId()); + } + } + else if (cont == 0) + hide(); + else + { + QString t = QString("%1 - %2 windows").arg(mGroupName).arg(cont); + setText(t); + setToolTip(parentTaskBar()->isShowGroupOnHover() ? QStringLiteral() : t); + setWindowId(0); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::showOnlySettingChanged() +{ + refreshVisibility(); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::recalculateFrameIfVisible() +{ + if (mPopup->isVisible()) + { + recalculateFrameSize(); + if (mPlugin->panel()->position() == ILxQtPanel::PositionBottom) + recalculateFramePosition(); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setAutoRotation(bool value, ILxQtPanel::Position position) +{ + foreach (LxQtTaskButton *button, mButtonHash.values()) + button->setAutoRotation(false, position); + + LxQtTaskButton::setAutoRotation(value, position); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshVisibility() +{ + bool will = false; + LxQtTaskBar const * taskbar = parentTaskBar(); + const int showDesktop = taskbar->showDesktopNum(); + foreach(LxQtTaskButton * btn, mButtonHash.values()) + { + bool visible = taskbar->isShowOnlyOneDesktopTasks() ? btn->isOnDesktop(0 == showDesktop ? KWindowSystem::currentDesktop() : showDesktop) : true; + visible &= taskbar->isShowOnlyCurrentScreenTasks() ? btn->isOnCurrentScreen() : true; + visible &= taskbar->isShowOnlyMinimizedTasks() ? btn->isMinimized() : true; + btn->setVisible(visible); + will |= visible; + } + + bool is = isVisible(); + setVisible(will); + regroup(); + + if (is != will) + emit visibilityChanged(will); +} + +/************************************************ + + ************************************************/ +QMimeData * LxQtTaskGroup::mimeData() +{ + QMimeData *mimedata = new QMimeData; + QByteArray byteArray; + QDataStream stream(&byteArray, QIODevice::WriteOnly); + stream << groupName(); + mimedata->setData(mimeDataFormat(), byteArray); + return mimedata; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::setPopupVisible(bool visible, bool fast) +{ + if (visible && !mPreventPopup && 0 == windowId()) + { + if (!mPopup->isVisible()) + { + // setup geometry + recalculateFrameSize(); + recalculateFramePosition(); + } + + mPopup->show(); + emit popupShown(this); + } + else + mPopup->hide(fast); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::refreshIconsGeometry() +{ + QRect rect = geometry(); + rect.moveTo(mapToGlobal(QPoint(0, 0))); + + if (windowId()) + { + refreshIconGeometry(rect); + return; + } + + foreach(LxQtTaskButton *but, mButtonHash.values()) + { + but->refreshIconGeometry(rect); + but->setIconSize(QSize(mPlugin->panel()->iconSize(), mPlugin->panel()->iconSize())); + } +} + +/************************************************ + + ************************************************/ +QSize LxQtTaskGroup::recalculateFrameSize() +{ + int height = recalculateFrameHeight(); + mPopup->setMaximumHeight(1000); + mPopup->setMinimumHeight(0); + + int hh = recalculateFrameWidth(); + mPopup->setMaximumWidth(hh); + mPopup->setMinimumWidth(0); + + QSize newSize(hh, height); + mPopup->resize(newSize); + + return newSize; +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameHeight() const +{ + int cont = visibleButtonsCount(); + int h = !mPlugin->panel()->isHorizontal() && parentTaskBar()->isAutoRotate() ? width() : height(); + return cont * h + (cont + 1) * mPopup->spacing(); +} + +/************************************************ + + ************************************************/ +int LxQtTaskGroup::recalculateFrameWidth() const +{ + // FIXME: 300? + int minimum = 300; + int hh = width(); + + if (!mPlugin->panel()->isHorizontal() && !parentTaskBar()->isAutoRotate()) + hh = height(); + + if (hh < minimum) + hh = minimum; + + return hh; +} + +/************************************************ + + ************************************************/ +QPoint LxQtTaskGroup::recalculateFramePosition() +{ + // Set position + int x_offset = 0, y_offset = 0; + switch (mPlugin->panel()->position()) + { + case ILxQtPanel::PositionTop: + y_offset += height(); + break; + case ILxQtPanel::PositionBottom: + y_offset = -recalculateFrameHeight(); + break; + case ILxQtPanel::PositionLeft: + x_offset += width(); + break; + case ILxQtPanel::PositionRight: + x_offset = -recalculateFrameWidth(); + break; + } + + QPoint pos = mapToGlobal(QPoint(x_offset, y_offset)); + mPopup->move(pos); + + return pos; +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::leaveEvent(QEvent *event) +{ + setPopupVisible(false); + QToolButton::leaveEvent(event); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::enterEvent(QEvent *event) +{ + QToolButton::enterEvent(event); + + if (sDraggging) + return; + + if (parentTaskBar()->isShowGroupOnHover()) + setPopupVisible(true); +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragEnterEvent(QDragEnterEvent *event) +{ + sDraggging = true; + // only show the popup if we aren't dragging a taskgroup + if (!event->mimeData()->hasFormat(mimeDataFormat())) + { + setPopupVisible(true); + LxQtTaskButton::dragEnterEvent(event); + } +} + +/************************************************ + + ************************************************/ +void LxQtTaskGroup::dragLeaveEvent(QDragLeaveEvent *event) +{ + // if draggind something into the taskgroup or the taskgroups' popup, + // do not close the popup + if (!sDraggging) + setPopupVisible(false); + else + sDraggging = false; + LxQtTaskButton::dragLeaveEvent(event); +} + +void LxQtTaskGroup::mouseMoveEvent(QMouseEvent* event) +{ + // if dragging the taskgroup, do not show the popup + setPopupVisible(false, true); + LxQtTaskButton::mouseMoveEvent(event); +} + +/************************************************ + + ************************************************/ +bool LxQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2) +{ + bool consumed{false}; + bool needsRefreshVisibility{false}; + QVector buttons; + if (mButtonHash.contains(window)) + buttons.append(mButtonHash.value(window)); + + // If group contains only one window properties must be changed also on button group + if (window == windowId()) + buttons.append(this); + + foreach (LxQtTaskButton * button, buttons) + { + consumed = true; + // if class is changed the window won't belong to our group any more + if (parentTaskBar()->isGroupingEnabled() && prop2.testFlag(NET::WM2WindowClass) && this != button) + { + KWindowInfo info(window, 0, NET::WM2WindowClass); + if (info.windowClassClass() != mGroupName) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + } + // window changed virtual desktop + if (prop.testFlag(NET::WMDesktop) || prop.testFlag(NET::WMGeometry)) + { + if (parentTaskBar()->isShowOnlyOneDesktopTasks() + || parentTaskBar()->isShowOnlyCurrentScreenTasks()) + { + needsRefreshVisibility = true; + } + } + + if (prop.testFlag(NET::WMVisibleName) || prop.testFlag(NET::WMName)) + button->updateText(); + + // XXX: we are setting window icon geometry -> don't need to handle NET::WMIconGeometry + if (prop.testFlag(NET::WMIcon)) + button->updateIcon(); + + if (prop.testFlag(NET::WMState)) + { + KWindowInfo info{window, NET::WMState}; + if (info.hasState(NET::SkipTaskbar) && this != button) + { + //remove this window from this group + //Note: can't optimize case when there is only one window in this group + // because mGroupName is a hash key in taskbar + emit windowDisowned(window); + onWindowRemoved(window); + continue; + } + button->setUrgencyHint(info.hasState(NET::DemandsAttention)); + + if (parentTaskBar()->isShowOnlyMinimizedTasks()) + { + needsRefreshVisibility = true; + } + } + } + + if (needsRefreshVisibility) + refreshVisibility(); + + return consumed; +} diff --git a/plugin-taskbar/lxqttaskgroup.h b/plugin-taskbar/lxqttaskgroup.h new file mode 100644 index 0000000..040bd1a --- /dev/null +++ b/plugin-taskbar/lxqttaskgroup.h @@ -0,0 +1,121 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXDE-Qt - a lightweight, Qt based, desktop toolset + * http://razor-qt.org + * http://lxqt.org + * + * Copyright: 2011 Razor team + * 2014 LXQt team + * Authors: + * Alexander Sokoloff + * Maciej Płaza + * Kuzma Shapran + * + * This program or library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef LXQTTASKGROUP_H +#define LXQTTASKGROUP_H + +#include "../panel/ilxqtpanel.h" +#include "../panel/ilxqtpanelplugin.h" +#include "lxqttaskbar.h" +#include "lxqtgrouppopup.h" +#include "lxqttaskbutton.h" +#include + +class QVBoxLayout; +class ILxQtPanelPlugin; + +class LxQtGroupPopup; +class LxQtMasterPopup; + +class LxQtTaskGroup: public LxQtTaskButton +{ + Q_OBJECT + +public: + LxQtTaskGroup(const QString & groupName, QIcon icon ,ILxQtPanelPlugin * plugin, LxQtTaskBar * parent); + + QString groupName() const { return mGroupName; } + + void removeButton(WId window); + int buttonsCount() const; + int visibleButtonsCount() const; + + LxQtTaskButton * addWindow(WId id); + LxQtTaskButton * checkedButton() const; + + // Returns the next or the previous button in the popup + // if circular is true, then it will go around the list of buttons + LxQtTaskButton * getNextPrevChildButton(bool next, bool circular); + + bool onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2); + void refreshIconsGeometry(); + void showOnlySettingChanged(); + void setAutoRotation(bool value, ILxQtPanel::Position position); + void setToolButtonsStyle(Qt::ToolButtonStyle style); + + void setPopupVisible(bool visible = true, bool fast = false); + + static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskgroup"); } + +protected: + QMimeData * mimeData(); + + void leaveEvent(QEvent * event); + void enterEvent(QEvent * event); + void dragEnterEvent(QDragEnterEvent * event); + void dragLeaveEvent(QDragLeaveEvent * event); + void contextMenuEvent(QContextMenuEvent * event); + void mouseMoveEvent(QMouseEvent * event); + int recalculateFrameHeight() const; + int recalculateFrameWidth() const; + + void draggingTimerTimeout(); + +private slots: + void onClicked(bool checked); + void onChildButtonClicked(); + void onActiveWindowChanged(WId window); + void onWindowRemoved(WId window); + void onDesktopChanged(int number); + + void closeGroup(); + +signals: + void groupBecomeEmpty(QString name); + void visibilityChanged(bool visible); + void popupShown(LxQtTaskGroup* sender); + void windowDisowned(WId window); + +private: + QString mGroupName; + LxQtGroupPopup * mPopup; + LxQtTaskButtonHash mButtonHash; + ILxQtPanelPlugin * mPlugin; + bool mPreventPopup; + + QSize recalculateFrameSize(); + QPoint recalculateFramePosition(); + void recalculateFrameIfVisible(); + void refreshVisibility(); + void regroup(); +}; + +#endif // LXQTTASKGROUP_H diff --git a/plugin-taskbar/translations/taskbar.ts b/plugin-taskbar/translations/taskbar.ts index 559d8dc..62d8e35 100644 --- a/plugin-taskbar/translations/taskbar.ts +++ b/plugin-taskbar/translations/taskbar.ts @@ -1,94 +1,107 @@ - + LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,42 +111,73 @@ - Taskbar Contents + General - Show windows from current desktop + Show only windows from c&urrent desktop - - Show windows from all desktops + + Show only windows from &panel's screen - - Taskbar Appearance + + Show only minimized windows - - Minimum button width + + Raise minimized windows on current desktop - - Auto&rotate buttons when the panel is vertical + + Close on middle-click + + + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance - + Button style - - Close on middle-click + + Maximum button width + + + + + + px + + + + + Maximum button height + + + + + Auto&rotate buttons when the panel is vertical diff --git a/plugin-taskbar/translations/taskbar_ar.ts b/plugin-taskbar/translations/taskbar_ar.ts index ff0277d..1cde641 100644 --- a/plugin-taskbar/translations/taskbar_ar.ts +++ b/plugin-taskbar/translations/taskbar_ar.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application التطبيق - + To &Desktop إلى س&طح المكتب - + &All Desktops كا&فَّة أسطح المكتب - + Desktop &%1 سطح المكتب &%1 - + &To Current Desktop إلى سطح المكتب ال&حالي - + Ma&ximize ت&كبير - + Maximize vertically تكبيرٌ عموديٌّ - + Maximize horizontally تكبيرٌ أفقيٌّ - + &Restore استر&جاع - + Mi&nimize ت&صغير - + Roll down لفٌّ نحو اﻷسفل - + Roll up لفٌّ نحو اﻷعلى - + &Layer طب&قة - + Always on &top دوماً في اﻷ&على - + &Normal عا&دي - + Always on &bottom دوماً في اﻷس&فل - + &Close إ&غلاق + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - إظهار نوافذ سطح المكتب الحاليّ + Show windows from c&urrent desktop + - Show windows from all desktops - إظهار نوافذ كافَّة اﻷسطح المكتبيَّة + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + إظهار نوافذ سطح المكتب الحاليّ + + + Show windows from all desktops + إظهار نوافذ كافَّة اﻷسطح المكتبيَّة + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ مظهر قائمة النَّوافذ - + Button style شكل الزُّرّ @@ -148,7 +184,7 @@ عرض زرِّ التكبير - + Close on middle-click إغلاق عند الضغط على زرّ الفأرة اﻷوسط diff --git a/plugin-taskbar/translations/taskbar_cs.ts b/plugin-taskbar/translations/taskbar_cs.ts index e09dadd..6605eb1 100644 --- a/plugin-taskbar/translations/taskbar_cs.ts +++ b/plugin-taskbar/translations/taskbar_cs.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Na &plochu - + &All Desktops &Všechny plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na nynější plochu - + Ma&ximize Zvě&tšit - + Maximize vertically Zvětšit svisle - + Maximize horizontally Zvětšit vodorovně - + &Restore &Obnovit - + Mi&nimize &Zmenšit - + Roll down Sbalit - + Roll up Rozbalit - + &Layer &Vrstva - + Always on &top Vždy &nahoře - + &Normal &Obvyklé - + Always on &bottom Vždy &dole - + &Close &Zavřít + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Ukázat okna z nynější plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Ukázat okna ze všech ploch + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhled seznamu oken - + Button style Styl tlačítek @@ -148,7 +184,7 @@ Největší šířka tlačítka - + Close on middle-click Zavřít klepnutím prostředním tlačítkem diff --git a/plugin-taskbar/translations/taskbar_cs_CZ.ts b/plugin-taskbar/translations/taskbar_cs_CZ.ts index a3e26d0..c80ae3b 100644 --- a/plugin-taskbar/translations/taskbar_cs_CZ.ts +++ b/plugin-taskbar/translations/taskbar_cs_CZ.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Na &plochu - + &All Desktops &Všechny plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na nynější plochu - + Ma&ximize Zvě&tšit - + Maximize vertically Zvětšit svisle - + Maximize horizontally Zvětšit vodorovně - + &Restore &Obnovit - + Mi&nimize &Zmenšit - + Roll down Sbalit - + Roll up Rozbalit - + &Layer &Vrstva - + Always on &top Vždy &nahoře - + &Normal &Obvyklé - + Always on &bottom Vždy &dole - + &Close &Zavřít + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Ukázat okna z nynější plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Ukázat okna ze všech ploch + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Ukázat okna z nynější plochy + + + Show windows from all desktops + Ukázat okna ze všech ploch + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhled seznamu oken - + Button style Styl tlačítek @@ -148,7 +184,7 @@ Největší šířka tlačítka - + Close on middle-click Zavřít klepnutím prostředním tlačítkem diff --git a/plugin-taskbar/translations/taskbar_da.ts b/plugin-taskbar/translations/taskbar_da.ts index 469c550..c805b8d 100644 --- a/plugin-taskbar/translations/taskbar_da.ts +++ b/plugin-taskbar/translations/taskbar_da.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Til skrivebor&d - + &All Desktops &Alle skriveborde - + Desktop &%1 Skrivebord &%1 - + &To Current Desktop &Til aktuelt skrivebord - + Ma&ximize Ma&ksimer - + Maximize vertically Maksimer vertikalt - + Maximize horizontally Maksimer horisontalt - + &Restore &Gendan - + Mi&nimize Mi&nimer - + Roll down Rul ned - + Roll up Rul op - + &Layer &Lag - + Always on &top Al&tid øverst - + &Normal &Normal - + Always on &bottom Altid &nederst - + &Close &Luk + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,55 @@ - Taskbar Contents + General - Show windows from current desktop - Vis vinduer fra aktuelle skrivebord + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra aktuelle skrivebord + + + Auto&rotate buttons when the panel is vertical - + Close on middle-click @@ -139,16 +176,15 @@ wlcB - Show windows from all desktops - Vis vinduer fra alle skriveborde + Vis vinduer fra alle skriveborde Window List Appearance Udseende af Vinduesliste - + Button style Knapstil diff --git a/plugin-taskbar/translations/taskbar_da_DK.ts b/plugin-taskbar/translations/taskbar_da_DK.ts index b0c221d..adc69ba 100644 --- a/plugin-taskbar/translations/taskbar_da_DK.ts +++ b/plugin-taskbar/translations/taskbar_da_DK.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop Til &Skrivebord - + &All Desktops A&lle Skriveborde - + Desktop &%1 Skrivebord &%1 - + &To Current Desktop Til Nuværende Skrivebor&d - + Ma&ximize Ma&ksimer - + Maximize vertically Maksimer vertikalt - + Maximize horizontally Maksimer horisontalt - + &Restore &Gendan - + Mi&nimize Mi&nimer - + Roll down Rul ned - + Roll up Rul op - + &Layer &Lag - + Always on &top Altid &Ovenpå - + &Normal &Normal - + Always on &bottom Altid Ned&erst - + &Close &Afslut + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Vis vinduer fra nuværende skrivebord + Show windows from c&urrent desktop + - Show windows from all desktops - Vis vinduer fra alle skriveborde + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Vis vinduer fra nuværende skrivebord + + + Show windows from all desktops + Vis vinduer fra alle skriveborde + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Udseende af vinduesliste - + Button style Knap stil @@ -148,7 +184,7 @@ Maks. knapbredde - + Close on middle-click Luk ved midterklik diff --git a/plugin-taskbar/translations/taskbar_de.desktop b/plugin-taskbar/translations/taskbar_de.desktop index c809473..f57f1a2 100644 --- a/plugin-taskbar/translations/taskbar_de.desktop +++ b/plugin-taskbar/translations/taskbar_de.desktop @@ -1,12 +1,2 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Task manager -Comment=Switch between running applications - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de]=Wechsel zwischen laufenden Anwendungen Name[de]=Anwendungsverwalter +Comment[de]=Wechsel zwischen laufenden Anwendungen diff --git a/plugin-taskbar/translations/taskbar_de.ts b/plugin-taskbar/translations/taskbar_de.ts index 9d9a5c2..834a0de 100644 --- a/plugin-taskbar/translations/taskbar_de.ts +++ b/plugin-taskbar/translations/taskbar_de.ts @@ -4,172 +4,201 @@ LxQtTaskButton - + Application Anwendung - + To &Desktop Zur Arb&eitsfläche - + &All Desktops &Alle Arbeitsflächen - + Desktop &%1 Arbeitsfläche &%1 - + &To Current Desktop - Zur Ak&tuellen Arbeitsfläche + Zur ak&tuellen Arbeitsfläche - + Ma&ximize Ma&ximieren - + Maximize vertically Vertikal maximieren - + Maximize horizontally Horizontal maximieren - + &Restore &Wiederherstellen - + Mi&nimize Mi&nimieren - + Roll down Herunterrollen - + Roll up Hochrollen - + &Layer &Ebene - + Always on &top Immer &oben - + &Normal &Normal - + Always on &bottom Immer &unten - + &Close &Schließen - LxQtTaskbarConfiguration + LxQtTaskGroup - LxQt Task Manager Settings - LxQt Taskmanager Einstellungen + + Group + Gruppe - Window List Content - Fensterlisteninhalt + + Close group + Gruppe schließen + + + LxQtTaskbarConfiguration Task Manager Settings - + Anwendungsverwalter - Einstellungen - Taskbar Contents - + General + Allgemein - - Show windows from current desktop - Fenster der aktuellen Arbeitsfläche anzeigen + + Show only windows from desktop + Nur Fenster der Arbeitsfläche anzeigen - - Taskbar Appearance - + + Show only windows from &panel's screen + Nur Fenster aus der &Taskleiste anzeigen - - Minimum button width - + + Show only minimized windows + Nur minimierte Fenster anzeigen - - Auto&rotate buttons when the panel is vertical - + + Raise minimized windows on current desktop + Minimierte Fenster auf aktuelle Arbeitsfläche heben - + Close on middle-click - + Fenster bei Mittelklick schließen - wlcB - wlcB + + Window &grouping + Fensteranordnun&g - - Show windows from all desktops - Fenster aller Arbeitsflächen anzeigen + + Show popup on mouse hover + Popup beim Überfahren mit dem Mauszeiger - Window List Appearance - Fensterlisten Erscheinungsbild + + Appearance + Erscheinungsbild - + Button style - Schaltflächenstiel + Schaltflächenstil + + + + Maximum button width + Max. Schaltflächenbreite + + + + + px + px - Max button width - Max. Schaltflächenbreite + + Maximum button height + Max. Schaltflächenhöhe - + + Auto&rotate buttons when the panel is vertical + Schaltflächen automatisch d&rehen bei vertikaler Leiste + + + Icon and text Symbol und Text - + Only icon Nur Symbol - + Only text Nur Text + + + Current + Aktuell + diff --git a/plugin-taskbar/translations/taskbar_de_DE.desktop b/plugin-taskbar/translations/taskbar_de_DE.desktop deleted file mode 100644 index 02c6590..0000000 --- a/plugin-taskbar/translations/taskbar_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=Task manager -Comment=Switch between running applications - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Zwischen laufenden Applikationen umschalten -Name[de_DE]=Task Manager diff --git a/plugin-taskbar/translations/taskbar_de_DE.ts b/plugin-taskbar/translations/taskbar_de_DE.ts deleted file mode 100644 index f5d5fa8..0000000 --- a/plugin-taskbar/translations/taskbar_de_DE.ts +++ /dev/null @@ -1,171 +0,0 @@ - - - - - LxQtTaskButton - - - Application - Anwendung - - - - To &Desktop - Zur &Arbeitsfläche - - - - &All Desktops - &Alle Arbeitsflächen - - - - Desktop &%1 - Arbeitsfläche &%1 - - - - &To Current Desktop - &Zur aktuellen Arbeitsfläche - - - - Ma&ximize - Ma&ximieren - - - - Maximize vertically - Maximiere vertikal - - - - Maximize horizontally - Maximiere horizintal - - - - &Restore - &Wiederherstellen - - - - Mi&nimize - Mi&nimieren - - - - Roll down - Roll runter - - - - Roll up - Roll hoch - - - - &Layer - &Schicht - - - - Always on &top - Immer &oben - - - - &Normal - &Normal - - - - Always on &bottom - Immer &unten - - - - &Close - &Schließen - - - - LxQtTaskbarConfiguration - - LxQt Task Manager Settings - LxQt Anwendungsverwalter Einstellungen - - - Window List Content - Fester Inhalt - - - - Task Manager Settings - - - - - Taskbar Contents - - - - - Show windows from current desktop - Zeige Fenster von der aktuellen Arbeitsfläche - - - - Show windows from all desktops - Zeige Fester von allen Arbeitsflächen - - - - Taskbar Appearance - - - - - Minimum button width - - - - - Auto&rotate buttons when the panel is vertical - - - - Window List Appearance - Festerlisten Erscheinungsbild - - - - Button style - Knopf Stil - - - Max button width - Max Knopf breite - - - - Close on middle-click - Schließen mit Mittelklick - - - - Icon and text - Symbole und Text - - - - Only icon - Nur Symbole - - - - Only text - Nur Text - - - diff --git a/plugin-taskbar/translations/taskbar_el_GR.ts b/plugin-taskbar/translations/taskbar_el_GR.ts index cee922b..c7b06a1 100644 --- a/plugin-taskbar/translations/taskbar_el_GR.ts +++ b/plugin-taskbar/translations/taskbar_el_GR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Εφαρμογή - + To &Desktop Στην επι&φάνεια εργασίας - + &All Desktops Ό&λες οι επιφάνειες εργασίας - + Desktop &%1 Επιφάνεια εργασίας &%1 - + &To Current Desktop Στ&ην τρέχουσα επιφάνεια εργασίας - + Ma&ximize &Μεγιστοποίηση - + Maximize vertically Μεγιστοποίηση κάθετα - + Maximize horizontally Μεγιστοποίηση οριζόντια - + &Restore &Επαναφορά - + Mi&nimize Ελα&χιστοποίηση - + Roll down Κύλιση κάτω - + Roll up Κύλιση επάνω - + &Layer Στ&ρώμα - + Always on &top Πάντα ε&πάνω - + &Normal Κα&νονικό - + Always on &bottom Πάντα &κάτω - + &Close Κλεί&σιμο + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Εμφάνιση παραθύρων από την τρέχουσα επιφάνεια εργασίας + Show windows from c&urrent desktop + - Show windows from all desktops - Εμφάνιση παραθύρων από όλες τις επιφάνειες εργασίας + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Εμφάνιση παραθύρων από την τρέχουσα επιφάνεια εργασίας + + + Show windows from all desktops + Εμφάνιση παραθύρων από όλες τις επιφάνειες εργασίας + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Εμφάνιση λίστας παραθύρων - + Button style Στυλ πλήκτρου @@ -148,7 +184,7 @@ Μέγιστο πλάτος πλήκτρου - + Close on middle-click Κλείσιμο με μεσαίο κλικ diff --git a/plugin-taskbar/translations/taskbar_eo.ts b/plugin-taskbar/translations/taskbar_eo.ts index 8a88838..61663db 100644 --- a/plugin-taskbar/translations/taskbar_eo.ts +++ b/plugin-taskbar/translations/taskbar_eo.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikaĵo - + To &Desktop &Al labortablo - + &All Desktops Ĉiuj l&abortabloj - + Desktop &%1 Labortablo &%1 - + &To Current Desktop Al ak&tuala labortablo - + Ma&ximize Ma&ksimumigi - + Maximize vertically Vertikale maksimumigi - + Maximize horizontally Horizontale maksimumigi - + &Restore &Restaŭri - + Mi&nimize &Malmaksimumigi - + Roll down Malsupren rulumi - + Roll up Supren rulumi - + &Layer Tavo&lo - + Always on &top Ĉiam &supre - + &Normal &Normale - + Always on &bottom Ĉiam &malsupre - + &Close &Fermi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Montri fenestrojn el aktuala labortablo + Show windows from c&urrent desktop + - Show windows from all desktops - Montri fenestrojn el ĉiuj labortabloj + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montri fenestrojn el aktuala labortablo + + + Show windows from all desktops + Montri fenestrojn el ĉiuj labortabloj + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apero de listo de fenestroj - + Button style Stilo de butonoj @@ -148,7 +184,7 @@ Maksimuma grando de butonoj - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_es.ts b/plugin-taskbar/translations/taskbar_es.ts index 15d56a4..8789602 100644 --- a/plugin-taskbar/translations/taskbar_es.ts +++ b/plugin-taskbar/translations/taskbar_es.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicación - + To &Desktop Al &escritorio - + &All Desktops &Todos los escritorios - + Desktop &%1 Escritorio &%1 - + &To Current Desktop &Al escritorio actual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar horizontalmente - + &Restore &Restauar - + Mi&nimize Mi&nimizar - + Roll down Desplegar - + Roll up Enrollar - + &Layer &Capa - + Always on &top Siempre &encima - + &Normal &Normal - + Always on &bottom Siempre al &fondo - + &Close &Cerrar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar ventanas del escritorio actual + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar ventanas de todos los escritorios + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio actual + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apariencia de la lista de ventanas - + Button style Estilo del botón @@ -148,7 +184,7 @@ Ancho máximo del botón - + Close on middle-click Cerrar con el boton central diff --git a/plugin-taskbar/translations/taskbar_es_VE.ts b/plugin-taskbar/translations/taskbar_es_VE.ts index b064ad9..d1d9baa 100644 --- a/plugin-taskbar/translations/taskbar_es_VE.ts +++ b/plugin-taskbar/translations/taskbar_es_VE.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicación - + To &Desktop Al &Escritorio - + &All Desktops &Todos los escritorios - + Desktop &%1 Escritorio &%1 - + &To Current Desktop &Al escritorio actual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar Orizzontalmente - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down DesEnrolar - + Roll up Enrolar - + &Layer Ca&pa - + Always on &top Siempre &encima - + &Normal &Normal - + Always on &bottom Siempre por de&bajo - + &Close &Cerrar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar ventanas del escritorio activo + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar ventanas de todos los escritorios + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar ventanas del escritorio activo + + + Show windows from all desktops + Mostrar ventanas de todos los escritorios + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apariencia de la lista de ventanas - + Button style Estilo de boton @@ -148,7 +184,7 @@ Ancho maximo - + Close on middle-click Cerrar en click medio diff --git a/plugin-taskbar/translations/taskbar_eu.ts b/plugin-taskbar/translations/taskbar_eu.ts index 0196e50..dee7fdc 100644 --- a/plugin-taskbar/translations/taskbar_eu.ts +++ b/plugin-taskbar/translations/taskbar_eu.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikazioa - + To &Desktop &Mahaigainera - + &All Desktops Mahaigain &guztiak - + Desktop &%1 &%1 mahaigaina - + &To Current Desktop &Uneko mahaigainera - + Ma&ximize Maximizatu - + Maximize vertically Maximizatu bertikalki - + Maximize horizontally Maximizatu horizontalki - + &Restore &Leheneratu - + Mi&nimize Minimizatu - + Roll down Zabaldu - + Roll up Bildu - + &Layer &Geruza - + Always on &top Beti &goian - + &Normal &Normala - + Always on &bottom Beti &behean - + &Close &Itxi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Erakutsi uneko mahaigaineko leihoak + Show windows from c&urrent desktop + - Show windows from all desktops - Erakutsi mahaigain guztietako leihoak + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Erakutsi uneko mahaigaineko leihoak + + + Show windows from all desktops + Erakutsi mahaigain guztietako leihoak + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Leiho-zerrendaren itxura - + Button style Botoi-estiloa @@ -148,7 +184,7 @@ Botoien zabalera maximoa - + Close on middle-click Itxi erdiko botoia klikatzean diff --git a/plugin-taskbar/translations/taskbar_fi.ts b/plugin-taskbar/translations/taskbar_fi.ts index 391c1f6..3a74d08 100644 --- a/plugin-taskbar/translations/taskbar_fi.ts +++ b/plugin-taskbar/translations/taskbar_fi.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Sovellus - + To &Desktop Työ&pöydälle - + &All Desktops &Kaikille työpöydille - + Desktop &%1 Työpöytä &%1 - + &To Current Desktop &Nykyiselle työpöydälle - + Ma&ximize Suu&renna - + Maximize vertically Suurenna pystysuunnassa - + Maximize horizontally Suurenna vaakasuunnassa - + &Restore &Palauta - + Mi&nimize Pie&nennä - + Roll down Rullaa alas - + Roll up Rullaa ylös - + &Layer Tas&o - + Always on &top Aina &ylimpänä - + &Normal &Tavallinen - + Always on &bottom Aina &alimpana - + &Close &Sulje + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Näytä ikkunat nykyiseltä työpöydältä + Show windows from c&urrent desktop + - Show windows from all desktops - Näytä ikkunat kaikilta työpöydiltä + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Näytä ikkunat nykyiseltä työpöydältä + + + Show windows from all desktops + Näytä ikkunat kaikilta työpöydiltä + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Ikkunaluettelon ulkoasu - + Button style Painiketyyli @@ -148,7 +184,7 @@ Painikkeen enimmäisleveys - + Close on middle-click Sulje hiiren keskimmäisen painikkeen painalluksella diff --git a/plugin-taskbar/translations/taskbar_fr_FR.ts b/plugin-taskbar/translations/taskbar_fr_FR.ts index 7efcfb1..dec8095 100644 --- a/plugin-taskbar/translations/taskbar_fr_FR.ts +++ b/plugin-taskbar/translations/taskbar_fr_FR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Application - + To &Desktop Vers &le bureau - + &All Desktops &Tous les bureaux - + Desktop &%1 Bureau &%1 - + &To Current Desktop &Vers le bureau courant - + Ma&ximize Maximiser - + Maximize vertically Maximiser verticalement - + Maximize horizontally Maximiser horizontalement - + &Restore &Restaurer - + Mi&nimize Mi&nimiser - + Roll down Enrouler vers le bas - + Roll up Enrouler vers le haut - + &Layer &Calque - + Always on &top Toujours au &dessus - + &Normal &Normal - + Always on &bottom Toujours en &bas - + &Close &Fermer + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Montrer les fenêtres du bureau actuel + Show windows from c&urrent desktop + - Show windows from all desktops - Montrer les fenêtres de tous les bureaux + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Montrer les fenêtres du bureau actuel + + + Show windows from all desktops + Montrer les fenêtres de tous les bureaux + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Apparence de la liste des fenêtres - + Button style Style de boutons @@ -148,7 +184,7 @@ Largeur maximale du bouton - + Close on middle-click Fermer d'un clic du milieu diff --git a/plugin-taskbar/translations/taskbar_hu.desktop b/plugin-taskbar/translations/taskbar_hu.desktop index bfea3f8..22f402c 100644 --- a/plugin-taskbar/translations/taskbar_hu.desktop +++ b/plugin-taskbar/translations/taskbar_hu.desktop @@ -8,5 +8,5 @@ Comment=Switch between running applications # Translations -Comment[hu]=Váltás a futú alkalmazások között +Comment[hu]=Váltás a futó alkalmazások között Name[hu]=Feladatkezelő diff --git a/plugin-taskbar/translations/taskbar_hu.ts b/plugin-taskbar/translations/taskbar_hu.ts index 93c55c7..7a812d1 100644 --- a/plugin-taskbar/translations/taskbar_hu.ts +++ b/plugin-taskbar/translations/taskbar_hu.ts @@ -1,155 +1,207 @@ - + LxQtTaskButton - + Application - + Alkalmazás - + To &Desktop - + Erre az asztal&ra - + &All Desktops - + &Az összes asztalra - + Desktop &%1 - + &%1. asztal - + &To Current Desktop - + Az ak&tuális asztalra - + Ma&ximize - + Ma&ximalizálás - + Maximize vertically - + Maximalizálás függőlegesen - + Maximize horizontally - + Maximalizálás vízszintesen - + &Restore - + &Visszaállítás - + Mi&nimize - + Mi&nimalizálás - + Roll down - + Legördítés - + Roll up - + Felgördítés - + &Layer - + Réte&g - + Always on &top - + Mindig &felül - + &Normal - + &Normál - + Always on &bottom - + Min&dig alul - + &Close - + &Bezárás + + + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás LxQtTaskbarConfiguration + + LxQt Task Manager Settings + A LxQt feladatkezelő beállításai + + + Window List Content + Az ablaklista tartalma + Task Manager Settings - + Feladatkezelő beállítása - Taskbar Contents - + General + Általános - Show windows from current desktop - + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak + + + + Show windows from all des&ktops + Az összes asztal ablakai létszanak - - Taskbar Appearance - + + Window &grouping + &Ablakcsoportok - Minimum button width - + Show popup on mouse hover + Egérre felbukkanó jelzés - - Auto&rotate buttons when the panel is vertical - + + Appearance + Megjelenés - - Close on middle-click - + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai - Show windows from all desktops - + Az összes asztal ablakai + + + + Auto&rotate buttons when the panel is vertical + Gombok függőleges panelnál gördülnek + + + Window List Appearance + Az ablaklista megjelenése - + Button style - + Gombstílus: + + + Max button width + Max. gombszélesség + + + + Close on middle-click + Középkattintásra bezárul Icon and text - + Ikon és szöveg Only icon - + Csak ikon Only text - + Csak szöveg diff --git a/plugin-taskbar/translations/taskbar_hu_HU.ts b/plugin-taskbar/translations/taskbar_hu_HU.ts index ec78c39..f6c594a 100644 --- a/plugin-taskbar/translations/taskbar_hu_HU.ts +++ b/plugin-taskbar/translations/taskbar_hu_HU.ts @@ -1,156 +1,192 @@ - + LxQtTaskButton - + Application Alkalmazás - + To &Desktop Erre az asztal&ra - + &All Desktops &Az összes asztalra - + Desktop &%1 &%1. asztal - + &To Current Desktop Az ak&tuális asztalra - + Ma&ximize Ma&ximalizálás - + Maximize vertically Maximalizálás függőlegesen - + Maximize horizontally Maximalizálás vízszintesen - + &Restore &Visszaállítás - + Mi&nimize Mi&nimalizálás - + Roll down Legördítés - + Roll up Felgördítés - + &Layer - Réte&] + Réte&g - + Always on &top Mindig &felül - + &Normal &Normál - + Always on &bottom Min&dig alul - + &Close &Bezárás + + LxQtTaskGroup + + + Group + Csoport + + + + Close group + Csoport bezárás + + LxQtTaskbarConfiguration LxQt Task Manager Settings - A LxQt feladatkezelő beállításai + A LxQt feladatkezelő beállításai Window List Content - Az ablaklista tartalma + Az ablaklista tartalma Task Manager Settings - + Feladatkezelő beállítása - Taskbar Contents - + General + Általános - Show windows from current desktop - A jelenlegi asztal ablakai + Show windows from c&urrent desktop + A jelenlegi asztal ablakai látszanak - Show windows from all desktops - Az összes asztal ablakai + Show windows from all des&ktops + Az összes asztal ablakai létszanak - - Taskbar Appearance - + + Window &grouping + &Ablakcsoportok - Minimum button width - + Show popup on mouse hover + Egérre felbukkanó jelzés + + + + Appearance + Megjelenés + + + + Maximum button width + Gomb maximális szélessége + + + + px + pixel + + + Show windows from current desktop + A jelenlegi asztal ablakai + + + Show windows from all desktops + Az összes asztal ablakai - + Auto&rotate buttons when the panel is vertical - + Gombok függőleges panelnál gördülnek Window List Appearance - Az ablaklista megjelenése + Az ablaklista megjelenése - + Button style Gombstílus: Max button width - Max. gombszélesség: + Max. gombszélesség - + Close on middle-click - + Középkattintásra bezárul diff --git a/plugin-taskbar/translations/taskbar_ia.ts b/plugin-taskbar/translations/taskbar_ia.ts index 895e429..95354c3 100644 --- a/plugin-taskbar/translations/taskbar_ia.ts +++ b/plugin-taskbar/translations/taskbar_ia.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_id_ID.ts b/plugin-taskbar/translations/taskbar_id_ID.ts index da02ff8..959e2d1 100644 --- a/plugin-taskbar/translations/taskbar_id_ID.ts +++ b/plugin-taskbar/translations/taskbar_id_ID.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_it_IT.ts b/plugin-taskbar/translations/taskbar_it_IT.ts index e326388..f6498a8 100644 --- a/plugin-taskbar/translations/taskbar_it_IT.ts +++ b/plugin-taskbar/translations/taskbar_it_IT.ts @@ -4,96 +4,109 @@ LxQtTaskButton - + Application Applicazione - + To &Desktop Al &desktop - + &All Desktops &Tutti i desktop - + Desktop &%1 Desktop &%1 - + &To Current Desktop &Al desktop corrente - + Ma&ximize Ma&ssimizza - + Maximize vertically Massimizza verticalmente - + Maximize horizontally Massimizza orizzontalmente - + &Restore &Ripristina - + Mi&nimize Mi&nimizza - + Roll down - Minimizza + &Srotola - + Roll up - Ripristina + &Arrotola - + &Layer &Livello - + Always on &top - Sempre in &alto + Sempre in &primo piano - + &Normal &Normale - + Always on &bottom - Sempre in &basso + Sempre in &secondo piano - + &Close &Chiudi + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration LxQt Task Manager Settings - Impostazioni del Task Manager di LxQt + Impostazioni del Task Manager di LXQt Window List Content @@ -102,44 +115,79 @@ Task Manager Settings - + Impostazioni della barra applicazioni - Taskbar Contents + General - Show windows from current desktop - Mostra finestre sul desktop corrente + Show windows from c&urrent desktop + - Show windows from all desktops - Mostra finestre da tutti i desktop + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance + + + Maximum button width + + + + + px + + + + Taskbar Contents + Contenuti della barra + + + Show windows from current desktop + Mostra finestre del desktop corrente + + + Show windows from all desktops + Mostra finestre da tutti i desktop + + + Taskbar Appearance + Aspetto + + + Minimum button width + Larghezza minima dei pulsanti + + + + Auto&rotate buttons when the panel is vertical + Ruota &automaticamente se il panello è verticale + Window List Appearance Aspetto delle finestre - + Button style Stile dei pulsanti @@ -148,7 +196,7 @@ Larghezza massima dei pulsanti - + Close on middle-click Chiudi con un clic del tasto centrale diff --git a/plugin-taskbar/translations/taskbar_ja.ts b/plugin-taskbar/translations/taskbar_ja.ts index 618c4d0..b81a168 100644 --- a/plugin-taskbar/translations/taskbar_ja.ts +++ b/plugin-taskbar/translations/taskbar_ja.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application アプリケーション - + To &Desktop デスクトップへ(&D) - + &All Desktops すべてのデスクトップ(&A) - + Desktop &%1 デスクトップ &%1 - + &To Current Desktop 現在のデスクトップへ(&T) - + Ma&ximize 最大化(&x) - + Maximize vertically 縦方向の最大化 - + Maximize horizontally 横方向の最大化 - + &Restore 復元(&R) - + Mi&nimize 最小化(&N) - + Roll down 広げる - + Roll up たたむ - + &Layer レイヤー(&L) - + Always on &top 常に手前に表示(&T) - + &Normal 通常(&N) - + Always on &bottom 常に奥に表示(&B) - + &Close 閉じる(&C) + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -97,45 +110,80 @@ タスクマネージャーの設定 - Taskbar Contents - タスクバーの内容 + タスクバーの内容 - Show windows from current desktop - 現在のデスクトップのウィンドウを表示 + 現在のデスクトップのウィンドウを表示 - Show windows from all desktops - 全てのデスクトップのウィンドウを表示 + 全てのデスクトップのウィンドウを表示 - Taskbar Appearance - タスクバーの見た目 + タスクバーの見た目 - Minimum button width - ボタン幅の最小値 + ボタン幅の最小値 - + Auto&rotate buttons when the panel is vertical パネルが垂直なときにはボタンを回転(&R) - + Button style ボタンのスタイル - + + General + + + + + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + + + + Close on middle-click 中ボタンのクリックで閉じる + + + Window &grouping + + + + + Show popup on mouse hover + + + + + Appearance + + + + + Maximum button width + + + + + px + + Icon and text diff --git a/plugin-taskbar/translations/taskbar_ko.ts b/plugin-taskbar/translations/taskbar_ko.ts index 6b3f9d2..2b1d173 100644 --- a/plugin-taskbar/translations/taskbar_ko.ts +++ b/plugin-taskbar/translations/taskbar_ko.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_lt.ts b/plugin-taskbar/translations/taskbar_lt.ts index 970e65d..81bcf69 100644 --- a/plugin-taskbar/translations/taskbar_lt.ts +++ b/plugin-taskbar/translations/taskbar_lt.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Programa - + To &Desktop Į &darbalaukį - + &All Desktops &visus darbalaukius - + Desktop &%1 &%1 darbalaukį - + &To Current Desktop &Į dabartinį darbalaukį - + Ma&ximize &Išdidinti - + Maximize vertically Išdidinti vertikaliai - + Maximize horizontally Išdidinti horizontaliai - + &Restore &Atstatyti - + Mi&nimize &Nuleisti - + Roll down Išvynioti - + Roll up Suvynioti - + &Layer S&luoksnis - + Always on &top Visada &viršuje - + &Normal Įpras&tas - + Always on &bottom Visada vi&ršuje - + &Close &Užverti + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Rodyti tik šio darbalaukio langus + Show windows from c&urrent desktop + - Show windows from all desktops - Rodyti visų darbalaukių langus + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Rodyti tik šio darbalaukio langus + + + Show windows from all desktops + Rodyti visų darbalaukių langus + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Langų sąrašo išvaizda - + Button style Mygtuko stilius @@ -148,7 +184,7 @@ Didžiausias leidžiamas plotis - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_nl.ts b/plugin-taskbar/translations/taskbar_nl.ts index b04a855..2e5a87b 100644 --- a/plugin-taskbar/translations/taskbar_nl.ts +++ b/plugin-taskbar/translations/taskbar_nl.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Toepassing - + To &Desktop Naar &bureaublad - + &All Desktops &Alle bureaubladen - + Desktop &%1 Bureaublad &%1 - + &To Current Desktop &Naar huidig bureaublad - + Ma&ximize Ma&ximaliseren - + Maximize vertically Verticaal maximaliseren - + Maximize horizontally Horizontaal maximaliseren - + &Restore &Herstellen - + Mi&nimize Mi&nimaliseren - + Roll down Uitrollen - + Roll up Oprollen - + &Layer &Laag - + Always on &top Altijd bovenop - + &Normal &Normaal - + Always on &bottom Altijd onderop - + &Close &Sluiten + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Toon vensters van huidig bureaublad + Show windows from c&urrent desktop + - Show windows from all desktops - Toon vensters van alle bureaubladen + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Toon vensters van huidig bureaublad + + + Show windows from all desktops + Toon vensters van alle bureaubladen + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Uiterlijk van vensterlijst - + Button style Stijl van knoppen @@ -148,7 +184,7 @@ Maximale knopbreedte - + Close on middle-click Sluiten bij middelklik diff --git a/plugin-taskbar/translations/taskbar_pl_PL.ts b/plugin-taskbar/translations/taskbar_pl_PL.ts index 0677000..c14f3dd 100644 --- a/plugin-taskbar/translations/taskbar_pl_PL.ts +++ b/plugin-taskbar/translations/taskbar_pl_PL.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikacja - + To &Desktop Na &pulpit - + &All Desktops &Wszystkie pulpity - + Desktop &%1 Pulpit &%1 - + &To Current Desktop &Na obecny pulpit - + Ma&ximize Zma&ksymalizuj - + Maximize vertically Zmaksymalizuj pionowo - + Maximize horizontally Zmaksymalizuj poziomo - + &Restore &Odzyskaj - + Mi&nimize Zmi&nimalizuj - + Roll down Zwiń - + Roll up Rozwiń - + &Layer &Warstwa - + Always on &top Zawsze na &wierzchu - + &Normal &Normalnie - + Always on &bottom Zawsze pod &spodem - + &Close &Zamknij + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Pokazuj okna z obecnego pulpitu + Show windows from c&urrent desktop + - Show windows from all desktops - Pokazuj okna ze wszystkich pulpitów + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokazuj okna z obecnego pulpitu + + + Show windows from all desktops + Pokazuj okna ze wszystkich pulpitów + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Wygląd listy zadań - + Button style Styl przycisku @@ -148,7 +184,7 @@ Maksymalna szerokość - + Close on middle-click Zamknij środkowym klawiszem diff --git a/plugin-taskbar/translations/taskbar_pt.ts b/plugin-taskbar/translations/taskbar_pt.ts index 5c8c24e..e121959 100644 --- a/plugin-taskbar/translations/taskbar_pt.ts +++ b/plugin-taskbar/translations/taskbar_pt.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicação - + To &Desktop Na área &de trabalho - + &All Desktops Tod&as as áreas de trabalho - + Desktop &%1 Área de trabalho &%1 - + &To Current Desktop Na área de &trabalho atual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar na vertical - + Maximize horizontally Maximizar na horizontal - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down Enrolar para baixo - + Roll up Enrolar para cima - + &Layer Ca&mada - + Always on &top Sempre na &frente - + &Normal &Normal - + Always on &bottom Sempre a&trás - + &Close Fe&char + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Mostrar janelas da área de trabalho atual + Show windows from c&urrent desktop + - Show windows from all desktops - Mostrar janelas de todas as áreas de trabalho + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Mostrar janelas da área de trabalho atual + + + Show windows from all desktops + Mostrar janelas de todas as áreas de trabalho + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Aparência da lista de janelas - + Button style Estilo dos botões @@ -148,7 +184,7 @@ Largura máxima do botão - + Close on middle-click Fechar com a roda do rato diff --git a/plugin-taskbar/translations/taskbar_pt_BR.ts b/plugin-taskbar/translations/taskbar_pt_BR.ts index 69c7fe1..cb6db4e 100644 --- a/plugin-taskbar/translations/taskbar_pt_BR.ts +++ b/plugin-taskbar/translations/taskbar_pt_BR.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicativo - + To &Desktop Para a área &de trabalho - + &All Desktops Todas &as áreas de trabalho - + Desktop &%1 Área de trabalho &%1 - + &To Current Desktop Para a área de &trabalho atual - + Ma&ximize Ma&ximizar - + Maximize vertically Maximizar verticalmente - + Maximize horizontally Maximizar horizontalmente - + &Restore &Restaurar - + Mi&nimize Mi&nimizar - + Roll down Rolar para baixo - + Roll up Rolar para cima - + &Layer &Camada - + Always on &top Sempre em &cima - + &Normal &Normal - + Always on &bottom Sempre em &baixo - + &Close &Fechar + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Exibir as janelas da área de trabalho atual + Show windows from c&urrent desktop + - Show windows from all desktops - Exibir as janelas de todas as áreas de trabalho + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Exibir as janelas da área de trabalho atual + + + Show windows from all desktops + Exibir as janelas de todas as áreas de trabalho + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Aparência da lista de janelas - + Button style Estilo dos botões @@ -148,7 +184,7 @@ Largura máxima do botão - + Close on middle-click Fechar em meio clique diff --git a/plugin-taskbar/translations/taskbar_ro_RO.ts b/plugin-taskbar/translations/taskbar_ro_RO.ts index 46ab9af..a0ad0d3 100644 --- a/plugin-taskbar/translations/taskbar_ro_RO.ts +++ b/plugin-taskbar/translations/taskbar_ro_RO.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplicație - + To &Desktop Către &desktop - + &All Desktops Toate ecr&anele - + Desktop &%1 Ecranul &%1 - + &To Current Desktop Că&tre ecranul virtual curent - + Ma&ximize Ma&ximizează - + Maximize vertically Maximizează pe verticală - + Maximize horizontally Maximizează pe orizontală - + &Restore &Restaurează - + Mi&nimize Mi&nimizează - + Roll down Derulează în jos - + Roll up Derulează în sus - + &Layer &Strat - + Always on &top Întotdeauna de&asupra - + &Normal &Normal - + Always on &bottom Întotdeauna de&desubt - + &Close În&chide + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -102,31 +115,54 @@ - Taskbar Contents + General - Show windows from current desktop - Afișează ferestrele de pe ecranul virtual curent + Show windows from c&urrent desktop + - Show windows from all desktops - Afișează ferestrele din toate ecranele virtuale + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Afișează ferestrele de pe ecranul virtual curent + + + Show windows from all desktops + Afișează ferestrele din toate ecranele virtuale + + + Auto&rotate buttons when the panel is vertical @@ -135,7 +171,7 @@ Aspect listă ferestre - + Button style Stil butoane @@ -144,7 +180,7 @@ Lățime maximă butoane - + Close on middle-click Închide prin clic pe butonul din mijloc diff --git a/plugin-taskbar/translations/taskbar_ru.ts b/plugin-taskbar/translations/taskbar_ru.ts index b38a3aa..5e9cda9 100644 --- a/plugin-taskbar/translations/taskbar_ru.ts +++ b/plugin-taskbar/translations/taskbar_ru.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Приложение - + To &Desktop &На рабочий стол - + &All Desktops &Все рабочие столы - + Desktop &%1 Рабочий стол &%1 - + &To Current Desktop На &текущий рабочий стол - + Ma&ximize Р&аспахнуть - + Maximize vertically Распахнуть по вертикали - + Maximize horizontally Распахнуть по горизонтали - + &Restore &Восстановить - + Mi&nimize &Свернуть - + Roll down Развернуть из заголовока - + Roll up Свернуть в заголовок - + &Layer &Положение - + Always on &top Всегда на &верху - + &Normal &Обычное - + Always on &bottom Всегда в&низу - + &Close &Закрыть + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + LxQtTaskbarConfiguration @@ -98,58 +111,94 @@ - Taskbar Contents - Содержимое панели задач + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид - - Show windows from current desktop - Показывать окна только с текущего стола + + Maximum button width + Максимальная ширина кнопки - - Show windows from all desktops - Показывать окна со всех рабочих столов + + + px + пикс - - Taskbar Appearance - Внешний вид панели задач + + Maximum button height + Максимальная высота кнопки - + Button style Стиль кнопок - - Minimum button width - Минимальная ширина кнопки + + Show only windows from desktop + Показывать окна только с рабочего стола - + Auto&rotate buttons when the panel is vertical Авто&поворот кнопок, когда панель вертикальна - + Close on middle-click Закрыть по щелчку средней кнопки мыши - + Icon and text Значок и текст - + Only icon Только значок - + Only text Только текст + + + Current + Текущий + diff --git a/plugin-taskbar/translations/taskbar_ru_RU.ts b/plugin-taskbar/translations/taskbar_ru_RU.ts index 9130364..02202d0 100644 --- a/plugin-taskbar/translations/taskbar_ru_RU.ts +++ b/plugin-taskbar/translations/taskbar_ru_RU.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Приложение - + To &Desktop &На рабочий стол - + &All Desktops &Все рабочие столы - + Desktop &%1 Рабочий стол &%1 - + &To Current Desktop На &текущий рабочий стол - + Ma&ximize Р&аспахнуть - + Maximize vertically Распахнуть по вертикали - + Maximize horizontally Распахнуть по горизонтали - + &Restore &Восстановить - + Mi&nimize &Свернуть - + Roll down Развернуть из заголовока - + Roll up Свернуть в заголовок - + &Layer &Положение - + Always on &top Всегда на &верху - + &Normal &Обычное - + Always on &bottom Всегда в&низу - + &Close &Закрыть + + LxQtTaskGroup + + + Group + Группа + + + + Close group + Закрыть группу + + LxQtTaskbarConfiguration @@ -98,58 +111,94 @@ - Taskbar Contents - Содержимое панели задач + General + Общие + + + + Show only windows from &panel's screen + Показывать окна только с экрана &панели + + + + Show only minimized windows + Показывать только свёрнутые окна + + + + Raise minimized windows on current desktop + Разворачивать свёрнутые окна на текущем рабочем столе + + + + Window &grouping + &Группировка окон + + + + Show popup on mouse hover + Показать всплывающее окно при наведении мыши + + + + Appearance + Внешний вид - - Show windows from current desktop - Показывать окна только с текущего стола + + Maximum button width + Максимальная ширина кнопки - - Show windows from all desktops - Показывать окна со всех рабочих столов + + + px + пикс - - Taskbar Appearance - Внешний вид панели задач + + Maximum button height + Максимальная высота кнопки - + Button style Стиль кнопок - - Minimum button width - Минимальная ширина кнопки + + Show only windows from desktop + Показывать окна только с рабочего стола - + Auto&rotate buttons when the panel is vertical Авто&поворот кнопок, когда панель вертикальна - + Close on middle-click Закрыть по щелчку средней кнопки мыши - + Icon and text Значок и текст - + Only icon Только значок - + Only text Только текст + + + Current + Текущий + diff --git a/plugin-taskbar/translations/taskbar_sk_SK.ts b/plugin-taskbar/translations/taskbar_sk_SK.ts index 34187fe..ba7c83c 100644 --- a/plugin-taskbar/translations/taskbar_sk_SK.ts +++ b/plugin-taskbar/translations/taskbar_sk_SK.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Aplikácia - + To &Desktop Na &plochu - + &All Desktops &Všetky plochy - + Desktop &%1 Plocha &%1 - + &To Current Desktop &Na aktuálnu plochu - + Ma&ximize Ma&ximalizovať - + Maximize vertically Maximalizovať zvisle - + Maximize horizontally Maximalizovať vodorovne - + &Restore &Obnoviť - + Mi&nimize Mi&nimalizovať - + Roll down Zrolovať nahor - + Roll up Zrolovať dolu - + &Layer &Vrstva - + Always on &top Vždy &navrchu - + &Normal &Normálne - + Always on &bottom Vždy na&spodku - + &Close &Zatvoriť + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Zobraziť okná z aktuálnej plochy + Show windows from c&urrent desktop + - Show windows from all desktops - Zobraziť okná z každej plochy + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Zobraziť okná z aktuálnej plochy + + + Show windows from all desktops + Zobraziť okná z každej plochy + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Vzhľad zoznamu okien - + Button style Štýl tlačidiel @@ -148,7 +184,7 @@ Maximálna šírka tlačidla - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_sl.ts b/plugin-taskbar/translations/taskbar_sl.ts index e90975f..155fda5 100644 --- a/plugin-taskbar/translations/taskbar_sl.ts +++ b/plugin-taskbar/translations/taskbar_sl.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Program - + To &Desktop &Na namizje - + &All Desktops &Vsa namizja - + Desktop &%1 Namizje &%1 - + &To Current Desktop Na &trenutno namizje - + Ma&ximize &Razpni - + Maximize vertically Razpni navpično - + Maximize horizontally Razpni vodoravno - + &Restore &Obnovi - + Mi&nimize Po&manjšaj - + Roll down Razvij - + Roll up Zvij - + &Layer &Plast - + Always on &top Vedno na &vrhu - + &Normal &Običajno - + Always on &bottom Vedno na &dnu - + &Close &Zapri + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Pokaži okna s trenutnega namizja + Show windows from c&urrent desktop + - Show windows from all desktops - Pokaži okna z vseh namizij + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Pokaži okna s trenutnega namizja + + + Show windows from all desktops + Pokaži okna z vseh namizij + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Videz seznama oken - + Button style Slog z gumbi @@ -148,7 +184,7 @@ Največja širina gumbov - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_sr@latin.ts b/plugin-taskbar/translations/taskbar_sr@latin.ts index 0ce8342..fbde286 100644 --- a/plugin-taskbar/translations/taskbar_sr@latin.ts +++ b/plugin-taskbar/translations/taskbar_sr@latin.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application - + To &Desktop - + &All Desktops - + Desktop &%1 - + &To Current Desktop - + Ma&ximize - + Maximize vertically - + Maximize horizontally - + &Restore - + Mi&nimize - + Roll down - + Roll up - + &Layer - + Always on &top - + &Normal - + Always on &bottom - + &Close + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -98,41 +111,56 @@ - Taskbar Contents + General - Show windows from current desktop + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - - Auto&rotate buttons when the panel is vertical + + Appearance - - Close on middle-click + + Maximum button width - - Show windows from all desktops + + px + + + + + Auto&rotate buttons when the panel is vertical + + + + + Close on middle-click - + Button style diff --git a/plugin-taskbar/translations/taskbar_sr_BA.ts b/plugin-taskbar/translations/taskbar_sr_BA.ts index c10a40f..82ab86e 100644 --- a/plugin-taskbar/translations/taskbar_sr_BA.ts +++ b/plugin-taskbar/translations/taskbar_sr_BA.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програм - + To &Desktop На &површ - + &All Desktops &све површи - + Desktop &%1 површ &%1 - + &To Current Desktop &На тренутну површ - + Ma&ximize Ма&ксимизуј - + Maximize vertically Максимизуј вертикално - + Maximize horizontally Максимизуј хоризонтално - + &Restore &Обнови - + Mi&nimize &Минимизуј - + Roll down Одмотај - + Roll up Намотај - + &Layer &Слој - + Always on &top увијек &изнад - + &Normal &нормално - + Always on &bottom увијек испо&д - + &Close &Затвори + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,55 @@ - Taskbar Contents + General - Show windows from current desktop - Прикажи прозоре са тренутне површи + Show windows from c&urrent desktop + + + + + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + Auto&rotate buttons when the panel is vertical - + Close on middle-click @@ -139,16 +176,15 @@ wlcB - Show windows from all desktops - Прикажи прозоре са свих површи + Прикажи прозоре са свих површи Window List Appearance Изглед листе прозора - + Button style Стил тастера diff --git a/plugin-taskbar/translations/taskbar_sr_RS.ts b/plugin-taskbar/translations/taskbar_sr_RS.ts index fdb6660..2409003 100644 --- a/plugin-taskbar/translations/taskbar_sr_RS.ts +++ b/plugin-taskbar/translations/taskbar_sr_RS.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програм - + To &Desktop На &површ - + &All Desktops &све површи - + Desktop &%1 површ &%1 - + &To Current Desktop &На тренутну површ - + Ma&ximize Ма&ксимизуј - + Maximize vertically Максимизуј вертикално - + Maximize horizontally Максимизуј хоризонтално - + &Restore &Обнови - + Mi&nimize &Минимизуј - + Roll down Одмотај - + Roll up Намотај - + &Layer &Слој - + Always on &top увек &изнад - + &Normal &нормално - + Always on &bottom увек испо&д - + &Close &Затвори + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Прикажи прозоре са тренутне површи + Show windows from c&urrent desktop + - Show windows from all desktops - Прикажи прозоре са свих површи + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Прикажи прозоре са тренутне површи + + + Show windows from all desktops + Прикажи прозоре са свих површи + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Изглед листе прозора - + Button style Стил тастера @@ -148,7 +184,7 @@ Макс. ширина тастера - + Close on middle-click diff --git a/plugin-taskbar/translations/taskbar_th_TH.ts b/plugin-taskbar/translations/taskbar_th_TH.ts index 33f2d3b..0ca915e 100644 --- a/plugin-taskbar/translations/taskbar_th_TH.ts +++ b/plugin-taskbar/translations/taskbar_th_TH.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application โปรแกรม - + To &Desktop ไปยัง &พ&ื&้นโต๊ะ - + &All Desktops &ท&ุกพื้นโต๊ะ - + Desktop &%1 พื้นโต๊ะ &%1 - + &To Current Desktop &ไปยังพื้นโต๊ะปัจจุบัน - + Ma&ximize &ขยายแผ่ - + Maximize vertically ขยายแผ่ทางแนวตั้ง - + Maximize horizontally ขยายแผ่ทางแนวนอน - + &Restore &ค&ืนสภาพ - + Mi&nimize &ย&่อเก็บ - + Roll down ม้วนลง - + Roll up ม้วนขึ้น - + &Layer &ลำดับชั้น - + Always on &top ด้าน&หน้าเสมอ - + &Normal &ปกติ - + Always on &bottom ด้านหลัง&งเสมอ - + &Close ปิ&ด + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - แสดงหน้าต่างเฉพาะพื้นโต๊ะปัจจุบัน + Show windows from c&urrent desktop + - Show windows from all desktops - แสดงหน้าต่างจากทุกพื้นโต๊ะ + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + แสดงหน้าต่างเฉพาะพื้นโต๊ะปัจจุบัน + + + Show windows from all desktops + แสดงหน้าต่างจากทุกพื้นโต๊ะ + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ ลักษณะรายการหน้าต่าง - + Button style รูปแบบปุ่ม @@ -148,7 +184,7 @@ ความกว้างปุ่มขนาดสูงสุด - + Close on middle-click ปิดด้วยการคลิกปุ่มกลาง diff --git a/plugin-taskbar/translations/taskbar_tr.ts b/plugin-taskbar/translations/taskbar_tr.ts index f830e48..862ae07 100644 --- a/plugin-taskbar/translations/taskbar_tr.ts +++ b/plugin-taskbar/translations/taskbar_tr.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Uygulama - + To &Desktop &Masaüstüne - + &All Desktops &Tüm Masaüstlerine - + Desktop &%1 Masaüstü &%1 - + &To Current Desktop &Şimdiki Masaüstüne - + Ma&ximize Bü&yüt - + Maximize vertically Dikey büyüt - + Maximize horizontally Yatay büyüt - + &Restore &Geri getir - + Mi&nimize Kü&çült - + Roll down Aşağı indir - + Roll up Yukarı çıkar - + &Layer &Katman - + Always on &top Her zaman &üstte - + &Normal &Normal - + Always on &bottom Her zaman &altta - + &Close &Kapat + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Şimdiki masaüstündeki pencereleri göster + Show windows from c&urrent desktop + - Show windows from all desktops - Tüm masaüstlerindeki pencereleri göster + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Şimdiki masaüstündeki pencereleri göster + + + Show windows from all desktops + Tüm masaüstlerindeki pencereleri göster + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Pencere Listesi Görünümü - + Button style Düğme biçimi @@ -148,7 +184,7 @@ En fazla düğme genişliği - + Close on middle-click Orta tıklama ile kapat diff --git a/plugin-taskbar/translations/taskbar_uk.ts b/plugin-taskbar/translations/taskbar_uk.ts index 62dc0cc..5752841 100644 --- a/plugin-taskbar/translations/taskbar_uk.ts +++ b/plugin-taskbar/translations/taskbar_uk.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application Програма - + To &Desktop На &стільницю - + &All Desktops На &всі стільниці - + Desktop &%1 Стільниця &%1 - + &To Current Desktop На &поточну стільницю - + Ma&ximize Ма&ксимізувати - + Maximize vertically Максимізувати вертикально - + Maximize horizontally Максимізувати горизонтально - + &Restore &Розгорнути - + Mi&nimize &Згорнути - + Roll down Посунути вниз - + Roll up Посунути вгору - + &Layer &Шар - + Always on &top Завжди з&гори - + &Normal &Типово - + Always on &bottom Завжди з&низу - + &Close З&акрити + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - Показувати вікна поточної стільниці + Show windows from c&urrent desktop + - Show windows from all desktops - Показувати вікна всіх стільниць + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + Показувати вікна поточної стільниці + + + Show windows from all desktops + Показувати вікна всіх стільниць + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ Вигляд списку вікон - + Button style Стиль кнопок @@ -148,7 +184,7 @@ Макс. довжина кнопки - + Close on middle-click Закривати по середній кнопці миші diff --git a/plugin-taskbar/translations/taskbar_zh_CN.ts b/plugin-taskbar/translations/taskbar_zh_CN.ts index 4711892..15b1eb9 100644 --- a/plugin-taskbar/translations/taskbar_zh_CN.ts +++ b/plugin-taskbar/translations/taskbar_zh_CN.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application 应用程序 - + To &Desktop 到&桌面 - + &All Desktops &全部桌面 - + Desktop &%1 桌面 &%1 - + &To Current Desktop &到当前桌面 - + Ma&ximize 最&大化 - + Maximize vertically 垂直最大化 - + Maximize horizontally 水平最大化 - + &Restore &恢复 - + Mi&nimize 最&小化 - + Roll down 卷下 - + Roll up 卷上 - + &Layer &层 - + Always on &top 总在&顶层 - + &Normal &正常 - + Always on &bottom 总在&底层 - + &Close &关闭 + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - 显示当前桌面的窗口 + Show windows from c&urrent desktop + - Show windows from all desktops - 显示所有桌面的窗口 + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 显示当前桌面的窗口 + + + Show windows from all desktops + 显示所有桌面的窗口 + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ 窗口列表外观 - + Button style 按钮样式 @@ -148,7 +184,7 @@ 最大按钮宽度 - + Close on middle-click 鼠标中击时关闭 diff --git a/plugin-taskbar/translations/taskbar_zh_TW.ts b/plugin-taskbar/translations/taskbar_zh_TW.ts index fac5b24..99f0b23 100644 --- a/plugin-taskbar/translations/taskbar_zh_TW.ts +++ b/plugin-taskbar/translations/taskbar_zh_TW.ts @@ -4,91 +4,104 @@ LxQtTaskButton - + Application 應用程式 - + To &Desktop 傳送到桌面(&D) - + &All Desktops 傳送到全部桌面(&A) - + Desktop &%1 桌面 &%1 - + &To Current Desktop 傳送到當前桌面(&T) - + Ma&ximize 最大化(&x) - + Maximize vertically 垂直最大化 - + Maximize horizontally 水平最大化 - + &Restore 恢復(&R) - + Mi&nimize 最小化(&n) - + Roll down 放下視窗 - + Roll up 捲起視窗 - + &Layer 層(&L) - + Always on &top 總是在最上層(&t) - + &Normal 正常(&N) - + Always on &bottom 總是在最底層(&b) - + &Close 關閉(&C) + + LxQtTaskGroup + + + Group + + + + + Close group + + + LxQtTaskbarConfiguration @@ -106,31 +119,54 @@ - Taskbar Contents + General - Show windows from current desktop - 顯示當前桌面視窗 + Show windows from c&urrent desktop + - Show windows from all desktops - 顯示所有桌面視窗 + Show windows from all des&ktops + - - Taskbar Appearance + + Window &grouping - Minimum button width + Show popup on mouse hover - + + Appearance + + + + + Maximum button width + + + + + px + + + + Show windows from current desktop + 顯示當前桌面視窗 + + + Show windows from all desktops + 顯示所有桌面視窗 + + + Auto&rotate buttons when the panel is vertical @@ -139,7 +175,7 @@ 視窗清單外觀 - + Button style 按鈕樣式 @@ -148,7 +184,7 @@ 最大按鈕寬度 - + Close on middle-click 按滑鼠中鍵關閉 diff --git a/plugin-tray/CMakeLists.txt b/plugin-tray/CMakeLists.txt index d5238f8..184c92a 100644 --- a/plugin-tray/CMakeLists.txt +++ b/plugin-tray/CMakeLists.txt @@ -1,8 +1,12 @@ set(PLUGIN "tray") -include(FindPkgConfig) include(CheckLibraryExists) +find_package(PkgConfig) +pkg_check_modules(XCB REQUIRED xcb) +pkg_check_modules(XCB_UTIL REQUIRED xcb-util) +pkg_check_modules(XCB_DAMAGE REQUIRED xcb-damage) + find_package(X11 REQUIRED) pkg_check_modules(XCOMPOSITE REQUIRED xcomposite) pkg_check_modules(XDAMAGE REQUIRED xdamage) @@ -22,13 +26,6 @@ set(SOURCES xfitman.cpp ) -set(MOCS - lxqttrayplugin.h - lxqttray.h - trayicon.h - xfitman.h -) - set(LIBRARIES ${X11_LIBRARIES} ${XCOMPOSITE_LIBRARIES} diff --git a/plugin-tray/lxqttray.cpp b/plugin-tray/lxqttray.cpp index efa8d05..83736d4 100644 --- a/plugin-tray/lxqttray.cpp +++ b/plugin-tray/lxqttray.cpp @@ -225,6 +225,7 @@ TrayIcon* LxQtTray::findIcon(Window id) ************************************************/ void LxQtTray::setIconSize(QSize iconSize) { + mIconSize = iconSize; unsigned long size = qMin(mIconSize.width(), mIconSize.height()); XChangeProperty(mDisplay, mTrayId, @@ -234,10 +235,6 @@ void LxQtTray::setIconSize(QSize iconSize) PropModeReplace, (unsigned char*)&size, 1); - - mIconSize = iconSize; - foreach(TrayIcon* icon, mIcons) - icon->setIconSize(mIconSize); } @@ -384,7 +381,6 @@ void LxQtTray::addIcon(Window winId) return; } - icon->setIconSize(mIconSize); mIcons.append(icon); mLayout->addWidget(icon); } diff --git a/plugin-tray/lxqttray.h b/plugin-tray/lxqttray.h index 53354cc..20ab76b 100644 --- a/plugin-tray/lxqttray.h +++ b/plugin-tray/lxqttray.h @@ -34,6 +34,7 @@ #include #include #include +#include "fixx11h.h" class TrayIcon; class QSize; diff --git a/plugin-tray/lxqttrayplugin.h b/plugin-tray/lxqttrayplugin.h index 49d9068..fafc610 100644 --- a/plugin-tray/lxqttrayplugin.h +++ b/plugin-tray/lxqttrayplugin.h @@ -42,7 +42,7 @@ public: virtual QWidget *widget(); virtual QString themeId() const { return "Tray"; } - virtual ILxQtPanelPlugin::Flags flags() const { return PreferRightAlignment; } + virtual Flags flags() const { return PreferRightAlignment | SingleInstance | NeedsHandle; } void realign(); bool isSeparate() const { return true; } @@ -55,10 +55,10 @@ private: class LxQtTrayPluginLibrary: public QObject, public ILxQtPanelPluginLibrary { Q_OBJECT - Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") + // Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtTrayPlugin(startupInfo); } diff --git a/plugin-tray/resources/tray.desktop.in b/plugin-tray/resources/tray.desktop.in index 110e874..7225961 100644 --- a/plugin-tray/resources/tray.desktop.in +++ b/plugin-tray/resources/tray.desktop.in @@ -3,5 +3,6 @@ Type=Service ServiceTypes=LxQtPanel/Plugin Name=System tray Comment=Display applications minimized to the system tray. +Icon=go-bottom #TRANSLATIONS_DIR=../translations diff --git a/plugin-tray/translations/tray_de.desktop b/plugin-tray/translations/tray_de.desktop index a4f2628..30e2af1 100644 --- a/plugin-tray/translations/tray_de.desktop +++ b/plugin-tray/translations/tray_de.desktop @@ -1,12 +1,3 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=System tray -Comment=Display applications minimized to the system tray. - -#TRANSLATIONS_DIR=../translations - - # Translations -Comment[de]=Zugang zu minimierten Anwendungen in der Fensterleiste -Name[de]=Fensterleiste +Name[de]=Benachrichtigungsfläche +Comment[de]=Benachrichtigungen von Anwendungen gem. System Tray Protocol diff --git a/plugin-tray/translations/tray_de_DE.desktop b/plugin-tray/translations/tray_de_DE.desktop deleted file mode 100644 index fff3edc..0000000 --- a/plugin-tray/translations/tray_de_DE.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LxQtPanel/Plugin -Name=System tray -Comment=Display applications minimized to the system tray. - -#TRANSLATIONS_DIR=../translations - - -# Translations -Comment[de_DE]=Auf versteckte, minimierte Anwendungen im System Tray zugreifen -Name[de_DE]=System Tray diff --git a/plugin-volume/CMakeLists.txt b/plugin-volume/CMakeLists.txt index 6dd8c6d..55457b1 100644 --- a/plugin-volume/CMakeLists.txt +++ b/plugin-volume/CMakeLists.txt @@ -20,25 +20,14 @@ set(SOURCES ossengine.cpp ) -set(MOCS - ${PROJECT_SOURCE_DIR}/panel/lxqtpanelpluginconfigdialog.h - lxqtvolume.h - volumebutton.h - volumepopup.h - audiodevice.h - lxqtvolumeconfiguration.h - audioengine.h - ossengine.h -) - set(UIS lxqtvolumeconfiguration.ui ) set(LIBRARIES ${LIBRARIES} - ${LXQT_GLOBALKEYS_LIBRARIES} - ${QTXDG_LIBRARIES} + lxqt-globalkeys + Qt5Xdg ) if(PULSEAUDIO_FOUND) diff --git a/plugin-volume/audiodevice.cpp b/plugin-volume/audiodevice.cpp index b50f2af..1882426 100644 --- a/plugin-volume/audiodevice.cpp +++ b/plugin-volume/audiodevice.cpp @@ -26,7 +26,6 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "audiodevice.h" - #include "audioengine.h" AudioDevice::AudioDevice(AudioDeviceType t, AudioEngine *engine, QObject *parent) : @@ -74,7 +73,7 @@ void AudioDevice::setIndex(uint index) void AudioDevice::setVolumeNoCommit(int volume) { if (m_engine) - volume = qBound(0, volume, m_engine->volumeMax(this)); + volume = m_engine->volumeBounded(volume, this); if (m_volume == volume) return; diff --git a/plugin-volume/audiodevice.h b/plugin-volume/audiodevice.h index 1a9e3c2..8b854ae 100644 --- a/plugin-volume/audiodevice.h +++ b/plugin-volume/audiodevice.h @@ -59,7 +59,7 @@ public: void setName(const QString &name); void setDescription(const QString &description); void setIndex(uint index); - + AudioEngine* engine() { return m_engine; } public slots: diff --git a/plugin-volume/audioengine.cpp b/plugin-volume/audioengine.cpp index b1cbd81..6cef716 100644 --- a/plugin-volume/audioengine.cpp +++ b/plugin-volume/audioengine.cpp @@ -43,6 +43,15 @@ AudioEngine::~AudioEngine() m_sinks.clear(); } +int AudioEngine::volumeBounded(int volume, AudioDevice* device) const +{ + int maximum = volumeMax(device); + double v = ((double) volume / 100.0) * maximum; + double bounded = qBound(0, v, maximum); + return qRound((bounded / maximum) * 100); +} + + void AudioEngine::mute(AudioDevice *device) { setMute(device, true); diff --git a/plugin-volume/audioengine.h b/plugin-volume/audioengine.h index cfb83d4..5fb9ea7 100644 --- a/plugin-volume/audioengine.h +++ b/plugin-volume/audioengine.h @@ -44,6 +44,7 @@ public: const QList &sinks() const { return m_sinks; } virtual int volumeMax(AudioDevice *device) const = 0; + virtual int volumeBounded(int volume, AudioDevice *device) const; virtual const QString backendName() const = 0; public slots: diff --git a/plugin-volume/lxqtvolume.cpp b/plugin-volume/lxqtvolume.cpp index 6dd2977..0476c81 100644 --- a/plugin-volume/lxqtvolume.cpp +++ b/plugin-volume/lxqtvolume.cpp @@ -60,13 +60,42 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): m_notification = new LxQt::Notification("", this); - // global key shortcuts - QString shortcutNotRegistered; - m_keyVolumeUp = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/up").arg(settings()->group()), tr("Increase sound volume"), this); if (m_keyVolumeUp) { + connect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); connect(m_keyVolumeUp, SIGNAL(activated()), this, SLOT(handleShortcutVolumeUp())); + } + m_keyVolumeDown = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/down").arg(settings()->group()), tr("Decrease sound volume"), this); + if (m_keyVolumeDown) + { + connect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown())); + } + m_keyMuteToggle = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/mute").arg(settings()->group()), tr("Mute/unmute sound volume"), this); + if (m_keyMuteToggle) + { + connect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); + connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute())); + } + + settingsChanged(); +} + +LxQtVolume::~LxQtVolume() +{ + delete m_volumeButton; +} + +void LxQtVolume::shortcutRegistered() +{ + GlobalKeyShortcut::Action * const shortcut = qobject_cast(sender()); + + QString shortcutNotRegistered; + + if (shortcut == m_keyVolumeUp) + { + disconnect(m_keyVolumeUp, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyVolumeUp->shortcut().isEmpty()) { @@ -76,12 +105,9 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): shortcutNotRegistered = " '" DEFAULT_UP_SHORTCUT "'"; } } - } - - m_keyVolumeDown = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/down").arg(settings()->group()), tr("Decrease sound volume"), this); - if (m_keyVolumeDown) + } else if (shortcut == m_keyVolumeDown) { - connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown())); + disconnect(m_keyVolumeDown, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyVolumeDown->shortcut().isEmpty()) { @@ -91,12 +117,9 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): shortcutNotRegistered += " '" DEFAULT_DOWN_SHORTCUT "'"; } } - } - - m_keyMuteToggle = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/mute").arg(settings()->group()), tr("Mute/unmute sound volume"), this); - if (m_keyMuteToggle) + } else if (shortcut == m_keyMuteToggle) { - connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute())); + disconnect(m_keyMuteToggle, &GlobalKeyShortcut::Action::registrationFinished, this, &LxQtVolume::shortcutRegistered); if (m_keyMuteToggle->shortcut().isEmpty()) { @@ -116,13 +139,6 @@ LxQtVolume::LxQtVolume(const ILxQtPanelPluginStartupInfo &startupInfo): m_notification->setTimeout(1000); m_notification->setUrgencyHint(LxQt::Notification::UrgencyLow); - - settingsChanged(); -} - -LxQtVolume::~LxQtVolume() -{ - delete m_volumeButton; } void LxQtVolume::setAudioEngine(AudioEngine *engine) diff --git a/plugin-volume/lxqtvolume.h b/plugin-volume/lxqtvolume.h index b72fe3f..56fd869 100644 --- a/plugin-volume/lxqtvolume.h +++ b/plugin-volume/lxqtvolume.h @@ -66,6 +66,7 @@ protected slots: void handleShortcutVolumeUp(); void handleShortcutVolumeDown(); void handleShortcutVolumeMute(); + void shortcutRegistered(); private: AudioEngine *m_engine; @@ -86,7 +87,7 @@ class LxQtVolumePluginLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtVolume(startupInfo); } diff --git a/plugin-volume/ossengine.cpp b/plugin-volume/ossengine.cpp index 7a6e8b6..13b6b9c 100644 --- a/plugin-volume/ossengine.cpp +++ b/plugin-volume/ossengine.cpp @@ -36,7 +36,7 @@ #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__NetBSD__) #include #elif defined(__linux__) || defined(__Linux__) #include diff --git a/plugin-volume/translations/volume.ts b/plugin-volume/translations/volume.ts index 4171d29..9c9af62 100644 --- a/plugin-volume/translations/volume.ts +++ b/plugin-volume/translations/volume.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ar.ts b/plugin-volume/translations/volume_ar.ts index 109debb..493c95a 100644 --- a/plugin-volume/translations/volume_ar.ts +++ b/plugin-volume/translations/volume_ar.ts @@ -8,28 +8,28 @@ إظهار سطح المكتب: ﻻ يمكن تسجيل اختصار لوحة المفاتيح العامُّ `%1` - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_cs.ts b/plugin-volume/translations/volume_cs.ts index cfb7d75..1230b30 100644 --- a/plugin-volume/translations/volume_cs.ts +++ b/plugin-volume/translations/volume_cs.ts @@ -8,28 +8,28 @@ Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_cs_CZ.ts b/plugin-volume/translations/volume_cs_CZ.ts index ae9f3f4..815ac1f 100644 --- a/plugin-volume/translations/volume_cs_CZ.ts +++ b/plugin-volume/translations/volume_cs_CZ.ts @@ -8,28 +8,28 @@ Ukázat plochu: Celkovou zkratku '%1' nelze zapsat - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_da_DK.ts b/plugin-volume/translations/volume_da_DK.ts index 34aaae4..0df3bcd 100644 --- a/plugin-volume/translations/volume_da_DK.ts +++ b/plugin-volume/translations/volume_da_DK.ts @@ -8,28 +8,28 @@ Vis Skrivebord: Global genvej '%1' kan ikke registreres - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_de.desktop b/plugin-volume/translations/volume_de.desktop new file mode 100644 index 0000000..32df5d6 --- /dev/null +++ b/plugin-volume/translations/volume_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Lautstärkeeinstellung +Comment[de]=Systemlautstärke einstellen und den bevorzugten Mischer starten. diff --git a/plugin-volume/translations/volume_de_DE.ts b/plugin-volume/translations/volume_de.ts similarity index 61% rename from plugin-volume/translations/volume_de_DE.ts rename to plugin-volume/translations/volume_de.ts index 4174f9c..4f32770 100644 --- a/plugin-volume/translations/volume_de_DE.ts +++ b/plugin-volume/translations/volume_de.ts @@ -1,54 +1,46 @@ - + LxQtVolume - Show Desktop: Global shortcut '%1' cannot be registered - Zeige Desktop: Globales Tastenkürzel '%1' kann nicht vergeben werden - - - + Increase sound volume - + Lautstärke erhöhen - + Decrease sound volume - + Lautstärke verringern - + Mute/unmute sound volume - + Lautstärke stummschalten/wiederherstellen - + Volume Control: The following shortcuts can not be registered: %1 - + Lautstärkeeinstellung: Die folgenden Tastaturkürzel konnten nicht registriert werden: %1 - - + + Volume: %1 - + Lautstärke: %1 LxQtVolumeConfiguration - - LxQt Volume Control Settings - LxQt Lautstärkeregelung - Volume Control Settings - + Lautstärkeeinstellungen Device to control - Zu regelndes Gerät + Zu steuerndes Gerät @@ -63,7 +55,7 @@ OSS - + OSS @@ -83,30 +75,30 @@ Allow volume beyond 100% (0dB) - Lautstärken über 100% (0dB) erlauben + Lautstärke über 100% (0dB) erlauben Volume adjust step - Lautstärken Schrittweite + Lautstärkeschrittweite External Mixer - Externer Mixer + Externer Mischer VolumePopup - + Launch mixer - + Mischer starten - - Mixer - + + Mi&xer + &Mischer diff --git a/plugin-volume/translations/volume_el_GR.ts b/plugin-volume/translations/volume_el_GR.ts index adfa582..98563c6 100644 --- a/plugin-volume/translations/volume_el_GR.ts +++ b/plugin-volume/translations/volume_el_GR.ts @@ -8,28 +8,28 @@ Εμφάνιση επιφάνειας εργασίας: Δεν είναι δυνατή η καταχώριση της καθολικής συντόμευσης "%1" - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_eo.ts b/plugin-volume/translations/volume_eo.ts index 4f31086..38b4f41 100644 --- a/plugin-volume/translations/volume_eo.ts +++ b/plugin-volume/translations/volume_eo.ts @@ -8,28 +8,28 @@ Montri labortablon: ĉiea klavkombino '%1' ne registreblas - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_es.ts b/plugin-volume/translations/volume_es.ts index 7514323..14fc080 100644 --- a/plugin-volume/translations/volume_es.ts +++ b/plugin-volume/translations/volume_es.ts @@ -8,28 +8,28 @@ Mostrar Escritorio: Atajo global '%1' no puede ser registrado - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_es_VE.ts b/plugin-volume/translations/volume_es_VE.ts index a63ca2e..d2a4f76 100644 --- a/plugin-volume/translations/volume_es_VE.ts +++ b/plugin-volume/translations/volume_es_VE.ts @@ -8,28 +8,28 @@ Mostrar escritorio: Acceso de teclado global '%1' no puede registrarse - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_eu.ts b/plugin-volume/translations/volume_eu.ts index 12b8546..b35dd73 100644 --- a/plugin-volume/translations/volume_eu.ts +++ b/plugin-volume/translations/volume_eu.ts @@ -8,28 +8,28 @@ Erakutsi mahaigaina: Ezin da '%1' lasterbide globala erregistratu - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_fi.ts b/plugin-volume/translations/volume_fi.ts index 2926394..50c300c 100644 --- a/plugin-volume/translations/volume_fi.ts +++ b/plugin-volume/translations/volume_fi.ts @@ -8,28 +8,28 @@ Näytä työpöytä: globaalia pikanäppäintä '%1' ei voi rekisteröidä - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_fr_FR.ts b/plugin-volume/translations/volume_fr_FR.ts index 23e922b..842d3d2 100644 --- a/plugin-volume/translations/volume_fr_FR.ts +++ b/plugin-volume/translations/volume_fr_FR.ts @@ -8,28 +8,28 @@ Montrer le bureau : le raccourci global '%1' ne peut pas être défini - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_de_DE.desktop b/plugin-volume/translations/volume_hu.desktop similarity index 64% rename from plugin-volume/translations/volume_de_DE.desktop rename to plugin-volume/translations/volume_hu.desktop index fab0912..1f90583 100644 --- a/plugin-volume/translations/volume_de_DE.desktop +++ b/plugin-volume/translations/volume_hu.desktop @@ -8,5 +8,5 @@ Comment=Control the system's volume and launch your preferred mixer. # Translations -Comment[de_DE]=Regele die Systemlautstärke und starte bevorzugten Mixer. -Name[de_DE]=Lautstärken Regelung +Comment[hu]=A rendszer hangerejének beállítása +Name[hu]=Hangerőszabályzó diff --git a/plugin-volume/translations/volume_hu.ts b/plugin-volume/translations/volume_hu.ts new file mode 100644 index 0000000..5a59b05 --- /dev/null +++ b/plugin-volume/translations/volume_hu.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/plugin-volume/translations/volume_hu_HU.ts b/plugin-volume/translations/volume_hu_HU.ts new file mode 100644 index 0000000..8901b59 --- /dev/null +++ b/plugin-volume/translations/volume_hu_HU.ts @@ -0,0 +1,104 @@ + + + + + LxQtVolume + + + Increase sound volume + Hangosítás + + + + Decrease sound volume + Halkítás + + + + Mute/unmute sound volume + Némítás/megszólaltatás + + + + Volume Control: The following shortcuts can not be registered: %1 + Hangerőszabályozó: A %1 gyorsbillentyű regisztrálhatatlan + + + + + Volume: %1 + Hangerő: %1 + + + + LxQtVolumeConfiguration + + + Volume Control Settings + Hangszabályzó beállítás + + + + Device to control + Eszközbeállítás + + + + Alsa + + + + + PulseAudio + + + + + OSS + + + + + Behavior + Működés + + + + Mute on middle click + Középkattintásra némul + + + + Show on mouse click + Egérkattintásra látszik + + + + Allow volume beyond 100% (0dB) + Hangerő tartomány 100% (0dB) + + + + Volume adjust step + Lépésköz + + + + External Mixer + Külső keverő + + + + VolumePopup + + + Launch mixer + Keverő futtatása + + + + Mixer + Keverő + + + diff --git a/plugin-volume/translations/volume_it_IT.ts b/plugin-volume/translations/volume_it_IT.ts index 2da4b27..3a36662 100644 --- a/plugin-volume/translations/volume_it_IT.ts +++ b/plugin-volume/translations/volume_it_IT.ts @@ -8,28 +8,28 @@ Mostra desktop: la scorciatoia globale '%1' non può essere registrata - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ja.ts b/plugin-volume/translations/volume_ja.ts index 5a11437..829e408 100644 --- a/plugin-volume/translations/volume_ja.ts +++ b/plugin-volume/translations/volume_ja.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume 音量を上げる - + Decrease sound volume 音量を下げる - + Mute/unmute sound volume ミュート/解除 - + Volume Control: The following shortcuts can not be registered: %1 音量制御: このショートカットは登録することができません: %1 - - + + Volume: %1 音量: %1 diff --git a/plugin-volume/translations/volume_lt.ts b/plugin-volume/translations/volume_lt.ts index 3049e00..de1b083 100644 --- a/plugin-volume/translations/volume_lt.ts +++ b/plugin-volume/translations/volume_lt.ts @@ -8,28 +8,28 @@ Rodyti darbalaukį: globalusis klavišas „%1“ negali būti registruojamas - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_nl.ts b/plugin-volume/translations/volume_nl.ts index 7e931fb..8268eae 100644 --- a/plugin-volume/translations/volume_nl.ts +++ b/plugin-volume/translations/volume_nl.ts @@ -8,28 +8,28 @@ Bureaublad weergeven: systeembrede sneltoets '%1' kan niet worden geregistreerd - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pl_PL.ts b/plugin-volume/translations/volume_pl_PL.ts index 5df03e8..5b78505 100644 --- a/plugin-volume/translations/volume_pl_PL.ts +++ b/plugin-volume/translations/volume_pl_PL.ts @@ -8,28 +8,28 @@ Pokaż Pulpit: Globalny skrót '%1' nie może zostać zarejestrowany - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pt.ts b/plugin-volume/translations/volume_pt.ts index 7da3821..3ec8efa 100644 --- a/plugin-volume/translations/volume_pt.ts +++ b/plugin-volume/translations/volume_pt.ts @@ -8,28 +8,28 @@ Tecla de atalho global: "%1" não pode ser registada - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_pt_BR.ts b/plugin-volume/translations/volume_pt_BR.ts index a0b338b..52874e5 100644 --- a/plugin-volume/translations/volume_pt_BR.ts +++ b/plugin-volume/translations/volume_pt_BR.ts @@ -8,28 +8,28 @@ Mostrar Área De Trabalho: Atalho Global '%1'não pode se registrado - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ro_RO.ts b/plugin-volume/translations/volume_ro_RO.ts index f7cfbb6..0b368b3 100644 --- a/plugin-volume/translations/volume_ro_RO.ts +++ b/plugin-volume/translations/volume_ro_RO.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_ru.ts b/plugin-volume/translations/volume_ru.ts index a651d8d..beb9ab1 100644 --- a/plugin-volume/translations/volume_ru.ts +++ b/plugin-volume/translations/volume_ru.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume Увеличить громкость звука - + Decrease sound volume Уменьшить громкость звука - + Mute/unmute sound volume Выкл/вкл звук - + Volume Control: The following shortcuts can not be registered: %1 Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 - - + + Volume: %1 Громкость: %1 diff --git a/plugin-volume/translations/volume_ru_RU.ts b/plugin-volume/translations/volume_ru_RU.ts index a7988d5..93a7e7f 100644 --- a/plugin-volume/translations/volume_ru_RU.ts +++ b/plugin-volume/translations/volume_ru_RU.ts @@ -4,28 +4,28 @@ LxQtVolume - + Increase sound volume Увеличить громкость звука - + Decrease sound volume Уменьшить громкость звука - + Mute/unmute sound volume Выкл/вкл звук - + Volume Control: The following shortcuts can not be registered: %1 Контроль громкости: следующие сочетания клавиш не могут быть зарегистрированы: %1 - - + + Volume: %1 Громкость: %1 diff --git a/plugin-volume/translations/volume_sl.ts b/plugin-volume/translations/volume_sl.ts index 342d1b9..5ff9d41 100644 --- a/plugin-volume/translations/volume_sl.ts +++ b/plugin-volume/translations/volume_sl.ts @@ -8,28 +8,28 @@ Prikaz namizja: globalne bližnjice »%1« ni moč registrirati - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_th_TH.ts b/plugin-volume/translations/volume_th_TH.ts index 3d6e732..f2422fd 100644 --- a/plugin-volume/translations/volume_th_TH.ts +++ b/plugin-volume/translations/volume_th_TH.ts @@ -8,28 +8,28 @@ แสดงพื้นโต๊ะ: ไม่สามารถตั้ง '%1' เป็นปุ่มลัดส่วนกลางได้ - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_uk.ts b/plugin-volume/translations/volume_uk.ts index 18c26b8..b9598a9 100644 --- a/plugin-volume/translations/volume_uk.ts +++ b/plugin-volume/translations/volume_uk.ts @@ -8,28 +8,28 @@ Показати стільницю: Не вдалося зареєструвати глобальне скорочення '%1' - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_zh_CN.ts b/plugin-volume/translations/volume_zh_CN.ts index 9ff66e5..94dfc34 100644 --- a/plugin-volume/translations/volume_zh_CN.ts +++ b/plugin-volume/translations/volume_zh_CN.ts @@ -8,28 +8,28 @@ 显示桌面:无法注册全局快捷键'%1' - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/translations/volume_zh_TW.ts b/plugin-volume/translations/volume_zh_TW.ts index 63391a5..1c09ef6 100644 --- a/plugin-volume/translations/volume_zh_TW.ts +++ b/plugin-volume/translations/volume_zh_TW.ts @@ -8,28 +8,28 @@ 顯示桌面:全域快捷鍵'%1'無法被註冊 - + Increase sound volume - + Decrease sound volume - + Mute/unmute sound volume - + Volume Control: The following shortcuts can not be registered: %1 - - + + Volume: %1 diff --git a/plugin-volume/volumebutton.cpp b/plugin-volume/volumebutton.cpp index ff489ef..4b90a9a 100644 --- a/plugin-volume/volumebutton.cpp +++ b/plugin-volume/volumebutton.cpp @@ -49,7 +49,7 @@ VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent): // In the worst case - no soundcard/pulse - is found it remains // in the button but at least the button is not blank ("invisible") handleStockIconChanged("dialog-error"); - m_volumePopup = new VolumePopup(); + m_volumePopup = new VolumePopup(this); m_popupHideTimer.setInterval(1000); connect(this, SIGNAL(clicked()), this, SLOT(toggleVolumeSlider())); @@ -64,8 +64,6 @@ VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent): VolumeButton::~VolumeButton() { - if (m_volumePopup) - delete m_volumePopup; } void VolumeButton::setShowOnClicked(bool state) @@ -135,7 +133,7 @@ void VolumeButton::showVolumeSlider() m_volumePopup->updateGeometry(); m_volumePopup->adjustSize(); QRect pos = mPlugin->calculatePopupWindowPos(m_volumePopup->size()); - m_volumePopup->open(pos.topLeft(), Qt::TopLeftCorner); + m_volumePopup->openAt(pos.topLeft(), Qt::TopLeftCorner); m_volumePopup->activateWindow(); } diff --git a/plugin-volume/volumepopup.cpp b/plugin-volume/volumepopup.cpp index 4313c19..59cf84c 100644 --- a/plugin-volume/volumepopup.cpp +++ b/plugin-volume/volumepopup.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "audioengine.h" #include @@ -50,18 +50,9 @@ VolumePopup::VolumePopup(QWidget* parent): m_mixerButton = new QPushButton(this); m_mixerButton->setObjectName("MixerLink"); m_mixerButton->setMinimumWidth(1); - m_mixerButton->setFlat(true); m_mixerButton->setToolTip(tr("Launch mixer")); - m_mixerButton->setText(tr("Mixer")); - QSize textSize = m_mixerButton->fontMetrics().size(Qt::TextShowMnemonic, m_mixerButton->text()); - QStyleOptionButton opt; - opt.initFrom(m_mixerButton); - opt.rect.setSize(textSize); - m_mixerButton->setMaximumSize(m_mixerButton->style()->sizeFromContents(QStyle::CT_PushButton, - &opt, - textSize, - m_mixerButton)); - m_mixerButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + m_mixerButton->setText(tr("Mi&xer")); + m_mixerButton->setAutoDefault(false); m_volumeSlider = new QSlider(Qt::Vertical, this); m_volumeSlider->setTickPosition(QSlider::TicksBothSides); @@ -73,11 +64,11 @@ VolumePopup::VolumePopup(QWidget* parent): m_muteToggleButton = new QPushButton(this); m_muteToggleButton->setIcon(XdgIcon::fromTheme(QStringList() << "audio-volume-muted")); m_muteToggleButton->setCheckable(true); - m_muteToggleButton->setFlat(true); + m_muteToggleButton->setAutoDefault(false); QVBoxLayout *l = new QVBoxLayout(this); l->setSpacing(0); - l->setMargin(2); + l->setMargin(0); l->addWidget(m_mixerButton, 0, Qt::AlignHCenter); l->addWidget(m_volumeSlider, 0, Qt::AlignHCenter); @@ -115,6 +106,9 @@ void VolumePopup::handleSliderValueChanged(int value) return; // qDebug("VolumePopup::handleSliderValueChanged: %d\n", value); m_device->setVolume(value); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(value)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel + QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip(), m_volumeSlider); } void VolumePopup::handleMuteToggleClicked() @@ -134,6 +128,8 @@ void VolumePopup::handleDeviceVolumeChanged(int volume) // signal emission. m_volumeSlider->blockSignals(true); m_volumeSlider->setValue(volume); + m_volumeSlider->setToolTip(QStringLiteral("%1%").arg(volume)); + dynamic_cast(*parent()).setToolTip(m_volumeSlider->toolTip()); //parent is the button on panel m_volumeSlider->blockSignals(false); // emit volumeChanged(percent); @@ -171,7 +167,7 @@ void VolumePopup::resizeEvent(QResizeEvent *event) realign(); } -void VolumePopup::open(QPoint pos, Qt::Corner anchor) +void VolumePopup::openAt(QPoint pos, Qt::Corner anchor) { m_pos = pos; m_anchor = anchor; diff --git a/plugin-volume/volumepopup.h b/plugin-volume/volumepopup.h index 04de241..f02b9c0 100644 --- a/plugin-volume/volumepopup.h +++ b/plugin-volume/volumepopup.h @@ -40,7 +40,7 @@ class VolumePopup : public QDialog public: VolumePopup(QWidget* parent = 0); - void open(QPoint pos, Qt::Corner anchor); + void openAt(QPoint pos, Qt::Corner anchor); void handleWheelEvent(QWheelEvent *event); QSlider *volumeSlider() const { return m_volumeSlider; } diff --git a/plugin-worldclock/CMakeLists.txt b/plugin-worldclock/CMakeLists.txt index b43151b..90d10c2 100644 --- a/plugin-worldclock/CMakeLists.txt +++ b/plugin-worldclock/CMakeLists.txt @@ -14,13 +14,6 @@ set(SOURCES lxqtworldclockconfigurationmanualformat.cpp ) -set(MOCS - lxqtworldclock.h - lxqtworldclockconfiguration.h - lxqtworldclockconfigurationtimezones.h - lxqtworldclockconfigurationmanualformat.h -) - set(UIS lxqtworldclockconfiguration.ui lxqtworldclockconfigurationtimezones.ui diff --git a/plugin-worldclock/lxqtworldclock.cpp b/plugin-worldclock/lxqtworldclock.cpp index 8dc473b..d37384a 100644 --- a/plugin-worldclock/lxqtworldclock.cpp +++ b/plugin-worldclock/lxqtworldclock.cpp @@ -45,6 +45,8 @@ LxQtWorldClock::LxQtWorldClock(const ILxQtPanelPluginStartupInfo &startupInfo): ILxQtPanelPlugin(startupInfo), mPopup(NULL), mTimer(new QTimer(this)), + mUpdateInterval(1), + mLastUpdate(0), mAutoRotate(true), mPopupContent(NULL) { @@ -77,33 +79,28 @@ LxQtWorldClock::~LxQtWorldClock() void LxQtWorldClock::timeout() { - QString str = formatDateTime(QDateTime::currentDateTime(), mActiveTimeZone); - if (str != mLastShownText) - { - mContent->setText(str); - mLastShownText = str; + QDateTime now = QDateTime::currentDateTime(); + qint64 nowMsec = now.toMSecsSinceEpoch(); + if ((mLastUpdate / mUpdateInterval) == (nowMsec / mUpdateInterval)) + return; - mRotatedWidget->adjustContentSize(); - mRotatedWidget->update(); + mLastUpdate = nowMsec; - updatePopupContent(); - } -} + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + mContent->setText(formatDateTime(now, timeZoneName)); -void LxQtWorldClock::restartTimer(int timerInterval) -{ - mTimer->stop(); - mTimer->setInterval(timerInterval); + mRotatedWidget->update(); - if (timerInterval < 1000) - mTimer->start(); - else - { - int delay = static_cast((timerInterval + 100 - (static_cast(QTime::currentTime().msecsSinceStartOfDay()) % timerInterval)) % timerInterval); - QTimer::singleShot(delay, this, SLOT(timeout())); - QTimer::singleShot(delay, mTimer, SLOT(start())); - } + updatePopupContent(); +} + +void LxQtWorldClock::restartTimer(int updateInterval) +{ + mUpdateInterval = updateInterval; + mTimer->start(qMin(100, updateInterval)); } void LxQtWorldClock::settingsChanged() @@ -124,7 +121,7 @@ void LxQtWorldClock::settingsChanged() } _settings->endArray(); if (mTimeZones.isEmpty()) - mTimeZones.append(QString::fromLatin1(QTimeZone::systemTimeZoneId())); + mTimeZones.append(QLatin1String("local")); mDefaultTimeZone = _settings->value(QLatin1String("defaultTimeZone"), QString()).toString(); if (mDefaultTimeZone.isEmpty()) @@ -190,7 +187,6 @@ void LxQtWorldClock::settingsChanged() mFormat = customFormat; else { - QTimeZone timeZone(mActiveTimeZone.toLatin1()); QLocale locale = QLocale(QLocale::AnyLanguage, QLocale().country()); if (formatType == QLatin1String("short-timeonly")) @@ -268,18 +264,18 @@ void LxQtWorldClock::settingsChanged() if ((oldFormat != mFormat)) { - int timerInterval = 0; + int updateInterval = 0; QString format = mFormat; format.replace(QRegExp(QLatin1String("'[^']*'")), QString()); if (format.contains(QLatin1String("z"))) - timerInterval = 1; + updateInterval = 1; else if (format.contains(QLatin1String("s"))) - timerInterval = 1000; + updateInterval = 1000; else - timerInterval = 60000; + updateInterval = 60000; - restartTimer(timerInterval); + restartTimer(updateInterval); } bool autoRotate = settings()->value(QLatin1String("autoRotate"), true).toBool(); @@ -338,7 +334,11 @@ void LxQtWorldClock::activated(ActivationReason reason) QCalendarWidget *calendarWidget = new QCalendarWidget(mPopup); mPopup->layout()->addWidget(calendarWidget); - QTimeZone timeZone(mActiveTimeZone.toLatin1()); + QString timeZoneName = mActiveTimeZone; + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + + QTimeZone timeZone(timeZoneName.toLatin1()); calendarWidget->setFirstDayOfWeek(QLocale(QLocale::AnyLanguage, timeZone.country()).firstDayOfWeek()); calendarWidget->setSelectedDate(QDateTime::currentDateTime().toTimeZone(timeZone).date()); } @@ -388,6 +388,9 @@ void LxQtWorldClock::updatePopupContent() foreach (QString timeZoneName, mTimeZones) { + if (timeZoneName == QLatin1String("local")) + timeZoneName = QString::fromLatin1(QTimeZone::systemTimeZoneId()); + QString formatted = formatDateTime(now, timeZoneName); if (!hasTimeZone) diff --git a/plugin-worldclock/lxqtworldclock.h b/plugin-worldclock/lxqtworldclock.h index 118c77e..ee9206b 100644 --- a/plugin-worldclock/lxqtworldclock.h +++ b/plugin-worldclock/lxqtworldclock.h @@ -74,6 +74,8 @@ private: LxQtWorldClockPopup* mPopup; QTimer *mTimer; + int mUpdateInterval; + qint64 mLastUpdate; QStringList mTimeZones; QMap mTimeZoneCustomNames; @@ -82,7 +84,6 @@ private: QString mFormat; bool mAutoRotate; - QString mLastShownText; QLabel *mPopupContent; void restartTimer(int); @@ -134,7 +135,7 @@ class LxQtWorldClockLibrary: public QObject, public ILxQtPanelPluginLibrary Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") Q_INTERFACES(ILxQtPanelPluginLibrary) public: - ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) + ILxQtPanelPlugin *instance(const ILxQtPanelPluginStartupInfo &startupInfo) const { return new LxQtWorldClock(startupInfo); } diff --git a/plugin-worldclock/lxqtworldclockconfiguration.cpp b/plugin-worldclock/lxqtworldclockconfiguration.cpp index ff1d128..7e215aa 100644 --- a/plugin-worldclock/lxqtworldclockconfiguration.cpp +++ b/plugin-worldclock/lxqtworldclockconfiguration.cpp @@ -519,15 +519,18 @@ void LxQtWorldClockConfiguration::addTimeZone() if (mConfigurationTimeZones->updateAndExec() == QDialog::Accepted) { QString timeZone = mConfigurationTimeZones->timeZone(); - if (findTimeZone(timeZone) == -1) + if (timeZone != QString()) { - int row = ui->timeZonesTW->rowCount(); - ui->timeZonesTW->setRowCount(row + 1); - QTableWidgetItem *item = new QTableWidgetItem(timeZone); - ui->timeZonesTW->setItem(row, 0, item); - ui->timeZonesTW->setItem(row, 1, new QTableWidgetItem(QString())); - if (mDefaultTimeZone.isEmpty()) - setDefault(row); + if (findTimeZone(timeZone) == -1) + { + int row = ui->timeZonesTW->rowCount(); + ui->timeZonesTW->setRowCount(row + 1); + QTableWidgetItem *item = new QTableWidgetItem(timeZone); + ui->timeZonesTW->setItem(row, 0, item); + ui->timeZonesTW->setItem(row, 1, new QTableWidgetItem(QString())); + if (mDefaultTimeZone.isEmpty()) + setDefault(row); + } } } @@ -587,11 +590,14 @@ void LxQtWorldClockConfiguration::editTimeZoneCustomName() QString oldName = ui->timeZonesTW->item(row, 1)->text(); - bool ok; - QString newName = QInputDialog::getText(this, tr("Input custom time zone name"), tr("Custom name"), QLineEdit::Normal, oldName, &ok); - if (ok) + QInputDialog d(this); + d.setWindowTitle(tr("Input custom time zone name")); + d.setLabelText(tr("Custom name")); + d.setTextValue(oldName); + d.setWindowModality(Qt::WindowModal); + if (d.exec()) { - ui->timeZonesTW->item(row, 1)->setText(newName); + ui->timeZonesTW->item(row, 1)->setText(d.textValue()); saveSettings(); } diff --git a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp b/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp index 9edffc5..774920e 100644 --- a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp +++ b/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp @@ -39,6 +39,7 @@ LxQtWorldClockConfigurationManualFormat::LxQtWorldClockConfigurationManualFormat ui(new Ui::LxQtWorldClockConfigurationManualFormat) { setObjectName("WorldClockConfigurationManualFormatWindow"); + setWindowModality(Qt::WindowModal); ui->setupUi(this); connect(ui->manualFormatPTE, SIGNAL(textChanged()), this, SIGNAL(manualFormatChanged())); diff --git a/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp b/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp index dce022f..bbf9eb3 100644 --- a/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp +++ b/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp @@ -39,6 +39,7 @@ LxQtWorldClockConfigurationTimeZones::LxQtWorldClockConfigurationTimeZones(QWidg ui(new Ui::LxQtWorldClockConfigurationTimeZones) { setObjectName("WorldClockConfigurationTimeZonesWindow"); + setWindowModality(Qt::WindowModal); ui->setupUi(this); connect(ui->timeZonesTW, SIGNAL(itemSelectionChanged()), SLOT(itemSelectionChanged())); @@ -123,6 +124,11 @@ int LxQtWorldClockConfigurationTimeZones::updateAndExec() makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); } + QStringList qStrings = QStringList() << tr("Other") << QLatin1String("local"); + QTreeWidgetItem *tzItem = new QTreeWidgetItem(QStringList() << qStrings[qStrings.length() - 1] << QString() << tr("Local timezone") << QString()); + tzItem->setData(0, Qt::UserRole, qStrings[qStrings.length() - 1]); + makeSureParentsExist(qStrings, parentItems)->addChild(tzItem); + ui->timeZonesTW->sortByColumn(0, Qt::AscendingOrder); return exec(); diff --git a/plugin-worldclock/translations/worldclock.ts b/plugin-worldclock/translations/worldclock.ts index f0efb2a..846c397 100644 --- a/plugin-worldclock/translations/worldclock.ts +++ b/plugin-worldclock/translations/worldclock.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -118,7 +118,7 @@ - + Custom name @@ -233,7 +233,7 @@ - + Input custom time zone name @@ -321,8 +321,14 @@ + Other + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_de.desktop b/plugin-worldclock/translations/worldclock_de.desktop new file mode 100644 index 0000000..c4e8a1b --- /dev/null +++ b/plugin-worldclock/translations/worldclock_de.desktop @@ -0,0 +1,2 @@ +Name[de]=Weltzeituhr +Comment[de]=Weltzeituhr diff --git a/plugin-worldclock/translations/worldclock_de.ts b/plugin-worldclock/translations/worldclock_de.ts new file mode 100644 index 0000000..c51cf08 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_de.ts @@ -0,0 +1,370 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Weltzeituhr - Einstellungen + + + + Display &format + Anzeige&format + + + + &Time + &Zeit + + + + F&ormat: + F&ormat: + + + + + + Short + Kurz + + + + + + Long + Lang + + + + + Custom + Eigenes + + + + Sho&w seconds + Se&kunden anzeigen + + + + Pad &hour with zero + Stunden mit fü&hrender Null + + + + &Use 12-hour format + 12-St&undenformat benutzen + + + + T&ime zone + Ze&itzone + + + + &Position: + &Position: + + + + For&mat: + For&mat: + + + + + Below + Unter + + + + + Above + Über + + + + + Before + Vor + + + + + After + Nach + + + + Offset from UTC + Versatz zu UTC + + + + Abbreviation + Abkürzung + + + + Location identifier + Ortsbezeichnung + + + + + + Custom name + Eigener Name + + + + &Date + &Datum + + + + Po&sition: + &Position: + + + + Fo&rmat: + Fo&rmat: + + + + ISO 8601 + ISO 8601 + + + + Show &year + &Jahr anzeigen + + + + Show day of wee&k + &Wochentag anzeigen + + + + Pad d&ay with zero + T&ag mit führender Null + + + + &Long month and day of week names + &Lange Monats- und Wochentagsbezeichnungen + + + + Ad&vanced manual format + &Erweitertes manuelles Format + + + + &Customise ... + &Ändern... + + + + Time &zones + &Zeitzonen + + + + IANA id + IANA-ID + + + + &Add ... + &Hinzufügen ... + + + + &Remove + &Entfernen + + + + Set as &default + Als &Default setzen + + + + &Edit custom name ... + &Eigenen Namen bearbeiten... + + + + Move &up + Nach &oben + + + + Move do&wn + Nach &unten + + + + &General + All&gemein + + + + Auto&rotate when the panel is vertical + &Bei senkrechter Leiste automatisch drehen + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + Input custom time zone name + Eigenen Zeitzonennamen eingeben + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + <h1>Syntax für eigenes Datums-/Zeitformat </h1> +<p>Ein Datumsmuster ist eine Zeichenkette, in der bestimmte Zeichenfolgen durch Datums- und Zeitangaben eines Kalenders ersetzt werden.</p> +<p>In der unten angegebenen Tabelle sind die Zeichenfolgen angegeben, für die eine Ersetzung vorgenommen wird. Dabei können einzelne Zeichen mehrfach angegeben werden, um die Bedeutung zu verändern. Beispielsweise wird y zur Darstellung des Jahres benutzt. Dabei produziert 'yy' z.B. '99', und 'yyyy' produziert dann '1999'. Bei den meisten numerischen Feldern bestimmt die Anzahl der Zeichen die Feldbreite. Beispielsweise bei h, das zur Darstellung der Stunden dient, könnte 'h' eine '5' produzieren, aber 'hh' ergäbe '05'. Bei einigen Zeichen wird durch die Anzahl bestimmt, ob die abgekürzte oder ausgeschriebene Form benutzt werden soll.</p> +<p>Zwei Hochkommas werden durch ein einzelnes Hochkomma ersetzt, sowohl innerhalb als auch außerhalb Hochkommas. Text innerhalb einfacher Hochkommas wird nicht ersetzt (abgesehen von zwei aufeinander folgenden Hochkommas). Ansonsten sind alle ASCII-Zeichen von a bis z und A bis Z reservierte Zeichen und müssen in Hochkommas stehen, wenn sie für sich selbst stehen sollen. Außerdem könnten bestimmte Satzzeichen zukünftig als Variablen aufgefasst werden (z.B. könnte ":" als Trennzeichen zwischen Zeitbestandteilen und '/' als Datumstrenner interpretiert werden, welche durch entsprechende lokale Zeichen in der Anzeige ersetzt werden).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Bedeutung</th></tr> +<tr><td>d</td><td>Tag als Zahl ohne führende Null (1 bis 31)</td></tr> +<tr><td>dd</td><td>Tag als Zahl mit führender Null (01 bis 31)</td></tr> +<tr><td>ddd</td><td>Abgekürzter lokalisierter Tagesname (z.B. 'Mon' bis 'Son').</td></tr> +<tr><td>dddd</td><td>Ausgeschriebener lokalisierter Tagesname (z.B. 'Montag' bis 'Sonntag</td></tr> +<tr><td>M</td><td>Monat als Zahl ohne führende Null (1-12)</td></tr> +<tr><td>MM</td><td>Monat als Zahl mit führender Null (01-12)</td></tr> +<tr><td>MMM</td><td>Abgekürzter lokalisierter Monatsname (z.B. 'Jan' bis 'Dez').</td></tr> +<tr><td>MMMM</td><td>Ausgeschriebener lokalisierter Monatsname (z.B. 'Januar' bis 'Dezember').</td></tr> +<tr><td>yy</td><td>Jahr als zweistellige Zahl (00-99)</td></tr> +<tr><td>yyyy</td><td>Jahr als vierstellige Zahl</td></tr> +<tr><td>h</td><td>Stunde ohne führende Null (0 bis 23 oder 1 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>hh</td><td>Stunde mit führender Null (00 bis 23 oder 01 bis 12 bei AM/PM-Anzeige)</td></tr> +<tr><td>H</td><td>Stunde ohne führende Null (0 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>HH</td><td>Stunde mit führender Null (00 bis 23, selbst bei AM/PM-Anzeige)</td></tr> +<tr><td>m</td><td>Minute ohne führende Null (0 bis 59)</td></tr> +<tr><td>mm</td><td>Minute mit führender Null (00 bis 59)</td></tr> +<tr><td>s</td><td>Sekunde ohne führende Null (0 bis 59)</td></tr> +<tr><td>ss</td><td>Sekunde mit führender Null (00 bis 59)</td></tr> +<tr><td>z</td><td>Millisekunden ohne führende Nullen (0 bis 999)</td></tr> +<tr><td>zzz</td><td>Millisekunden mit führenden Nullen (000 bis 999)</td></tr> +<tr><td>AP <i>oder</i> A</td><td>AM/PM-Anzeige nutzen. <b>A/AP</b> wird durch "AM" oder "PM" ersetzt.<</td></tr> +<tr><td>ap <i>oder</i> a</td><td>am/pm-Anzeige nutzen. <b>a/ap</b> wird durch "am" oder "pm" ersetzt.<</td></tr> +<tr><td>t</td><td>Zeitzone (z.B. "CEST")</td></tr> +<tr><td>T</td><td>Offset zu UTC</td></tr> +<tr><td>TT</td><td>Zeitzone IANA-ID</td></tr> +<tr><td>TTT</td><td>Zeitzone abgekürzt</td></tr> +<tr><td>TTTT</td><td>Zeitzone kurz</td></tr> +<tr><td>TTTTT</td><td>Zeitzone lang</td></tr> +<tr><td>TTTTTT</td><td>Eigener Name für die Zeitzone. Dieser kann im Reiter 'Zeitzonen' gesetzt werden.</td></tr></table> +<p><br /><b>Hinweis:</b> Jedes Zeichen, das nicht in den Bereichen ['a'..'z'] und ['A'..'Z'] liegt, wird als in Hochkommas eingeschlossener Text behandelt. Zeichen wie ':', '.', ' ', '#' und '@' erscheinen im resultierenden Text auch wenn sie nicht in Hochkommas eingeschlossen sind. Das Hochkomma wird als Fluchtzeichen verwendet. Zwei aufeinander folgende Hochkommas repräsentieren ein 'echtes' Hochkomma.</p> + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Weltzeituhr Zeitzonen + + + + Time zone + Zeitzone + + + + Name + Name + + + + Comment + Kommentar + + + + Country + Land + + + + UTC + UTC + + + + + Other + Andere + + + + Local timezone + Lokale Zeitzone + + + diff --git a/plugin-worldclock/translations/worldclock_hu.desktop b/plugin-worldclock/translations/worldclock_hu.desktop new file mode 100644 index 0000000..36fd874 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu.desktop @@ -0,0 +1,3 @@ +#TRANSLATIONS +Name[hu]=Világóra +Comment[hu]=Világóra bővítmény diff --git a/plugin-worldclock/translations/worldclock_hu.ts b/plugin-worldclock/translations/worldclock_hu.ts new file mode 100644 index 0000000..e77c109 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/plugin-worldclock/translations/worldclock_hu_HU.ts b/plugin-worldclock/translations/worldclock_hu_HU.ts new file mode 100644 index 0000000..c281ad3 --- /dev/null +++ b/plugin-worldclock/translations/worldclock_hu_HU.ts @@ -0,0 +1,334 @@ + + + + + LxQtWorldClock + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + LxQtWorldClockConfiguration + + + World Clock Settings + Világóra beállítás + + + + Display &format + Megjelenítés &forma + + + + &Time + &Idő + + + + F&ormat: + F&ormátum: + + + + + + Short + Rövid + + + + + + Long + Hosszú + + + + + Custom + Egyéni + + + + Sho&w seconds + &Másodpercek + + + + Pad &hour with zero + Óra bevezető nullával + + + + T&ime zone + &Időzóna + + + + &Position: + &Hely + + + + For&mat: + Fo&rmátum: + + + + + Below + Belül + + + + + Above + Kívül + + + + + Before + Előtt + + + + + After + Után + + + + Offset from UTC + UTC eltérés + + + + Abbreviation + Rövidítés + + + + IANA id + + + + + + + Custom name + Egyedi + + + + &Use 12-hour format + 12 ó&rás alak + + + + Location identifier + Helyazonosító + + + + &Date + &Dátum + + + + Po&sition: + H&ely + + + + Fo&rmat: + Fo&rmátum: + + + + ISO 8601 + + + + + Show &year + É&v látszik + + + + Show day of wee&k + Hét napja látszi&k + + + + Pad d&ay with zero + N&ap nullával indul + + + + &Long month and day of week names + &Hosszú hónap és hetinap + + + + Ad&vanced manual format + Haladó kézi forma + + + + &Customise ... + &Meghatároz... + + + + Time &zones + Idő&zónák + + + + &Add ... + Hozzá&ad + + + + &Remove + Tö&röl + + + + Set as &default + Alapértelmez + + + + &Edit custom name ... + Névsz&erkesztés + + + + Move &up + &Föl + + + + Move do&wn + &Le + + + + &General + Általáno&s + + + + Auto&rotate when the panel is vertical + Függöleges panelnél görgetés + + + + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' + + + + + Input custom time zone name + Egyéb időzóna név + + + + LxQtWorldClockConfigurationManualFormat + + + World Clock Time Zones + Világóra időzónák + + + + <h1>Custom Date/Time Format Syntax</h1> +<p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p> +<p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p> +<p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br /></p> +<table border="1" width="100%" cellpadding="4" cellspacing="0"> +<tr><th width="20%">Code</th><th>Meaning</th></tr> +<tr><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr> +<tr><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr> +<tr><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</td></tr> +<tr><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday</td></tr> +<tr><td>M</td><td>the month as number without a leading zero (1-12)</td></tr> +<tr><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr> +<tr><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</td></tr> +<tr><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December').</td></tr> +<tr><td>yy</td><td>the year as two digit number (00-99)</td></tr> +<tr><td>yyyy</td><td>the year as four digit number</td></tr> +<tr><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr> +<tr><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr> +<tr><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr> +<tr><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr> +<tr><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr> +<tr><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr> +<tr><td>s</td><td>the second without a leading zero (0 to 59)</td></tr> +<tr><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr> +<tr><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr> +<tr><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr> +<tr><td>AP <i>or</i> A</td><td>use AM/PM display. <b>A/AP</b> will be replaced by either "AM" or "PM".<</td></tr> +<tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> +<tr><td>t</td><td>the timezone (for example "CEST")</td></tr> +<tr><td>T</td><td>the offset from UTC</td></tr> +<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TTT</td><td>the timezone abbreviation</td></tr> +<tr><td>TTTT</td><td>the timezone short display name</td></tr> +<tr><td>TTTTT</td><td>the timezone long display name</td></tr> +<tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> +<p><br /><b>Note:</b> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p> + + + + + + LxQtWorldClockConfigurationTimeZones + + + World Clock Time Zones + Világóra időzónák + + + + Time zone + Időzóna + + + + Name + Név + + + + Comment + Megjegyzés + + + + Country + Ország + + + + UTC + + + + + + Other + Egyéb + + + + Local timezone + Helyi idő + + + diff --git a/plugin-worldclock/translations/worldclock_ja.ts b/plugin-worldclock/translations/worldclock_ja.ts index f9657dc..08a506a 100644 --- a/plugin-worldclock/translations/worldclock_ja.ts +++ b/plugin-worldclock/translations/worldclock_ja.ts @@ -4,9 +4,9 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -121,7 +121,6 @@ 場所 - IANA id IANAのID @@ -129,7 +128,7 @@ - + Custom name 指定した名前 @@ -229,12 +228,12 @@ パネルが垂直なときには回転する(&R) - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + Input custom time zone name タイムゾーンの名前を入力 @@ -358,8 +357,14 @@ + Other その他 + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_pt.ts b/plugin-worldclock/translations/worldclock_pt.ts index 26ed172..7a76d26 100644 --- a/plugin-worldclock/translations/worldclock_pt.ts +++ b/plugin-worldclock/translations/worldclock_pt.ts @@ -1,10 +1,10 @@ - + LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Curto, apenas horas + &Curto, apenas horas &Long, time only - &Longo, apenas horas + &Longo, apenas horas S&hort, date && time - C&urto, hora e data + C&urto, hora e data L&ong, date && time - L&ongo, hora e data + L&ongo, hora e data &Custom - &Personalizar + &Personalizar <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Sintaxe do formato de data/hora personalizado</span></p><p>Um formato de data é uma cadeia de caracteres em que os caracteres são substituidos pelos dados de data e hora de um calendário ou que são utilizados para gerar os dados do calendário.</p><p>A tabela de símbolos para campos de data abaixo contém os caracteres utilizados em padrões para mostrar os devidos formatos de uma região. Os caracteres podem ser utilizados diversas vezes. Por exemplo, se utilizar y para o anor, yy devolve 99 e yyyy devolve 1999. Para a maioria dos campo numéricos, o número de caracteres especifica o tamanho do campo. Por exemplo, se utilizar h para a hora, h devolve 5 mas hh devolve 05. Para alguns caracteres, o número de letras especifica o formato utilizado (pode ser abreviado ou completo), conforme explicado abaixo.</p><p>Duas aspas simples representam uma aspa simples literal, seja dentro ou fora das aspas simples. O texto entre aspas simples não é interpretado de qualquer forma (exceto para duas aspas simples adjacentes). Doutra forma, todas as letras ASCII , de "a" a "z" e "A" a "Z" estão reservadas para caracteres de sintaxe e são necessárias aspas para representarem caracteres literais. Adicionalmente, alguns símbolos de pontuação ASCII podem ser tornados variáveis no futuro (ex: &quot;:&quot; é interpretado como separador de hora e '/' como separador de data e são substituidos pelos separadores normalmente utilizados na região).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Significado</span></p></td></tr><tr><td><p>d</p></td><td><p>o dia como número sem o zero inicial (1 a 31)</p></td></tr><tr><td><p>dd</p></td><td><p>o dia como número mas com zero inicial (01 a 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>o nome do dia abreviado (Seg a Dom).</p></td></tr><tr><td><p>dddd</p></td><td><p>o nome do dia completo (Segunda a Domingo</p></td></tr><tr><td><p>M</p></td><td><p>o mês como número sem o zero inicial (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>o mês como número mas com zero inicial (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>o nome abreviado do mês (Jan a Dez).</p></td></tr><tr><td><p>MMMM</p></td><td><p>o nome completo do mês (Janeiro a Dezembro).</p></td></tr><tr><td><p>yy</p></td><td><p>o ano como número de 2 dígitos (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>o ano como número de 4 dígitos</p></td></tr><tr><td><p>h</p></td><td><p>a hora sem o zero inicial (0 a 23 ou 1 a 12 se AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>a hora mas com o zero inicial (00 a 23 ou 01 a 12 se AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>a hora sem o zero inicial (0 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>a hora mas com o zero inicial (00 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>m</p></td><td><p>os minutos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>mm</p></td><td><p>os minutos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>s</p></td><td><p>os segundos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>ss</p></td><td><p>os segundos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>z</p></td><td><p>os milissegundos sem o zero inicial (0 a 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>os milissegundos mas com zero inicial (000 a 999)</p></td></tr><tr><td><p>AP ou A</p></td><td><p>para mostrar AM/PM <span style=" font-weight:600;">A/AP</span> será substituido por &quot;AM&quot; ou &quot;PM&quot;.</p></td></tr><tr><td><p>ap ou a</p></td><td><p>para mostrar am/pm <span style=" font-weight:600;">a/ap</span> será substituido por &quot;am&quot; ou &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>o fuso horário (por exemplo: &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>o desvio da UTC</p></td></tr><tr><td><p>TT</p></td><td><p>a ID IANA do fuso horário</p></td></tr><tr><td><p>TTT</p></td><td><p>a abreviatura do fuso horário</p></td></tr><tr><td><p>TTTT</p></td><td><p>o nome abreviado do fuso horário</p></td></tr><tr><td><p>TTTTT</p></td><td><p>o nome completo do fuso horário</p></td></tr></table><p><br/><span style=" font-weight:600;">Nota:</span> quaisquer caracteres no padrão que não estejam no intervalo [a...z] e [A...Z] serão tratados como texto. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão no texto mesmo se não tiverem aspas.As aspas simples são utilizadas para 'escape' de letras. As aspas duplas, dentro ou fora da sequência entre aspas, representa uma aspa simples 'real.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Sintaxe do formato de data/hora personalizado</span></p><p>Um formato de data é uma cadeia de caracteres em que os caracteres são substituidos pelos dados de data e hora de um calendário ou que são utilizados para gerar os dados do calendário.</p><p>A tabela de símbolos para campos de data abaixo contém os caracteres utilizados em padrões para mostrar os devidos formatos de uma região. Os caracteres podem ser utilizados diversas vezes. Por exemplo, se utilizar y para o anor, yy devolve 99 e yyyy devolve 1999. Para a maioria dos campo numéricos, o número de caracteres especifica o tamanho do campo. Por exemplo, se utilizar h para a hora, h devolve 5 mas hh devolve 05. Para alguns caracteres, o número de letras especifica o formato utilizado (pode ser abreviado ou completo), conforme explicado abaixo.</p><p>Duas aspas simples representam uma aspa simples literal, seja dentro ou fora das aspas simples. O texto entre aspas simples não é interpretado de qualquer forma (exceto para duas aspas simples adjacentes). Doutra forma, todas as letras ASCII , de "a" a "z" e "A" a "Z" estão reservadas para caracteres de sintaxe e são necessárias aspas para representarem caracteres literais. Adicionalmente, alguns símbolos de pontuação ASCII podem ser tornados variáveis no futuro (ex: &quot;:&quot; é interpretado como separador de hora e '/' como separador de data e são substituidos pelos separadores normalmente utilizados na região).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Significado</span></p></td></tr><tr><td><p>d</p></td><td><p>o dia como número sem o zero inicial (1 a 31)</p></td></tr><tr><td><p>dd</p></td><td><p>o dia como número mas com zero inicial (01 a 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>o nome do dia abreviado (Seg a Dom).</p></td></tr><tr><td><p>dddd</p></td><td><p>o nome do dia completo (Segunda a Domingo</p></td></tr><tr><td><p>M</p></td><td><p>o mês como número sem o zero inicial (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>o mês como número mas com zero inicial (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>o nome abreviado do mês (Jan a Dez).</p></td></tr><tr><td><p>MMMM</p></td><td><p>o nome completo do mês (Janeiro a Dezembro).</p></td></tr><tr><td><p>yy</p></td><td><p>o ano como número de 2 dígitos (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>o ano como número de 4 dígitos</p></td></tr><tr><td><p>h</p></td><td><p>a hora sem o zero inicial (0 a 23 ou 1 a 12 se AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>a hora mas com o zero inicial (00 a 23 ou 01 a 12 se AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>a hora sem o zero inicial (0 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>a hora mas com o zero inicial (00 a 23, mesmo se AM/PM)</p></td></tr><tr><td><p>m</p></td><td><p>os minutos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>mm</p></td><td><p>os minutos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>s</p></td><td><p>os segundos sem o zero inicial (0 a 59)</p></td></tr><tr><td><p>ss</p></td><td><p>os segundos mas com zero inicial (00 a 59)</p></td></tr><tr><td><p>z</p></td><td><p>os milissegundos sem o zero inicial (0 a 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>os milissegundos mas com zero inicial (000 a 999)</p></td></tr><tr><td><p>AP ou A</p></td><td><p>para mostrar AM/PM <span style=" font-weight:600;">A/AP</span> será substituido por &quot;AM&quot; ou &quot;PM&quot;.</p></td></tr><tr><td><p>ap ou a</p></td><td><p>para mostrar am/pm <span style=" font-weight:600;">a/ap</span> será substituido por &quot;am&quot; ou &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>o fuso horário (por exemplo: &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>o desvio da UTC</p></td></tr><tr><td><p>TT</p></td><td><p>a ID IANA do fuso horário</p></td></tr><tr><td><p>TTT</p></td><td><p>a abreviatura do fuso horário</p></td></tr><tr><td><p>TTTT</p></td><td><p>o nome abreviado do fuso horário</p></td></tr><tr><td><p>TTTTT</p></td><td><p>o nome completo do fuso horário</p></td></tr></table><p><br/><span style=" font-weight:600;">Nota:</span> quaisquer caracteres no padrão que não estejam no intervalo [a...z] e [A...Z] serão tratados como texto. Por exemplo, os caracteres ':', '.', ' ', '#' e '@' aparecerão no texto mesmo se não tiverem aspas.As aspas simples são utilizadas para 'escape' de letras. As aspas duplas, dentro ou fora da sequência entre aspas, representa uma aspa simples 'real.</p></body></html> @@ -177,7 +177,7 @@ - + Custom name Nome personalizado @@ -257,7 +257,7 @@ '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' - + Input custom time zone name Escreva o nome do fuso horário personalizado @@ -380,8 +380,14 @@ + Other Outro + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_ru.ts b/plugin-worldclock/translations/worldclock_ru.ts index 47e6c35..e16c1c0 100644 --- a/plugin-worldclock/translations/worldclock_ru.ts +++ b/plugin-worldclock/translations/worldclock_ru.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Короткий, только время + &Короткий, только время &Long, time only - &Длинный, только время + &Длинный, только время S&hort, date && time - К&ороткий, дата и время + К&ороткий, дата и время L&ong, date && time - Д&линный, дата и время + Д&линный, дата и время &Custom - &Свой + &Свой <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> @@ -172,7 +172,7 @@ - + Custom name Своё имя @@ -257,7 +257,7 @@ - + Input custom time zone name Введите своё имя для часового пояса @@ -380,8 +380,14 @@ + Other Другое + + + Local timezone + + diff --git a/plugin-worldclock/translations/worldclock_ru_RU.ts b/plugin-worldclock/translations/worldclock_ru_RU.ts index 2e12214..31c2b4b 100644 --- a/plugin-worldclock/translations/worldclock_ru_RU.ts +++ b/plugin-worldclock/translations/worldclock_ru_RU.ts @@ -4,7 +4,7 @@ LxQtWorldClock - + '<b>'HH:mm:ss'</b><br/><font size="-2">'ddd, d MMM yyyy'<br/>'TT'</font>' @@ -18,27 +18,27 @@ &Short, time only - &Короткий, только время + &Короткий, только время &Long, time only - &Длинный, только время + &Длинный, только время S&hort, date && time - К&ороткий, дата и время + К&ороткий, дата и время L&ong, date && time - Д&линный, дата и время + Д&линный, дата и время &Custom - &Свой + &Свой <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Custom Date/Time Format Syntax</span></p><p>A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing.</p><p>The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.</p><p>Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg &quot;:&quot; being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).<br/></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Code</span></p></td><td><p align="center"><span style=" font-weight:600;">Meaning</span></p></td></tr><tr><td><p>d</p></td><td><p>the day as number without a leading zero (1 to 31)</p></td></tr><tr><td><p>dd</p></td><td><p>the day as number with a leading zero (01 to 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>the abbreviated localized day name (e.g. 'Mon' to 'Sun').</p></td></tr><tr><td><p>dddd</p></td><td><p>the long localized day name (e.g. 'Monday' to 'Sunday</p></td></tr><tr><td><p>M</p></td><td><p>the month as number without a leading zero (1-12)</p></td></tr><tr><td><p>MM</p></td><td><p>the month as number with a leading zero (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>the abbreviated localized month name (e.g. 'Jan' to 'Dec').</p></td></tr><tr><td><p>MMMM</p></td><td><p>the long localized month name (e.g. 'January' to 'December').</p></td></tr><tr><td><p>yy</p></td><td><p>the year as two digit number (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>the year as four digit number</p></td></tr><tr><td><p>h</p></td><td><p>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</p></td></tr><tr><td><p>hh</p></td><td><p>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</p></td></tr><tr><td><p>H</p></td><td><p>the hour without a leading zero (0 to 23, even with AM/PM display)</p></td></tr><tr><td><p>HH</p></td><td><p>the hour with a leading zero (00 to 23, even with AM/PM display)</p></td></tr><tr><td><p>m</p></td><td><p>the minute without a leading zero (0 to 59)</p></td></tr><tr><td><p>mm</p></td><td><p>the minute with a leading zero (00 to 59)</p></td></tr><tr><td><p>s</p></td><td><p>the second without a leading zero (0 to 59)</p></td></tr><tr><td><p>ss</p></td><td><p>the second with a leading zero (00 to 59)</p></td></tr><tr><td><p>z</p></td><td><p>the milliseconds without leading zeroes (0 to 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>the milliseconds with leading zeroes (000 to 999)</p></td></tr><tr><td><p>AP or A</p></td><td><p>use AM/PM display. <span style=" font-weight:600;">A/AP</span> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</p></td></tr><tr><td><p>ap or a</p></td><td><p>use am/pm display. <span style=" font-weight:600;">a/ap</span> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</p></td></tr><tr><td><p>t</p></td><td><p>the timezone (for example &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>the offset from UTC</p></td></tr><tr><td><p>TT</p></td><td><p>the timezone IANA id</p></td></tr><tr><td><p>TTT</p></td><td><p>the timezone abbreviation</p></td></tr><tr><td><p>TTTT</p></td><td><p>the timezone short display name</p></td></tr><tr><td><p>TTTTT</p></td><td><p>the timezone long display name</p></td></tr></table><p><br/><span style=" font-weight:600;">Note:</span> Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</p></body></html> - <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Синтаксис своего формата даты/времени</span></p><p>Шаблон даты — это строка символов, где специальные группы символов заменяются при форматировании на дату и время из календаря или используются для генерации даты при синтаксическом разборе.</p><p>Таблица символов полей даты ниже содержит символы, используемые в шаблонах для отображения подходящих форматов установленной локали, такой как yyyy для года. Символы могут быть использованы несколько раз. Например, если использован y для года, 'yy' отобразит '99', тогда как 'yyyy' покажет '1999'. Для большинства числовых полей число символов определяет ширину поля. Например, если h это час, 'h' отобразит '5', но 'hh' отобразит '05'. Для некоторых символов, это число определяет должно ли быть использовано сокращение или полная форма, но могут быть и другие варианты, как написано ниже.</p><p>Две одинарные кавычки отобразят одиночную кавычку, независимо от того внутренние они или внешние. Текст внутри одинарных кавычек никак не интерпретируется (за исключением двух смежных одинарных кавычек). Тогда как все символы ASCII от a до z и A до Z зарезервированы под символы синтаксиса, и требуют заключения в кавычки для отображения их как обычных символов. помимо прочего, некоторые знаки препинания ASCII могут стать переменными в будущем (т.е. &quot;:&quot; быть интерпретированы как разделитель компонентов времени и '/' как разделитель компонентов даты, и заменены при отображении соответствующими символами с учётом локали ).<br /></p><table border="1" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="4"><tr><td width="20%"><p align="center"><span style=" font-weight:600;">Код</span></p></td><td><p align="center"><span style=" font-weight:600;">Обозначения</span></p></td></tr><tr><td><p>d</p></td><td><p>день как число без первого нуля (от 1 до 31)</p></td></tr><tr><td><p>dd</p></td><td><p>день как число с первым нулём (от 01 до 31)</p></td></tr><tr><td><p>ddd</p></td><td><p>сокращённое локализованное название дня (т.е. от 'Пн' до 'Вс').</p></td></tr><tr><td><p>dddd</p></td><td><p>длинное локализованное название дня (т.е. от 'Понедельник' до 'Воскресенье'</p></td></tr><tr><td><p>M</p></td><td><p>месяц как число без первого нуля (1-12)</p></td></tr><tr><td><p>MM</td><td><p>месяц как число с первым нулём (01-12)</p></td></tr><tr><td><p>MMM</p></td><td><p>сокращённое локализованное название месяца (т.е. от 'Янв' до 'Дек').</p></td></tr><tr><td><p>MMMM</p></td><td><p>длинное локализованное название месяца (т.е. от 'Январь' до 'Декабрь').</p></td></tr><tr><td><p>yy</p></td><td><p>год как двухразрядное число (00-99)</p></td></tr><tr><td><p>yyyy</p></td><td><p>год как четырёхразрядное число</p></td></tr><tr><td><p>h</p></td><td><p>час без нуля впереди (от 0 до 23 или 1 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>hh</p></td><td><p>час с нулём впереди (от 00 до 23 или 01 до 12, если отображается AM/PM)</p></td></tr><tr><td><p>H</p></td><td><p>час без нуля впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td><p>HH</p></td><td><p>час с нулём впереди (от 00 до 23, даже с отображением AM/PM)</p></td></tr><tr><td>m</p></td><td><p>минута без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>mm</p></td><td><p>минута с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>s</td><td><p>секунда без нуля впереди (от 0 до 59)</p></td></tr><tr><td><p>ss</p></td><td><p>секунда с нулём впереди (от 00 до 59)</p></td></tr><tr><td><p>z</p></td><td><p>миллисекунда без нуля впереди (от 0 до 999)</p></td></tr><tr><td><p>zzz</p></td><td><p>миллисекунда с нулём впереди (от 000 до 999)</p></td></tr><tr><td><p>AP или A</p></td><td><p>использовать отображение AM/PM. <span style=" font-weight:600;">A/AP</span> будет замещено или &quot;AM&quot; или &quot;PM&quot;.</p></td></tr><tr><td><p>ap или a</p></td><td><p>использовать отображение am/pm. <span style=" font-weight:600;">a/ap</span> будет замещено или &quot;am&quot; или &quot;pm&quot;</p></td></tr><tr><td><p>t</p></td><td><p>часовой пояс (например &quot;CEST&quot;)</p></td></tr><tr><td><p>T</p></td><td><p>сдвиг времени от UTC</p></td></tr><tr><td>TT</p></td><td><p>id часового пояса IANA</p></td></tr><tr><td><p>TTT</p></td><td><p>аббревиатура часового пояса</p></td></tr><tr><td><p>TTTT</p></td><td><p>короткое имя часового пояса</p></td></tr><tr><td><p>TTTTT</p></td><td><p>длинное имя часового пояса</p></td></tr></table><p><br/><span style=" font-weight:600;">Замечание:</span> Любой символ в шаблоне не из диапазона ['a'..'z'] и ['A'..'Z'] будет обработан как цитируемый текст. Например, символы как ':', '.', ' ', '#' и '@' появятся в тексте со временем, даже если они не помещены в одинарные кавычки. Одинарные кавычки используются для управляющих символ. Две одинарные кавычки подряд, независимо от того внутри или снаружи цитируемой последовательности, представляет 'реальные' одинарные кавычки.</p></body></html> @@ -172,7 +172,7 @@ - + Custom name Своё имя @@ -257,7 +257,7 @@ - + Input custom time zone name Введите своё имя для часового пояса @@ -380,8 +380,14 @@ + Other Другое + + + Local timezone + +