diff -Nru dde-dock-4.5.9.1/CHANGELOG.md dde-dock-4.6.3.1/CHANGELOG.md --- dde-dock-4.5.9.1/CHANGELOG.md 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/CHANGELOG.md 2018-04-11 09:44:14.000000000 +0000 @@ -1,4 +1,154 @@ -# 4.5.9.1 + +## 4.6.3.1 (2018-04-11) + + +### 4.6.3 (2018-03-28) + + +#### Bug Fixes + +* Popup Applet not hide when item removed ([0e9d9df0](0e9d9df0)) +* popup not shown ([0a0b60aa](0a0b60aa)) + + + + +## 4.6.2 (2018-03-22) + + +#### Bug Fixes + +* 1px line on top and left ([65100785](65100785)) +* not installed keyboard_layout.json ([3776f361](3776f361)) +* dock hang when receive attention on fastion mode ([1444fa40](1444fa40)) + + + + + +## 4.6.1 (2018-03-15) + + +#### Bug Fixes + +* sound input sink volume slider not init ([e06a0ac0](e06a0ac0)) +* update trayWidget on fashion mode ([ecb014c9](ecb014c9)) +* hidpi support for indicatortraywidget ([2704bf62](2704bf62)) +* indicatortraywidget connect error pertoires slots ([83cb34e8](83cb34e8)) +* Adapt lintian ([182ba8bd](182ba8bd)) +* dock hide behavior error when popup menu ([ad3f979e](ad3f979e)) +* menu auto hide ([51ee4140](51ee4140)) +* positioned at wrong place ([842e530e](842e530e)) +* show control-center not work ([2774afe4](2774afe4)) +* container item icon not clearly ([7b817246](7b817246)) +* dont show container tips if it's empty ([7ca10744](7ca10744)) +* aliasing border on highlighting app icon ([093d87e9](093d87e9)) +* dock frontend rect not support hiDPI ([9c6c41cb](9c6c41cb)) +* sound slider use svg ([a84062bc](a84062bc)) +* network refresh button support hidpi ([c784f3c5](c784f3c5)) +* network refresh button not visiable when device on ([3807c731](3807c731)) +* **WiFi:** connecting indicator icon is too large ([a005b64f](a005b64f)) +* **attention:** crash when app item destory. ([d40239a3](d40239a3)) +* **container:** item tips color wrong ([e9803aa2](e9803aa2)) +* **dockitem:** popup applet position error ([ec1ca53e](ec1ca53e)) +* **item:** panel will hide when show menu on keep always hide mode ([c29bca64](c29bca64)) +* **network:** + * refresh button not set size ([05015516](05015516)) + * add new wireless disconnect svg ([0421d796](0421d796)) + * network plugin icon diable using theme icon ([e81ba0ba](e81ba0ba)) + * plugins icon not support hidpi ([f5b69302](f5b69302)) + * ap state error when hotspot open ([62eae043](62eae043)) +* **plugin:** wireless not refresh ([bcc5e866](bcc5e866)) +* **power:** power icon shown if switch display mode ([4ff28712](4ff28712)) +* **sound:** + * resources not load ([7e94385a](7e94385a)) + * app mute icon is not support HIDPI ([b5f8253a](b5f8253a)) + * fallback to default icon ([3e7e65d7](3e7e65d7)) + * plugins config file locate error ([34ce1bdd](34ce1bdd)) +* **sys-tray:** system tray alignment adjust ([9018711b](9018711b)) +* **sys_tray:** system tray not align vertial center ([a545ce08](a545ce08)) +* **visible:** visible error when display mode changed ([8ed399a5](8ed399a5)) +* **wireless:** + * init device enabled state ([ca1c5acd](ca1c5acd)) + * call dbus frequently ([4d217516](4d217516)) + +#### Features + +* add keybord_layout.json ([e4faf0b5](e4faf0b5)) +* add keyboard layout plugin. ([3d19f67c](3d19f67c)) +* support indicator traywidget ([58fd2df6](58fd2df6)) +* open dde-calendar with dbus call ([fb6ee52b](fb6ee52b)) +* **keyboard_layout:** add new dbus interface ([7ef2fea7](7ef2fea7)) +* **network:** + * add refresh animation ([5bb7b22e](5bb7b22e)) + * support cloned address ([e2983ded](e2983ded)) +* **plugins:** keep order ([e281f088](e281f088)) +* **system-tray:** using native popup ([354cfd9f](354cfd9f)) + + + + +## 4.6.0 (2018-03-12) + + +#### Features + +* add keyboard layout plugin. ([3d19f67c](3d19f67c)) +* support indicator traywidget ([58fd2df6](58fd2df6)) +* open dde-calendar with dbus call ([fb6ee52b](fb6ee52b)) +* **network:** + * add refresh animation ([5bb7b22e](5bb7b22e)) + * support cloned address ([e2983ded](e2983ded)) +* **plugins:** keep order ([e281f088](e281f088)) +* **system-tray:** using native popup ([354cfd9f](354cfd9f)) + +#### Bug Fixes + +* sound input sink volume slider not init ([e06a0ac0](e06a0ac0)) +* update trayWidget on fashion mode ([ecb014c9](ecb014c9)) +* hidpi support for indicatortraywidget ([2704bf62](2704bf62)) +* indicatortraywidget connect error pertoires slots ([83cb34e8](83cb34e8)) +* Adapt lintian ([182ba8bd](182ba8bd)) +* dock hide behavior error when popup menu ([ad3f979e](ad3f979e)) +* menu auto hide ([51ee4140](51ee4140)) +* positioned at wrong place ([842e530e](842e530e)) +* show control-center not work ([2774afe4](2774afe4)) +* container item icon not clearly ([7b817246](7b817246)) +* dont show container tips if it's empty ([7ca10744](7ca10744)) +* aliasing border on highlighting app icon ([093d87e9](093d87e9)) +* dock frontend rect not support hiDPI ([9c6c41cb](9c6c41cb)) +* sound slider use svg ([a84062bc](a84062bc)) +* network refresh button support hidpi ([c784f3c5](c784f3c5)) +* network refresh button not visiable when device on ([3807c731](3807c731)) +* **WiFi:** connecting indicator icon is too large ([a005b64f](a005b64f)) +* **attention:** crash when app item destory. ([d40239a3](d40239a3)) +* **container:** item tips color wrong ([e9803aa2](e9803aa2)) +* **item:** panel will hide when show menu on keep always hide mode ([c29bca64](c29bca64)) +* **network:** + * refresh button not set size ([05015516](05015516)) + * add new wireless disconnect svg ([0421d796](0421d796)) + * network plugin icon diable using theme icon ([e81ba0ba](e81ba0ba)) + * plugins icon not support hidpi ([f5b69302](f5b69302)) + * ap state error when hotspot open ([62eae043](62eae043)) +* **plugin:** wireless not refresh ([bcc5e866](bcc5e866)) +* **power:** power icon shown if switch display mode ([4ff28712](4ff28712)) +* **sound:** + * resources not load ([7e94385a](7e94385a)) + * app mute icon is not support HIDPI ([b5f8253a](b5f8253a)) + * fallback to default icon ([3e7e65d7](3e7e65d7)) + * plugins config file locate error ([34ce1bdd](34ce1bdd)) +* **sys_tray:** system tray not align vertial center ([a545ce08](a545ce08)) +* **visible:** visible error when display mode changed ([8ed399a5](8ed399a5)) + + + +# 4.5.12 + Fix item not update when wm changed + +# 4.5.11 + UI improve + +# 4.5.10 Minor bug fixes. # 4.5.9 diff -Nru dde-dock-4.5.9.1/CMakeLists.txt dde-dock-4.6.3.1/CMakeLists.txt --- dde-dock-4.5.9.1/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.7) + +set(VERSION 4.0) + +project(dde-dock) + +#set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_CXX_FLAGS "-g -Wall") + +if (DEFINED DOCK_TRAY_USE_NATIVE_POPUP) + add_definitions(-DDOCK_TRAY_USE_NATIVE_POPUP) +endif () + +if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast") + + # generate qm + execute_process(COMMAND bash "translate_generation.sh" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +endif () + +file(GLOB INTERFACES "interfaces/*.h") + +add_subdirectory("frame") +add_subdirectory("plugins") + +# Install settings +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX /usr) +endif () + +## qm files +file(GLOB QM_FILES "translations/*.qm") +install(FILES ${QM_FILES} + DESTINATION share/dde-dock/translations) + +## dev files +install (FILES ${INTERFACES} + DESTINATION include/dde-dock) + +## services files +install(FILES frame/com.deepin.dde.Dock.service + DESTINATION /usr/share/dbus-1/services) diff -Nru dde-dock-4.5.9.1/dde-dock.pro dde-dock-4.6.3.1/dde-dock.pro --- dde-dock-4.5.9.1/dde-dock.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/dde-dock.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ - -TEMPLATE = subdirs -SUBDIRS = frame \ - plugins - -# Automating generation .qm files from .ts files -CONFIG(release, debug|release) { - !system($$PWD/translate_generation.sh): error("Failed to generate translation") -} -TRANSLATIONS = translations/dde-dock.ts - -qm_files.path = $${PREFIX}/share/dde-dock/translations/ -qm_files.files = translations/*.qm - -INSTALLS = qm_files diff -Nru dde-dock-4.5.9.1/debian/changelog dde-dock-4.6.3.1/debian/changelog --- dde-dock-4.5.9.1/debian/changelog 2018-02-02 07:30:13.000000000 +0000 +++ dde-dock-4.6.3.1/debian/changelog 2018-05-07 03:21:22.000000000 +0000 @@ -1,6 +1,6 @@ -dde-dock (4.5.9.1-1) artful; urgency=low +dde-dock (4.6.3.1-1) bionic; urgency=low [ shuttle ] - * Auto Version update. + * ['Autobuild release: 17146c0ebfcabd1eaac4730c953dba9e92ffa859'] - -- lilongyu Fri, 02 Feb 2018 15:30:08 +0800 + -- lilongyu Mon, 07 May 2018 11:21:18 +0800 diff -Nru dde-dock-4.5.9.1/debian/control dde-dock-4.6.3.1/debian/control --- dde-dock-4.5.9.1/debian/control 2018-02-02 07:30:27.000000000 +0000 +++ dde-dock-4.6.3.1/debian/control 2018-04-11 09:44:14.000000000 +0000 @@ -13,6 +13,7 @@ qtbase5-private-dev, libdframeworkdbus-dev, libgsettings-qt-dev, + cmake, clang Standards-Version: 3.9.8 Homepage: http://www.deepin.org/ diff -Nru dde-dock-4.5.9.1/debian/dde-dock.install dde-dock-4.6.3.1/debian/dde-dock.install --- dde-dock-4.5.9.1/debian/dde-dock.install 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/debian/dde-dock.install 2018-04-11 09:44:14.000000000 +0000 @@ -1,3 +1,4 @@ /usr/share /usr/bin /usr/lib +/etc/dde-dock \ No newline at end of file diff -Nru dde-dock-4.5.9.1/debian/rules dde-dock-4.6.3.1/debian/rules --- dde-dock-4.5.9.1/debian/rules 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/debian/rules 2018-04-11 09:44:14.000000000 +0000 @@ -2,19 +2,20 @@ # -*- makefile -*- export QT_SELECT=5 +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +ifeq ($(DEB_BUILD_ARCH), mips64el) + export CC = /usr/bin/clang + export CXX = /usr/bin/clang++ +endif + + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --parallel -ifeq ($(DEB_BUILD_ARCH), mips64el) override_dh_auto_configure: - dh_auto_configure -- QMAKE_CC=clang QMAKE_CXX=clang++ -endif - -ifeq ($(DEB_BUILD_ARCH), mipsel) -override_dh_auto_configure: - dh_auto_configure -- QMAKE_CC=clang QMAKE_CXX=clang++ -endif + dh_auto_configure -- \ + -DDOCK_TRAY_USE_NATIVE_POPUP=YES diff -Nru dde-dock-4.5.9.1/frame/CMakeLists.txt dde-dock-4.6.3.1/frame/CMakeLists.txt --- dde-dock-4.5.9.1/frame/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/frame/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.7) + +set(BIN_NAME dde-dock) + +configure_file(environments.h.in environments.h @ONLY) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +# Find the library +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Concurrent REQUIRED) +find_package(Qt5X11Extras REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(DtkWidget REQUIRED) + +pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11) +pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) + +# driver-manager +add_executable(${BIN_NAME} ${SRCS} ${INTERFACES} item/resources.qrc) +target_include_directories(${BIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${XCB_EWMH_INCLUDE_DIRS} + ${DFrameworkDBus_INCLUDE_DIRS} + ${Qt5Gui_PRIVATE_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR} + ../interfaces) +target_link_libraries(${BIN_NAME} PRIVATE + ${XCB_EWMH_LIBRARIES} + ${DFrameworkDBus_LIBRARIES} + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Concurrent_LIBRARIES} + ${Qt5X11Extras_LIBRARIES} + ${Qt5DBus_LIBRARIES} +) + +# bin +install(TARGETS ${BIN_NAME} DESTINATION bin) diff -Nru dde-dock-4.5.9.1/frame/controller/dockitemcontroller.cpp dde-dock-4.6.3.1/frame/controller/dockitemcontroller.cpp --- dde-dock-4.5.9.1/frame/controller/dockitemcontroller.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockitemcontroller.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -20,7 +20,6 @@ */ #include "dockitemcontroller.h" -#include "dbus/dbusdockentry.h" #include "item/appitem.h" #include "item/stretchitem.h" #include "item/launcheritem.h" @@ -309,14 +308,15 @@ else { insertIndex = m_itemList.size(); - for (int i(firstPluginPosition); i != m_itemList.size(); ++i) + for (int i(firstPluginPosition + 1); i != m_itemList.size() + 1; ++i) { - PluginsItem *pItem = static_cast(m_itemList[i]); + PluginsItem *pItem = static_cast(m_itemList[i - 1]); Q_ASSERT(pItem); - if (itemSortKey <= pItem->itemSortKey()) + const int sortKey = pItem->itemSortKey(); + if (sortKey != -1 && itemSortKey > sortKey) continue; - insertIndex = i; + insertIndex = i - 1; break; } } @@ -329,6 +329,8 @@ void DockItemController::pluginItemRemoved(PluginsItem *item) { + item->hidePopup(); + if (m_containerItem->contains(item)) m_containerItem->removeItem(item); else @@ -348,3 +350,38 @@ for (auto path : m_appInter->entries()) appItemAdded(path, -1); } + +void DockItemController::sortPluginItems() +{ + int firstPluginIndex = -1; + for (int i(0); i != m_itemList.size(); ++i) + { + if (m_itemList[i]->itemType() == DockItem::Plugins) + { + firstPluginIndex = i; + break; + } + } + + if (firstPluginIndex == -1) + return; + + std::sort(m_itemList.begin() + firstPluginIndex, m_itemList.end(), [](DockItem *a, DockItem *b) -> bool { + PluginsItem *pa = static_cast(a); + PluginsItem *pb = static_cast(b); + + const int aKey = pa->itemSortKey(); + const int bKey = pb->itemSortKey(); + + if (bKey == -1) + return true; + if (aKey == -1) + return false; + + return aKey < bKey; + }); + + // reset order + for (int i(firstPluginIndex); i != m_itemList.size(); ++i) + emit itemMoved(m_itemList[i], i); +} diff -Nru dde-dock-4.5.9.1/frame/controller/dockitemcontroller.h dde-dock-4.6.3.1/frame/controller/dockitemcontroller.h --- dde-dock-4.5.9.1/frame/controller/dockitemcontroller.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockitemcontroller.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -55,6 +55,7 @@ public slots: void refershItemsIcon(); + void sortPluginItems(); void updatePluginsItemOrderKey(); void itemMove(DockItem * const moveItem, DockItem * const replaceItem); void itemDroppedIntoContainer(DockItem * const item); diff -Nru dde-dock-4.5.9.1/frame/controller/dockpluginloader.cpp dde-dock-4.6.3.1/frame/controller/dockpluginloader.cpp --- dde-dock-4.5.9.1/frame/controller/dockpluginloader.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockpluginloader.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -33,7 +33,7 @@ void DockPluginLoader::run() { #ifdef QT_DEBUG - const QDir pluginsDir("plugins"); + const QDir pluginsDir("../plugins"); #else const QDir pluginsDir("../lib/dde-dock/plugins"); #endif diff -Nru dde-dock-4.5.9.1/frame/controller/dockpluginloader.h dde-dock-4.6.3.1/frame/controller/dockpluginloader.h --- dde-dock-4.5.9.1/frame/controller/dockpluginloader.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockpluginloader.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/controller/dockpluginscontroller.cpp dde-dock-4.6.3.1/frame/controller/dockpluginscontroller.cpp --- dde-dock-4.5.9.1/frame/controller/dockpluginscontroller.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockpluginscontroller.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/controller/dockpluginscontroller.h dde-dock-4.6.3.1/frame/controller/dockpluginscontroller.h --- dde-dock-4.5.9.1/frame/controller/dockpluginscontroller.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/controller/dockpluginscontroller.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusdockadaptors.cpp dde-dock-4.6.3.1/frame/dbus/dbusdockadaptors.cpp --- dde-dock-4.5.9.1/frame/dbus/dbusdockadaptors.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusdockadaptors.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusdockadaptors.h dde-dock-4.6.3.1/frame/dbus/dbusdockadaptors.h --- dde-dock-4.5.9.1/frame/dbus/dbusdockadaptors.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusdockadaptors.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2016 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusdockentry.cpp dde-dock-4.6.3.1/frame/dbus/dbusdockentry.cpp --- dde-dock-4.5.9.1/frame/dbus/dbusdockentry.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusdockentry.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockEntry -p dbusdockentry dde-dock-entry-v1.xml - * - * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "dbusdockentry.h" - -/* - * Implementation of interface class DBusDockEntry - */ - -DBusDockEntry::DBusDockEntry(const QString &path, QObject *parent) - : QDBusAbstractInterface("com.deepin.dde.daemon.Dock", path, staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - qRegisterMetaType("WindowDict"); - qDBusRegisterMetaType(); - - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusDockEntry::~DBusDockEntry() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusdockentry.h dde-dock-4.6.3.1/frame/dbus/dbusdockentry.h --- dde-dock-4.5.9.1/frame/dbus/dbusdockentry.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusdockentry.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockEntry -p dbusdockentry dde-dock-entry-v1.xml - * - * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef DBUSDOCKENTRY_H_1464922075 -#define DBUSDOCKENTRY_H_1464922075 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -typedef QMap WindowDict; - -/* - * Proxy class for interface dde.dock.Entry - */ -class DBusDockEntry: public QDBusAbstractInterface -{ - Q_OBJECT - - Q_SLOT void __propertyChanged__(const QDBusMessage& msg) - { - QList arguments = msg.arguments(); - if (3 != arguments.count()) - return; - QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName !="com.deepin.dde.daemon.Dock.Entry") - return; - QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); - foreach(const QString &prop, changedProps.keys()) { - const QMetaObject* self = metaObject(); - for (int i=self->propertyOffset(); i < self->propertyCount(); ++i) { - QMetaProperty p = self->property(i); - if (p.name() == prop) { - Q_EMIT p.notifySignal().invoke(this); - } - } - } - } -public: - static inline const char *staticInterfaceName() - { return "com.deepin.dde.daemon.Dock.Entry"; } - -public: - explicit DBusDockEntry(const QString &path, QObject *parent = 0); - - ~DBusDockEntry(); - - Q_PROPERTY(bool IsActive READ active NOTIFY ActiveChanged) - inline bool active() const - { return qvariant_cast< bool >(property("IsActive")); } - - Q_PROPERTY(WindowDict WindowTitles READ titles NOTIFY TitlesChanged) - inline WindowDict titles() const - { return qvariant_cast< WindowDict >(property("WindowTitles")); } - - Q_PROPERTY(QString Id READ id NOTIFY IdChanged) - inline QString id() const - { return qvariant_cast< QString >(property("Id")); } - - Q_PROPERTY(QString Icon READ icon NOTIFY IconChanged) - inline QString icon() const - { return qvariant_cast< QString >(property("Icon")); } - - Q_PROPERTY(QString Menu READ menu NOTIFY MenuChanged) - inline QString menu() const - { return qvariant_cast< QString >(property("Menu")); } - - Q_PROPERTY(QString Name READ name NOTIFY NameChanged) - inline QString name() const - { return qvariant_cast< QString >(property("Name")); } - - Q_PROPERTY(quint32 CurrentWindow READ currentWindow NOTIFY CurrentWindowChanged) - inline quint32 currentWindow() const - { return qvariant_cast< quint32 >(property("CurrentWindow")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Activate() - { - QList argumentList; - - argumentList << QVariant::fromValue(quint32(QX11Info::getTimestamp())); - - return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList); - } - - inline QDBusPendingReply<> NewInstance() - { - QList argumentList; - - argumentList << QVariant::fromValue(quint32(QX11Info::getTimestamp())); - - return asyncCallWithArgumentList(QStringLiteral("NewInstance"), argumentList); - } - - inline QDBusPendingReply<> HandleMenuItem(const QString &item) - { - return asyncCall(QStringLiteral("HandleMenuItem"), QVariant::fromValue(quint32(QX11Info::getTimestamp())), item); - } - - inline QDBusPendingReply<> HandleDragDrop(const QStringList &uriList) - { - return asyncCall(QStringLiteral("HandleDragDrop"), QVariant::fromValue(quint32(QX11Info::getTimestamp())), QVariant::fromValue(uriList)); - } - - inline QDBusPendingReply<> RequestDock() - { - return asyncCall(QStringLiteral("RequestDock")); - } - - inline QDBusPendingReply<> Check() - { - return asyncCall(QStringLiteral("Check")); - } - - inline QDBusPendingReply<> RequestUndock() - { - return asyncCall(QStringLiteral("RequestUndock")); - } - - inline QDBusPendingReply<> PresentWindows() - { - return asyncCall(QStringLiteral("PresentWindows")); - } - -Q_SIGNALS: // SIGNALS -// begin property changed signals -void ActiveChanged(); -void TitlesChanged(); -void DataChanged(); -void IdChanged(); -void TitleChanged(); -void IconChanged(); -void MenuChanged(); -void NameChanged(); -void CurrentWindowChanged(); -}; - -namespace dde { - namespace dock { - typedef ::DBusDockEntry Entry; - } -} -#endif diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusmenu.cpp dde-dock-4.6.3.1/frame/dbus/dbusmenu.cpp --- dde-dock-4.5.9.1/frame/dbus/dbusmenu.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusmenu.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusmenu.h dde-dock-4.6.3.1/frame/dbus/dbusmenu.h --- dde-dock-4.5.9.1/frame/dbus/dbusmenu.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusmenu.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusmenumanager.cpp dde-dock-4.6.3.1/frame/dbus/dbusmenumanager.cpp --- dde-dock-4.5.9.1/frame/dbus/dbusmenumanager.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusmenumanager.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/dbus/dbusmenumanager.h dde-dock-4.6.3.1/frame/dbus/dbusmenumanager.h --- dde-dock-4.5.9.1/frame/dbus/dbusmenumanager.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/dbus/dbusmenumanager.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/environments.h.in dde-dock-4.6.3.1/frame/environments.h.in --- dde-dock-4.5.9.1/frame/environments.h.in 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/frame/environments.h.in 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef __ENVIRONMENTS_H_ +#define __ENVIRONMENTS_H_ + +#define VERSION "@VERSION@" + +#endif diff -Nru dde-dock-4.5.9.1/frame/frame.pro dde-dock-4.6.3.1/frame/frame.pro --- dde-dock-4.5.9.1/frame/frame.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/frame.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - -include(../interfaces/interfaces.pri) - -QT += core gui gui-private widgets dbus x11extras svg - -TARGET = dde-dock -DESTDIR = $$_PRO_FILE_PWD_/../ -TEMPLATE = app -CONFIG += c++11 link_pkgconfig - -PKGCONFIG += xcb-ewmh dtkwidget x11 -LIBS += -lgomp - -SOURCES += main.cpp \ - window/mainwindow.cpp \ - xcb/xcb_misc.cpp \ - item/dockitem.cpp \ - panel/mainpanel.cpp \ - controller/dockitemcontroller.cpp \ - dbus/dbusdockentry.cpp \ - dbus/dbusdisplay.cpp \ - item/appitem.cpp \ - util/docksettings.cpp \ - dbus/dbusclientmanager.cpp \ - dbus/dbusdock.cpp \ - util/themeappicon.cpp \ - item/launcheritem.cpp \ - dbus/dbusmenumanager.cpp \ - dbus/dbusmenu.cpp \ - item/pluginsitem.cpp \ - controller/dockpluginscontroller.cpp \ - util/imagefactory.cpp \ - util/dockpopupwindow.cpp \ - item/stretchitem.cpp \ - item/placeholderitem.cpp \ - controller/dockpluginloader.cpp \ - item/containeritem.cpp \ - item/components/containerwidget.cpp \ - dbus/dbusdockadaptors.cpp \ - item/components/appsnapshot.cpp \ - item/components/floatingpreview.cpp \ - item/components/previewcontainer.cpp - -HEADERS += \ - window/mainwindow.h \ - xcb/xcb_misc.h \ - item/dockitem.h \ - panel/mainpanel.h \ - controller/dockitemcontroller.h \ - dbus/dbusdockentry.h \ - dbus/dbusdisplay.h \ - item/appitem.h \ - util/docksettings.h \ - dbus/dbusclientmanager.h \ - dbus/dbusdock.h \ - util/themeappicon.h \ - item/launcheritem.h \ - dbus/dbusmenumanager.h \ - dbus/dbusmenu.h \ - item/pluginsitem.h \ - controller/dockpluginscontroller.h \ - util/imagefactory.h \ - util/dockpopupwindow.h \ - item/stretchitem.h \ - item/placeholderitem.h \ - controller/dockpluginloader.h \ - item/containeritem.h \ - item/components/containerwidget.h \ - dbus/dbusdockadaptors.h \ - item/components/appsnapshot.h \ - item/components/floatingpreview.h \ - item/components/previewcontainer.h - -dbus_service.files += com.deepin.dde.Dock.service -dbus_service.path = /usr/share/dbus-1/services - -headers.files += ../interfaces/constants.h \ - ../interfaces/pluginproxyinterface.h \ - ../interfaces/pluginsiteminterface.h -headers.path = /usr/include/dde-dock - -target.path = $${PREFIX}/bin/ -INSTALLS += target dbus_service headers - -RESOURCES += \ - item/resources.qrc diff -Nru dde-dock-4.5.9.1/frame/item/appitem.cpp dde-dock-4.6.3.1/frame/item/appitem.cpp --- dde-dock-4.5.9.1/frame/item/appitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/appitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -34,12 +34,71 @@ #include #include #include -#include #include +#include #define APP_DRAG_THRESHOLD 20 -const static qreal Frames[] = { 0, 0.327013, 0.987033, 1.77584, 2.61157, 3.45043, 4.26461, 5.03411, 5.74306, 6.37782, 6.92583, 7.37484, 7.71245, 7.92557, 8, 7.86164, 7.43184, 6.69344, 5.64142, 4.2916, 2.68986, 0.91694, -0.91694, -2.68986, -4.2916, -5.64142, -6.69344, -7.43184, -7.86164, -8, -7.86164, -7.43184, -6.69344, -5.64142, -4.2916, -2.68986, -0.91694, 0.91694, 2.68986, 4.2916, 5.64142, 6.69344, 7.43184, 7.86164, 8, 7.93082, 7.71592, 7.34672, 6.82071, 6.1458, 5.34493, 4.45847, 3.54153, 2.65507, 1.8542, 1.17929, 0.653279, 0.28408, 0.0691776, 0 }; +const static qreal Frames[] = { 0, + 0.327013, + 0.987033, + 1.77584, + 2.61157, + 3.45043, + 4.26461, + 5.03411, + 5.74306, + 6.37782, + 6.92583, + 7.37484, + 7.71245, + 7.92557, + 8, 7.86164, + 7.43184, + 6.69344, + 5.64142, + 4.2916, + 2.68986, + 0.91694, + -0.91694, + -2.68986, + -4.2916, + -5.64142, + -6.69344, + -7.43184, + -7.86164, + -8, + -7.86164, + -7.43184, + -6.69344, + -5.64142, + -4.2916, + -2.68986, + -0.91694, + 0.91694, + 2.68986, + 4.2916, + 5.64142, + 6.69344, + 7.43184, + 7.86164, + 8, + 7.93082, + 7.71592, + 7.34672, + 6.82071, + 6.1458, + 5.34493, + 4.45847, + 3.54153, + 2.65507, + 1.8542, + 1.17929, + 0.653279, + 0.28408, + 0.0691776, + 0, + }; int AppItem::IconBaseSize; QPoint AppItem::MousePressPos; @@ -48,12 +107,12 @@ : DockItem(parent), m_appNameTips(new QLabel(this)), m_appPreviewTips(new PreviewContainer(this)), - m_itemEntry(new DBusDockEntry(entry.path(), this)), + m_itemEntryInter(new DockEntryInter("com.deepin.dde.daemon.Dock", entry.path(), QDBusConnection::sessionBus(), this)), - m_itemView(new QGraphicsView(this)), + m_swingEffectView(new QGraphicsView(this)), m_itemScene(new QGraphicsScene(this)), - m_draging(false), + m_dragging(false), m_appIcon(QPixmap()), @@ -67,30 +126,29 @@ m_largeWatcher(new QFutureWatcher(this)) { QHBoxLayout *centralLayout = new QHBoxLayout; - centralLayout->addWidget(m_itemView); + centralLayout->addWidget(m_swingEffectView); centralLayout->setMargin(0); centralLayout->setSpacing(0); - setAccessibleName(m_itemEntry->name()); + setAccessibleName(m_itemEntryInter->name()); setAcceptDrops(true); -// setMouseTracking(true); setLayout(centralLayout); - m_itemView->setScene(m_itemScene); - m_itemView->setAlignment(Qt::AlignCenter); - m_itemView->setVisible(false); - m_itemView->setFrameStyle(QFrame::NoFrame); - m_itemView->setContentsMargins(0, 0, 0, 0); - m_itemView->setRenderHints(QPainter::SmoothPixmapTransform); - m_itemView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); - m_itemView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - m_itemView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_swingEffectView->setScene(m_itemScene); + m_swingEffectView->setAlignment(Qt::AlignCenter); + m_swingEffectView->setVisible(false); + m_swingEffectView->setFrameStyle(QFrame::NoFrame); + m_swingEffectView->setContentsMargins(0, 0, 0, 0); + m_swingEffectView->setRenderHints(QPainter::SmoothPixmapTransform); + m_swingEffectView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); + m_swingEffectView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_swingEffectView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - m_id = m_itemEntry->id(); - m_active = m_itemEntry->active(); + m_id = m_itemEntryInter->id(); + m_active = m_itemEntryInter->isActive(); - m_appNameTips->setObjectName(m_itemEntry->name()); - m_appNameTips->setAccessibleName(m_itemEntry->name() + "-tips"); + m_appNameTips->setObjectName(m_itemEntryInter->name()); + m_appNameTips->setAccessibleName(m_itemEntryInter->name() + "-tips"); m_appNameTips->setVisible(false); m_appNameTips->setStyleSheet("color:white;" "padding:0px 3px;"); @@ -100,24 +158,26 @@ m_appPreviewTips->setVisible(false); - connect(m_itemEntry, &DBusDockEntry::ActiveChanged, this, &AppItem::activeChanged); - connect(m_itemEntry, &DBusDockEntry::TitlesChanged, this, &AppItem::updateTitle, Qt::QueuedConnection); - connect(m_itemEntry, &DBusDockEntry::IconChanged, this, &AppItem::refershIcon); - connect(m_itemEntry, &DBusDockEntry::ActiveChanged, this, static_cast(&AppItem::update)); + connect(m_itemEntryInter, &DockEntryInter::IsActiveChanged, this, &AppItem::activeChanged); + connect(m_itemEntryInter, &DockEntryInter::IsActiveChanged, this, static_cast(&AppItem::update)); + connect(m_itemEntryInter, &DockEntryInter::WindowInfosChanged, this, &AppItem::updateWindowInfos, Qt::QueuedConnection); + connect(m_itemEntryInter, &DockEntryInter::IconChanged, this, &AppItem::refershIcon); connect(m_updateIconGeometryTimer, &QTimer::timeout, this, &AppItem::updateWindowIconGeometries, Qt::QueuedConnection); connect(m_appPreviewTips, &PreviewContainer::requestActivateWindow, this, &AppItem::requestActivateWindow, Qt::QueuedConnection); connect(m_appPreviewTips, &PreviewContainer::requestPreviewWindow, this, &AppItem::requestPreviewWindow, Qt::QueuedConnection); connect(m_appPreviewTips, &PreviewContainer::requestCancelAndHidePreview, this, &AppItem::cancelAndHidePreview); - connect(m_appPreviewTips, &PreviewContainer::requestCheckWindows, m_itemEntry, &DBusDockEntry::Check); + connect(m_appPreviewTips, &PreviewContainer::requestCheckWindows, m_itemEntryInter, &DockEntryInter::Check); - updateTitle(); + updateWindowInfos(m_itemEntryInter->windowInfos()); refershIcon(); } AppItem::~AppItem() { + stopSwingEffect(); + m_appNameTips->deleteLater(); m_appPreviewTips->deleteLater(); } @@ -136,7 +196,7 @@ mapToGlobal(QPoint(width(),height()))); auto *xcb_misc = XcbMisc::instance(); - for (auto it(m_titles.cbegin()); it != m_titles.cend(); ++it) + for (auto it(m_windowInfos.cbegin()); it != m_windowInfos.cend(); ++it) xcb_misc->set_window_icon_geometry(it.key(), r); } @@ -177,7 +237,7 @@ { DockItem::paintEvent(e); - if (m_draging || m_itemView->isVisible()) + if (m_dragging || (m_swingEffectView->isVisible() && DockDisplayMode != Fashion)) return; QPainter painter(this); @@ -190,23 +250,11 @@ // draw background QRectF backgroundRect = itemRect; - if (DockDisplayMode == Efficient) - { - switch (DockPosition) - { - case Top: - case Bottom: -// backgroundRect = itemRect;//.marginsRemoved(QMargins(2, 0, 2, 0)); -// backgroundRect = itemRect.marginsRemoved(QMargins(0, 1, 0, 1)); - case Left: - case Right: - backgroundRect = itemRect.marginsRemoved(QMargins(1, 1, 1, 1)); -// backgroundRect = itemRect.marginsRemoved(QMargins(1, 0, 1, 0)); - } - } if (DockDisplayMode == Efficient) { + backgroundRect = itemRect.marginsRemoved(QMargins(1, 1, 1, 1)); + if (m_active) { painter.fillRect(backgroundRect, QColor(44, 167, 248, 255 * 0.3)); @@ -223,14 +271,17 @@ painter.fillRect(activeRect, QColor(44, 167, 248, 255)); } - else if (!m_titles.isEmpty()) - painter.fillRect(backgroundRect, QColor(255, 255, 255, 255 * 0.2)); - // else - // painter.fillRect(backgroundRect, Qt::gray); + else if (!m_windowInfos.isEmpty()) + { + if (hasAttention()) + painter.fillRect(backgroundRect, QColor(241, 138, 46, 255 * .8)); + else + painter.fillRect(backgroundRect, QColor(255, 255, 255, 255 * 0.2)); + } } else { - if (!m_titles.isEmpty()) + if (!m_windowInfos.isEmpty()) { QPoint p; QPixmap pixmap; @@ -270,6 +321,9 @@ } } + if (m_swingEffectView->isVisible()) + return; + // icon const QPixmap &pixmap = m_appIcon; if (pixmap.isNull()) @@ -280,65 +334,20 @@ const int iconX = itemRect.center().x() - pixmap.rect().center().x() / ratio; const int iconY = itemRect.center().y() - pixmap.rect().center().y() / ratio; - // draw ligher/normal icon - if (!m_hover) - painter.drawPixmap(iconX, iconY, pixmap); - else - painter.drawPixmap(iconX, iconY, ImageFactory::lighterEffect(pixmap)); + painter.drawPixmap(iconX, iconY, pixmap); } void AppItem::mouseReleaseEvent(QMouseEvent *e) { if (e->button() == Qt::MiddleButton) { - m_itemEntry->NewInstance(); + m_itemEntryInter->NewInstance(QX11Info::getTimestamp()); } else if (e->button() == Qt::LeftButton) { - m_itemEntry->Activate(); - - if (!m_titles.isEmpty()) - return; - - // start launching effects - m_itemScene->clear(); - const auto ratio = qApp->devicePixelRatio(); - const QRect r = rect(); - const QPixmap &icon = m_appIcon; - QGraphicsPixmapItem *item = m_itemScene->addPixmap(icon); - item->setTransformationMode(Qt::SmoothTransformation); - item->setPos(QPointF(r.center()) - QPointF(icon.rect().center()) / ratio); - m_itemScene->setSceneRect(r); - m_itemView->setSceneRect(r); - m_itemView->setFixedSize(r.size()); -// m_itemView->setSceneRect((r.width() - icon.width()) / 2, (r.height() - icon.height()) / 2, r.width(), r.height()); + m_itemEntryInter->Activate(QX11Info::getTimestamp()); - QTimeLine *tl = new QTimeLine; - tl->setDuration(1200); - tl->setFrameRange(0, 60); - tl->setLoopCount(1); - tl->setEasingCurve(QEasingCurve::Linear); - tl->setStartFrame(0); - tl->start(); - - QGraphicsItemAnimation *ani = new QGraphicsItemAnimation; - ani->setItem(item); - ani->setTimeLine(tl); - - const int px = qreal(-icon.rect().center().x()) / ratio; - const int py = qreal(-icon.rect().center().y()) / ratio - 18.; - const QPoint pos = r.center() + QPoint(0, 18); - for (int i(0); i != 60; ++i) - { - ani->setPosAt(i / 60.0, pos); - ani->setTranslationAt(i / 60.0, px, py); - ani->setRotationAt(i / 60.0, Frames[i]); - } - - connect(tl, &QTimeLine::finished, tl, &QTimeLine::deleteLater); - connect(tl, &QTimeLine::finished, ani, &QGraphicsItemAnimation::deleteLater); - connect(tl, &QTimeLine::finished, m_itemScene, &QGraphicsScene::clear); - connect(tl, &QTimeLine::finished, m_itemView, &QGraphicsView::hide); - - m_itemView->setVisible(true); + // play launch effect + if (m_windowInfos.isEmpty()) + playSwingEffect(); } } @@ -387,7 +396,7 @@ { QWidget::wheelEvent(e); - m_itemEntry->PresentWindows(); + m_itemEntryInter->PresentWindows(); } void AppItem::resizeEvent(QResizeEvent *e) @@ -414,7 +423,7 @@ { DockItem::dragMoveEvent(e); - if (m_titles.isEmpty()) + if (m_windowInfos.isEmpty()) return; if (!PopupWindow->isVisible() || PopupWindow->getContent() != m_appPreviewTips) @@ -429,7 +438,7 @@ } qDebug() << "accept drop event with URIs: " << uriList; - m_itemEntry->HandleDragDrop(uriList); + m_itemEntryInter->HandleDragDrop(QX11Info::getTimestamp(), uriList); } void AppItem::leaveEvent(QEvent *e) @@ -442,7 +451,7 @@ void AppItem::showHoverTips() { - if (!m_titles.isEmpty()) + if (!m_windowInfos.isEmpty()) return showPreview(); DockItem::showHoverTips(); @@ -452,26 +461,26 @@ { Q_UNUSED(checked); - m_itemEntry->HandleMenuItem(itemId); + m_itemEntryInter->HandleMenuItem(QX11Info::getTimestamp(), itemId); } const QString AppItem::contextMenu() const { - return m_itemEntry->menu(); + return m_itemEntryInter->menu(); } QWidget *AppItem::popupTips() { - if (m_draging) + if (m_dragging) return nullptr; - if (!m_titles.isEmpty()) + if (!m_windowInfos.isEmpty()) { - const quint32 currentWindow = m_itemEntry->currentWindow(); - Q_ASSERT(m_titles.contains(currentWindow)); - m_appNameTips->setText(m_titles[currentWindow]); + const quint32 currentWindow = m_itemEntryInter->currentWindow(); + Q_ASSERT(m_windowInfos.contains(currentWindow)); + m_appNameTips->setText(m_windowInfos[currentWindow].title); } else { - m_appNameTips->setText(m_itemEntry->name()); + m_appNameTips->setText(m_itemEntryInter->name()); } return m_appNameTips; @@ -479,7 +488,7 @@ void AppItem::startDrag() { - m_draging = true; + m_dragging = true; update(); const QPixmap &dragPix = m_appIcon; @@ -495,25 +504,42 @@ // drag out of dock panel if (!drag->target()) - m_itemEntry->RequestUndock(); + m_itemEntryInter->RequestUndock(); - m_draging = false; + m_dragging = false; setVisible(true); update(); } -void AppItem::updateTitle() +bool AppItem::hasAttention() const +{ + for (const auto &info : m_windowInfos) + if (info.attention) + return true; + return false; +} + +void AppItem::updateWindowInfos(const WindowInfoMap &info) { - m_titles = m_itemEntry->titles(); - m_appPreviewTips->setWindowInfos(m_titles); + m_windowInfos = info; + m_appPreviewTips->setWindowInfos(m_windowInfos); m_updateIconGeometryTimer->start(); + // process attention effect + if (hasAttention()) + { + if (DockDisplayMode == DisplayMode::Fashion) + playSwingEffect(); + } else { + stopSwingEffect(); + } + update(); } void AppItem::refershIcon() { - const QString icon = m_itemEntry->icon(); + const QString icon = m_itemEntryInter->icon(); const int iconSize = qMin(width(), height()); if (DockDisplayMode == Efficient) @@ -533,7 +559,7 @@ void AppItem::showPreview() { - if (m_titles.isEmpty()) + if (m_windowInfos.isEmpty()) return; // test cursor position @@ -549,11 +575,11 @@ // default: return; // } - m_appPreviewTips->setWindowInfos(m_titles); + showPopupWindow(m_appPreviewTips, true); + + m_appPreviewTips->setWindowInfos(m_windowInfos); m_appPreviewTips->updateSnapshots(); m_appPreviewTips->updateLayoutDirection(DockPosition); - - showPopupWindow(m_appPreviewTips, true); } void AppItem::cancelAndHidePreview() @@ -562,3 +588,71 @@ emit requestCancelPreview(); } +void AppItem::playSwingEffect() +{ + // NOTE(sbw): return if animation view already playing + if (m_swingEffectView->isVisible()) + return; + + stopSwingEffect(); + if (!m_itemAnimation.timeLine()) + { + QTimeLine *tl = new QTimeLine(1200, this); + tl->setFrameRange(0, 60); + tl->setLoopCount(1); + tl->setEasingCurve(QEasingCurve::Linear); + tl->setStartFrame(0); + + m_itemAnimation.setTimeLine(tl); + } + + const auto ratio = qApp->devicePixelRatio(); + const QRect r = rect(); + const QPixmap &icon = m_appIcon; + + QGraphicsPixmapItem *item = m_itemScene->addPixmap(icon); + item->setTransformationMode(Qt::SmoothTransformation); + item->setPos(QPointF(r.center()) - QPointF(icon.rect().center()) / ratio); + + m_itemAnimation.setItem(item); + m_itemScene->setSceneRect(r); + m_swingEffectView->setSceneRect(r); + m_swingEffectView->setFixedSize(r.size()); + + const int px = qreal(-icon.rect().center().x()) / ratio; + const int py = qreal(-icon.rect().center().y()) / ratio - 18.; + const QPoint pos = r.center() + QPoint(0, 18); + for (int i(0); i != 60; ++i) + { + m_itemAnimation.setPosAt(i / 60.0, pos); + m_itemAnimation.setTranslationAt(i / 60.0, px, py); + m_itemAnimation.setRotationAt(i / 60.0, Frames[i]); + } + + QTimeLine *tl = m_itemAnimation.timeLine(); + connect(tl, &QTimeLine::finished, m_swingEffectView, &QGraphicsView::hide); + connect(tl, &QTimeLine::finished, this, &AppItem::checkAttentionEffect); + + tl->start(); + m_swingEffectView->setVisible(true); +} + +void AppItem::stopSwingEffect() +{ + // stop swing effect + m_swingEffectView->setVisible(false); + + if (m_itemAnimation.timeLine()) + m_itemAnimation.timeLine()->stop(); + m_itemAnimation.clear(); + m_itemScene->clear(); +} + +void AppItem::checkAttentionEffect() +{ + QTimer::singleShot(1000, this, [=] { + if (DockDisplayMode == DisplayMode::Fashion && hasAttention()) + playSwingEffect(); + }); +} + diff -Nru dde-dock-4.5.9.1/frame/item/appitem.h dde-dock-4.6.3.1/frame/item/appitem.h --- dde-dock-4.5.9.1/frame/item/appitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/appitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -24,11 +24,15 @@ #include "dockitem.h" #include "components/previewcontainer.h" -#include "dbus/dbusdockentry.h" #include "dbus/dbusclientmanager.h" #include #include +#include + +#include + +using DockEntryInter = com::deepin::dde::daemon::dock::Entry; class AppItem : public DockItem { @@ -71,25 +75,30 @@ QWidget *popupTips(); void startDrag(); + bool hasAttention() const; private slots: - void updateTitle(); + void updateWindowInfos(const WindowInfoMap &info); void refershIcon(); void activeChanged(); void showPreview(); void cancelAndHidePreview(); + void playSwingEffect(); + void stopSwingEffect(); + void checkAttentionEffect(); private: QLabel *m_appNameTips; PreviewContainer *m_appPreviewTips; - DBusDockEntry *m_itemEntry; + DockEntryInter *m_itemEntryInter; - QGraphicsView *m_itemView; + QGraphicsView *m_swingEffectView; QGraphicsScene *m_itemScene; + QGraphicsItemAnimation m_itemAnimation; - bool m_draging; + bool m_dragging; bool m_active; - WindowDict m_titles; + WindowInfoMap m_windowInfos; QString m_id; QPixmap m_appIcon; QPixmap m_horizontalIndicator; diff -Nru dde-dock-4.5.9.1/frame/item/components/appsnapshot.cpp dde-dock-4.6.3.1/frame/item/components/appsnapshot.cpp --- dde-dock-4.5.9.1/frame/item/components/appsnapshot.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/appsnapshot.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -46,6 +46,7 @@ m_closeBtn->setHoverPic(":/icons/resources/close_round_hover.svg"); m_closeBtn->setPressPic(":/icons/resources/close_round_press.svg"); m_closeBtn->setVisible(false); + m_title->setStyleSheet("color: white;"); QHBoxLayout *centralLayout = new QHBoxLayout; centralLayout->addWidget(m_title); @@ -86,12 +87,15 @@ const bool composite = m_wmHelper->hasComposite(); m_title->setVisible(!composite); -// m_closeBtn->setVisible(!composite); + + QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot); } -void AppSnapshot::setWindowTitle(const QString &title) +void AppSnapshot::setWindowInfo(const WindowInfo &info) { - m_title->setText(title); + m_windowInfo = info; + + m_title->setText(m_windowInfo.title); } void AppSnapshot::dragEnterEvent(QDragEnterEvent *e) @@ -180,6 +184,7 @@ QWidget::paintEvent(e); QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); if (!m_wmHelper->hasComposite()) { @@ -194,9 +199,15 @@ const QRect r = rect().marginsRemoved(QMargins(8, 8, 8, 8)); const auto ratio = devicePixelRatioF(); + // draw attention background + if (m_windowInfo.attention) + { + painter.setBrush(QColor(241, 138, 46, 255 * .8)); + painter.setPen(Qt::NoPen); + painter.drawRoundedRect(rect(), 5, 5); + } + // draw image -// QImage im = m_snapshot.scaled(r.size() * ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation); -// im.setDevicePixelRatio(ratio); const QImage &im = m_snapshot; const QRect ir = im.rect(); @@ -205,6 +216,13 @@ painter.drawImage(offset_x, offset_y, im); } +void AppSnapshot::resizeEvent(QResizeEvent *e) +{ + QWidget::resizeEvent(e); + + QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot); +} + void AppSnapshot::mousePressEvent(QMouseEvent *e) { QWidget::mousePressEvent(e); diff -Nru dde-dock-4.5.9.1/frame/item/components/appsnapshot.h dde-dock-4.6.3.1/frame/item/components/appsnapshot.h --- dde-dock-4.5.9.1/frame/item/components/appsnapshot.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/appsnapshot.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -30,6 +30,8 @@ #include #include +#include + DWIDGET_USE_NAMESPACE #define SNAP_WIDTH 200 @@ -43,8 +45,9 @@ explicit AppSnapshot(const WId wid, QWidget *parent = 0); WId wid() const { return m_wid; } + bool attentioned() const { return m_windowInfo.attention; } const QImage snapshot() const { return m_snapshot; } - const QString title() const { return m_title->text(); } + const QString title() const { return m_windowInfo.title; } signals: void entered(const WId wid) const; @@ -55,18 +58,20 @@ void fetchSnapshot(); void closeWindow() const; void compositeChanged() const; - void setWindowTitle(const QString &title); + void setWindowInfo(const WindowInfo &info); private: void dragEnterEvent(QDragEnterEvent *e); void enterEvent(QEvent *e); void leaveEvent(QEvent *e); void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); void mousePressEvent(QMouseEvent *e); private: const WId m_wid; + WindowInfo m_windowInfo; QImage m_snapshot; QLabel *m_title; DImageButton *m_closeBtn; diff -Nru dde-dock-4.5.9.1/frame/item/components/containerwidget.cpp dde-dock-4.6.3.1/frame/item/components/containerwidget.cpp --- dde-dock-4.5.9.1/frame/item/components/containerwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/containerwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/components/containerwidget.h dde-dock-4.6.3.1/frame/item/components/containerwidget.h --- dde-dock-4.5.9.1/frame/item/components/containerwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/containerwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/components/floatingpreview.cpp dde-dock-4.6.3.1/frame/item/components/floatingpreview.cpp --- dde-dock-4.5.9.1/frame/item/components/floatingpreview.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/floatingpreview.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/components/floatingpreview.h dde-dock-4.6.3.1/frame/item/components/floatingpreview.h --- dde-dock-4.5.9.1/frame/item/components/floatingpreview.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/floatingpreview.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/components/hoverhighlighteffect.cpp dde-dock-4.6.3.1/frame/item/components/hoverhighlighteffect.cpp --- dde-dock-4.5.9.1/frame/item/components/hoverhighlighteffect.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/hoverhighlighteffect.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "hoverhighlighteffect.h" +#include "util/imagefactory.h" + +#include +#include + +HoverHighlightEffect::HoverHighlightEffect(QObject *parent) + : QGraphicsEffect(parent) + + , m_highlighting(false) +{ + +} + +void HoverHighlightEffect::draw(QPainter *painter) +{ + const QPixmap pix = sourcePixmap(Qt::DeviceCoordinates); + + if (m_highlighting) + { + painter->drawPixmap(0, 0, ImageFactory::lighterEffect(pix)); + } else { + painter->drawPixmap(0, 0, pix); + } +} diff -Nru dde-dock-4.5.9.1/frame/item/components/hoverhighlighteffect.h dde-dock-4.6.3.1/frame/item/components/hoverhighlighteffect.h --- dde-dock-4.5.9.1/frame/item/components/hoverhighlighteffect.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/hoverhighlighteffect.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef HOVERHIGHLIGHTEFFECT_H +#define HOVERHIGHLIGHTEFFECT_H + +#include + +class HoverHighlightEffect : public QGraphicsEffect +{ + Q_OBJECT + +public: + explicit HoverHighlightEffect(QObject *parent = nullptr); + + void setHighlighting(const bool highlighting) { m_highlighting = highlighting; } + +protected: + void draw(QPainter *painter); + +private: + bool m_highlighting; +}; + +#endif // HOVERHIGHLIGHTEFFECT_H diff -Nru dde-dock-4.5.9.1/frame/item/components/previewcontainer.cpp dde-dock-4.6.3.1/frame/item/components/previewcontainer.cpp --- dde-dock-4.5.9.1/frame/item/components/previewcontainer.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/previewcontainer.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -55,7 +55,7 @@ connect(m_floatingPreview, &FloatingPreview::requestMove, this, &PreviewContainer::moveFloatingPreview); } -void PreviewContainer::setWindowInfos(const WindowDict &infos) +void PreviewContainer::setWindowInfos(const WindowInfoMap &infos) { // check removed window for (auto it(m_snapshots.begin()); it != m_snapshots.end();) @@ -74,7 +74,7 @@ { if (!m_snapshots.contains(it.key())) appendSnapWidget(it.key()); - m_snapshots[it.key()]->setWindowTitle(it.value()); + m_snapshots[it.key()]->setWindowInfo(it.value()); } if (m_snapshots.isEmpty()) @@ -165,6 +165,10 @@ m_windowListLayout->addWidget(snap); m_snapshots.insert(wid, snap); + + // refresh if visible + if (isVisible()) + snap->fetchSnapshot(); } void PreviewContainer::enterEvent(QEvent *e) @@ -184,6 +188,9 @@ void PreviewContainer::dragEnterEvent(QDragEnterEvent *e) { + if (!m_wmHelper->hasComposite()) + return; + e->accept(); m_needActivate = false; diff -Nru dde-dock-4.5.9.1/frame/item/components/previewcontainer.h dde-dock-4.6.3.1/frame/item/components/previewcontainer.h --- dde-dock-4.5.9.1/frame/item/components/previewcontainer.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/components/previewcontainer.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -26,11 +26,12 @@ #include #include -#include "dbus/dbusdockentry.h" #include "constants.h" #include "appsnapshot.h" #include "floatingpreview.h" +#include + #include DWIDGET_USE_NAMESPACE @@ -49,7 +50,7 @@ void requestCancelAndHidePreview() const; public: - void setWindowInfos(const WindowDict &infos); + void setWindowInfos(const WindowInfoMap &infos); void updateSnapshots(); public slots: diff -Nru dde-dock-4.5.9.1/frame/item/containeritem.cpp dde-dock-4.6.3.1/frame/item/containeritem.cpp --- dde-dock-4.5.9.1/frame/item/containeritem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/containeritem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -32,6 +32,10 @@ m_containerWidget->setVisible(false); m_popupTips->setText(tr("Click to display hidden icon")); m_popupTips->setVisible(false); + m_popupTips->setStyleSheet("QLabel {" + "color: white;" + "margin: 2px 4px;" + "}"); setAcceptDrops(true); } @@ -40,8 +44,8 @@ { if (dropping) showPopupApplet(m_containerWidget); - else - hidePopup(); +// else +// hidePopup(); m_dropping = dropping; update(); diff -Nru dde-dock-4.5.9.1/frame/item/containeritem.h dde-dock-4.6.3.1/frame/item/containeritem.h --- dde-dock-4.5.9.1/frame/item/containeritem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/containeritem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/dockitem.cpp dde-dock-4.6.3.1/frame/item/dockitem.cpp --- dde-dock-4.5.9.1/frame/item/dockitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/dockitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -22,6 +22,7 @@ #include "dockitem.h" #include "dbus/dbusmenu.h" #include "dbus/dbusmenumanager.h" +#include "components/hoverhighlighteffect.h" #include #include @@ -35,6 +36,8 @@ m_hover(false), m_popupShown(false), + m_hoverEffect(new HoverHighlightEffect(this)), + m_popupTipsDelayTimer(new QTimer(this)), m_popupAdjustDelayTimer(new QTimer(this)), @@ -55,11 +58,13 @@ m_popupTipsDelayTimer->setInterval(500); m_popupTipsDelayTimer->setSingleShot(true); - m_popupAdjustDelayTimer->setInterval(100); + m_popupAdjustDelayTimer->setInterval(10); m_popupAdjustDelayTimer->setSingleShot(true); + setGraphicsEffect(m_hoverEffect); + connect(m_popupTipsDelayTimer, &QTimer::timeout, this, &DockItem::showHoverTips); - connect(m_popupAdjustDelayTimer, &QTimer::timeout, this, &DockItem::updatePopupPosition); + connect(m_popupAdjustDelayTimer, &QTimer::timeout, this, &DockItem::updatePopupPosition, Qt::QueuedConnection); } DockItem::~DockItem() @@ -78,13 +83,33 @@ DockDisplayMode = mode; } +bool DockItem::event(QEvent *event) +{ + if (m_popupShown) + { + switch (event->type()) + { + case QEvent::Paint: + if (!m_popupAdjustDelayTimer->isActive()) + m_popupAdjustDelayTimer->start(); + break; + default:; + } + } + + return QWidget::event(event); +} + void DockItem::updatePopupPosition() { Q_ASSERT(sender() == m_popupAdjustDelayTimer); - if (!m_popupShown || !PopupWindow->isVisible()) + if (!m_popupShown || !PopupWindow->model()) return; + if (PopupWindow->getContent() != m_lastPopupWidget.data()) + return popupWindowAccept(); + const QPoint p = popupMarkPoint(); PopupWindow->show(p, PopupWindow->model()); } @@ -94,13 +119,6 @@ QWidget::paintEvent(e); } -void DockItem::moveEvent(QMoveEvent *e) -{ - QWidget::moveEvent(e); - - m_popupAdjustDelayTimer->start(); -} - void DockItem::mousePressEvent(QMouseEvent *e) { m_popupTipsDelayTimer->stop(); @@ -113,6 +131,7 @@ void DockItem::enterEvent(QEvent *e) { m_hover = true; + m_hoverEffect->setHighlighting(true); m_popupTipsDelayTimer->start(); update(); @@ -125,6 +144,7 @@ QWidget::leaveEvent(e); m_hover = false; + m_hoverEffect->setHighlighting(false); m_popupTipsDelayTimer->stop(); // auto hide if popup is not model window @@ -182,11 +202,8 @@ DBusMenu *menuInter = new DBusMenu(path.path(), this); connect(menuInter, &DBusMenu::ItemInvoked, this, &DockItem::invokedMenuItem); - connect(menuInter, &DBusMenu::MenuUnregistered, this, [=] { - emit requestRefershWindowVisible(); - emit requestWindowAutoHide(true); - menuInter->deleteLater(); - }); + connect(menuInter, &DBusMenu::ItemInvoked, menuInter, &DBusMenu::deleteLater); + connect(menuInter, &DBusMenu::MenuUnregistered, this, &DockItem::onContextMenuAccepted, Qt::QueuedConnection); menuInter->ShowMenu(QString(QJsonDocument(menuObject).toJson())); @@ -194,10 +211,16 @@ emit requestWindowAutoHide(false); } +void DockItem::onContextMenuAccepted() +{ + emit requestRefershWindowVisible(); + emit requestWindowAutoHide(true); +} + void DockItem::showHoverTips() { // another model popup window is alread exists - if (PopupWindow->isVisible() && PopupWindow->model()) + if (PopupWindow->model()) return; // if not in geometry area @@ -215,6 +238,7 @@ void DockItem::showPopupWindow(QWidget * const content, const bool model) { m_popupShown = true; + m_lastPopupWidget = content; if (model) emit requestWindowAutoHide(false); @@ -256,7 +280,7 @@ void DockItem::showPopupApplet(QWidget * const applet) { // another model popup window is alread exists - if (PopupWindow->isVisible() && PopupWindow->model()) + if (PopupWindow->model()) return; showPopupWindow(applet, true); @@ -310,6 +334,7 @@ void DockItem::hidePopup() { m_popupTipsDelayTimer->stop(); + m_popupAdjustDelayTimer->stop(); m_popupShown = false; PopupWindow->hide(); diff -Nru dde-dock-4.5.9.1/frame/item/dockitem.h dde-dock-4.6.3.1/frame/item/dockitem.h --- dde-dock-4.5.9.1/frame/item/dockitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/dockitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -24,8 +24,10 @@ #include "constants.h" #include "util/dockpopupwindow.h" +#include "components/hoverhighlighteffect.h" #include +#include #include @@ -65,8 +67,8 @@ void requestRefershWindowVisible() const; protected: + bool event(QEvent *event); void paintEvent(QPaintEvent *e); - void moveEvent(QMoveEvent *e); void mousePressEvent(QMouseEvent *e); void enterEvent(QEvent *e); void leaveEvent(QEvent *e); @@ -87,6 +89,7 @@ protected slots: void showContextMenu(); + void onContextMenuAccepted(); private: void updatePopupPosition(); @@ -95,6 +98,9 @@ bool m_hover; bool m_popupShown; + QPointer m_lastPopupWidget; + QPointer m_hoverEffect; + QTimer *m_popupTipsDelayTimer; QTimer *m_popupAdjustDelayTimer; diff -Nru dde-dock-4.5.9.1/frame/item/launcheritem.cpp dde-dock-4.6.3.1/frame/item/launcheritem.cpp --- dde-dock-4.5.9.1/frame/item/launcheritem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/launcheritem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -70,11 +70,7 @@ const int iconX = rect().center().x() - pixmap.rect().center().x() / ratio; const int iconY = rect().center().y() - pixmap.rect().center().y() / ratio; - // draw ligher/normal icon - if (!m_hover) - painter.drawPixmap(iconX, iconY, pixmap); - else - painter.drawPixmap(iconX, iconY, ImageFactory::lighterEffect(pixmap)); + painter.drawPixmap(iconX, iconY, pixmap); } void LauncherItem::resizeEvent(QResizeEvent *e) diff -Nru dde-dock-4.5.9.1/frame/item/launcheritem.h dde-dock-4.6.3.1/frame/item/launcheritem.h --- dde-dock-4.5.9.1/frame/item/launcheritem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/launcheritem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/placeholderitem.cpp dde-dock-4.6.3.1/frame/item/placeholderitem.cpp --- dde-dock-4.5.9.1/frame/item/placeholderitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/placeholderitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/placeholderitem.h dde-dock-4.6.3.1/frame/item/placeholderitem.h --- dde-dock-4.5.9.1/frame/item/placeholderitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/placeholderitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/item/pluginsitem.cpp dde-dock-4.6.3.1/frame/item/pluginsitem.cpp --- dde-dock-4.5.9.1/frame/item/pluginsitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/pluginsitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -40,7 +40,7 @@ m_pluginInter(pluginInter), m_centralWidget(m_pluginInter->itemWidget(itemKey)), m_itemKey(itemKey), - m_draging(false) + m_dragging(false) { qDebug() << "load plugins item: " << pluginInter->pluginName() << itemKey << m_centralWidget; @@ -153,7 +153,7 @@ bool PluginsItem::eventFilter(QObject *o, QEvent *e) { - if (m_draging) + if (m_dragging) if (o == m_centralWidget && e->type() == QEvent::Paint) return true; @@ -187,7 +187,7 @@ { const QPixmap pixmap = grab(); - m_draging = true; + m_dragging = true; update(); QMimeData *mime = new QMimeData; @@ -203,7 +203,7 @@ Q_UNUSED(result); emit itemDropped(drag->target()); - m_draging = false; + m_dragging = false; setVisible(true); update(); } diff -Nru dde-dock-4.5.9.1/frame/item/pluginsitem.h dde-dock-4.6.3.1/frame/item/pluginsitem.h --- dde-dock-4.5.9.1/frame/item/pluginsitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/pluginsitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -69,7 +69,7 @@ PluginsItemInterface * const m_pluginInter; QWidget *m_centralWidget; const QString m_itemKey; - bool m_draging; + bool m_dragging; static QPoint MousePressPoint; }; diff -Nru dde-dock-4.5.9.1/frame/item/stretchitem.cpp dde-dock-4.6.3.1/frame/item/stretchitem.cpp --- dde-dock-4.5.9.1/frame/item/stretchitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/stretchitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -27,6 +27,7 @@ : DockItem(parent) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setMinimumSize(0, 0); } void StretchItem::mousePressEvent(QMouseEvent *e) diff -Nru dde-dock-4.5.9.1/frame/item/stretchitem.h dde-dock-4.6.3.1/frame/item/stretchitem.h --- dde-dock-4.5.9.1/frame/item/stretchitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/item/stretchitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/main.cpp dde-dock-4.6.3.1/frame/main.cpp --- dde-dock-4.5.9.1/frame/main.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/main.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -85,7 +85,7 @@ RegisterDdeSession(); - QTimer::singleShot(500, &mw, &MainWindow::launch); + QTimer::singleShot(1, &mw, &MainWindow::launch); return app.exec(); } diff -Nru dde-dock-4.5.9.1/frame/panel/mainpanel.cpp dde-dock-4.6.3.1/frame/panel/mainpanel.cpp --- dde-dock-4.5.9.1/frame/panel/mainpanel.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/panel/mainpanel.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -25,63 +25,36 @@ #include #include -DockItem *MainPanel::DragingItem = nullptr; +DockItem *MainPanel::DraggingItem = nullptr; PlaceholderItem *MainPanel::RequestDockItem = nullptr; const char *RequestDockKey = "RequestDock"; MainPanel::MainPanel(QWidget *parent) - : QFrame(parent), + : DBlurEffectWidget(parent), m_position(Dock::Top), m_displayMode(Dock::Fashion), m_itemLayout(new QBoxLayout(QBoxLayout::LeftToRight)), m_itemAdjustTimer(new QTimer(this)), - m_itemController(DockItemController::instance(this)), - - m_effectWidget(new DBlurEffectWidget(this)), - m_wmHelper(DWindowManagerHelper::instance()) + m_itemController(DockItemController::instance(this)) { m_itemLayout->setSpacing(0); m_itemLayout->setContentsMargins(0, 0, 0, 0); - m_effectWidget->setBlurRectXRadius(0); - m_effectWidget->setBlurRectYRadius(0); - m_effectWidget->setMaskColor(DBlurEffectWidget::DarkColor); - m_effectWidget->setBlendMode(DBlurEffectWidget::BehindWindowBlend); - m_effectWidget->setDisabled(true); - m_effectWidget->move(0, 0); + setBlurRectXRadius(0); + setBlurRectYRadius(0); + setBlendMode(BehindWindowBlend); setAcceptDrops(true); setAccessibleName("dock-mainpanel"); setObjectName("MainPanel"); setStyleSheet("QWidget #MainPanel {" -// "border:" xstr(PANEL_BORDER) "px solid rgba(162, 162, 162, .2);" // "background-color:rgba(10, 10, 10, .6);" "}" - "QWidget #MainPanel[displayMode='1'] {" - "border:none;" - "}" - // Top - "QWidget #MainPanel[displayMode='0'][position='0'] {" -// "border-bottom-left-radius:5px;" -// "border-bottom-right-radius:5px;" - "}" - // Right - "QWidget #MainPanel[displayMode='0'][position='1'] {" -// "border-top-left-radius:5px;" -// "border-bottom-left-radius:5px;" - "}" - // Bottom - "QWidget #MainPanel[displayMode='0'][position='2'] {" -// "border-top-left-radius:6px;" -// "border-top-right-radius:6px;" - "}" - // Left - "QWidget #MainPanel[displayMode='0'][position='3'] {" -// "border-top-right-radius:5px;" -// "border-bottom-right-radius:5px;" - "}" +// "QWidget #MainPanel[displayMode='1'] {" +// "border:none;" +// "}" "QWidget #MainPanel[position='0'] {" "padding:0 " xstr(PANEL_PADDING) "px;" "border-top:none;" @@ -130,9 +103,15 @@ switch (m_position) { case Position::Top: - case Position::Bottom: m_itemLayout->setDirection(QBoxLayout::LeftToRight); break; + case Position::Bottom: + m_itemLayout->setDirection(QBoxLayout::LeftToRight); + m_itemLayout->setContentsMargins(1, 0, 1, 0); + break; case Position::Left: - case Position::Right: m_itemLayout->setDirection(QBoxLayout::TopToBottom); break; + case Position::Right: + m_itemLayout->setDirection(QBoxLayout::TopToBottom); + m_itemLayout->setContentsMargins(0, 1, 0, 1); + break; } m_itemAdjustTimer->start(); @@ -181,51 +160,29 @@ return int(m_position); } -void MainPanel::moveEvent(QMoveEvent* e) +void MainPanel::setEffectEnabled(const bool enabled) { - QFrame::moveEvent(e); + if (enabled) + setMaskColor(QColor(0, 0, 0, 255 * 0.4)); + else + setMaskColor(QColor(55, 63, 71)); - emit geometryChanged(); + m_itemAdjustTimer->start(); } -void MainPanel::paintEvent(QPaintEvent *e) +void MainPanel::moveEvent(QMoveEvent* e) { - QWidget::paintEvent(e); + DBlurEffectWidget::moveEvent(e); -// QPainter p(this); -// p.setRenderHint(QPainter::Antialiasing); - -// if (m_displayMode == Dock::Fashion && m_wmHelper->hasComposite()) { -// QPen pen; -// pen.setWidth(1); -// pen.setColor(QColor(162, 162, 162, 255 * 0.2)); - -// const QRect r = rect(); -// // border radius -// const int br = 8; - -// // draw border -// QRect borderRect = r; -// switch (m_position) -// { -// case Top: borderRect.setTop(-br); break; -// case Bottom: borderRect.setBottom(r.bottom() + br); break; -// case Left: borderRect.setLeft(-br); break; -// case Right: borderRect.setRight(r.right() + br); break; -// } - -// p.setPen(pen); -// p.setBrush(Qt::transparent); -// p.drawRoundedRect(borderRect, br, br); -// } + emit geometryChanged(); } void MainPanel::resizeEvent(QResizeEvent *e) { - QWidget::resizeEvent(e); + DBlurEffectWidget::resizeEvent(e); m_itemAdjustTimer->start(); - m_effectWidget->resize(e->size()); +// m_effectWidget->resize(e->size()); emit geometryChanged(); } @@ -240,11 +197,11 @@ if (dragSourceItem) { e->accept(); - if (DragingItem) - DragingItem->show(); + if (DraggingItem) + DraggingItem->show(); return; } else { - DragingItem = nullptr; + DraggingItem = nullptr; } if (!e->mimeData()->formats().contains(RequestDockKey)) @@ -266,16 +223,16 @@ // internal drag swap if (e->source()) { - if (dst == DragingItem) + if (dst == DraggingItem) return; - if (!DragingItem) + if (!DraggingItem) return; - if (m_itemController->itemIsInContainer(DragingItem)) + if (m_itemController->itemIsInContainer(DraggingItem)) return; - m_itemController->itemMove(DragingItem, dst); + m_itemController->itemMove(DraggingItem, dst); } else { - DragingItem = nullptr; + DraggingItem = nullptr; if (!RequestDockItem) { @@ -313,15 +270,15 @@ RequestDockItem = nullptr; } - if (DragingItem && DragingItem->itemType() != DockItem::Plugins) - DragingItem->hide(); + if (DraggingItem && DraggingItem->itemType() != DockItem::Plugins) + DraggingItem->hide(); } void MainPanel::dropEvent(QDropEvent *e) { Q_UNUSED(e) - DragingItem = nullptr; + DraggingItem = nullptr; if (RequestDockItem) { @@ -378,6 +335,9 @@ { Q_ASSERT(sender() == m_itemAdjustTimer); + // ensure all item is update, whatever layout is changed + QTimer::singleShot(1, this, static_cast(&MainPanel::update)); + const auto ratio = devicePixelRatioF(); QSize itemSize; @@ -466,8 +426,8 @@ } } - const int w = width() - PANEL_BORDER * 2 - PANEL_PADDING * 2; - const int h = height() - PANEL_BORDER * 2 - PANEL_PADDING * 2; + const int w = width() - PANEL_BORDER * 2 - PANEL_PADDING * 2 - PANEL_MARGIN * 2; + const int h = height() - PANEL_BORDER * 2 - PANEL_PADDING * 2 - PANEL_MARGIN * 2; // test if panel can display all items completely bool containsCompletely = false; @@ -475,11 +435,11 @@ { case Dock::Top: case Dock::Bottom: - containsCompletely = totalWidth <= w; break; + containsCompletely = totalWidth <= w; break; case Dock::Left: case Dock::Right: - containsCompletely = totalHeight <= h; break; + containsCompletely = totalHeight <= h; break; default: Q_ASSERT(false); @@ -494,13 +454,11 @@ int base; if (m_position == Dock::Top || m_position == Dock::Bottom) { -// qDebug() << "width: " << totalWidth << width(); overflow = totalWidth; base = w; } else { -// qDebug() << "height: " << totalHeight << height(); overflow = totalHeight; base = h; } @@ -540,8 +498,6 @@ // ensure all extra space assigned Q_ASSERT(extraDecrease == 0); - - update(); } /// @@ -590,17 +546,17 @@ } /// -/// \brief MainPanel::itemDragStarted handle managed item draging +/// \brief MainPanel::itemDragStarted handle managed item dragging /// void MainPanel::itemDragStarted() { - DragingItem = qobject_cast(sender()); + DraggingItem = qobject_cast(sender()); - if (DragingItem->itemType() == DockItem::Plugins) + if (DraggingItem->itemType() == DockItem::Plugins) { - if (static_cast(DragingItem)->allowContainer()) + if (static_cast(DraggingItem)->allowContainer()) { - qobject_cast(DragingItem)->hidePopup(); + qobject_cast(DraggingItem)->hidePopup(); m_itemController->setDropping(true); } } @@ -609,7 +565,7 @@ rect.setTopLeft(mapToGlobal(pos())); rect.setSize(size()); - DragingItem->setVisible(rect.contains(QCursor::pos())); + DraggingItem->setVisible(rect.contains(QCursor::pos())); } /// diff -Nru dde-dock-4.5.9.1/frame/panel/mainpanel.h dde-dock-4.6.3.1/frame/panel/mainpanel.h --- dde-dock-4.5.9.1/frame/panel/mainpanel.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/panel/mainpanel.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -35,12 +35,13 @@ #define xstr(s) str(s) #define str(s) #s #define PANEL_BORDER 0 -#define PANEL_PADDING 6 -#define WINDOW_OVERFLOW 5 +#define PANEL_PADDING 0 +#define PANEL_MARGIN 1 +#define WINDOW_OVERFLOW 4 DWIDGET_USE_NAMESPACE -class MainPanel : public QFrame +class MainPanel : public DBlurEffectWidget { Q_OBJECT Q_PROPERTY(int displayMode READ displayMode DESIGNABLE true) @@ -54,6 +55,8 @@ int displayMode() const; int position() const; + void setEffectEnabled(const bool enabled); + signals: void requestWindowAutoHide(const bool autoHide) const; void requestRefershWindowVisible() const; @@ -61,7 +64,6 @@ private: void moveEvent(QMoveEvent *e); - void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); void dragEnterEvent(QDragEnterEvent *e); void dragMoveEvent(QDragMoveEvent *e); @@ -87,10 +89,7 @@ QTimer *m_itemAdjustTimer; DockItemController *m_itemController; - DBlurEffectWidget *m_effectWidget; - DWindowManagerHelper *m_wmHelper; - - static DockItem *DragingItem; + static DockItem *DraggingItem; static PlaceholderItem *RequestDockItem; }; diff -Nru dde-dock-4.5.9.1/frame/util/dockpopupwindow.cpp dde-dock-4.6.3.1/frame/util/dockpopupwindow.cpp --- dde-dock-4.5.9.1/frame/util/dockpopupwindow.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/dockpopupwindow.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -58,7 +58,7 @@ bool DockPopupWindow::model() const { - return m_model; + return isVisible() && m_model; } void DockPopupWindow::setContent(QWidget *content) @@ -122,7 +122,14 @@ return false; // FIXME: ensure position move after global mouse release event - QTimer::singleShot(100, this, [this] { if (isVisible()) show(m_lastPoint, m_model); }); + if (isVisible()) + { + QTimer::singleShot(10, this, [=] { + // NOTE(sbw): double check is necessary, in this time, the popup maybe already hided. + if (isVisible()) + show(m_lastPoint, m_model); + }); + } return false; } diff -Nru dde-dock-4.5.9.1/frame/util/dockpopupwindow.h dde-dock-4.6.3.1/frame/util/dockpopupwindow.h --- dde-dock-4.5.9.1/frame/util/dockpopupwindow.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/dockpopupwindow.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/util/docksettings.cpp dde-dock-4.6.3.1/frame/util/docksettings.cpp --- dde-dock-4.5.9.1/frame/util/docksettings.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/docksettings.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -130,7 +130,7 @@ connect(&m_settingsMenu, &WhiteMenu::triggered, this, &DockSettings::menuActionClicked); connect(m_dockInter, &DBusDock::PositionChanged, this, &DockSettings::onPositionChanged); connect(m_dockInter, &DBusDock::IconSizeChanged, this, &DockSettings::iconSizeChanged); - connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &DockSettings::displayModeChanged); + connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &DockSettings::onDisplayModeChanged); connect(m_dockInter, &DBusDock::HideModeChanged, this, &DockSettings::hideModeChanged, Qt::QueuedConnection); connect(m_dockInter, &DBusDock::HideStateChanged, this, &DockSettings::hideStateChanged); connect(m_dockInter, &DBusDock::ServiceRestarted, this, &DockSettings::resetFrontendGeometry); @@ -206,7 +206,8 @@ { m_autoHide = false; - qDeleteAll(m_hideSubMenu->actions()); + // create actions + QList actions; for (auto *p : m_itemController->pluginList()) { if (!p->pluginIsAllowDisable()) @@ -221,9 +222,19 @@ act->setChecked(enable); act->setData(name); - m_hideSubMenu->addAction(act); + actions << act; } + // sort by name + std::sort(actions.begin(), actions.end(), [] (QAction *a, QAction *b) -> bool { + return a->data().toString() > b->data().toString(); + }); + + // add actions + qDeleteAll(m_hideSubMenu->actions()); + for (auto act : actions) + m_hideSubMenu->addAction(act); + m_fashionModeAct.setChecked(m_displayMode == Fashion); m_efficientModeAct.setChecked(m_displayMode == Efficient); m_topPosAct.setChecked(m_position == Top); @@ -241,7 +252,6 @@ m_keepHiddenAct.setChecked(m_hideMode == KeepHidden); m_smartHideAct.setChecked(m_hideMode == SmartHide); - m_settingsMenu.exec(QCursor::pos()); setAutoHide(true); @@ -306,22 +316,23 @@ void DockSettings::onPositionChanged() { -// qDebug() << Q_FUNC_INFO; const Position prevPos = m_position; const Position nextPos = Dock::Position(m_dockInter->position()); if (prevPos == nextPos) return; - m_position = nextPos; - DockItem::setDockPosition(m_position); - qApp->setProperty(PROP_POSITION, QVariant::fromValue(m_position)); + emit positionChanged(prevPos); - calculateWindowConfig(); + QTimer::singleShot(200, this, [this, nextPos] { + m_position = nextPos; + DockItem::setDockPosition(nextPos); + qApp->setProperty(PROP_POSITION, QVariant::fromValue(nextPos)); - emit positionChanged(prevPos); + calculateWindowConfig(); - m_itemController->refershItemsIcon(); + m_itemController->refershItemsIcon(); + }); } void DockSettings::iconSizeChanged() @@ -335,7 +346,7 @@ emit dataChanged(); } -void DockSettings::displayModeChanged() +void DockSettings::onDisplayModeChanged() { // qDebug() << Q_FUNC_INFO; m_displayMode = Dock::DisplayMode(m_dockInter->displayMode()); @@ -344,7 +355,9 @@ calculateWindowConfig(); - emit dataChanged(); + emit displayModeChanegd(); + + QTimer::singleShot(1, m_itemController, &DockItemController::sortPluginItems); } void DockSettings::hideModeChanged() @@ -518,8 +531,8 @@ } } - const int perfectWidth = visibleItemCount * defaultWidth + PANEL_BORDER * 2 + PANEL_PADDING * 2 + WINDOW_OVERFLOW; - const int perfectHeight = visibleItemCount * defaultHeight + PANEL_BORDER * 2 + PANEL_PADDING * 2 + WINDOW_OVERFLOW; + const int perfectWidth = visibleItemCount * defaultWidth + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2; + const int perfectHeight = visibleItemCount * defaultHeight + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2; const int calcWidth = qMin(m_primaryRect.width() - FASHION_MODE_PADDING * 2, perfectWidth); const int calcHeight = qMin(m_primaryRect.height() - FASHION_MODE_PADDING * 2, perfectHeight); switch (m_position) diff -Nru dde-dock-4.5.9.1/frame/util/docksettings.h dde-dock-4.6.3.1/frame/util/docksettings.h --- dde-dock-4.5.9.1/frame/util/docksettings.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/docksettings.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -84,6 +84,7 @@ void dataChanged() const; void positionChanged(const Position prevPosition) const; void autoHideChanged(const bool autoHide) const; + void displayModeChanegd() const; void windowVisibleChanged() const; void windowHideModeChanged() const; void windowGeometryChanged() const; @@ -96,7 +97,7 @@ void menuActionClicked(QAction *action); void onPositionChanged(); void iconSizeChanged(); - void displayModeChanged(); + void onDisplayModeChanged(); void hideModeChanged(); void hideStateChanged(); void dockItemCountChanged(); diff -Nru dde-dock-4.5.9.1/frame/util/imagefactory.cpp dde-dock-4.6.3.1/frame/util/imagefactory.cpp --- dde-dock-4.5.9.1/frame/util/imagefactory.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/imagefactory.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -44,13 +44,14 @@ for (int j(0); j != width; ++j) { QRgb &rgba = *(QRgb*)scanLine; - if (qAlpha(rgba) == 0xff && (qRed(rgba) || qGreen(rgba) || qBlue(rgba))) { - const QColor hsv = QColor::fromRgba(rgba).toHsv(); - // check brightness first, color with max brightness processed with lighter will - // become white like color which will ruin the whole image in general cases. - if (hsv.value() < 255) { - rgba = QColor::fromRgba(rgba).lighter(delta).rgba(); - } + if (qAlpha(rgba) == 0xff) { + rgba = QColor::fromRgba(rgba).light(delta).rgba(); +// const QColor hsv = QColor::fromRgba(rgba).toHsv(); +// // check brightness first, color with max brightness processed with lighter will +// // become white like color which will ruin the whole image in general cases. +// if (hsv.value() < 255) { +// rgba = QColor::fromRgba(rgba).lighter(delta).rgba(); +// } } scanLine += bytesPerPixel; } diff -Nru dde-dock-4.5.9.1/frame/util/imagefactory.h dde-dock-4.6.3.1/frame/util/imagefactory.h --- dde-dock-4.5.9.1/frame/util/imagefactory.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/imagefactory.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/util/themeappicon.cpp dde-dock-4.6.3.1/frame/util/themeappicon.cpp --- dde-dock-4.5.9.1/frame/util/themeappicon.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/themeappicon.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/util/themeappicon.h dde-dock-4.6.3.1/frame/util/themeappicon.h --- dde-dock-4.5.9.1/frame/util/themeappicon.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/util/themeappicon.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/window/mainwindow.cpp dde-dock-4.6.3.1/frame/window/mainwindow.cpp --- dde-dock-4.5.9.1/frame/window/mainwindow.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/window/mainwindow.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,7 @@ setAttribute(Qt::WA_TranslucentBackground); setAcceptDrops(true); + DPlatformWindowHandle::enableDXcbForWindow(this, true); m_platformWindowHandle.setEnableBlurWindow(false); m_platformWindowHandle.setTranslucentBackground(true); m_platformWindowHandle.setWindowRadius(0); @@ -159,11 +161,13 @@ return QWidget::event(e); } -void MainWindow::resizeEvent(QResizeEvent *e) +void MainWindow::showEvent(QShowEvent *e) { - QWidget::resizeEvent(e); + QWidget::showEvent(e); - m_shadowMaskOptimizeTimer->start(); + m_platformWindowHandle.setEnableBlurWindow(false); + m_platformWindowHandle.setShadowOffset(QPoint()); + m_platformWindowHandle.setShadowRadius(0); } void MainWindow::mousePressEvent(QMouseEvent *e) @@ -267,13 +271,16 @@ void MainWindow::compositeChanged() { - const int duration = m_wmHelper->hasComposite() ? 300 : 0; + const bool composite = m_wmHelper->hasComposite(); + const int duration = composite ? 300 : 0; m_sizeChangeAni->setDuration(duration); m_posChangeAni->setDuration(duration); m_panelShowAni->setDuration(duration); m_panelHideAni->setDuration(duration); + m_mainPanel->setEffectEnabled(composite); + m_shadowMaskOptimizeTimer->start(); m_positionUpdateTimer->start(); } @@ -315,18 +322,20 @@ } } + // using platform window to set real window position windowHandle()->handle()->setGeometry(QRect(rp.x(), rp.y(), wx, hx)); } void MainWindow::initConnections() { connect(m_settings, &DockSettings::dataChanged, m_positionUpdateTimer, static_cast(&QTimer::start)); - connect(m_settings, &DockSettings::windowGeometryChanged, this, &MainWindow::updateGeometry, Qt::DirectConnection); connect(m_settings, &DockSettings::positionChanged, this, &MainWindow::positionChanged); + connect(m_settings, &DockSettings::autoHideChanged, this, &MainWindow::updatePanelVisible); + connect(m_settings, &DockSettings::windowGeometryChanged, this, &MainWindow::updateGeometry, Qt::DirectConnection); connect(m_settings, &DockSettings::windowHideModeChanged, this, &MainWindow::setStrutPartial, Qt::QueuedConnection); connect(m_settings, &DockSettings::windowHideModeChanged, [this] { resetPanelEnvironment(true); }); connect(m_settings, &DockSettings::windowVisibleChanged, this, &MainWindow::updatePanelVisible, Qt::QueuedConnection); - connect(m_settings, &DockSettings::autoHideChanged, this, &MainWindow::updatePanelVisible); + connect(m_settings, &DockSettings::displayModeChanegd, m_positionUpdateTimer, static_cast(&QTimer::start)); connect(m_mainPanel, &MainPanel::requestRefershWindowVisible, this, &MainWindow::updatePanelVisible, Qt::QueuedConnection); connect(m_mainPanel, &MainPanel::requestWindowAutoHide, m_settings, &DockSettings::setAutoHide); @@ -393,7 +402,7 @@ narrow(prevPos); // reset position & layout and slide out - QTimer::singleShot(100, this, [&] { + QTimer::singleShot(200, this, [&] { resetPanelEnvironment(false, true); updateGeometry(); expand(); @@ -420,8 +429,10 @@ updateGeometry(); // make sure strut partial is set after the size/position animation; - const int inter = qMax(m_sizeChangeAni->duration(), m_posChangeAni->duration()); - QTimer::singleShot(inter + 100, this, &MainWindow::setStrutPartial); + const int duration = qMax(m_sizeChangeAni->duration(), m_posChangeAni->duration()); + + QTimer::singleShot(duration, this, &MainWindow::setStrutPartial); + QTimer::singleShot(duration, this, &MainWindow::updatePanelVisible); } void MainWindow::updateGeometry() @@ -463,6 +474,7 @@ internalMove(windowRect.topLeft()); m_mainPanel->update(); + m_shadowMaskOptimizeTimer->start(); } void MainWindow::clearStrutPartial() @@ -593,6 +605,8 @@ m_panelShowAni->setStartValue(startPos); m_panelShowAni->setEndValue(finishPos); m_panelShowAni->start(); + m_shadowMaskOptimizeTimer->start(); + m_platformWindowHandle.setShadowRadius(0); } } @@ -613,6 +627,7 @@ m_panelHideAni->setStartValue(m_mainPanel->pos()); m_panelHideAni->setEndValue(finishPos); m_panelHideAni->start(); + m_platformWindowHandle.setShadowRadius(0); } void MainWindow::resetPanelEnvironment(const bool visible, const bool resetPosition) @@ -645,6 +660,7 @@ } m_mainPanel->move(finishPos); + m_mainPanel->updateDockPosition(position); } void MainWindow::updatePanelVisible() @@ -680,21 +696,13 @@ if (!m_launched) return; - qApp->processEvents(); if (m_shadowMaskOptimizeTimer->isActive()) return; - if (m_settings->displayMode() == Efficient || - m_panelHideAni->state() == QPropertyAnimation::Running || - m_panelShowAni->state() == QPauseAnimation::Running || - !m_wmHelper->hasComposite()) - { - m_platformWindowHandle.setShadowRadius(0); - m_platformWindowHandle.setWindowRadius(0); - } else { - m_platformWindowHandle.setShadowRadius(60); - m_platformWindowHandle.setWindowRadius(5); - } + const bool composite = m_wmHelper->hasComposite(); + const bool isFasion = m_settings->displayMode() == Fashion; + + m_platformWindowHandle.setWindowRadius(composite && isFasion ? 5 : 0); } void MainWindow::positionCheck() diff -Nru dde-dock-4.5.9.1/frame/window/mainwindow.h dde-dock-4.6.3.1/frame/window/mainwindow.h --- dde-dock-4.5.9.1/frame/window/mainwindow.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/window/mainwindow.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -50,7 +50,7 @@ private: using QWidget::show; bool event(QEvent *e); - void resizeEvent(QResizeEvent *e); + void showEvent(QShowEvent *e); void mousePressEvent(QMouseEvent *e); void keyPressEvent(QKeyEvent *e); void enterEvent(QEvent *e); diff -Nru dde-dock-4.5.9.1/frame/xcb/xcb_misc.cpp dde-dock-4.6.3.1/frame/xcb/xcb_misc.cpp --- dde-dock-4.5.9.1/frame/xcb/xcb_misc.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/xcb/xcb_misc.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/frame/xcb/xcb_misc.h dde-dock-4.6.3.1/frame/xcb/xcb_misc.h --- dde-dock-4.5.9.1/frame/xcb/xcb_misc.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/frame/xcb/xcb_misc.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/.gitignore dde-dock-4.6.3.1/.gitignore --- dde-dock-4.5.9.1/.gitignore 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/.gitignore 2018-04-11 09:44:14.000000000 +0000 @@ -14,6 +14,7 @@ build*/ *.pro.user* +CMakeLists.txt.user *.DS_Store *.qm diff -Nru dde-dock-4.5.9.1/interfaces/constants.h dde-dock-4.6.3.1/interfaces/constants.h --- dde-dock-4.5.9.1/interfaces/constants.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/interfaces/constants.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/interfaces/interfaces.pri dde-dock-4.6.3.1/interfaces/interfaces.pri --- dde-dock-4.5.9.1/interfaces/interfaces.pri 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/interfaces/interfaces.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -DEFINES += QT_MESSAGELOGCONTEXT - -HEADERS += \ - $$PWD/pluginsiteminterface.h \ - $$PWD/constants.h \ - $$PWD/pluginproxyinterface.h - -SOURCES += \ - -INCLUDEPATH += $$PWD - -isEmpty(PREFIX) -{ - PREFIX = /usr -} diff -Nru dde-dock-4.5.9.1/interfaces/pluginproxyinterface.h dde-dock-4.6.3.1/interfaces/pluginproxyinterface.h --- dde-dock-4.5.9.1/interfaces/pluginproxyinterface.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/interfaces/pluginproxyinterface.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/interfaces/pluginsiteminterface.h dde-dock-4.6.3.1/interfaces/pluginsiteminterface.h --- dde-dock-4.5.9.1/interfaces/pluginsiteminterface.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/interfaces/pluginsiteminterface.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/CMakeLists.txt dde-dock-4.6.3.1/plugins/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,9 @@ + +add_subdirectory("datetime") +#add_subdirectory("disk-mount") +add_subdirectory("network") +add_subdirectory("shutdown") +add_subdirectory("sound") +add_subdirectory("system-tray") +#add_subdirectory("trash") +add_subdirectory("keyboard-layout") \ No newline at end of file diff -Nru dde-dock-4.5.9.1/plugins/datetime/CMakeLists.txt dde-dock-4.6.3.1/plugins/datetime/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/datetime/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,24 @@ + +set(PLUGIN_NAME "datetime") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(DtkWidget REQUIRED) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/datetime/datetimeplugin.cpp dde-dock-4.6.3.1/plugins/datetime/datetimeplugin.cpp --- dde-dock-4.5.9.1/plugins/datetime/datetimeplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/datetimeplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -22,13 +22,15 @@ #include "datetimeplugin.h" #include +#include DatetimePlugin::DatetimePlugin(QObject *parent) : QObject(parent), m_dateTipsLabel(new QLabel), - m_refershTimer(new QTimer(this)) + m_refershTimer(new QTimer(this)), + m_settings("deepin", "dde-dock-datetime") { m_dateTipsLabel->setObjectName("datetime"); m_dateTipsLabel->setStyleSheet("color:white;" @@ -82,7 +84,16 @@ { Q_UNUSED(itemKey); - return -1; + const QString key = QString("pos_%1").arg(displayMode()); + return m_settings.value(key, 0).toInt(); +} + +void DatetimePlugin::setSortKey(const QString &itemKey, const int order) +{ + Q_UNUSED(itemKey); + + const QString key = QString("pos_%1").arg(displayMode()); + m_settings.setValue(key, order); } QWidget *DatetimePlugin::itemWidget(const QString &itemKey) diff -Nru dde-dock-4.5.9.1/plugins/datetime/datetimeplugin.h dde-dock-4.6.3.1/plugins/datetime/datetimeplugin.h --- dde-dock-4.5.9.1/plugins/datetime/datetimeplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/datetimeplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -27,6 +27,7 @@ #include #include +#include class DatetimePlugin : public QObject, PluginsItemInterface { @@ -45,7 +46,8 @@ bool pluginIsAllowDisable() override { return true; } bool pluginIsDisable() override; - int itemSortKey(const QString &itemKey) override; + int itemSortKey(const QString &itemKey); + void setSortKey(const QString &itemKey, const int order); QWidget *itemWidget(const QString &itemKey) override; QWidget *itemTipsWidget(const QString &itemKey) override; @@ -65,6 +67,7 @@ QTimer *m_refershTimer; QString m_currentTimeString; + QSettings m_settings; }; #endif // DATETIMEPLUGIN_H diff -Nru dde-dock-4.5.9.1/plugins/datetime/datetime.pro dde-dock-4.6.3.1/plugins/datetime/datetime.pro --- dde-dock-4.5.9.1/plugins/datetime/datetime.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/datetime.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += - -TARGET = $$qtLibraryTarget(datetime) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += datetime.json - -HEADERS += \ - datetimeplugin.h \ - datetimewidget.h - -SOURCES += \ - datetimeplugin.cpp \ - datetimewidget.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources.qrc diff -Nru dde-dock-4.5.9.1/plugins/datetime/datetimewidget.cpp dde-dock-4.6.3.1/plugins/datetime/datetimewidget.cpp --- dde-dock-4.5.9.1/plugins/datetime/datetimewidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/datetimewidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -167,7 +167,7 @@ const int tips_height = tips_width / 2; QPixmap tips; - if (current.time().hour() > 12) + if (current.time().hour() > 11) tips = loadSvg(":/icons/resources/icons/tips-pm.svg", QSize(tips_width, tips_height)); else tips = loadSvg(":/icons/resources/icons/tips-am.svg", QSize(tips_width, tips_height)); diff -Nru dde-dock-4.5.9.1/plugins/datetime/datetimewidget.h dde-dock-4.6.3.1/plugins/datetime/datetimewidget.h --- dde-dock-4.5.9.1/plugins/datetime/datetimewidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/datetime/datetimewidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/CMakeLists.txt dde-dock-4.6.3.1/plugins/disk-mount/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/disk-mount/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,24 @@ + +set(PLUGIN_NAME "disk-mount") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(DtkWidget REQUIRED) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/dbus/variant/diskinfo.cpp dde-dock-4.6.3.1/plugins/disk-mount/dbus/variant/diskinfo.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/dbus/variant/diskinfo.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/dbus/variant/diskinfo.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/dbus/variant/diskinfo.h dde-dock-4.6.3.1/plugins/disk-mount/dbus/variant/diskinfo.h --- dde-dock-4.5.9.1/plugins/disk-mount/dbus/variant/diskinfo.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/dbus/variant/diskinfo.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -25,7 +25,6 @@ #include #include #include -#include class DiskInfo { diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolitem.cpp dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolitem.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolitem.h dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolitem.h --- dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolwidget.cpp dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolwidget.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolwidget.h dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolwidget.h --- dde-dock-4.5.9.1/plugins/disk-mount/diskcontrolwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskcontrolwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskmountplugin.cpp dde-dock-4.6.3.1/plugins/disk-mount/diskmountplugin.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/diskmountplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskmountplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskmountplugin.h dde-dock-4.6.3.1/plugins/disk-mount/diskmountplugin.h --- dde-dock-4.5.9.1/plugins/disk-mount/diskmountplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskmountplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/disk-mount.pro dde-dock-4.6.3.1/plugins/disk-mount/disk-mount.pro --- dde-dock-4.5.9.1/plugins/disk-mount/disk-mount.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/disk-mount.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg dbus -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += dtkwidget - -TARGET = $$qtLibraryTarget(disk-mount) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += disk-mount.json - -HEADERS += \ - diskmountplugin.h \ - dbus/dbusdiskmount.h \ - dbus/variant/diskinfo.h \ - diskcontrolwidget.h \ - diskpluginitem.h \ - imageutil.h \ - diskcontrolitem.h - -SOURCES += \ - diskmountplugin.cpp \ - dbus/dbusdiskmount.cpp \ - dbus/variant/diskinfo.cpp \ - diskcontrolwidget.cpp \ - diskpluginitem.cpp \ - imageutil.cpp \ - diskcontrolitem.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources.qrc diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskpluginitem.cpp dde-dock-4.6.3.1/plugins/disk-mount/diskpluginitem.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/diskpluginitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskpluginitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/diskpluginitem.h dde-dock-4.6.3.1/plugins/disk-mount/diskpluginitem.h --- dde-dock-4.5.9.1/plugins/disk-mount/diskpluginitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/diskpluginitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/imageutil.cpp dde-dock-4.6.3.1/plugins/disk-mount/imageutil.cpp --- dde-dock-4.5.9.1/plugins/disk-mount/imageutil.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/imageutil.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/disk-mount/imageutil.h dde-dock-4.6.3.1/plugins/disk-mount/imageutil.h --- dde-dock-4.5.9.1/plugins/disk-mount/imageutil.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/disk-mount/imageutil.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/CMakeLists.txt dde-dock-4.6.3.1/plugins/keyboard-layout/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/keyboard-layout/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,36 @@ + +set(PLUGIN_NAME "keyboard-layout") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(DtkWidget REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(DFrameworkdbus REQUIRED) + +pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) +pkg_check_modules(QGSettings REQUIRED gsettings-qt) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS}) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${DFrameworkDBus_INCLUDE_DIRS} + ${QGSettings_INCLUDE_DIRS} + ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${DFrameworkDBus_LIBRARIES} + ${QGSettings_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} + ${Qt5DBus_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) +install(FILES ./keybord_layout.json DESTINATION /etc/dde-dock/indicator) diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/dbusadaptors.cpp dde-dock-4.6.3.1/plugins/keyboard-layout/dbusadaptors.cpp --- dde-dock-4.5.9.1/plugins/keyboard-layout/dbusadaptors.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/dbusadaptors.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: rekols + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "dbusadaptors.h" +#include + +DBusAdaptors::DBusAdaptors(QObject *parent) + : QDBusAbstractAdaptor(parent), + m_keyboard(new Keyboard("com.deepin.daemon.InputDevices", + "/com/deepin/daemon/InputDevice/Keyboard", + QDBusConnection::sessionBus(), this)) +{ + connect(m_keyboard, &Keyboard::CurrentLayoutChanged, this, + [=] { + emit layoutChanged(layout()); + }); +} + +DBusAdaptors::~DBusAdaptors() +{ +} + +QString DBusAdaptors::layout() const +{ + return QString(m_keyboard->currentLayout()).split(';').first(); +} diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/dbusadaptors.h dde-dock-4.6.3.1/plugins/keyboard-layout/dbusadaptors.h --- dde-dock-4.5.9.1/plugins/keyboard-layout/dbusadaptors.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/dbusadaptors.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: rekols + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef DBUSADAPTORS_H +#define DBUSADAPTORS_H + +#include +#include + +using Keyboard = com::deepin::daemon::inputdevice::Keyboard; + +class DBusAdaptors : public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.Keyboard") + Q_CLASSINFO("D-Bus Introspection", "" + " \n" + " \n" + " " + " " + " " + " \n" + "") + +public: + DBusAdaptors(QObject *parent = nullptr); + ~DBusAdaptors(); + +public: + Q_PROPERTY(QString layout READ layout NOTIFY layoutChanged) + QString layout() const; + +signals: + void layoutChanged(QString text); + +private: + Keyboard *m_keyboard; +}; + +#endif diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/keyboard.json dde-dock-4.6.3.1/plugins/keyboard-layout/keyboard.json --- dde-dock-4.5.9.1/plugins/keyboard-layout/keyboard.json 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/keyboard.json 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "api": "1.0" +} diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/keyboardplugin.cpp dde-dock-4.6.3.1/plugins/keyboard-layout/keyboardplugin.cpp --- dde-dock-4.5.9.1/plugins/keyboard-layout/keyboardplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/keyboardplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: rekols + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboardplugin.h" + +KeyboardPlugin::KeyboardPlugin(QObject *parent) + : QObject(parent) +{ +} + +KeyboardPlugin::~KeyboardPlugin() +{ +} + +const QString KeyboardPlugin::pluginName() const +{ + return "keyboard"; +} + +const QString KeyboardPlugin::pluginDisplayName() const +{ + return "Keyboard"; +} + +void KeyboardPlugin::init(PluginProxyInterface *proxyInter) +{ + m_proxyInter = proxyInter; + m_dbusAdaptors = new DBusAdaptors(this); + + QDBusConnection::sessionBus().registerService("com.deepin.dde.Keyboard"); + QDBusConnection::sessionBus().registerObject("/com/deepin/dde/Keyboard", "com.deepin.dde.Keyboard", this); +} + +QWidget* KeyboardPlugin::itemWidget(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + return nullptr; +} + +QWidget* KeyboardPlugin::itemTipsWidget(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + return nullptr; +} diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/keyboardplugin.h dde-dock-4.6.3.1/plugins/keyboard-layout/keyboardplugin.h --- dde-dock-4.5.9.1/plugins/keyboard-layout/keyboardplugin.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/keyboardplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: rekols + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef KEYBOARDPLUGIN_H +#define KEYBOARDPLUGIN_H + +#include "pluginsiteminterface.h" +#include "dbusadaptors.h" + +class KeyboardPlugin : public QObject , PluginsItemInterface +{ + Q_OBJECT + Q_INTERFACES(PluginsItemInterface) + Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "keyboard.json") + +public: + KeyboardPlugin(QObject *parent = nullptr); + ~KeyboardPlugin(); + + const QString pluginName() const override; + const QString pluginDisplayName() const override; + void init(PluginProxyInterface *proxyInter) override; + + QWidget *itemWidget(const QString &itemKey) override; + QWidget *itemTipsWidget(const QString &itemKey) override; + +private: + DBusAdaptors *m_dbusAdaptors; +}; + +#endif diff -Nru dde-dock-4.5.9.1/plugins/keyboard-layout/keybord_layout.json dde-dock-4.6.3.1/plugins/keyboard-layout/keybord_layout.json --- dde-dock-4.5.9.1/plugins/keyboard-layout/keybord_layout.json 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/keyboard-layout/keybord_layout.json 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,10 @@ +{ + "data": { + "text": { + "dbus_service": "com.deepin.dde.Keyboard", + "dbus_path": "/com/deepin/dde/Keyboard", + "dbus_interface": "com.deepin.dde.Keyboard", + "dbus_properties": "layout" + } + } +} diff -Nru dde-dock-4.5.9.1/plugins/network/CMakeLists.txt dde-dock-4.6.3.1/plugins/network/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/network/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,28 @@ + +set(PLUGIN_NAME "network") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(DtkWidget REQUIRED) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${Qt5DBus_INCLUDE_DIRS} + ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} + ${Qt5DBus_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/accesspoint.cpp dde-dock-4.6.3.1/plugins/network/item/applet/accesspoint.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/accesspoint.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/accesspoint.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/accesspoint.h dde-dock-4.6.3.1/plugins/network/item/applet/accesspoint.h --- dde-dock-4.5.9.1/plugins/network/item/applet/accesspoint.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/accesspoint.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/accesspointwidget.cpp dde-dock-4.6.3.1/plugins/network/item/applet/accesspointwidget.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/accesspointwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/accesspointwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/accesspointwidget.h dde-dock-4.6.3.1/plugins/network/item/applet/accesspointwidget.h --- dde-dock-4.5.9.1/plugins/network/item/applet/accesspointwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/accesspointwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/devicecontrolwidget.cpp dde-dock-4.6.3.1/plugins/network/item/applet/devicecontrolwidget.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/devicecontrolwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/devicecontrolwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -21,12 +21,12 @@ #include "devicecontrolwidget.h" #include "horizontalseperator.h" -#include "refreshbutton.h" #include #include #include #include +#include DWIDGET_USE_NAMESPACE @@ -39,24 +39,20 @@ m_switchBtn = new DSwitchButton; - m_refreshBtn = new RefreshButton; - const QPixmap pixmap = DHiDPIHelper::loadNxPixmap(":/wireless/resources/wireless/refresh_normal.svg"); - m_refreshView = new QWidget; - m_refreshView->setFixedSize(pixmap.size() / devicePixelRatioF()); - m_refreshView->hide(); - - m_loadingIndicator = new DLoadingIndicator(m_refreshView); + m_loadingIndicator = new DLoadingIndicator; m_loadingIndicator->setImageSource(pixmap); m_loadingIndicator->setLoading(false); + m_loadingIndicator->setSmooth(true); m_loadingIndicator->setAniDuration(1000); m_loadingIndicator->setAniEasingCurve(QEasingCurve::InOutCirc); + m_loadingIndicator->installEventFilter(this); + m_loadingIndicator->setFixedSize(pixmap.size() / devicePixelRatioF()); QHBoxLayout *infoLayout = new QHBoxLayout; infoLayout->addWidget(m_deviceName); - infoLayout->addWidget(m_refreshBtn); - infoLayout->addWidget(m_refreshView); + infoLayout->addWidget(m_loadingIndicator); infoLayout->addSpacing(10); infoLayout->addWidget(m_switchBtn); infoLayout->setSpacing(0); @@ -78,7 +74,6 @@ setFixedHeight(30); connect(m_switchBtn, &DSwitchButton::checkedChanged, this, &DeviceControlWidget::deviceEnableChanged); - connect(m_refreshBtn, &RefreshButton::clicked, this, &DeviceControlWidget::refreshNetwork); } void DeviceControlWidget::setDeviceName(const QString &name) @@ -90,22 +85,30 @@ { m_switchBtn->blockSignals(true); m_switchBtn->setChecked(enable); + m_loadingIndicator->setVisible(enable); m_switchBtn->blockSignals(false); +} + +bool DeviceControlWidget::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == m_loadingIndicator) { + if (event->type() == QEvent::MouseButtonPress) { + if (!m_loadingIndicator->loading()) { + refreshNetwork(); + } + } + } - m_refreshBtn->setVisible(enable); + return QWidget::eventFilter(watched, event); } void DeviceControlWidget::refreshNetwork() { emit requestRefresh(); - m_refreshBtn->hide(); m_loadingIndicator->setLoading(true); - m_refreshView->show(); QTimer::singleShot(1000, this, [=] { - m_refreshBtn->show(); - m_refreshView->hide(); m_loadingIndicator->setLoading(false); }); } diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/devicecontrolwidget.h dde-dock-4.6.3.1/plugins/network/item/applet/devicecontrolwidget.h --- dde-dock-4.5.9.1/plugins/network/item/applet/devicecontrolwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/devicecontrolwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -31,7 +31,6 @@ DWIDGET_USE_NAMESPACE -class RefreshButton; class DeviceControlWidget : public QWidget { Q_OBJECT @@ -47,6 +46,9 @@ void deviceEnableChanged(const bool enable) const; void requestRefresh() const; +protected: + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + private slots: void refreshNetwork(); @@ -54,8 +56,6 @@ QLabel *m_deviceName; Dtk::Widget::DSwitchButton *m_switchBtn; // HorizontalSeperator *m_seperator; - RefreshButton *m_refreshBtn; - QWidget *m_refreshView; DLoadingIndicator *m_loadingIndicator; }; diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/horizontalseperator.cpp dde-dock-4.6.3.1/plugins/network/item/applet/horizontalseperator.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/horizontalseperator.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/horizontalseperator.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/horizontalseperator.h dde-dock-4.6.3.1/plugins/network/item/applet/horizontalseperator.h --- dde-dock-4.5.9.1/plugins/network/item/applet/horizontalseperator.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/horizontalseperator.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/refreshbutton.cpp dde-dock-4.6.3.1/plugins/network/item/applet/refreshbutton.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/refreshbutton.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/refreshbutton.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "refreshbutton.h" - -#include -#include -#include - -RefreshButton::RefreshButton(QWidget *parent) : QLabel(parent) -{ - setAttribute(Qt::WA_TranslucentBackground); - - m_normalPixmap = loadPixmap(":/wireless/resources/wireless/refresh_normal.svg"); - m_hoverPixmap = loadPixmap(":/wireless/resources/wireless/refresh_hover.svg"); - m_pressPixmap = loadPixmap(":/wireless/resources/wireless/refresh_press.svg"); - - setPixmap(m_normalPixmap); -} - -void RefreshButton::enterEvent(QEvent *event) -{ - QLabel::enterEvent(event); - - setPixmap(m_hoverPixmap); -} - -void RefreshButton::leaveEvent(QEvent *event) -{ - QLabel::leaveEvent(event); - - setPixmap(m_normalPixmap); -} - -void RefreshButton::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) - setPixmap(m_pressPixmap); -} - -void RefreshButton::mouseReleaseEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) - emit clicked(); - - setPixmap(m_normalPixmap); -} - -QPixmap RefreshButton::loadPixmap(const QString &file) -{ - QPixmap pixmap; - - const qreal ratio = devicePixelRatioF(); - - QImageReader reader; - reader.setFileName(file); - if (reader.canRead()) { - reader.setScaledSize(reader.size() * ratio); - pixmap = QPixmap::fromImage(reader.read()); - pixmap.setDevicePixelRatio(ratio); - } - - return pixmap; -} diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/refreshbutton.h dde-dock-4.6.3.1/plugins/network/item/applet/refreshbutton.h --- dde-dock-4.5.9.1/plugins/network/item/applet/refreshbutton.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/refreshbutton.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef REFRESHBUTTON_H -#define REFRESHBUTTON_H - -#include - -class RefreshButton : public QLabel -{ - Q_OBJECT -public: - explicit RefreshButton(QWidget *parent = nullptr); - -signals: - void clicked(); - -protected: - void enterEvent(QEvent *event) Q_DECL_OVERRIDE; - void leaveEvent(QEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - -private: - QPixmap loadPixmap(const QString &file); - -private: - QPixmap m_normalPixmap; - QPixmap m_hoverPixmap; - QPixmap m_pressPixmap; - -}; - -#endif // REFRESHBUTTON_H diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/wirelessapplet.cpp dde-dock-4.6.3.1/plugins/network/item/applet/wirelessapplet.cpp --- dde-dock-4.5.9.1/plugins/network/item/applet/wirelessapplet.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/wirelessapplet.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -77,6 +77,9 @@ m_centralLayout->setSpacing(0); m_centralLayout->setMargin(0); + // initialization state. + m_deviceEnabled = m_networkInter->IsDeviceEnabled(m_device.dbusPath()); + setWidget(m_centralWidget); setFrameStyle(QFrame::NoFrame); setFixedWidth(300); @@ -167,7 +170,7 @@ void WirelessList::setDeviceInfo(const int index) { // set device enable state - m_controlPanel->setDeviceEnabled(m_networkInter->IsDeviceEnabled(m_device.dbusPath())); + m_controlPanel->setDeviceEnabled(m_deviceEnabled); // set device name if (index == -1) @@ -371,7 +374,11 @@ if (devPath != m_device.path()) return; - m_controlPanel->setDeviceEnabled(enable); + if (m_deviceEnabled != enable) { + m_deviceEnabled = enable; + m_controlPanel->setDeviceEnabled(enable); + m_updateAPTimer->start(); + } } void WirelessList::activateAP(const QDBusObjectPath &apPath, const QString &ssid) diff -Nru dde-dock-4.5.9.1/plugins/network/item/applet/wirelessapplet.h dde-dock-4.6.3.1/plugins/network/item/applet/wirelessapplet.h --- dde-dock-4.5.9.1/plugins/network/item/applet/wirelessapplet.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/applet/wirelessapplet.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -90,6 +90,7 @@ QWidget *m_centralWidget; DeviceControlWidget *m_controlPanel; DBusNetwork *m_networkInter; + bool m_deviceEnabled; }; #endif // WIRELESSAPPLET_H diff -Nru dde-dock-4.5.9.1/plugins/network/item/deviceitem.cpp dde-dock-4.6.3.1/plugins/network/item/deviceitem.cpp --- dde-dock-4.5.9.1/plugins/network/item/deviceitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/deviceitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/deviceitem.h dde-dock-4.6.3.1/plugins/network/item/deviceitem.h --- dde-dock-4.5.9.1/plugins/network/item/deviceitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/deviceitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/wireditem.cpp dde-dock-4.6.3.1/plugins/network/item/wireditem.cpp --- dde-dock-4.5.9.1/plugins/network/item/wireditem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/wireditem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -65,7 +65,7 @@ QWidget *WiredItem::itemPopup() { - m_itemTips->setText(tr("Unknow")); + m_itemTips->setText(tr("Unknown")); do { if (!m_connected) diff -Nru dde-dock-4.5.9.1/plugins/network/item/wireditem.h dde-dock-4.6.3.1/plugins/network/item/wireditem.h --- dde-dock-4.5.9.1/plugins/network/item/wireditem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/wireditem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/wirelessitem.cpp dde-dock-4.6.3.1/plugins/network/item/wirelessitem.cpp --- dde-dock-4.5.9.1/plugins/network/item/wirelessitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/wirelessitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/item/wirelessitem.h dde-dock-4.6.3.1/plugins/network/item/wirelessitem.h --- dde-dock-4.5.9.1/plugins/network/item/wirelessitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/item/wirelessitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/networkdevice.cpp dde-dock-4.6.3.1/plugins/network/networkdevice.cpp --- dde-dock-4.5.9.1/plugins/network/networkdevice.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkdevice.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/networkdevice.h dde-dock-4.6.3.1/plugins/network/networkdevice.h --- dde-dock-4.5.9.1/plugins/network/networkdevice.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkdevice.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/networkmanager.cpp dde-dock-4.6.3.1/plugins/network/networkmanager.cpp --- dde-dock-4.5.9.1/plugins/network/networkmanager.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkmanager.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/networkmanager.h dde-dock-4.6.3.1/plugins/network/networkmanager.h --- dde-dock-4.5.9.1/plugins/network/networkmanager.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkmanager.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/networkplugin.cpp dde-dock-4.6.3.1/plugins/network/networkplugin.cpp --- dde-dock-4.5.9.1/plugins/network/networkplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -143,6 +143,18 @@ return nullptr; } +int NetworkPlugin::itemSortKey(const QString &itemKey) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + return m_settings.value(key, 0).toInt(); +} + +void NetworkPlugin::setSortKey(const QString &itemKey, const int order) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + m_settings.setValue(key, order); +} + void NetworkPlugin::deviceAdded(const NetworkDevice &device) { DeviceItem *item = nullptr; diff -Nru dde-dock-4.5.9.1/plugins/network/networkplugin.h dde-dock-4.6.3.1/plugins/network/networkplugin.h --- dde-dock-4.5.9.1/plugins/network/networkplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/networkplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -51,6 +51,9 @@ QWidget *itemTipsWidget(const QString &itemKey); QWidget *itemPopupApplet(const QString &itemKey); + int itemSortKey(const QString &itemKey); + void setSortKey(const QString &itemKey, const int order); + private slots: void deviceAdded(const NetworkDevice &device); void deviceRemoved(const NetworkDevice &device); diff -Nru dde-dock-4.5.9.1/plugins/network/network.pro dde-dock-4.6.3.1/plugins/network/network.pro --- dde-dock-4.5.9.1/plugins/network/network.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/network.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg dbus -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += dtkwidget - -TARGET = $$qtLibraryTarget(network) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += network.json - -HEADERS += \ - networkplugin.h \ - item/wireditem.h \ - dbus/dbusnetwork.h \ - networkmanager.h \ - networkdevice.h \ - util/imageutil.h \ - item/deviceitem.h \ - item/wirelessitem.h \ - item/applet/wirelessapplet.h \ - item/applet/devicecontrolwidget.h \ - item/applet/accesspoint.h \ - item/applet/accesspointwidget.h \ - item/applet/horizontalseperator.h \ - item/applet/refreshbutton.h - -SOURCES += \ - networkplugin.cpp \ - item/wireditem.cpp \ - dbus/dbusnetwork.cpp \ - networkmanager.cpp \ - networkdevice.cpp \ - util/imageutil.cpp \ - item/deviceitem.cpp \ - item/wirelessitem.cpp \ - item/applet/wirelessapplet.cpp \ - item/applet/devicecontrolwidget.cpp \ - item/applet/accesspoint.cpp \ - item/applet/accesspointwidget.cpp \ - item/applet/horizontalseperator.cpp \ - item/applet/refreshbutton.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources.qrc - diff -Nru dde-dock-4.5.9.1/plugins/network/util/imageutil.cpp dde-dock-4.6.3.1/plugins/network/util/imageutil.cpp --- dde-dock-4.5.9.1/plugins/network/util/imageutil.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/util/imageutil.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/network/util/imageutil.h dde-dock-4.6.3.1/plugins/network/util/imageutil.h --- dde-dock-4.5.9.1/plugins/network/util/imageutil.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/network/util/imageutil.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/home_monitor.json dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/home_monitor.json --- dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/home_monitor.json 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/home_monitor.json 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "api": "1.0" +} diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/homemonitorplugin.cpp dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/homemonitorplugin.cpp --- dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/homemonitorplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/homemonitorplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,28 @@ +#include "homemonitorplugin.h" + +HomeMonitorPlugin::HomeMonitorPlugin(QObject *parent) + : QObject(parent) +{ + +} + +const QString HomeMonitorPlugin::pluginName() const +{ + return QStringLiteral("home_monitor"); +} + +void HomeMonitorPlugin::init(PluginProxyInterface *proxyInter) +{ + m_proxyInter = proxyInter; + + m_pluginWidget = new InformationWidget; + + m_proxyInter->itemAdded(this, QString()); +} + +QWidget *HomeMonitorPlugin::itemWidget(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + return m_pluginWidget; +} diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/homemonitorplugin.h dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/homemonitorplugin.h --- dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/homemonitorplugin.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/homemonitorplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,28 @@ +#ifndef HOMEMONITORPLUGIN_H +#define HOMEMONITORPLUGIN_H + +#include "informationwidget.h" + +#include + +#include + +class HomeMonitorPlugin : public QObject, PluginsItemInterface +{ + Q_OBJECT + Q_INTERFACES(PluginsItemInterface) + Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "home_monitor.json") + +public: + explicit HomeMonitorPlugin(QObject *parent = nullptr); + + const QString pluginName() const override; + void init(PluginProxyInterface *proxyInter) override; + + QWidget *itemWidget(const QString &itemKey) override; + +private: + InformationWidget *m_pluginWidget; +}; + +#endif // HOMEMONITORPLUGIN_H diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/informationwidget.cpp dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/informationwidget.cpp --- dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/informationwidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/informationwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,33 @@ +#include "informationwidget.h" + +#include +#include + +InformationWidget::InformationWidget(QWidget *parent) + : QWidget(parent) + + , m_infoLabel(new QLabel) +{ + m_infoLabel->setStyleSheet("QLabel {" + "color: white;" + "}"); + + QVBoxLayout *centralLayout = new QVBoxLayout; + centralLayout->addWidget(m_infoLabel); + centralLayout->setSpacing(0); + centralLayout->setMargin(0); + + setLayout(centralLayout); + + QTimer::singleShot(1, this, &InformationWidget::refreshInfo); +} + +void InformationWidget::refreshInfo() +{ + // TODO: fetch info + const int remain = 50; + const int total = 100; + + // update display + m_infoLabel->setText(tr("Home:\n%1G/%2G").arg(remain).arg(total)); +} diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/informationwidget.h dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/informationwidget.h --- dde-dock-4.5.9.1/plugins/plugin-guide/home_monitor/informationwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/home_monitor/informationwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,21 @@ +#ifndef INFORMATIONWIDGET_H +#define INFORMATIONWIDGET_H + +#include +#include + +class InformationWidget : public QWidget +{ + Q_OBJECT + +public: + explicit InformationWidget(QWidget *parent = nullptr); + +private slots: + void refreshInfo(); + +private: + QLabel *m_infoLabel; +}; + +#endif // INFORMATIONWIDGET_H diff -Nru dde-dock-4.5.9.1/plugins/plugin-guide/plugins-developer-guide.md dde-dock-4.6.3.1/plugins/plugin-guide/plugins-developer-guide.md --- dde-dock-4.5.9.1/plugins/plugin-guide/plugins-developer-guide.md 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugin-guide/plugins-developer-guide.md 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,180 @@ +# 从零构建 dde-dock 的插件 +本教程将展示一个简单的 dde-dock 插件的开发过程,插件开发者可跟随此步骤为 dde-dock 创造出更多具有丰富功能的插件。 + +在本教程中,将创建一个可以实时显示用户家目录(`~/`)使用情况的小工具。 + +### 插件的工作原理 +dde-dock 插件本质是一个按 Qt 插件标准所开发的共享库文件(`so`)。通过 dde-dock 预定的规范与提供的接口,共同完成 dde-dock 的功能扩展。 + +## 准备环境 +插件的开发环境可以是任意的,只要是符合 Qt 插件规范及 dde-dock 插件规范的共享库文件,都可以被当作 dde-dock 插件载入。下面以 Qt + qmake 为例进行说明: + +### 安装依赖 +以 Deepin 15.5 环境为基础,至少先安装如下的包: + +- dde-dock-dev +- qt5-qmake +- qtbase5-dev-tools +- libqt5core5a +- libqt5widgets5 +- pkg-config + +## 基本的项目结构 + +### 创建必需的项目目录与文件 +插件名称叫做`home_monitor`,所以创建以下的目录结构: +``` +home_monitor +├── home_monitor.json +├── homemonitorplugin.cpp +├── homemonitorplugin.h +└── home_monitor.pro +``` + +`home_monitor.pro`文件内容如下: +``` qmake +# 添加所需的 Qt 模块 +QT += widgets +# 指定生成目标为共享库 +TEMPLATE = lib +# 指定生成目标为 Qt 插件 +CONFIG += plugin c++11 + +# 指定生成目标的名称 +TARGET = $$qtLibraryTarget(home_monitor) +# 指定生成目标的目录 +DESTDIR = $$_PRO_FILE_PWD_ +# 添加必要的文件到插件中 +DISTFILES += home_monitor.json + +HEADERS += \ + homemonitorplugin.h + +SOURCES += \ + homemonitorplugin.cpp + +# 以下是安装相关的设定 +isEmpty(PREFIX) { + PREFIX = /usr +} + +target.path = $${PREFIX}/lib/dde-dock/plugins/ +INSTALLS += target +``` + +`home_monitor.json`文件指明了当前插件所使用的 dde-dock 的接口版本,dde-dock 在加载此插件时,会检测自己的接口版本是否与插件的接口版本一致,当双方的接口版本不一致时,dde-dock 为了安全将阻止加载对应的插件。 + +在 dde-dock 内建的插件代码中,可以找到当前具体的接口版本,目前只有 1.0 版本。 +``` json +{ + "api": "1.0" +} +``` + +`homemonitorplugin.h`包含了类`HomeMonitorPlugin`,它继承自`PluginItemInterface`,这代表了它是一个实现了 dde-dock 接口的插件。 + +`PluginItemInterface`中包含众多的功能接口以丰富插件的功能,具体的接口功能与用法可以查看对应文件中的文档。大多数接口在没有特定需求的时候都是无需处理的,需要所有插件显式处理的接口只有`pluginName`、`init`、`itemWidget`三个接口。 +``` c++ +#ifndef HOMEMONITORPLUGIN_H +#define HOMEMONITORPLUGIN_H + +#include + +#include + +class HomeMonitorPlugin : public QObject, PluginsItemInterface +{ + Q_OBJECT + Q_INTERFACES(PluginsItemInterface) + Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "home_monitor.json") + +public: + explicit HomeMonitorPlugin(QObject *parent = nullptr); + + // 返回插件的名称,必须是唯一值,不可以和其它插件冲突 + const QString pluginName() const override; + // 插件初始化函数 + void init(PluginProxyInterface *proxyInter) override; + + // 返回插件的 widget + QWidget *itemWidget(const QString &itemKey) override; +}; + +#endif // HOMEMONITORPLUGIN_H +``` + +`homemonitorplugin.cpp`中包含对应接口的实现 +``` c++ +#include "homemonitorplugin.h" + +HomeMonitorPlugin::HomeMonitorPlugin(QObject *parent) + : QObject(parent) +{ + +} + +const QString HomeMonitorPlugin::pluginName() const +{ + return QStringLiteral("home_monitor"); +} + +void HomeMonitorPlugin::init(PluginProxyInterface *proxyInter) +{ + m_proxyInter = proxyInter; +} + +QWidget *HomeMonitorPlugin::itemWidget(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + return nullptr; +} +``` + +## 测试插件加载 +### 从源码构建 +为了不污染源码目录,推荐在源码目录中创建`build`进行构建: +``` sh +cd home_monitor +mkdir build +cd build +qmake .. +make -j4 +``` +### 安装 +``` +sudo make install +``` + +可以看到有`home_monitor.so`文件被安装在了 dde-dock 的插件目录。 + +``` sh +install -m 755 -p ../../home_monitor/libhome_monitor.so /usr/lib/dde-dock/plugins/libhome_monitor.so +``` + +### 测试加载 +执行`pkill dde-dock; dde-dock`来重新运行 dde-dock,在终端输出中如果出现以下的输出,说明插件的加载已经正常。 +``` +init plugin: "home_monitor" +init plugin finished: "home_monitor" +``` + +## 创建自己的 widget +按照一般的业务逻辑处理,这部分不是本教程的重点,可以参考完整代码及其它插件进行实现。 + +## 添加 widget 到 dde-dock 面板上 +在`init`方法中获取到了`PluginProxyInterface`对象,调用此对象的`itemAdded`即可实现向 dde-dock 面板上添加项目。 +第二个`QString`类型的参数代表了本插件所提供的 item 的 id,当一个插件提供多个 item 时,不同 item 之间的 id 要保证唯一。 +``` c++ +proxyInter->itemAdded(this, QString()); +``` + +在调用`itemAdded`之后,dde-dock 会在合适的时机调用插件的`itemWidget`接口以获取需要显示的 widget。在 itemWidget 接口中分析 itemKey,返回与之对应的 widget 对象,当插件只有一个可显示项目时,itemKey 可以忽略。 +``` c++ +QWidget *HomeMonitorPlugin::itemWidget(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + return m_pluginWidget; +} +``` \ No newline at end of file diff -Nru dde-dock-4.5.9.1/plugins/plugins.pro dde-dock-4.6.3.1/plugins/plugins.pro --- dde-dock-4.5.9.1/plugins/plugins.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/plugins.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = \ - datetime \ - shutdown \ - system-tray \ - #disk-mount \ - network \ - #trash \ - sound diff -Nru dde-dock-4.5.9.1/plugins/shutdown/CMakeLists.txt dde-dock-4.6.3.1/plugins/shutdown/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/shutdown/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,24 @@ + +set(PLUGIN_NAME "shutdown") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(DtkWidget REQUIRED) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/shutdown/dbus/dbusaccount.cpp dde-dock-4.6.3.1/plugins/shutdown/dbus/dbusaccount.cpp --- dde-dock-4.5.9.1/plugins/shutdown/dbus/dbusaccount.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/dbus/dbusaccount.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/shutdown/dbus/dbusaccount.h dde-dock-4.6.3.1/plugins/shutdown/dbus/dbusaccount.h --- dde-dock-4.5.9.1/plugins/shutdown/dbus/dbusaccount.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/dbus/dbusaccount.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2015 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/shutdown/pluginwidget.cpp dde-dock-4.6.3.1/plugins/shutdown/pluginwidget.cpp --- dde-dock-4.5.9.1/plugins/shutdown/pluginwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/pluginwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/shutdown/pluginwidget.h dde-dock-4.6.3.1/plugins/shutdown/pluginwidget.h --- dde-dock-4.5.9.1/plugins/shutdown/pluginwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/pluginwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/shutdown/powerstatuswidget.cpp dde-dock-4.6.3.1/plugins/shutdown/powerstatuswidget.cpp --- dde-dock-4.5.9.1/plugins/shutdown/powerstatuswidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/powerstatuswidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -92,14 +92,9 @@ percentageStr = "000"; } - QString iconStr; - - if (plugged) { - iconStr = "battery-charged-symbolic"; - } else { - iconStr = QString("battery-%1-symbolic").arg(percentageStr); - } - + const QString iconStr = QString("battery-%1-%2") + .arg(percentageStr) + .arg(plugged ? "plugged-symbolic" : "symbolic"); const auto ratio = devicePixelRatioF(); QPixmap pix = QIcon::fromTheme(iconStr).pixmap(QSize(16, 16) * ratio); pix.setDevicePixelRatio(ratio); diff -Nru dde-dock-4.5.9.1/plugins/shutdown/powerstatuswidget.h dde-dock-4.6.3.1/plugins/shutdown/powerstatuswidget.h --- dde-dock-4.5.9.1/plugins/shutdown/powerstatuswidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/powerstatuswidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/shutdown/shutdownplugin.cpp dde-dock-4.6.3.1/plugins/shutdown/shutdownplugin.cpp --- dde-dock-4.5.9.1/plugins/shutdown/shutdownplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/shutdownplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -228,6 +228,18 @@ updateBatteryVisible(); } +int ShutdownPlugin::itemSortKey(const QString &itemKey) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + return m_settings.value(key, 0).toInt(); +} + +void ShutdownPlugin::setSortKey(const QString &itemKey, const int order) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + m_settings.setValue(key, order); +} + void ShutdownPlugin::updateBatteryVisible() { const bool exist = !m_powerInter->batteryPercentage().isEmpty(); diff -Nru dde-dock-4.5.9.1/plugins/shutdown/shutdownplugin.h dde-dock-4.6.3.1/plugins/shutdown/shutdownplugin.h --- dde-dock-4.5.9.1/plugins/shutdown/shutdownplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/shutdownplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -56,6 +56,9 @@ void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override; void displayModeChanged(const Dock::DisplayMode displayMode) override; + int itemSortKey(const QString &itemKey); + void setSortKey(const QString &itemKey, const int order); + private: void updateBatteryVisible(); void requestContextMenu(const QString &itemKey); diff -Nru dde-dock-4.5.9.1/plugins/shutdown/shutdown.pro dde-dock-4.6.3.1/plugins/shutdown/shutdown.pro --- dde-dock-4.5.9.1/plugins/shutdown/shutdown.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/shutdown/shutdown.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += - -TARGET = $$qtLibraryTarget(shutdown) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += shutdown.json - -HEADERS += \ - shutdownplugin.h \ - dbus/dbuspower.h \ - pluginwidget.h \ - powerstatuswidget.h \ - dbus/dbusaccount.h - -SOURCES += \ - shutdownplugin.cpp \ - dbus/dbuspower.cpp \ - pluginwidget.cpp \ - powerstatuswidget.cpp \ - dbus/dbusaccount.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources.qrc diff -Nru dde-dock-4.5.9.1/plugins/sound/CMakeLists.txt dde-dock-4.6.3.1/plugins/sound/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/sound/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,32 @@ + +set(PLUGIN_NAME "sound") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(DtkWidget REQUIRED) + +pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) +pkg_check_modules(QGSettings REQUIRED gsettings-qt) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources/resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${DFrameworkDBus_INCLUDE_DIRS} + ${QGSettings_INCLUDE_DIRS} + ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${DFrameworkDBus_LIBRARIES} + ${QGSettings_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/sound/componments/horizontalseparator.cpp dde-dock-4.6.3.1/plugins/sound/componments/horizontalseparator.cpp --- dde-dock-4.5.9.1/plugins/sound/componments/horizontalseparator.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/componments/horizontalseparator.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/componments/horizontalseparator.h dde-dock-4.6.3.1/plugins/sound/componments/horizontalseparator.h --- dde-dock-4.5.9.1/plugins/sound/componments/horizontalseparator.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/componments/horizontalseparator.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/componments/volumeslider.cpp dde-dock-4.6.3.1/plugins/sound/componments/volumeslider.cpp --- dde-dock-4.5.9.1/plugins/sound/componments/volumeslider.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/componments/volumeslider.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -86,18 +86,20 @@ void VolumeSlider::mouseMoveEvent(QMouseEvent *e) { const int value = minimum() + (double((maximum()) - minimum()) * e->x() / rect().width()); + const int normalized = std::max(std::min(1000, value), 0); - QSlider::setValue(std::max(std::min(1000, value), 0)); - emit valueChanged(std::max(std::min(1000, value), 0)); + QSlider::setValue(normalized); + + emit valueChanged(normalized); } void VolumeSlider::mouseReleaseEvent(QMouseEvent *e) { - if (e->button() == Qt::LeftButton) { + if (e->button() == Qt::LeftButton) + { m_pressed = false; emit requestPlaySoundEffect(); } - // QTimer::singleShot(100, [this] {m_pressed = false;}); } void VolumeSlider::wheelEvent(QWheelEvent *e) diff -Nru dde-dock-4.5.9.1/plugins/sound/componments/volumeslider.h dde-dock-4.6.3.1/plugins/sound/componments/volumeslider.h --- dde-dock-4.5.9.1/plugins/sound/componments/volumeslider.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/componments/volumeslider.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/dbus/dbussink.h dde-dock-4.6.3.1/plugins/sound/dbus/dbussink.h --- dde-dock-4.5.9.1/plugins/sound/dbus/dbussink.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/dbus/dbussink.h 2018-04-11 09:44:14.000000000 +0000 @@ -119,6 +119,14 @@ return asyncCallWithArgumentList(QStringLiteral("SetMute"), argumentList); } + inline void SetMuteQueued(bool in0) + { + QList argumentList; + argumentList << QVariant::fromValue(in0); + + CallQueued("SetMute", argumentList); + } + inline QDBusPendingReply<> SetPort(const QString &in0) { QList argumentList; @@ -133,6 +141,53 @@ return asyncCallWithArgumentList(QStringLiteral("SetVolume"), argumentList); } + inline void SetVolumeQueued(double volume, bool feedBack) + { + QList argumentList; + argumentList << QVariant::fromValue(volume) << QVariant::fromValue(feedBack); + + CallQueued("SetVolume", argumentList); + } + +private: + inline void CallQueued(const QString &callName, const QList &args) + { + if (m_waittingCalls.contains(callName)) + { + m_waittingCalls[callName] = args; + return; + } + + if (m_processingCalls.contains(callName)) + { + m_waittingCalls.insert(callName, args); + } else { + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args)); + connect(watcher, &QDBusPendingCallWatcher::finished, this, &DBusSink::onPendingCallFinished); + + m_processingCalls.insert(callName, watcher); + } + } + +private slots: + void onPendingCallFinished(QDBusPendingCallWatcher *w) + { + w->deleteLater(); + + const auto callName = m_processingCalls.key(w); + Q_ASSERT(!callName.isEmpty()); + if (callName.isEmpty()) + return; + + m_processingCalls.remove(callName); + + if (!m_waittingCalls.contains(callName)) + return; + + const auto args = m_waittingCalls.take(callName); + CallQueued(callName, args); + } + Q_SIGNALS: // SIGNALS // begin property changed signals void BalanceChanged(); @@ -144,6 +199,10 @@ void SupportBalanceChanged(); void SupportFadeChanged(); void VolumeChanged(); + +private: + QMap m_processingCalls; + QMap> m_waittingCalls; }; namespace com { diff -Nru dde-dock-4.5.9.1/plugins/sound/dbus/dbussinkinput.h dde-dock-4.6.3.1/plugins/sound/dbus/dbussinkinput.h --- dde-dock-4.5.9.1/plugins/sound/dbus/dbussinkinput.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/dbus/dbussinkinput.h 2018-04-11 09:44:14.000000000 +0000 @@ -109,6 +109,14 @@ return asyncCallWithArgumentList(QStringLiteral("SetMute"), argumentList); } + inline void SetMuteQueued(bool in0) + { + QList argumentList; + argumentList << QVariant::fromValue(in0); + + CallQueued("SetMute", argumentList); + } + inline QDBusPendingReply<> SetVolume(double volume, bool feedBack) { QList argumentList; @@ -116,6 +124,53 @@ return asyncCallWithArgumentList(QStringLiteral("SetVolume"), argumentList); } + inline void SetVolumeQueued(double volume, bool feedBack) + { + QList argumentList; + argumentList << QVariant::fromValue(volume) << QVariant::fromValue(feedBack); + + CallQueued("SetVolume", argumentList); + } + +private: + inline void CallQueued(const QString &callName, const QList &args) + { + if (m_waittingCalls.contains(callName)) + { + m_waittingCalls[callName] = args; + return; + } + + if (m_processingCalls.contains(callName)) + { + m_waittingCalls.insert(callName, args); + } else { + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args)); + connect(watcher, &QDBusPendingCallWatcher::finished, this, &DBusSinkInput::onPendingCallFinished); + + m_processingCalls.insert(callName, watcher); + } + } + +private slots: + void onPendingCallFinished(QDBusPendingCallWatcher *w) + { + w->deleteLater(); + + const auto callName = m_processingCalls.key(w); + Q_ASSERT(!callName.isEmpty()); + if (callName.isEmpty()) + return; + + m_processingCalls.remove(callName); + + if (!m_waittingCalls.contains(callName)) + return; + + const auto args = m_waittingCalls.take(callName); + CallQueued(callName, args); + } + Q_SIGNALS: // SIGNALS // begin property changed signals void BalanceChanged(); @@ -126,6 +181,10 @@ void SupportBalanceChanged(); void SupportFadeChanged(); void VolumeChanged(); + +private: + QMap m_processingCalls; + QMap> m_waittingCalls; }; namespace com { diff -Nru dde-dock-4.5.9.1/plugins/sound/sinkinputwidget.cpp dde-dock-4.6.3.1/plugins/sound/sinkinputwidget.cpp --- dde-dock-4.5.9.1/plugins/sound/sinkinputwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/sinkinputwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -24,6 +24,7 @@ #include #include #include +#include DWIDGET_USE_NAMESPACE @@ -48,7 +49,6 @@ m_volumeIcon->setAccessibleName("app-" + iconName + "-icon"); m_volumeIcon->setPixmap(getIconFromTheme(iconName, QSize(24, 24))); m_volumeSlider->setAccessibleName("app-" + iconName + "-slider"); - m_volumeSlider->setValue(m_inputInter->volume() * 1000); QHBoxLayout *centralLayout = new QHBoxLayout; centralLayout->addWidget(m_volumeIcon); @@ -61,29 +61,32 @@ connect(m_volumeSlider, &VolumeSlider::requestPlaySoundEffect, this, &SinkInputWidget::onPlaySoundEffect); connect(m_volumeIcon, &DImageButton::clicked, this, &SinkInputWidget::setMute); connect(m_inputInter, &DBusSinkInput::MuteChanged, this, &SinkInputWidget::setMuteIcon); + connect(m_inputInter, &DBusSinkInput::VolumeChanged, this, [=] { m_volumeSlider->setValue(m_inputInter->volume() * 1000); }); setLayout(centralLayout); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setFixedHeight(30); setMuteIcon(); + + emit m_inputInter->VolumeChanged(); } void SinkInputWidget::setVolume(const int value) { - m_inputInter->SetVolume(double(value) / 1000.0, false); + m_inputInter->SetVolumeQueued(double(value) / 1000.0, false); } void SinkInputWidget::setMute() { - m_inputInter->SetMute(!m_inputInter->mute()); + m_inputInter->SetMuteQueued(!m_inputInter->mute()); } void SinkInputWidget::setMuteIcon() { if (m_inputInter->mute()) { const auto ratio = devicePixelRatioF(); - QPixmap muteIcon(QString(":/icons/image/audio-volume-muted-symbolic.svg")); + QPixmap muteIcon = DHiDPIHelper::loadNxPixmap(":/icons/image/audio-volume-muted-symbolic.svg"); QPixmap appIconSource(getIconFromTheme(m_inputInter->icon(), QSize(24, 24))); QPixmap temp(appIconSource.size()); @@ -109,5 +112,5 @@ void SinkInputWidget::onPlaySoundEffect() { // set the mute property to false to play sound effects. - m_inputInter->SetMute(false); + m_inputInter->SetMuteQueued(false); } diff -Nru dde-dock-4.5.9.1/plugins/sound/sinkinputwidget.h dde-dock-4.6.3.1/plugins/sound/sinkinputwidget.h --- dde-dock-4.5.9.1/plugins/sound/sinkinputwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/sinkinputwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/soundapplet.cpp dde-dock-4.6.3.1/plugins/sound/soundapplet.cpp --- dde-dock-4.5.9.1/plugins/sound/soundapplet.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/soundapplet.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -179,7 +179,7 @@ //Keep the same units. slider is 1000.0f, maxVolue need multiplication 10. float m_maxVolume = std::min(1000, m_gsetting->get("output-volume-max").toInt() * 10); - m_defSinkInter->SetVolume(m_volumeSlider->value() / 1000.0f * (m_maxVolume / 1000.0f), false); + m_defSinkInter->SetVolumeQueued(m_volumeSlider->value() / 1000.0f * (m_maxVolume / 1000.0f), false); } void SoundApplet::sinkInputsChanged() @@ -208,7 +208,7 @@ void SoundApplet::toggleMute() { - m_defSinkInter->SetMute(!m_defSinkInter->mute()); + m_defSinkInter->SetMuteQueued(!m_defSinkInter->mute()); } void SoundApplet::delayLoad() @@ -231,5 +231,5 @@ void SoundApplet::onPlaySoundEffect() { // set the mute property to false to play sound effects. - m_defSinkInter->SetMute(false); + m_defSinkInter->SetMuteQueued(false); } diff -Nru dde-dock-4.5.9.1/plugins/sound/soundapplet.h dde-dock-4.6.3.1/plugins/sound/soundapplet.h --- dde-dock-4.5.9.1/plugins/sound/soundapplet.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/soundapplet.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/sounditem.cpp dde-dock-4.6.3.1/plugins/sound/sounditem.cpp --- dde-dock-4.5.9.1/plugins/sound/sounditem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/sounditem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -101,7 +101,7 @@ Q_UNUSED(checked); if (menuId == MUTE) - m_sinkInter->SetMute(!m_sinkInter->mute()); + m_sinkInter->SetMuteQueued(!m_sinkInter->mute()); else if (menuId == SETTINS) QProcess::startDetached("dbus-send --print-reply --dest=com.deepin.dde.ControlCenter /com/deepin/dde/ControlCenter com.deepin.dde.ControlCenter.ShowModule \"string:sound\""); } @@ -147,7 +147,7 @@ QWidget::paintEvent(e); QPainter painter(this); - painter.drawPixmap(rect().center() - m_iconPixmap.rect().center() / qApp->devicePixelRatio(), m_iconPixmap); + painter.drawPixmap(rect().center() - m_iconPixmap.rect().center() / m_iconPixmap.devicePixelRatioF(), m_iconPixmap); } void SoundItem::refershIcon() diff -Nru dde-dock-4.5.9.1/plugins/sound/sounditem.h dde-dock-4.6.3.1/plugins/sound/sounditem.h --- dde-dock-4.5.9.1/plugins/sound/sounditem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/sounditem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/sound/soundplugin.cpp dde-dock-4.6.3.1/plugins/sound/soundplugin.cpp --- dde-dock-4.5.9.1/plugins/sound/soundplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/soundplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -20,6 +20,7 @@ */ #include "soundplugin.h" +#include #define STATE_KEY "enable" @@ -28,7 +29,6 @@ m_settings("deepin", "dde-dock-sound"), m_soundItem(nullptr) { - } const QString SoundPlugin::pluginName() const @@ -101,3 +101,19 @@ m_soundItem->invokeMenuItem(menuId, checked); } + +int SoundPlugin::itemSortKey(const QString &itemKey) +{ + Q_UNUSED(itemKey); + + const QString key = QString("pos_%1").arg(displayMode()); + return m_settings.value(key, 0).toInt(); +} + +void SoundPlugin::setSortKey(const QString &itemKey, const int order) +{ + Q_UNUSED(itemKey); + + const QString key = QString("pos_%1").arg(displayMode()); + m_settings.setValue(key, order); +} diff -Nru dde-dock-4.5.9.1/plugins/sound/soundplugin.h dde-dock-4.6.3.1/plugins/sound/soundplugin.h --- dde-dock-4.5.9.1/plugins/sound/soundplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/soundplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -50,6 +50,9 @@ const QString itemContextMenu(const QString &itemKey); void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked); + int itemSortKey(const QString &itemKey); + void setSortKey(const QString &itemKey, const int order); + private: QSettings m_settings; SoundItem *m_soundItem; diff -Nru dde-dock-4.5.9.1/plugins/sound/sound.pro dde-dock-4.6.3.1/plugins/sound/sound.pro --- dde-dock-4.5.9.1/plugins/sound/sound.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/sound/sound.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg dbus -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += gsettings-qt dtkwidget - -TARGET = $$qtLibraryTarget(sound) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += sound.json - -HEADERS += \ - soundplugin.h \ - sounditem.h \ - soundapplet.h \ - dbus/dbusaudio.h \ - dbus/dbussink.h \ - componments/horizontalseparator.h \ - componments/volumeslider.h \ - dbus/dbussinkinput.h \ - sinkinputwidget.h - -SOURCES += \ - soundplugin.cpp \ - sounditem.cpp \ - soundapplet.cpp \ - dbus/dbusaudio.cpp \ - dbus/dbussink.cpp \ - componments/horizontalseparator.cpp \ - componments/volumeslider.cpp \ - dbus/dbussinkinput.cpp \ - sinkinputwidget.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources/resources.qrc diff -Nru dde-dock-4.5.9.1/plugins/system-tray/abstracttraywidget.cpp dde-dock-4.6.3.1/plugins/system-tray/abstracttraywidget.cpp --- dde-dock-4.5.9.1/plugins/system-tray/abstracttraywidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/abstracttraywidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "abstracttraywidget.h" + +#include +#include + +AbstractTrayWidget::AbstractTrayWidget(QWidget *parent, Qt::WindowFlags f): + QWidget(parent, f) +{ + +} + +AbstractTrayWidget::~AbstractTrayWidget() +{ + +} + +void AbstractTrayWidget::mouseReleaseEvent(QMouseEvent *e) +{ + const QPoint point(e->pos() - rect().center()); + if (point.manhattanLength() > 24) + return; + + e->accept(); + + QPoint globalPos = QCursor::pos(); + uint8_t buttonIndex = XCB_BUTTON_INDEX_1; + + switch (e->button()) { + case Qt:: MiddleButton: + buttonIndex = XCB_BUTTON_INDEX_2; + break; + case Qt::RightButton: + buttonIndex = XCB_BUTTON_INDEX_3; + break; + default: + break; + } + + sendClick(buttonIndex, globalPos.x(), globalPos.y()); +} diff -Nru dde-dock-4.5.9.1/plugins/system-tray/abstracttraywidget.h dde-dock-4.6.3.1/plugins/system-tray/abstracttraywidget.h --- dde-dock-4.5.9.1/plugins/system-tray/abstracttraywidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/abstracttraywidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include + +class QDBusMessage; +class AbstractTrayWidget: public QWidget +{ + Q_OBJECT +public: + explicit AbstractTrayWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + virtual ~AbstractTrayWidget(); + + virtual void setActive(const bool active) = 0; + virtual void updateIcon() = 0; + virtual void sendClick(uint8_t, int, int) = 0; + virtual const QImage trayImage() = 0; + +Q_SIGNALS: + void iconChanged(); + +protected: + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; +}; + diff -Nru dde-dock-4.5.9.1/plugins/system-tray/CMakeLists.txt dde-dock-4.6.3.1/plugins/system-tray/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/system-tray/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,34 @@ + +set(PLUGIN_NAME "system-tray") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB_RECURSE SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(Qt5X11Extras REQUIRED) +find_package(DtkWidget REQUIRED) + +pkg_check_modules(XCB_LIBS REQUIRED xcb-ewmh xcb xcb-image xcb-composite xtst xcb-icccm) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${Qt5DBus_INCLUDE_DIRS} + ${XCB_LIBS_INCLUDE_DIRS} + ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5X11Extras_LIBRARIES} + ${Qt5DBus_LIBRARIES} + ${Qt5Svg_LIBRARIES} + ${XCB_LIBS_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/system-tray/fashiontrayitem.cpp dde-dock-4.6.3.1/plugins/system-tray/fashiontrayitem.cpp --- dde-dock-4.5.9.1/plugins/system-tray/fashiontrayitem.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/fashiontrayitem.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -44,7 +44,7 @@ } -TrayWidget *FashionTrayItem::activeTray() +AbstractTrayWidget *FashionTrayItem::activeTray() const { return m_activeTray; } @@ -54,18 +54,18 @@ m_enableMouseEvent = enable; } -void FashionTrayItem::setActiveTray(TrayWidget *tray) +void FashionTrayItem::setActiveTray(AbstractTrayWidget *tray) { if (!m_activeTray.isNull()) { m_activeTray->setActive(false); - disconnect(m_activeTray, &TrayWidget::iconChanged, this, static_cast(&FashionTrayItem::update)); + disconnect(m_activeTray, &AbstractTrayWidget::iconChanged, this, static_cast(&FashionTrayItem::update)); } if (tray) { tray->setActive(true); - connect(tray, &TrayWidget::iconChanged, this, static_cast(&FashionTrayItem::update)); + connect(tray, &AbstractTrayWidget::iconChanged, this, static_cast(&FashionTrayItem::update)); } m_activeTray = tray; diff -Nru dde-dock-4.5.9.1/plugins/system-tray/fashiontrayitem.h dde-dock-4.6.3.1/plugins/system-tray/fashiontrayitem.h --- dde-dock-4.5.9.1/plugins/system-tray/fashiontrayitem.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/fashiontrayitem.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -25,7 +25,7 @@ #include #include -#include +#include class FashionTrayItem : public QWidget { @@ -34,12 +34,12 @@ public: explicit FashionTrayItem(QWidget *parent = 0); - TrayWidget *activeTray(); + AbstractTrayWidget *activeTray() const; void setMouseEnable(const bool enable); public slots: - void setActiveTray(TrayWidget *tray); + void setActiveTray(AbstractTrayWidget *tray); private: void resizeEvent(QResizeEvent *e); @@ -52,7 +52,7 @@ private: bool m_enableMouseEvent; - QPointer m_activeTray; + QPointer m_activeTray; QPixmap m_backgroundPixmap; QPoint m_pressPoint; diff -Nru dde-dock-4.5.9.1/plugins/system-tray/indicatortraywidget.cpp dde-dock-4.6.3.1/plugins/system-tray/indicatortraywidget.cpp --- dde-dock-4.5.9.1/plugins/system-tray/indicatortraywidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/indicatortraywidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,292 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "indicatortraywidget.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +class IndicatorTrayWidgetPrivate +{ +public: + IndicatorTrayWidgetPrivate(IndicatorTrayWidget *parent) : q_ptr(parent) {} + + void updateContent(); + + void initDBus(const QString &indicatorKey); + + template + void featData(const QString &key, + const QJsonObject &data, + const char *propertyChangedSlot, + Func const &callback) + { + Q_Q(IndicatorTrayWidget); + auto dataConfig = data.value(key).toObject(); + auto dbusService = dataConfig.value("dbus_service").toString(); + auto dbusPath = dataConfig.value("dbus_path").toString(); + auto dbusInterface = dataConfig.value("dbus_interface").toString(); + auto isSystemBus = dataConfig.value("system_dbus").toBool(false); + auto bus = isSystemBus ? QDBusConnection::systemBus() : QDBusConnection::sessionBus(); + + QDBusInterface interface(dbusService, dbusPath, dbusInterface, bus, q); + + if (dataConfig.contains("dbus_method")) { + QString methodName = dataConfig.value("dbus_method").toString(); + auto ratio = q->devicePixelRatioF(); + QDBusReply reply = interface.call(methodName.toStdString().c_str(), ratio); + callback(reply.value()); + } + + if (dataConfig.contains("dbus_properties")) { + auto propertyName = dataConfig.value("dbus_properties").toString(); + auto propertyNameCStr = propertyName.toStdString(); + propertyInterfaceNames.insert(key, dbusInterface); + propertyNames.insert(key, QString::fromStdString(propertyNameCStr)); + callback(interface.property(propertyNameCStr.c_str())); + QDBusConnection::sessionBus().connect(dbusService, + dbusPath, + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + "sa{sv}as", + q, + propertyChangedSlot); + + // FIXME(sbw): hack for qt dbus propery changed signal. + // see: https://bugreports.qt.io/browse/QTBUG-48008 + QDBusConnection::sessionBus().connect(dbusService, + dbusPath, + dbusInterface, + QString("%1Changed").arg(propertyName), + "s", + q, + propertyChangedSlot); + } + } + + template + void propertyChanged(const QString &key, const QDBusMessage &msg, Func const &callback) + { + QList arguments = msg.arguments(); + if (1 == arguments.count()) + { + const QString &v = msg.arguments().at(0).toString(); + callback(v); + return; + } else if (3 != arguments.count()) { + qWarning() << "arguments count must be 3"; + return; + } + + QString interfaceName = msg.arguments().at(0).toString(); + if (interfaceName != propertyInterfaceNames.value(key)) { + qWarning() << "interfaceName mismatch" << interfaceName << propertyInterfaceNames.value(key) << key; + return; + } + QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); + if (changedProps.contains(propertyNames.value(key))) { + callback(changedProps.value(propertyNames.value(key))); + } + } + + QLabel *label = Q_NULLPTR; + QMap propertyNames; + QMap propertyInterfaceNames; + + IndicatorTrayWidget *q_ptr; + Q_DECLARE_PUBLIC(IndicatorTrayWidget) +}; + +IndicatorTrayWidget::IndicatorTrayWidget(const QString &indicatorKey, QWidget *parent, Qt::WindowFlags f) : + AbstractTrayWidget(parent, f), + d_ptr(new IndicatorTrayWidgetPrivate(this)) +{ + Q_D(IndicatorTrayWidget); + + setAttribute(Qt::WA_TranslucentBackground); + + auto layout = new QVBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); + d->label = new QLabel(this); + + QPalette p = palette(); + p.setColor(QPalette::Foreground, Qt::white); + p.setColor(QPalette::Background, Qt::red); + d->label->setPalette(p); + + layout->addWidget(d->label, 0, Qt::AlignCenter); + setLayout(layout); + + // register dbus + auto path = QString("/com/deepin/dde/Dock/Indicator/") + indicatorKey; + auto interface = QString("com.deepin.dde.Dock.Indicator.") + indicatorKey; + auto sessionBus = QDBusConnection::sessionBus(); + sessionBus.registerObject(path, + interface, + this, + QDBusConnection::ExportScriptableSlots); + + d->initDBus(indicatorKey); +} + +IndicatorTrayWidget::~IndicatorTrayWidget() +{ +} + +void IndicatorTrayWidget::setActive(const bool) +{ + +} + +void IndicatorTrayWidget::updateIcon() +{ + +} + +const QImage IndicatorTrayWidget::trayImage() +{ + return grab().toImage(); +} + +void IndicatorTrayWidget::sendClick(uint8_t buttonIndex, int x, int y) +{ + Q_EMIT clicked(buttonIndex, x, y); +} + +QSize IndicatorTrayWidget::sizeHint() const +{ + auto sz = AbstractTrayWidget::sizeHint(); + sz.setHeight(26); + sz.setWidth(26); + return sz; +} + +void IndicatorTrayWidget::setPixmapData(const QByteArray &data) +{ + Q_D(IndicatorTrayWidget); + auto rawPixmap = QPixmap::fromImage(QImage::fromData(data)); + rawPixmap.setDevicePixelRatio(devicePixelRatioF()); + d->label->setPixmap(rawPixmap); + d->updateContent(); +} + +void IndicatorTrayWidget::setPixmapPath(const QString &text) +{ + Q_D(IndicatorTrayWidget); + d->label->setPixmap(QPixmap(text)); + d->updateContent(); +} + +void IndicatorTrayWidget::setText(const QString &text) +{ + Q_D(IndicatorTrayWidget); + d->label->setText(text); + d->updateContent(); +} + +void IndicatorTrayWidget::iconPropertyChanged(const QDBusMessage &msg) +{ + Q_D(IndicatorTrayWidget); + d->propertyChanged("icon", msg, [ = ](QVariant v) { + setPixmapData(v.toByteArray()); + }); +} + +void IndicatorTrayWidget::textPropertyChanged(const QDBusMessage &msg) +{ + Q_D(IndicatorTrayWidget); + d->propertyChanged("text", msg, [ = ](QVariant v) { + setText(v.toString()); + }); +} + +void IndicatorTrayWidgetPrivate::updateContent() +{ + Q_Q(IndicatorTrayWidget); + q->update(); + Q_EMIT q->iconChanged(); +} + +void IndicatorTrayWidgetPrivate::initDBus(const QString &indicatorKey) +{ + Q_Q(IndicatorTrayWidget); + + QString filepath = QString("/etc/dde-dock/indicator/%1.json").arg(indicatorKey); + QFile confFile(filepath); + if (!confFile.open(QIODevice::ReadOnly)) { + qCritical() << "read indicator config Error"; + } + + QJsonDocument doc = QJsonDocument::fromJson(confFile.readAll()); + confFile.close(); + auto config = doc.object(); + + auto delay = config.value("delay").toInt(0); + + qDebug() << "delay load" << delay << indicatorKey << q; + + q->hide(); + QTimer::singleShot(delay, [ = ]() { + auto data = config.value("data").toObject(); + + if (data.contains("text")) { + featData("text", data, SLOT(textPropertyChanged(QDBusMessage)), [ = ](QVariant v) { + q->setText(v.toString()); + }); + } + if (data.contains("icon")) { + featData("icon", data, SLOT(iconPropertyChanged(QDBusMessage)), [ = ](QVariant v) { + q->setPixmapData(v.toByteArray()); + }); + } + + const QJsonObject action = config.value("action").toObject(); + if (!action.isEmpty()) + q->connect(q, &IndicatorTrayWidget::clicked, q, [ = ](uint8_t /*button_index*/, int /*x*/, int /*y*/) { + auto triggerConfig = action.value("trigger").toObject(); + auto dbusService = triggerConfig.value("dbus_service").toString(); + auto dbusPath = triggerConfig.value("dbus_path").toString(); + auto dbusInterface = triggerConfig.value("dbus_interface").toString(); + auto methodName = triggerConfig.value("dbus_method").toString(); + auto isSystemBus = triggerConfig.value("system_dbus").toBool(false); + auto bus = isSystemBus ? QDBusConnection::systemBus() : QDBusConnection::sessionBus(); + + QDBusInterface interface(dbusService, dbusPath, dbusInterface, bus, q); + interface.asyncCall(methodName); + }); + + Q_EMIT q->delayLoaded(); + }); +} diff -Nru dde-dock-4.5.9.1/plugins/system-tray/indicatortraywidget.h dde-dock-4.6.3.1/plugins/system-tray/indicatortraywidget.h --- dde-dock-4.5.9.1/plugins/system-tray/indicatortraywidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/indicatortraywidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include "abstracttraywidget.h" + +class IndicatorTrayWidgetPrivate; +class IndicatorTrayWidget: public AbstractTrayWidget +{ + Q_OBJECT +public: + explicit IndicatorTrayWidget(const QString &itemKey, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + ~IndicatorTrayWidget(); + + void setActive(const bool active) Q_DECL_OVERRIDE; + void updateIcon() Q_DECL_OVERRIDE; + const QImage trayImage() Q_DECL_OVERRIDE; + void sendClick(uint8_t, int, int) Q_DECL_OVERRIDE; + + QSize sizeHint() const Q_DECL_OVERRIDE; + + static QString toTrayWidgetId(const QString &indicatorKey) { return QString("indicator:%1").arg(indicatorKey); } + static QString toIndicatorId(QString itemKey) { return itemKey.remove("indicator:"); } + static bool isIndicatorKey(const QString &itemKey) { return itemKey.startsWith("indicator:"); } + +public Q_SLOTS: + Q_SCRIPTABLE void setPixmapData(const QByteArray &data); + Q_SCRIPTABLE void setPixmapPath(const QString &text); + Q_SCRIPTABLE void setText(const QString &text); + +public Q_SLOTS: + void iconPropertyChanged(const QDBusMessage &msg); + void textPropertyChanged(const QDBusMessage &msg); + +Q_SIGNALS: + void delayLoaded(); + void clicked(uint8_t, int, int); + +private: + QScopedPointer d_ptr; + Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_ptr), IndicatorTrayWidget) +}; + diff -Nru dde-dock-4.5.9.1/plugins/system-tray/systemtrayplugin.cpp dde-dock-4.6.3.1/plugins/system-tray/systemtrayplugin.cpp --- dde-dock-4.5.9.1/plugins/system-tray/systemtrayplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/systemtrayplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -22,6 +22,7 @@ #include "systemtrayplugin.h" #include "fashiontrayitem.h" +#include #include #include #include @@ -65,6 +66,7 @@ switchToMode(displayMode()); QTimer::singleShot(1, this, &SystemTrayPlugin::trayListChanged); + QTimer::singleShot(2, this, &SystemTrayPlugin::loadIndicator); } void SystemTrayPlugin::displayModeChanged(const Dock::DisplayMode mode) @@ -74,12 +76,11 @@ QWidget *SystemTrayPlugin::itemWidget(const QString &itemKey) { - if (itemKey == FASHION_MODE_ITEM) + if (itemKey == FASHION_MODE_ITEM) { return m_fashionItem; + } - const quint32 trayWinId = itemKey.toUInt(); - - return m_trayList.value(trayWinId); + return m_trayList.value(itemKey); } QWidget *SystemTrayPlugin::itemTipsWidget(const QString &itemKey) @@ -95,17 +96,19 @@ QWidget *SystemTrayPlugin::itemPopupApplet(const QString &itemKey) { - if (itemKey != FASHION_MODE_ITEM) + if (itemKey != FASHION_MODE_ITEM) { return nullptr; + } Q_ASSERT(m_trayList.size()); updateTipsContent(); - if (m_trayList.size() > 1) + if (m_trayList.size() > 1) { return m_trayApplet; - else + } else { return nullptr; + } } bool SystemTrayPlugin::itemAllowContainer(const QString &itemKey) @@ -117,24 +120,32 @@ bool SystemTrayPlugin::itemIsInContainer(const QString &itemKey) { - const QString widKey = getWindowClass(itemKey.toInt()); - if (widKey.isEmpty()) - return false; - - return m_containerSettings->value(widKey, false).toBool(); + const QString widKey = getWindowClass(XWindowTrayWidget::toWinId(itemKey)); + if (!widKey.isEmpty()) + return m_containerSettings->value(widKey, false).toBool(); + else + return m_containerSettings->value(itemKey, false).toBool(); } int SystemTrayPlugin::itemSortKey(const QString &itemKey) { - Q_UNUSED(itemKey); + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + return m_containerSettings->value(key, 0).toInt(); +} - return 0; +void SystemTrayPlugin::setSortKey(const QString &itemKey, const int order) +{ + const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode()); + m_containerSettings->setValue(key, order); } void SystemTrayPlugin::setItemIsInContainer(const QString &itemKey, const bool container) { -// qDebug() << getWindowClass(itemKey.toInt()); - m_containerSettings->setValue(getWindowClass(itemKey.toInt()), container); + const QString widKey = getWindowClass(XWindowTrayWidget::toWinId(itemKey)); + if (widKey.isEmpty()) + m_containerSettings->setValue(itemKey, container); + else + m_containerSettings->setValue(widKey, container); } void SystemTrayPlugin::updateTipsContent() @@ -156,8 +167,7 @@ auto result = xcb_icccm_get_wm_class_reply(connection, cookie, reply, &error); QString ret; - if (result == 1) - { + if (result == 1) { ret = QString("%1-%2").arg(reply->class_name).arg(reply->instance_name); xcb_icccm_get_wm_class_reply_wipe(reply); } @@ -170,90 +180,131 @@ void SystemTrayPlugin::trayListChanged() { - QList trayList = m_trayInter->trayIcons(); + QList winidList = m_trayInter->trayIcons(); + QStringList trayList; + + for (auto winid : winidList) { + trayList << XWindowTrayWidget::toTrayWidgetId(winid); + } for (auto tray : m_trayList.keys()) - if (!trayList.contains(tray)) + if (!trayList.contains(tray) && XWindowTrayWidget::isWinIdKey(tray)) { trayRemoved(tray); + } - for (auto tray : trayList) + for (auto tray : trayList) { trayAdded(tray); + } + } -void SystemTrayPlugin::trayAdded(const quint32 winId) +void SystemTrayPlugin::trayAdded(const QString itemKey) { - if (m_trayList.contains(winId)) + if (m_trayList.contains(itemKey)) { return; + } - getWindowClass(winId); - - TrayWidget *trayWidget = new TrayWidget(winId); - - m_trayList.insert(winId, trayWidget); - - m_fashionItem->setMouseEnable(m_trayList.size() == 1); - if (!m_fashionItem->activeTray()) - m_fashionItem->setActiveTray(trayWidget); + auto addTrayWidget = [ = ](AbstractTrayWidget * trayWidget) { + if (trayWidget) { + m_trayList.insert(itemKey, trayWidget); + m_fashionItem->setMouseEnable(m_trayList.size() == 1); + if (!m_fashionItem->activeTray()) { + m_fashionItem->setActiveTray(trayWidget); + } + + if (displayMode() == Dock::Efficient) { + m_proxyInter->itemAdded(this, itemKey); + } else { + m_proxyInter->itemAdded(this, FASHION_MODE_ITEM); + } + } + }; + + if (XWindowTrayWidget::isWinIdKey(itemKey)) { + auto winId = XWindowTrayWidget::toWinId(itemKey); + getWindowClass(winId); + AbstractTrayWidget *trayWidget = new XWindowTrayWidget(winId); + addTrayWidget(trayWidget); + } - if (displayMode() == Dock::Efficient) - m_proxyInter->itemAdded(this, QString::number(winId)); - else - m_proxyInter->itemAdded(this, FASHION_MODE_ITEM); + if (IndicatorTrayWidget::isIndicatorKey(itemKey)) { + QString indicatorKey = IndicatorTrayWidget::toIndicatorId(itemKey); + auto trayWidget = new IndicatorTrayWidget(indicatorKey); + connect(trayWidget, &IndicatorTrayWidget::delayLoaded, + trayWidget, [ = ]() { + addTrayWidget(trayWidget); + }); + } } -void SystemTrayPlugin::trayRemoved(const quint32 winId) +void SystemTrayPlugin::trayRemoved(const QString itemKey) { - if (!m_trayList.contains(winId)) + if (!m_trayList.contains(itemKey)) { return; + } - TrayWidget *widget = m_trayList.take(winId); - m_proxyInter->itemRemoved(this, QString::number(winId)); + QWidget *widget = m_trayList.take(itemKey); + m_proxyInter->itemRemoved(this, itemKey); widget->deleteLater(); m_fashionItem->setMouseEnable(m_trayList.size() == 1); - if (m_trayApplet->isVisible()) + if (m_trayApplet->isVisible()) { updateTipsContent(); + } - if (m_fashionItem->activeTray() && m_fashionItem->activeTray() != widget) + if (m_fashionItem->activeTray() && m_fashionItem->activeTray() != widget) { return; + } // reset active tray - if (m_trayList.values().isEmpty()) - { + if (m_trayList.values().isEmpty()) { m_fashionItem->setActiveTray(nullptr); m_proxyInter->itemRemoved(this, FASHION_MODE_ITEM); - } else + } else { m_fashionItem->setActiveTray(m_trayList.values().last()); + } } -void SystemTrayPlugin::trayChanged(const quint32 winId) +void SystemTrayPlugin::trayChanged(quint32 winId) { - if (!m_trayList.contains(winId)) + QString itemKey = XWindowTrayWidget::toTrayWidgetId(winId); + if (!m_trayList.contains(itemKey)) { return; + } - m_trayList.value(winId)->updateIcon(); - m_fashionItem->setActiveTray(m_trayList[winId]); + m_trayList.value(itemKey)->updateIcon(); + m_fashionItem->setActiveTray(m_trayList.value(itemKey)); - if (m_trayApplet->isVisible()) + if (m_trayApplet->isVisible()) { updateTipsContent(); + } } void SystemTrayPlugin::switchToMode(const Dock::DisplayMode mode) { - if (mode == Dock::Fashion) - { - for (auto winId : m_trayList.keys()) - m_proxyInter->itemRemoved(this, QString::number(winId)); - if (m_trayList.isEmpty()) + if (mode == Dock::Fashion) { + for (auto itemKey : m_trayList.keys()) { + m_proxyInter->itemRemoved(this, itemKey); + } + if (m_trayList.isEmpty()) { m_proxyInter->itemRemoved(this, FASHION_MODE_ITEM); - else + } else { m_proxyInter->itemAdded(this, FASHION_MODE_ITEM); - } - else - { + } + } else { m_proxyInter->itemRemoved(this, FASHION_MODE_ITEM); - for (auto winId : m_trayList.keys()) - m_proxyInter->itemAdded(this, QString::number(winId)); + for (auto itemKey : m_trayList.keys()) { + m_proxyInter->itemAdded(this, itemKey); + } + } +} + +void SystemTrayPlugin::loadIndicator() +{ + QDir indicatorConfDir("/etc/dde-dock/indicator"); + + for (auto fileInfo : indicatorConfDir.entryInfoList({"*.json"}, QDir::Files | QDir::NoDotAndDotDot)) { + trayAdded(IndicatorTrayWidget::toTrayWidgetId(fileInfo.baseName())); } } diff -Nru dde-dock-4.5.9.1/plugins/system-tray/systemtrayplugin.h dde-dock-4.6.3.1/plugins/system-tray/systemtrayplugin.h --- dde-dock-4.5.9.1/plugins/system-tray/systemtrayplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/systemtrayplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -23,10 +23,12 @@ #define SYSTEMTRAYPLUGIN_H #include "pluginsiteminterface.h" -#include "traywidget.h" #include "tipswidget.h" #include "dbus/dbustraymanager.h" +#include "xwindowtraywidget.h" +#include "indicatortraywidget.h" + #include #include @@ -40,34 +42,36 @@ public: explicit SystemTrayPlugin(QObject *parent = 0); - const QString pluginName() const; - void init(PluginProxyInterface *proxyInter); - void displayModeChanged(const Dock::DisplayMode mode); - - QWidget *itemWidget(const QString &itemKey); - QWidget *itemTipsWidget(const QString &itemKey); - QWidget *itemPopupApplet(const QString &itemKey); - - bool itemAllowContainer(const QString &itemKey); - bool itemIsInContainer(const QString &itemKey); - int itemSortKey(const QString &itemKey); - void setItemIsInContainer(const QString &itemKey, const bool container); + const QString pluginName() const Q_DECL_OVERRIDE; + void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE; + void displayModeChanged(const Dock::DisplayMode mode) Q_DECL_OVERRIDE; + + QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE; + QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE; + QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE; + + bool itemAllowContainer(const QString &itemKey) Q_DECL_OVERRIDE; + bool itemIsInContainer(const QString &itemKey) Q_DECL_OVERRIDE; + int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE; + void setSortKey(const QString &itemKey, const int order); + void setItemIsInContainer(const QString &itemKey, const bool container) Q_DECL_OVERRIDE; private: + void loadIndicator(); void updateTipsContent(); const QString getWindowClass(quint32 winId); private slots: void trayListChanged(); - void trayAdded(const quint32 winId); - void trayRemoved(const quint32 winId); - void trayChanged(const quint32 winId); + void trayAdded(const QString itemKey); + void trayRemoved(const QString itemKey); + void trayChanged(quint32 winId); void switchToMode(const Dock::DisplayMode mode); private: DBusTrayManager *m_trayInter; FashionTrayItem *m_fashionItem; - QMap m_trayList; + QMap m_trayList; TrayApplet *m_trayApplet; QLabel *m_tipsLabel; diff -Nru dde-dock-4.5.9.1/plugins/system-tray/system-tray.pro dde-dock-4.6.3.1/plugins/system-tray/system-tray.pro --- dde-dock-4.5.9.1/plugins/system-tray/system-tray.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/system-tray.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets gui core dbus x11extras svg -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += xcb xcb-image xcb-icccm xcb-composite xtst - -TARGET = $$qtLibraryTarget(system-tray) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += system-tray.json - -isEqual(DOCK_TRAY_USE_NATIVE_POPUP, YES) { - DEFINES += DOCK_TRAY_USE_NATIVE_POPUP -} - -HEADERS += \ - systemtrayplugin.h \ - dbus/dbustraymanager.h \ - traywidget.h \ - fashiontrayitem.h \ - tipswidget.h - -SOURCES += \ - systemtrayplugin.cpp \ - dbus/dbustraymanager.cpp \ - traywidget.cpp \ - fashiontrayitem.cpp \ - tipswidget.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ - resources.qrc diff -Nru dde-dock-4.5.9.1/plugins/system-tray/tipswidget.cpp dde-dock-4.6.3.1/plugins/system-tray/tipswidget.cpp --- dde-dock-4.5.9.1/plugins/system-tray/tipswidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/tipswidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -20,7 +20,7 @@ */ #include "tipswidget.h" -#include "traywidget.h" +#include "abstracttraywidget.h" TrayApplet::TrayApplet(QWidget *parent) : QWidget(parent), @@ -44,7 +44,7 @@ } } -void TrayApplet::addWidgets(QList &widgets) +void TrayApplet::addWidgets(QList &widgets) { for (auto w : widgets) { diff -Nru dde-dock-4.5.9.1/plugins/system-tray/tipswidget.h dde-dock-4.6.3.1/plugins/system-tray/tipswidget.h --- dde-dock-4.5.9.1/plugins/system-tray/tipswidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/tipswidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * @@ -25,7 +25,7 @@ #include #include -class TrayWidget; +class AbstractTrayWidget; class TrayApplet : public QWidget { Q_OBJECT @@ -34,7 +34,7 @@ explicit TrayApplet(QWidget *parent = 0); void clear(); - void addWidgets(QList &widgets); + void addWidgets(QList &widgets); private: QBoxLayout *m_mainLayout; diff -Nru dde-dock-4.5.9.1/plugins/system-tray/traywidget.cpp dde-dock-4.6.3.1/plugins/system-tray/traywidget.cpp --- dde-dock-4.5.9.1/plugins/system-tray/traywidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/traywidget.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "traywidget.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -static const qreal iconSize = 16; - -#define DRAG_THRESHOLD 20 - -const QPoint rawXPosition(const QPoint &scaledPos) -{ - QRect g = qApp->primaryScreen()->geometry(); - for (auto *screen : qApp->screens()) - { - const QRect &sg = screen->geometry(); - if (sg.contains(scaledPos)) - { - g = sg; - break; - } - } - - return g.topLeft() + (scaledPos - g.topLeft()) * qApp->devicePixelRatio(); -} - -void sni_cleanup_xcb_image(void *data) -{ - xcb_image_destroy(static_cast(data)); -} - -TrayWidget::TrayWidget(quint32 winId, QWidget *parent) - : QWidget(parent), - m_windowId(winId) -{ - wrapWindow(); - - m_updateTimer = new QTimer(this); - m_updateTimer->setInterval(100); - m_updateTimer->setSingleShot(true); - - m_sendHoverEvent = new QTimer(this); - m_sendHoverEvent->setInterval(100); - m_sendHoverEvent->setSingleShot(true); - - connect(m_updateTimer, &QTimer::timeout, this, &TrayWidget::refershIconImage); -#ifdef DOCK_TRAY_USE_NATIVE_POPUP - connect(m_sendHoverEvent, &QTimer::timeout, this, &TrayWidget::sendHoverEvent); -#endif - - setMouseTracking(true); - setFixedSize(26, 26); - m_updateTimer->start(); -} - -TrayWidget::~TrayWidget() -{ -} - -const QImage TrayWidget::trayImage() -{ - return m_image; -} - -QSize TrayWidget::sizeHint() const -{ - return QSize(26, 26); -} - -void TrayWidget::showEvent(QShowEvent *e) -{ - QWidget::showEvent(e); - - m_updateTimer->start(); -} - -void TrayWidget::paintEvent(QPaintEvent *e) -{ - Q_UNUSED(e); - if (m_image.isNull()) - return m_updateTimer->start(); - - QPainter painter; - painter.begin(this); - painter.setRenderHint(QPainter::Antialiasing); -#ifdef QT_DEBUG -// painter.fillRect(rect(), Qt::red); -#endif - - const QPoint p = rect().center() - m_image.rect().center() / m_image.devicePixelRatioF(); - painter.drawImage(p, m_image); - - painter.end(); -} - -void TrayWidget::mousePressEvent(QMouseEvent *e) -{ - e->accept(); - const QPoint point(e->pos() - rect().center()); - if (point.manhattanLength() > 24) - e->ignore(); - - QWidget::mousePressEvent(e); -} - -void TrayWidget::mouseReleaseEvent(QMouseEvent *e) -{ - const QPoint point(e->pos() - rect().center()); - if (point.manhattanLength() > 24) - return; - - e->accept(); - - QPoint globalPos = QCursor::pos(); - uint8_t buttonIndex = XCB_BUTTON_INDEX_1; - - switch (e->button()) { - case Qt:: MiddleButton: - buttonIndex = XCB_BUTTON_INDEX_2; - break; - case Qt::RightButton: - buttonIndex = XCB_BUTTON_INDEX_3; - break; - default: - break; - } - - sendClick(buttonIndex, globalPos.x(), globalPos.y()); -} - -void TrayWidget::mouseMoveEvent(QMouseEvent *e) -{ - QWidget::mouseMoveEvent(e); - - m_sendHoverEvent->start(); -} - -void TrayWidget::configContainerPosition() -{ - auto c = QX11Info::connection(); - - const QPoint p(rawXPosition(QCursor::pos())); - - const uint32_t containerVals[4] = {uint32_t(p.x()), uint32_t(p.y()), 1, 1}; - xcb_configure_window(c, m_containerWid, - XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, - containerVals); - xcb_flush(c); -} - -void TrayWidget::wrapWindow() -{ - auto c = QX11Info::connection(); - - auto cookie = xcb_get_geometry(c, m_windowId); - QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); - if (clientGeom.isNull()) - return; - - //create a container window - const auto ratio = devicePixelRatioF(); - auto screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; - m_containerWid = xcb_generate_id(c); - uint32_t values[2]; - auto mask = XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT; - values[0] = ParentRelative; //draw a solid background so the embedded icon doesn't get garbage in it - values[1] = true; //bypass wM - xcb_create_window (c, /* connection */ - XCB_COPY_FROM_PARENT, /* depth */ - m_containerWid, /* window Id */ - screen->root, /* parent window */ - 0, 0, /* x, y */ - iconSize * ratio, iconSize * ratio, /* width, height */ - 0, /* border_width */ - XCB_WINDOW_CLASS_INPUT_OUTPUT,/* class */ - screen->root_visual, /* visual */ - mask, values); /* masks */ - - /* - We need the window to exist and be mapped otherwise the child won't render it's contents - - We also need it to exist in the right place to get the clicks working as GTK will check sendEvent locations to see if our window is in the right place. So even though our contents are drawn via compositing we still put this window in the right place - - We can't composite it away anything parented owned by the root window (apparently) - Stack Under works in the non composited case, but it doesn't seem to work in kwin's composited case (probably need set relevant NETWM hint) - - As a last resort set opacity to 0 just to make sure this container never appears - */ -// const uint32_t stackBelowData[] = {XCB_STACK_MODE_BELOW}; -// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData); - - QWindow * win = QWindow::fromWinId(m_containerWid); - win->setOpacity(0); - -// setX11PassMouseEvent(true); - - xcb_flush(c); - - xcb_map_window(c, m_containerWid); - - xcb_reparent_window(c, m_windowId, - m_containerWid, - 0, 0); - - /* - * Render the embedded window offscreen - */ - xcb_composite_redirect_window(c, m_windowId, XCB_COMPOSITE_REDIRECT_MANUAL); - - - /* we grab the window, but also make sure it's automatically reparented back - * to the root window if we should die. - */ - xcb_change_save_set(c, XCB_SET_MODE_INSERT, m_windowId); - - //tell client we're embedding it - // xembed_message_send(m_windowId, XEMBED_EMBEDDED_NOTIFY, m_containerWid, 0, 0); - - //move window we're embedding - /* - const uint32_t windowMoveConfigVals[2] = { 0, 0 }; - xcb_configure_window(c, m_windowId, - XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, - windowMoveCentially quitting the application. Returns onfigVals); - */ - - //if the window is a clearly stupid size resize to be something sensible - //this is needed as chormium and such when resized just fill the icon with transparent space and only draw in the middle - //however spotify does need this as by default the window size is 900px wide. - //use an artbitrary heuristic to make sure icons are always sensible -// if (clientGeom->width > iconSize || clientGeom->height > iconSize ) - { - const uint32_t windowMoveConfigVals[2] = { uint32_t(iconSize * ratio), uint32_t(iconSize * ratio) }; - xcb_configure_window(c, m_windowId, - XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, - windowMoveConfigVals); - } - - //show the embedded window otherwise nothing happens - xcb_map_window(c, m_windowId); - -// xcb_clear_area(c, 0, m_windowId, 0, 0, qMin(clientGeom->width, iconSize), qMin(clientGeom->height, iconSize)); - - xcb_flush(c); -// setWindowOnTop(false); - setWindowOnTop(true); - setX11PassMouseEvent(true); -} - -void TrayWidget::sendHoverEvent() -{ - // fake enter event - const QPoint p(rawXPosition(QCursor::pos())); - configContainerPosition(); - setX11PassMouseEvent(false); - setWindowOnTop(true); - XTestFakeMotionEvent(QX11Info::display(), 0, p.x(), p.y(), CurrentTime); - XFlush(QX11Info::display()); - QTimer::singleShot(100, this, [=] { setX11PassMouseEvent(true); }); -} - -void TrayWidget::updateIcon() -{ - if (!isVisible() && !m_active) - return; - - m_updateTimer->start(); -} - -//void TrayWidget::hideIcon() -//{ -// auto c = QX11Info::connection(); - -// const uint32_t stackAboveData[] = {XCB_STACK_MODE_BELOW}; -// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); - -// const uint32_t windowMoveConfigVals[2] = {0, 0}; -// xcb_configure_window(c, m_containerWid, -// XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, -// windowMoveConfigVals); - -// hide(); -//} - -void TrayWidget::sendClick(uint8_t mouseButton, int x, int y) -{ - if (isBadWindow()) - return; - - m_sendHoverEvent->stop(); - - const QPoint p(rawXPosition(QPoint(x, y))); - configContainerPosition(); - setX11PassMouseEvent(false); - setWindowOnTop(true); - XTestFakeMotionEvent(QX11Info::display(), 0, p.x(), p.y(), CurrentTime); - XFlush(QX11Info::display()); - XTestFakeButtonEvent(QX11Info::display(), mouseButton, true, CurrentTime); - XFlush(QX11Info::display()); - XTestFakeButtonEvent(QX11Info::display(), mouseButton, false, CurrentTime); - XFlush(QX11Info::display()); - QTimer::singleShot(100, this, [=] { setX11PassMouseEvent(true); }); -} - -void TrayWidget::setActive(const bool active) -{ - m_active = active; - m_updateTimer->start(); -} - -void TrayWidget::refershIconImage() -{ - const auto ratio = devicePixelRatioF(); - auto c = QX11Info::connection(); - auto cookie = xcb_get_geometry(c, m_windowId); - QScopedPointer geom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); - if (geom.isNull()) - return; - - xcb_expose_event_t expose; - expose.response_type = XCB_EXPOSE; - expose.window = m_containerWid; - expose.x = 0; - expose.y = 0; - expose.width = iconSize * ratio; - expose.height = iconSize * ratio; - xcb_send_event_checked(c, false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast(&expose)); - xcb_flush(c); - - xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP); - if (!image) - return; - - QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image); - if (qimage.isNull()) - return; - - m_image = qimage.scaled(16 * ratio, 16 * ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation); - m_image.setDevicePixelRatio(ratio); - - update(); - emit iconChanged(); -} - -void TrayWidget::setX11PassMouseEvent(const bool pass) -{ - if (pass) - { - XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeBounding, 0, 0, nullptr, 0, ShapeSet, YXBanded); - XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeInput, 0, 0, nullptr, 0, ShapeSet, YXBanded); - } - else - { - XRectangle rectangle; - rectangle.x = 0; - rectangle.y = 0; - rectangle.width = 1; - rectangle.height = 1; - - XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeBounding, 0, 0, &rectangle, 1, ShapeSet, YXBanded); - XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeInput, 0, 0, &rectangle, 1, ShapeSet, YXBanded); - } - - XFlush(QX11Info::display()); -} - -void TrayWidget::setWindowOnTop(const bool top) -{ - auto c = QX11Info::connection(); - const uint32_t stackAboveData[] = {top ? XCB_STACK_MODE_ABOVE : XCB_STACK_MODE_BELOW}; - xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); - xcb_flush(c); -} - -bool TrayWidget::isBadWindow() -{ - auto c = QX11Info::connection(); - - auto cookie = xcb_get_geometry(c, m_windowId); - QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); - return clientGeom.isNull(); -} diff -Nru dde-dock-4.5.9.1/plugins/system-tray/traywidget.h dde-dock-4.6.3.1/plugins/system-tray/traywidget.h --- dde-dock-4.5.9.1/plugins/system-tray/traywidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/traywidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef TRAYWIDGET_H -#define TRAYWIDGET_H - -#include -#include - -class TrayWidget : public QWidget -{ - Q_OBJECT - -public: - explicit TrayWidget(quint32 winId, QWidget *parent = 0); - ~TrayWidget(); - - void updateIcon(); - const QImage trayImage(); - void sendClick(uint8_t mouseButton, int x, int y); - void setActive(const bool active); - -signals: - void iconChanged(); - -private: - QSize sizeHint() const; - void showEvent(QShowEvent *e); - void paintEvent(QPaintEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void configContainerPosition(); - - void wrapWindow(); - void sendHoverEvent(); -// void hideIcon(); - void refershIconImage(); - -private slots: - void setX11PassMouseEvent(const bool pass); - void setWindowOnTop(const bool top); - bool isBadWindow(); - -private: - bool m_active = false; - WId m_windowId; - WId m_containerWid; - QImage m_image; - - QTimer *m_updateTimer; - QTimer *m_sendHoverEvent; -}; - -#endif // TRAYWIDGET_H diff -Nru dde-dock-4.5.9.1/plugins/system-tray/xwindowtraywidget.cpp dde-dock-4.6.3.1/plugins/system-tray/xwindowtraywidget.cpp --- dde-dock-4.5.9.1/plugins/system-tray/xwindowtraywidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/xwindowtraywidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,391 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "xwindowtraywidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static const qreal iconSize = 16; + +#define DRAG_THRESHOLD 20 + +const QPoint rawXPosition(const QPoint &scaledPos) +{ + QRect g = qApp->primaryScreen()->geometry(); + for (auto *screen : qApp->screens()) + { + const QRect &sg = screen->geometry(); + if (sg.contains(scaledPos)) + { + g = sg; + break; + } + } + + return g.topLeft() + (scaledPos - g.topLeft()) * qApp->devicePixelRatio(); +} + +void sni_cleanup_xcb_image(void *data) +{ + xcb_image_destroy(static_cast(data)); +} + +XWindowTrayWidget::XWindowTrayWidget(quint32 winId, QWidget *parent) + : AbstractTrayWidget(parent), + m_windowId(winId) +{ + wrapWindow(); + + m_updateTimer = new QTimer(this); + m_updateTimer->setInterval(100); + m_updateTimer->setSingleShot(true); + + m_sendHoverEvent = new QTimer(this); + m_sendHoverEvent->setInterval(100); + m_sendHoverEvent->setSingleShot(true); + + connect(m_updateTimer, &QTimer::timeout, this, &XWindowTrayWidget::refershIconImage); +#ifdef DOCK_TRAY_USE_NATIVE_POPUP + connect(m_sendHoverEvent, &QTimer::timeout, this, &XWindowTrayWidget::sendHoverEvent); +#endif + + setMouseTracking(true); + + m_updateTimer->start(); +} + +XWindowTrayWidget::~XWindowTrayWidget() +{ +} + +const QImage XWindowTrayWidget::trayImage() +{ + return m_image; +} + +QSize XWindowTrayWidget::sizeHint() const +{ + return QSize(26, 26); +} + +void XWindowTrayWidget::showEvent(QShowEvent *e) +{ + QWidget::showEvent(e); + + m_updateTimer->start(); +} + +void XWindowTrayWidget::paintEvent(QPaintEvent *e) +{ + Q_UNUSED(e); + if (m_image.isNull()) + return m_updateTimer->start(); + + QPainter painter; + painter.begin(this); + painter.setRenderHint(QPainter::Antialiasing); +#ifdef QT_DEBUG +// painter.fillRect(rect(), Qt::red); +#endif + + const QPoint p = rect().center() - m_image.rect().center() / m_image.devicePixelRatioF(); + painter.drawImage(p, m_image); + + painter.end(); +} + +void XWindowTrayWidget::mousePressEvent(QMouseEvent *e) +{ + e->accept(); + const QPoint point(e->pos() - rect().center()); + if (point.manhattanLength() > 24) + e->ignore(); + + QWidget::mousePressEvent(e); +} + +void XWindowTrayWidget::mouseMoveEvent(QMouseEvent *e) +{ + QWidget::mouseMoveEvent(e); + + m_sendHoverEvent->start(); +} + +void XWindowTrayWidget::configContainerPosition() +{ + auto c = QX11Info::connection(); + + const QPoint p(rawXPosition(QCursor::pos())); + + const uint32_t containerVals[4] = {uint32_t(p.x()), uint32_t(p.y()), 1, 1}; + xcb_configure_window(c, m_containerWid, + XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, + containerVals); + xcb_flush(c); +} + +void XWindowTrayWidget::wrapWindow() +{ + auto c = QX11Info::connection(); + + auto cookie = xcb_get_geometry(c, m_windowId); + QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); + if (clientGeom.isNull()) + return; + + //create a container window + const auto ratio = devicePixelRatioF(); + auto screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; + m_containerWid = xcb_generate_id(c); + uint32_t values[2]; + auto mask = XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT; + values[0] = ParentRelative; //draw a solid background so the embedded icon doesn't get garbage in it + values[1] = true; //bypass wM + xcb_create_window (c, /* connection */ + XCB_COPY_FROM_PARENT, /* depth */ + m_containerWid, /* window Id */ + screen->root, /* parent window */ + 0, 0, /* x, y */ + iconSize * ratio, iconSize * ratio, /* width, height */ + 0, /* border_width */ + XCB_WINDOW_CLASS_INPUT_OUTPUT,/* class */ + screen->root_visual, /* visual */ + mask, values); /* masks */ + + /* + We need the window to exist and be mapped otherwise the child won't render it's contents + + We also need it to exist in the right place to get the clicks working as GTK will check sendEvent locations to see if our window is in the right place. So even though our contents are drawn via compositing we still put this window in the right place + + We can't composite it away anything parented owned by the root window (apparently) + Stack Under works in the non composited case, but it doesn't seem to work in kwin's composited case (probably need set relevant NETWM hint) + + As a last resort set opacity to 0 just to make sure this container never appears + */ +// const uint32_t stackBelowData[] = {XCB_STACK_MODE_BELOW}; +// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData); + + QWindow * win = QWindow::fromWinId(m_containerWid); + win->setOpacity(0); + +// setX11PassMouseEvent(true); + + xcb_flush(c); + + xcb_map_window(c, m_containerWid); + + xcb_reparent_window(c, m_windowId, + m_containerWid, + 0, 0); + + /* + * Render the embedded window offscreen + */ + xcb_composite_redirect_window(c, m_windowId, XCB_COMPOSITE_REDIRECT_MANUAL); + + + /* we grab the window, but also make sure it's automatically reparented back + * to the root window if we should die. + */ + xcb_change_save_set(c, XCB_SET_MODE_INSERT, m_windowId); + + //tell client we're embedding it + // xembed_message_send(m_windowId, XEMBED_EMBEDDED_NOTIFY, m_containerWid, 0, 0); + + //move window we're embedding + /* + const uint32_t windowMoveConfigVals[2] = { 0, 0 }; + xcb_configure_window(c, m_windowId, + XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, + windowMoveCentially quitting the application. Returns onfigVals); + */ + + //if the window is a clearly stupid size resize to be something sensible + //this is needed as chormium and such when resized just fill the icon with transparent space and only draw in the middle + //however spotify does need this as by default the window size is 900px wide. + //use an artbitrary heuristic to make sure icons are always sensible +// if (clientGeom->width > iconSize || clientGeom->height > iconSize ) + { + const uint32_t windowMoveConfigVals[2] = { uint32_t(iconSize * ratio), uint32_t(iconSize * ratio) }; + xcb_configure_window(c, m_windowId, + XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, + windowMoveConfigVals); + } + + //show the embedded window otherwise nothing happens + xcb_map_window(c, m_windowId); + +// xcb_clear_area(c, 0, m_windowId, 0, 0, qMin(clientGeom->width, iconSize), qMin(clientGeom->height, iconSize)); + + xcb_flush(c); +// setWindowOnTop(false); + setWindowOnTop(true); + setX11PassMouseEvent(true); +} + +void XWindowTrayWidget::sendHoverEvent() +{ + // fake enter event + const QPoint p(rawXPosition(QCursor::pos())); + configContainerPosition(); + setX11PassMouseEvent(false); + setWindowOnTop(true); + XTestFakeMotionEvent(QX11Info::display(), 0, p.x(), p.y(), CurrentTime); + XFlush(QX11Info::display()); + QTimer::singleShot(100, this, [=] { setX11PassMouseEvent(true); }); +} + +void XWindowTrayWidget::updateIcon() +{ + if (!isVisible() && !m_active) + return; + + m_updateTimer->start(); +} + +//void TrayWidget::hideIcon() +//{ +// auto c = QX11Info::connection(); + +// const uint32_t stackAboveData[] = {XCB_STACK_MODE_BELOW}; +// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); + +// const uint32_t windowMoveConfigVals[2] = {0, 0}; +// xcb_configure_window(c, m_containerWid, +// XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, +// windowMoveConfigVals); + +// hide(); +//} + +void XWindowTrayWidget::sendClick(uint8_t mouseButton, int x, int y) +{ + if (isBadWindow()) + return; + + m_sendHoverEvent->stop(); + + const QPoint p(rawXPosition(QPoint(x, y))); + configContainerPosition(); + setX11PassMouseEvent(false); + setWindowOnTop(true); + XTestFakeMotionEvent(QX11Info::display(), 0, p.x(), p.y(), CurrentTime); + XFlush(QX11Info::display()); + XTestFakeButtonEvent(QX11Info::display(), mouseButton, true, CurrentTime); + XFlush(QX11Info::display()); + XTestFakeButtonEvent(QX11Info::display(), mouseButton, false, CurrentTime); + XFlush(QX11Info::display()); + QTimer::singleShot(100, this, [=] { setX11PassMouseEvent(true); }); +} + +void XWindowTrayWidget::setActive(const bool active) +{ + m_active = active; + m_updateTimer->start(); +} + +void XWindowTrayWidget::refershIconImage() +{ + const auto ratio = devicePixelRatioF(); + auto c = QX11Info::connection(); + auto cookie = xcb_get_geometry(c, m_windowId); + QScopedPointer geom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); + if (geom.isNull()) + return; + + xcb_expose_event_t expose; + expose.response_type = XCB_EXPOSE; + expose.window = m_containerWid; + expose.x = 0; + expose.y = 0; + expose.width = iconSize * ratio; + expose.height = iconSize * ratio; + xcb_send_event_checked(c, false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast(&expose)); + xcb_flush(c); + + xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP); + if (!image) + return; + + QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image); + if (qimage.isNull()) + return; + + m_image = qimage.scaled(16 * ratio, 16 * ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation); + m_image.setDevicePixelRatio(ratio); + + update(); + emit iconChanged(); +} + +void XWindowTrayWidget::setX11PassMouseEvent(const bool pass) +{ + if (pass) + { + XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeBounding, 0, 0, nullptr, 0, ShapeSet, YXBanded); + XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeInput, 0, 0, nullptr, 0, ShapeSet, YXBanded); + } + else + { + XRectangle rectangle; + rectangle.x = 0; + rectangle.y = 0; + rectangle.width = 1; + rectangle.height = 1; + + XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeBounding, 0, 0, &rectangle, 1, ShapeSet, YXBanded); + XShapeCombineRectangles(QX11Info::display(), m_containerWid, ShapeInput, 0, 0, &rectangle, 1, ShapeSet, YXBanded); + } + + XFlush(QX11Info::display()); +} + +void XWindowTrayWidget::setWindowOnTop(const bool top) +{ + auto c = QX11Info::connection(); + const uint32_t stackAboveData[] = {top ? XCB_STACK_MODE_ABOVE : XCB_STACK_MODE_BELOW}; + xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); + xcb_flush(c); +} + +bool XWindowTrayWidget::isBadWindow() +{ + auto c = QX11Info::connection(); + + auto cookie = xcb_get_geometry(c, m_windowId); + QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); + return clientGeom.isNull(); +} diff -Nru dde-dock-4.5.9.1/plugins/system-tray/xwindowtraywidget.h dde-dock-4.6.3.1/plugins/system-tray/xwindowtraywidget.h --- dde-dock-4.5.9.1/plugins/system-tray/xwindowtraywidget.h 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/system-tray/xwindowtraywidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. + * + * Author: sbw + * + * Maintainer: sbw + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TRAYWIDGET_H +#define TRAYWIDGET_H + +#include +#include + +#include + +class XWindowTrayWidget : public AbstractTrayWidget +{ + Q_OBJECT + +public: + explicit XWindowTrayWidget(quint32 winId, QWidget *parent = 0); + ~XWindowTrayWidget(); + + void updateIcon() Q_DECL_OVERRIDE; + void setActive(const bool active) Q_DECL_OVERRIDE; + const QImage trayImage() Q_DECL_OVERRIDE; + void sendClick(uint8_t mouseButton, int x, int y) Q_DECL_OVERRIDE; + + static QString toTrayWidgetId(quint32 winId) { return QString("window:%1").arg(winId); } + static bool isWinIdKey(const QString &itemKey) { return itemKey.startsWith("window:"); } + static quint32 toWinId(QString itemKey) { return itemKey.remove("window:").toUInt() ; } + +private: + QSize sizeHint() const Q_DECL_OVERRIDE; + void showEvent(QShowEvent *e) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void configContainerPosition(); + + void wrapWindow(); + void sendHoverEvent(); +// void hideIcon(); + void refershIconImage(); + +private slots: + void setX11PassMouseEvent(const bool pass); + void setWindowOnTop(const bool top); + bool isBadWindow(); + +private: + bool m_active = false; + WId m_windowId; + WId m_containerWid; + QImage m_image; + + QTimer *m_updateTimer; + QTimer *m_sendHoverEvent; +}; + +#endif // TRAYWIDGET_H diff -Nru dde-dock-4.5.9.1/plugins/trash/CMakeLists.txt dde-dock-4.6.3.1/plugins/trash/CMakeLists.txt --- dde-dock-4.5.9.1/plugins/trash/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/CMakeLists.txt 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,32 @@ + +set(PLUGIN_NAME "trash") + +project(${PLUGIN_NAME}) + +# Sources files +file(GLOB SRCS "*.h" "*.cpp") + +find_package(PkgConfig REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(DtkWidget REQUIRED) + +pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) + +add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") +add_library(${PLUGIN_NAME} SHARED ${SRCS}) +set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) +target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} + ${DFrameworkDBus_INCLUDE_DIRS} + ${Qt5DBus_INCLUDE_DIRS} + ../../interfaces) +target_link_libraries(${PLUGIN_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${DFrameworkDBus_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5DBus_LIBRARIES} + ${Qt5Svg_LIBRARIES} +) + +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff -Nru dde-dock-4.5.9.1/plugins/trash/popupcontrolwidget.cpp dde-dock-4.6.3.1/plugins/trash/popupcontrolwidget.cpp --- dde-dock-4.5.9.1/plugins/trash/popupcontrolwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/popupcontrolwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/trash/popupcontrolwidget.h dde-dock-4.6.3.1/plugins/trash/popupcontrolwidget.h --- dde-dock-4.5.9.1/plugins/trash/popupcontrolwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/popupcontrolwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/trash/trashplugin.cpp dde-dock-4.6.3.1/plugins/trash/trashplugin.cpp --- dde-dock-4.5.9.1/plugins/trash/trashplugin.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/trashplugin.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/trash/trashplugin.h dde-dock-4.6.3.1/plugins/trash/trashplugin.h --- dde-dock-4.5.9.1/plugins/trash/trashplugin.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/trashplugin.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/trash/trash.pro dde-dock-4.6.3.1/plugins/trash/trash.pro --- dde-dock-4.5.9.1/plugins/trash/trash.pro 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/trash.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - -include(../../interfaces/interfaces.pri) - -QT += widgets svg dbus -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += dtkwidget dframeworkdbus - -TARGET = $$qtLibraryTarget(trash) -DESTDIR = $$_PRO_FILE_PWD_/../ -DISTFILES += trash.json - -HEADERS += \ - trashplugin.h \ - trashwidget.h \ - popupcontrolwidget.h - -SOURCES += \ - trashplugin.cpp \ - trashwidget.cpp \ - popupcontrolwidget.cpp - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -RESOURCES += \ diff -Nru dde-dock-4.5.9.1/plugins/trash/trashwidget.cpp dde-dock-4.6.3.1/plugins/trash/trashwidget.cpp --- dde-dock-4.5.9.1/plugins/trash/trashwidget.cpp 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/trashwidget.cpp 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/plugins/trash/trashwidget.h dde-dock-4.6.3.1/plugins/trash/trashwidget.h --- dde-dock-4.5.9.1/plugins/trash/trashwidget.h 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/plugins/trash/trashwidget.h 2018-04-11 09:44:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 ~ 2017 Deepin Technology Co., Ltd. + * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw * diff -Nru dde-dock-4.5.9.1/translations/dde-dock_af.ts dde-dock-4.6.3.1/translations/dde-dock_af.ts --- dde-dock-4.5.9.1/translations/dde-dock_af.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_af.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left Links - + Right Regs - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Modus - + Location - + Size Grootte - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Klank @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Onbekend @@ -387,27 +387,27 @@ Auto-konnekteer - + Connect Koppel - + Cancel Kanselleer - + Wireless Network Draadlose Netwerk - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_am_ET.ts dde-dock-4.6.3.1/translations/dde-dock_am_ET.ts --- dde-dock-4.5.9.1/translations/dde-dock_am_ET.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_am_ET.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + ይጫኑ የ ተደበቁ ምልክቶች ለ ማሳየት DatetimePlugin - + Datetime - + ቀን እና ሰአት - + 12 Hour Time - + 12 ሰአት ጊዜ - + 24 Hour Time - + 24 ሰአት ጊዜ - + Time Settings ሰአት ማሰናጃ @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode በ ዘመናዊ ዘዴ - + Efficient Mode በ አጥጋቢ ዘዴ - + Top ከ ላይ - + Bottom ከ ታች - + Left የ ግራ - + Right የ ቀኝ - + Large ትልቅ - + Medium መካከለኛ - + Small ትንሽ - + Keep Shown እንደ ታየ ማቆያ - + Keep Hidden እንደ ተደበቅ ማቆያ - + Smart Hide በራሱ መደበቂያ - + Mode ዘዴ - + Location አካባቢ - + Size መጠን - + Status ሁኔታው - + Plugins ተሰኪዎች @@ -301,7 +301,7 @@ ድምፅ ማሰናጃ - + Current Volume %1 የ አሁኑ መጠን %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound ድምፅ @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray የ ስርአት ትሪ: @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown ያልታወቀ @@ -387,27 +387,27 @@ በራሱ-መገናኛ - + Connect መገናኛ - + Cancel መሰረዣ - + Wireless Network ሽቦ አልባ ኔትዎርክ - + Wireless Network %1 ሽቦ አልባ ኔትዎርክ: %1 - + Password required to connect to <font color="#faca57">%1</font> የ መግቢያ ቃል ያስፈልጋል ለ መገናኘት ወደ <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ar.ts dde-dock-4.6.3.1/translations/dde-dock_ar.ts --- dde-dock-4.5.9.1/translations/dde-dock_ar.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ar.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + انقر لعرض الرمز المخفي DatetimePlugin - + Datetime - + الوقت والتاريخ - + 12 Hour Time توقيت الـ 12 ساعة - + 24 Hour Time توقيت الـ 24 ساعة - + Time Settings إعدادات الوقت @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode النمط الحداثي - + Efficient Mode النمط الفعال - + Top أعلى - + Bottom أسفل - + Left يسار - + Right يمين - + Large كبير - + Medium متوسط - + Small صغير - + Keep Shown اﻹبقاء ظاهراً - + Keep Hidden الإبقاء مخفياً - + Smart Hide إخفاء ذكي - + Mode النمط - + Location الموقع - + Size الحجم - + Status الحالة - + Plugins الإضافات @@ -301,7 +301,7 @@ إعدادات الصوت - + Current Volume %1 الحجم الحالي %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound الصوت @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray منطقة إعلام النظام @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown غير معروف @@ -387,27 +387,27 @@ اتصال تلقائي - + Connect اتصال - + Cancel إلغاء - + Wireless Network شبكة لاسلكية - + Wireless Network %1 الشبكة اللاسلكية : %1 - + Password required to connect to <font color="#faca57">%1</font> كلمة السر مطلوبة للاتصال بـ <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ast.ts dde-dock-4.6.3.1/translations/dde-dock_ast.ts --- dde-dock-4.5.9.1/translations/dde-dock_ast.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ast.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + Primi p'amosar l'iconu anubríu DatetimePlugin - + Datetime - + Datetime - + 12 Hour Time 12h - + 24 Hour Time 24h - + Time Settings Axustes d'hora @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mou MacOS - + Efficient Mode Mou Windows - + Top Arriba - + Bottom Abaxo - + Left Izquierda - + Right Drecha - + Large Llargu - + Medium Medio - + Small Pequeñu - + Keep Shown Caltener amosáu - + Keep Hidden Caltener anubríu - + Smart Hide Anubrición intelixente - + Mode Mou - + Location Allugamientu - + Size Tamañu - + Status Estáu - + Plugins Complementos @@ -301,7 +301,7 @@ Axustes d'audiu - + Current Volume %1 Volume actual %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Soníu @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Bandexa del sistema @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Desconocíu @@ -387,27 +387,27 @@ Conexón automática - + Connect Coneutar - + Cancel Encaboxar - + Wireless Network Rede inalámbrica - + Wireless Network %1 Rede inalámbrica %1 - + Password required to connect to <font color="#faca57">%1</font> Ríquese la contraseña pa coneutase a <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_az.ts dde-dock-4.6.3.1/translations/dde-dock_az.ts --- dde-dock-4.5.9.1/translations/dde-dock_az.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_az.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top Yuxarı - + Bottom Aşağı - + Left Sol - + Right Sağ - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location Yerləşmə - + Size Ölçü - + Status - + Plugins Qoşmalar @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Səs @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Naməlum @@ -387,27 +387,27 @@ - + Connect Bağlan - + Cancel İmtina - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_bg.ts dde-dock-4.6.3.1/translations/dde-dock_bg.ts --- dde-dock-4.5.9.1/translations/dde-dock_bg.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_bg.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Дата - + 12 Hour Time 12 часово време - + 24 Hour Time 24 часово време - + Time Settings Настройки на времето @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Модерен режим - + Efficient Mode Ефективен режим - + Top Отгоре - + Bottom Отдолу - + Left Ляво - + Right Дясно - + Large Голям - + Medium Среден - + Small Малък - + Keep Shown Показвай - + Keep Hidden Скрий - + Smart Hide Интелигентно скриване - + Mode Режим - + Location Местоположение - + Size Размер - + Status Статус - + Plugins Плъгини @@ -301,7 +301,7 @@ Настройки на звука - + Current Volume %1 Текущо ниво на звука %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Звук @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Зона за уведомяване @@ -352,8 +352,8 @@ WiredItem - Unknow - Непознато + Unknown + Неизвестно @@ -387,27 +387,27 @@ Автоматично свързване - + Connect Свързване - + Cancel Отказ - + Wireless Network Безжична мрежа - + Wireless Network %1 Безжична връзка %1 - + Password required to connect to <font color="#faca57">%1</font> Необходима е парола за свързване с <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_bn.ts dde-dock-4.6.3.1/translations/dde-dock_bn.ts --- dde-dock-4.5.9.1/translations/dde-dock_bn.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_bn.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -71,7 +71,7 @@ Open - + খুলুন @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + মোড - + Location - + Size সাইজ - + Status - + Plugins @@ -172,7 +172,7 @@ Launcher - + লঞ্চার @@ -217,7 +217,7 @@ Shut down - + বন্ধ করুন @@ -293,7 +293,7 @@ Mute - + নীরব @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,15 +309,15 @@ SoundPlugin - + Sound - + শব্দ SystemTrayPlugin - + System Tray @@ -340,7 +340,7 @@ Open - + খুলুন @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + অজানা @@ -387,27 +387,27 @@ - + Connect - + Cancel বাতিল - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ca.ts dde-dock-4.6.3.1/translations/dde-dock_ca.ts --- dde-dock-4.5.9.1/translations/dde-dock_ca.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ca.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,30 +4,30 @@ Click to display hidden icon - + Cliqueu per veure la icona amagada DatetimePlugin - + Datetime - + Dia i hora - + 12 Hour Time - + 12 hores - + 24 Hour Time - + 24 hores - + Time Settings - + Configuració del dia i l'hora @@ -35,17 +35,17 @@ Enable network - + Habilita la xarxa Disable network - + Inhabilita la xarxa Network settings - + Configuració de la xarxa @@ -53,12 +53,12 @@ Unknown device - + Dispositiu desconegut Unknown volume - + Volum desconegut @@ -76,95 +76,95 @@ Unmount all - + Desmunta-ho tot DockSettings - + Fashion Mode - + Mode de moda - + Efficient Mode - + Mode eficient - + Top - + A dalt - + Bottom - + A baix - + Left - Esquerra + A l'esquerra - + Right - Dreta + A la dreta - + Large - + Gros - + Medium - + Mitjà - + Small - + Petit - + Keep Shown - + Mantén visible - + Keep Hidden - + Mantén ocult - + Smart Hide - + Ocultació intel·ligent - + Mode Mode - + Location - + Ubicació - + Size Mida - + Status - + Estat - + Plugins - + Connectors @@ -193,22 +193,22 @@ Empty - + Buit This action cannot be restored - Aquesta acció es podra desfer + Aquesta acció es pot desfer. Are you sure to empty 1 item ? - + Segur que voleu eliminar 1 element? Are you sure to empty %1 items ? - + Segur que voleu eliminar %1 elements? @@ -217,42 +217,42 @@ Shut down - Apagar + Atura Remaining Capacity %1 - + Capacitat restant %1 Charged %1 - + Càrrega: %1 Charging %1 - + Carregant: %1 Restart - Reiniciar + Reinicia Lock - Bloquejar + Bloqueja Log out - Tancar sessió + Surt de la sessió Suspend - Suspendre + Suspèn @@ -262,12 +262,12 @@ Switch account - + Canvi de compte Power settings - + Configuració de l'energia @@ -280,7 +280,7 @@ Application - + Aplicació @@ -288,7 +288,7 @@ Unmute - + Activa el so @@ -298,18 +298,18 @@ Audio Settings - + Configuració de l'àudio - + Current Volume %1 - + Volum actual: %1 SoundPlugin - + Sound So @@ -317,9 +317,9 @@ SystemTrayPlugin - + System Tray - + Safata del sistema @@ -327,12 +327,12 @@ Trash - %1 file - + Paperera: %1 fitxer Trash - %1 files - + Paperera: %1 fitxers @@ -345,25 +345,25 @@ Empty - + Buida WiredItem - Unknow - + Unknown + Desconegut No Network - + Sense xarxa Wired connection: %1 - + Connexió amb fil: %1 @@ -371,12 +371,12 @@ No Network - + Sense xarxa Wireless Connection: %1 - + Connexió sense fil: %1 @@ -384,32 +384,32 @@ Auto-connect - Auto connectar + Connexió automàtica - + Connect - Connectar + Connecta - + Cancel Cancel·la - + Wireless Network Xarxa sense fils - + Wireless Network %1 - + Xarxa sense fil: %1 - + Password required to connect to <font color="#faca57">%1</font> - + Cal una contrasenya per connectar amb <font color="#faca57">%1</font>. \ No newline at end of file diff -Nru dde-dock-4.5.9.1/translations/dde-dock_cs.ts dde-dock-4.6.3.1/translations/dde-dock_cs.ts --- dde-dock-4.5.9.1/translations/dde-dock_cs.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_cs.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + Klepněte pr zobrazení skryté ikony DatetimePlugin - + Datetime - + Datum - + 12 Hour Time 12 hodinový čas - + 24 Hour Time 24 hodinový čas - + Time Settings Nastavení času @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Návykový režim - + Efficient Mode Účelný režim - + Top Nahoře - + Bottom Dole - + Left Vlevo - + Right Vpravo - + Large Velký - + Medium Střední - + Small Malý - + Keep Shown Ukázat vždy - + Keep Hidden Vždy skrýt - + Smart Hide Skrýt chytře - + Mode Režim - + Location Umístění - + Size Velikost - + Status Stav - + Plugins Přídavné moduly @@ -257,7 +257,7 @@ Power - Energie + Napájení @@ -301,7 +301,7 @@ Nastavení zvuku - + Current Volume %1 Hlasitost %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Zvuk @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Systémová lišta @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Neznámý @@ -387,27 +387,27 @@ Připojit automaticky - + Connect Připojit - + Cancel Zrušit - + Wireless Network Bezdrátová síť - + Wireless Network %1 Bezdrátová síť %1 - + Password required to connect to <font color="#faca57">%1</font> Zadejte heslo pro připojení <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_da.ts dde-dock-4.6.3.1/translations/dde-dock_da.ts --- dde-dock-4.5.9.1/translations/dde-dock_da.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_da.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Dato og klokkeslæt - + 12 Hour Time 12-timers klokkeslæt - + 24 Hour Time 24-timers klokkeslæt - + Time Settings Tidsindstillinger @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Fashion-tilstand - + Efficient Mode Effektiv tilstand - + Top Øverst - + Bottom - Knap + Nederst - + Left Venstre - + Right Højre - + Large Stor - + Medium Medium - + Small Lille - + Keep Shown Bevar vist - + Keep Hidden Bevar skjult - + Smart Hide Smart skjul - + Mode Tilstand - + Location Placering - + Size Størrelse - + Status Status - + Plugins Plugins @@ -301,7 +301,7 @@ Lydindstillinger - + Current Volume %1 Aktuel volumen %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Lyd @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Systembakke @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Ukendt @@ -387,27 +387,27 @@ Automatisk tilslutning - + Connect Opret forbindelse - + Cancel Annuller - + Wireless Network Trådløst netværk - + Wireless Network %1 Trådløst netværk %1 - + Password required to connect to <font color="#faca57">%1</font> Der kræves adgangskode for at kunne oprette forbindelse til <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_de.ts dde-dock-4.6.3.1/translations/dde-dock_de.ts --- dde-dock-4.5.9.1/translations/dde-dock_de.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_de.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Datum/Zeit - + 12 Hour Time 12-Stunden-Zeit - + 24 Hour Time 24-Stunden-Zeit - + Time Settings Zeiteinstellungen @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mode-Modus - + Efficient Mode Effizienter Modus - + Top Oben - + Bottom Unten - + Left Links - + Right Rechts - + Large Groß - + Medium Mittel - + Small Klein - + Keep Shown Angezeigt lassen - + Keep Hidden Ausgeblendet lassen - + Smart Hide Intelligentes Ausblenden - + Mode Modus - + Location Ort - + Size Größe - + Status Status - + Plugins Plugins @@ -301,7 +301,7 @@ Audioeinstellungen - + Current Volume %1 Aktuelle Lautstärke %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Benachrichtigungsfeld @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Unbekannt @@ -387,27 +387,27 @@ Automatisch verbinden - + Connect Verbinden - + Cancel Abbrechen - + Wireless Network Drahtlosnetzwerk - + Wireless Network %1 Drahtlosnetzwerk %1 - + Password required to connect to <font color="#faca57">%1</font> Passwort zum Verbinden mit <font color="#faca57">%1</font> erforderlich diff -Nru dde-dock-4.5.9.1/translations/dde-dock_el.ts dde-dock-4.6.3.1/translations/dde-dock_el.ts --- dde-dock-4.5.9.1/translations/dde-dock_el.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_el.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings Ρυθμίσεις ώρας @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Μοντέρνα λειτουργία - + Efficient Mode Αποτελεσματική λειτουργία - + Top Πάνω μέρος - + Bottom Κάτω μέρος - + Left Αριστερά - + Right Δεξιά - + Large Μεγάλο - + Medium Μέτρια - + Small Μικρό - + Keep Shown Εμφάνιση - + Keep Hidden Απόκρυψη - + Smart Hide Έξυπνη απόκρυψη - + Mode Λειτουργία - + Location Τοποθεσία - + Size Μέγεθος - + Status Κατάσταση - + Plugins Πρόσθετα @@ -301,7 +301,7 @@ Ρυθμίσεις Ήχου - + Current Volume %1 Τρέχουσα Ένταση %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Ήχος @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Άγνωστο @@ -387,27 +387,27 @@ Αυτόματη σύνδεση - + Connect Σύνδεση - + Cancel Ακύρωση - + Wireless Network Ασύρματο Δίκτυο - + Wireless Network %1 Ασύρματο Δίκτυο %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_en_AU.ts dde-dock-4.6.3.1/translations/dde-dock_en_AU.ts --- dde-dock-4.5.9.1/translations/dde-dock_en_AU.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_en_AU.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left Left - + Right Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Mode - + Location - + Size Size - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Unknown @@ -387,27 +387,27 @@ Auto-connect - + Connect Connect - + Cancel Cancel - + Wireless Network Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_eo.ts dde-dock-4.6.3.1/translations/dde-dock_eo.ts --- dde-dock-4.5.9.1/translations/dde-dock_eo.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_eo.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,24 +10,24 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings - + Hor-agordoj @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left Maldekstra - + Right Dekstra - + Large Granda - + Medium Mezgranda - + Small Malgranda - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Maniero - + Location Loko - + Size Dimensio - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sono @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Nekonata @@ -387,27 +387,27 @@ Aŭtomata kunligo - + Connect Kunligi - + Cancel Nuligi - + Wireless Network Senkabla reto - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_es_419.ts dde-dock-4.6.3.1/translations/dde-dock_es_419.ts --- dde-dock-4.5.9.1/translations/dde-dock_es_419.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_es_419.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + Haga clic para mostrar el icono oculto DatetimePlugin - + Datetime - + Fecha y hora - + 12 Hour Time - Tiempo en 12 horas + Horario de 12 horas - + 24 Hour Time - Tiempo en 24 horas + Horario de 24 horas - + Time Settings Ajustes de tiempo @@ -45,7 +45,7 @@ Network settings - Configuraciones de red + Ajustes de red @@ -82,89 +82,89 @@ DockSettings - + Fashion Mode Modo elegante - + Efficient Mode Modo eficiente - + Top Arriba - + Bottom - Abajo + Inferior - + Left Izquierda - + Right Derecha - + Large Grande - + Medium - Intermedio + Mediano - + Small Pequeño - + Keep Shown Mantener visible - + Keep Hidden Mantener oculto - + Smart Hide - Ocultar automáticamente + Ocultado inteligente - + Mode Modo - + Location Ubicación - + Size Tamaño - + Status Estado - + Plugins - Plugins + Complementos @@ -180,7 +180,7 @@ Network - Redes e Internet + Redes @@ -193,22 +193,22 @@ Empty - Vacío + Vaciar This action cannot be restored - Esta acción no se puede restaurar + Esta acción no puede ser restaurada Are you sure to empty 1 item ? - ¿Eliminar definitivamente 1 elemento? + ¿Está seguro de vaciar 1 elemento? Are you sure to empty %1 items ? - ¿Eliminar definitivamente los %1 elementos? + ¿Está seguro de vaciar %1 elementos? @@ -227,7 +227,7 @@ Charged %1 - Cargada %1 + Cargado %1 @@ -247,7 +247,7 @@ Log out - Salir + Cerrar sesión @@ -262,12 +262,12 @@ Switch account - Cambiar de cuenta + Cambiar cuenta Power settings - Ajustes de encendido + Ajustes energía @@ -288,7 +288,7 @@ Unmute - Desactivar silenciar + Activar sonido @@ -298,10 +298,10 @@ Audio Settings - Configuraciones de audio + Ajustes audio - + Current Volume %1 Volumen actual %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sonido @@ -317,9 +317,9 @@ SystemTrayPlugin - + System Tray - Bandeja de Sistema + Bandeja de sistema @@ -327,12 +327,12 @@ Trash - %1 file - Papelera - %1 file + Papelera - %1 archivo Trash - %1 files - Papelera - %1 files + Papelera - %1 archivos @@ -345,14 +345,14 @@ Empty - Vacío + Vaciar WiredItem - Unknow + Unknown Desconocido @@ -363,7 +363,7 @@ Wired connection: %1 - Conexión cableada: %1 + Conexión por cable: %1 @@ -384,32 +384,32 @@ Auto-connect - Conectar Automáticamente + Autoconectar - + Connect Conectar - + Cancel Cancelar - + Wireless Network Red inalámbrica - + Wireless Network %1 Red inalámbrica %1 - + Password required to connect to <font color="#faca57">%1</font> - Se requiere una contraseña para conectar a <font color="#faca57">%1</font> + Se requiere una contraseña para conectar con <font color="#faca57">%1</font> \ No newline at end of file diff -Nru dde-dock-4.5.9.1/translations/dde-dock_es.ts dde-dock-4.6.3.1/translations/dde-dock_es.ts --- dde-dock-4.5.9.1/translations/dde-dock_es.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_es.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Fecha y hora - + 12 Hour Time Horario de 12 horas - + 24 Hour Time Horario de 24 horas - + Time Settings Ajustes de tiempo @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Modo elegante - + Efficient Mode Modo eficiente - + Top Arriba - + Bottom Inferior - + Left Izquierda - + Right Derecha - + Large Grande - + Medium Mediano - + Small Pequeño - + Keep Shown Mantener visible - + Keep Hidden Mantener oculto - + Smart Hide Ocultado inteligente - + Mode Modo - + Location Ubicación - + Size Tamaño - + Status Estado - + Plugins Complementos @@ -301,7 +301,7 @@ Ajustes audio - + Current Volume %1 Volumen actual %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sonido @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Bandeja de sistema @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Desconocido @@ -387,27 +387,27 @@ Autoconectar - + Connect Conectar - + Cancel Cancelar - + Wireless Network Red inalámbrica - + Wireless Network %1 Red inalámbrica %1 - + Password required to connect to <font color="#faca57">%1</font> Se requiere una contraseña para conectar con <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_fa.ts dde-dock-4.6.3.1/translations/dde-dock_fa.ts --- dde-dock-4.5.9.1/translations/dde-dock_fa.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_fa.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left چپ - + Right راست - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode حالت - + Location - + Size حجم - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound صدا @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + ناشناخته @@ -387,27 +387,27 @@ اتصال - خودکار - + Connect اتصال - + Cancel انصراف - + Wireless Network شبکه بیسیم - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_fi.ts dde-dock-4.6.3.1/translations/dde-dock_fi.ts --- dde-dock-4.5.9.1/translations/dde-dock_fi.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_fi.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top Yläosa - + Bottom Pohja - + Left Vasen - + Right Oikea - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Tila - + Location Sijaintipaikka - + Size Koko - + Status - + Plugins Lisäosat @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Ääni @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Tuntematon @@ -387,27 +387,27 @@ Automaattinen yhteys - + Connect Yhdistä - + Cancel Peruuta - + Wireless Network Langaton verkko - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_fr.ts dde-dock-4.6.3.1/translations/dde-dock_fr.ts --- dde-dock-4.5.9.1/translations/dde-dock_fr.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_fr.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - Date et l'heure + Date et heure - + 12 Hour Time 12 Heures - + 24 Hour Time 24 Heures - + Time Settings Réglages de l'heure @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mode dock - + Efficient Mode Mode étendu - + Top Haut - + Bottom Bas - + Left Gauche - + Right Droite - + Large Grand - + Medium Moyen - + Small Petit - + Keep Shown Maintenir affiché - + Keep Hidden Maintenir caché - + Smart Hide Masquer intelligemment - + Mode Mode - + Location Emplacement - + Size Taille - + Status Status - + Plugins Extensions @@ -301,7 +301,7 @@ Paramètres audio - + Current Volume %1 Volume actuel %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Son @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Zone de notification @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Inconnu @@ -387,27 +387,27 @@ Connection automatique - + Connect Se connecter - + Cancel Annuler - + Wireless Network Réseau sans fil - + Wireless Network %1 Réseau sans fil %1 - + Password required to connect to <font color="#faca57">%1</font> Mot de passe requis pour se connecter à <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_gl_ES.ts dde-dock-4.6.3.1/translations/dde-dock_gl_ES.ts --- dde-dock-4.5.9.1/translations/dde-dock_gl_ES.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_gl_ES.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time Horario de 12 horas - + 24 Hour Time Horario de 24 horas - + Time Settings Axustes da hora @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Modo moderno - + Efficient Mode Modo eficiente - + Top Arriba - + Bottom Abaixo - + Left Esquerda - + Right Dereita - + Large Grande - + Medium Medio - + Small Pequeno - + Keep Shown Manter visible - + Keep Hidden Manter oculto - + Smart Hide Ocultar automaticamente - + Mode Modo - + Location Localización - + Size Tamaño - + Status Estado - + Plugins Complementos @@ -301,7 +301,7 @@ Axustes de son - + Current Volume %1 Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Son @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Bandexa do sistema @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Descoñecido @@ -387,27 +387,27 @@ Conectar automaticamente - + Connect Conectar - + Cancel Cancelar - + Wireless Network Rede sen fíos - + Wireless Network %1 Rede sen fíos %1 - + Password required to connect to <font color="#faca57">%1</font> Requírese dun contrasinal para conectar a <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_gl.ts dde-dock-4.6.3.1/translations/dde-dock_gl.ts --- dde-dock-4.5.9.1/translations/dde-dock_gl.ts 1970-01-01 00:00:00.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_gl.ts 2018-04-11 09:44:14.000000000 +0000 @@ -0,0 +1,415 @@ + + + ContainerItem + + + Click to display hidden icon + + + + + DatetimePlugin + + + Datetime + + + + + 12 Hour Time + + + + + 24 Hour Time + + + + + Time Settings + + + + + DeviceItem + + + Enable network + + + + + Disable network + + + + + Network settings + + + + + DiskControlItem + + + Unknown device + + + + + Unknown volume + + + + + DiskMountPlugin + + + Disk + + + + + Open + + + + + Unmount all + + + + + DockSettings + + + Fashion Mode + + + + + Efficient Mode + + + + + Top + + + + + Bottom + + + + + Left + + + + + Right + + + + + Large + + + + + Medium + + + + + Small + + + + + Keep Shown + + + + + Keep Hidden + + + + + Smart Hide + + + + + Mode + + + + + Location + + + + + Size + + + + + Status + + + + + Plugins + + + + + LauncherItem + + + Launcher + + + + + NetworkPlugin + + + Network + + + + + PopupControlWidget + + + Cancel + + + + + Empty + + + + + This action cannot be restored + + + + + Are you sure to empty 1 item ? + + + + + Are you sure to empty %1 items ? + + + + + ShutdownPlugin + + + + Shut down + + + + + Remaining Capacity %1 + + + + + Charged %1 + + + + + Charging %1 + + + + + Restart + + + + + Lock + + + + + Log out + + + + + Suspend + + + + + Power + + + + + Switch account + + + + + Power settings + + + + + SoundApplet + + + Device + + + + + Application + + + + + SoundItem + + + Unmute + + + + + Mute + + + + + Audio Settings + + + + + Current Volume %1 + + + + + SoundPlugin + + + Sound + + + + + SystemTrayPlugin + + + System Tray + + + + + TrashPlugin + + + Trash - %1 file + + + + + Trash - %1 files + + + + + TrashWidget + + + Open + + + + + Empty + + + + + WiredItem + + + Unknown + Descoñecido + + + + No Network + + + + + Wired connection: %1 + + + + + WirelessItem + + + No Network + + + + + Wireless Connection: %1 + + + + + WirelessList + + + Auto-connect + + + + + Connect + + + + + Cancel + + + + + Wireless Network + + + + + Wireless Network %1 + + + + + Password required to connect to <font color="#faca57">%1</font> + + + + \ No newline at end of file diff -Nru dde-dock-4.5.9.1/translations/dde-dock_he.ts dde-dock-4.6.3.1/translations/dde-dock_he.ts --- dde-dock-4.5.9.1/translations/dde-dock_he.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_he.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top למעלה - + Bottom למטה - + Left שמאל - + Right ימין - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode מצב - + Location מקום - + Size גודל - + Status - + Plugins פלאגינים @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound שמע @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + לא ידוע @@ -387,27 +387,27 @@ חיבור אוטומטי - + Connect התחבר - + Cancel ביטול - + Wireless Network רשת אלחוטית - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_hi_IN.ts dde-dock-4.6.3.1/translations/dde-dock_hi_IN.ts --- dde-dock-4.5.9.1/translations/dde-dock_hi_IN.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_hi_IN.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top ऊपर - + Bottom नीचे - + Left बाएँ - + Right दाएँ - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode मोड - + Location लोकेशन - + Size आकार - + Status - + Plugins प्लगिंस @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound ध्वनि @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + अज्ञात @@ -387,27 +387,27 @@ स्वतः-जुड़ना - + Connect जोड़ें - + Cancel रद्द करो - + Wireless Network बिना वायर के संचार - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_hr.ts dde-dock-4.6.3.1/translations/dde-dock_hr.ts --- dde-dock-4.5.9.1/translations/dde-dock_hr.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_hr.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time 12 satno vrijeme - + 24 Hour Time 24 satno vrijeme - + Time Settings Postavke vremena @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Popularan način - + Efficient Mode Efikasan način - + Top Gore - + Bottom Dolje - + Left Lijevo - + Right Desno - + Large Veliko - + Medium Srednje - + Small Maleno - + Keep Shown Drži prikazano - + Keep Hidden Drži skriveno - + Smart Hide Pametno skrivanje - + Mode Način - + Location Lokacija - + Size Veličina - + Status Status - + Plugins Priključci @@ -301,7 +301,7 @@ Zvučne postavke - + Current Volume %1 Trenutna glasnoća %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Zvuk @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Nepoznato @@ -387,27 +387,27 @@ Automatsko povezivanje - + Connect Poveži - + Cancel Otkaži - + Wireless Network Bežična mreža - + Wireless Network %1 Bežična mreža %1 - + Password required to connect to <font color="#faca57">%1</font> Za spajanje na <font color="#faca57">%1</font> potrebna je lozinka diff -Nru dde-dock-4.5.9.1/translations/dde-dock_hu.ts dde-dock-4.6.3.1/translations/dde-dock_hu.ts --- dde-dock-4.5.9.1/translations/dde-dock_hu.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_hu.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Dátum és idő - + 12 Hour Time 12 órás idő - + 24 Hour Time 24 órás idő - + Time Settings Idő beállítás @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Stílus mód - + Efficient Mode Hatékony mód - + Top Fent - + Bottom Lent - + Left Bal - + Right Jobb - + Large Nagy - + Medium Közepes - + Small Kicsi - + Keep Shown Megjelenítve tartás - + Keep Hidden Elrejtve tartás - + Smart Hide Intelligens elrejtés - + Mode Mód - + Location Hely - + Size Méret - + Status Állapot - + Plugins Bővítmények @@ -301,7 +301,7 @@ Hangeszköz beállítások - + Current Volume %1 Jelenlegi hangerő %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Hang @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Rendszertálca @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Ismeretlen @@ -387,27 +387,27 @@ Automatikus csatlakozás - + Connect Csatlakozás - + Cancel Mégse - + Wireless Network Vezeték nélküli hálózat - + Wireless Network %1 Vezeték nélküli Hálózat %1 - + Password required to connect to <font color="#faca57">%1</font> <font color="#faca57">%1</font> kapcsolathoz jelszó szükséges. diff -Nru dde-dock-4.5.9.1/translations/dde-dock_hy.ts dde-dock-4.6.3.1/translations/dde-dock_hy.ts --- dde-dock-4.5.9.1/translations/dde-dock_hy.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_hy.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left Ձախ - + Right Աջ - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location Վայր - + Size Չափս - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Անհայտ @@ -387,27 +387,27 @@ - + Connect - + Cancel Չեղարկել - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_id.ts dde-dock-4.6.3.1/translations/dde-dock_id.ts --- dde-dock-4.5.9.1/translations/dde-dock_id.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_id.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time Waktu 12 Jam - + 24 Hour Time Waktu 24 Jam - + Time Settings Pengaturan Waktu @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mode fasion - + Efficient Mode Mode efesien - + Top Atas - + Bottom Bawah - + Left Kiri - + Right Kanan - + Large Besar - + Medium Sedang - + Small Kecil - + Keep Shown Tetap tampilkan - + Keep Hidden Tetap sembunyikan - + Smart Hide Sembunyi pintar - + Mode Mode - + Location Lokasi - + Size Ukuran - + Status Status - + Plugins Plugin @@ -301,7 +301,7 @@ Pengaturan Audio - + Current Volume %1 Volume Saat ini %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Suara @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Baki sistem @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Tidak diketahui @@ -387,27 +387,27 @@ Sambungkan otomatis - + Connect Sambungkan - + Cancel Batalkan - + Wireless Network Jaringan Nirkabel - + Wireless Network %1 Jaringan Nirkabel %1 - + Password required to connect to <font color="#faca57">%1</font> Sandi lewat dibutuhkan untuk menyambungkan <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_it.ts dde-dock-4.6.3.1/translations/dde-dock_it.ts --- dde-dock-4.5.9.1/translations/dde-dock_it.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_it.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Orologio - + 12 Hour Time - 12 ore + Formato 12 ore - + 24 Hour Time - 24 ore + Formato 24 ore - + Time Settings Impostazioni orarie @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Fashion - + Efficient Mode Efficient - + Top Sopra - + Bottom Sotto - + Left Sinistra - + Right Destra - + Large Larga - + Medium Media - + Small Piccola - + Keep Shown Mostra sempre - + Keep Hidden Lascia nascosta - + Smart Hide Nascondi automaticamente - + Mode Modalità - + Location Posizione - + Size Dimensioni - + Status Comportamento - + Plugins Plugin @@ -188,7 +188,7 @@ Cancel - Cancella + Annulla @@ -301,7 +301,7 @@ Impostazioni Audio - + Current Volume %1 Volume attuale %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Audio @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Tray di Sistema @@ -332,7 +332,7 @@ Trash - %1 files - Cestino - %1 files + Cestino - %1 file @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Sconosciuto @@ -387,27 +387,27 @@ Auto-connetti - + Connect Connetti - + Cancel - Cancella + Annulla - + Wireless Network WiFi - + Wireless Network %1 Rete wireless %1 - + Password required to connect to <font color="#faca57">%1</font> Password richiesta per connettersi a <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ja.ts dde-dock-4.6.3.1/translations/dde-dock_ja.ts --- dde-dock-4.5.9.1/translations/dde-dock_ja.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ja.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time 12時間表示 - + 24 Hour Time 24時間表示 - + Time Settings 時間設定 @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode ファッションモード - + Efficient Mode エフィシェントモード - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown 表示を保つ - + Keep Hidden 非表示を保つ - + Smart Hide スマート非表示 - + Mode モード - + Location ロケーション - + Size サイズ - + Status 状態 - + Plugins プラグイン @@ -301,7 +301,7 @@ 音の設定 - + Current Volume %1 現在の音量 %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound サウンド @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray システムトレイ @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown 不明 @@ -387,27 +387,27 @@ 自動接続 - + Connect 接続 - + Cancel キャンセル - + Wireless Network 無線ネットワーク - + Wireless Network %1 無線接続 %1 - + Password required to connect to <font color="#faca57">%1</font> <font color="#faca57">%1</font> への接続にはパスワードが必要です diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ko.ts dde-dock-4.6.3.1/translations/dde-dock_ko.ts --- dde-dock-4.5.9.1/translations/dde-dock_ko.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ko.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings 시간 설정 @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top 맨 위 - + Bottom 하단 - + Left 왼쪽 - + Right 오른쪽 - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode 모드 - + Location 위치 - + Size 크기 - + Status - + Plugins 플러그인 @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound 소리 @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + 알 수 없음 @@ -387,27 +387,27 @@ 자동 연결 - + Connect 연결 - + Cancel 취소 - + Wireless Network 무선 네트워크 - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ku_IQ.ts dde-dock-4.6.3.1/translations/dde-dock_ku_IQ.ts --- dde-dock-4.5.9.1/translations/dde-dock_ku_IQ.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ku_IQ.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown @@ -387,27 +387,27 @@ - + Connect - + Cancel پاشگەزبوونەوە - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_lt.ts dde-dock-4.6.3.1/translations/dde-dock_lt.ts --- dde-dock-4.5.9.1/translations/dde-dock_lt.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_lt.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Data ir laikas - + 12 Hour Time 12 valandų laikas - + 24 Hour Time 24 valandų laikas - + Time Settings Laiko nustatymai @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Madinga veiksena - + Efficient Mode Efektyvi veiksena - + Top Viršus - + Bottom Apačia - + Left Kairė - + Right Dešinė - + Large Didelis - + Medium Vidutinis - + Small Mažas - + Keep Shown Laikyti rodomą - + Keep Hidden Laikyti paslėptą - + Smart Hide Išmaniai slėpti - + Mode Veiksena - + Location Vieta - + Size Dydis - + Status Būsena - + Plugins Įskiepiai @@ -301,7 +301,7 @@ Garso nustatymai - + Current Volume %1 Esamas garsis %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Garsas @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Sistemos dėklas @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Nežinoma @@ -387,27 +387,27 @@ Automatiškai prisijungti - + Connect Prisijungti - + Cancel Atsisakyti - + Wireless Network Belaidis tinklas - + Wireless Network %1 Belaidis tinklas %1 - + Password required to connect to <font color="#faca57">%1</font> Norint prisijungti prie <font color="#faca57">%1</font>, reikalingas slaptažodis diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ml.ts dde-dock-4.6.3.1/translations/dde-dock_ml.ts --- dde-dock-4.5.9.1/translations/dde-dock_ml.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ml.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode ഫാഷൻ രീതി - + Efficient Mode കാര്യക്ഷമമായ രീതി - + Top മുകളിൽ - + Bottom താഴെ - + Left ഇടതു് - + Right വലതു് - + Large വലുത് - + Medium ഇടത്തരം - + Small ചെറുത് - + Keep Shown എപ്പോഴും ദൃശ്യമാക്കുക - + Keep Hidden എപ്പോഴും അദൃശ്യമാക്കുക - + Smart Hide സമർത്ഥമായ അദൃശ്യമാക്കൽ - + Mode രീതി - + Location സ്ഥാനം - + Size വലുപ്പം - + Status അവസ്ഥ - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - മറക്കുക + Unknown + @@ -387,27 +387,27 @@ തനിയേ ബന്ധിപ്പിക്കുക - + Connect ബന്ധിപ്പിക്കുക - + Cancel റദ്ദാക്കുക - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> <font color="#faca57">%1</font> - ഇതിലേക്ക് ബന്ധിപ്പിക്കാൻ രഹസ്യവാക്ക് ആവശ്യമാണു് diff -Nru dde-dock-4.5.9.1/translations/dde-dock_mn.ts dde-dock-4.6.3.1/translations/dde-dock_mn.ts --- dde-dock-4.5.9.1/translations/dde-dock_mn.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_mn.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left Зүүн - + Right Баруун - + Large - + Medium Дундаж - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size Хэмжээ - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Тодорхойгүй @@ -387,27 +387,27 @@ Автоматаар холбогдох - + Connect Холбогдох - + Cancel Цуцлах - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ms.ts dde-dock-4.6.3.1/translations/dde-dock_ms.ts --- dde-dock-4.5.9.1/translations/dde-dock_ms.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ms.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Tarikhwaktu - + 12 Hour Time Waktu 12 Jam - + 24 Hour Time Waktu 24 Jam - + Time Settings Tetapan Waktu @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mod Berfesyen - + Efficient Mode Mod Efisyen - + Top Teratas - + Bottom Bawah - + Left Kiri - + Right Kanan - + Large Besar - + Medium Sederhana - + Small Kecil - + Keep Shown Kekal Ditunjukkan - + Keep Hidden Kekal Tersembunyi - + Smart Hide Sembunyi Pintar - + Mode Mod - + Location Lokasi - + Size Saiz - + Status Status - + Plugins Pemalam @@ -301,7 +301,7 @@ Tetapan Audio - + Current Volume %1 Volum Semasa %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Bunyi @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Talam Sistem @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Tidak diketahui @@ -387,27 +387,27 @@ Auto-sambung - + Connect Sambung - + Cancel Batal - + Wireless Network Rangkaian Tanpa Wayar - + Wireless Network %1 Sambungan Tanpa Wayar %1 - + Password required to connect to <font color="#faca57">%1</font> Kata laluan diperlukan untuk sambung ke <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_nb.ts dde-dock-4.6.3.1/translations/dde-dock_nb.ts --- dde-dock-4.5.9.1/translations/dde-dock_nb.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_nb.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,24 +10,24 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings - + Tidsinnstillinger @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top Toppen - + Bottom Bunn - + Left Venstre - + Right Høyre - + Large Stor - + Medium Medium - + Small Liten - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Modus - + Location Lokasjon - + Size Størrelse - + Status - + Plugins Utvidelser @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Lyd @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Ukjent @@ -387,27 +387,27 @@ Auto-tilkobling - + Connect Koble til - + Cancel Avbryt - + Wireless Network Trådløs Nettverk - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_nl.ts dde-dock-4.6.3.1/translations/dde-dock_nl.ts --- dde-dock-4.5.9.1/translations/dde-dock_nl.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_nl.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + Klik om het verborgen pictogram weer te geven DatetimePlugin - + Datetime - + DatumTijd - + 12 Hour Time 12-uurs Tijd - + 24 Hour Time 24-uurs Tijd - + Time Settings Tijdinstellingen @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Moderne Modus - + Efficient Mode Efficiënte Modus - + Top Boven - + Bottom Onderkant - + Left Links - + Right Rechts - + Large Groot - + Medium Medium - + Small Klein - + Keep Shown Blijf weergeven - + Keep Hidden Altijd verbegen - + Smart Hide Slim verbergen - + Mode Modus - + Location Locatie - + Size Grootte - + Status Status - + Plugins Plugins @@ -301,7 +301,7 @@ Geluidsinstellingen - + Current Volume %1 Huidige Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Geluid @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Systeemvak @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Onbekend @@ -387,27 +387,27 @@ Automatisch verbinden - + Connect Verbinden - + Cancel Annuleren - + Wireless Network Draadloos netwerk - + Wireless Network %1 Draadloos Netwerk %1 - + Password required to connect to <font color="#faca57">%1</font> Wachtwoord vereist om verbinding te maken met <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_pam.ts dde-dock-4.6.3.1/translations/dde-dock_pam.ts --- dde-dock-4.5.9.1/translations/dde-dock_pam.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_pam.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown @@ -387,27 +387,27 @@ - + Connect Kumunekta - + Cancel I-cancel - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_pl.ts dde-dock-4.6.3.1/translations/dde-dock_pl.ts --- dde-dock-4.5.9.1/translations/dde-dock_pl.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_pl.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Data i czas - + 12 Hour Time Czas 12-godzinny - + 24 Hour Time Czas 24-godzinny - + Time Settings Ustawienia czasu @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Tryb modny - + Efficient Mode Tryb wydajny - + Top Góra - + Bottom Dół - + Left Do lewej - + Right Do prawej - + Large Duże - + Medium Średni - + Small Małe - + Keep Shown Zawsze wyświetlaj - + Keep Hidden Zawsze ukrywaj - + Smart Hide Mądre ukrywanie - + Mode Tryb - + Location Położenie - + Size Rozmiar - + Status Stan - + Plugins Wtyczki @@ -301,7 +301,7 @@ Ustawienia dźwięku - + Current Volume %1 Obecna głośność %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Dźwięk @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Obszar powiadamiania @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Nieznany @@ -387,27 +387,27 @@ Połącz automatycznie - + Connect Połącz - + Cancel Anuluj - + Wireless Network Sieć bezprzewodowa - + Wireless Network %1 Sieć bezprzewodowa %1 - + Password required to connect to <font color="#faca57">%1</font> Wymagane hasło, aby połączyć z <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_pt_BR.ts dde-dock-4.6.3.1/translations/dde-dock_pt_BR.ts --- dde-dock-4.5.9.1/translations/dde-dock_pt_BR.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_pt_BR.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Data e hora - + 12 Hour Time Formato 12 horas - + 24 Hour Time Formato 24 horas - + Time Settings Alterar data e hora @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Fashion - + Efficient Mode Eficiente - + Top Acima - + Bottom Abaixo - + Left Esquerda - + Right Direita - + Large Grande - + Medium Médio - + Small Pequeno - + Keep Shown Continuar exibindo - + Keep Hidden Continuar oculto - + Smart Hide Ocultação inteligente - + Mode Modo - + Location Localização - + Size Tamanho - + Status Estado - + Plugins Plugins @@ -301,7 +301,7 @@ Configurações de áudio - + Current Volume %1 Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Som @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Bandeja do sistema @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Desconhecido @@ -387,27 +387,27 @@ Auto-conectar - + Connect Conectar - + Cancel Cancelar - + Wireless Network Rede wireless - + Wireless Network %1 Rede wireless %1 - + Password required to connect to <font color="#faca57">%1</font> Digite a senha para conectar a <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_pt.ts dde-dock-4.6.3.1/translations/dde-dock_pt.ts --- dde-dock-4.5.9.1/translations/dde-dock_pt.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_pt.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Data hora - + 12 Hour Time Horário de 12 Horas - + 24 Hour Time Horário de 24 Horas - + Time Settings Definições Horárias @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Modo Elegante - + Efficient Mode Modo Eficiente - + Top Topo - + Bottom Fundo - + Left Esquerda - + Right Direita - + Large Grande - + Medium Médio - + Small Pequeno - + Keep Shown Manter Visível - + Keep Hidden Manter Escondido - + Smart Hide Esconder Inteligente - + Mode Modo - + Location Localização - + Size Tamanho - + Status Estado - + Plugins Plugins @@ -301,7 +301,7 @@ Definições de Áudio - + Current Volume %1 Nível de Som Atual %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Som @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Tray do Sistema @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Desconhecido @@ -387,27 +387,27 @@ Ligar automaticamente - + Connect Ligar - + Cancel Cancelar - + Wireless Network Rede Sem fios - + Wireless Network %1 Rede Sem Fios %1 - + Password required to connect to <font color="#faca57">%1</font> Necessária palavra-passe para ligar a <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ro.ts dde-dock-4.6.3.1/translations/dde-dock_ro.ts --- dde-dock-4.5.9.1/translations/dde-dock_ro.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ro.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top Sus - + Bottom Jos - + Left Stânga - + Right Dreapta - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode Mod - + Location Locație - + Size Dimensiune - + Status - + Plugins Plugin-uri @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Sunet @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + Necunoscut @@ -387,27 +387,27 @@ Auto conectare - + Connect Conectare - + Cancel Anulează - + Wireless Network Rețea fără fir - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ru.ts dde-dock-4.6.3.1/translations/dde-dock_ru.ts --- dde-dock-4.5.9.1/translations/dde-dock_ru.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ru.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Дата и время - + 12 Hour Time 12-часовой Формат - + 24 Hour Time 24-часовой Формат - + Time Settings Настройки Времени @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Современный Режим - + Efficient Mode Эффективный Режим - + Top Сверху - + Bottom Снизу - + Left Слева - + Right Справа - + Large Большой - + Medium Средний - + Small Маленький - + Keep Shown Отображать Всегда - + Keep Hidden Держать Скрытым - + Smart Hide Умное Скрытие - + Mode Режим - + Location Местонахождение - + Size Размер - + Status Статус - + Plugins Плагины @@ -301,7 +301,7 @@ Настройки Звука - + Current Volume %1 Уровень Громкости %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Звук @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Системный Лоток @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Неизвестный @@ -387,27 +387,27 @@ Авто-подключение - + Connect Подключить - + Cancel Отмена - + Wireless Network Беспроводная Сеть - + Wireless Network %1 Беспроводная Сеть %1 - + Password required to connect to <font color="#faca57">%1</font> Требуется пароль для подключения к <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_si.ts dde-dock-4.6.3.1/translations/dde-dock_si.ts --- dde-dock-4.5.9.1/translations/dde-dock_si.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_si.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + නොදත් @@ -387,27 +387,27 @@ - + Connect - + Cancel - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_sk.ts dde-dock-4.6.3.1/translations/dde-dock_sk.ts --- dde-dock-4.5.9.1/translations/dde-dock_sk.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_sk.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Dátum Čas - + 12 Hour Time 12 hodinový čas - + 24 Hour Time 24 hodinový čas - + Time Settings Nastavenia času @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Módny režim - + Efficient Mode Efektívny režim - + Top Hore - + Bottom Dolu - + Left Vľavo - + Right Vpravo - + Large Veľký - + Medium Stredne - + Small Malý - + Keep Shown Ponechať zobrazené - + Keep Hidden Ponechať skryté - + Smart Hide Inteligentné skrývanie - + Mode Režim - + Location Umiestnenie - + Size Veľkosť - + Status Stav - + Plugins Pluginy @@ -301,7 +301,7 @@ Nastavenia zvuku - + Current Volume %1 Aktuálna hlasitosť %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Zvuk @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Systémový panel @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Neznámy @@ -387,27 +387,27 @@ Automaticky-pripojiť - + Connect Pripojiť - + Cancel Zrušiť - + Wireless Network Bezdrôtová sieť - + Wireless Network %1 Bezdrôtová sieť %1 - + Password required to connect to <font color="#faca57">%1</font> Je vyžadované heslo pre pripojenie k <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_sl.ts dde-dock-4.6.3.1/translations/dde-dock_sl.ts --- dde-dock-4.5.9.1/translations/dde-dock_sl.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_sl.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Datumčas - + 12 Hour Time 12-urni čas - + 24 Hour Time 24-urni čas - + Time Settings Nastavitev časa @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Modni način - + Efficient Mode Učinkovit način - + Top Vrh - + Bottom Dno - + Left Levo - + Right Desno - + Large Veliko - + Medium Srednje - + Small Majhno - + Keep Shown Ohrani prikazano - + Keep Hidden Ohrani skrito - + Smart Hide Pametno skrivanje - + Mode Način - + Location Položaj - + Size Velikost - + Status Status - + Plugins Vtičniki @@ -301,7 +301,7 @@ Zvočne nastavitve - + Current Volume %1 Trenutna glasnost %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Zvok @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Sistemski pladenj @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Neznano @@ -387,27 +387,27 @@ Samodejno poveži - + Connect Poveži - + Cancel Prekliči - + Wireless Network Brezžično omrežje - + Wireless Network %1 Brezžično omrežje %1 - + Password required to connect to <font color="#faca57">%1</font> Za povezavo z/s <font color="#faca57">%1</font> je potrebno geslo diff -Nru dde-dock-4.5.9.1/translations/dde-dock_sr.ts dde-dock-4.6.3.1/translations/dde-dock_sr.ts --- dde-dock-4.5.9.1/translations/dde-dock_sr.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_sr.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time 12-часовно време - + 24 Hour Time 24-часовно време - + Time Settings Поставке времена @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Улицкан режим - + Efficient Mode Ефикасан режим - + Top Врх - + Bottom Дно - + Left Лево - + Right Десно - + Large Велико - + Medium Средње - + Small Мало - + Keep Shown Остави приказано - + Keep Hidden Остави скривено - + Smart Hide Паметно скривање - + Mode Режим - + Location Позиција - + Size Величина - + Status Стање - + Plugins Додаци @@ -301,7 +301,7 @@ Поставке звука - + Current Volume %1 Тренутна јачина %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Звук @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Системска касета @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Непознато @@ -387,27 +387,27 @@ Сам се повежи - + Connect Повежи се - + Cancel Откажи - + Wireless Network Бежична мрежа - + Wireless Network %1 Бежична мрежа %1 - + Password required to connect to <font color="#faca57">%1</font> Потребна је лозинка за повезивање на <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_sv.ts dde-dock-4.6.3.1/translations/dde-dock_sv.ts --- dde-dock-4.5.9.1/translations/dde-dock_sv.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_sv.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time 12 timmars tid - + 24 Hour Time 24 timmars tid - + Time Settings Tidsinställningar @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Mode läge - + Efficient Mode Effektivt läge - + Top Toppen - + Bottom Botten - + Left Vänster - + Right Höger - + Large Stor - + Medium Medium - + Small Liten - + Keep Shown Behåll visad - + Keep Hidden Behåll gömd - + Smart Hide Smart gömd - + Mode Mode - + Location Plats - + Size Storlek - + Status Status - + Plugins Plugin @@ -301,7 +301,7 @@ Ljudinställningar - + Current Volume %1 Aktuell volym %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Ljud @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Systemfält @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Okänd @@ -387,27 +387,27 @@ Anslut automatiskt - + Connect Anslut - + Cancel Avbryt - + Wireless Network Trådlöst nätverk - + Wireless Network %1 Trådlöst nätverk %1 - + Password required to connect to <font color="#faca57">%1</font> Lösenord krävs för att ansluta till <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ta.ts dde-dock-4.6.3.1/translations/dde-dock_ta.ts --- dde-dock-4.5.9.1/translations/dde-dock_ta.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ta.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left இடது - + Right வலது - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode முறை - + Location - + Size அளவு - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound ஒலி @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + தெரியாத @@ -387,27 +387,27 @@ தானியங்கி-இணைப்பு - + Connect இணை - + Cancel நிறுத்து - + Wireless Network கம்பியில்லா இணையம் - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_tr.ts dde-dock-4.6.3.1/translations/dde-dock_tr.ts --- dde-dock-4.5.9.1/translations/dde-dock_tr.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_tr.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime Tarih saat - + 12 Hour Time 12 Saatlik Zaman - + 24 Hour Time 24 Saatlik Zaman - + Time Settings Zaman Ayarları @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Moda Kip - + Efficient Mode Verimli Kip - + Top Üst - + Bottom Alt - + Left Sol - + Right Sağ - + Large Büyük - + Medium Orta - + Small Küçük - + Keep Shown Göstermeye Devam Et - + Keep Hidden Gizli Tut - + Smart Hide Akıllı Gizleme - + Mode Kip - + Location Konum - + Size Boyut - + Status Durum - + Plugins Eklentiler @@ -188,7 +188,7 @@ Cancel - İptal Et + İptal et @@ -301,7 +301,7 @@ Ses Ayarları - + Current Volume %1 Geçerli Ses %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Ses @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Sistem Tepsisi @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Bilinmeyen @@ -387,27 +387,27 @@ Otomatik-bağlantı - + Connect Bağlan - + Cancel - İptal Et + İptal et - + Wireless Network Kablosuz Ağ - + Wireless Network %1 Kablosuz Ağ %1 - + Password required to connect to <font color="#faca57">%1</font> Bağlanmak için şifre gerekli <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock.ts dde-dock-4.6.3.1/translations/dde-dock.ts --- dde-dock-4.5.9.1/translations/dde-dock.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock.ts 2018-04-11 09:44:14.000000000 +0000 @@ -12,22 +12,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -84,87 +84,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size - + Status - + Plugins @@ -303,7 +303,7 @@ - + Current Volume %1 @@ -311,7 +311,7 @@ SoundPlugin - + Sound @@ -319,7 +319,7 @@ SystemTrayPlugin - + System Tray @@ -354,7 +354,7 @@ WiredItem - Unknow + Unknown @@ -389,27 +389,27 @@ - + Connect - + Cancel - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ug.ts dde-dock-4.6.3.1/translations/dde-dock_ug.ts --- dde-dock-4.5.9.1/translations/dde-dock_ug.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ug.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings ۋاقىت تەڭشىكى @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium ئوتتۇرىدا - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode ھالىتى - + Location - + Size چوڭلۇقى - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound ئاۋاز @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + نامەلۇم @@ -387,27 +387,27 @@ - + Connect ئۇلاش - + Cancel بىكار قىلىش - + Wireless Network سىمسىز تور - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_uk.ts dde-dock-4.6.3.1/translations/dde-dock_uk.ts --- dde-dock-4.5.9.1/translations/dde-dock_uk.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_uk.ts 2018-04-11 09:44:14.000000000 +0000 @@ -4,28 +4,28 @@ Click to display hidden icon - + Натисніть, щоб відобразити прихований значок DatetimePlugin - + Datetime - + Дата, час - + 12 Hour Time - + 12 Годинний Час - + 24 Hour Time - + 24 Годинний Час - + Time Settings Налаштування Часу @@ -58,7 +58,7 @@ Unknown volume - + Невідомий том @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Модний режим - + Efficient Mode - + Режим ефективності - + Top Верх - + Bottom Вниз - + Left Ліворуч - + Right Праворуч - + Large Великий - + Medium Середній - + Small Маленький - + Keep Shown - + Показувати постійно - + Keep Hidden - + Приховувати - + Smart Hide - + Розумне приховування - + Mode Режим - + Location Місце знаходження - + Size Розмір - + Status Статус - + Plugins Плагіни @@ -203,12 +203,12 @@ Are you sure to empty 1 item ? - + Ви впевнені, що хочете очистити 1 обєкт? Are you sure to empty %1 items ? - + Ви впевнені, що хочете очистити %1 обєкти ? @@ -222,7 +222,7 @@ Remaining Capacity %1 - + Залишкова Ємність %1 @@ -257,7 +257,7 @@ Power - Потужність + Акумулятор @@ -301,7 +301,7 @@ Налаштування аудіо - + Current Volume %1 Поточна гучність %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Звук @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Системний трей @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown Невідомо @@ -387,27 +387,27 @@ Автоматичне підключення - + Connect Підключитися - + Cancel Скасувати - + Wireless Network Бездротова мережа - + Wireless Network %1 Бездротова мережа %1 - + Password required to connect to <font color="#faca57">%1</font> Потрібен пароль для підключення до <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_ur.ts dde-dock-4.6.3.1/translations/dde-dock_ur.ts --- dde-dock-4.5.9.1/translations/dde-dock_ur.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_ur.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location - + Size - + Status - + Plugins @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown @@ -387,27 +387,27 @@ - + Connect - + Cancel - + Wireless Network - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_vi.ts dde-dock-4.6.3.1/translations/dde-dock_vi.ts --- dde-dock-4.5.9.1/translations/dde-dock_vi.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_vi.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time Thời gian dạng 12 Giờ - + 24 Hour Time Thời gian dạng 24 Giờ - + Time Settings Những Thiết lập Thời gian @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Chế độ Thời trang - + Efficient Mode Chế độ Hiệu quả - + Top Trên đỉnh - + Bottom Dưới đáy - + Left Trái - + Right Phải - + Large Lớn - + Medium Trung bình - + Small Nhỏ - + Keep Shown Tiếp tục Hiển thị - + Keep Hidden Tiếp tục Ẩn - + Smart Hide Ẩn Thông minh - + Mode Chế độ - + Location Nơi chốn - + Size Kích thước - + Status Tình trạng - + Plugins @@ -301,7 +301,7 @@ Thiết lập Âm thanh - + Current Volume %1 Âm lượng Hiện tại %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound Âm thanh @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray Khay Hệ thống @@ -352,8 +352,8 @@ WiredItem - Unknow - Không xác định + Unknown + Không rõ @@ -387,27 +387,27 @@ Tự động kết nối - + Connect Kết nối - + Cancel Hủy - + Wireless Network Mạng không dây - + Wireless Network %1 Mạng Không dây %1 - + Password required to connect to <font color="#faca57">%1</font> Mật mã đòi hỏi để kết nối với <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_zh_CN.ts dde-dock-4.6.3.1/translations/dde-dock_zh_CN.ts --- dde-dock-4.5.9.1/translations/dde-dock_zh_CN.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_zh_CN.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime 时间 - + 12 Hour Time 12小时制 - + 24 Hour Time 24小时制 - + Time Settings 时间设置 @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode 时尚模式 - + Efficient Mode 高效模式 - + Top - + Bottom - + Left - + Right - + Large - + Medium - + Small - + Keep Shown 一直显示 - + Keep Hidden 一直隐藏 - + Smart Hide 智能隐藏 - + Mode 模式 - + Location 位置 - + Size 大小 - + Status 状态 - + Plugins 插件 @@ -301,7 +301,7 @@ 音量设置 - + Current Volume %1 当前音量%1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound 声音 @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray 系统托盘 @@ -352,7 +352,7 @@ WiredItem - Unknow + Unknown 未知 @@ -387,27 +387,27 @@ 自动连接 - + Connect 连接 - + Cancel 取消 - + Wireless Network 无线网络 - + Wireless Network %1 无线网络%1 - + Password required to connect to <font color="#faca57">%1</font> 连接<font color="#faca57">%1</font>需要密码 diff -Nru dde-dock-4.5.9.1/translations/dde-dock_zh_HK.ts dde-dock-4.6.3.1/translations/dde-dock_zh_HK.ts --- dde-dock-4.5.9.1/translations/dde-dock_zh_HK.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_zh_HK.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime - + 12 Hour Time - + 24 Hour Time - + Time Settings @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode - + Efficient Mode - + Top - + Bottom - + Left - + Right - + Large - + Medium 中速 - + Small - + Keep Shown - + Keep Hidden - + Smart Hide - + Mode - + Location 檔位置 - + Size 大小 - + Status - + Plugins 外掛 @@ -301,7 +301,7 @@ - + Current Volume %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound 音效 @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray @@ -352,8 +352,8 @@ WiredItem - Unknow - + Unknown + 未知 @@ -387,27 +387,27 @@ 自動連接 - + Connect 連接 - + Cancel 取消 - + Wireless Network 無線網絡 - + Wireless Network %1 - + Password required to connect to <font color="#faca57">%1</font> diff -Nru dde-dock-4.5.9.1/translations/dde-dock_zh_TW.ts dde-dock-4.6.3.1/translations/dde-dock_zh_TW.ts --- dde-dock-4.5.9.1/translations/dde-dock_zh_TW.ts 2018-01-03 07:28:11.000000000 +0000 +++ dde-dock-4.6.3.1/translations/dde-dock_zh_TW.ts 2018-04-11 09:44:14.000000000 +0000 @@ -10,22 +10,22 @@ DatetimePlugin - + Datetime 日期時間 - + 12 Hour Time 12 小時制 - + 24 Hour Time 24 小時制 - + Time Settings 時間設定 @@ -82,87 +82,87 @@ DockSettings - + Fashion Mode Deepin 樣式 - + Efficient Mode Windows 樣式 - + Top 頂部 - + Bottom 底部 - + Left 左側 - + Right 右側 - + Large - + Medium - + Small - + Keep Shown 永遠顯示 - + Keep Hidden 永遠隱藏 - + Smart Hide 智慧隱藏 - + Mode 樣式 - + Location 位置 - + Size 圖示 - + Status 狀態 - + Plugins 附加元件 @@ -301,7 +301,7 @@ 聲音設定 - + Current Volume %1 目前音量 %1 @@ -309,7 +309,7 @@ SoundPlugin - + Sound 聲音 @@ -317,7 +317,7 @@ SystemTrayPlugin - + System Tray 系統匣 @@ -352,8 +352,8 @@ WiredItem - Unknow - 未知 + Unknown + Unknown @@ -387,27 +387,27 @@ 自動連線 - + Connect 連線 - + Cancel 取消 - + Wireless Network 無線網路 - + Wireless Network %1 無線網路 %1 - + Password required to connect to <font color="#faca57">%1</font> 連線到<font color="#faca57"> %1 </font>需要密碼