diff --git a/HACKING.md b/HACKING.md deleted file mode 100644 index 7a3fe3e04..000000000 --- a/HACKING.md +++ /dev/null @@ -1,204 +0,0 @@ -# HACKING guide for Dock - -## Project layout - -### Coding layout - -Dock developed by Qt(QWidget). - -It has five packages - -- src/controller -This package control most of the non-visible data communication. -- src/dbus -This package include all of the DBus backend header that programs use. -- src/interfaces -This package include the header which export for plugins development. Those header should be packaged in a single software package in the future. -- src/panel -Panel was not the top level window. This package contains the most relevant widget of panel. -- src/widgets -The rest of the all other visible widgets. - -### Others - -- ~/.cache/deepin/dde-dock/ -Store log files. -- ~/.config/deepin/dde-dock/style/ & /usr/share/dde-dock/style/ -- Store style files. - -## Core Design - -### 布局管理 - -- 布局动画的实现 - -> - MovableLayout -> ->> 可拖拽排序的布局,是App布局(DockAppLayout)和插件布局(DockPluginLayout)的基类。 -> -> - MovableSpacingItem -> ->> 此类继承于QFrame,不含有可视内容。在MovableLayout的某个位置插入此类的对象,这样就相当于插入一段空白项。并且此类在size改变时会使用动画处理,这样就能达到空白是有过渡动画的插入效果。当需要在新的位置插入空白项时,发出信号使之前的所有空白项都开始销毁,销毁过程也由动画控制以达到过度效果。当鼠标拖拽着快速移动时因为不断的插入和销毁,就能实现布局内控件的挤压移动动画。 -> - -- 布局鼠标事件处理 - -> - 鼠标移动时开始检测是否达到拖拽阈值(为防止轻微点击误操作),如果达到则开始拖拽处理。 -> - 在dragEnter或者dragMove时根据鼠标的位置计算出当前悬停在哪个布局中的控件之上,根据需要插入空白项或者移除空白项;在dragLeave时通知所有空白项销毁; -> - 在drop事件发生时,根据drop之前布局的布局方式以及移动方向确定新项目的位置。并且drop事件传递的QDropEvent对象会通过信号向外发送,外部类或子类可根据该对象做进一步处理。 - -### App管理 - -- 把App固定到任务栏 - -> - 从Launcher拖拽项目到Dock的App布局中(drag的mime数据中有特殊标志值) -> - 从Launcher使用右键菜单发送到Dock -> - 从桌面或文件管理器中拖拽.desktop文件到Dock的App布局中(有特殊标志值的就调用后端提供的DBus方法请求固定到Dock上,如果没有特殊标志值则当成普通文件处理) - -- 把App从任务栏移除 - -> - 使用右键菜单的“移除驻留”选项移除,调用后端移除函数进行移除 -> - 拖拽到Dock显示区域外丢弃移除 -当检测到鼠标位置离开布局的有效区域后,生成DropMask的一个对象跟随鼠标移动,该对象可以接受drop事件,并且大小正好就是拖拽时图像的大小,始终位于鼠标正下方。一旦鼠标在布局区域以外释放,则该对象接受相应数据作销毁动画后发出销毁信号完成项目的移除操作。 - -- App排序 - ->排序完成后调用后端的排序函数进行位置记录 -- App的激活与窗口切换 -> - 直接调用后端的Activate函数实现App的激活与窗口切换(如果有多个窗口) -> - 每个预览窗口都有对应的Xid,当点击某个预览窗口时,调用后端的ActiveWindow方法实现窗口切换。 - -- 文件拖拽 - -> - 有效的.desktop文件尝试固定到Dock的App布局中 -> - 普通文件调用对应App的后端的HandleDragDrop方法尝试打开 - -### 插件系统 - -- 插件预检测 - -> - 检测插件文件是否有效 -> - 检测插件版本是否有效 -> - 检测插件是否为系统级别插件 - -- 插件通信 - -> - 插件主动向Dock传递数据 -插件内部通过在init函数中保存DockPluginProxyInterface对象以随时调用该类提供的方法向Dock传递数据 -> - Dock主动向插件传递数据 -目前在插件接口类DockPluginInterface中实现的三个方法可以主动向插件传递数据,分别是:changeMode、setEnabled和invokeMenuItem - -- 插件设置 - ->在每个插件初始化前(调用init函数前),插件设置窗口对象已经与传递到插件内的DockPluginProxyInterface子类DockPluginProxy的对应对象做好相应信号的连接。当插件初始化完成后,即可调用DockPluginProxy的infoChangedEvent方法(参数为InfoTypeConfigurable、InfoTypeEnable或者InfoTypeTitle),这样设置窗口就会读取插件的信息并显示到设置窗口中。 - -### 显示模式管理 - -- 不同显示模式的常量值(特别是size) - -> - 常量值在dockconstants.h中定义 -> - DockModeData提供的单例对象控制在不同显示模式下常量的使用 - -- 显示模式改变的通知 - -> 每个与显示模式相关的模块或者类都应该连接DockModeData类的dockModeChanged信号,在收到该信号后,重新调用该对象的方法(如:getDockHeight)即可获取不同显示模式下合适的常量值。 - -### 隐藏模式管理 - -- 移动鼠标切换Dock的隐藏与显示状态 - ->实际上Dock隐藏时只是把主窗口高度降低到了 1 像素,一个像素依然足够接受鼠标的移入事件。鼠标移入后即显示Dock主窗口,当鼠标移出到Dock的区域以外后使用后端提供的方法使主窗口隐藏。 - -- 移动窗口切换Dock的隐藏与显示状态 - ->由后端检测,只需要根据状态改变显示或者隐藏Dock主窗口即可 - -- 使用快捷键(Super+H)切换Dock的隐藏与显示状态 - ->由后端检测,只需要根据状态改变显示或者隐藏Dock主窗口即可。但是需要注意在按下快捷键时,鼠标是否停留在Dock主窗口区域的处理。 - -### 预览窗口 - -- 预览窗口的移动 - -> - 所有App的预览窗口内容与所有插件提供的Applet内容都是共用一个PreviewWindow对象的 -> - 当鼠标从某个有预览内容的项移动到另一个同样有预览内容的项时,用当前鼠标所在的项的预览内容填充预览窗口(填充过程会加入延时以达到流畅过度的效果)即可,填充完成后请主动调用预览窗口的resizeWithContent函数和showPreview函数以更新预览窗的大小和位置。 - -- 每项的标题窗口 - ->每个DockItem都会有一个PreviewWindow对象用于显示标题。当没有预览内容时将使用该对象显示标题。 - -### 样式管理 - -- 样式表文件说明 -目前样式表控制还有不完善的问题,部分控件的显示不是由样式表控制(如:预览窗口的外边框)。以后会针对样式表的内容整理出一份文档。 - -- 第三方样式表 - -> - 第三方样式安装目录 -> ->> - /usr/share/dde-dock/style/ ->> - ~/.config/deepin/dde-dock/style/ -> -> - 第三方样式文件结构 -> ->> - 必须在第三方样式安装目录下新建一个以样式名称命名的目录 ->> - 以样式名称命名的目录下必须包含一个主要的样式表文件:style.qss ->> - 以样式名称命名的目录下可以拥有任意数量的其他资源 -> - -- 运行过程中切换样式表(如果未来系统统一了样式切换) -样式表的切换接口以DBus接口的方式给出 - -> - DBus接口 - ->> com.deepin.dde.dock -> -> - 相关方法 -> ->> - currentStyleName(): 返回当前Dock正在使用的样式名称 ->> - styleNameList(): 返回当前Dock默认样式和所有第三当样式名称的列表 ->> - applyStyle(String styleName): 切换到styleNameList列表中某个有效的样式 -> - -### 特殊项 - -- Launcher启动项 -使用QProcess启动dde-launcher进程。作为单独的项载入到DockPanel面板中。 -- 未来可能加入的启动项 -暂无 - -### 其他扩展 - -- 竖直方向布局 -目前与布局相关的类是支持竖直方向布局的。只要根据需要改进DockPanel和MainWidget类即可。未来如果设计有这样的需求就可以这样做。 - -## UML & Diagram - -### [UML File(Umbrello)](https://github.com/linuxdeepin/dde-dock/files/115295/dde-dock.xmi.zip) -### Diagram -- Use Case Diagram -![dde-dock](https://cloud.githubusercontent.com/assets/5242852/12776747/808aeee8-ca93-11e5-942a-c77ac08d5210.png) -- Class Diagram -1. mainwidget -![mainwidget](https://cloud.githubusercontent.com/assets/5242852/12776749/80a3cc1a-ca93-11e5-9431-1c06bacd828c.png) -2. layout -![layout](https://cloud.githubusercontent.com/assets/5242852/12776751/84e7b282-ca93-11e5-8838-fe9d1e5bca03.png) -3. appmanager -![appmanager](https://cloud.githubusercontent.com/assets/5242852/12776746/807ffd3a-ca93-11e5-8419-3fc2fb45371a.png) -4. pluginmanager -![pluginmanager](https://cloud.githubusercontent.com/assets/5242852/12776750/80b6d742-ca93-11e5-800f-a7c8e42a838e.png) -5. item -![item](https://cloud.githubusercontent.com/assets/5242852/12776748/8099af3c-ca93-11e5-8a17-0f036d18dd20.png) - -## List of TODO (It’s the good way for contributing) - -None. - -## List of Workaround - -None. - -## Others - -- [DDE Dock Plugin Development](https://github.com/linuxdeepin/developer-center/wiki/DDE-Dock-Plugin-Development) \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 4d7705a57..000000000 --- a/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# DDE Dock - -DDE Dock is Deepin Desktop Environment task bar. - -## Dependencies - -### Build dependencies - -* qmake (>= 5.3) -* [deepin-tool-kit](https://github.com/linuxdeepin/deepin-tool-kit) (developer package) - -### Runtime dependencies - -* [deepin-tool-kit](https://github.com/linuxdeepin/deepin-tool-kit) -* [dde-daemon](https://github.com/linuxdeepin/dde-daemon) -* gtk+-2.0 -* Qt5 (>= 5.3) - * Qt5-DBus - * Qt5-Svg - * Qt5-X11extras - -## Installation - -### Build from source code - -1. Make sure you have installed all dependencies. - -2. Build: -``` -$ cd dde-dock -$ mkdir Build -$ cd Build -$ qmake .. -$ make -``` - -3. Install: -``` -$ sudo make install -``` - -When install complete, the executable binary file is placed into `/usr/bin/dde-dock`. - -## Getting help - -Any usage issues can ask for help via -* [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) -* [IRC Channel](https://webchat.freenode.net/?channels=deepin) -* [Official Forum](https://bbs.deepin.org/) -* [Wiki](http://wiki.deepin.org/) - -## Getting involved - -We encourage you to report issues and contribute changes -* [Contribution guide for users](http://wiki.deepin.org/index.php?title=Contribution_Guidelines_for_Users) -* [Contribution guide for developers](http://wiki.deepin.org/index.php?title=Contribution_Guidelines_for_Developers) - -## License - -DDE Dock is licensed under [GPLv3](https://github.com/linuxdeepin/developer-center/wiki/LICENSE). diff --git a/dde-dock/src/dbus/dbusshutdownfront.cpp b/dbus/dbusdockentrymanager.cpp similarity index 59% rename from dde-dock/src/dbus/dbusshutdownfront.cpp rename to dbus/dbusdockentrymanager.cpp index 6f13c221a..931febd6d 100644 --- a/dde-dock/src/dbus/dbusshutdownfront.cpp +++ b/dbus/dbusdockentrymanager.cpp @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusShutdownFront -p dbusshutdownfront com.deepin.dde.shutdownFront.xml + * Command line was: qdbusxml2cpp -c DBusDockEntryManager -p dbusdockentrymanager dde-dock-EntryManager.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -9,19 +9,19 @@ * before re-generating it. */ -#include "dbusshutdownfront.h" +#include "dbusdockentrymanager.h" /* - * Implementation of interface class DBusShutdownFront + * Implementation of interface class DBusDockEntryManager */ -DBusShutdownFront::DBusShutdownFront(QObject *parent) - : QDBusAbstractInterface("com.deepin.dde.shutdownFront", "/com/deepin/dde/shutdownFront", staticInterfaceName(), QDBusConnection::sessionBus(), parent) +DBusDockEntryManager::DBusDockEntryManager(QObject *parent) + : QDBusAbstractInterface("com.deepin.daemon.Dock", "/dde/dock/EntryManager", staticInterfaceName(), QDBusConnection::sessionBus(), parent) { QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); } -DBusShutdownFront::~DBusShutdownFront() +DBusDockEntryManager::~DBusDockEntryManager() { QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); } diff --git a/dde-dock/src/dbus/dbusshutdownfront.h b/dbus/dbusdockentrymanager.h similarity index 54% rename from dde-dock/src/dbus/dbusshutdownfront.h rename to dbus/dbusdockentrymanager.h index bbf541c97..0bbaf49ec 100644 --- a/dde-dock/src/dbus/dbusshutdownfront.h +++ b/dbus/dbusdockentrymanager.h @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusShutdownFront -p dbusshutdownfront com.deepin.dde.shutdownFront.xml + * Command line was: qdbusxml2cpp -c DBusDockEntryManager -p dbusdockentrymanager dde-dock-EntryManager.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -8,8 +8,8 @@ * Do not edit! All changes made to it will be lost. */ -#ifndef DBUSSHUTDOWNFRONT_H_1459492401 -#define DBUSSHUTDOWNFRONT_H_1459492401 +#ifndef DBUSDOCKENTRYMANAGER_H_1464835422 +#define DBUSDOCKENTRYMANAGER_H_1464835422 #include #include @@ -21,9 +21,9 @@ #include /* - * Proxy class for interface com.deepin.dde.shutdownFront + * Proxy class for interface dde.dock.EntryManager */ -class DBusShutdownFront: public QDBusAbstractInterface +class DBusDockEntryManager: public QDBusAbstractInterface { Q_OBJECT @@ -33,7 +33,7 @@ class DBusShutdownFront: public QDBusAbstractInterface if (3 != arguments.count()) return; QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName !="com.deepin.dde.shutdownFront") + if (interfaceName !="dde.dock.EntryManager") return; QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); foreach(const QString &prop, changedProps.keys()) { @@ -48,35 +48,42 @@ class DBusShutdownFront: public QDBusAbstractInterface } public: static inline const char *staticInterfaceName() - { return "com.deepin.dde.shutdownFront"; } + { return "dde.dock.EntryManager"; } public: - DBusShutdownFront(QObject *parent = 0); + explicit DBusDockEntryManager(QObject *parent = 0); - ~DBusShutdownFront(); + ~DBusDockEntryManager(); + + Q_PROPERTY(QList Entries READ entries NOTIFY EntriesChanged) + inline QList entries() const + { return qvariant_cast< QList >(property("Entries")); } public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Ping() + inline QDBusPendingReply GetEntryIDs() { QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Ping"), argumentList); + return asyncCallWithArgumentList(QStringLiteral("GetEntryIDs"), argumentList); } - inline QDBusPendingReply<> Show() + inline QDBusPendingReply<> Reorder(const QStringList &in0) { QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Show"), argumentList); + argumentList << QVariant::fromValue(in0); + return asyncCallWithArgumentList(QStringLiteral("Reorder"), argumentList); } Q_SIGNALS: // SIGNALS + void Added(const QDBusObjectPath &in0); + void Removed(const QString &in0); + void TrayInited(); // begin property changed signals +void EntriesChanged(); }; -namespace com { - namespace deepin { - namespace dde { - typedef ::DBusShutdownFront shutdownFront; - } +namespace dde { + namespace dock { + typedef ::DBusDockEntryManager EntryManager; } } #endif diff --git a/dbus/dde-dock-EntryManager.xml b/dbus/dde-dock-EntryManager.xml new file mode 100644 index 000000000..f010a1f85 --- /dev/null +++ b/dbus/dde-dock-EntryManager.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/dbus/dde-dock-entry-v1.xml b/dbus/dde-dock-entry-v1.xml new file mode 100644 index 000000000..b6839b0fc --- /dev/null +++ b/dbus/dde-dock-entry-v1.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dde-dock-bundle.pro b/dde-dock-bundle.pro deleted file mode 100644 index fe91812af..000000000 --- a/dde-dock-bundle.pro +++ /dev/null @@ -1,15 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = dde-dock \ - dde-dock-systray-plugin \ - dde-dock-shutdown-plugin \ - dde-dock-trash-plugin - -DEFINES += QT_MESSAGELOGCONTEXT - -# Automating generation .qm files from .ts files -system($$PWD/translate_generation.sh) - -qm_files.files += translations/*.qm -qm_files.path = /usr/share/dde-dock/translations/ - -INSTALLS += qm_files diff --git a/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.json b/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.json deleted file mode 100644 index 887610607..000000000 --- a/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "api_version" : 1.0, - "sys_plugin" : true -} diff --git a/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.pro b/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.pro deleted file mode 100644 index 106591d55..000000000 --- a/dde-dock-shutdown-plugin/dde-dock-shutdown-plugin.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += core gui widgets - -TARGET = dde-dock-shutdown-plugin -TEMPLATE = lib -CONFIG += plugin c++11 - -SOURCES += \ - shutdownplugin.cpp - -HEADERS += \ - shutdownplugin.h -INCLUDEPATH += ../dde-dock/src/ - -DISTFILES += dde-dock-shutdown-plugin.json - -target.path = $${PREFIX}/lib/dde-dock/plugins/ -INSTALLS += target - -QMAKE_MOC_OPTIONS += -I/usr/include/ - -RESOURCES += \ - resources.qrc diff --git a/dde-dock-shutdown-plugin/icons/fashion.svg b/dde-dock-shutdown-plugin/icons/fashion.svg deleted file mode 100644 index 5d7b44d2f..000000000 --- a/dde-dock-shutdown-plugin/icons/fashion.svg +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-shutdown-plugin/icons/normal.svg b/dde-dock-shutdown-plugin/icons/normal.svg deleted file mode 100644 index f32d3fae6..000000000 --- a/dde-dock-shutdown-plugin/icons/normal.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/dde-dock-shutdown-plugin/resources.qrc b/dde-dock-shutdown-plugin/resources.qrc deleted file mode 100644 index 301c1e2be..000000000 --- a/dde-dock-shutdown-plugin/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - icons/normal.svg - icons/fashion.svg - - diff --git a/dde-dock-shutdown-plugin/shutdownplugin.cpp b/dde-dock-shutdown-plugin/shutdownplugin.cpp deleted file mode 100644 index 410b6fdd9..000000000 --- a/dde-dock-shutdown-plugin/shutdownplugin.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "shutdownplugin.h" -#include "interfaces/dockconstants.h" - -#include -#include -#include -#include - -using namespace Dock; - -const QString PLUGIN_ID = "shutdown"; - -ShutdownPlugin::ShutdownPlugin(QObject *parent) - : QObject(parent) -{ - m_mainWidget = new QLabel; -} - -QString ShutdownPlugin::getPluginName() -{ - return QString(QCoreApplication::translate("HomeScreen", "Shutdown")); -} - -void ShutdownPlugin::init(DockPluginProxyInterface *proxy) -{ - m_proxy = proxy; - m_proxy->itemAddedEvent(PLUGIN_ID); - - changeMode(m_proxy->dockMode(), m_proxy->dockMode()); -} - -void ShutdownPlugin::changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) -{ - Q_UNUSED(oldMode) - - switch (newMode) - { - case Dock::FashionMode: - m_mainWidget->setFixedSize(APP_ITEM_FASHION_ICON_SIZE, APP_ITEM_FASHION_ICON_SIZE); - m_mainWidget->setPixmap(QPixmap(":/icons/icons/fashion.svg")); - break; - case Dock::ClassicMode: - case Dock::EfficientMode: - m_mainWidget->setFixedSize(APPLET_CLASSIC_ICON_SIZE, APPLET_CLASSIC_ICON_SIZE); - m_mainWidget->setPixmap(QPixmap(":/icons/icons/normal.svg")); - break; - } - - m_proxy->infoChangedEvent(DockPluginInterface::InfoTypeItemSize, PLUGIN_ID); -} - -QStringList ShutdownPlugin::ids() -{ - return QStringList(); -} - -QString ShutdownPlugin::getName(QString id) -{ - Q_UNUSED(id) - - return getPluginName(); -} - -QString ShutdownPlugin::getTitle(QString id) -{ - Q_UNUSED(id) - - return getPluginName(); -} - -QString ShutdownPlugin::getCommand(QString id) -{ - Q_UNUSED(id) - - return QString("dbus-send --print-reply --dest=com.deepin.dde.shutdownFront /com/deepin/dde/shutdownFront com.deepin.dde.shutdownFront.Show"); -} - -QWidget *ShutdownPlugin::getItem(QString id) -{ - Q_UNUSED(id) - - return m_mainWidget; -} - -QWidget *ShutdownPlugin::getApplet(QString id) -{ - Q_UNUSED(id) - - return nullptr; -} - -QString ShutdownPlugin::getMenuContent(QString id) -{ - Q_UNUSED(id) - - return QString(); -} - -void ShutdownPlugin::invokeMenuItem(QString id, QString itemId, bool checked) -{ - Q_UNUSED(id) - Q_UNUSED(itemId) - Q_UNUSED(checked) -} - -void ShutdownPlugin::setEnabled(const QString &id, bool enabled) -{ - Q_UNUSED(id) - Q_UNUSED(enabled) -} - -bool ShutdownPlugin::configurable(const QString &id) -{ - Q_UNUSED(id) - - return false; -} - -bool ShutdownPlugin::enabled(const QString &id) -{ - Q_UNUSED(id) - - return true; -} - -QPixmap ShutdownPlugin::getIcon(QString id) -{ - Q_UNUSED(id); - - return QPixmap(); -} diff --git a/dde-dock-shutdown-plugin/shutdownplugin.h b/dde-dock-shutdown-plugin/shutdownplugin.h deleted file mode 100644 index 8d675915b..000000000 --- a/dde-dock-shutdown-plugin/shutdownplugin.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef SHUTDOWNPLUGIN_H -#define SHUTDOWNPLUGIN_H - -#include -#include - -#include "interfaces/dockplugininterface.h" -#include "interfaces/dockpluginproxyinterface.h" - -class ShutdownPlugin : public QObject, public DockPluginInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.deepin.Dock.PluginInterface" FILE "dde-dock-shutdown-plugin.json") - Q_INTERFACES(DockPluginInterface) - -public: - explicit ShutdownPlugin(QObject *parent = 0); - - void init(DockPluginProxyInterface *proxy) Q_DECL_OVERRIDE; - void changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) Q_DECL_OVERRIDE; - void invokeMenuItem(QString id, QString itemId, bool checked) Q_DECL_OVERRIDE; - void setEnabled(const QString &id, bool enabled) Q_DECL_OVERRIDE; - bool configurable(const QString &id) Q_DECL_OVERRIDE; - bool enabled(const QString &id) Q_DECL_OVERRIDE; - QPixmap getIcon(QString id) Q_DECL_OVERRIDE; - QString getPluginName() Q_DECL_OVERRIDE; - QString getName(QString id) Q_DECL_OVERRIDE; - QString getTitle(QString id) Q_DECL_OVERRIDE; - QString getCommand(QString id) Q_DECL_OVERRIDE; - QString getMenuContent(QString id) Q_DECL_OVERRIDE; - QStringList ids() Q_DECL_OVERRIDE; - QWidget *getItem(QString id) Q_DECL_OVERRIDE; - QWidget *getApplet(QString id) Q_DECL_OVERRIDE; - -private: - DockPluginProxyInterface *m_proxy; - - QLabel *m_mainWidget; -}; - -#endif // SHUTDOWNPLUGIN_H diff --git a/dde-dock-systray-plugin/com.deepin.dde.TrayManager.xml b/dde-dock-systray-plugin/com.deepin.dde.TrayManager.xml deleted file mode 100644 index 1c5139f6e..000000000 --- a/dde-dock-systray-plugin/com.deepin.dde.TrayManager.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/compositetrayitem.cpp b/dde-dock-systray-plugin/compositetrayitem.cpp deleted file mode 100644 index f2a1053b8..000000000 --- a/dde-dock-systray-plugin/compositetrayitem.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include - -#include "trayicon.h" -#include "compositetrayitem.h" - -// these two variables are decided by the picture background. -static const int Margins = 4; -static const int ColumnWidth = 20; - -CompositeTrayItem::CompositeTrayItem(QWidget *parent) : - QFrame(parent), - m_isCovered(true), - m_isFolded(false) -{ - setFixedSize(1, 1); - setObjectName("CompositeItem"); - - m_cover = new QLabel(this); - m_cover->setFixedSize(48, 48); - m_cover->setPixmap(QPixmap(":/images/darea_cover.svg")); - m_cover->move(QPoint(0, 0)); - - m_coverTimer = new QTimer(this); - m_coverTimer->setInterval(500); - m_coverTimer->setSingleShot(true); - - m_updateTimer = new QTimer(this); - m_updateTimer->setInterval(500); - m_updateTimer->setSingleShot(false); - m_updateTimer->start(); - - - m_foldButton = new DImageButton(":/images/fold-button-normal.svg", - ":/images/fold-button-hover.svg", - ":/images/fold-button-press.svg", - this); - m_foldButton->setFixedSize(18, 18); - m_foldButton->hide(); - - m_unfoldButton = new DImageButton(":/images/unfold-button-normal.svg", - ":/images/unfold-button-hover.svg", - ":/images/unfold-button-press.svg", - this); - m_unfoldButton->setFixedSize(18, 18); - m_unfoldButton->hide(); - - connect(m_coverTimer, &QTimer::timeout, this, &CompositeTrayItem::tryCoverOn); - connect(m_updateTimer, &QTimer::timeout, this, &CompositeTrayItem::handleUpdateTimer); - connect(m_foldButton, &DImageButton::clicked, this, &CompositeTrayItem::fold); - connect(m_unfoldButton, &DImageButton::clicked, this, &CompositeTrayItem::unfold); -} - -CompositeTrayItem::~CompositeTrayItem() -{ - qDebug() << "CompositeTrayItem destroyed."; -} - -void CompositeTrayItem::addTrayIcon(QString key, TrayIcon * icon) -{ - m_icons[key] = icon; - - icon->setParent(this); - - this->relayout(); -} - -void CompositeTrayItem::remove(QString key) -{ - TrayIcon * icon = m_icons.take(key); - if (icon) { - - icon->setParent(NULL); - icon->deleteLater(); - - this->relayout(); - } -} - -Dock::DockMode CompositeTrayItem::mode() const -{ - return m_mode; -} - -void CompositeTrayItem::setMode(const Dock::DockMode &mode) -{ - if (m_mode != mode) { - m_mode = mode; - - this->relayout(); - } -} - -void CompositeTrayItem::clear() -{ - foreach (TrayIcon * icon, m_icons.values()) { - icon->deleteLater(); - } - m_icons.clear(); -} - -bool CompositeTrayItem::exist(const QString &key) -{ - return m_icons.keys().indexOf(key) != -1; -} - -QStringList CompositeTrayItem::trayIds() const -{ - return m_icons.keys(); -} - -void CompositeTrayItem::coverOn() -{ - m_coverTimer->stop(); - - m_cover->raise(); - m_cover->setVisible(true); - m_isCovered = true; -} - -void CompositeTrayItem::coverOff() -{ - m_cover->lower(); - m_cover->setVisible(false); - m_isCovered = false; -} - -void CompositeTrayItem::tryCoverOn() -{ - QPoint globalPos = mapToGlobal(QPoint(0, 0)); - QRect globalGeometry(globalPos, size()); - - if (!globalGeometry.contains(QCursor::pos()) && - (m_icons.keys().length() <= 4 || m_isFolded) && - m_mode == Dock::FashionMode) - { - coverOn(); - } -} - -void CompositeTrayItem::handleTrayiconDamage() -{ - m_coverTimer->stop(); - - unfold(); - - QList items = m_icons.values(); - for (int i = 0; i < items.length(); i++) { - TrayIcon * icon = items.at(i); - icon->updateIcon(); - } -} - -void CompositeTrayItem::handleUpdateTimer() -{ - QList items = m_icons.values(); - for (int i = 0; i < items.length(); i++) { - TrayIcon * icon = items.at(i); - icon->updateIcon(); - } -} - -bool CompositeTrayItem::eventFilter(QObject *obj, QEvent *event) -{ - if (event->type() == QEvent::Enter) { - //disable parent's hover event - return true; - } - - return QFrame::eventFilter(obj, event); -} - -void CompositeTrayItem::resizeEvent(QResizeEvent * event) -{ - emit sizeChanged(); - - QFrame::resizeEvent(event); -} - -void CompositeTrayItem::enterEvent(QEvent * event) -{ - coverOff(); - - QFrame::enterEvent(event); -} - -void CompositeTrayItem::leaveEvent(QEvent * event) -{ - m_coverTimer->start(); - - QFrame::leaveEvent(event); -} - -void CompositeTrayItem::fold() -{ - m_isFolded = true; - - relayout(); -} - -void CompositeTrayItem::unfold() -{ - m_isFolded = false; - - coverOff(); - relayout(); -} - -void CompositeTrayItem::relayout() -{ - uint childrenCount = m_icons.keys().length(); - uint columnCount = 2; - - if (childrenCount <= 4) { - columnCount = 2; - } else if (childrenCount <= 6) { - columnCount = 3; - } else if (childrenCount <= 8) { - columnCount = 4; - } else if (childrenCount <= 10) { - columnCount = 5; - } else if (childrenCount <= 12) { - columnCount = 6; - } - - if (m_mode == Dock::FashionMode) { - QList items = m_icons.values(); - - if (m_isFolded) { - columnCount = 2; - } else if (columnCount > 2 && childrenCount % 2 == 0) { - columnCount += 1; - } - - QString style = QString("QFrame#CompositeItem { background-image: url(':/images/darea_container_%1.svg') }").arg(columnCount * 2); - setStyleSheet(style); - - setFixedSize(Margins * 2 + ColumnWidth * columnCount, 48); - - int placesCount = items.length(); - if (m_isFolded && placesCount > 3) { placesCount = 3;} - - for (int i = 0; i < items.length(); i++) { - TrayIcon * icon = items.at(i); - - if (i < placesCount) { - icon->maskOn(); - - int x = i % columnCount * ColumnWidth + Margins + (ColumnWidth - 16) / 2; - int y = i / columnCount * ColumnWidth + Margins + (ColumnWidth - 16) / 2; - - icon->move(x, y); - icon->show(); - icon->updateIcon(); - } else { - icon->hideIcon(); - } - } - - if (columnCount > 2) { - m_foldButton->move((columnCount - 1) * ColumnWidth + Margins + (ColumnWidth - 16) / 2, - ColumnWidth + Margins + (ColumnWidth - 16) / 2); - m_foldButton->show(); - m_unfoldButton->hide(); - } else if (m_isFolded) { - m_unfoldButton->move((columnCount - 1) * ColumnWidth + Margins + (ColumnWidth - 16) / 2, - ColumnWidth + Margins + (ColumnWidth - 16) / 2); - m_unfoldButton->show(); - m_foldButton->hide(); - } else { - m_foldButton->hide(); - m_unfoldButton->hide(); - } - - if (m_isCovered) { - m_cover->raise(); - m_cover->show(); - } else { - m_cover->hide(); - } - } else { - m_cover->hide(); - - setStyleSheet(""); - setFixedSize(childrenCount * Dock::APPLET_CLASSIC_ICON_SIZE + (childrenCount - 1) * Dock::APPLET_CLASSIC_ITEM_SPACING, - Dock::APPLET_CLASSIC_ICON_SIZE); - - QList items = m_icons.values(); - for (int i = 0; i < items.length(); i++) { - TrayIcon * icon = items.at(i); - icon->maskOff(); - - icon->move(i * (Dock::APPLET_CLASSIC_ICON_SIZE + Dock::APPLET_CLASSIC_ITEM_SPACING), 0); - icon->show(); - icon->updateIcon(); - } - } -} diff --git a/dde-dock-systray-plugin/compositetrayitem.h b/dde-dock-systray-plugin/compositetrayitem.h deleted file mode 100644 index 30373011f..000000000 --- a/dde-dock-systray-plugin/compositetrayitem.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef COMPOSITETRAYITEM_H -#define COMPOSITETRAYITEM_H - -#include -#include - -#include - -#include "interfaces/dockconstants.h" - -DWIDGET_USE_NAMESPACE; - -class TrayIcon; -class QLabel; -class CompositeTrayItem : public QFrame -{ - Q_OBJECT -public: - explicit CompositeTrayItem(QWidget *parent = 0); - virtual ~CompositeTrayItem(); - - void addTrayIcon(QString key, TrayIcon * item); - void remove(QString key); - void setMode(const Dock::DockMode &mode); - void clear(); - - bool exist(const QString &key); - QStringList trayIds() const; - Dock::DockMode mode() const; - - void coverOn(); - void coverOff(); - -signals: - void sizeChanged(); - -public slots: - void handleTrayiconDamage(); - void handleUpdateTimer(); - -protected: - bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; - void enterEvent(QEvent *) Q_DECL_OVERRIDE; - void leaveEvent(QEvent *) Q_DECL_OVERRIDE; - -private: - Dock::DockMode m_mode; - QMap m_icons; - QPixmap m_itemMask; - QLabel * m_cover; - QTimer * m_coverTimer; - QTimer * m_updateTimer; - DImageButton * m_foldButton; - DImageButton * m_unfoldButton; - bool m_isCovered; - bool m_isFolded; - - void relayout(); - -private slots: - void tryCoverOn(); - void fold(); - void unfold(); -}; - -#endif // COMPOSITETRAYITEM_H diff --git a/dde-dock-systray-plugin/dbustraymanager.cpp b/dde-dock-systray-plugin/dbustraymanager.cpp deleted file mode 100644 index a57a543b6..000000000 --- a/dde-dock-systray-plugin/dbustraymanager.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c TrayManager -p dbustraymanager ./com.deepin.dde.TrayManager.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 "dbustraymanager.h" - -/* - * Implementation of interface class TrayManager - */ - -TrayManager::TrayManager(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -TrayManager::~TrayManager() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-systray-plugin/dbustraymanager.h b/dde-dock-systray-plugin/dbustraymanager.h deleted file mode 100644 index 3752d575e..000000000 --- a/dde-dock-systray-plugin/dbustraymanager.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c TrayManager -p dbustraymanager ./com.deepin.dde.TrayManager.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 DBUSTRAYMANAGER_H_1443507634 -#define DBUSTRAYMANAGER_H_1443507634 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.dde.TrayManager - */ -class TrayManager: 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.TrayManager") - 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.TrayManager"; } - -public: - TrayManager(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - - ~TrayManager(); - - Q_PROPERTY(QList TrayIcons READ trayIcons NOTIFY TrayIconsChanged) - inline QList trayIcons() const - { return qvariant_cast< QList >(property("TrayIcons")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> EnableNotification(uint in0, bool in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("EnableNotification"), argumentList); - } - - inline QDBusPendingReply GetName(uint in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("GetName"), argumentList); - } - - inline QDBusPendingReply Manage() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Manage"), argumentList); - } - - inline QDBusPendingReply<> RequireManageTrayIcons() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("RequireManageTrayIcons"), argumentList); - } - - inline QDBusPendingReply<> RetryManager() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("RetryManager"), argumentList); - } - - inline QDBusPendingReply Unmanage() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Unmanage"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Added(uint in0); - void Changed(uint in0); - void Removed(uint in0); -// begin property changed signals -void TrayIconsChanged(); -}; - -namespace com { - namespace deepin { - namespace dde { - typedef ::TrayManager TrayManager; - } - } -} -#endif diff --git a/dde-dock-systray-plugin/dde-dock-systray-plugin.json b/dde-dock-systray-plugin/dde-dock-systray-plugin.json deleted file mode 100644 index 887610607..000000000 --- a/dde-dock-systray-plugin/dde-dock-systray-plugin.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "api_version" : 1.0, - "sys_plugin" : true -} diff --git a/dde-dock-systray-plugin/dde-dock-systray-plugin.pro b/dde-dock-systray-plugin/dde-dock-systray-plugin.pro deleted file mode 100644 index 705bea8f3..000000000 --- a/dde-dock-systray-plugin/dde-dock-systray-plugin.pro +++ /dev/null @@ -1,34 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-06-29T20:08:12 -# -#------------------------------------------------- - -QT += core gui dbus x11extras - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -PKGCONFIG += xcb xcb-image xcb-composite dtkbase dtkwidget -CONFIG += plugin c++11 link_pkgconfig - -TARGET = $$qtLibraryTarget(dde-dock-systray-plugin) -TEMPLATE = lib -INCLUDEPATH += ../dde-dock/src/ - -SOURCES += systrayplugin.cpp \ - dbustraymanager.cpp \ - compositetrayitem.cpp \ - trayicon.cpp \ - ../dde-dock/src/dbus/dbusentrymanager.cpp - -HEADERS += systrayplugin.h \ - dbustraymanager.h \ - compositetrayitem.h \ - trayicon.h \ - ../dde-dock/src/dbus/dbusentrymanager.h - -RESOURCES += images.qrc -DISTFILES += dde-dock-systray-plugin.json - -target.path = /usr/lib/dde-dock/plugins/ -INSTALLS += target diff --git a/dde-dock-systray-plugin/images.qrc b/dde-dock-systray-plugin/images.qrc deleted file mode 100644 index 85055d027..000000000 --- a/dde-dock-systray-plugin/images.qrc +++ /dev/null @@ -1,16 +0,0 @@ - - - images/darea_container_4.svg - images/darea_container_6.svg - images/darea_container_8.svg - images/darea_container_10.svg - images/darea_container_12.svg - images/darea_cover.svg - images/fold-button-normal.svg - images/fold-button-hover.svg - images/fold-button-press.svg - images/unfold-button-normal.svg - images/unfold-button-hover.svg - images/unfold-button-press.svg - - diff --git a/dde-dock-systray-plugin/images/darea_container_10.svg b/dde-dock-systray-plugin/images/darea_container_10.svg deleted file mode 100644 index 84350e014..000000000 --- a/dde-dock-systray-plugin/images/darea_container_10.svg +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/darea_container_12.svg b/dde-dock-systray-plugin/images/darea_container_12.svg deleted file mode 100644 index baa0c04f1..000000000 --- a/dde-dock-systray-plugin/images/darea_container_12.svg +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/darea_container_4.svg b/dde-dock-systray-plugin/images/darea_container_4.svg deleted file mode 100644 index 02a167707..000000000 --- a/dde-dock-systray-plugin/images/darea_container_4.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/darea_container_6.svg b/dde-dock-systray-plugin/images/darea_container_6.svg deleted file mode 100644 index 02a1bf6f6..000000000 --- a/dde-dock-systray-plugin/images/darea_container_6.svg +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/darea_container_8.svg b/dde-dock-systray-plugin/images/darea_container_8.svg deleted file mode 100644 index dce2a0b66..000000000 --- a/dde-dock-systray-plugin/images/darea_container_8.svg +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/darea_cover.svg b/dde-dock-systray-plugin/images/darea_cover.svg deleted file mode 100644 index d1fe16365..000000000 --- a/dde-dock-systray-plugin/images/darea_cover.svg +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/fold-button-hover.svg b/dde-dock-systray-plugin/images/fold-button-hover.svg deleted file mode 100644 index c51f9e2b5..000000000 --- a/dde-dock-systray-plugin/images/fold-button-hover.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dde-dock-systray-plugin/images/fold-button-normal.svg b/dde-dock-systray-plugin/images/fold-button-normal.svg deleted file mode 100644 index b584f24e0..000000000 --- a/dde-dock-systray-plugin/images/fold-button-normal.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dde-dock-systray-plugin/images/fold-button-press.svg b/dde-dock-systray-plugin/images/fold-button-press.svg deleted file mode 100644 index ae1920c4c..000000000 --- a/dde-dock-systray-plugin/images/fold-button-press.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dde-dock-systray-plugin/images/unfold-button-hover.svg b/dde-dock-systray-plugin/images/unfold-button-hover.svg deleted file mode 100644 index 67c554df5..000000000 --- a/dde-dock-systray-plugin/images/unfold-button-hover.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dde-dock-systray-plugin/images/unfold-button-normal.svg b/dde-dock-systray-plugin/images/unfold-button-normal.svg deleted file mode 100644 index 564d8c764..000000000 --- a/dde-dock-systray-plugin/images/unfold-button-normal.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dde-dock-systray-plugin/images/unfold-button-press.svg b/dde-dock-systray-plugin/images/unfold-button-press.svg deleted file mode 100644 index c3a8b9c38..000000000 --- a/dde-dock-systray-plugin/images/unfold-button-press.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dde-dock-systray-plugin/main.cpp b/dde-dock-systray-plugin/main.cpp deleted file mode 100644 index 0ab90aab2..000000000 --- a/dde-dock-systray-plugin/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "systrayplugin.h" -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - SystrayPlugin w; - w.show(); - - return a.exec(); -} diff --git a/dde-dock-systray-plugin/systrayplugin.cpp b/dde-dock-systray-plugin/systrayplugin.cpp deleted file mode 100644 index 2c18ea8a9..000000000 --- a/dde-dock-systray-plugin/systrayplugin.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include - -#include "systrayplugin.h" -#include "compositetrayitem.h" -#include "trayicon.h" -#include "../dde-dock/src/dbus/dbusentrymanager.h" - -static const QString CompositeItemKey = "composite_item_key"; - -SystrayPlugin::SystrayPlugin() -{ - m_compositeItem = new CompositeTrayItem; - - connect(m_compositeItem, &CompositeTrayItem::sizeChanged, - this, &SystrayPlugin::onCompositeItemSizeChanged); -} - -SystrayPlugin::~SystrayPlugin() -{ - m_compositeItem->deleteLater(); -} - -void SystrayPlugin::init(DockPluginProxyInterface * proxy) -{ - m_proxy = proxy; - m_compositeItem->setMode(proxy->dockMode()); - - if (!m_dbusTrayManager) { - m_dbusTrayManager = new com::deepin::dde::TrayManager("com.deepin.dde.TrayManager", - "/com/deepin/dde/TrayManager", - QDBusConnection::sessionBus(), - this); - connect(m_dbusTrayManager, &TrayManager::TrayIconsChanged, this, &SystrayPlugin::onTrayIconsChanged); - connect(m_dbusTrayManager, &TrayManager::Changed, m_compositeItem, &CompositeTrayItem::handleTrayiconDamage); - } - - DBusEntryManager *entryManager = new DBusEntryManager(this); - connect(entryManager, &DBusEntryManager::TrayInited, this, &SystrayPlugin::onTrayInit); - - initTrayIcons(); - - if (m_compositeItem->parentWidget()) { - //wait for parentWidget() is valuable to set eventFilter - m_compositeItem->parentWidget()->installEventFilter(m_compositeItem); - } -} - -QString SystrayPlugin::getPluginName() -{ - return "System Tray"; -} - -QStringList SystrayPlugin::ids() -{ - return QStringList(CompositeItemKey); -} - -QString SystrayPlugin::getTitle(QString) -{ - return ""; -} - -QString SystrayPlugin::getName(QString) -{ - return getPluginName(); -} - -QString SystrayPlugin::getCommand(QString) -{ - return ""; -} - -bool SystrayPlugin::configurable(const QString &) -{ - return false; -} - -bool SystrayPlugin::enabled(const QString &) -{ - return true; -} - -void SystrayPlugin::setEnabled(const QString &, bool) -{ - -} - -QWidget * SystrayPlugin::getItem(QString) -{ - return m_compositeItem; -} - -QWidget * SystrayPlugin::getApplet(QString) -{ - return NULL; -} - -void SystrayPlugin::changeMode(Dock::DockMode newMode, Dock::DockMode) -{ - m_compositeItem->setMode(newMode); - m_proxy->infoChangedEvent(DockPluginInterface::InfoTypeItemSize, CompositeItemKey); -} - -QString SystrayPlugin::getMenuContent(QString) -{ - return ""; -} - -void SystrayPlugin::invokeMenuItem(QString, QString, bool) -{ - -} - -void SystrayPlugin::initTrayIcons() -{ - m_compositeItem->clear(); - - m_dbusTrayManager->RetryManager(); - QList trayIcons = m_dbusTrayManager->trayIcons(); - qDebug() << "Init trayicons, Found trayicons: " <isValid() << trayIcons << m_dbusTrayManager->property("TrayIcons"); - - foreach (uint trayIcon, trayIcons) { - addTrayIcon(trayIcon); - } - - m_proxy->itemAddedEvent(CompositeItemKey); -} - -// private slots -void SystrayPlugin::addTrayIcon(WId winId) -{ - QString key = QString::number(winId); - if (m_compositeItem->exist(key)) - return; - qWarning() << "Systray add:" << winId; - - TrayIcon * icon = new TrayIcon(winId); - - m_compositeItem->addTrayIcon(key, icon); - - m_proxy->infoChangedEvent(DockPluginInterface::InfoTypeItemSize, CompositeItemKey); -} - -void SystrayPlugin::removeTrayIcon(WId winId) -{ - qWarning() << "Systray remove:" << winId; - QString key = QString::number(winId); - - m_compositeItem->remove(key); - - m_proxy->infoChangedEvent(DockPluginInterface::InfoTypeItemSize, CompositeItemKey); -} - -void SystrayPlugin::onTrayIconsChanged() -{ - QList icons = m_dbusTrayManager->trayIcons(); - QStringList ids = m_compositeItem->trayIds(); - qDebug() << "TrayIconsChanged:" << icons; - foreach (uint id, icons) { //add news - if (ids.indexOf(QString::number(id)) == -1) { - addTrayIcon(id); - } - } - foreach (QString id, ids) { //remove olds - if (icons.indexOf(id.toUInt()) == -1) { - removeTrayIcon(id.toUInt()); - } - } -} - -void SystrayPlugin::onTrayInit() -{ - -} - -void SystrayPlugin::onCompositeItemSizeChanged() -{ - m_proxy->infoChangedEvent(DockPluginInterface::InfoTypeItemSize, CompositeItemKey); -} diff --git a/dde-dock-systray-plugin/systrayplugin.h b/dde-dock-systray-plugin/systrayplugin.h deleted file mode 100644 index 88f117500..000000000 --- a/dde-dock-systray-plugin/systrayplugin.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef SYSTRAYPLUGIN_H -#define SYSTRAYPLUGIN_H - -#include -#include -#include -#include - -#include "interfaces/dockconstants.h" -#include "interfaces/dockplugininterface.h" -#include "interfaces/dockpluginproxyinterface.h" - -#include "dbustraymanager.h" - -class CompositeTrayItem; -class SystrayPlugin : public QObject, public DockPluginInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.deepin.Dock.PluginInterface" FILE "dde-dock-systray-plugin.json") - Q_INTERFACES(DockPluginInterface) - -public: - SystrayPlugin(); - ~SystrayPlugin(); - - void init(DockPluginProxyInterface * proxy) Q_DECL_OVERRIDE; - - QString getPluginName() Q_DECL_OVERRIDE; - - QStringList ids() Q_DECL_OVERRIDE; - QString getTitle(QString id) Q_DECL_OVERRIDE; - QString getName(QString id) Q_DECL_OVERRIDE; - QString getCommand(QString id) Q_DECL_OVERRIDE; - bool configurable(const QString &id) Q_DECL_OVERRIDE; - bool enabled(const QString &id) Q_DECL_OVERRIDE; - void setEnabled(const QString &id, bool enable) Q_DECL_OVERRIDE; - QWidget * getItem(QString id) Q_DECL_OVERRIDE; - QWidget * getApplet(QString id) Q_DECL_OVERRIDE; - void changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) Q_DECL_OVERRIDE; - - QString getMenuContent(QString id) Q_DECL_OVERRIDE; - void invokeMenuItem(QString id, QString itemId, bool checked) Q_DECL_OVERRIDE; - -private slots: - void onTrayIconsChanged(); - void onTrayInit(); - void onCompositeItemSizeChanged(); - -private: - void initTrayIcons(); - void addTrayIcon(WId winId); - void removeTrayIcon(WId winId); - -private: - CompositeTrayItem * m_compositeItem = 0; - DockPluginProxyInterface * m_proxy = 0; - com::deepin::dde::TrayManager *m_dbusTrayManager = 0; -}; - -#endif // SYSTRAYPLUGIN_H diff --git a/dde-dock-systray-plugin/trayicon.cpp b/dde-dock-systray-plugin/trayicon.cpp deleted file mode 100644 index c2c00e034..000000000 --- a/dde-dock-systray-plugin/trayicon.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "interfaces/dockconstants.h" - -#include "trayicon.h" - -static const uint16_t s_embedSize = Dock::APPLET_CLASSIC_ICON_SIZE; - -void sni_cleanup_xcb_image(void *data) -{ - xcb_image_destroy(static_cast(data)); -} - -TrayIcon::TrayIcon(WId winId, QWidget *parent) : - QFrame(parent), - m_windowId(winId) -{ - resize(s_embedSize, s_embedSize); - - wrapWindow(); - updateIcon(); - - // prevent the updateIcon function from being executed overly. - m_timer = new QTimer(this); - m_timer->setInterval(500); - m_timer->setSingleShot(true); - - connect(m_timer, &QTimer::timeout, this, &TrayIcon::updateIcon); -} - -TrayIcon::~TrayIcon() -{ - -} - -void TrayIcon::paintEvent(QPaintEvent *) -{ - QPainter painter; - painter.begin(this); - painter.setRenderHint(QPainter::Antialiasing); - - m_image = getImageNonComposite(); - if (!m_image.isNull()) { - if (m_masked) { - QPainterPath path; - path.addRoundedRect(0, 0, s_embedSize, s_embedSize, s_embedSize / 2, s_embedSize / 2); - - painter.setClipPath(path); - } - - painter.drawImage(0, 0, m_image.scaled(s_embedSize, s_embedSize)); - } - - painter.end(); -} - -/* -void TrayIcon::mousePressEvent(QMouseEvent * event) -{ - qDebug() << event->globalPos(); - - QPoint globalPos = mapToGlobal(QPoint(0, 0)); - uint8_t buttonIndex = XCB_BUTTON_INDEX_1; - - switch (event->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 TrayIcon::maskOn() -{ - m_masked = true; - - repaint(); -} - -void TrayIcon::maskOff() -{ - m_masked = false; - - repaint(); -} - -void TrayIcon::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 - 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] = screen->black_pixel; //draw a solid background so the embeded 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 */ - s_embedSize, s_embedSize, /* 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); - - 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 > s_embedSize || clientGeom->height > s_embedSize ) - { - const uint32_t windowMoveConfigVals[2] = { s_embedSize, s_embedSize }; - 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, s_embedSize), qMin(clientGeom->height, s_embedSize)); - - xcb_flush(c); -} - -void TrayIcon::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 TrayIcon::updateIcon() -{ - if (!isVisible()) return; - - if (m_timer->isActive()) { - return; - } else { - m_timer->start(); - } - - auto c = QX11Info::connection(); - - const uint32_t stackAboveData[] = {XCB_STACK_MODE_ABOVE}; - xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); - - QPoint globalPos = mapToGlobal(QPoint(0, 0)); - const uint32_t windowMoveConfigVals[2] = { uint32_t(globalPos.x()), uint32_t(globalPos.y()) }; - xcb_configure_window(c, m_containerWid, - XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, - windowMoveConfigVals); - - const uint32_t windowResizeConfigVals[2] = { s_embedSize, s_embedSize }; - xcb_configure_window(c, m_windowId, - XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, - windowResizeConfigVals); - - repaint(); -} - -QImage TrayIcon::getImageNonComposite() -{ - 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 QImage(); - - xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP); - - if (image == NULL) - return QImage(); - - QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image); - - return qimage; -} - -void TrayIcon::sendClick(uint8_t mouseButton, int x, int y) -{ - //it's best not to look at this code - //GTK doesn't like send_events and double checks the mouse position matches where the window is and is top level - //in order to solve this we move the embed container over to where the mouse is then replay the event using send_event - //if patching, test with xchat + xchat context menus - - //note x,y are not actually where the mouse is, but the plasmoid - //ideally we should make this match the plasmoid hit area - - auto c = QX11Info::connection(); - - auto cookieSize = xcb_get_geometry(c, m_windowId); - QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookieSize, Q_NULLPTR)); - - auto cookie = xcb_query_pointer(c, m_windowId); - QScopedPointer pointer(xcb_query_pointer_reply(c, cookie, Q_NULLPTR)); - - qDebug() << pointer->root_x << pointer->root_y << x << y << clientGeom->width << clientGeom->height; - - //move our window so the mouse is within its geometry - uint32_t configVals[2] = {0, 0}; - if (mouseButton >= XCB_BUTTON_INDEX_4) { - //scroll event, take pointer position - configVals[0] = pointer->root_x; - configVals[1] = pointer->root_y; - } else { - if (pointer->root_x > x + clientGeom->width) - configVals[0] = pointer->root_x - clientGeom->width + 1; - else - configVals[0] = static_cast(x); - if (pointer->root_y > y + clientGeom->height) - configVals[1] = pointer->root_y - clientGeom->height + 1; - else - configVals[1] = static_cast(y); - } - xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, configVals); - - //pull window up -// const uint32_t stackAboveData[] = {XCB_STACK_MODE_ABOVE}; -// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); - -// system(QString("xdotool click --window %1 %2").arg(m_windowId).arg(mouseButton).toLatin1()); - - //mouse down - { - xcb_button_press_event_t* event = new xcb_button_press_event_t; - memset(event, 0x00, sizeof(xcb_button_press_event_t)); - event->response_type = XCB_BUTTON_PRESS; - event->event = m_windowId; - event->time = QX11Info::getTimestamp(); - event->same_screen = 1; - event->root = QX11Info::appRootWindow(); - event->root_x = x; - event->root_y = y; - event->event_x = 0; - event->event_y = 0; - event->child = 0; - event->state = 0; - event->detail = mouseButton; - - xcb_send_event(c, false, m_windowId, XCB_EVENT_MASK_BUTTON_PRESS, (char *) event); -// free(event); - delete event; - } - - //mouse up - { - xcb_button_release_event_t* event = new xcb_button_release_event_t; - memset(event, 0x00, sizeof(xcb_button_release_event_t)); - event->response_type = XCB_BUTTON_RELEASE; - event->event = m_windowId; - event->time = QX11Info::getTimestamp(); - event->same_screen = 1; - event->root = QX11Info::appRootWindow(); - event->root_x = x; - event->root_y = y; - event->event_x = 0; - event->event_y = 0; - event->child = 0; - event->state = 0; - event->detail = mouseButton; - - xcb_send_event(c, false, m_windowId, XCB_EVENT_MASK_BUTTON_RELEASE, (char *) event); -// free(event); - delete event; - } - -// const uint32_t stackBelowData[] = {XCB_STACK_MODE_BELOW}; -// xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData); -} diff --git a/dde-dock-systray-plugin/trayicon.h b/dde-dock-systray-plugin/trayicon.h deleted file mode 100644 index 3aa11d34d..000000000 --- a/dde-dock-systray-plugin/trayicon.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef TRAYICON_H -#define TRAYICON_H - -#include -#include -#include - -class QPaintEvent; -class QMouseEvent; -class TrayIcon : public QFrame -{ - Q_OBJECT -public: - explicit TrayIcon(WId winId, QWidget *parent = 0); - ~TrayIcon(); - - void maskOn(); - void maskOff(); - - void hideIcon(); - void updateIcon(); - -protected: - void paintEvent(QPaintEvent *); -// void mousePressEvent(QMouseEvent *); - -private: - WId m_windowId; - WId m_containerWid; - bool m_masked; - bool m_hided; - QTimer * m_timer; - QImage m_image; - - void wrapWindow(); - QImage getImageNonComposite(); - void sendClick(uint8_t, int, int); -}; - -#endif // TRAYICON_H diff --git a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_hover.png b/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_hover.png deleted file mode 100644 index b796abc9c..000000000 Binary files a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_hover.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_normal.png b/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_normal.png deleted file mode 100644 index fe463b791..000000000 Binary files a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_normal.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_press.png b/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_press.png deleted file mode 100644 index 47c0a8c0a..000000000 Binary files a/dde-dock-trash-plugin/Resource/dark/images/dark_close_small_press.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/dark/qss/trash.qss b/dde-dock-trash-plugin/Resource/dark/qss/trash.qss deleted file mode 100644 index 112900ac8..000000000 --- a/dde-dock-trash-plugin/Resource/dark/qss/trash.qss +++ /dev/null @@ -1,54 +0,0 @@ -QFrame#ContentFrame{ - background-color: rgba(0, 0, 0, 0.7); - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 4px; -} - -QPushButton#CloseButton{ - border-image: url(":/images/Resource/dark/images/dark_close_small_normal.png") -} - -QPushButton#CloseButton:hover{ - border-image: url(":/images/Resource/dark/images/dark_close_small_hover.png") -} - - -QPushButton#CloseButton:pressed{ - border-image: url(":/images/Resource/dark/images/dark_close_small_press.png") -} - -QPushButton#ActionButton{ - background-color: transparent; - border: 1px solid rgba(255, 255, 255, 0.3); - border-right: none; - border-left: none; - border-bottom: none; - color: white; - text-align: center; -} - -QPushButton#ActionButton:hover{ - background-color: transparent; - color: rgba(255, 255, 255, 0.5); -} - -QPushButton#ActionButton:pressed{ - background-color: transparent; - color: #01bdff; -} - -QLabel#VLine{ - background-color:rgba(255, 255, 255, 0.3); -} - -QLabel#MessageLabel{ - padding-top: 2px; - padding-bottom: 2px; - color: white; -} - -QLabel#TipMessageLabel{ - padding-top: 2px; - padding-bottom: 2px; - color: #ffa530; -} diff --git a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_hover.png b/dde-dock-trash-plugin/Resource/light/images/dark_close_small_hover.png deleted file mode 100644 index b796abc9c..000000000 Binary files a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_hover.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_normal.png b/dde-dock-trash-plugin/Resource/light/images/dark_close_small_normal.png deleted file mode 100644 index fe463b791..000000000 Binary files a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_normal.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_press.png b/dde-dock-trash-plugin/Resource/light/images/dark_close_small_press.png deleted file mode 100644 index 47c0a8c0a..000000000 Binary files a/dde-dock-trash-plugin/Resource/light/images/dark_close_small_press.png and /dev/null differ diff --git a/dde-dock-trash-plugin/Resource/light/qss/trash.qss b/dde-dock-trash-plugin/Resource/light/qss/trash.qss deleted file mode 100644 index 112900ac8..000000000 --- a/dde-dock-trash-plugin/Resource/light/qss/trash.qss +++ /dev/null @@ -1,54 +0,0 @@ -QFrame#ContentFrame{ - background-color: rgba(0, 0, 0, 0.7); - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 4px; -} - -QPushButton#CloseButton{ - border-image: url(":/images/Resource/dark/images/dark_close_small_normal.png") -} - -QPushButton#CloseButton:hover{ - border-image: url(":/images/Resource/dark/images/dark_close_small_hover.png") -} - - -QPushButton#CloseButton:pressed{ - border-image: url(":/images/Resource/dark/images/dark_close_small_press.png") -} - -QPushButton#ActionButton{ - background-color: transparent; - border: 1px solid rgba(255, 255, 255, 0.3); - border-right: none; - border-left: none; - border-bottom: none; - color: white; - text-align: center; -} - -QPushButton#ActionButton:hover{ - background-color: transparent; - color: rgba(255, 255, 255, 0.5); -} - -QPushButton#ActionButton:pressed{ - background-color: transparent; - color: #01bdff; -} - -QLabel#VLine{ - background-color:rgba(255, 255, 255, 0.3); -} - -QLabel#MessageLabel{ - padding-top: 2px; - padding-bottom: 2px; - color: white; -} - -QLabel#TipMessageLabel{ - padding-top: 2px; - padding-bottom: 2px; - color: #ffa530; -} diff --git a/dde-dock-trash-plugin/dbus/dbusemptytrashjob.cpp b/dde-dock-trash-plugin/dbus/dbusemptytrashjob.cpp deleted file mode 100644 index d6bc72627..000000000 --- a/dde-dock-trash-plugin/dbus/dbusemptytrashjob.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusEmptyTrashJob -p dbusemptytrashjob com.deepin.filemanager.Backend.Operations.EmptyTrashJob.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 "dbusemptytrashjob.h" - -/* - * Implementation of interface class DBusEmptyTrashJob - */ - -DBusEmptyTrashJob::DBusEmptyTrashJob(const QString &path, QObject *parent) - : QDBusAbstractInterface(staticServerPath(), path, staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusEmptyTrashJob::~DBusEmptyTrashJob() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-trash-plugin/dbus/dbusemptytrashjob.h b/dde-dock-trash-plugin/dbus/dbusemptytrashjob.h deleted file mode 100644 index 303479b86..000000000 --- a/dde-dock-trash-plugin/dbus/dbusemptytrashjob.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusEmptyTrashJob -p dbusemptytrashjob com.deepin.filemanager.Backend.Operations.EmptyTrashJob.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 DBUSEMPTYTRASHJOB_H_1437723880 -#define DBUSEMPTYTRASHJOB_H_1437723880 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.filemanager.Backend.Operations.EmptyTrashJob - */ -class DBusEmptyTrashJob: 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.filemanager.Backend.Operations.EmptyTrashJob") - 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 *staticServerPath() - { return "com.deepin.filemanager.Backend.Operations"; } - static inline const char *staticInterfaceName() - { return "com.deepin.filemanager.Backend.Operations.EmptyTrashJob"; } - -public: - DBusEmptyTrashJob(const QString &path, QObject *parent = 0); - - ~DBusEmptyTrashJob(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Execute() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Execute"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Done(); -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace filemanager { - namespace Backend { - namespace Operations { - typedef ::DBusEmptyTrashJob EmptyTrashJob; - } - } - } - } -} -#endif diff --git a/dde-dock-trash-plugin/dbus/dbusfileoperations.cpp b/dde-dock-trash-plugin/dbus/dbusfileoperations.cpp deleted file mode 100644 index c4e9d5bc5..000000000 --- a/dde-dock-trash-plugin/dbus/dbusfileoperations.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusFileOperations -p dbusfileoperations com.deepin.filemanager.Backend.Operations.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 "dbusfileoperations.h" - -/* - * Implementation of interface class DBusFileOperations - */ - -DBusFileOperations::DBusFileOperations(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusFileOperations::~DBusFileOperations() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-trash-plugin/dbus/dbusfileoperations.h b/dde-dock-trash-plugin/dbus/dbusfileoperations.h deleted file mode 100644 index 6123eedc3..000000000 --- a/dde-dock-trash-plugin/dbus/dbusfileoperations.h +++ /dev/null @@ -1,423 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusFileOperations -p dbusfileoperations com.deepin.filemanager.Backend.Operations.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 DBUSFILEOPERATIONS_H_1437701966 -#define DBUSFILEOPERATIONS_H_1437701966 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.filemanager.Backend.Operations - */ -class DBusFileOperations: 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.filemanager.Backend.Operations") - 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 *staticServerPath() - { return "com.deepin.filemanager.Backend.Operations"; } - static inline const char *staticInterfacePath() - { return "/com/deepin/filemanager/Backend/Operations"; } - static inline const char *staticInterfaceName() - { return "com.deepin.filemanager.Backend.Operations"; } - -public: - DBusFileOperations(QObject *parent = 0); - - ~DBusFileOperations(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply NewChmodJob(const QString &in0, uint in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("NewChmodJob"), argumentList); - } - inline QDBusReply NewChmodJob(const QString &in0, uint in1, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewChmodJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewChownJob(const QString &in0, const QString &in1, const QString &in2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - return asyncCallWithArgumentList(QStringLiteral("NewChownJob"), argumentList); - } - inline QDBusReply NewChownJob(const QString &in0, const QString &in1, const QString &in2, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewChownJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewCopyJob(const QStringList &in0, const QString &in1, const QString &in2, uint in3, const QString &in4, const QString &in5, const QString &in6) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6); - return asyncCallWithArgumentList(QStringLiteral("NewCopyJob"), argumentList); - } - inline QDBusReply NewCopyJob(const QStringList &in0, const QString &in1, const QString &in2, uint in3, const QString &in4, const QString &in5, const QString &in6, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewCopyJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewCreateDirectoryJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - return asyncCallWithArgumentList(QStringLiteral("NewCreateDirectoryJob"), argumentList); - } - inline QDBusReply NewCreateDirectoryJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewCreateDirectoryJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewCreateFileFromTemplateJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - return asyncCallWithArgumentList(QStringLiteral("NewCreateFileFromTemplateJob"), argumentList); - } - inline QDBusReply NewCreateFileFromTemplateJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewCreateFileFromTemplateJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewCreateFileJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4, const QString &in5) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5); - return asyncCallWithArgumentList(QStringLiteral("NewCreateFileJob"), argumentList); - } - inline QDBusReply NewCreateFileJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4, const QString &in5, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewCreateFileJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewDeleteJob(const QStringList &in0, bool in1, const QString &in2, const QString &in3, const QString &in4) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - return asyncCallWithArgumentList(QStringLiteral("NewDeleteJob"), argumentList); - } - inline QDBusReply NewDeleteJob(const QStringList &in0, bool in1, const QString &in2, const QString &in3, const QString &in4, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewDeleteJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewEmptyTrashJob(bool in0, const QString &in1, const QString &in2, const QString &in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("NewEmptyTrashJob"), argumentList); - } - inline QDBusReply NewEmptyTrashJob(bool in0, const QString &in1, const QString &in2, const QString &in3, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewEmptyTrashJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewGetAllLaunchAppsJob() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("NewGetAllLaunchAppsJob"), argumentList); - } - inline QDBusReply NewGetAllLaunchAppsJob(QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewGetAllLaunchAppsJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewGetDefaultLaunchAppJob(const QString &in0, bool in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("NewGetDefaultLaunchAppJob"), argumentList); - } - inline QDBusReply NewGetDefaultLaunchAppJob(const QString &in0, bool in1, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewGetDefaultLaunchAppJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewGetRecommendedLaunchAppsJob(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("NewGetRecommendedLaunchAppsJob"), argumentList); - } - inline QDBusReply NewGetRecommendedLaunchAppsJob(const QString &in0, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewGetRecommendedLaunchAppsJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewGetTemplateJob() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("NewGetTemplateJob"), argumentList); - } - inline QDBusReply NewGetTemplateJob(QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewGetTemplateJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewLinkJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - return asyncCallWithArgumentList(QStringLiteral("NewLinkJob"), argumentList); - } - inline QDBusReply NewLinkJob(const QString &in0, const QString &in1, const QString &in2, const QString &in3, const QString &in4, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewLinkJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewListJob(const QString &in0, int in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("NewListJob"), argumentList); - } - inline QDBusReply NewListJob(const QString &in0, int in1, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewListJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewMoveJob(const QStringList &in0, const QString &in1, const QString &in2, uint in3, const QString &in4, const QString &in5, const QString &in6) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6); - return asyncCallWithArgumentList(QStringLiteral("NewMoveJob"), argumentList); - } - inline QDBusReply NewMoveJob(const QStringList &in0, const QString &in1, const QString &in2, uint in3, const QString &in4, const QString &in5, const QString &in6, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewMoveJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewRenameJob(const QString &in0, const QString &in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("NewRenameJob"), argumentList); - } - inline QDBusReply NewRenameJob(const QString &in0, const QString &in1, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewRenameJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewSetDefaultLaunchAppJob(const QString &in0, const QString &in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("NewSetDefaultLaunchAppJob"), argumentList); - } - inline QDBusReply NewSetDefaultLaunchAppJob(const QString &in0, const QString &in1, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewSetDefaultLaunchAppJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewStatJob(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("NewStatJob"), argumentList); - } - inline QDBusReply NewStatJob(const QString &in0, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewStatJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusPendingReply NewTrashJob(const QStringList &in0, bool in1, const QString &in2, const QString &in3, const QString &in4) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - return asyncCallWithArgumentList(QStringLiteral("NewTrashJob"), argumentList); - } - inline QDBusReply NewTrashJob(const QStringList &in0, bool in1, const QString &in2, const QString &in3, const QString &in4, QDBusObjectPath &out1, QString &out2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("NewTrashJob"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - out1 = qdbus_cast(reply.arguments().at(1)); - out2 = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - -Q_SIGNALS: // SIGNALS -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace filemanager { -// namespace Backend { -// typedef ::DBusFileOperations Operations; -// } - } - } -} -#endif diff --git a/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.cpp b/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.cpp deleted file mode 100644 index ee99c167a..000000000 --- a/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusFileTrashMonitor -p dbusfiletrashmonitor com.deepin.filemanager.Backend.Monitor.TrashMonitor.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 "dbusfiletrashmonitor.h" - -/* - * Implementation of interface class DBusFileTrashMonitor - */ - -DBusFileTrashMonitor::DBusFileTrashMonitor(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusFileTrashMonitor::~DBusFileTrashMonitor() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.h b/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.h deleted file mode 100644 index bc703b395..000000000 --- a/dde-dock-trash-plugin/dbus/dbusfiletrashmonitor.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusFileTrashMonitor -p dbusfiletrashmonitor com.deepin.filemanager.Backend.Monitor.TrashMonitor.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 DBUSFILETRASHMONITOR_H_1437702221 -#define DBUSFILETRASHMONITOR_H_1437702221 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.filemanager.Backend.Monitor.TrashMonitor - */ -class DBusFileTrashMonitor: 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.filemanager.Backend.Monitor.TrashMonitor") - 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 *staticServerPath() - { return "com.deepin.filemanager.Backend.Monitor"; } - static inline const char *staticInterfacePath() - { return "/com/deepin/filemanager/Backend/Monitor/TrashMonitor"; } - static inline const char *staticInterfaceName() - { return "com.deepin.filemanager.Backend.Monitor.TrashMonitor"; } - -public: - DBusFileTrashMonitor(QObject *parent = 0); - - ~DBusFileTrashMonitor(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply ItemCount() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("ItemCount"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ItemCountChanged(uint in0); -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace filemanager { - namespace Backend { - namespace Monitor { - typedef ::DBusFileTrashMonitor TrashMonitor; - } - } - } - } -} -#endif diff --git a/dde-dock-trash-plugin/dbus/dbuslauncher.cpp b/dde-dock-trash-plugin/dbus/dbuslauncher.cpp deleted file mode 100644 index 984f57aed..000000000 --- a/dde-dock-trash-plugin/dbus/dbuslauncher.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncher -p dbuslauncher com.deepin.daemon.Launcher.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 "dbuslauncher.h" - -/* - * Implementation of interface class DBusLauncher - */ - -DBusLauncher::DBusLauncher(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusLauncher::~DBusLauncher() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-trash-plugin/dbus/dbuslauncher.h b/dde-dock-trash-plugin/dbus/dbuslauncher.h deleted file mode 100644 index 05477e077..000000000 --- a/dde-dock-trash-plugin/dbus/dbuslauncher.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncher -p dbuslauncher com.deepin.daemon.Launcher.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 DBUSLAUNCHER_H_1437727696 -#define DBUSLAUNCHER_H_1437727696 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.dde.daemon.Launcher - */ -class DBusLauncher: 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.Launcher") - 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 *staticServerPath() - { return "com.deepin.dde.daemon.Launcher"; } - static inline const char *staticInterfacePath() - { return "/com/deepin/dde/daemon/Launcher"; } - static inline const char *staticInterfaceName() - { return "com.deepin.dde.daemon.Launcher"; } - -public: - DBusLauncher(QObject *parent = 0); - - ~DBusLauncher(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> RequestUninstall(const QString &in0, bool in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("RequestUninstall"), argumentList); - } - -Q_SIGNALS: // SIGNALS -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace dde { - namespace daemon { - typedef ::DBusLauncher Launcher; - } - } - } -} -#endif diff --git a/dde-dock-trash-plugin/dbus/dbustrashjob.cpp b/dde-dock-trash-plugin/dbus/dbustrashjob.cpp deleted file mode 100644 index d98ccb1b4..000000000 --- a/dde-dock-trash-plugin/dbus/dbustrashjob.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusTrashJob -p dbustrashjob com.deepin.filemanager.Backend.Operations.TrashJob.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 "dbustrashjob.h" - -/* - * Implementation of interface class DBusTrashJob - */ - -DBusTrashJob::DBusTrashJob(const QString &path, QObject *parent) - : QDBusAbstractInterface(staticServerPath(), path, staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusTrashJob::~DBusTrashJob() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock-trash-plugin/dbus/dbustrashjob.h b/dde-dock-trash-plugin/dbus/dbustrashjob.h deleted file mode 100644 index 4c681b5d3..000000000 --- a/dde-dock-trash-plugin/dbus/dbustrashjob.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusTrashJob -p dbustrashjob com.deepin.filemanager.Backend.Operations.TrashJob.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 DBUSTRASHJOB_H_1437722517 -#define DBUSTRASHJOB_H_1437722517 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.filemanager.Backend.Operations.TrashJob - */ -class DBusTrashJob: 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.filemanager.Backend.Operations.TrashJob") - 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 *staticServerPath() - { return "com.deepin.filemanager.Backend.Operations"; } - static inline const char *staticInterfaceName() - { return "com.deepin.filemanager.Backend.Operations.TrashJob"; } - -public: - DBusTrashJob(const QString &path, QObject *parent = 0); - - ~DBusTrashJob(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Abort() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Abort"), argumentList); - } - - inline QDBusPendingReply<> Execute() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Execute"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Aborted(); - void Deleting(const QString &in0); - void Done(); - void ProcessedAmount(qlonglong in0, ushort in1); - void Trashing(const QString &in0); -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace filemanager { - namespace Backend { - namespace Operations { - typedef ::DBusTrashJob TrashJob; - } - } - } - } -} -#endif diff --git a/dde-dock-trash-plugin/dde-dock-trash-plugin.json b/dde-dock-trash-plugin/dde-dock-trash-plugin.json deleted file mode 100644 index 887610607..000000000 --- a/dde-dock-trash-plugin/dde-dock-trash-plugin.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "api_version" : 1.0, - "sys_plugin" : true -} diff --git a/dde-dock-trash-plugin/dde-dock-trash-plugin.pro b/dde-dock-trash-plugin/dde-dock-trash-plugin.pro deleted file mode 100644 index c1ecf35c6..000000000 --- a/dde-dock-trash-plugin/dde-dock-trash-plugin.pro +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-07-20T14:06:01 -# -#------------------------------------------------- - -QT += core gui widgets dbus svg - -TARGET = dde-dock-trash-plugin -TEMPLATE = lib -CONFIG += plugin c++11 link_pkgconfig -PKGCONFIG += gtk+-2.0 - -INCLUDEPATH += ../dde-dock/src -include(./dialogs/dialogs.pri) - -SOURCES += \ - mainitem.cpp \ - trashplugin.cpp \ - dbus/dbusfileoperations.cpp \ - dbus/dbusfiletrashmonitor.cpp \ - dbus/dbustrashjob.cpp \ - dbus/dbusemptytrashjob.cpp \ - dbus/dbuslauncher.cpp - -HEADERS += \ - mainitem.h \ - trashplugin.h \ - dbus/dbusfileoperations.h \ - dbus/dbusfiletrashmonitor.h \ - dbus/dbustrashjob.h \ - dbus/dbusemptytrashjob.h \ - dbus/dbuslauncher.h - -DISTFILES += dde-dock-trash-plugin.json - -unix { - target.path = /usr/lib/dde-dock/plugins/ - INSTALLS += target -} - -RESOURCES += \ - trash-plugin-light.qrc \ - trash-plugin-dark.qrc diff --git a/dde-dock-trash-plugin/dialogs/cleartrashdialog.cpp b/dde-dock-trash-plugin/dialogs/cleartrashdialog.cpp deleted file mode 100644 index faa4142a8..000000000 --- a/dde-dock-trash-plugin/dialogs/cleartrashdialog.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "cleartrashdialog.h" -#include -#include -#include -#include - -ClearTrashDialog::ClearTrashDialog(QWidget *parent): - DBaseDialog(parent) -{ - - QString icon = ":/images/skin/dialogs/images/user-trash-full.png"; - QString message = tr("Are you sure to empty trash?"); - QString tipMessage = tr("This action cannot be restored"); - QStringList buttons, buttonTexts; - buttons << "Cancel" << "Empty"; - buttonTexts << tr("Cancel") << tr("Empty"); - initUI(icon, message, tipMessage, buttons, buttons); - moveCenter(); - getButtonsGroup()->button(1)->setFocus(); - setButtonTexts(buttonTexts); -} - -void ClearTrashDialog::handleKeyEnter(){ - handleButtonsClicked(1); -} - -ClearTrashDialog::~ClearTrashDialog() -{ - -} - diff --git a/dde-dock-trash-plugin/dialogs/cleartrashdialog.h b/dde-dock-trash-plugin/dialogs/cleartrashdialog.h deleted file mode 100644 index 389cda18d..000000000 --- a/dde-dock-trash-plugin/dialogs/cleartrashdialog.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef CLEARTRASHDIALOG_H -#define CLEARTRASHDIALOG_H - -#include "dbasedialog.h" - -class ClearTrashDialog : public DBaseDialog -{ - Q_OBJECT -public: - explicit ClearTrashDialog(QWidget *parent = 0); - ~ClearTrashDialog(); - -signals: - -public slots: - void handleKeyEnter(); -}; - -#endif // CLEARTRASHDIALOG_H diff --git a/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.cpp b/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.cpp deleted file mode 100644 index ee19ce0f5..000000000 --- a/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "confirmuninstalldialog.h" -#include -#include -#include -#include - -ConfirmUninstallDialog::ConfirmUninstallDialog(QWidget *parent) : DBaseDialog(parent) -{ - QString icon = ":/images/skin/dialogs/images/user-trash-full.png"; - QString message = "Are you sure to uninstall this application?"; - QString tipMessage = tr("All dependencies will be removed together"); - QStringList buttons, buttonTexts; - buttons << "Cancel" << "Confirm"; - buttonTexts << tr("Cancel") << tr("Confirm"); - initUI(icon, message, tipMessage, buttons, buttons); - moveCenter(); - getButtonsGroup()->button(1)->setFocus(); - setButtonTexts(buttonTexts); -} - -void ConfirmUninstallDialog::handleKeyEnter(){ - handleButtonsClicked(1); -} - -ConfirmUninstallDialog::~ConfirmUninstallDialog() -{ - -} diff --git a/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.h b/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.h deleted file mode 100644 index 9427903d8..000000000 --- a/dde-dock-trash-plugin/dialogs/confirmuninstalldialog.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef CONFIRMUNINSTALLDIALOG_H -#define CONFIRMUNINSTALLDIALOG_H - -#include "dbasedialog.h" - -class ConfirmUninstallDialog : public DBaseDialog -{ - Q_OBJECT -public: - explicit ConfirmUninstallDialog(QWidget *parent = 0); - ~ConfirmUninstallDialog(); - -signals: - -public slots: - void handleKeyEnter(); -}; - -#endif // CONFIRMUNINSTALLDIALOG_H diff --git a/dde-dock-trash-plugin/dialogs/dbasedialog.cpp b/dde-dock-trash-plugin/dialogs/dbasedialog.cpp deleted file mode 100644 index 3ab5167bd..000000000 --- a/dde-dock-trash-plugin/dialogs/dbasedialog.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dbasedialog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -DBaseDialog::DBaseDialog(QWidget *parent):DMovabelDialog(parent) -{ - m_messageLabelMaxWidth = qApp->desktop()->availableGeometry().width() / 2 - - 100 - 2 * getCloseButton()->width(); -} - -void DBaseDialog::initUI(const QString &icon, - const QString &message, - const QString &tipMessage, - const QStringList &buttonKeys, - const QStringList &buttonTexts){ - m_icon = icon; - m_message = message; - m_tipMessage = tipMessage; - m_buttonKeys = buttonKeys; - m_buttonTexts = buttonTexts; - - QFrame* contentFrame = new QFrame; - contentFrame->setObjectName("ContentFrame"); - - m_iconLabel = new QLabel; - m_iconLabel->setFixedSize(48, 48); - setIcon(m_icon); - - m_messageLabel = new QLabel; - m_messageLabel->setObjectName("MessageLabel"); - setMessage(m_message); - - m_tipMessageLabel = new QLabel; - m_tipMessageLabel->setObjectName("TipMessageLabel"); - setTipMessage(m_tipMessage); - - m_buttonGroup = new QButtonGroup; - QHBoxLayout* buttonLayout = new QHBoxLayout; - foreach (QString label, m_buttonKeys) { - int index = m_buttonKeys.indexOf(label); - QPushButton* button = new QPushButton(label); - button->setObjectName("ActionButton"); - button->setAttribute(Qt::WA_NoMousePropagation); - button->setFixedHeight(28); - m_buttonGroup->addButton(button, index); - buttonLayout->addWidget(button); - if (index < m_buttonKeys.length() - 1){ - QLabel* label = new QLabel; - label->setObjectName("VLine"); - label->setFixedWidth(1); - buttonLayout->addWidget(label); - } - } - - setButtonTexts(m_buttonTexts); - buttonLayout->setSpacing(0); - buttonLayout->setContentsMargins(0, 0, 0, 0); - - QVBoxLayout* iconLayout = new QVBoxLayout; - iconLayout->addWidget(m_iconLabel, Qt::AlignCenter); - iconLayout->setContentsMargins(26, 22, 26, 22); - - m_messageLayout = new QVBoxLayout; - m_messageLayout->addWidget(m_messageLabel); - m_messageLayout->addWidget(m_tipMessageLabel); - m_messageLayout->addStretch(); - m_messageLayout->setContentsMargins(5, getCloseButton()->height(), getCloseButton()->width(), 0); - - QHBoxLayout* topLayout = new QHBoxLayout; - topLayout->addLayout(iconLayout); - topLayout->addLayout(m_messageLayout); - - QVBoxLayout* mainLayout = new QVBoxLayout; - mainLayout->addLayout(topLayout); - mainLayout->addLayout(buttonLayout); - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0, 0, 0, 0); - contentFrame->setLayout(mainLayout); - - QHBoxLayout* contentlayout = new QHBoxLayout; - contentlayout->addWidget(contentFrame); - contentlayout->setContentsMargins(5, 5, 5, 5); - setLayout(contentlayout); - - resize(m_defaultWidth, m_defaultHeight); - setStyleSheet(getQssFromFile(":/qss/Resource/dark/qss/trash.qss")); - initConnect(); -} - - -void DBaseDialog::initConnect(){ - connect(m_buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(handleButtonsClicked(int))); -} - -QButtonGroup* DBaseDialog::getButtonsGroup(){ - return m_buttonGroup; -} - -QVBoxLayout* DBaseDialog::getMessageLayout(){ - return m_messageLayout; -} - -QString DBaseDialog::getIcon(){ - return m_icon; -} - -void DBaseDialog::setIcon(const QString &icon){ - m_icon = icon; - m_iconLabel->setPixmap(QPixmap(m_icon).scaled(m_iconLabel->size())); -} - -QString DBaseDialog::getMessage(){ - return m_message; -} - -void DBaseDialog::setMessage(const QString &message){ - m_message = message; - - QFontMetrics fm = fontMetrics(); - if (fm.width(m_message) > m_messageLabelMaxWidth){ - QString text = fm.elidedText(m_message, Qt::ElideRight, m_messageLabelMaxWidth); - m_messageLabel->setText(text); - }else{ - m_messageLabel->setText(m_message); - } - m_messageLabel->resize(fm.width(m_messageLabel->text()), height()); -} - -QString DBaseDialog::getTipMessage(){ - return m_tipMessage; -} - -void DBaseDialog::setTipMessage(const QString &tipMessage){ - m_tipMessage = tipMessage; - - QFontMetrics fm = fontMetrics(); - if (fm.width(m_tipMessage) > m_messageLabelMaxWidth){ - QString text = fm.elidedText(m_tipMessage, Qt::ElideRight, m_messageLabelMaxWidth); - m_tipMessageLabel->setText(text); - }else{ - m_tipMessageLabel->setText(m_tipMessage); - } - m_tipMessageLabel->resize(fm.width(m_messageLabel->text()), height()); -} - -QStringList DBaseDialog::getButtons(){ - return m_buttonKeys; -} - -void DBaseDialog::setButtons(const QStringList &buttons){ - m_buttonKeys = buttons; -} - -QStringList DBaseDialog::getButtonTexts(){ - return m_buttonTexts; -} - -void DBaseDialog::setButtonTexts(const QStringList& buttonTexts){ - if (buttonTexts.length() != m_buttonKeys.length()){ - return; - } - m_buttonTexts = buttonTexts; - for (int i = 0; i < m_buttonGroup->buttons().length(); i++) { - QPushButton* button = reinterpret_cast(m_buttonGroup->buttons().at(i)); - button->setText(m_buttonTexts.at(i)); - } -} - -void DBaseDialog::handleButtonsClicked(int id){ - close(); - int index = m_buttonGroup->buttons().indexOf(m_buttonGroup->button(id)); - if (m_buttonKeys.length() > index){ - emit buttonClicked(index); - } -} - -void DBaseDialog::handleKeyEnter(){ - -} - -void DBaseDialog::closeEvent(QCloseEvent *event){ - emit aboutToClose(); - DMovabelDialog::closeEvent(event); - emit closed(); -} - - -void DBaseDialog::resizeEvent(QResizeEvent *event){ - DMovabelDialog::resizeEvent(event); -} - -QString DBaseDialog::getQssFromFile(const QString &name) -{ - QFile file(name); - QString styleSheet = ""; - if (file.open(QFile::ReadOnly)) - { - styleSheet = QString(file.readAll()); - - file.close(); - } - else - qWarning() << "[Error:] Open style file errr!"; - - return styleSheet; -} - -DBaseDialog::~DBaseDialog() -{ - -} - diff --git a/dde-dock-trash-plugin/dialogs/dbasedialog.h b/dde-dock-trash-plugin/dialogs/dbasedialog.h deleted file mode 100644 index 174271def..000000000 --- a/dde-dock-trash-plugin/dialogs/dbasedialog.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DBASEDIALOG_H -#define DBASEDIALOG_H - -#include "dmovabledialog.h" - -class QPushButton; -class QButtonGroup; -class QLabel; -class QCloseEvent; -class QVBoxLayout; - -class DBaseDialog : public DMovabelDialog -{ - Q_OBJECT -public: - explicit DBaseDialog(QWidget *parent = 0); - ~DBaseDialog(); - void initUI(const QString& icon, - const QString& message, - const QString& tipMessage, - const QStringList& buttonKeys, - const QStringList& buttonTexts); - void initConnect(); - - QString getIcon(); - QString getMessage(); - QString getTipMessage(); - QStringList getButtons(); - QStringList getButtonTexts(); - QButtonGroup* getButtonsGroup(); - -signals: - void aboutToClose(); - void closed(); - void buttonClicked(int index); - -public slots: - void setIcon(const QString& icon); - void setMessage(const QString& message); - void setTipMessage(const QString& tipMessage); - void setButtons(const QStringList& buttons); - void setButtonTexts(const QStringList& buttonTexts); - void handleButtonsClicked(int id); - void handleKeyEnter(); - QVBoxLayout* getMessageLayout(); - -protected: - void closeEvent(QCloseEvent* event); - void resizeEvent(QResizeEvent* event); - -private: - QString getQssFromFile(const QString &name); - - QString m_icon; - QString m_message; - QString m_tipMessage; - QStringList m_buttonKeys; - QStringList m_buttonTexts; - int m_defaultWidth = 380; - int m_defaultHeight = 120; - - QLabel* m_iconLabel; - QLabel* m_messageLabel; - QLabel* m_tipMessageLabel; - QButtonGroup* m_buttonGroup; - - QVBoxLayout* m_messageLayout; - int m_messageLabelMaxWidth; -}; - -#endif // DBASEDIALOG_H diff --git a/dde-dock-trash-plugin/dialogs/dialogs.pri b/dde-dock-trash-plugin/dialogs/dialogs.pri deleted file mode 100644 index 03dc663b2..000000000 --- a/dde-dock-trash-plugin/dialogs/dialogs.pri +++ /dev/null @@ -1,11 +0,0 @@ -HEADERS += \ - $$PWD/dbasedialog.h \ - $$PWD/cleartrashdialog.h \ - $$PWD/confirmuninstalldialog.h \ - $$PWD/dmovabledialog.h - -SOURCES += \ - $$PWD/dbasedialog.cpp \ - $$PWD/cleartrashdialog.cpp \ - $$PWD/confirmuninstalldialog.cpp \ - $$PWD/dmovabledialog.cpp diff --git a/dde-dock-trash-plugin/dialogs/dmovabledialog.cpp b/dde-dock-trash-plugin/dialogs/dmovabledialog.cpp deleted file mode 100644 index 0187c9789..000000000 --- a/dde-dock-trash-plugin/dialogs/dmovabledialog.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dmovabledialog.h" -#include -#include -#include -#include -#include - - -DMovabelDialog::DMovabelDialog(QWidget *parent):QDialog(parent) -{ - setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog); - setAttribute(Qt::WA_TranslucentBackground); - m_closeButton = new QPushButton(this); - m_closeButton->setObjectName("CloseButton"); - m_closeButton->setFixedSize(25, 25); - m_closeButton->setAttribute(Qt::WA_NoMousePropagation); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(close())); -} - -void DMovabelDialog::setMovableHeight(int height){ - m_movableHeight = height; -} - - -QPushButton* DMovabelDialog::getCloseButton(){ - return m_closeButton; -} - -void DMovabelDialog::moveCenter(){ - QRect qr = frameGeometry(); - QPoint cp = qApp->desktop()->availableGeometry().center(); - qr.moveCenter(cp); - move(qr.topLeft()); -} - -void DMovabelDialog::mousePressEvent(QMouseEvent *event) -{ - if(event->button() & Qt::LeftButton) - { - m_dragPosition = event->globalPos() - frameGeometry().topLeft(); - } - QDialog::mousePressEvent(event); -} - -void DMovabelDialog::mouseReleaseEvent(QMouseEvent *event) -{ - QDialog::mouseReleaseEvent(event); -} - -void DMovabelDialog::mouseMoveEvent(QMouseEvent *event) -{ - move(event->globalPos() - m_dragPosition); - QDialog::mouseMoveEvent(event); -} - -void DMovabelDialog::resizeEvent(QResizeEvent *event){ - m_closeButton->move(width() - m_closeButton->width() - 4, 4); - m_closeButton->raise(); - moveCenter(); - QDialog::resizeEvent(event); -} - -DMovabelDialog::~DMovabelDialog() -{ - -} - diff --git a/dde-dock-trash-plugin/dialogs/dmovabledialog.h b/dde-dock-trash-plugin/dialogs/dmovabledialog.h deleted file mode 100644 index 6ed093217..000000000 --- a/dde-dock-trash-plugin/dialogs/dmovabledialog.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DMOVABLEDIALOG_H -#define DMOVABLEDIALOG_H - - -#include -#include -class QMouseEvent; -class QPushButton; -class QResizeEvent; - -class DMovabelDialog:public QDialog -{ -public: - DMovabelDialog(QWidget *parent = 0); - ~DMovabelDialog(); - - QPushButton* getCloseButton(); - -public slots: - void setMovableHeight(int height); - void moveCenter(); - -protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void resizeEvent(QResizeEvent* event); - -private: - QPoint m_dragPosition; - int m_movableHeight = 30; - QPushButton* m_closeButton; -}; - -#endif // DMOVABLEDIALOG_H diff --git a/dde-dock-trash-plugin/mainitem.cpp b/dde-dock-trash-plugin/mainitem.cpp deleted file mode 100644 index 0ec1887d0..000000000 --- a/dde-dock-trash-plugin/mainitem.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include "mainitem.h" - -#undef signals -extern "C" { - #include -} -#define signals public - - -static void requrestUpdateIcons() -{ - //can not passing QObject to the callback function,so use signal - emit SignalManager::instance()->requestAppIconUpdate(); -} - -void initGtkThemeWatcher() -{ - GtkSettings* gs = gtk_settings_get_default(); - g_signal_connect(gs, "notify::gtk-icon-theme-name", - G_CALLBACK(requrestUpdateIcons), NULL); -} - -SignalManager *SignalManager::m_signalManager = NULL; -SignalManager *SignalManager::instance() -{ - if (!m_signalManager) - m_signalManager = new SignalManager; - return m_signalManager; -} - -MainItem::MainItem(QWidget *parent) : QLabel(parent) -{ - setAcceptDrops(true); - setFixedSize(Dock::APPLET_FASHION_ITEM_WIDTH, Dock::APPLET_FASHION_ITEM_HEIGHT); - - m_dftm = new DBusFileTrashMonitor(this); - connect(m_dftm, &DBusFileTrashMonitor::ItemCountChanged, [=]{ - updateIcon(false); - }); - updateIcon(false); - - initGtkThemeWatcher(); - //can't use lambda here - connect(SignalManager::instance(), SIGNAL(requestAppIconUpdate()), this, SLOT(onRequestUpdateIcon())); -} - -MainItem::~MainItem() -{ - -} - -void MainItem::emptyTrash() -{ - ClearTrashDialog *dialog = new ClearTrashDialog; - dialog->setIcon(getThemeIconPath("user-trash-full")); - connect(dialog, &ClearTrashDialog::buttonClicked, [=](int key){ - dialog->deleteLater(); - if (key == 1){ - qWarning() << "Clear trash..."; - QDBusPendingReply tmpReply = m_dfo->NewEmptyTrashJob(false, "", "", ""); - QDBusObjectPath op = tmpReply.argumentAt(1).value(); - DBusEmptyTrashJob * detj = new DBusEmptyTrashJob(op.path(), this); - connect(detj, &DBusEmptyTrashJob::Done, detj, &DBusEmptyTrashJob::deleteLater); - connect(detj, &DBusEmptyTrashJob::Done, [=](){ - updateIcon(false); - }); - - if (detj->isValid()) - detj->Execute(); - } - }); - dialog->exec(); -} - -void MainItem::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) - { - QProcess * tmpProcess = new QProcess(); - connect(tmpProcess, SIGNAL(finished(int)), tmpProcess, SLOT(deleteLater())); - tmpProcess->start("gvfs-open trash://"); - } - - //Makesure it parent can accept the mouse event too - event->ignore(); -} - -void MainItem::dragEnterEvent(QDragEnterEvent * event) -{ - if (event->source()) - return;//just accept the object outside this app - updateIcon(true); - - event->setDropAction(Qt::MoveAction); - event->accept(); -} - -void MainItem::dragLeaveEvent(QDragLeaveEvent *) -{ - updateIcon(false); -} - -void MainItem::dropEvent(QDropEvent *event) -{ - updateIcon(false); - - if (event->source()) - return; - - if (event->mimeData()->formats().indexOf("RequestDock") != -1) { //from desktop or launcher - QJsonObject dataObj = QJsonDocument::fromJson(event->mimeData()->data("RequestDock")).object(); - if (!dataObj.isEmpty()){ - QString appKey = dataObj.value("appKey").toString(); - QString appName = dataObj.value("appName").toString(); - QString appIcon = dataObj.value("appIcon").toString(); - if (appKey.isEmpty()) - return; - event->ignore(); - - execUninstall(appKey, appName, appIcon); - } - } - else {//File or Dirctory - trashFiles(event->mimeData()->urls()); - } -} - -void MainItem::onRequestUpdateIcon() -{ - updateIcon(false); -} - -void MainItem::execUninstall(const QString &appKey, const QString &appName, const QString &appIcon) -{ - ConfirmUninstallDialog *dialog = new ConfirmUninstallDialog; - //TODO: need real icon name - dialog->setIcon(getThemeIconPath(appIcon)); - QString message = tr("Are you sure to uninstall %1?").arg(appName); - dialog->setMessage(message); - connect(dialog, &ConfirmUninstallDialog::buttonClicked, [=](int key){ - dialog->deleteLater(); - if (key == 1){ - qWarning() << "Uninstall application:" << appKey << appName; - m_launcher->RequestUninstall(appKey, true); - } - }); - dialog->exec(); -} - -void MainItem::trashFiles(const QList &files) -{ - QStringList normalFiles; - for (QUrl url : files) { - //try to uninstall app by .desktop file - if (url.fileName().endsWith(".desktop")) { - QSettings ds(url.path(), QSettings::IniFormat); - ds.setIniCodec(QTextCodec::codecForName("UTF-8")); - ds.beginGroup("Desktop Entry"); - QString appKey = ds.value("X-Deepin-AppID").toString(); - if (!appKey.isEmpty()) { - QString l(qgetenv(QString("LANGUAGE").toUtf8().data())); - QString appName = ds.value(QString("Name[%1]").arg(l)).toString(); - appName = appName.isEmpty() ? ds.value("Name").toString() : appName; - execUninstall(appKey, appName, ds.value("Icon").toString()); - } - else { - normalFiles << url.path(); - } - ds.endGroup(); - } - else { - normalFiles << url.path(); - } - } - - //remove normal files - QDBusPendingReply tmpReply = m_dfo->NewTrashJob(normalFiles, false, "", "", ""); - QDBusObjectPath op = tmpReply.argumentAt(1).value(); - DBusTrashJob * dtj = new DBusTrashJob(op.path(), this); - connect(dtj, &DBusTrashJob::Done, dtj, &DBusTrashJob::deleteLater); - connect(dtj, &DBusTrashJob::Done, [=](){ - updateIcon(false); - }); - - if (dtj->isValid()) - dtj->Execute(); - - qWarning()<< op.path() << "Move files to trash: "<< normalFiles; -} - -void MainItem::updateIcon(bool isOpen) -{ - QString iconName = ""; - if (isOpen) - { - if (m_dftm->ItemCount() > 0) - iconName = "user-trash-full-opened"; - else - iconName = "user-trash-empty-opened"; - } - else - { - if (m_dftm->ItemCount() > 0) - iconName = "user-trash-full"; - else - iconName = "user-trash-empty"; - } - - QPixmap pixmap(getThemeIconPath(iconName)); - setPixmap(pixmap.scaled(Dock::APPLET_FASHION_ICON_SIZE,Dock::APPLET_FASHION_ICON_SIZE)); -} - -// iconName should be a icon name constraints to the freeedesktop standard. -QString MainItem::getThemeIconPath(QString iconName) -{ - // iconPath is an absolute path of the system. - if (QFile::exists(iconName) && iconName.contains(QDir::separator())) { - return iconName; - } - else { - QByteArray bytes = iconName.toUtf8(); - const char *name = bytes.constData(); - - GtkIconTheme* theme = gtk_icon_theme_get_default(); - - GtkIconInfo* info = gtk_icon_theme_lookup_icon(theme, name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK); - - if (info) { - char* path = g_strdup(gtk_icon_info_get_filename(info)); -#if GTK_MAJOR_VERSION >= 3 - g_object_unref(info); -#elif GTK_MAJOR_VERSION == 2 - gtk_icon_info_free(info); -#endif - return QString(path); - } else { - return ""; - } - } -} diff --git a/dde-dock-trash-plugin/mainitem.h b/dde-dock-trash-plugin/mainitem.h deleted file mode 100644 index 68525b985..000000000 --- a/dde-dock-trash-plugin/mainitem.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef MAINITEM_H -#define MAINITEM_H - -#include -#include -#include -#include -#include -#include - -#include "dialogs/confirmuninstalldialog.h" -#include "dialogs/cleartrashdialog.h" -#include "interfaces/dockconstants.h" -#include "dbus/dbusfiletrashmonitor.h" -#include "dbus/dbusfileoperations.h" -#include "dbus/dbusemptytrashjob.h" -#include "dbus/dbustrashjob.h" -#include "dbus/dbuslauncher.h" - -class SignalManager : public QObject -{ - Q_OBJECT -public: - static SignalManager * instance(); - -signals: - void requestAppIconUpdate(); - -private: - static SignalManager *m_signalManager; - explicit SignalManager(QObject *parent = 0) : QObject(parent) {} -}; - -class MainItem : public QLabel -{ - Q_OBJECT -public: - MainItem(QWidget *parent = 0); - ~MainItem(); - - void emptyTrash(); - -protected: - void mousePressEvent(QMouseEvent * event); - void dragEnterEvent(QDragEnterEvent *); - void dragLeaveEvent(QDragLeaveEvent *); - void dropEvent(QDropEvent * event); - -private slots: - void onRequestUpdateIcon(); - -private: - void execUninstall(const QString &appKey, const QString &appName, const QString &appIcon); - void trashFiles(const QList &files); - void updateIcon(bool isOpen); - QString getThemeIconPath(QString iconName); - - DBusFileOperations * m_dfo = new DBusFileOperations(this); - DBusFileTrashMonitor * m_dftm = NULL; - DBusLauncher * m_launcher = new DBusLauncher(this); -}; - -#endif // MAINITEM_H diff --git a/dde-dock-trash-plugin/trash-plugin-dark.qrc b/dde-dock-trash-plugin/trash-plugin-dark.qrc deleted file mode 100644 index 7b0aba172..000000000 --- a/dde-dock-trash-plugin/trash-plugin-dark.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - Resource/dark/images/dark_close_small_hover.png - Resource/dark/images/dark_close_small_normal.png - Resource/dark/images/dark_close_small_press.png - - - Resource/dark/qss/trash.qss - - diff --git a/dde-dock-trash-plugin/trash-plugin-light.qrc b/dde-dock-trash-plugin/trash-plugin-light.qrc deleted file mode 100644 index 7bb3a96fc..000000000 --- a/dde-dock-trash-plugin/trash-plugin-light.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - Resource/light/images/dark_close_small_hover.png - Resource/light/images/dark_close_small_normal.png - Resource/light/images/dark_close_small_press.png - - - Resource/light/qss/trash.qss - - diff --git a/dde-dock-trash-plugin/trashplugin.cpp b/dde-dock-trash-plugin/trashplugin.cpp deleted file mode 100644 index 28aac707f..000000000 --- a/dde-dock-trash-plugin/trashplugin.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include - -#include "trashplugin.h" - -TrashPlugin::TrashPlugin() -{ - QIcon::setThemeName("deepin"); - - m_item = new MainItem(); - connect(this, &TrashPlugin::menuItemInvoked, m_item, &MainItem::emptyTrash); -} - -void TrashPlugin::init(DockPluginProxyInterface *proxy) -{ - m_proxy = proxy; - - setMode(proxy->dockMode()); -} - -QString TrashPlugin::getPluginName() -{ - return tr("Trash"); -} - -QStringList TrashPlugin::ids() -{ - return QStringList(m_id); -} - -QString TrashPlugin::getName(QString) -{ - return getPluginName(); -} - -QString TrashPlugin::getTitle(QString) -{ - return getPluginName(); -} - -QString TrashPlugin::getCommand(QString) -{ - return ""; -} - -bool TrashPlugin::configurable(const QString &) -{ - return false; -} - -bool TrashPlugin::enabled(const QString &) -{ - return true; -} - -void TrashPlugin::setEnabled(const QString &, bool) -{ - -} - -QWidget * TrashPlugin::getItem(QString) -{ - return m_item; -} - -QWidget * TrashPlugin::getApplet(QString) -{ - return NULL; -} - -void TrashPlugin::changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) -{ - if (newMode != oldMode) - setMode(newMode); -} - -QString TrashPlugin::getMenuContent(QString) -{ - QJsonObject contentObj; - - QJsonArray items; - - items.append(createMenuItem("clear_trash", tr("Empty"))); - - contentObj.insert("items", items); - - return QString(QJsonDocument(contentObj).toJson()); -} - -void TrashPlugin::invokeMenuItem(QString, QString itemId, bool checked) -{ - qWarning() << "Menu check:" << itemId << checked; - emit menuItemInvoked(); -} - -// private methods -void TrashPlugin::setMode(Dock::DockMode mode) -{ - m_mode = mode; - - if (mode == Dock::FashionMode) - m_proxy->itemAddedEvent(m_id); - else{ - m_proxy->itemRemovedEvent(m_id); - m_item->setParent(NULL); - } -} - -QJsonObject TrashPlugin::createMenuItem(QString itemId, QString itemName, bool checkable, bool checked) -{ - QJsonObject itemObj; - - itemObj.insert("itemId", itemId); - itemObj.insert("itemText", itemName); - itemObj.insert("itemIcon", ""); - itemObj.insert("itemIconHover", ""); - itemObj.insert("itemIconInactive", ""); - itemObj.insert("itemExtra", ""); - itemObj.insert("isActive", m_trashMonitor->ItemCount() > 0); - itemObj.insert("isCheckable", checkable); - itemObj.insert("checked", checked); - itemObj.insert("itemSubMenu", QJsonObject()); - - return itemObj; -} - -TrashPlugin::~TrashPlugin() -{ - -} - -#if QT_VERSION < 0x050000 -Q_EXPORT_PLUGIN2(dde-dock-trash-plugin, TrashPlugin) -#endif // QT_VERSION < 0x050000 diff --git a/dde-dock-trash-plugin/trashplugin.h b/dde-dock-trash-plugin/trashplugin.h deleted file mode 100644 index 69b20d26e..000000000 --- a/dde-dock-trash-plugin/trashplugin.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef TRASHPLUGIN_H -#define TRASHPLUGIN_H - -#include -#include -#include -#include -#include -#include -#include -#include "mainitem.h" -#include "interfaces/dockconstants.h" -#include "interfaces/dockplugininterface.h" -#include "interfaces/dockpluginproxyinterface.h" - -class TrashPlugin : public QObject, public DockPluginInterface -{ - Q_OBJECT -#if QT_VERSION >= 0x050000 - Q_PLUGIN_METADATA(IID "org.deepin.Dock.PluginInterface" FILE "dde-dock-trash-plugin.json") -#endif // QT_VERSION >= 0x050000 - Q_INTERFACES(DockPluginInterface) - -public: - TrashPlugin(); - ~TrashPlugin(); - - void init(DockPluginProxyInterface *proxy) Q_DECL_OVERRIDE; - void changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) Q_DECL_OVERRIDE; - - QString getPluginName() Q_DECL_OVERRIDE; - - QStringList ids() Q_DECL_OVERRIDE; - QString getName(QString id) Q_DECL_OVERRIDE; - QString getTitle(QString id) Q_DECL_OVERRIDE; - QString getCommand(QString id) Q_DECL_OVERRIDE; - bool configurable(const QString &id) Q_DECL_OVERRIDE; - bool enabled(const QString &id) Q_DECL_OVERRIDE; - void setEnabled(const QString &id, bool enabled) Q_DECL_OVERRIDE; - QWidget * getItem(QString id) Q_DECL_OVERRIDE; - QWidget * getApplet(QString id) Q_DECL_OVERRIDE; - QString getMenuContent(QString id) Q_DECL_OVERRIDE; - void invokeMenuItem(QString id, QString itemId, bool checked) Q_DECL_OVERRIDE; - -signals: - void menuItemInvoked(); - -private: - MainItem * m_item = NULL; - QString m_id = "trash_plugin"; - DockPluginProxyInterface * m_proxy; - DBusFileTrashMonitor * m_trashMonitor = new DBusFileTrashMonitor(this); - - Dock::DockMode m_mode = Dock::EfficientMode; - -private: - void setMode(Dock::DockMode mode); - QJsonObject createMenuItem(QString itemId, - QString itemName, - bool checkable = false, - bool checked = false); -}; - -#endif // TRASHPLUGIN_H diff --git a/dde-dock.pro b/dde-dock.pro new file mode 100644 index 000000000..cd06cd8c2 --- /dev/null +++ b/dde-dock.pro @@ -0,0 +1,19 @@ +QT += core gui widgets dbus x11extras + +TARGET = dde-dock +TEMPLATE = app +CONFIG += c++11 link_pkgconfig + +PKGCONFIG += xcb-ewmh + +SOURCES += main.cpp \ + window/mainwindow.cpp \ + dbus/dbusdockentrymanager.cpp \ + xcb/xcb_misc.cpp \ + item/dockitem.cpp + +HEADERS += \ + window/mainwindow.h \ + dbus/dbusdockentrymanager.h \ + xcb/xcb_misc.h \ + item/dockitem.h diff --git a/dde-dock/com.deepin.dde.dock.service b/dde-dock/com.deepin.dde.dock.service deleted file mode 100644 index f52e0db65..000000000 --- a/dde-dock/com.deepin.dde.dock.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.deepin.dde.dock -Exec=/usr/bin/dde-dock diff --git a/dde-dock/dark.qrc b/dde-dock/dark.qrc deleted file mode 100644 index f3604c5a2..000000000 --- a/dde-dock/dark.qrc +++ /dev/null @@ -1,18 +0,0 @@ - - - resources/dark/images/close_hover.png - resources/dark/images/close_normal.png - resources/dark/images/close_press.png - resources/dark/images/dark_dock.svg - resources/dark/images/open-indicator.png - resources/dark/images/opening-indicator.png - resources/dark/images/setting_close_small_hover.png - resources/dark/images/setting_close_small_normal.png - resources/dark/images/setting_close_small_press.png - resources/dark/images/preview_border_hover.png - resources/dark/images/preview_border_normal.png - - - resources/dark/qss/dde-dock.qss - - diff --git a/dde-dock/dde-dock.pro b/dde-dock/dde-dock.pro deleted file mode 100644 index b8142db2c..000000000 --- a/dde-dock/dde-dock.pro +++ /dev/null @@ -1,123 +0,0 @@ - -QT += core gui x11extras dbus svg concurrent - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = dde-dock -TEMPLATE = app -INCLUDEPATH += ./src ./libs - -DEFINES += PLUGIN_API_VERSION=1.0 - -ARCH = $$QMAKE_HOST.arch -isEqual(ARCH, mips64) | isEqual(ARCH, mips32) { - DEFINES += ARCH_MIPSEL -} - - -RESOURCES += \ - dark.qrc \ - light.qrc - -CONFIG += c++11 link_pkgconfig -PKGCONFIG += gtk+-2.0 x11 cairo xcb xcb-ewmh xcb-damage dtkbase dtkutil dtkwidget - -target.path = /usr/bin/ - -headers.files += src/interfaces/dockconstants.h \ - src/interfaces/dockplugininterface.h \ - src/interfaces/dockpluginproxyinterface.h -headers.path = /usr/include/dde-dock - -dbus_service.files += com.deepin.dde.dock.service -dbus_service.path = /usr/share/dbus-1/services - -INSTALLS += dbus_service headers target - -HEADERS += \ - src/interfaces/dockconstants.h \ - src/interfaces/dockplugininterface.h \ - src/interfaces/dockpluginproxyinterface.h \ - libs/xcb_misc.h \ - src/controller/dockmodedata.h \ - src/dbus/dbusclientmanager.h \ - src/dbus/dbusdockedappmanager.h \ - src/dbus/dbusdocksetting.h \ - src/dbus/dbusentrymanager.h \ - src/dbus/dbushidestatemanager.h \ - src/dbus/dbusmenu.h \ - src/dbus/dbusmenumanager.h \ - src/dbus/dbuspanelmanager.h \ - src/panel/panelmenu.h \ - src/widgets/highlighteffect.h \ - src/widgets/reflectioneffect.h \ - src/mainwidget.h \ - src/controller/signalmanager.h \ - src/widgets/previewwindow.h \ - src/dbus/dbusdisplay.h \ - src/dbus/dbuslauncher.h \ - src/dbus/dbusdockentry.h \ - src/panel/dockpanel.h \ - src/widgets/app/dockappbg.h \ - src/widgets/app/dockappicon.h \ - src/widgets/app/dockappitem.h \ - src/widgets/app/dockapplayout.h \ - src/controller/apps/dockappmanager.h \ - src/widgets/dockitem.h \ - src/widgets/plugin/dockpluginitem.h \ - src/widgets/plugin/dockpluginssettingwindow.h \ - src/controller/plugins/dockpluginsmanager.h \ - src/widgets/movablelayout.h \ - src/widgets/plugin/dockpluginlayout.h \ - src/controller/plugins/dockpluginitemwrapper.h \ - src/controller/plugins/dockpluginproxy.h \ - src/widgets/app/apppreview/apppreviewloader.h \ - src/widgets/app/apppreview/apppreviewloaderframe.h \ - src/widgets/app/apppreview/apppreviewscontainer.h \ - src/widgets/launcher/docklauncheritem.h \ - src/controller/stylemanager.h \ - src/dbus/dbuslaunchercontroller.h \ - src/dbus/dbusshutdownfront.h - -SOURCES += \ - libs/xcb_misc.cpp \ - src/controller/dockmodedata.cpp \ - src/dbus/dbusclientmanager.cpp \ - src/dbus/dbusdockedappmanager.cpp \ - src/dbus/dbusdocksetting.cpp \ - src/dbus/dbusentrymanager.cpp \ - src/dbus/dbushidestatemanager.cpp \ - src/dbus/dbusmenu.cpp \ - src/dbus/dbusmenumanager.cpp \ - src/dbus/dbuspanelmanager.cpp \ - src/panel/panelmenu.cpp \ - src/widgets/highlighteffect.cpp \ - src/widgets/reflectioneffect.cpp \ - src/main.cpp \ - src/mainwidget.cpp \ - src/controller/signalmanager.cpp \ - src/widgets/previewwindow.cpp \ - src/dbus/dbusdisplay.cpp \ - src/dbus/dbuslauncher.cpp \ - src/dbus/dbusdockentry.cpp \ - src/panel/dockpanel.cpp \ - src/widgets/app/dockappbg.cpp \ - src/widgets/app/dockappicon.cpp \ - src/widgets/app/dockappitem.cpp \ - src/widgets/app/dockapplayout.cpp \ - src/controller/apps/dockappmanager.cpp \ - src/widgets/dockitem.cpp \ - src/widgets/plugin/dockpluginitem.cpp \ - src/widgets/plugin/dockpluginssettingwindow.cpp \ - src/controller/plugins/dockpluginsmanager.cpp \ - src/widgets/movablelayout.cpp \ - src/widgets/plugin/dockpluginlayout.cpp \ - src/controller/plugins/dockpluginitemwrapper.cpp \ - src/controller/plugins/dockpluginproxy.cpp \ - src/widgets/app/apppreview/apppreviewloader.cpp \ - src/widgets/app/apppreview/apppreviewloaderframe.cpp \ - src/widgets/app/apppreview/apppreviewscontainer.cpp \ - src/widgets/launcher/docklauncheritem.cpp \ - src/controller/stylemanager.cpp \ - src/dbus/dbuslaunchercontroller.cpp \ - src/dbus/dbusshutdownfront.cpp diff --git a/dde-dock/images.qrc b/dde-dock/images.qrc deleted file mode 100644 index 4d8ed6621..000000000 --- a/dde-dock/images.qrc +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dde-dock/light.qrc b/dde-dock/light.qrc deleted file mode 100644 index c0cb13680..000000000 --- a/dde-dock/light.qrc +++ /dev/null @@ -1,18 +0,0 @@ - - - resources/light/images/close_hover.png - resources/light/images/close_normal.png - resources/light/images/close_press.png - resources/light/images/dark_dock.svg - resources/light/images/open-indicator.png - resources/light/images/opening-indicator.png - resources/light/images/setting_close_small_hover.png - resources/light/images/setting_close_small_normal.png - resources/light/images/setting_close_small_press.png - resources/light/images/preview_border_hover.png - resources/light/images/preview_border_normal.png - - - resources/light/qss/dde-dock.qss - - diff --git a/dde-dock/qss.qrc b/dde-dock/qss.qrc deleted file mode 100644 index 4d8ed6621..000000000 --- a/dde-dock/qss.qrc +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dde-dock/resources/dark/images/close_hover.png b/dde-dock/resources/dark/images/close_hover.png deleted file mode 100644 index 2a03ad091..000000000 Binary files a/dde-dock/resources/dark/images/close_hover.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/close_normal.png b/dde-dock/resources/dark/images/close_normal.png deleted file mode 100644 index 5696fe862..000000000 Binary files a/dde-dock/resources/dark/images/close_normal.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/close_press.png b/dde-dock/resources/dark/images/close_press.png deleted file mode 100644 index c67bbae9e..000000000 Binary files a/dde-dock/resources/dark/images/close_press.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/dark_dock.svg b/dde-dock/resources/dark/images/dark_dock.svg deleted file mode 100644 index 7dc2ce8c4..000000000 --- a/dde-dock/resources/dark/images/dark_dock.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - dark_dock副本 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dde-dock/resources/dark/images/open-indicator.png b/dde-dock/resources/dark/images/open-indicator.png deleted file mode 100644 index 5b2a59502..000000000 Binary files a/dde-dock/resources/dark/images/open-indicator.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/opening-indicator.png b/dde-dock/resources/dark/images/opening-indicator.png deleted file mode 100644 index 279d58c02..000000000 Binary files a/dde-dock/resources/dark/images/opening-indicator.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/preview_border_hover.png b/dde-dock/resources/dark/images/preview_border_hover.png deleted file mode 100644 index 891232b60..000000000 Binary files a/dde-dock/resources/dark/images/preview_border_hover.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/preview_border_normal.png b/dde-dock/resources/dark/images/preview_border_normal.png deleted file mode 100644 index fa11d6cc4..000000000 Binary files a/dde-dock/resources/dark/images/preview_border_normal.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/setting_close_small_hover.png b/dde-dock/resources/dark/images/setting_close_small_hover.png deleted file mode 100644 index b796abc9c..000000000 Binary files a/dde-dock/resources/dark/images/setting_close_small_hover.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/setting_close_small_normal.png b/dde-dock/resources/dark/images/setting_close_small_normal.png deleted file mode 100644 index fe463b791..000000000 Binary files a/dde-dock/resources/dark/images/setting_close_small_normal.png and /dev/null differ diff --git a/dde-dock/resources/dark/images/setting_close_small_press.png b/dde-dock/resources/dark/images/setting_close_small_press.png deleted file mode 100644 index 47c0a8c0a..000000000 Binary files a/dde-dock/resources/dark/images/setting_close_small_press.png and /dev/null differ diff --git a/dde-dock/resources/dark/qss/dde-dock.qss b/dde-dock/resources/dark/qss/dde-dock.qss deleted file mode 100644 index e0e2150fe..000000000 --- a/dde-dock/resources/dark/qss/dde-dock.qss +++ /dev/null @@ -1,111 +0,0 @@ -QLabel#Panel[isFashionMode="false"] { - background-color: rgba(0,0,0,0.7); -} - -QLabel#Panel[isFashionMode="true"] { - border-width: 0px 21px 49px 21px; - border-image: url(:/images/resources/dark/images/dark_dock.svg) 0 21 49 21 stretch; -} - -QLabel#DockAppTitle { - color: rgba(255,255,255,0.8); -} - -QLabel#ClassicModeTitle { - color: rgba(255,255,255,1); -} - -/*************************************App Background***********************************************/ -/*item is current opened and is hovered*/ -QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="true"] { - background: rgba(0,188,255,0.80); - border: 1px solid rgba(79,174,249,0.50); - /*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/ - border-radius: 2px; -} -/*item is current opened but not hovered*/ -QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="false"] { - background: rgba(0,188,255,0.60); - border: 1px solid rgba(79,174,249,0.50); - /*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/ - border-radius: 2px; -} -/*item is actived and hovered*/ -QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="true"][isCurrentOpened="false"] { - background: rgba(255,255,255,0.40); - border-radius: 2px; -} -/*item is actived but not hovered*/ -QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="false"][isCurrentOpened="false"] { - background: rgba(255,255,255,0.20); - border-radius: 2px; -} - -QLabel#AppBackgroundActiveLabel { - qproperty-openIndicatorIcon:url(:/images/resources/dark/images/open-indicator.png); - qproperty-openingIndicatorIcon:url(:/images/resources/dark/images/opening-indicator.png); -} - -/******************************Item Preview***********************/ -QPushButton#AppPreviewLoaderFrameCloseButton { - border-image: url(:/images/resources/dark/images/close_normal.png); -} - -QPushButton#AppPreviewLoaderFrameCloseButton:hover { - border-image: url(:/images/resources/dark/images/close_hover.png); -} - -QPushButton#AppPreviewLoaderFrameCloseButton:pressed { - border-image: url(:/images/resources/dark/images/close_press.png); -} - -AppPreviewLoader { - /*radius is 4 and width is 2 so slice should be 4 + 2 = 6*/ - border: 6px solid transparent; - border-image: url(:/images/resources/dark/images/preview_border_normal.png) 6 repeat; -} - -AppPreviewLoader[isHover="true"] { - /*radius is 4 and width is 2 so slice should be 4 + 2 = 6*/ - border: 6px solid transparent; - border-image: url(:/images/resources/dark/images/preview_border_hover.png) 6 repeat; -} - -QLabel#AppPreviewLoaderFrameTitle { - border-top-left-radius: 0px; - border-bottom-left-radius: 3px; - border-top-right-radius: 0px; - border-bottom-right-radius: 3px; - border-width: 0; - font-size: 10px; - color: #FFFFFF; - background-color: rgba(0,0,0,0.7); -} - - -/********************************Plugin Setting********************/ -QLabel#PluginSettingTitle { - color:#b4b4b4; -} - -QLabel#PluginSettingLineTitle { - color:#b4b4b4; -} - -QWidget#PluginsSettingFrame { - background-color: rgba(0,0,0,0.9); - border-radius: 3; -} - -QPushButton#PluginSettingCloseButton{ - border-image: url(:/images/resources/dark/images/setting_close_small_normal.png); -} - -QPushButton#PluginSettingCloseButton:hover{ - border-image: url(:/images/resources/dark/images/setting_close_small_hover.png); -} - -QPushButton#PluginSettingCloseButton:pressed{ - border-image: url(:/images/resources/dark/images/setting_close_small_press.png); -} - diff --git a/dde-dock/resources/light/images/close_hover.png b/dde-dock/resources/light/images/close_hover.png deleted file mode 100644 index 2a03ad091..000000000 Binary files a/dde-dock/resources/light/images/close_hover.png and /dev/null differ diff --git a/dde-dock/resources/light/images/close_normal.png b/dde-dock/resources/light/images/close_normal.png deleted file mode 100644 index 5696fe862..000000000 Binary files a/dde-dock/resources/light/images/close_normal.png and /dev/null differ diff --git a/dde-dock/resources/light/images/close_press.png b/dde-dock/resources/light/images/close_press.png deleted file mode 100644 index c67bbae9e..000000000 Binary files a/dde-dock/resources/light/images/close_press.png and /dev/null differ diff --git a/dde-dock/resources/light/images/dark_dock.svg b/dde-dock/resources/light/images/dark_dock.svg deleted file mode 100644 index 7dc2ce8c4..000000000 --- a/dde-dock/resources/light/images/dark_dock.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - dark_dock副本 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dde-dock/resources/light/images/open-indicator.png b/dde-dock/resources/light/images/open-indicator.png deleted file mode 100644 index 5b2a59502..000000000 Binary files a/dde-dock/resources/light/images/open-indicator.png and /dev/null differ diff --git a/dde-dock/resources/light/images/opening-indicator.png b/dde-dock/resources/light/images/opening-indicator.png deleted file mode 100644 index 279d58c02..000000000 Binary files a/dde-dock/resources/light/images/opening-indicator.png and /dev/null differ diff --git a/dde-dock/resources/light/images/preview_border_hover.png b/dde-dock/resources/light/images/preview_border_hover.png deleted file mode 100644 index 891232b60..000000000 Binary files a/dde-dock/resources/light/images/preview_border_hover.png and /dev/null differ diff --git a/dde-dock/resources/light/images/preview_border_normal.png b/dde-dock/resources/light/images/preview_border_normal.png deleted file mode 100644 index fa11d6cc4..000000000 Binary files a/dde-dock/resources/light/images/preview_border_normal.png and /dev/null differ diff --git a/dde-dock/resources/light/images/setting_close_small_hover.png b/dde-dock/resources/light/images/setting_close_small_hover.png deleted file mode 100644 index b796abc9c..000000000 Binary files a/dde-dock/resources/light/images/setting_close_small_hover.png and /dev/null differ diff --git a/dde-dock/resources/light/images/setting_close_small_normal.png b/dde-dock/resources/light/images/setting_close_small_normal.png deleted file mode 100644 index fe463b791..000000000 Binary files a/dde-dock/resources/light/images/setting_close_small_normal.png and /dev/null differ diff --git a/dde-dock/resources/light/images/setting_close_small_press.png b/dde-dock/resources/light/images/setting_close_small_press.png deleted file mode 100644 index 47c0a8c0a..000000000 Binary files a/dde-dock/resources/light/images/setting_close_small_press.png and /dev/null differ diff --git a/dde-dock/resources/light/qss/dde-dock.qss b/dde-dock/resources/light/qss/dde-dock.qss deleted file mode 100644 index e0e2150fe..000000000 --- a/dde-dock/resources/light/qss/dde-dock.qss +++ /dev/null @@ -1,111 +0,0 @@ -QLabel#Panel[isFashionMode="false"] { - background-color: rgba(0,0,0,0.7); -} - -QLabel#Panel[isFashionMode="true"] { - border-width: 0px 21px 49px 21px; - border-image: url(:/images/resources/dark/images/dark_dock.svg) 0 21 49 21 stretch; -} - -QLabel#DockAppTitle { - color: rgba(255,255,255,0.8); -} - -QLabel#ClassicModeTitle { - color: rgba(255,255,255,1); -} - -/*************************************App Background***********************************************/ -/*item is current opened and is hovered*/ -QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="true"] { - background: rgba(0,188,255,0.80); - border: 1px solid rgba(79,174,249,0.50); - /*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/ - border-radius: 2px; -} -/*item is current opened but not hovered*/ -QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="false"] { - background: rgba(0,188,255,0.60); - border: 1px solid rgba(79,174,249,0.50); - /*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/ - border-radius: 2px; -} -/*item is actived and hovered*/ -QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="true"][isCurrentOpened="false"] { - background: rgba(255,255,255,0.40); - border-radius: 2px; -} -/*item is actived but not hovered*/ -QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="false"][isCurrentOpened="false"] { - background: rgba(255,255,255,0.20); - border-radius: 2px; -} - -QLabel#AppBackgroundActiveLabel { - qproperty-openIndicatorIcon:url(:/images/resources/dark/images/open-indicator.png); - qproperty-openingIndicatorIcon:url(:/images/resources/dark/images/opening-indicator.png); -} - -/******************************Item Preview***********************/ -QPushButton#AppPreviewLoaderFrameCloseButton { - border-image: url(:/images/resources/dark/images/close_normal.png); -} - -QPushButton#AppPreviewLoaderFrameCloseButton:hover { - border-image: url(:/images/resources/dark/images/close_hover.png); -} - -QPushButton#AppPreviewLoaderFrameCloseButton:pressed { - border-image: url(:/images/resources/dark/images/close_press.png); -} - -AppPreviewLoader { - /*radius is 4 and width is 2 so slice should be 4 + 2 = 6*/ - border: 6px solid transparent; - border-image: url(:/images/resources/dark/images/preview_border_normal.png) 6 repeat; -} - -AppPreviewLoader[isHover="true"] { - /*radius is 4 and width is 2 so slice should be 4 + 2 = 6*/ - border: 6px solid transparent; - border-image: url(:/images/resources/dark/images/preview_border_hover.png) 6 repeat; -} - -QLabel#AppPreviewLoaderFrameTitle { - border-top-left-radius: 0px; - border-bottom-left-radius: 3px; - border-top-right-radius: 0px; - border-bottom-right-radius: 3px; - border-width: 0; - font-size: 10px; - color: #FFFFFF; - background-color: rgba(0,0,0,0.7); -} - - -/********************************Plugin Setting********************/ -QLabel#PluginSettingTitle { - color:#b4b4b4; -} - -QLabel#PluginSettingLineTitle { - color:#b4b4b4; -} - -QWidget#PluginsSettingFrame { - background-color: rgba(0,0,0,0.9); - border-radius: 3; -} - -QPushButton#PluginSettingCloseButton{ - border-image: url(:/images/resources/dark/images/setting_close_small_normal.png); -} - -QPushButton#PluginSettingCloseButton:hover{ - border-image: url(:/images/resources/dark/images/setting_close_small_hover.png); -} - -QPushButton#PluginSettingCloseButton:pressed{ - border-image: url(:/images/resources/dark/images/setting_close_small_press.png); -} - diff --git a/dde-dock/src/controller/apps/dockappmanager.cpp b/dde-dock/src/controller/apps/dockappmanager.cpp deleted file mode 100644 index e180e8451..000000000 --- a/dde-dock/src/controller/apps/dockappmanager.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dockappmanager.h" -#include "dbus/dbuslauncher.h" - -DockAppManager::DockAppManager(QObject *parent) : QObject(parent) -{ - m_entryManager = new DBusEntryManager(this); - connect(m_entryManager, &DBusEntryManager::Added, this, &DockAppManager::onEntryAdded); - connect(m_entryManager, &DBusEntryManager::Removed, this, &DockAppManager::onEntryRemoved); - DBusLauncher *dbusLauncher = new DBusLauncher(this); - connect(dbusLauncher, &DBusLauncher::ItemChanged, [=](const QString &in0, ItemInfo in1){ - if (in0 == "deleted") { - onEntryRemoved(in1.key); - m_dockAppManager->RequestUndock(in1.key); - } - }); -} - -void DockAppManager::initEntries() -{ - QList entryList = m_entryManager->entries(); - for (QDBusObjectPath objPath : entryList) - { - DBusDockEntry *dep = new DBusDockEntry(objPath.path()); - if (/*dep->isValid() && */dep->type() == "App") { - m_initEntries << dep; - } - } - - initItemList(); -} - -void DockAppManager::onEntryAdded(const QDBusObjectPath &path) -{ - DBusDockEntry *entryProxyer = new DBusDockEntry(path.path()); - if (entryProxyer->isValid() && entryProxyer->type() == "App") - { - DockAppItem *item = new DockAppItem(); - QString tmpId = entryProxyer->id(); - item->setItemId(tmpId); - if (m_ids.indexOf(tmpId) != -1) { - item->deleteLater(); - }else{ - qDebug() << "app entry add:" << tmpId ; - bool isTheDropOne = m_dockingItemId == tmpId; - m_ids.append(tmpId); - if (isTheDropOne) { - emit entryAdded(item); - } - else { - emit entryAppend(item); - } - - emit requestSort(); - - m_dockingItemId = ""; - } - - item->setEntryProxyer(entryProxyer); - } -} - -void DockAppManager::setDockingItemId(const QString &dockingItemId) -{ - m_dockingItemId = dockingItemId; -} - -void DockAppManager::onEntryRemoved(const QString &id) -{ - if (m_ids.indexOf(id) != -1) { - qDebug() << "app entry remove:" << id; - m_ids.removeAll(id); - emit entryRemoved(id); - } -} - -void DockAppManager::initItemList() -{ - QStringList dockedList = m_dockAppManager->DockedAppList().value(); - - m_ids = QStringList(); - QList undockedEntries; - - for (DBusDockEntry *entry : m_initEntries) { - m_ids << entry->id(); - if (dockedList.indexOf(entry->id()) != -1) { - DockAppItem *item = new DockAppItem; - emit entryAppend(item); - item->setEntryProxyer(entry); - } else { - undockedEntries << entry; - } - } - - for (DBusDockEntry *entry : undockedEntries) { - DockAppItem *item = new DockAppItem; - emit entryAppend(item); - item->setEntryProxyer(entry); - } -} diff --git a/dde-dock/src/controller/apps/dockappmanager.h b/dde-dock/src/controller/apps/dockappmanager.h deleted file mode 100644 index 8f7f2c70c..000000000 --- a/dde-dock/src/controller/apps/dockappmanager.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKAPPMANAGER_H -#define DOCKAPPMANAGER_H - -#include "dbus/dbusentrymanager.h" -#include "dbus/dbusdockentry.h" -#include "dbus/dbusdockedappmanager.h" -#include "widgets/app/dockappitem.h" - -class DockAppManager : public QObject -{ - Q_OBJECT -public: - explicit DockAppManager(QObject *parent = 0); - void initEntries(); - - void setDockingItemId(const QString &dockingItemId); - -signals: - void requestSort(); - void entryAdded(DockAppItem *item); - void entryAppend(DockAppItem *item); - void entryRemoved(const QString &id); - -private: - void initItemList(); //Sort and append item to dock - void onEntryRemoved(const QString &id); - void onEntryAdded(const QDBusObjectPath &path); - -private: - QStringList m_ids; - QString m_dockingItemId = ""; //drop to the dock one - DBusEntryManager *m_entryManager = NULL; - DBusDockedAppManager *m_dockAppManager = new DBusDockedAppManager(this); - QList m_initEntries; -}; - -#endif // DOCKAPPMANAGER_H diff --git a/dde-dock/src/controller/dockmodedata.cpp b/dde-dock/src/controller/dockmodedata.cpp deleted file mode 100644 index 6ccba2b5c..000000000 --- a/dde-dock/src/controller/dockmodedata.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dockmodedata.h" - -DockModeData::DockModeData(QObject *parent) : - QObject(parent) -{ - initDDS(); -} - -DockModeData * DockModeData::m_dockModeData = NULL; -DockModeData * DockModeData::instance() -{ - if (m_dockModeData == NULL) - m_dockModeData = new DockModeData(); - - return m_dockModeData; -} - -Dock::DockMode DockModeData::getDockMode() -{ - return m_currentMode; -} - -void DockModeData::setDockMode(Dock::DockMode value) -{ - m_dockSetting->SetDisplayMode(value); -} - -Dock::HideMode DockModeData::getHideMode() -{ - return m_hideMode; -} - -void DockModeData::setHideMode(Dock::HideMode value) -{ - m_dockSetting->SetHideMode(value); - if(value == Dock::KeepShowing) { - setHideState(Dock::HideStateShowing); - } - else if (value == Dock::SmartHide){ - setHideState(Dock::HideStateHiding); - } - QTimer::singleShot(100, m_hideStateManager, SLOT(UpdateState())); -} - -Dock::HideState DockModeData::getHideState() -{ - return m_hideState; -} - -void DockModeData::setHideState(Dock::HideState value) -{ - m_hideState = value; - m_hideStateManager->SetState(value); - m_hideStateManager->UpdateState(); -} - -int DockModeData::getDockHeight() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::PANEL_FASHION_HEIGHT; - case Dock::EfficientMode: - return Dock::PANEL_EFFICIENT_HEIGHT; - case Dock::ClassicMode: - return Dock::PANEL_CLASSIC_HEIGHT; - default: - return Dock::PANEL_FASHION_HEIGHT; - } -} - -int DockModeData::getItemHeight() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APP_ITEM_FASHION_HEIGHT; - case Dock::EfficientMode: - return Dock::APP_ITEM_EFFICIENT_HEIGHT; - case Dock::ClassicMode: - return Dock::APP_ITEM_CLASSIC_HEIGHT; - default: - return Dock::APP_ITEM_FASHION_HEIGHT; - } -} - -int DockModeData::getNormalItemWidth() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APP_ITEM_FASHION_NORMAL_WIDTH; - case Dock::EfficientMode: - return Dock::APP_ITEM_EFFICIENT_NORMAL_WIDTH; - case Dock::ClassicMode: - return Dock::APP_ITEM_CLASSIC_NORMAL_WIDTH; - default: - return Dock::APP_ITEM_FASHION_NORMAL_WIDTH; - } -} - -int DockModeData::getActivedItemWidth() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APP_ITEM_FASHION_ACTIVE_WIDTH; - case Dock::EfficientMode: - return Dock::APP_ITEM_EFFICIENT_ACTIVE_WIDTH; - case Dock::ClassicMode: - return Dock::APP_ITEM_CLASSIC_ACTIVE_WIDTH; - default: - return Dock::APP_ITEM_FASHION_ACTIVE_WIDTH; - } -} - -int DockModeData::getAppItemSpacing() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APP_ITEM_FASHION_SPACING; - case Dock::EfficientMode: - return Dock::APP_ITEM_EFFICIENT_SPACING; - case Dock::ClassicMode: - return Dock::APP_ITEM_CLASSIC_SPACING; - default: - return Dock::APP_ITEM_FASHION_SPACING; - } -} - -int DockModeData::getAppIconSize() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APP_ITEM_FASHION_ICON_SIZE; - case Dock::EfficientMode: - return Dock::APP_ITEM_EFFICIENT_ICON_SIZE; - case Dock::ClassicMode: - return Dock::APP_ITEM_CLASSIC_ICON_SIZE; - default: - return Dock::APP_ITEM_FASHION_ICON_SIZE; - } -} - -int DockModeData::getAppletsItemHeight() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APPLET_FASHION_ITEM_HEIGHT; - case Dock::EfficientMode: - return Dock::APPLET_EFFICIENT_ITEM_HEIGHT; - case Dock::ClassicMode: - return Dock::APPLET_CLASSIC_ITEM_HEIGHT; - default: - return Dock::APPLET_FASHION_ITEM_HEIGHT; - } -} - -int DockModeData::getAppletsItemWidth() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APPLET_FASHION_ITEM_WIDTH; - case Dock::EfficientMode: - return Dock::APPLET_EFFICIENT_ITEM_WIDTH; - case Dock::ClassicMode: - return Dock::APPLET_CLASSIC_ITEM_WIDTH; - default: - return Dock::APPLET_FASHION_ITEM_WIDTH; - } -} - -int DockModeData::getAppletsItemSpacing() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APPLET_FASHION_ITEM_SPACING; - case Dock::EfficientMode: - return Dock::APPLET_EFFICIENT_ITEM_SPACING; - case Dock::ClassicMode: - return Dock::APPLET_CLASSIC_ITEM_SPACING; - default: - return Dock::APPLET_FASHION_ITEM_SPACING; - } -} - -int DockModeData::getAppletsIconSize() -{ - switch (m_currentMode) - { - case Dock::FashionMode: - return Dock::APPLET_FASHION_ICON_SIZE; - case Dock::EfficientMode: - return Dock::APPLET_EFFICIENT_ICON_SIZE; - case Dock::ClassicMode: - return Dock::APPLET_CLASSIC_ICON_SIZE; - default: - return Dock::APPLET_FASHION_ICON_SIZE; - } -} - -void DockModeData::onDockModeChanged(int mode) -{ - Dock::DockMode tmpMode = Dock::DockMode(mode); - Dock::DockMode oldmode = m_currentMode; - m_currentMode = tmpMode; - - emit dockModeChanged(tmpMode,oldmode); -} - -void DockModeData::onHideModeChanged(int mode) -{ - Dock::HideMode tmpMode = Dock::HideMode(mode); - Dock::HideMode oldMode = m_hideMode; - m_hideMode = tmpMode; - - emit hideModeChanged(tmpMode,oldMode); -} - -void DockModeData::initDDS() -{ - m_dockSetting = new DBusDockSetting(this); - connect(m_dockSetting,&DBusDockSetting::DisplayModeChanged,this,&DockModeData::onDockModeChanged); - connect(m_dockSetting,&DBusDockSetting::HideModeChanged,this,&DockModeData::onHideModeChanged); - - m_currentMode = Dock::DockMode(m_dockSetting->GetDisplayMode().value()); - m_hideMode = Dock::HideMode(m_dockSetting->GetHideMode().value()); - - emit dockModeChanged(m_currentMode,m_currentMode); - emit hideModeChanged(m_hideMode,m_hideMode); -} diff --git a/dde-dock/src/controller/dockmodedata.h b/dde-dock/src/controller/dockmodedata.h deleted file mode 100644 index a0e11d84d..000000000 --- a/dde-dock/src/controller/dockmodedata.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKMODEDATA_H -#define DOCKMODEDATA_H - -#include -#include -#include -#include -#include "dbus/dbusdocksetting.h" -#include "dbus/dbushidestatemanager.h" -#include "interfaces/dockconstants.h" - -class DockModeData : public QObject -{ - Q_OBJECT -public: - static DockModeData * instance(); - - Dock::DockMode getDockMode(); - void setDockMode(Dock::DockMode value); - Dock::HideMode getHideMode(); - void setHideMode(Dock::HideMode value); - Dock::HideState getHideState(); - void setHideState(Dock::HideState value); - - int getDockHeight(); - int getItemHeight(); - int getNormalItemWidth(); - int getActivedItemWidth(); - int getAppItemSpacing(); - int getAppIconSize(); - - int getAppletsItemHeight(); - int getAppletsItemWidth(); - int getAppletsItemSpacing(); - int getAppletsIconSize(); - -signals: - void dockModeChanged(Dock::DockMode newMode,Dock::DockMode oldMode); - void hideModeChanged(Dock::HideMode newMode,Dock::HideMode oldMode); - -private: - explicit DockModeData(QObject *parent = 0); - - void initDDS(); - void onDockModeChanged(int mode); - void onHideModeChanged(int mode); - -private: - static DockModeData * m_dockModeData; - - Dock::DockMode m_currentMode = Dock::EfficientMode; - Dock::HideMode m_hideMode = Dock::KeepShowing; - Dock::HideState m_hideState = Dock::HideStateShown; //make sure the preview can be show - - DBusDockSetting *m_dockSetting = NULL; - DBusHideStateManager *m_hideStateManager = new DBusHideStateManager(this); -}; - -#endif // DOCKMODEDATA_H diff --git a/dde-dock/src/controller/plugins/dockpluginitemwrapper.cpp b/dde-dock/src/controller/plugins/dockpluginitemwrapper.cpp deleted file mode 100644 index c8ec47da8..000000000 --- a/dde-dock/src/controller/plugins/dockpluginitemwrapper.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include - -#include "dockpluginitemwrapper.h" -#include "../dockmodedata.h" - -static const QString MenuItemRun = "id_run"; -static const QString MenuItemRemove = "id_remove"; - -DockPluginItemWrapper::DockPluginItemWrapper(DockPluginInterface *plugin, - QString id, QWidget * parent) : - DockItem(parent), - m_plugin(plugin), - m_id(id) -{ - if (m_plugin) { - qDebug() << "PluginItemWrapper created " << m_plugin->getPluginName() << m_id; - - QWidget * item = m_plugin->getItem(id); - m_pluginItemContents = m_plugin->getApplet(id); - - if (item) { - QHBoxLayout *layout = new QHBoxLayout(this); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - layout->addWidget(item); - adjustSize(); - - m_display = new DBusDisplay(this); - } - } -} - - -DockPluginItemWrapper::~DockPluginItemWrapper() -{ - qDebug() << "PluginItemWrapper destroyed " << m_plugin->getPluginName() << m_id; -} - -QString DockPluginItemWrapper::getTitle() -{ - return m_plugin->getTitle(m_id); -} - -QWidget * DockPluginItemWrapper::getApplet() -{ - return m_plugin->getApplet(m_id); -} - -QString DockPluginItemWrapper::getItemId() -{ - return m_id; -} - -void DockPluginItemWrapper::enterEvent(QEvent *) -{ - if (hoverable()) { - DisplayRect rec = m_display->primaryRect(); - showPreview(QPoint(globalX() + width() / 2, rec.height- DockModeData::instance()->getDockHeight() - DOCK_PREVIEW_MARGIN)); - emit mouseEnter(); - } -} - -void DockPluginItemWrapper::leaveEvent(QEvent *) -{ - hidePreview(); - emit mouseLeave(); -} - - -void DockPluginItemWrapper::mousePressEvent(QMouseEvent * event) -{ - hidePreview(true); - - if (event->button() == Qt::RightButton) { - DisplayRect rec = m_display->primaryRect(); - this->showMenu(QPoint(rec.x + globalX() + width() / 2, - rec.y + rec.height - DockModeData::instance()->getDockHeight())); - } else if (event->button() == Qt::LeftButton) { - QString command = m_plugin->getCommand(m_id); - if (!command.isEmpty()) QProcess::startDetached(command); - } - - emit mousePress(); -} - -void DockPluginItemWrapper::mouseReleaseEvent(QMouseEvent *event) -{ - Q_UNUSED(event) - - emit mouseRelease(); -} - -QString DockPluginItemWrapper::getMenuContent() -{ - QString menuContent = m_plugin->getMenuContent(m_id); - - bool canRun = !m_plugin->getCommand(m_id).isEmpty(); - bool configurable = m_plugin->configurable(m_id); - - if (canRun || configurable) { - QJsonObject result = QJsonDocument::fromJson(menuContent.toUtf8()).object(); - QJsonArray array = result["items"].toArray(); - - QJsonObject itemRun = createMenuItem(MenuItemRun, tr("_Run"), false, false); - QJsonObject itemRemove = createMenuItem(MenuItemRemove, tr("_Undock"), false, false); - - if (canRun) array.insert(0, itemRun); - if (configurable) array.append(itemRemove); - - result["items"] = array; - - return QString(QJsonDocument(result).toJson()); - } else { - return menuContent; - } -} - -void DockPluginItemWrapper::invokeMenuItem(QString itemId, bool checked) -{ - if (itemId == MenuItemRun) { - QString command = m_plugin->getCommand(m_id); - QProcess::startDetached(command); - } else if (itemId == MenuItemRemove){ - m_plugin->setEnabled(m_id, false); - } else { - m_plugin->invokeMenuItem(m_id, itemId, checked); - } -} - -QJsonObject DockPluginItemWrapper::createMenuItem(QString itemId, QString itemName, bool checkable, bool checked) -{ - QJsonObject itemObj; - - itemObj.insert("itemId", itemId); - itemObj.insert("itemText", itemName); - itemObj.insert("itemIcon", ""); - itemObj.insert("itemIconHover", ""); - itemObj.insert("itemIconInactive", ""); - itemObj.insert("itemExtra", ""); - itemObj.insert("isActive", true); - itemObj.insert("isCheckable", checkable); - itemObj.insert("checked", checked); - itemObj.insert("itemSubMenu", QJsonObject()); - - return itemObj; -} diff --git a/dde-dock/src/controller/plugins/dockpluginitemwrapper.h b/dde-dock/src/controller/plugins/dockpluginitemwrapper.h deleted file mode 100644 index 937091cec..000000000 --- a/dde-dock/src/controller/plugins/dockpluginitemwrapper.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINITEMWRAPPER_H -#define DOCKPLUGINITEMWRAPPER_H - -#include - -#include "widgets/dockitem.h" -#include "interfaces/dockplugininterface.h" -#include "dbus/dbusdisplay.h" - -class QMouseEvent; -class DockPluginItemWrapper : public DockItem -{ - Q_OBJECT -public: - DockPluginItemWrapper(DockPluginInterface *plugin, QString getItemId, QWidget * parent = 0); - virtual ~DockPluginItemWrapper(); - - QString getTitle() Q_DECL_OVERRIDE; - QString getItemId() Q_DECL_OVERRIDE; - QWidget * getApplet() Q_DECL_OVERRIDE; - - QString getMenuContent() Q_DECL_OVERRIDE; - void invokeMenuItem(QString itemId, bool checked) Q_DECL_OVERRIDE; - -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: - DBusDisplay *m_display = NULL; - QWidget *m_pluginItemContents = NULL; - DockPluginInterface * m_plugin; - QString m_id; - - QJsonObject createMenuItem(QString itemId, QString itemName, bool checkable, bool checked); - const int DOCK_PREVIEW_MARGIN = 7; -}; - -#endif // DOCKPLUGINITEMWRAPPER_H diff --git a/dde-dock/src/controller/plugins/dockpluginproxy.cpp b/dde-dock/src/controller/plugins/dockpluginproxy.cpp deleted file mode 100644 index 23e1e79ae..000000000 --- a/dde-dock/src/controller/plugins/dockpluginproxy.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include - -#include "dockpluginproxy.h" -#include "dockpluginitemwrapper.h" -#include "controller/dockmodedata.h" - -DockPluginProxy::DockPluginProxy(QPluginLoader * loader, DockPluginInterface * plugin) : - QObject(), - m_loader(loader), - m_plugin(plugin) -{ -} - -DockPluginProxy::~DockPluginProxy() -{ - foreach (QString id, m_items.keys()) { - emit itemRemoved(m_items.take(id), id); - } - m_items.clear(); - - m_loader->unload(); - m_loader->deleteLater(); - - qDebug() << "Plugin unloaded: " << m_loader->fileName(); -} - -DockPluginInterface * DockPluginProxy::plugin() -{ - return m_plugin; -} - -Dock::DockMode DockPluginProxy::dockMode() -{ - return DockModeData::instance()->getDockMode(); -} - -bool DockPluginProxy::isSystemPlugin() -{ - return m_loader->metaData()["MetaData"].toObject()["sys_plugin"].toBool(); -} - -void DockPluginProxy::itemAddedEvent(QString id) -{ - if (m_plugin->getItem(id)) { - qDebug() << "Item added on plugin " << m_plugin->getPluginName() << id; - - DockItem * item = new DockPluginItemWrapper(m_plugin, id); - m_items[id] = item; - - emit itemAdded(item, id); - } -} - -void DockPluginProxy::itemRemovedEvent(QString id) -{ - qDebug() << "Item removed on plugin " << m_plugin->getPluginName() << id; - - DockItem * item = m_items.value(id); - if (item) { - item->hidePreview(true); - m_items.take(id); - - emit itemRemoved(item, id); - } -} - -void DockPluginProxy::infoChangedEvent(DockPluginInterface::InfoType type, const QString &id) -{ - switch (type) { - case DockPluginInterface::InfoTypeItemSize: - case DockPluginInterface::ItemSize: //Q_DECL_DEPRECATED - itemSizeChangedEvent(id); - break; - case DockPluginInterface::InfoTypeAppletSize: - case DockPluginInterface::AppletSize: //Q_DECL_DEPRECATED - appletSizeChangedEvent(id); - break; - case DockPluginInterface::InfoTypeTitle: - emit titleChanged(id); - break; - case DockPluginInterface::InfoTypeConfigurable: - emit configurableChanged(id); - break; - case DockPluginInterface::InfoTypeEnable: - emit enabledChanged(id); - break; - default: - break; - } -} - -void DockPluginProxy::itemSizeChangedEvent(QString id) -{ - - DockItem * item = m_items.value(id); - if (item) { - qWarning() << "Item size changed on plugin " << m_plugin->getPluginName() << id; - item->adjustSize(); - } -} - -void DockPluginProxy::appletSizeChangedEvent(QString id) -{ - DockItem * item = m_items.value(id); - if (item) { - qWarning() << "Applet size changed on plugin " << m_plugin->getPluginName() << id; - item->needPreviewUpdate(); - } -} diff --git a/dde-dock/src/controller/plugins/dockpluginproxy.h b/dde-dock/src/controller/plugins/dockpluginproxy.h deleted file mode 100644 index 35a3fb089..000000000 --- a/dde-dock/src/controller/plugins/dockpluginproxy.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINPROXY_H -#define DOCKPLUGINPROXY_H - -#include "widgets/dockitem.h" -#include "interfaces/dockplugininterface.h" -#include "interfaces/dockpluginproxyinterface.h" - -class QPluginLoader; -class DockPluginProxy : public QObject, public DockPluginProxyInterface -{ - Q_OBJECT -public: - DockPluginProxy(QPluginLoader * loader, DockPluginInterface * plugin); - ~DockPluginProxy(); - - bool isSystemPlugin(); - DockPluginInterface * plugin(); - - Dock::DockMode dockMode() Q_DECL_OVERRIDE; - - void itemAddedEvent(QString id) Q_DECL_OVERRIDE; - void itemRemovedEvent(QString id) Q_DECL_OVERRIDE; - void infoChangedEvent(DockPluginInterface::InfoType type, const QString &id) Q_DECL_OVERRIDE; - -signals: - void itemAdded(DockItem * item, QString uuid); - void itemRemoved(DockItem * item, QString uuid); - void titleChanged(const QString &id); - void configurableChanged(QString id); - void enabledChanged(QString id); - -private: - QMap m_items; - - QPluginLoader * m_loader; - DockPluginInterface * m_plugin; - - void itemSizeChangedEvent(QString id); - void appletSizeChangedEvent(QString id); -}; - -#endif // DOCKPLUGINPROXY_H diff --git a/dde-dock/src/controller/plugins/dockpluginsmanager.cpp b/dde-dock/src/controller/plugins/dockpluginsmanager.cpp deleted file mode 100644 index 9ce2670a8..000000000 --- a/dde-dock/src/controller/plugins/dockpluginsmanager.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include - -#include "dockpluginproxy.h" -#include "dockpluginsmanager.h" -#include "interfaces/dockplugininterface.h" - -const QString SYSTRAY_PLUGIN_ID = "composite_item_key"; -const QString DATETIME_PLUGIN_ID = "id_datetime"; -const QString SHUTDOWN_PLUGIN_ID = "shutdown"; -const int DELAY_NOTE_MODE_CHANGED_INTERVAL = 500; - -DockPluginsManager::DockPluginsManager(QObject *parent) : - QObject(parent) -{ - m_settingWindow = new DockPluginsSettingWindow; - - m_searchPaths << "/usr/lib/dde-dock/plugins/"; - - connect(m_dockModeData, &DockModeData::dockModeChanged, this, &DockPluginsManager::onDockModeChanged); -} - -void DockPluginsManager::initAll() -{ - for (QString path : m_searchPaths) { - QDir pluginsDir(path); - - for (QString fileName : pluginsDir.entryList(QDir::Files)) { - QString pluginPath = pluginsDir.absoluteFilePath(fileName); - - this->loadPlugin(pluginPath); - } - } - - for (DockPluginProxy * proxy : m_proxies.values()) { - connect(proxy, &DockPluginProxy::configurableChanged, [=](const QString &id) { - if (proxy->plugin()->configurable(id)) { - m_settingWindow->onPluginAdd(proxy->plugin()->enabled(id), - id, - proxy->plugin()->getName(id), - proxy->plugin()->getIcon(id)); - } - else { - m_settingWindow->onPluginRemove(id); - } - }); - connect(proxy, &DockPluginProxy::enabledChanged, [=](const QString &id) { - m_settingWindow->onPluginEnabledChanged(id, proxy->plugin()->enabled(id)); - }); - connect(proxy, &DockPluginProxy::titleChanged, [=](const QString &id) { - m_settingWindow->onPluginTitleChanged(id, proxy->plugin()->getName(id)); - }); - - proxy->plugin()->init(proxy); - } - - initSettingWindow(); -} - -void DockPluginsManager::onPluginsSetting(int y) -{ - m_settingWindow->move(QCursor::pos().x(), y - m_settingWindow->height()); - m_settingWindow->show(); -} - -// public slots -void DockPluginsManager::onDockModeChanged(Dock::DockMode newMode, Dock::DockMode oldMode) -{ - if (newMode == oldMode) - return; - - m_newMode = newMode; - m_oldMode = oldMode; - - //hide plugin immediately - for (DockItem *item : m_sysPlugins.keys()) { - item->setVisible(false); - } - for (DockItem *item : m_normalPlugins.keys()) { - item->setVisible(false); - } - - //Many plugin when changing the mode has done a lot of work - //and cause UI block - //so,delay to note plugin dock-mode changed after the dock updated it style - QTimer::singleShot(DELAY_NOTE_MODE_CHANGED_INTERVAL, this, SLOT(notePluginModeChanged())); -} - -DockPluginProxy * DockPluginsManager::loadPlugin(const QString &path) -{ - // check the file type - if (!QLibrary::isLibrary(path)) - return NULL; - - QPluginLoader * pluginLoader = new QPluginLoader(path); - - // check the apiVersion the plugin uses - double apiVersion = pluginLoader->metaData()["MetaData"].toObject()["api_version"].toDouble(); - if (apiVersion != PLUGIN_API_VERSION) - return NULL; - - - QObject *plugin = pluginLoader->instance(); - - if (plugin) { - DockPluginInterface * interface = qobject_cast(plugin); - - if (interface) { - qDebug() << "Plugin loaded: " << path; - - DockPluginProxy * proxy = new DockPluginProxy(pluginLoader, interface); - if (proxy) { - m_proxies[path] = proxy; - connect(proxy, &DockPluginProxy::itemAdded, this, &DockPluginsManager::onPluginItemAdded); - connect(proxy, &DockPluginProxy::itemRemoved, this, &DockPluginsManager::onPluginItemRemoved); - connect(m_settingWindow, &DockPluginsSettingWindow::checkedChanged, [=](QString uuid, bool checked){ - //NOTE:one sender, multi receiver - if (interface->ids().indexOf(uuid) != -1) { - interface->setEnabled(uuid, checked); - } - }); - - return proxy; - } - } - else { - qWarning() << "Load plugin failed(failed to convert) " << path; - } - } - else { - qWarning() << "Load plugin failed" << pluginLoader->errorString(); - } - - return NULL; -} - -void DockPluginsManager::unloadPlugin(const QString &path) -{ - if (m_proxies.contains(path)) { - DockPluginProxy * proxy = m_proxies.take(path); - delete proxy; - } -} - -void DockPluginsManager::initSettingWindow() -{ - foreach (DockPluginProxy *proxy, m_proxies.values()) { - QStringList ids = proxy->plugin()->ids(); - foreach (QString uuid, ids) { - if (proxy->plugin()->configurable(uuid)){ - m_settingWindow->onPluginAdd(proxy->plugin()->enabled(uuid), - uuid, - proxy->plugin()->getName(uuid), - proxy->plugin()->getIcon(uuid)); - } - } - } -} - -void DockPluginsManager::onPluginItemAdded(DockItem *item, QString uuid) -{ - DockPluginProxy *proxy = qobject_cast(sender()); - if (!proxy) - return; - - if (proxy->isSystemPlugin()) - handleSysPluginAdd(item, uuid); - else - handleNormalPluginAdd(item, uuid); -} - -void DockPluginsManager::onPluginItemRemoved(DockItem *item, QString) -{ - m_sysPlugins.remove(item); - m_normalPlugins.remove(item); - - emit itemRemoved(item); - item->setVisible(false); - item->deleteLater(); -} - -// private slots -void DockPluginsManager::watchedFileChanged(const QString & file) -{ - qDebug() << "DockPluginsManager::watchedFileChanged" << file; - this->unloadPlugin(file); - - if (QFile::exists(file)) { - DockPluginProxy * proxy = loadPlugin(file); - - if (proxy) proxy->plugin()->init(proxy); - } -} - -void DockPluginsManager::watchedDirectoryChanged(const QString & directory) -{ - qDebug() << "DockPluginsManager::watchedDirectoryChanged" << directory; - // we just need to take care of the situation that new files pop up in - // our watched directory. - QDir targetDir(directory); - foreach (QString fileName, targetDir.entryList(QDir::Files)) { - QString absPath = targetDir.absoluteFilePath(fileName); - if (!m_proxies.contains(absPath)) { - DockPluginProxy * proxy = loadPlugin(absPath); - - if (proxy) proxy->plugin()->init(proxy); - } - } -} - -void DockPluginsManager::notePluginModeChanged() -{ - for (DockPluginProxy * proxy : m_proxies) { - DockPluginInterface * plugin = proxy->plugin(); - plugin->changeMode(m_newMode, m_oldMode); - } - - //make sure all plugin will show - for (DockItem *item : m_sysPlugins.keys()) { - item->setVisible(true); - } - for (DockItem *item : m_normalPlugins.keys()) { - item->setVisible(true); - } - - //reanchor systray-plugin - DockItem *sysItem = m_sysPlugins.key(SYSTRAY_PLUGIN_ID); - m_sysPlugins.remove(sysItem); - emit itemRemoved(sysItem); - handleSysPluginAdd(sysItem, SYSTRAY_PLUGIN_ID); -} - -DockItem *DockPluginsManager::sysPluginItem(QString id) -{ - int si = m_sysPlugins.values().indexOf(id); - - if (si != -1) - return m_sysPlugins.keys().at(si); - else - return NULL; -} - -void DockPluginsManager::handleSysPluginAdd(DockItem *item, QString uuid) -{ - if (!item || m_sysPlugins.values().indexOf(uuid) != -1) - return; - - m_sysPlugins.insert(item, uuid); - - if (uuid == SHUTDOWN_PLUGIN_ID) - { - if (m_sysPlugins.values().contains(DATETIME_PLUGIN_ID)) - emit itemInsert(sysPluginItem(DATETIME_PLUGIN_ID), item); - else - emit itemAppend(item); - - return; - } - - if (uuid == SYSTRAY_PLUGIN_ID) { - if (m_dockModeData->getDockMode() != Dock::FashionMode) { - emit itemAppend(item); - } - else { - emit itemInsert(sysPluginItem(SHUTDOWN_PLUGIN_ID), item); - } - } - else { - emit itemInsert(NULL, item); - } -} - -void DockPluginsManager::handleNormalPluginAdd(DockItem *item, QString uuid) -{ - if (!item || m_normalPlugins.values().indexOf(uuid) != -1) - return; - - if (m_dockModeData->getDockMode() != Dock::FashionMode) { - - qDebug() << uuid << m_sysPlugins.values(); - - if (m_sysPlugins.values().contains(SHUTDOWN_PLUGIN_ID)) - itemInsert(sysPluginItem(SHUTDOWN_PLUGIN_ID), item); - else if (m_sysPlugins.values().contains(DATETIME_PLUGIN_ID)) - itemInsert(sysPluginItem(DATETIME_PLUGIN_ID), item); - else - itemInsert(nullptr, item); - } - else { - //Normal plug placed in the far left on Fashion Mode - emit itemAppend(item); - } - - m_normalPlugins.insert(item, uuid); -} diff --git a/dde-dock/src/controller/plugins/dockpluginsmanager.h b/dde-dock/src/controller/plugins/dockpluginsmanager.h deleted file mode 100644 index 5c34a32b0..000000000 --- a/dde-dock/src/controller/plugins/dockpluginsmanager.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINSMANAGER_H -#define DOCKPLUGINSMANAGER_H - -#include -#include -#include - -#include "widgets/dockitem.h" -#include "interfaces/dockconstants.h" -#include "controller/dockmodedata.h" -#include "../../widgets/plugin/dockpluginssettingwindow.h" - -class QFileSystemWatcher; -class DockPluginProxy; -class DockPluginsManager : public QObject -{ - Q_OBJECT -public: - explicit DockPluginsManager(QObject *parent = 0); - -signals: - void itemInsert(DockItem *baseItem, DockItem *targetItem); - void itemAppend(DockItem * item); - void itemRemoved(DockItem * item); - -public slots: - void initAll(); - void onPluginsSetting(int y); - void onDockModeChanged(Dock::DockMode newMode, - Dock::DockMode oldMode); - -private slots: - void watchedFileChanged(const QString & file); - void watchedDirectoryChanged(const QString & directory); - void notePluginModeChanged(); - -private: - DockItem * sysPluginItem(QString id); - DockPluginProxy * loadPlugin(const QString & path); - void handleSysPluginAdd(DockItem *item, QString uuid); - void handleNormalPluginAdd(DockItem *item, QString uuid); - void unloadPlugin(const QString & path); - void initSettingWindow(); - void onPluginItemAdded(DockItem *item, QString uuid); - void onPluginItemRemoved(DockItem *item, QString); - -private: - DockPluginsSettingWindow *m_settingWindow = NULL; - QMap m_sysPlugins; - QMap m_normalPlugins; - QMap m_proxies; - QFileSystemWatcher * m_watcher = NULL; - QStringList m_searchPaths; - DockModeData *m_dockModeData = DockModeData::instance(); - Dock::DockMode m_newMode; - Dock::DockMode m_oldMode; -}; - -#endif // DOCKPLUGINSMANAGER_H diff --git a/dde-dock/src/controller/signalmanager.cpp b/dde-dock/src/controller/signalmanager.cpp deleted file mode 100644 index 14138e691..000000000 --- a/dde-dock/src/controller/signalmanager.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "signalmanager.h" - -SignalManager *SignalManager::m_signalManager = NULL; -SignalManager *SignalManager::instance() -{ - if (!m_signalManager) - m_signalManager = new SignalManager; - return m_signalManager; -} - -SignalManager::SignalManager(QObject *parent) : QObject(parent) -{ - -} - diff --git a/dde-dock/src/controller/signalmanager.h b/dde-dock/src/controller/signalmanager.h deleted file mode 100644 index 7346bf75e..000000000 --- a/dde-dock/src/controller/signalmanager.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef SIGNALMANAGER_H -#define SIGNALMANAGER_H - -#include - -class SignalManager : public QObject -{ - Q_OBJECT -public: - static SignalManager *instance(); - -signals: - void requestAppIconUpdate(); - -private: - explicit SignalManager(QObject *parent = 0); - static SignalManager *m_signalManager; -}; - -#endif // SIGNALMANAGER_H diff --git a/dde-dock/src/controller/stylemanager.cpp b/dde-dock/src/controller/stylemanager.cpp deleted file mode 100644 index d3fb4a470..000000000 --- a/dde-dock/src/controller/stylemanager.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include "stylemanager.h" - -const QString GLOBAL_STYLE_PATH = "/usr/share/dde-dock/style/"; -const QString LOCAL_STYLE_PATH = QDir::homePath() + "/.config/deepin/dde-dock/style/"; -const QString CURRENT_STYLE_KEY = "CurrentStyle"; -const QString SEARCH_PATH_KEY = "StyleSearchPath"; - -StyleManager::StyleManager(QObject *parent) : QObject(parent) -{ - initSettings(); -} - -StyleManager *StyleManager::m_styleManager = NULL; -StyleManager *StyleManager::instance() -{ - if (m_styleManager == NULL) - m_styleManager = new StyleManager; - return m_styleManager; -} - -QStringList StyleManager::styleNameList() -{ - QStringList nameList; - nameList << "dark" << "light"; //default style - nameList << getStyleFromFilesystem(); - - return nameList; -} - -QString StyleManager::currentStyle() -{ - return m_settings->value(CURRENT_STYLE_KEY).toString(); -} - -void StyleManager::applyStyle(const QString &styleName) -{ - if (styleName == "dark" || styleName == "light") { - applyDefaultStyle(styleName); - } - else { - applyThirdPartyStyle(styleName); - } -} - -void StyleManager::initStyleSheet() -{ - applyStyle(currentStyle()); -} - -QStringList StyleManager::getStyleFromFilesystem() -{ - QStringList list; - for (QString path : m_settings->value(SEARCH_PATH_KEY).toStringList()) { - QDir d(path); - if (d.exists()) { //read all valuable style - QFileInfoList nl = d.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot |QDir::Readable); - for (QFileInfo p : nl) { - if (QFile::exists(p.absoluteFilePath() + "/style.qss")) - list << p.baseName(); - } - } - } - - return list; -} - -void StyleManager::initSettings() -{ - m_settings = new QSettings("deepin", "dde-dock"); - if (m_settings->value(CURRENT_STYLE_KEY).toString().isEmpty()) { - m_settings->setValue(CURRENT_STYLE_KEY, "dark"); - QStringList p; - p << GLOBAL_STYLE_PATH; - p << LOCAL_STYLE_PATH; - m_settings->setValue(SEARCH_PATH_KEY, QVariant(p)); - } -} - -void StyleManager::applyDefaultStyle(const QString &name) -{ - QString filePath = QString("://qss/resources/%1/qss/dde-dock.qss").arg(name); - QFile file(filePath); - if (file.open(QFile::ReadOnly)) { - QString styleSheet = QLatin1String(file.readAll()); - qApp->setStyleSheet(styleSheet); - file.close(); - } else { - qWarning() << "Dock Open style file errr!"; - } -} - -void StyleManager::applyThirdPartyStyle(const QString &name) -{ - QStringList sp = m_settings->value(SEARCH_PATH_KEY).toStringList(); - for (QString path : sp) { - QFile file(path + name + "/style.qss"); - if (file.open(QFile::ReadOnly)) { - QString styleSheet = QLatin1String(file.readAll()); - qApp->setStyleSheet(styleSheet); - file.close(); - return; - } else { - qWarning() << "Dock Open style file errr!"; - } - } -} - - diff --git a/dde-dock/src/controller/stylemanager.h b/dde-dock/src/controller/stylemanager.h deleted file mode 100644 index 2eb1db577..000000000 --- a/dde-dock/src/controller/stylemanager.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef STYLEMANAGER_H -#define STYLEMANAGER_H - -#include -#include - -class StyleManager : public QObject -{ - Q_OBJECT -public: - static StyleManager *instance(); - QStringList styleNameList(); - QString currentStyle(); - void applyStyle(const QString &styleName); - void initStyleSheet(); - -private: - explicit StyleManager(QObject *parent = 0); - QStringList getStyleFromFilesystem(); - void initSettings(); - void applyDefaultStyle(const QString &name); - void applyThirdPartyStyle(const QString &name); - -private: - static StyleManager *m_styleManager; - QSettings *m_settings; -}; - -#endif // STYLEMANAGER_H diff --git a/dde-dock/src/dbus/com.deepin.dde.Launcher.xml b/dde-dock/src/dbus/com.deepin.dde.Launcher.xml deleted file mode 100644 index 61cfc374f..000000000 --- a/dde-dock/src/dbus/com.deepin.dde.Launcher.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/dde-dock/src/dbus/com.deepin.dde.shutdownFront.xml b/dde-dock/src/dbus/com.deepin.dde.shutdownFront.xml deleted file mode 100644 index dd81029b2..000000000 --- a/dde-dock/src/dbus/com.deepin.dde.shutdownFront.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/dde-dock/src/dbus/dbusclientmanager.cpp b/dde-dock/src/dbus/dbusclientmanager.cpp deleted file mode 100644 index 0199965c0..000000000 --- a/dde-dock/src/dbus/dbusclientmanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusClientManager -p dbusclientmanager dde.dock.ClientManager.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 "dbusclientmanager.h" - -/* - * Implementation of interface class DBusClientManager - */ - -DBusClientManager::DBusClientManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusClientManager::~DBusClientManager() -{ -} - diff --git a/dde-dock/src/dbus/dbusclientmanager.h b/dde-dock/src/dbus/dbusclientmanager.h deleted file mode 100644 index 9e84dff1b..000000000 --- a/dde-dock/src/dbus/dbusclientmanager.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusClientManager -p dbusclientmanager dde.dock.ClientManager.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 DBUSCLIENTMANAGER_H_1435836676 -#define DBUSCLIENTMANAGER_H_1435836676 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.ClientManager - */ -class DBusClientManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/ClientManager"; } - static inline const char *staticInterfaceName() - { return "dde.dock.ClientManager"; } - -public: - DBusClientManager(QObject *parent = 0); - - ~DBusClientManager(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply ActiveWindow(uint in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("ActiveWindow"), argumentList); - } - - inline QDBusPendingReply CloseWindow(uint in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("CloseWindow"), argumentList); - } - - inline QDBusPendingReply CurrentActiveWindow() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("CurrentActiveWindow"), argumentList); - } - - inline QDBusPendingReply IsLauncherShown() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("IsLauncherShown"), argumentList); - } - - inline QDBusPendingReply<> ToggleShowDesktop() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("ToggleShowDesktop"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ActiveWindowChanged(uint in0); - void ShowingDesktopChanged(); -}; - -namespace dde { - namespace dock { - typedef ::DBusClientManager ClientManager; - } -} -#endif diff --git a/dde-dock/src/dbus/dbusdisplay.cpp b/dde-dock/src/dbus/dbusdisplay.cpp deleted file mode 100644 index 68401f993..000000000 --- a/dde-dock/src/dbus/dbusdisplay.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p DBusDisplay -c DBusDisplay com.deepin.daemon.Display.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 "dbusdisplay.h" - -/* - * Implementation of interface class DBusDisplay - */ - -DBusDisplay::DBusDisplay(QObject *parent) - : QDBusAbstractInterface(staticServiceName(), staticObjectPath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); - - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusDisplay::~DBusDisplay() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - - -QDBusArgument &operator<<(QDBusArgument &argument, const DisplayRect &rect) -{ - argument.beginStructure(); - argument << rect.x << rect.y << rect.width << rect.height; - argument.endStructure(); - return argument; -} - -const QDBusArgument &operator>>(const QDBusArgument &argument, DisplayRect &rect) -{ - argument.beginStructure(); - argument >> rect.x >> rect.y >> rect.width >> rect.height; - argument.endStructure(); - return argument; -} - -QDebug operator<<(QDebug deg, const DisplayRect &rect) -{ - qDebug() << "x:" << rect.x << "y:" << rect.y << "width:" << rect.width << "height:" << rect.height; - - return deg; -} - diff --git a/dde-dock/src/dbus/dbusdisplay.h b/dde-dock/src/dbus/dbusdisplay.h deleted file mode 100644 index 9e2feebc3..000000000 --- a/dde-dock/src/dbus/dbusdisplay.h +++ /dev/null @@ -1,238 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p displayinterface -c DisplayInterface com.deepin.daemon.Display.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 DBUSDISPLAY_H -#define DBUSDISPLAY_H - -#include -#include -#include -#include -#include -#include -#include -#include - -typedef QMap BrightnessMap; - -Q_DECLARE_METATYPE(BrightnessMap) - -struct DisplayRect{ - qint16 x; - qint16 y; - quint16 width; - quint16 height; - - operator QRect() const - { - return QRect(x, y, width, height); - } -}; - -Q_DECLARE_METATYPE(DisplayRect) - -QDBusArgument &operator<<(QDBusArgument &argument, const DisplayRect &rect); -const QDBusArgument &operator>>(const QDBusArgument &argument, DisplayRect &rect); -QDebug operator<<(QDebug deg, const DisplayRect &rect); - -/* - * Proxy class for interface com.deepin.daemon.Display - */ -class DBusDisplay: 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.daemon.Display") - return; - QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); - QStringList keys = changedProps.keys(); - foreach(const QString &prop, 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.daemon.Display"; } - static inline const char *staticServiceName() - { return "com.deepin.daemon.Display"; } - static inline const char *staticObjectPath() - { return "/com/deepin/daemon/Display"; } - -public: - DBusDisplay(QObject *parent = 0); - - ~DBusDisplay(); - - Q_PROPERTY(BrightnessMap Brightness READ brightness NOTIFY BrightnessChanged) - inline BrightnessMap brightness() const - { return qvariant_cast< BrightnessMap >(property("Brightness")); } - - Q_PROPERTY(QDBusObjectPath BuiltinOutput READ builtinOutput NOTIFY BuiltinOutputChanged) - inline QDBusObjectPath builtinOutput() const - { return qvariant_cast< QDBusObjectPath >(property("BuiltinOutput")); } - - Q_PROPERTY(short DisplayMode READ displayMode NOTIFY DisplayModeChanged) - inline short displayMode() const - { return qvariant_cast< short >(property("DisplayMode")); } - - Q_PROPERTY(bool HasChanged READ hasChanged NOTIFY HasChangedChanged) - inline bool hasChanged() const - { return qvariant_cast< bool >(property("HasChanged")); } - - Q_PROPERTY(QList Monitors READ monitors NOTIFY MonitorsChanged) - inline QList monitors() const - { return qvariant_cast< QList >(property("Monitors")); } - - Q_PROPERTY(QString Primary READ primary NOTIFY PrimaryChanged) - inline QString primary() const - { return qvariant_cast< QString >(property("Primary")); } - - Q_PROPERTY(DisplayRect PrimaryRect READ primaryRect NOTIFY PrimaryRectChanged) - inline DisplayRect primaryRect() const - { return qvariant_cast< DisplayRect >(property("PrimaryRect")); } - - Q_PROPERTY(ushort ScreenHeight READ screenHeight NOTIFY ScreenHeightChanged) - inline ushort screenHeight() const - { return qvariant_cast< ushort >(property("ScreenHeight")); } - - Q_PROPERTY(ushort ScreenWidth READ screenWidth NOTIFY ScreenWidthChanged) - inline ushort screenWidth() const - { return qvariant_cast< ushort >(property("ScreenWidth")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Apply() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Apply"), argumentList); - } - - inline QDBusPendingReply<> AssociateTouchScreen(const QString &in0, const QString &in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("AssociateTouchScreen"), argumentList); - } - - inline QDBusPendingReply<> ChangeBrightness(const QString &in0, double in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("ChangeBrightness"), argumentList); - } - - inline QDBusPendingReply<> JoinMonitor(const QString &in0, const QString &in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("JoinMonitor"), argumentList); - } - - inline QDBusPendingReply QueryCurrentPlanName() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("QueryCurrentPlanName"), argumentList); - } - - inline QDBusPendingReply QueryOutputFeature(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("QueryOutputFeature"), argumentList); - } - - inline QDBusPendingReply<> Reset() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Reset"), argumentList); - } - - inline QDBusPendingReply<> ResetBrightness(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("ResetBrightness"), argumentList); - } - - inline QDBusPendingReply<> ResetChanges() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("ResetChanges"), argumentList); - } - - inline QDBusPendingReply<> SaveChanges() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("SaveChanges"), argumentList); - } - - inline QDBusPendingReply<> SetBrightness(const QString &in0, double in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("SetBrightness"), argumentList); - } - - inline QDBusPendingReply<> SetPrimary(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetPrimary"), argumentList); - } - - inline QDBusPendingReply<> SplitMonitor(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SplitMonitor"), argumentList); - } - - inline QDBusPendingReply<> SwitchMode(short in0, const QString &in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("SwitchMode"), argumentList); - } - -Q_SIGNALS: // SIGNALS - //void PrimaryChanged(const QRect &in0); -// begin property changed signals -void BrightnessChanged(); -void BuiltinOutputChanged(); -void DisplayModeChanged(); -void HasChangedChanged(); -void MonitorsChanged(); -void PrimaryChanged(); -void PrimaryRectChanged(); -void ScreenHeightChanged(); -void ScreenWidthChanged(); -}; - -#endif diff --git a/dde-dock/src/dbus/dbusdockedappmanager.cpp b/dde-dock/src/dbus/dbusdockedappmanager.cpp deleted file mode 100644 index f9afe814a..000000000 --- a/dde-dock/src/dbus/dbusdockedappmanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockedAppManager -p dbusdockedappmanager dde.dock.DockedAppManager.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 "dbusdockedappmanager.h" - -/* - * Implementation of interface class DBusDockedAppManager - */ - -DBusDockedAppManager::DBusDockedAppManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusDockedAppManager::~DBusDockedAppManager() -{ -} - diff --git a/dde-dock/src/dbus/dbusdockedappmanager.h b/dde-dock/src/dbus/dbusdockedappmanager.h deleted file mode 100644 index 92775ea27..000000000 --- a/dde-dock/src/dbus/dbusdockedappmanager.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockedAppManager -p dbusdockedappmanager dde.dock.DockedAppManager.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 DBUSDOCKEDAPPMANAGER_H_1436925098 -#define DBUSDOCKEDAPPMANAGER_H_1436925098 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.DockedAppManager - */ -class DBusDockedAppManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/DockedAppManager"; } - static inline const char *staticInterfaceName() - { return "dde.dock.DockedAppManager"; } - -public: - DBusDockedAppManager(QObject *parent = 0); - - ~DBusDockedAppManager(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply Dock(const QString &in0, const QString &in1, const QString &in2, const QString &in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("Dock"), argumentList); - } - - inline QDBusPendingReply DockedAppList() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("DockedAppList"), argumentList); - } - - inline QDBusPendingReply IsDocked(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("IsDocked"), argumentList); - } - - inline QDBusPendingReply RequestDock(const QString &in0, const QString &in1, const QString &in2, const QString &in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("RequestDock"), argumentList); - } - - inline QDBusPendingReply RequestUndock(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("RequestUndock"), argumentList); - } - - inline QDBusPendingReply<> Sort(const QStringList &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("Sort"), argumentList); - } - - inline QDBusPendingReply Undock(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("Undock"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Docked(const QString &in0); - void Undocked(const QString &in0); -}; - -namespace dde { - namespace dock { - typedef ::DBusDockedAppManager DockedAppManager; - } -} -#endif diff --git a/dde-dock/src/dbus/dbusdockentry.cpp b/dde-dock/src/dbus/dbusdockentry.cpp deleted file mode 100644 index ea75d711f..000000000 --- a/dde-dock/src/dbus/dbusdockentry.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockEntry -p dbusdockentry dde.dock.entry.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(staticServerPath(), path, staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - 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 --git a/dde-dock/src/dbus/dbusdockentry.h b/dde-dock/src/dbus/dbusdockentry.h deleted file mode 100644 index 68c78b3dc..000000000 --- a/dde-dock/src/dbus/dbusdockentry.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockEntry -p dbusdockentry dde.dock.entry.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_1450418911 -#define DBUSDOCKENTRY_H_1450418911 - -#include -#include -#include -#include -#include -#include -#include -#include - -typedef QMap StringMap; -Q_DECLARE_METATYPE(StringMap) -/* - * 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 !="dde.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 *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfaceName() - { return "dde.dock.Entry"; } - -public: - DBusDockEntry(const QString &path, QObject *parent = 0); - - ~DBusDockEntry(); - - Q_PROPERTY(StringMap Data READ data NOTIFY DataChanged) - inline StringMap data() const - { return qvariant_cast< StringMap >(property("Data")); } - - Q_PROPERTY(QString Id READ id NOTIFY IdChanged) - inline QString id() const - { return qvariant_cast< QString >(property("Id")); } - - Q_PROPERTY(QString Type READ type NOTIFY TypeChanged) - inline QString type() const - { return qvariant_cast< QString >(property("Type")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply Activate(int in0, int in1, uint in2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList); - } - - inline QDBusPendingReply<> ContextMenu(int in0, int in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("ContextMenu"), argumentList); - } - - inline QDBusPendingReply<> HandleDragDrop(int in0, int in1, const QString &in2, uint in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("HandleDragDrop"), argumentList); - } - - inline QDBusPendingReply<> HandleDragEnter(int in0, int in1, const QString &in2, uint in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("HandleDragEnter"), argumentList); - } - - inline QDBusPendingReply<> HandleDragLeave(int in0, int in1, const QString &in2, uint in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("HandleDragLeave"), argumentList); - } - - inline QDBusPendingReply<> HandleDragOver(int in0, int in1, const QString &in2, uint in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("HandleDragOver"), argumentList); - } - - inline QDBusPendingReply<> HandleMenuItem(const QString &in0, uint in1) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("HandleMenuItem"), argumentList); - } - - inline QDBusPendingReply<> HandleMouseWheel(int in0, int in1, int in2, uint in3) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3); - return asyncCallWithArgumentList(QStringLiteral("HandleMouseWheel"), argumentList); - } - - inline QDBusPendingReply<> SecondaryActivate(int in0, int in1, uint in2) - { - QList argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - return asyncCallWithArgumentList(QStringLiteral("SecondaryActivate"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void DataChanged(const QString &in0, const QString &in1); -// begin property changed signals -//void DataChanged(); -void IdChanged(); -void TypeChanged(); -}; - -namespace dde { - namespace dock { - typedef ::DBusDockEntry Entry; - } -} -#endif diff --git a/dde-dock/src/dbus/dbusdocksetting.cpp b/dde-dock/src/dbus/dbusdocksetting.cpp deleted file mode 100644 index cd6a3cf2e..000000000 --- a/dde-dock/src/dbus/dbusdocksetting.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockSetting -p dbusdocksetting dde.dock.DockSetting.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 "dbusdocksetting.h" - -/* - * Implementation of interface class DBusDockSetting - */ - -DBusDockSetting::DBusDockSetting(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusDockSetting::~DBusDockSetting() -{ -} - diff --git a/dde-dock/src/dbus/dbusdocksetting.h b/dde-dock/src/dbus/dbusdocksetting.h deleted file mode 100644 index 0f274ebfd..000000000 --- a/dde-dock/src/dbus/dbusdocksetting.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDockSetting -p dbusdocksetting dde.dock.DockSetting.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 DBUSDOCKSETTING_H_1435836997 -#define DBUSDOCKSETTING_H_1435836997 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.DockSetting - */ -class DBusDockSetting: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/DockSetting"; } - static inline const char *staticInterfaceName() - { return "dde.dock.DockSetting"; } - -public: - DBusDockSetting(QObject *parent = 0); - - ~DBusDockSetting(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply GetClockType() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetClockType"), argumentList); - } - - inline QDBusPendingReply GetDisplayDate() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetDisplayDate"), argumentList); - } - - inline QDBusPendingReply GetDisplayMode() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetDisplayMode"), argumentList); - } - - inline QDBusPendingReply GetDisplayWeek() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetDisplayWeek"), argumentList); - } - - inline QDBusPendingReply GetHideMode() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetHideMode"), argumentList); - } - - inline QDBusPendingReply SetClockType(int in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetClockType"), argumentList); - } - - inline QDBusPendingReply SetDisplayDate(bool in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetDisplayDate"), argumentList); - } - - inline QDBusPendingReply SetDisplayMode(int in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetDisplayMode"), argumentList); - } - - inline QDBusPendingReply SetDisplayWeek(bool in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetDisplayWeek"), argumentList); - } - - inline QDBusPendingReply SetHideMode(int in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetHideMode"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ClockTypeChanged(int in0); - void DisplayDateChanged(bool in0); - void DisplayModeChanged(int in0); - void DisplayWeekChanged(bool in0); - void HideModeChanged(int in0); -}; - -namespace dde { - namespace dock { - typedef ::DBusDockSetting DockSetting; - } -} -#endif diff --git a/dde-dock/src/dbus/dbusentrymanager.cpp b/dde-dock/src/dbus/dbusentrymanager.cpp deleted file mode 100644 index c98ff4e19..000000000 --- a/dde-dock/src/dbus/dbusentrymanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusEntryManager -p dbusentrymanager dde.dock.EntryManager.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 "dbusentrymanager.h" - -/* - * Implementation of interface class DBusEntryManager - */ - -DBusEntryManager::DBusEntryManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusEntryManager::~DBusEntryManager() -{ -} - diff --git a/dde-dock/src/dbus/dbusentrymanager.h b/dde-dock/src/dbus/dbusentrymanager.h deleted file mode 100644 index 226a139f8..000000000 --- a/dde-dock/src/dbus/dbusentrymanager.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusEntryManager -p dbusentrymanager dde.dock.EntryManager.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 DBUSENTRYMANAGER_H_1435836026 -#define DBUSENTRYMANAGER_H_1435836026 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.EntryManager - */ -class DBusEntryManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/EntryManager"; } - static inline const char *staticInterfaceName() - { return "dde.dock.EntryManager"; } - -public: - DBusEntryManager(QObject *parent = 0); - - ~DBusEntryManager(); - - Q_PROPERTY(QList Entries READ entries) - inline QList entries() const - { return qvariant_cast< QList >(property("Entries")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Reorder(const QStringList &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("Reorder"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Added(const QDBusObjectPath &in0); - void Removed(const QString &in0); - void TrayInited(); -}; - -namespace dde { - namespace dock { - typedef ::DBusEntryManager EntryManager; - } -} -#endif diff --git a/dde-dock/src/dbus/dbushidestatemanager.cpp b/dde-dock/src/dbus/dbushidestatemanager.cpp deleted file mode 100644 index 6e608b2b1..000000000 --- a/dde-dock/src/dbus/dbushidestatemanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusHideStateManager -p dbushidestatemanager dde.dock.HideStateManager.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 "dbushidestatemanager.h" - -/* - * Implementation of interface class DBusHideStateManager - */ - -DBusHideStateManager::DBusHideStateManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusHideStateManager::~DBusHideStateManager() -{ -} - diff --git a/dde-dock/src/dbus/dbushidestatemanager.h b/dde-dock/src/dbus/dbushidestatemanager.h deleted file mode 100644 index 9590be30b..000000000 --- a/dde-dock/src/dbus/dbushidestatemanager.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusHideStateManager -p dbushidestatemanager dde.dock.HideStateManager.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 DBUSHIDESTATEMANAGER_H_1436862485 -#define DBUSHIDESTATEMANAGER_H_1436862485 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.HideStateManager - */ -class DBusHideStateManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/HideStateManager"; } - static inline const char *staticInterfaceName() - { return "dde.dock.HideStateManager"; } - -public: - DBusHideStateManager(QObject *parent = 0); - - ~DBusHideStateManager(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> CancelToggleShow() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("CancelToggleShow"), argumentList); - } - - inline QDBusPendingReply SetState(int in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetState"), argumentList); - } - - inline QDBusPendingReply<> ToggleShow() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("ToggleShow"), argumentList); - } - - inline QDBusPendingReply<> UpdateState() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("UpdateState"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ChangeState(int in0); -}; - -namespace dde { - namespace dock { - typedef ::DBusHideStateManager HideStateManager; - } -} -#endif diff --git a/dde-dock/src/dbus/dbuslauncher.cpp b/dde-dock/src/dbus/dbuslauncher.cpp deleted file mode 100644 index aacde6072..000000000 --- a/dde-dock/src/dbus/dbuslauncher.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncher -p dbuslauncher launcherinterface.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 "dbuslauncher.h" - - -ItemInfo::ItemInfo(){ - -} - -ItemInfo::~ItemInfo(){ - -} - -void ItemInfo::registerMetaType() -{ - qRegisterMetaType("ItemInfo"); - qDBusRegisterMetaType(); - qRegisterMetaType>("QMap"); - qDBusRegisterMetaType>(); - qRegisterMetaType>("QList"); - qDBusRegisterMetaType>(); -} - -QDBusArgument &operator<<(QDBusArgument &argument, const ItemInfo &obj) -{ - argument.beginStructure(); - argument << obj.url << obj.name; - argument << obj.key << obj.iconKey; - argument << obj.id << obj.intsalledTime; - - argument.endStructure(); - return argument; -} - - -const QDBusArgument &operator>>(const QDBusArgument &argument, ItemInfo &obj) -{ - argument.beginStructure(); - argument >> obj.url >> obj.name; - argument >> obj.key >> obj.iconKey; - argument >> obj.id >> obj.intsalledTime; - argument.endStructure(); - return argument; -} - -QDebug &operator <<(QDebug &debug, const ItemInfo &obj) -{ - debug << "LauncherItemInfo:" - << QString("[url:%1, name:%2, key:%3, iconKey:%4, id:%5, intsalledTime:%6, isAutoStart:%7, icon:%8]") - .arg(obj.url) - .arg(obj.name) - .arg(obj.key) - .arg(obj.iconKey) - .arg(obj.id) - .arg(obj.intsalledTime) - .arg(obj.isAutoStart) - .arg(obj.icon); - return debug; -} - -/* - * Implementation of interface class DBusLauncher - */ - -DBusLauncher::DBusLauncher(QObject *parent) - : QDBusAbstractInterface(staticServiceName(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - ItemInfo::registerMetaType(); - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusLauncher::~DBusLauncher() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock/src/dbus/dbuslauncher.h b/dde-dock/src/dbus/dbuslauncher.h deleted file mode 100644 index f92425544..000000000 --- a/dde-dock/src/dbus/dbuslauncher.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncher -p dbuslauncher launcherinterface.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 DBUSLAUNCHER_H_1443507634 -#define DBUSLAUNCHER_H_1443507634 - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -class ItemInfo -{ -public: - QString url; - QString name; - QString key; - QString iconKey; - qlonglong id; - qlonglong intsalledTime; - - /*add url*/ - bool isAutoStart=false; - QString icon; - - ItemInfo(); - ~ItemInfo(); - - friend QDebug &operator <<(QDebug &debug, const ItemInfo &obj); - - friend QDBusArgument &operator<<(QDBusArgument &argument, const ItemInfo &obj); - - friend const QDBusArgument &operator>>(const QDBusArgument &argument, ItemInfo &obj); - - static void registerMetaType(); -}; -Q_DECLARE_METATYPE(ItemInfo) -/* - * Proxy class for interface com.deepin.dde.daemon.Launcher - */ -class DBusLauncher: 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.Launcher") - 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.Launcher"; } - static inline const char *staticInterfacePath() - { return "/com/deepin/dde/daemon/Launcher"; } - static inline const char *staticServiceName() - { return "com.deepin.dde.daemon.Launcher"; } - -public: - DBusLauncher(QObject *parent = 0); - - ~DBusLauncher(); - - -Q_SIGNALS: // SIGNALS - void ItemChanged(const QString &in0, ItemInfo in1, qlonglong in2); - void UninstallFailed(const QString &in0, const QString &in1); - void UninstallSuccess(const QString &in0); -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace dde { - namespace daemon { - typedef ::DBusLauncher Launcher; - } - } - } -} -#endif diff --git a/dde-dock/src/dbus/dbuslaunchercontroller.cpp b/dde-dock/src/dbus/dbuslaunchercontroller.cpp deleted file mode 100644 index b2ecdc43e..000000000 --- a/dde-dock/src/dbus/dbuslaunchercontroller.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncherController -p dbuslaunchercontroller com.deepin.dde.Launcher.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 "dbuslaunchercontroller.h" - -/* - * Implementation of interface class DBusLauncherController - */ - -DBusLauncherController::DBusLauncherController(QObject *parent) - : QDBusAbstractInterface("com.deepin.dde.Launcher", "/com/deepin/dde/Launcher", staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusLauncherController::~DBusLauncherController() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/dde-dock/src/dbus/dbuslaunchercontroller.h b/dde-dock/src/dbus/dbuslaunchercontroller.h deleted file mode 100644 index 287231bcc..000000000 --- a/dde-dock/src/dbus/dbuslaunchercontroller.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusLauncherController -p dbuslaunchercontroller com.deepin.dde.Launcher.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 DBUSLAUNCHERCONTROLLER_H_1459390230 -#define DBUSLAUNCHERCONTROLLER_H_1459390230 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.dde.Launcher - */ -class DBusLauncherController: 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.Launcher") - 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.Launcher"; } - -public: - DBusLauncherController(QObject *parent = 0); - - ~DBusLauncherController(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Exit() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Exit"), argumentList); - } - - inline QDBusPendingReply<> Hide() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Hide"), argumentList); - } - - inline QDBusPendingReply<> Show() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Show"), argumentList); - } - - inline QDBusPendingReply<> ShowByMode(qlonglong in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("ShowByMode"), argumentList); - } - - inline QDBusPendingReply<> Toggle() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("Toggle"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Closed(); - void Shown(); -// begin property changed signals -}; - -namespace com { - namespace deepin { - namespace dde { - typedef ::DBusLauncherController Launcher; - } - } -} -#endif diff --git a/dde-dock/src/dbus/dbusmenu.cpp b/dde-dock/src/dbus/dbusmenu.cpp deleted file mode 100644 index 51ad7dcd8..000000000 --- a/dde-dock/src/dbus/dbusmenu.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusMenu -p dbusmenu com.deepin.menu.Menu.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 "dbusmenu.h" - -/* - * Implementation of interface class DBusMenu - */ - -DBusMenu::DBusMenu(const QString &path, QObject *parent) - : QDBusAbstractInterface(staticServerPath(), path, staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusMenu::~DBusMenu() -{ -} - diff --git a/dde-dock/src/dbus/dbusmenu.h b/dde-dock/src/dbus/dbusmenu.h deleted file mode 100644 index e338338cf..000000000 --- a/dde-dock/src/dbus/dbusmenu.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusMenu -p dbusmenu com.deepin.menu.Menu.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 DBUSMENU_H_1436158836 -#define DBUSMENU_H_1436158836 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.menu.Menu - */ -class DBusMenu: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.menu"; } - static inline const char *staticInterfaceName() - { return "com.deepin.menu.Menu"; } - -public: - DBusMenu(const QString &path,QObject *parent = 0); - - ~DBusMenu(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> SetItemActivity(const QString &itemId, bool isActive) - { - QList argumentList; - argumentList << QVariant::fromValue(itemId) << QVariant::fromValue(isActive); - return asyncCallWithArgumentList(QStringLiteral("SetItemActivity"), argumentList); - } - - inline QDBusPendingReply<> SetItemChecked(const QString &itemId, bool checked) - { - QList argumentList; - argumentList << QVariant::fromValue(itemId) << QVariant::fromValue(checked); - return asyncCallWithArgumentList(QStringLiteral("SetItemChecked"), argumentList); - } - - inline QDBusPendingReply<> SetItemText(const QString &itemId, const QString &text) - { - QList argumentList; - argumentList << QVariant::fromValue(itemId) << QVariant::fromValue(text); - return asyncCallWithArgumentList(QStringLiteral("SetItemText"), argumentList); - } - - inline QDBusPendingReply<> ShowMenu(const QString &menuJsonContent) - { - QList argumentList; - argumentList << QVariant::fromValue(menuJsonContent); - return asyncCallWithArgumentList(QStringLiteral("ShowMenu"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ItemInvoked(const QString &itemId, bool checked); - void MenuUnregistered(); -}; - -namespace com { - namespace deepin { - namespace menu { - typedef ::DBusMenu Menu; - } - } -} -#endif diff --git a/dde-dock/src/dbus/dbusmenumanager.cpp b/dde-dock/src/dbus/dbusmenumanager.cpp deleted file mode 100644 index 4f6e3d2e7..000000000 --- a/dde-dock/src/dbus/dbusmenumanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusMenuManager -p dbusmenumanager com.deepin.menu.Manager.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 "dbusmenumanager.h" - -/* - * Implementation of interface class DBusMenuManager - */ - -DBusMenuManager::DBusMenuManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusMenuManager::~DBusMenuManager() -{ -} - diff --git a/dde-dock/src/dbus/dbusmenumanager.h b/dde-dock/src/dbus/dbusmenumanager.h deleted file mode 100644 index 6e18347c0..000000000 --- a/dde-dock/src/dbus/dbusmenumanager.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusMenuManager -p dbusmenumanager com.deepin.menu.Manager.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 DBUSMENUMANAGER_H_1436158928 -#define DBUSMENUMANAGER_H_1436158928 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.deepin.menu.Manager - */ -class DBusMenuManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.menu"; } - static inline const char *staticInterfacePath() - { return "/com/deepin/menu"; } - static inline const char *staticInterfaceName() - { return "com.deepin.menu.Manager"; } - -public: - DBusMenuManager(QObject *parent = 0); - - ~DBusMenuManager(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply RegisterMenu() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("RegisterMenu"), argumentList); - } - - inline QDBusPendingReply<> UnregisterMenu(const QString &menuObjectPath) - { - QList argumentList; - argumentList << QVariant::fromValue(menuObjectPath); - return asyncCallWithArgumentList(QStringLiteral("UnregisterMenu"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace com { - namespace deepin { - namespace menu { - typedef ::DBusMenuManager Manager; - } - } -} -#endif diff --git a/dde-dock/src/dbus/dbuspanelmanager.cpp b/dde-dock/src/dbus/dbuspanelmanager.cpp deleted file mode 100644 index 55486e2e5..000000000 --- a/dde-dock/src/dbus/dbuspanelmanager.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusPanelManager -p dbuspanelmanager dde.dock.Property.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 "dbuspanelmanager.h" - -/* - * Implementation of interface class DBusPanelManager - */ - -DBusPanelManager::DBusPanelManager(QObject *parent) - : QDBusAbstractInterface(staticServerPath(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ -} - -DBusPanelManager::~DBusPanelManager() -{ -} - diff --git a/dde-dock/src/dbus/dbuspanelmanager.h b/dde-dock/src/dbus/dbuspanelmanager.h deleted file mode 100644 index 93299746a..000000000 --- a/dde-dock/src/dbus/dbuspanelmanager.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusPanelManager -p dbuspanelmanager dde.dock.Property.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 DBUSPANELMANAGER_H_1435837517 -#define DBUSPANELMANAGER_H_1435837517 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.Property - */ -class DBusPanelManager: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticServerPath() - { return "com.deepin.daemon.Dock"; } - static inline const char *staticInterfacePath() - { return "/dde/dock/Property"; } - static inline const char *staticInterfaceName() - { return "dde.dock.Property"; } - -public: - DBusPanelManager(QObject *parent = 0); - - ~DBusPanelManager(); - - Q_PROPERTY(int Height READ height) - inline int height() const - { return qvariant_cast< int >(property("Height")); } - - Q_PROPERTY(int PanelWidth READ panelWidth) - inline int panelWidth() const - { return qvariant_cast< int >(property("PanelWidth")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply SetPanelWidth(int in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("SetPanelWidth"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace dde { - namespace dock { - typedef ::DBusPanelManager Property; - } -} -#endif diff --git a/dde-dock/src/interfaces/dockconstants.h b/dde-dock/src/interfaces/dockconstants.h deleted file mode 100644 index 98c203f07..000000000 --- a/dde-dock/src/interfaces/dockconstants.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKCONSTANTS_H -#define DOCKCONSTANTS_H - -namespace Dock { - -enum DockMode { - FashionMode = 0, - EfficientMode = 1, - ClassicMode = 2 -}; - -enum HideMode { - KeepShowing = 0, - KeepHidden = 1, - SmartHide = 3 -}; - -enum HideState { - HideStateShowing = 0, - HideStateHiding = 1, - HideStateShown = 2, - HideStateHidden = 3 -}; - -//////////////// App //////////////////////////////// -const int APP_PREVIEW_WIDTH = 200; -const int APP_PREVIEW_HEIGHT = 124; -const int APP_PREVIEW_MARGIN = 20 ; -const int APP_PREVIEW_CLOSEBUTTON_SIZE = 26; - -const int APP_ITEM_FASHION_HEIGHT = 70; -const int APP_ITEM_FASHION_NORMAL_WIDTH = 48; -const int APP_ITEM_FASHION_ACTIVE_WIDTH = 48; -const int APP_ITEM_FASHION_SPACING = 3; -const int APP_ITEM_FASHION_ICON_SIZE = 48; - -const int APP_ITEM_EFFICIENT_HEIGHT = 48; -const int APP_ITEM_EFFICIENT_NORMAL_WIDTH = 64; -const int APP_ITEM_EFFICIENT_ACTIVE_WIDTH = 64; -const int APP_ITEM_EFFICIENT_SPACING = 4; -const int APP_ITEM_EFFICIENT_ICON_SIZE = 32; - -const int APP_ITEM_CLASSIC_HEIGHT = 36; -const int APP_ITEM_CLASSIC_NORMAL_WIDTH = 48; -const int APP_ITEM_CLASSIC_ACTIVE_WIDTH = 160; -const int APP_ITEM_CLASSIC_SPACING = 4; -const int APP_ITEM_CLASSIC_ICON_SIZE = 24; - -//////////////// APpplet //////////////////////////// -const int APPLET_FASHION_ITEM_HEIGHT = 48; -const int APPLET_FASHION_ITEM_WIDTH = 48; -const int APPLET_FASHION_ITEM_SPACING = 3; -const int APPLET_FASHION_ICON_SIZE = 48; - -const int APPLET_EFFICIENT_ITEM_HEIGHT = 16; -const int APPLET_EFFICIENT_ITEM_WIDTH = 16; -const int APPLET_EFFICIENT_ITEM_SPACING = 10; -const int APPLET_EFFICIENT_ICON_SIZE = 16; - -const int APPLET_CLASSIC_ITEM_HEIGHT = 16; -const int APPLET_CLASSIC_ITEM_WIDTH = 16; -const int APPLET_CLASSIC_ITEM_SPACING = 10; -const int APPLET_CLASSIC_ICON_SIZE = 16; - -///////////// Panel //////////////////////////////// -const int PANEL_FASHION_HEIGHT = 70; -const int PANEL_EFFICIENT_HEIGHT = 48; -const int PANEL_CLASSIC_HEIGHT = 36; - -} - -#endif // DOCKCONSTANTS_H diff --git a/dde-dock/src/interfaces/dockplugininterface.h b/dde-dock/src/interfaces/dockplugininterface.h deleted file mode 100644 index 8e3b38388..000000000 --- a/dde-dock/src/interfaces/dockplugininterface.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGININTERFACE_H -#define DOCKPLUGININTERFACE_H - -#include -#include -#include - -#include "dockconstants.h" - -class DockPluginProxyInterface; -class DockPluginInterface -{ -public: - enum InfoType{ - ItemSize,//Q_DECL_DEPRECATED - AppletSize,//Q_DECL_DEPRECATED - Title,//Q_DECL_DEPRECATED - CanDisable,//Q_DECL_DEPRECATED - InfoTypeItemSize, - InfoTypeAppletSize, - InfoTypeTitle, - InfoTypeEnable, - InfoTypeConfigurable - }; - - virtual ~DockPluginInterface() {} - - virtual QString getPluginName() = 0; - - virtual void init(DockPluginProxyInterface *proxy) = 0; - virtual void changeMode(Dock::DockMode newMode, Dock::DockMode oldMode) = 0; - - virtual QStringList ids() = 0; - virtual QString getName(QString id) = 0; - virtual QString getTitle(QString id) = 0; - virtual QString getCommand(QString id) = 0; - virtual QPixmap getIcon(QString id) {Q_UNUSED(id); return QPixmap("");} - virtual bool configurable(const QString &id) = 0; - virtual bool enabled(const QString &id) = 0; - virtual void setEnabled(const QString &id, bool enabled) = 0; - virtual QWidget * getItem(QString id) = 0; - virtual QWidget * getApplet(QString id) = 0; - virtual QString getMenuContent(QString id) = 0; - virtual void invokeMenuItem(QString id, QString itemId, bool checked) = 0; -}; - -QT_BEGIN_NAMESPACE - -#define DockPluginInterface_iid "org.deepin.Dock.PluginInterface" - -Q_DECLARE_INTERFACE(DockPluginInterface, DockPluginInterface_iid) - -QT_END_NAMESPACE - -#endif // DOCKPLUGININTERFACE_H diff --git a/dde-dock/src/interfaces/dockpluginproxyinterface.h b/dde-dock/src/interfaces/dockpluginproxyinterface.h deleted file mode 100644 index 4077b60ec..000000000 --- a/dde-dock/src/interfaces/dockpluginproxyinterface.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINPROXYINTERFACE_H -#define DOCKPLUGINPROXYINTERFACE_H - -#include - -#include "dockconstants.h" -#include "dockplugininterface.h" - -class DockPluginProxyInterface -{ -public: - virtual Dock::DockMode dockMode() = 0; - - virtual void itemAddedEvent(QString id) = 0; - virtual void itemRemovedEvent(QString id) = 0; - virtual void infoChangedEvent(DockPluginInterface::InfoType type, const QString &id) = 0; -}; - -#endif // DOCKPLUGINPROXYINTERFACE_H diff --git a/dde-dock/src/main.cpp b/dde-dock/src/main.cpp deleted file mode 100644 index 76d8cb618..000000000 --- a/dde-dock/src/main.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include - -#include -#include - -#include "mainwidget.h" -#include "Logger.h" -#include "controller/stylemanager.h" -#include "controller/signalmanager.h" - -#include - -#undef signals -extern "C" { - #include -} -#define signals public - -//#define ARCH_MIPSEL - -static void requrestUpdateIcons() -{ - //can not passing QObject to the callback function,so use signal - emit SignalManager::instance()->requestAppIconUpdate(); -} - -void initGtkThemeWatcher() -{ - GtkSettings* gs = gtk_settings_get_default(); - g_signal_connect(gs, "notify::gtk-icon-theme-name", - G_CALLBACK(requrestUpdateIcons), NULL); -} - -// let startdde know that we've already started. -void RegisterDdeSession() -{ - QString envName("DDE_SESSION_PROCESS_COOKIE_ID"); - - QByteArray cookie = qgetenv(envName.toUtf8().data()); - qunsetenv(envName.toUtf8().data()); - - if (!cookie.isEmpty()) { - QDBusInterface iface("com.deepin.SessionManager", - "/com/deepin/SessionManager", - "com.deepin.SessionManager", - QDBusConnection::sessionBus()); - iface.asyncCall("Register", QString(cookie)); - } -} - -DUTIL_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - DApplication a(argc, argv); - if (!a.setSingleInstance(QString("dde-dock_%1").arg(getuid()))) { - qDebug() << "set single instance failed!"; - return -1; - } - a.setOrganizationName("deepin"); - a.setApplicationName("dde-dock"); - a.setApplicationDisplayName("Dock"); - - // install translators - QTranslator translator; - translator.load("/usr/share/dde-dock/translations/dde-dock_" + QLocale::system().name()); - a.installTranslator(&translator); - - // translations from dde-control-center, used by those plugins provided by dde-control-center, - // but below lines should be moved to individual plugins in the future. - QTranslator translator1; - translator1.load("/usr/share/dde-control-center/translations/dde-control-center_" + QLocale::system().name()); - a.installTranslator(&translator1); - - DLogManager::registerConsoleAppender(); - DLogManager::registerFileAppender(); - dInfo()<< "LogFile:" << DLogManager::getlogFilePath(); - - QDBusConnection::sessionBus().registerService(DBUS_NAME); - RegisterDdeSession(); - - StyleManager::instance()->initStyleSheet(); - - MainWidget w; - qWarning() << "Start Dock, The main window has been shown."; - w.loadResources(); -//#ifndef ARCH_MIPSEL -// w.show(); -//#endif - - initGtkThemeWatcher(); - - return a.exec(); -} diff --git a/dde-dock/src/mainwidget.cpp b/dde-dock/src/mainwidget.cpp deleted file mode 100644 index ec08d6c48..000000000 --- a/dde-dock/src/mainwidget.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "mainwidget.h" -#include "xcb_misc.h" -#include "controller/stylemanager.h" -#include "dbus/dbuspanelmanager.h" - -#include - -// Keep it longer than dock show/hide animation duration. -const int UPDATE_STRUT_PARTIAL_DELAY = 350; - -const int ENTER_DELAY_INTERVAL = 200; -MainWidget::MainWidget(QWidget *parent) - : QWidget(parent), - m_dockProperty(new DBusPanelManager(this)) -{ - this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); - this->setAttribute(Qt::WA_TranslucentBackground); - //the attribute "Qt::WA_X11DoNotAcceptFocus" will not tack effect, not know the reason - //this->setAttribute(Qt::WA_X11DoNotAcceptFocus); - - initHideStateManager(); - - m_mainPanel = new DockPanel(this); - connect(m_mainPanel, &DockPanel::startShow, this, &MainWidget::showDock); - connect(m_mainPanel, &DockPanel::panelHasHidden, this, &MainWidget::hideDock); - connect(m_mainPanel, &DockPanel::sizeChanged, this, &MainWidget::onPanelSizeChanged); - - connect(m_dmd, &DockModeData::dockModeChanged, this, &MainWidget::onDockModeChanged); - connect(m_dmd, &DockModeData::hideModeChanged, this, &MainWidget::onHideModeChanged); - - //For init - m_display = new DBusDisplay(this); - m_windowStayRect = m_display->primaryRect(); - updateXcbStrutPartial(); - - m_positionUpdateTimer = new QTimer(this); - m_positionUpdateTimer->setSingleShot(true); - m_positionUpdateTimer->setInterval(100); - - DockUIDbus *dockUIDbus = new DockUIDbus(this); - Q_UNUSED(dockUIDbus) - - XcbMisc::instance()->set_window_type(winId(), XcbMisc::Dock); - - connect(m_display, &DBusDisplay::PrimaryRectChanged, this, &MainWidget::updateGeometry); - connect(m_display, &DBusDisplay::ScreenHeightChanged, this, &MainWidget::updateGeometry); - connect(m_display, &DBusDisplay::ScreenWidthChanged, this, &MainWidget::updateGeometry); - connect(m_positionUpdateTimer, &QTimer::timeout, this, &MainWidget::updatePosition); - - connect(m_mainPanel, &DockPanel::pluginsInitDone, this, &MainWidget::show); - - m_positionUpdateTimer->start(); -} - -void MainWidget::onDockModeChanged() -{ - // force update position twice - m_positionUpdateTimer->start(); - updateGeometry(); - updateBackendProperty(); -} - -void MainWidget::onHideModeChanged() -{ - updateGeometry(); -} - -// TODO: it should be named to `updateSize' instead I think. -void MainWidget::updatePosition() -{ - const QRect rec = m_windowStayRect; - - qDebug() << "update position with rect: " << rec; - - clearXcbStrutPartial(); - - const Dock::DockMode dockMode = m_dmd->getDockMode(); - const int w = dockMode == Dock::FashionMode ? m_mainPanel->sizeHint().width() : rec.width(); - if (dockMode != Dock::FashionMode) -// m_mainPanel->setFixedWidth(w); - m_mainPanel->onContentsSizeChanged(); - - if (m_hasHidden) { - //set height with 0 mean window is hidden,Windows manager will handle it's showing animation - this->setFixedSize(w, 1); - - this->move(rec.x() + (rec.width() - width()) / 2, - rec.y() + rec.height() - 1);//1 pixel for grab mouse enter event to show panel - } else { - this->setFixedSize(w, m_dmd->getDockHeight()); - - move(rec.x() + (rec.width() - width()) / 2, - rec.y() + rec.height() - height() /*- 10*/); - } - - if (dockMode == Dock::FashionMode) - updateBackendProperty(); - updateXcbStrutPartial(); -} - -void MainWidget::updateXcbStrutPartial() -{ - int tmpHeight = 0; - DBusDockSetting dds; - if (dds.GetHideMode() == Dock::KeepShowing) { - // qApp's screenHeight is wrong. its a bug, use dbus data instead. -// int maxMonitorHeight = qApp->desktop()->size().height(); -// int max = 0; -// for (QScreen *screen : qApp->screens()) -// { -// QRect screenRect = screen->geometry(); -// max = qMax(max, screenRect.y() + screenRect.height()); -// } - -// qDebug() << "max = " << max; - - int maxMonitorHeight = m_display->screenHeight(); - tmpHeight = maxMonitorHeight - y(); - } - - // sometimes screen height is wrong, we need to ignore wrong data. - if (tmpHeight && tmpHeight < m_dmd->getDockHeight()) { - return; - } - - // Set the strut partial to be full-width of the primary screen to - // avoid some strange bugs. - const QRect primaryRect = m_windowStayRect; - - XcbMisc::instance()->set_strut_partial(winId(), - XcbMisc::OrientationBottom, - tmpHeight, - primaryRect.x(), - primaryRect.x() + primaryRect.width()); -// The line below causes deepin-wm to regard dde-dock as a normal window -// while previewing windows. https://github.com/fasheng/arch-deepin/issues/249 - // this->setVisible(true); -} - -void MainWidget::clearXcbStrutPartial() -{ - XcbMisc::instance()->set_strut_partial(winId(), - XcbMisc::OrientationBottom, - 0, 0, 0); -} - -void MainWidget::updateBackendProperty() -{ - m_dockProperty->SetPanelWidth(width()); -} - -void MainWidget::updateGeometry() -{ - QRect primaryRect = m_display->primaryRect(); - - for (const QScreen *screen : qApp->screens()) { - if (screen->name() == m_display->primary()) { - primaryRect = screen->geometry(); - connect(screen, &QScreen::geometryChanged, this, &MainWidget::updateGeometry, Qt::UniqueConnection); - } else { - disconnect(screen, &QScreen::geometryChanged, this, &MainWidget::updateGeometry); - } - } - - m_windowStayRect = primaryRect; - m_positionUpdateTimer->start(); -} - -void MainWidget::move(const int ax, const int ay) -{ - QWidget::move(ax, ay); - -// qDebug() << "move to " << ax << ',' << ay; -} - -void MainWidget::initHideStateManager() -{ - m_dhsm = new DBusHideStateManager(this); - m_dhsm->SetState(Dock::HideStateHiding); -} - -void MainWidget::enterEvent(QEvent *) -{ - if (height() == 1) { - QTimer *st = new QTimer(this); - connect(st, &QTimer::timeout, this, [ = ] { - //make sure the panel will show by mouse-enter - if (geometry().contains(QCursor::pos())) - { - qDebug() << "MouseEntered, show dock..."; - emit m_mainPanel->startShow(); - } - sender()->deleteLater(); - }); - st->start(ENTER_DELAY_INTERVAL); - } -} - -void MainWidget::leaveEvent(QEvent *) -{ - if (!this->geometry().contains(QCursor::pos())) { - m_dhsm->UpdateState(); - } -} - -void MainWidget::showDock() -{ - m_hasHidden = false; - m_positionUpdateTimer->start(); -} - -void MainWidget::hideDock() -{ - m_hasHidden = true; - m_positionUpdateTimer->start(); -} - -void MainWidget::onPanelSizeChanged() -{ -// m_windowRectDelayApplyTimer->start(); - - if (m_dmd->getDockMode() != Dock::FashionMode) - return; - - const QRect rec = m_windowStayRect; - const int w = m_mainPanel->sizeHint().width(); - - if (m_hasHidden) { - //set height with 0 mean window is hidden,Windows manager will handle it's showing animation - this->setFixedSize(w, 1); - - this->move(rec.x() + (rec.width() - width()) / 2, - rec.y() + rec.height() - 1);//1 pixel for grab mouse enter event to show panel - } else { - this->setFixedSize(w, m_dmd->getDockHeight()); - - move(rec.x() + (rec.width() - width()) / 2, - rec.y() + rec.height() - height() /*- 10*/); - } -// setFixedWidth(m_mainPanel->sizeHint().width()); -// updatePosition(); -// updateGeometry(); -} - -MainWidget::~MainWidget() -{ - qDebug() << "dde-dock destroyed"; -} - -void MainWidget::loadResources() -{ - m_mainPanel->loadResources(); -} - -DockUIDbus::DockUIDbus(MainWidget *parent): - QDBusAbstractAdaptor(parent), - m_parent(parent) -{ - QDBusConnection::sessionBus().registerObject(DBUS_PATH, parent); -} - -DockUIDbus::~DockUIDbus() -{ - -} - -qulonglong DockUIDbus::Xid() -{ - return m_parent->winId(); -} - -QString DockUIDbus::currentStyleName() -{ - return StyleManager::instance()->currentStyle(); -} - -QStringList DockUIDbus::styleNameList() -{ - return StyleManager::instance()->styleNameList(); -} - -void DockUIDbus::applyStyle(const QString &styleName) -{ - StyleManager::instance()->applyStyle(styleName); -} diff --git a/dde-dock/src/mainwidget.h b/dde-dock/src/mainwidget.h deleted file mode 100644 index aad0d6248..000000000 --- a/dde-dock/src/mainwidget.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef MAINWIDGET_H -#define MAINWIDGET_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include "dbus/dbushidestatemanager.h" -#include "dbus/dbusdocksetting.h" -#include "dbus/dbusdisplay.h" -#include "controller/dockmodedata.h" -#include "panel/dockpanel.h" -#include "controller/plugins/dockpluginsmanager.h" - -const QString DBUS_PATH = "/com/deepin/dde/dock"; -const QString DBUS_NAME = "com.deepin.dde.dock"; - -class DockUIDbus; -class DBusPanelManager; -class MainWidget : public QWidget -{ - Q_OBJECT - -public: - MainWidget(QWidget *parent = 0); - ~MainWidget(); - void loadResources(); - -protected: - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - -private: - void hideDock(); - void onPanelSizeChanged(); - void onDockModeChanged(); - void onHideModeChanged(); - void initHideStateManager(); - -private slots: - void showDock(); - void updatePosition(); - void updateXcbStrutPartial(); - void clearXcbStrutPartial(); - void updateBackendProperty(); - void updateGeometry(); - -private: - void move(const int ax, const int ay); - -private: - DockPanel *m_mainPanel = NULL; - bool m_hasHidden = false; - QRect m_windowStayRect; - QTimer *m_positionUpdateTimer = nullptr; - DockModeData * m_dmd = DockModeData::instance(); - DBusHideStateManager *m_dhsm = NULL; - DBusDisplay *m_display = NULL; - DBusPanelManager *m_dockProperty = NULL; -}; - -class DockUIDbus : public QDBusAbstractAdaptor { - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.dock") - -public: - DockUIDbus(MainWidget* parent); - ~DockUIDbus(); - - Q_SLOT qulonglong Xid(); - Q_SLOT QString currentStyleName(); - Q_SLOT QStringList styleNameList(); - Q_SLOT void applyStyle(const QString &styleName); - -private: - MainWidget* m_parent; -}; - -#endif // MAINWIDGET_H diff --git a/dde-dock/src/panel/dockpanel.cpp b/dde-dock/src/panel/dockpanel.cpp deleted file mode 100644 index 1f93377ef..000000000 --- a/dde-dock/src/panel/dockpanel.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include - -#include "dockpanel.h" -#include "controller/dockmodedata.h" -#include "controller/stylemanager.h" - -const int REFLECTION_Y = 25; -const int REFLECTION_HEIGHT = 40; -const int FASHION_PANEL_LPADDING = 21; -const int FASHION_PANEL_RPADDING = 21; -const int SHOW_ANIMATION_DURATION = 300; -const int HIDE_ANIMATION_DURATION = 300; -const int DELAY_HIDE_PREVIEW_INTERVAL = 200; -const int DELAY_SHOW_PREVIEW_INTERVAL = 200; -const QEasingCurve SHOW_EASINGCURVE = QEasingCurve::OutCubic; -const QEasingCurve HIDE_EASINGCURVE = QEasingCurve::Linear; - -DockPanel::DockPanel(QWidget *parent) - : QLabel(parent) -{ - setObjectName("Panel"); - - initHideStateManager(); - initGlobalPreview(); - initShowHideAnimation(); - initPluginLayout(); - initAppLayout(); - initMainLayout(); - initReflection(); - - setMinimumHeight(m_dockModeData->getDockHeight()); //set height for border-image calculate - reloadStyleSheet(); - - connect(m_dockModeData, &DockModeData::dockModeChanged, this, &DockPanel::onDockModeChanged); - connect(this, &DockPanel::sizeChanged, this, &DockPanel::updateReflection); -} - -bool DockPanel::isFashionMode() -{ - return m_isFashionMode; -} - -void DockPanel::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::RightButton) - showPanelMenu(); -} - -void DockPanel::initShowHideAnimation() -{ -// QStateMachine * machine = new QStateMachine(this); - -// QState * showState = new QState(machine); -// showState->assignProperty(this,"y", 0); -// QState * hideState = new QState(machine); - //y should change with DockMode changed -// connect(this, &DockPanel::startHide, [&]{ -// hideState->assignProperty(this,"y", m_dockModeData->getDockHeight()); -// }); -// machine->setInitialState(showState); - - QPropertyAnimation *showAnimation = new QPropertyAnimation(this, "y"); - showAnimation->setDuration(SHOW_ANIMATION_DURATION); - showAnimation->setEasingCurve(SHOW_EASINGCURVE); - connect(showAnimation,&QPropertyAnimation::finished,this,&DockPanel::onShowPanelFinished); - connect(showAnimation, &QPropertyAnimation::stateChanged, this, &DockPanel::changeItemHoverable); - - QPropertyAnimation *hideAnimation = new QPropertyAnimation(this, "y"); - hideAnimation->setDuration(HIDE_ANIMATION_DURATION); - hideAnimation->setEasingCurve(HIDE_EASINGCURVE); - connect(hideAnimation,&QPropertyAnimation::finished,this,&DockPanel::onHidePanelFinished); - connect(hideAnimation, &QPropertyAnimation::stateChanged, this, &DockPanel::changeItemHoverable); - - connect(this, &DockPanel::startHide, [=] { - hideAnimation->setStartValue(0); - hideAnimation->setEndValue(m_dockModeData->getDockHeight()); - hideAnimation->start(); - }); - - connect(this, &DockPanel::startShow, [=] { - showAnimation->setStartValue(m_dockModeData->getDockHeight()); - showAnimation->setEndValue(0); - showAnimation->start(); - }); - -// connect(this, &DockPanel::startHide, [hideAnimation] {hideAnimation->start();}); - -// QSignalTransition *st = showState->addTransition(this,SIGNAL(startHide()), hideState); -// st->addAnimation(hideAnimation); -// connect(this, &DockPanel::startShow, [this] {qDebug() << "Ccc";}); -// QSignalTransition *ht = hideState->addTransition(this,SIGNAL(startShow()), showState); -// ht->addAnimation(showAnimation); - -// machine->start(); -} - -void DockPanel::initHideStateManager() -{ - m_HSManager = new DBusHideStateManager(this); - connect(m_HSManager,&DBusHideStateManager::ChangeState, this, &DockPanel::onHideStateChanged); - - //for initialization - m_HSManager->UpdateState(); -} - -void DockPanel::initPluginLayout() -{ - m_pluginLayout = new DockPluginLayout(this); - m_pluginLayout->setAutoResize(true); - m_pluginLayout->resize(0, m_dockModeData->getAppletsItemHeight()); - m_pluginLayout->setLayoutSpacing(m_dockModeData->getAppletsItemSpacing()); - - connect(m_pluginLayout, &DockPluginLayout::sizeChanged, this, &DockPanel::onContentsSizeChanged); - connect(m_pluginLayout, &DockPluginLayout::needPreviewShow, this, &DockPanel::onNeedPreviewShow); - connect(m_pluginLayout, &DockPluginLayout::needPreviewHide, this, &DockPanel::onNeedPreviewHide); - connect(m_pluginLayout, &DockPluginLayout::needPreviewUpdate, this, &DockPanel::onNeedPreviewUpdate); - connect(m_pluginLayout, &DockPluginLayout::pluginsInitDone, this, &DockPanel::pluginsInitDone, Qt::QueuedConnection); -} - -void DockPanel::initAppLayout() -{ - m_appLayout = new DockAppLayout(this); - m_appLayout->setAutoResize(m_dockModeData->getDockMode() == Dock::FashionMode); - m_appLayout->resize(0, m_dockModeData->getItemHeight()); - m_appLayout->setLayoutSpacing(m_dockModeData->getAppItemSpacing()); - - connect(m_appLayout, &DockAppLayout::sizeChanged, this, &DockPanel::onContentsSizeChanged); - connect(m_appLayout, &DockAppLayout::needPreviewShow, this, &DockPanel::onNeedPreviewShow); - connect(m_appLayout, &DockAppLayout::needPreviewHide, this, &DockPanel::onNeedPreviewHide); - connect(m_appLayout, &DockAppLayout::needPreviewUpdate, this, &DockPanel::onNeedPreviewUpdate); -} - -void DockPanel::initMainLayout() -{ - QHBoxLayout *mLayout = new QHBoxLayout(this); - mLayout->setSpacing(0); - mLayout->setContentsMargins(0, 0, 0, 0); - m_launcherItem = new DockLauncherItem(); - mLayout->addWidget(m_launcherItem, 0, Qt::AlignTop); - mLayout->addSpacing(m_dockModeData->getAppItemSpacing()); - mLayout->addWidget(m_appLayout, 0, Qt::AlignTop); - mLayout->addSpacing(8); - mLayout->addWidget(m_pluginLayout, 0, Qt::AlignTop); - - //for init - onDockModeChanged(m_dockModeData->getDockMode(), m_dockModeData->getDockMode()); -} - -void DockPanel::initReflection() -{ - m_launcherReflection = new ReflectionEffect(m_launcherItem, this); - m_pluginReflection = new ReflectionEffect(m_pluginLayout, this); - m_appReflection = new ReflectionEffect(m_appLayout, this); -} - -void DockPanel::initGlobalPreview() -{ - m_globalPreview = new PreviewWindow(DArrowRectangle::ArrowBottom); - - //make sure all app-preview will be destroy to save resources - connect(m_globalPreview, &PreviewWindow::showFinish, [=] (QWidget *lastContent) { - if (lastContent) { - AppPreviewsContainer *tmpFrame = qobject_cast(lastContent); - if (tmpFrame) - tmpFrame->clearUpPreview(); - } - }); - connect(m_globalPreview, &PreviewWindow::hideFinish, [=] (QWidget *lastContent) { - m_HSManager->UpdateState(); - if (lastContent) { - AppPreviewsContainer *tmpFrame = qobject_cast(lastContent); - if (tmpFrame) - tmpFrame->clearUpPreview(); - } - }); - connect(m_globalPreview, &PreviewWindow::previewFrameHided, m_HSManager, &DBusHideStateManager::UpdateState); -} - -void DockPanel::onDockModeChanged(Dock::DockMode, Dock::DockMode) -{ - reloadStyleSheet(); - - m_pluginLayout->setLayoutSpacing(m_dockModeData->getAppletsItemSpacing()); - m_pluginLayout->setFixedHeight(m_dockModeData->getItemHeight()); - QHBoxLayout *mLayout = qobject_cast(layout()); - if (m_dockModeData->getDockMode() == Dock::FashionMode) { - mLayout->setAlignment(m_pluginLayout, Qt::AlignTop); - m_pluginLayout->setAlignment(Qt::AlignTop); - } - else { - mLayout->setAlignment(m_pluginLayout, Qt::AlignVCenter); - m_pluginLayout->setAlignment(Qt::AlignVCenter); - } - - // interval 0 stands for timeout will be triggered on idle. - QTimer::singleShot(0, m_appLayout, SLOT(updateItemWidths())); - QTimer::singleShot(0, m_appLayout, SLOT(updateWindowIconGeometries())); -} - -void DockPanel::onHideStateChanged(int dockState) -{ - bool containsMouse = parentWidget()->geometry().contains(QCursor::pos()); - - if (dockState == Dock::HideStateShowing) { - emit startShow(); - } else if (dockState == Dock::HideStateHiding && !containsMouse && !m_globalPreview->isVisible()) { - emit startHide(); - } -} - -void DockPanel::onShowPanelFinished() -{ - //dbus的ToggleShow接口会在判断时把HideStateShown对应的切换到HideStateShowing导致一直没法再切换 - m_dockModeData->setHideState(Dock::HideStateHiding); - emit panelHasShown(); -} - -void DockPanel::onHidePanelFinished() -{ - m_dockModeData->setHideState(Dock::HideStateHidden); - emit panelHasHidden(); -} - -void DockPanel::onNeedPreviewHide(bool immediately) -{ - int interval = immediately ? 0 : DELAY_HIDE_PREVIEW_INTERVAL; - m_globalPreview->hidePreview(interval); -} - -void DockPanel::onNeedPreviewShow(DockItem *item, const QPoint &pos) -{ - if (item && item->getApplet()) { - m_lastPreviewPos = pos; - m_globalPreview->setArrowX(-1);//reset x to move arrow to horizontal-center - m_globalPreview->setContent(item->getApplet()); - m_globalPreview->showPreview(pos.x(), - pos.y() + m_globalPreview->shadowBlurRadius() + m_globalPreview->shadowDistance(), - DELAY_SHOW_PREVIEW_INTERVAL); - } -} - -void DockPanel::onNeedPreviewUpdate() -{ - if (!m_globalPreview->isVisible()) - return; - m_globalPreview->resizeWithContent(); - m_globalPreview->showPreview(m_lastPreviewPos.x(), - m_lastPreviewPos.y() + m_globalPreview->shadowBlurRadius() + m_globalPreview->shadowDistance(), - DELAY_SHOW_PREVIEW_INTERVAL); -} - -void DockPanel::onContentsSizeChanged() -{ - if (m_dockModeData->getDockMode() == Dock::FashionMode) { - m_appLayout->setAutoResize(true); - m_appLayout->update(); - } - else { - DisplayRect rec = getScreenRect(); - m_appLayout->setAutoResize(false); - - m_appLayout->setFixedSize(rec.width - m_pluginLayout->width() - m_launcherItem->width(), m_dockModeData->getItemHeight()); - } - m_appLayout->updateWindowIconGeometries(); - - setFixedSize(sizeHint().width(), m_dockModeData->getDockHeight()); - emit sizeChanged(); -} - -void DockPanel::changeItemHoverable(QAbstractAnimation::State state) -{ - bool v = true; - switch (state) { - case QAbstractAnimation::Running: - v = false; - break; - case QAbstractAnimation::Paused: - case QAbstractAnimation::Stopped: - v = true; - break; - default: - break; - } - - m_launcherItem->setHoverable(v); - m_appLayout->itemHoverableChange(v); - m_pluginLayout->itemHoverableChange(v); -} - -void DockPanel::reloadStyleSheet() -{ - m_isFashionMode = m_dockModeData->getDockMode() == Dock::FashionMode; - - // INFO: 这里用 unpolish/polish 会出现只有部分 qss 起作用的情况,必须重新加载所有 qss - StyleManager::instance()->initStyleSheet(); - -// style()->unpolish(this); -// style()->polish(this); // force a stylesheet recomputation -} - -void DockPanel::showPanelMenu() -{ - QPoint tmpPos = QCursor::pos(); - - PanelMenu::instance()->showMenu(tmpPos.x(),tmpPos.y()); -} - -void DockPanel::updateReflection() -{ - if (m_dockModeData->getDockMode() == Dock::FashionMode) { - m_launcherReflection->setVisible(true); - m_launcherReflection->setFixedSize(m_launcherItem->width(), REFLECTION_HEIGHT); - m_launcherReflection->move(m_launcherItem->x(), REFLECTION_Y); - m_launcherReflection->updateReflection(); - - m_appReflection->setVisible(true); - m_appReflection->setFixedSize(m_appLayout->width(), REFLECTION_HEIGHT); - m_appReflection->move(m_appLayout->x(), REFLECTION_Y); - m_appReflection->updateReflection(); - - m_pluginReflection->setVisible(true); - m_pluginReflection->setFixedSize(m_pluginLayout->width(), REFLECTION_HEIGHT); - m_pluginReflection->move(m_pluginLayout->x(), REFLECTION_Y); - m_pluginReflection->updateReflection(); - } - else { - m_launcherReflection->setVisible(false); - m_pluginReflection->setVisible(false); - m_appReflection->setVisible(false); - } -} - -void DockPanel::loadResources() -{ - m_appLayout->initEntries(); - m_pluginLayout->initAllPlugins(); -} - -QSize DockPanel::sizeHint() const -{ - int w = m_appLayout->width() + m_pluginLayout->width() + m_launcherItem->width(); - int h = m_appLayout->height() + m_pluginLayout->height() + m_launcherItem->height(); - if (m_dockModeData->getDockMode() == Dock::FashionMode) { - w = w + FASHION_PANEL_LPADDING + FASHION_PANEL_RPADDING; - } - - return QSize(w, h); -} - -void DockPanel::setY(int value) -{ - move(x(), value); -} - -DisplayRect DockPanel::getScreenRect() -{ - DBusDisplay d; - return d.primaryRect(); -} - -DockPanel::~DockPanel() -{ - -} diff --git a/dde-dock/src/panel/dockpanel.h b/dde-dock/src/panel/dockpanel.h deleted file mode 100644 index 48d47ff75..000000000 --- a/dde-dock/src/panel/dockpanel.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPANEL_H -#define DOCKPANEL_H - -#include - -#include "dbus/dbushidestatemanager.h" -#include "controller/dockmodedata.h" -#include "widgets/launcher/docklauncheritem.h" -#include "widgets/plugin/dockpluginlayout.h" -#include "widgets/app/dockapplayout.h" -#include "widgets/reflectioneffect.h" -#include "widgets/previewwindow.h" -#include "dbus/dbusdisplay.h" -#include "panelmenu.h" - -class LayoutDropMask; -class DockPanel : public QLabel -{ - Q_OBJECT - Q_PROPERTY(int y READ y WRITE setY) - Q_PROPERTY(bool isFashionMode READ isFashionMode) - Q_PROPERTY(int width READ width WRITE setFixedWidth) - -public: - explicit DockPanel(QWidget *parent = 0); - ~DockPanel(); - - bool isFashionMode(); //for qss setting background - void loadResources(); - QSize sizeHint() const; - void onContentsSizeChanged(); - -signals: - void startShow(); - void startHide(); - void panelHasShown(); - void panelHasHidden(); - void sizeChanged(); - void pluginsInitDone(); - -protected: - void mousePressEvent(QMouseEvent *event); - -private: - void initShowHideAnimation(); - void initHideStateManager(); - void initPluginLayout(); - void initAppLayout(); - void initMainLayout(); - void initReflection(); - void initGlobalPreview(); - - void onDockModeChanged(Dock::DockMode, Dock::DockMode); - void onHideStateChanged(int dockState); - void onShowPanelFinished(); - void onHidePanelFinished(); - void onNeedPreviewHide(bool immediately); - void onNeedPreviewShow(DockItem *item, const QPoint &pos); - void onNeedPreviewUpdate(); - - void changeItemHoverable(QAbstractAnimation::State state); - void reloadStyleSheet(); - void setY(int value); //for hide and show animation - void showPanelMenu(); - void updateReflection(); - - DisplayRect getScreenRect(); - -private: - QPoint m_lastPreviewPos; - PreviewWindow *m_globalPreview = NULL; - DBusHideStateManager *m_HSManager = NULL; - DockModeData *m_dockModeData = DockModeData::instance(); - DockLauncherItem *m_launcherItem = NULL; - DockPluginLayout *m_pluginLayout = NULL; - DockAppLayout *m_appLayout = NULL; - ReflectionEffect *m_launcherReflection; - ReflectionEffect *m_pluginReflection; - ReflectionEffect *m_appReflection; - - bool m_isFashionMode = false; -}; - -#endif // DOCKPANEL_H diff --git a/dde-dock/src/panel/panelmenu.cpp b/dde-dock/src/panel/panelmenu.cpp deleted file mode 100644 index c2a1f5b8e..000000000 --- a/dde-dock/src/panel/panelmenu.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "panelmenu.h" - - -PanelMenu * PanelMenu::m_panelMenu = NULL; -PanelMenu * PanelMenu::instance() -{ - if (!m_panelMenu) - m_panelMenu = new PanelMenu(); - return m_panelMenu; -} - -PanelMenu::PanelMenu(QObject *parent) : QObject(parent) -{ - m_menuManager = new DBusMenuManager(this); -} - -void PanelMenu::showMenu(int x, int y) -{ - if (m_menuManager && m_menuManager->isValid()){ - QDBusPendingReply pr = m_menuManager->RegisterMenu(); - if (pr.count() == 1) - { - QDBusObjectPath op = pr.argumentAt(0).value(); - m_menuInterfacePath = op.path(); - DBusMenu *m_menu = new DBusMenu(m_menuInterfacePath,this); - connect(m_menu,&DBusMenu::MenuUnregistered,m_menu,&DBusMenu::deleteLater); - connect(m_menu,&DBusMenu::ItemInvoked,this,&PanelMenu::onItemInvoked); - - QJsonObject targetObj; - targetObj.insert("x",QJsonValue(x)); - targetObj.insert("y",QJsonValue(y)); - targetObj.insert("isDockMenu",QJsonValue(false)); - - QJsonArray contentArry; - contentArry.append(createRadioItemObj(tr("Fashion mode"),ToFashionMode,DockModeGroup,m_dockModeData->getDockMode() == Dock::FashionMode)); - contentArry.append(createRadioItemObj(tr("Efficient mode"),ToEfficientMode,DockModeGroup,m_dockModeData->getDockMode() == Dock::EfficientMode)); - contentArry.append(createRadioItemObj(tr("Classic mode"),ToClassicMode,DockModeGroup,m_dockModeData->getDockMode() == Dock::ClassicMode)); - contentArry.append(createItemObj("",OperationType(-1))); - contentArry.append(createRadioItemObj(tr("Keep showing"),ToKeepShowing,HideModeGroup,m_dockModeData->getHideMode() == Dock::KeepShowing)); - contentArry.append(createRadioItemObj(tr("Keep hidden"),ToKeepHidden,HideModeGroup,m_dockModeData->getHideMode() == Dock::KeepHidden)); - contentArry.append(createRadioItemObj(tr("Smart hide"),ToSmartHide,HideModeGroup,m_dockModeData->getHideMode() == Dock::SmartHide)); - contentArry.append(createItemObj("",OperationType(-1))); - contentArry.append(createItemObj(tr("Notification area settings"),ToPluginSetting)); - - QJsonObject contentObj; - contentObj.insert("items",contentArry); - targetObj.insert("menuJsonContent",QString(QJsonDocument(contentObj).toJson())); - - m_menu->ShowMenu(QString(QJsonDocument(targetObj).toJson())); - } - } -} - -void PanelMenu::onItemInvoked(const QString &itemId, bool) -{ - emit menuItemInvoked(); - - if (itemId.split(":").length() < 1) - return; - - OperationType tt = OperationType(itemId.split(":").at(0).toInt()); - switch (tt) - { - case ToFashionMode: - changeToFashionMode(); - break; - case ToEfficientMode: - changeToEfficientMode(); - break; - case ToClassicMode: - changeToClassicMode(); - break; - case ToKeepShowing: - changeToKeepShowing(); - break; - case ToKeepHidden: - changeToKeepHidden(); - break; - case ToSmartHide: - changeToSmartHide(); - break; - case ToPluginSetting: - emit settingPlugin(); - break; - default: - break; - } - -} - -void PanelMenu::changeToFashionMode() -{ - qDebug() << "Change to fashion mode..."; - m_dockModeData->setDockMode(Dock::FashionMode); -} - -void PanelMenu::changeToEfficientMode() -{ - qDebug() << "Change to efficient mode..."; - m_dockModeData->setDockMode(Dock::EfficientMode); -} - -void PanelMenu::changeToClassicMode() -{ - qDebug() << "Change to classic mode..."; - m_dockModeData->setDockMode(Dock::ClassicMode); -} - -void PanelMenu::changeToKeepShowing() -{ - qDebug() << "Change to keep showing mode..."; - m_dockModeData->setHideMode(Dock::KeepShowing); -} - -void PanelMenu::changeToKeepHidden() -{ - qDebug() << "Change to keep hidden mode..."; - m_dockModeData->setHideMode(Dock::KeepHidden); -} - -void PanelMenu::changeToSmartHide() -{ - qDebug() << "Change to smart hide mode..."; - m_dockModeData->setHideMode(Dock::SmartHide); -} - -QJsonObject PanelMenu::createItemObj(const QString &itemName, OperationType type) -{ - QJsonObject itemObj; - itemObj.insert("itemId",QString::number(type)); - itemObj.insert("itemText",itemName); - itemObj.insert("itemIcon",""); - itemObj.insert("itemIconHover",""); - itemObj.insert("itemIconInactive",""); - itemObj.insert("itemExtra",""); - itemObj.insert("isActive",true); - itemObj.insert("checked",false); - itemObj.insert("itemSubMenu",QJsonObject()); - - return itemObj; -} - -QJsonObject PanelMenu::createRadioItemObj(const QString &itemName, OperationType type, MenuGroup group, bool check) -{ - QJsonObject itemObj; - itemObj.insert("itemId",QString::number(type) + ":radio:" + QString::number(group)); - itemObj.insert("itemText",itemName); - itemObj.insert("itemIcon",""); - itemObj.insert("itemIconHover",""); - itemObj.insert("itemIconInactive",""); - itemObj.insert("itemExtra",""); - itemObj.insert("isActive",true); - itemObj.insert("checked",check); - itemObj.insert("itemSubMenu",QJsonObject()); - - return itemObj; -} diff --git a/dde-dock/src/panel/panelmenu.h b/dde-dock/src/panel/panelmenu.h deleted file mode 100644 index 21216305f..000000000 --- a/dde-dock/src/panel/panelmenu.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef PANELMENU_H -#define PANELMENU_H - -#include -#include -#include -#include -#include -#include - -#include "dbus/dbusmenumanager.h" -#include "dbus/dbusmenu.h" -#include "controller/dockmodedata.h" -#include "interfaces/dockconstants.h" - -class PanelMenu : public QObject -{ - Q_OBJECT -public: - enum OperationType { - ToFashionMode, - ToEfficientMode, - ToClassicMode, - ToKeepShowing, - ToKeepHidden, - ToSmartHide, - ToPluginSetting - }; - enum MenuGroup{ - DockModeGroup, - HideModeGroup - }; - - static PanelMenu * instance(); - - void showMenu(int x,int y); - -signals: - void settingPlugin(); - void menuItemInvoked(); - -private: - explicit PanelMenu(QObject *parent = 0); - - void changeToFashionMode(); - void changeToEfficientMode(); - void changeToClassicMode(); - void changeToKeepShowing(); - void changeToKeepHidden(); - void changeToSmartHide(); - - void onItemInvoked(const QString &itemId, bool result); - - QJsonObject createItemObj(const QString &itemName, OperationType type); - QJsonObject createRadioItemObj(const QString &itemName, OperationType type, MenuGroup group, bool check); - -private: - static PanelMenu * m_panelMenu; - QString m_menuInterfacePath = ""; - DBusDockSetting m_dockSetting; - DBusMenuManager *m_menuManager = NULL; - DockModeData *m_dockModeData = DockModeData::instance(); - -}; - -#endif // PANELMENU_H diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewloader.cpp b/dde-dock/src/widgets/app/apppreview/apppreviewloader.cpp deleted file mode 100644 index d62c47828..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewloader.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include "apppreviewloader.h" - -static cairo_status_t cairo_write_func (void *widget, const unsigned char *data, unsigned int length) -{ - AppPreviewLoader * wp = (AppPreviewLoader *)widget; - - wp->imageData.append((const char *) data, length); - - return CAIRO_STATUS_SUCCESS; -} - -class Monitor : public QAbstractNativeEventFilter -{ -public: - Monitor(AppPreviewLoader * wp) : - QAbstractNativeEventFilter(), - m_wp(wp) - { - xcb_connection_t *c = QX11Info::connection(); - xcb_prefetch_extension_data(c, &xcb_damage_id); - const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); - m_damageEventBase = reply->first_event; - if (reply->present) { - xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); - } - - m_damage = xcb_generate_id(c); - xcb_damage_create(c, m_damage, wp->m_sourceWindow, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES); - } - - ~Monitor () - { - xcb_connection_t *c = QX11Info::connection(); - xcb_damage_destroy(c, m_damage); - } - - bool nativeEventFilter(const QByteArray &eventType, void *message, long *) - { - //only draw once data to save computing resources - if (m_wp->imageData.isEmpty() && eventType=="xcb_generic_event_t") { - xcb_generic_event_t *event = static_cast(message); - const uint8_t responseType = event->response_type & ~0x80; - - if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { - auto *ev = reinterpret_cast(event); - - if (m_wp && m_wp->m_sourceWindow == ev->drawable) { - m_wp->prepareRepaint(); - } - } else if (responseType == XCB_CONFIGURE_NOTIFY) { - auto *ev = reinterpret_cast(event); - - if (m_wp && m_wp->m_sourceWindow == ev->window) { - m_wp->prepareRepaint(); - } - } - } - return false; - } - -private: - AppPreviewLoader * m_wp; - int m_damageEventBase; - int m_damage; -}; - -AppPreviewLoader::AppPreviewLoader(WId sourceWindow, QWidget *parent) - : QFrame(parent), - m_sourceWindow(sourceWindow), - m_monitor(NULL) -{ - setObjectName("WindowPreview"); - - setAttribute(Qt::WA_TransparentForMouseEvents); - -// prepareRepaint(); - - installMonitor(); -} - -AppPreviewLoader::~AppPreviewLoader() -{ - removeMonitor(); -} - -void AppPreviewLoader::paintEvent(QPaintEvent *) -{ - QPainter painter; - painter.begin(this); - - QImage image = QImage::fromData(imageData, "PNG"); - QPixmap pixmap = QPixmap::fromImage(image); - //ignore border - QRect rec(m_borderWidth, m_borderWidth, width() - m_borderWidth * 2, height() - m_borderWidth * 2); - pixmap = pixmap.scaled(rec.width(), rec.height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - painter.drawPixmap(rec.x(), rec.y(), pixmap); - - painter.end(); -} -bool AppPreviewLoader::isHover() const -{ - return m_isHover; -} - -void AppPreviewLoader::setIsHover(bool isHover) -{ - m_isHover = isHover; - - style()->unpolish(this); - style()->polish(this);// force a stylesheet recomputation - - update(); -} - -void AppPreviewLoader::requestUpdate() -{ - prepareRepaint(); - update(); -} - - -void AppPreviewLoader::installMonitor() -{ - if (!m_monitor) { - m_monitor = new Monitor(this); - - QCoreApplication * app = QApplication::instance(); - if (app) app->installNativeEventFilter(m_monitor); - } -} - -void AppPreviewLoader::removeMonitor() -{ - if (m_monitor) { - QCoreApplication * app = QApplication::instance(); - if (app) app->removeNativeEventFilter(m_monitor); - - delete m_monitor; - m_monitor = NULL; - } -} - -void AppPreviewLoader::prepareRepaint() -{ - Display *dsp = QX11Info::display(); - - XWindowAttributes s_atts; - Status ss = XGetWindowAttributes(dsp, m_sourceWindow, &s_atts); - QSize contentSize(width() - m_borderWidth * 2, height() - m_borderWidth * 2); - - if (ss != 0) { - cairo_surface_t *source = cairo_xlib_surface_create(dsp, - m_sourceWindow, - s_atts.visual, - s_atts.width, - s_atts.height); - - cairo_surface_t * image_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - contentSize.width(), - contentSize.height()); - - float ratio = 0.0f; - if (s_atts.width > s_atts.height) { - ratio = contentSize.width() * 1.0 / s_atts.width; - } else { - ratio = contentSize.height() * 1.0 / s_atts.height; - } - int x = (contentSize.width() - s_atts.width * ratio) / 2.0; - int y = (contentSize.height() - s_atts.height * ratio) / 2.0; - - cairo_t * cairo = cairo_create(image_surface); - cairo_scale(cairo, ratio, ratio); - cairo_set_source_surface(cairo, source, x / ratio, y / ratio); - cairo_paint(cairo); - - imageData.clear(); - cairo_surface_write_to_png_stream(image_surface, cairo_write_func, this); - - cairo_surface_destroy(source); - cairo_surface_destroy(image_surface); - cairo_destroy(cairo); - - update(); - } -} - - diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewloader.h b/dde-dock/src/widgets/app/apppreview/apppreviewloader.h deleted file mode 100644 index 0b29316ff..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewloader.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef APPPREVIEWLOADER_H -#define APPPREVIEWLOADER_H - -#include -#include -#include -#include -#include - -class Monitor; -class QPaintEvent; -class AppPreviewLoader : public QFrame -{ - Q_OBJECT - Q_PROPERTY(bool isHover READ isHover WRITE setIsHover) -public: - friend class Monitor; - - AppPreviewLoader(WId sourceWindow, QWidget *parent = 0); - ~AppPreviewLoader(); - - QByteArray imageData; - - bool isHover() const; - void setIsHover(bool isHover); - void requestUpdate(); - -protected: - void paintEvent(QPaintEvent * event); - -private: - WId m_sourceWindow; - - Monitor * m_monitor; - int m_borderWidth = 3; - bool m_isHover = false; - - void installMonitor(); - void removeMonitor(); - void prepareRepaint(); - -}; - -#endif // APPPREVIEWLOADER_H diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.cpp b/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.cpp deleted file mode 100644 index 8b2ba63ab..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include -#include - -#include "apppreviewloader.h" -#include "apppreviewloaderframe.h" -#include "interfaces/dockconstants.h" - -const int BUTTON_SIZE = Dock::APP_PREVIEW_CLOSEBUTTON_SIZE; -const int TITLE_HEIGHT = 25; -const int FRAME_BORDER_WIDTH = 2; - -//////////////////////////////////////// -/// \\// /// -/////////////////////////////////// /// -/// //\\ /// -/// /// /// -/// /// /// -/// /// /// -/// AppPreviewLoader /// /// -/// /// /// -/// /// /// -/// /// /// -/// /// /// -////////////////////////////////// /// -/// /// -/// //////////////////////////////////// -PopupFrame::PopupFrame(QWidget *parent) : - QWidget(parent) -{ - //PopupFrame is a middleware which use for show popup style preview -} - -void PopupFrame::mousePressEvent(QMouseEvent *) -{ - emit mousePress(); -} - -void PopupFrame::leaveEvent(QEvent *) -{ - emit mouseLeave(); -} - - -AppPreviewLoaderFrame::AppPreviewLoaderFrame(const QString &title, int xid, QWidget *parent) : - QFrame(parent), m_parent(parent), m_inMiniStyle(false),m_canShowTitle(true), m_xid(xid) -{ - this->setFixedSize(Dock::APP_PREVIEW_WIDTH + BUTTON_SIZE / 2, Dock::APP_PREVIEW_HEIGHT + BUTTON_SIZE); - - initPopupWidget(); - initPreviewLoader(xid); - initCloseButton(); - initTitle(title); -} - -AppPreviewLoaderFrame::~AppPreviewLoaderFrame() -{ - -} - -void AppPreviewLoaderFrame::shrink(const QSize &size, bool miniStyle) -{ - this->setFixedSize(size); - m_inMiniStyle = miniStyle; - m_canShowTitle = !m_inMiniStyle; - - updatePopWidgetGeometry(); - updateWidgetsGeometry(); -} - -void AppPreviewLoaderFrame::enterEvent(QEvent *) -{ - QSize ts(this->width() * 1.4, this->height() * 1.4); - if (m_inMiniStyle && (ts.height() < m_parent->height())) { - m_popupWidget->setParent(m_parent); - m_popupWidget->setFixedSize(ts); - QPoint tp = this->mapToParent(QPoint(0, 0)); - int nx = tp.x() - (m_popupWidget->width() - this->width()) / 2; - if (nx < 0) - nx = 0; - else if (nx + ts.width() > m_parent->width()) - nx = m_parent->width() - ts.width(); - m_popupWidget->move(nx, (m_parent->height() - m_popupWidget->height()) / 2); - m_popupWidget->show(); - - m_canShowTitle = true; - } - - m_closeButton->show(); - m_previewLoader->setIsHover(true); - m_previewLoader->requestUpdate(); - - updateWidgetsGeometry(); -} - -void AppPreviewLoaderFrame::initPopupWidget() -{ - m_popupWidget = new PopupFrame(this); - //TODO add box-shadow - - connect(m_popupWidget, &PopupFrame::mousePress, [=] { - m_popupWidget->setParent(this); //make sure the popupwidget will be delete with this - emit requestPreviewActive(m_xid); - }); - connect(m_popupWidget, &PopupFrame::mouseLeave, [=] { - m_popupWidget->setFixedSize(this->size()); - m_popupWidget->setParent(this); - m_layout->addWidget(m_popupWidget); - - m_closeButton->hide(); - m_previewLoader->setIsHover(false); - m_canShowTitle = !m_inMiniStyle; - - updateWidgetsGeometry(); - }); - - m_layout = new QHBoxLayout(this); - m_layout->setContentsMargins(0, 0, 0, 0); - m_layout->addWidget(m_popupWidget); - - updatePopWidgetGeometry(); -} - -void AppPreviewLoaderFrame::initTitle(const QString &t) -{ - m_titleLabel = new QLabel(t, m_popupWidget); - m_titleLabel->setAlignment(Qt::AlignCenter); - m_titleLabel->setObjectName("AppPreviewLoaderFrameTitle"); - - updateTitleGeometry(); -} - -void AppPreviewLoaderFrame::initPreviewLoader(int xid) -{ - m_previewLoader = new AppPreviewLoader(xid, m_popupWidget); - - updatePreviewLoaderGeometry(); -} - -void AppPreviewLoaderFrame::initCloseButton() -{ - m_closeButton = new QPushButton(m_popupWidget); - m_closeButton->setObjectName("AppPreviewLoaderFrameCloseButton"); - m_closeButton->setFixedSize(BUTTON_SIZE, BUTTON_SIZE); - m_closeButton->hide(); - - connect(m_closeButton, &QPushButton::clicked, [=]{ - m_popupWidget->setParent(this); //make sure the popupwidget will be delete with this - emit requestPreviewClose(m_xid); - this->deleteLater(); - }); - - updateCloseButtonGeometry(); -} - -void AppPreviewLoaderFrame::updatePopWidgetGeometry() -{ - m_popupWidget->setFixedSize(this->size()); -} - -void AppPreviewLoaderFrame::updatePreviewLoaderGeometry() -{ - //left:parent.left - //leftMargin:0 - //topMargin==rightMargin==bottomMargin==BUTTON_SIZE / 2 - //horizontalCenter:parent.horizontalCenter - m_previewLoader->setFixedSize(m_popupWidget->width() - BUTTON_SIZE / 2, m_popupWidget->height() - BUTTON_SIZE); - m_previewLoader->move(0, BUTTON_SIZE / 2); -} - -void AppPreviewLoaderFrame::updateCloseButtonGeometry() -{ - //always in the top-right corner - m_closeButton->move(m_popupWidget->width() - BUTTON_SIZE, 0); -} - -void AppPreviewLoaderFrame::updateTitleGeometry() -{ - if (m_canShowTitle) { - m_titleLabel->setVisible(true); - QFontMetrics fm(m_titleLabel->font()); - m_titleLabel->setText(fm.elidedText(m_titleLabel->text(), Qt::ElideRight, width() * 4 / 5)); - - int titleBorderWidth = 1; - m_titleLabel->setFixedSize(m_previewLoader->width() - (FRAME_BORDER_WIDTH + titleBorderWidth) * 2, - TITLE_HEIGHT - titleBorderWidth*2); - m_titleLabel->move(FRAME_BORDER_WIDTH + titleBorderWidth, - BUTTON_SIZE / 2 + m_previewLoader->height() - TITLE_HEIGHT - FRAME_BORDER_WIDTH + titleBorderWidth); - } - else - m_titleLabel->setVisible(false); -} - -void AppPreviewLoaderFrame::updateWidgetsGeometry() -{ - updatePreviewLoaderGeometry(); - updateCloseButtonGeometry(); - updateTitleGeometry(); -} - - diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.h b/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.h deleted file mode 100644 index 6414910de..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewloaderframe.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef APPPREVIEWLOADERFRAME_H -#define APPPREVIEWLOADERFRAME_H - -#include -#include - -class QLabel; -class QPushButton; -class QHBoxLayout; -class AppPreviewLoader; - -class PopupFrame : public QWidget -{ - Q_OBJECT -public: - explicit PopupFrame(QWidget *parent = 0); - -signals: - void mousePress(); - void mouseLeave(); - -protected: - void mousePressEvent(QMouseEvent *); - void leaveEvent(QEvent *); -}; - -class AppPreviewLoaderFrame : public QFrame -{ - Q_OBJECT -public: - explicit AppPreviewLoaderFrame(const QString &title, int xid, QWidget *parent=0); - ~AppPreviewLoaderFrame(); - void shrink(const QSize &size, bool miniStyle); - -signals: - void requestPreviewClose(int xid); - void requestPreviewActive(int xid); - -protected: - void enterEvent(QEvent *); - -private: - void initPopupWidget(); - void initTitle(const QString &t); - void initPreviewLoader(int xid); - void initCloseButton(); - void updatePopWidgetGeometry(); - void updatePreviewLoaderGeometry(); - void updateCloseButtonGeometry(); - void updateTitleGeometry(); - void updateWidgetsGeometry(); - -private: - AppPreviewLoader * m_previewLoader; - QPushButton *m_closeButton; - QHBoxLayout *m_layout; - PopupFrame *m_popupWidget; //for show popup preview - QWidget *m_parent; //for reparent to make preview show like popup window - QLabel *m_titleLabel; - bool m_inMiniStyle; - bool m_canShowTitle; - int m_xid; -}; - -#endif // APPPREVIEWLOADERFRAME_H diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.cpp b/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.cpp deleted file mode 100644 index a9cea0942..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include - -#include "apppreviewscontainer.h" -#include "apppreviewloaderframe.h" -#include "interfaces/dockconstants.h" - -const int PREVIEW_PADDING = 5; -const int BUTTON_SIZE = Dock::APP_PREVIEW_CLOSEBUTTON_SIZE; -const int PREVIEW_HEIGHT = Dock::APP_PREVIEW_HEIGHT; -const int PREVIEW_WIDTH = Dock::APP_PREVIEW_WIDTH; -const int PREVIEW_MARGIN = Dock::APP_PREVIEW_MARGIN; - -AppPreviewsContainer::AppPreviewsContainer(QWidget *parent) : - QWidget(parent) -{ - m_clientManager = new DBusClientManager(this); - - - m_mainLayout = new QHBoxLayout(this); - m_mainLayout->setAlignment(Qt::AlignCenter); - m_mainLayout->setContentsMargins(Dock::APP_PREVIEW_CLOSEBUTTON_SIZE / 2, 0, 0, 0); - m_mainLayout->setSpacing(PREVIEW_MARGIN - Dock::APP_PREVIEW_CLOSEBUTTON_SIZE / 2); - - resize(PREVIEW_WIDTH,PREVIEW_HEIGHT); -} - -void AppPreviewsContainer::addItem(const QString &title, int xid) -{ - if (m_previewMap.keys().indexOf(xid) != -1) - return; - - AppPreviewLoaderFrame *f = new AppPreviewLoaderFrame(title, xid, this); - connect(f, &AppPreviewLoaderFrame::requestPreviewClose, this, &AppPreviewsContainer::removePreview); - connect(f, &AppPreviewLoaderFrame::requestPreviewActive, this, &AppPreviewsContainer::activatePreview); - - m_mainLayout->addWidget(f); - - m_previewMap.insert(xid, f); - - setItemCount(m_previewMap.count()); -} - -void AppPreviewsContainer::leaveEvent(QEvent *) -{ -} - -void AppPreviewsContainer::removePreview(int xid) -{ - m_previewMap.remove(xid); - m_mainLayout->removeWidget(qobject_cast(sender())); - sender()->deleteLater(); - m_clientManager->CloseWindow(xid); - - if (m_mainLayout->count() <= 0) - { - emit requestHide(); - return; - } - - setItemCount(m_previewMap.count()); - - emit sizeChanged(); -} - -void AppPreviewsContainer::activatePreview(int xid) -{ - m_clientManager->ActiveWindow(xid); - - emit requestHide(); -} - -void AppPreviewsContainer::clearUpPreview() -{ - QLayoutItem *child; - while ((child = m_mainLayout->takeAt(0)) != 0){ - child->widget()->deleteLater(); - delete child; - } - - m_previewMap.clear(); -} - -QSize AppPreviewsContainer::getNormalContentSize() -{ - - int contentWidth = m_mainLayout->count() * (PREVIEW_WIDTH + PREVIEW_MARGIN) - + PREVIEW_MARGIN - PREVIEW_PADDING * 2; - int contentHeight = PREVIEW_HEIGHT + PREVIEW_MARGIN*2 - PREVIEW_PADDING * 2; - - return QSize(contentWidth, contentHeight); -} - -void AppPreviewsContainer::setItemCount(int count) -{ - QSize frameSize(PREVIEW_WIDTH + BUTTON_SIZE / 2, PREVIEW_HEIGHT + BUTTON_SIZE); - QRect dr = QApplication::desktop()->geometry(); - bool outOfScreen = getNormalContentSize().width() > dr.width(); - - //if the total width larger than screen width,scale the preview frame size - if (outOfScreen) { - int w = (dr.width() - (count + 1) * PREVIEW_MARGIN) / count + BUTTON_SIZE / 2; - int h = w * (PREVIEW_HEIGHT + BUTTON_SIZE) / (PREVIEW_WIDTH + BUTTON_SIZE / 2); - frameSize = QSize(w, h); - } - - foreach (AppPreviewLoaderFrame *frame, m_previewMap.values()) { - frame->shrink(frameSize, outOfScreen); - } - - int contentWidth = count * (frameSize.width() - BUTTON_SIZE / 2) + (count + 1) * PREVIEW_MARGIN; - int contentHeight = PREVIEW_HEIGHT + PREVIEW_MARGIN * 2; - - resize(contentWidth, contentHeight); -} - -AppPreviewsContainer::~AppPreviewsContainer() -{ - -} - - - - - diff --git a/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.h b/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.h deleted file mode 100644 index 9ed31955b..000000000 --- a/dde-dock/src/widgets/app/apppreview/apppreviewscontainer.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef APPPREVIEWSCONTAINER_H -#define APPPREVIEWSCONTAINER_H - -#include -#include "dbus/dbusclientmanager.h" - -class QHBoxLayout; -class AppPreviewLoaderFrame; - -class AppPreviewsContainer : public QWidget -{ - Q_OBJECT -public: - explicit AppPreviewsContainer(QWidget *parent = 0); - ~AppPreviewsContainer(); - - void addItem(const QString &title,int xid); - -protected: - void leaveEvent(QEvent *); - -signals: - void requestHide(); - void sizeChanged(); - -public slots: - void removePreview(int xid); - void activatePreview(int xid); - void clearUpPreview(); - QSize getNormalContentSize(); - -private: - void setItemCount(int count); - -private: - QMap m_previewMap; - DBusClientManager *m_clientManager; - QHBoxLayout *m_mainLayout; -}; - -#endif // APPPREVIEWSCONTAINER_H diff --git a/dde-dock/src/widgets/app/dockappbg.cpp b/dde-dock/src/widgets/app/dockappbg.cpp deleted file mode 100644 index 879355d7a..000000000 --- a/dde-dock/src/widgets/app/dockappbg.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dockappbg.h" - -BGActiveIndicator::BGActiveIndicator(QWidget *parent) - :QLabel(parent) -{ - setObjectName("AppBackgroundActiveLabel"); - setAlignment(Qt::AlignBottom | Qt::AlignHCenter); -} - -void BGActiveIndicator::showActivatingAnimation() -{ - if (m_loopCount != 0) - return; - m_loopCount = 0; - setFixedSize(28, 13); - emit sizeChange(); - setVisible(true); - m_iconPath = m_openingIndicatorIcon; - QPropertyAnimation *animation = new QPropertyAnimation(this, "opacity"); - animation->setDuration(500); - animation->setStartValue(0); - animation->setEndValue(1); - animation->start(); - connect(animation, &QPropertyAnimation::finished, [=]{ - ++ m_loopCount; - if (m_loopCount == 4){ - m_loopCount = 0; - emit showAnimationFinish(); - } - else{ - if (m_loopCount % 2 == 0){ - animation->setStartValue(0); - animation->setEndValue(1); - animation->start(); - } - else{ - animation->setStartValue(1); - animation->setEndValue(0); - animation->start(); - } - } - }); - -} - -void BGActiveIndicator::show() -{ - QLabel::show(); - setFixedSize(24, 5); - setOpacity(1); - m_iconPath = m_openIndicatorIcon; - update(); - emit sizeChange(); -} -double BGActiveIndicator::opacity() const -{ - return m_opacity; -} - -void BGActiveIndicator::setOpacity(double opacity) -{ - m_opacity = opacity; - update(); -} - -void BGActiveIndicator::paintEvent(QPaintEvent *event) -{ - if (m_iconPath.isEmpty()){ - QLabel::paintEvent(event); - return; - } - QPainter painter; - painter.begin(this); - - painter.setClipRect(rect()); - painter.setOpacity(m_opacity); - painter.drawPixmap(0, 0, QPixmap(m_iconPath).scaled(size())); - - painter.end(); -} -QString BGActiveIndicator::openingIndicatorIcon() const -{ - return m_openingIndicatorIcon; -} - -void BGActiveIndicator::setOpeningIndicatorIcon(const QString &openingIndicatorIcon) -{ - m_openingIndicatorIcon = openingIndicatorIcon; -} - -QString BGActiveIndicator::openIndicatorIcon() const -{ - return m_openIndicatorIcon; -} - -void BGActiveIndicator::setOpenIndicatorIcon(const QString &openIndicatorIcon) -{ - m_openIndicatorIcon = openIndicatorIcon; -} - - -DockAppBG::DockAppBG(QWidget *parent) : - QLabel(parent) -{ - setObjectName("AppBackground"); - initActiveLabel(); -} - -bool DockAppBG::isActived() -{ - return m_isActived; -} - -void DockAppBG::setIsActived(bool value) -{ - m_isActived = value; - if (!m_isActived) { - m_activeLabel->hide(); - m_bePress = false; - } - else if (!m_bePress && isFashionMode()){ - m_activeLabel->show(); - } - - style()->unpolish(this); - style()->polish(this);// force a stylesheet recomputation -} - -bool DockAppBG::isCurrentOpened() -{ - return m_isCurrentOpened; -} - -void DockAppBG::setIsCurrentOpened(bool value) -{ - m_isCurrentOpened = value; - - style()->unpolish(this); - style()->polish(this);// force a stylesheet recomputation -} - -bool DockAppBG::isHovered() -{ - return m_isHovered; -} - -void DockAppBG::setIsHovered(bool value) -{ - m_isHovered = value; - - style()->unpolish(this); - style()->polish(this);// force a stylesheet recomputation -} -bool DockAppBG::isFashionMode() const -{ - return DockModeData::instance()->getDockMode() == Dock::FashionMode; -} - -void DockAppBG::showActivatingAnimation() -{ - m_bePress = true; - if (!m_isActived && isFashionMode()) - m_activeLabel->showActivatingAnimation(); -} - -void DockAppBG::resizeEvent(QResizeEvent *) -{ - updateActiveLabelPos(); -} - -void DockAppBG::initActiveLabel() -{ - m_activeLabel = new BGActiveIndicator(this); - connect(m_activeLabel, &BGActiveIndicator::sizeChange, this, &DockAppBG::updateActiveLabelPos); - connect(DockModeData::instance(), &DockModeData::dockModeChanged, this, &DockAppBG::onDockModeChanged); - connect(m_activeLabel, &BGActiveIndicator::showAnimationFinish, [=]{ - if (m_isActived) - m_activeLabel->show(); - m_bePress = false; - }); -} - -void DockAppBG::updateActiveLabelPos() -{ - if (m_activeLabel) - m_activeLabel->move((width() - m_activeLabel->width()) / 2, height() - m_activeLabel->height()); -} - -void DockAppBG::onDockModeChanged() -{ - if (m_activeLabel && !isFashionMode()) - m_activeLabel->hide(); - else if (m_activeLabel && m_isActived) - m_activeLabel->show(); -} - diff --git a/dde-dock/src/widgets/app/dockappbg.h b/dde-dock/src/widgets/app/dockappbg.h deleted file mode 100644 index 5d3e14eb6..000000000 --- a/dde-dock/src/widgets/app/dockappbg.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKAPPBG_H -#define DOCKAPPBG_H - -#include -#include -#include -#include -#include -#include - -#include "controller/dockmodedata.h" - -class BGActiveIndicator : public QLabel -{ - Q_OBJECT - Q_PROPERTY(double opacity READ opacity WRITE setOpacity) - Q_PROPERTY(QString openIndicatorIcon READ openIndicatorIcon WRITE setOpenIndicatorIcon) - Q_PROPERTY(QString openingIndicatorIcon READ openingIndicatorIcon WRITE setOpeningIndicatorIcon) - -public: - explicit BGActiveIndicator(QWidget *parent = 0); - void showActivatingAnimation(); - void show(); - - double opacity() const; - void setOpacity(double opacity); - - QString openIndicatorIcon() const; - void setOpenIndicatorIcon(const QString &openIndicatorIcon); - - QString openingIndicatorIcon() const; - void setOpeningIndicatorIcon(const QString &openingIndicatorIcon); - -signals: - void sizeChange(); - void showAnimationFinish(); - -protected: - void paintEvent(QPaintEvent *event); - -private: - int m_loopCount = 0; - double m_opacity = 0; - QString m_openIndicatorIcon = ""; - QString m_openingIndicatorIcon = ""; - QString m_iconPath = ""; -}; - -class DockAppBG : public QLabel -{ - Q_OBJECT - Q_PROPERTY(bool isActived READ isActived WRITE setIsActived) - Q_PROPERTY(bool isCurrentOpened READ isCurrentOpened WRITE setIsCurrentOpened) - Q_PROPERTY(bool isHovered READ isHovered WRITE setIsHovered) - Q_PROPERTY(bool isFashionMode READ isFashionMode) -public: - explicit DockAppBG(QWidget *parent = 0); - void showActivatingAnimation(); - - bool isActived(); - void setIsActived(bool value); - bool isCurrentOpened(); - void setIsCurrentOpened(bool value); - bool isHovered(); - void setIsHovered(bool value); - bool isFashionMode() const; - -protected: - void resizeEvent(QResizeEvent *); - -private: - void initActiveLabel(); - void updateActiveLabelPos(); - void onDockModeChanged(); - -private: - bool m_bePress = false; - bool m_isActived = false; - bool m_isCurrentOpened = false; - bool m_isHovered = false; - bool m_isFashionMode = false; - - BGActiveIndicator *m_activeLabel; - - const int ACTIVE_LABEL_WIDTH = 30; - const int ACTIVE_LABEL_HEIGHT = 10; -}; - -#endif // DOCKAPPBG_H diff --git a/dde-dock/src/widgets/app/dockappicon.cpp b/dde-dock/src/widgets/app/dockappicon.cpp deleted file mode 100644 index f94f48e71..000000000 --- a/dde-dock/src/widgets/app/dockappicon.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include - -#include "dockappicon.h" -#include "controller/signalmanager.h" - -#undef signals -extern "C" { - #include -} -#define signals public - -DockAppIcon::DockAppIcon(QWidget *parent, Qt::WindowFlags f) : - QLabel(parent, f) -{ - // as far as I know, it's safe to call this method multiple times, - // because it does some check work internally. - gtk_init(NULL, NULL); - gdk_error_trap_push(); - - this->setAttribute(Qt::WA_TranslucentBackground); - this->setAlignment(Qt::AlignCenter); - - connect(SignalManager::instance(), &SignalManager::requestAppIconUpdate, this, &DockAppIcon::updateIcon); -} - -void DockAppIcon::setIcon(const QString &iconPath) -{ - m_iconPath = iconPath; - - QPixmap pixmap(48, 48); - - // iconPath is an absolute path of the system. - if (QFile::exists(iconPath) && QFileInfo(iconPath).isAbsolute()) { - pixmap = QPixmap(iconPath); - } else if (iconPath.startsWith("data:image/")){ - // iconPath is a string representing an inline image. - QStringList strs = iconPath.split("base64,"); - if (strs.length() == 2) { - QByteArray data = QByteArray::fromBase64(strs.at(1).toLatin1()); - pixmap.loadFromData(data); - } - } else { - // try to read the iconPath as a icon name. - QString path = getThemeIconPath(iconPath); - if (path.isEmpty()) - path = getThemeIconPath("application-x-desktop"); - if (path.endsWith(".svg")) { - QSvgRenderer renderer(path); - pixmap.fill(Qt::transparent); - - QPainter painter; - painter.begin(&pixmap); - - renderer.render(&painter); - - painter.end(); - } else { - pixmap.load(path); - } - } - - if (!pixmap.isNull()) { - pixmap = pixmap.scaled(m_modeData->getAppIconSize(), - m_modeData->getAppIconSize(), - Qt::KeepAspectRatioByExpanding, - Qt::SmoothTransformation); - - setPixmap(pixmap); - } -} - -void DockAppIcon::mousePressEvent(QMouseEvent *ev) -{ - if (m_modeData->getDockMode() == Dock::FashionMode) - emit mousePress(ev); - else - QLabel::mousePressEvent(ev); -} - -void DockAppIcon::mouseReleaseEvent(QMouseEvent *ev) -{ - if (m_modeData->getDockMode() == Dock::FashionMode) - emit mouseRelease(ev); - else - QLabel::mousePressEvent(ev); -} - -void DockAppIcon::enterEvent(QEvent *) -{ - if (m_modeData->getDockMode() == Dock::FashionMode) - emit mouseEnter(); -} - -void DockAppIcon::leaveEvent(QEvent *) -{ - if (m_modeData->getDockMode() == Dock::FashionMode) - emit mouseLeave(); -} - -// iconName should be a icon name constraints to the freeedesktop standard. -QString DockAppIcon::getThemeIconPath(QString iconName) -{ - QByteArray bytes = iconName.toUtf8(); - const char *name = bytes.constData(); - - GtkIconTheme* theme = gtk_icon_theme_get_default(); - - GtkIconInfo* info = gtk_icon_theme_lookup_icon(theme, name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK); - - if (info) { - char* path = g_strdup(gtk_icon_info_get_filename(info)); -#if GTK_MAJOR_VERSION >= 3 - g_object_unref(info); -#elif GTK_MAJOR_VERSION == 2 - gtk_icon_info_free(info); -#endif - return QString(path); - } else { - return ""; - } -} - -void DockAppIcon::updateIcon() -{ - if (!m_iconPath.isEmpty()) - setIcon(m_iconPath); -} diff --git a/dde-dock/src/widgets/app/dockappicon.h b/dde-dock/src/widgets/app/dockappicon.h deleted file mode 100644 index 4d6fd3626..000000000 --- a/dde-dock/src/widgets/app/dockappicon.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKAPPICON_H -#define DOCKAPPICON_H - -#include -#include -#include -#include -#include -#include - -#include "controller/dockmodedata.h" - -class DockAppIcon : public QLabel -{ - Q_OBJECT -public: - explicit DockAppIcon(QWidget *parent = 0, Qt::WindowFlags f = 0); - - void setIcon(const QString &iconPath); - -signals: - void mousePress(QMouseEvent *event); - void mouseRelease(QMouseEvent *event); - void mouseEnter(); - void mouseLeave(); - -protected: - void mousePressEvent(QMouseEvent *ev); - void mouseReleaseEvent(QMouseEvent *ev); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - -private: - DockModeData *m_modeData = DockModeData::instance(); - QString m_iconPath = ""; - - QString getThemeIconPath(QString iconName); - void updateIcon(); -}; - -#endif // DOCKAPPICON_H diff --git a/dde-dock/src/widgets/app/dockappitem.cpp b/dde-dock/src/widgets/app/dockappitem.cpp deleted file mode 100644 index 9245673b6..000000000 --- a/dde-dock/src/widgets/app/dockappitem.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include - -#include "dockappitem.h" -#include "xcb_misc.h" - -const QEasingCurve MOVE_ANIMATION_CURVE = QEasingCurve::OutCubic; - -DockAppItem::DockAppItem(QWidget *parent) : - DockItem(parent) -{ - m_appManager = new DBusDockedAppManager(this); - m_dockModeData = DockModeData::instance(); - connect(m_dockModeData, &DockModeData::dockModeChanged,this, &DockAppItem::onDockModeChanged); - - setFixedSize(m_dockModeData->getNormalItemWidth(), m_dockModeData->getItemHeight()); - - initAppIcon(); - initBackground(); - initTitle(); - m_appIcon->raise(); - initClientManager(); - initPreviewContainer(); -} - -DockAppItemData DockAppItem::itemData() const -{ - return m_itemData; -} - -QWidget *DockAppItem::getApplet() -{ - if (m_itemData.isActived && !m_itemData.xidTitleMap.isEmpty()) { - m_previewContainer->clearUpPreview(); - //Returns a list containing all the keys in the map in ascending order. - QList xids = m_itemData.xidTitleMap.keys(); - - for (int xid : xids) { - m_previewContainer->addItem(m_itemData.xidTitleMap[xid], xid); - } - - return m_previewContainer; - } - else { - return NULL; //use getTitle() to show title by DockItem - } -} - -QString DockAppItem::getItemId() -{ - return m_itemData.id; -} - -QString DockAppItem::getTitle() -{ - return m_itemData.title; -} - -QPixmap DockAppItem::iconPixmap() -{ - QPixmap m = m_appIcon->grab(); - m.scaled(m_dockModeData->getAppIconSize(), m_dockModeData->getAppIconSize()); - return m; -} - -QPixmap DockAppItem::grab(const QRect &rectangle) -{ - const bool actived = m_appBG->isActived(); - m_appBG->setIsActived(false); - const QPixmap pixmap = DockItem::grab(rectangle); - m_appBG->setIsActived(actived); - - return pixmap; -} - -void DockAppItem::openFiles(const QStringList files) -{ - for (QString url : files) { - m_entryProxyer->HandleDragDrop(0, 0, "file://" + url, 0); - qDebug() << "Try to open file:" << url; - } -} - -void DockAppItem::setItemId(QString id) -{ - m_itemData.id = id; -} - -void DockAppItem::setEntryProxyer(DBusDockEntry *entryProxyer) -{ - m_entryProxyer = entryProxyer; - m_entryProxyer->setParent(this); - connect(m_entryProxyer, &DBusDockEntry::DataChanged, this, &DockAppItem::onDbusDataChanged); - - initData(); -} - -void DockAppItem::mousePressEvent(QMouseEvent *event) -{ - //mouse event accept area are app-icon-area in FashionMode - if (m_dockModeData->getDockMode() != Dock::FashionMode) - onMousePress(event); - else - QFrame::mousePressEvent(event); -} - -void DockAppItem::mouseReleaseEvent(QMouseEvent *event) -{ - //mouse event accept area are app-icon-area in FashionMode - if (m_dockModeData->getDockMode() != Dock::FashionMode) - onMouseRelease(event); - else - QFrame::mouseReleaseEvent(event); -} - -void DockAppItem::enterEvent(QEvent *) -{ - //mouse event accept area are app-icon-area in FashionMode - if (m_dockModeData->getDockMode() != Dock::FashionMode) - onMouseEnter(); -} - -void DockAppItem::leaveEvent(QEvent *) -{ - //mouse event accept area are app-icon-area in FashionMode - if (m_dockModeData->getDockMode() != Dock::FashionMode) - onMouseLeave(); -} - -void DockAppItem::resizeEvent(QResizeEvent *e) -{ - Q_UNUSED(e) - - resizeResources(); -} - -void DockAppItem::initClientManager() -{ - m_clientManager = new DBusClientManager(this); - connect(m_clientManager, &DBusClientManager::ActiveWindowChanged, this, &DockAppItem::setCurrentOpened); -} - -void DockAppItem::initBackground() -{ - m_appBG = new DockAppBG(this); - // NOTE: add 1px padding for item top. - m_appBG->move(0, 1); -} - -void DockAppItem::initPreviewContainer() -{ - m_previewContainer = new AppPreviewsContainer(); - connect(m_previewContainer,&AppPreviewsContainer::requestHide, [=]{hidePreview();}); - connect(m_previewContainer,&AppPreviewsContainer::sizeChanged, this, &DockAppItem::needPreviewUpdate); -} - -void DockAppItem::initAppIcon() -{ - m_appIcon = new DockAppIcon(this); - connect(m_appIcon, &DockAppIcon::mousePress, this, &DockAppItem::onMousePress); - connect(m_appIcon, &DockAppIcon::mouseRelease, this, &DockAppItem::onMouseRelease); - connect(m_appIcon, &DockAppIcon::mouseEnter, this, &DockAppItem::onMouseEnter); - connect(m_appIcon, &DockAppIcon::mouseLeave, this, &DockAppItem::onMouseLeave); -} - -void DockAppItem::initTitle() -{ - m_appTitle = new QLabel(this); - m_appTitle->setObjectName("ClassicModeTitle"); - m_appTitle->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); -} - -void DockAppItem::initData() -{ - StringMap dataMap = m_entryProxyer->data(); - m_itemData.title = dataMap.value("title"); - m_itemData.iconPath = dataMap.value("icon"); - m_itemData.menuJsonString = dataMap.value("menu"); - updateXidTitleMap(); - m_itemData.isActived = dataMap.value("app-status") == "active"; - m_itemData.currentOpened = m_itemData.xidTitleMap.keys().indexOf(m_clientManager->CurrentActiveWindow().value()) != -1; - m_itemData.id = m_entryProxyer->id(); - - setActived(m_itemData.isActived); - setCurrentOpened(m_clientManager->CurrentActiveWindow()); - updateIcon(); - updateTitle(); -} - -void DockAppItem::updateIcon() -{ - m_appIcon->setFixedSize(m_dockModeData->getAppIconSize(), m_dockModeData->getAppIconSize()); - m_appIcon->setIcon(m_itemData.iconPath); - - reanchorIcon(); -} - -void DockAppItem::updateTitle() -{ - m_itemData.title = m_entryProxyer->data().value("title"); - - switch (m_dockModeData->getDockMode()) { - case Dock::FashionMode: - case Dock::EfficientMode: - m_appTitle->setFixedSize(0, 0); - m_appTitle->setVisible(false); - return; - case Dock::ClassicMode: - m_appIcon->setVisible(true); - m_appTitle->setFixedSize((m_actived ? (width() - m_appIcon->width()) : 0), m_appIcon->height()); - m_appTitle->move((m_appIcon->x() + m_appIcon->width()), m_appIcon->y()); - m_appTitle->show(); - break; - default: - break; - } - - QFontMetrics fm(m_appTitle->font()); - m_appTitle->setText(fm.elidedText(m_itemData.title, Qt::ElideRight, (width() - m_appIcon->width() - 10))); - -} - -void DockAppItem::updateState() -{ - m_itemData.isActived = m_entryProxyer->data().value("app-status") == "active"; - setActived(m_itemData.isActived); -} - -void DockAppItem::updateXidTitleMap() -{ - m_itemData.xidTitleMap.clear(); - QJsonArray array = QJsonDocument::fromJson(m_entryProxyer->data().value("app-xids").toUtf8()).array(); - for (QJsonValue v : array) { - QJsonObject obj = v.toObject(); - m_itemData.xidTitleMap.insert(obj.value("Xid").toInt(), obj.value("Title").toString()); - } - - setWindowIconGeometries(); -} - -void DockAppItem::updateMenuJsonString() -{ - m_itemData.menuJsonString = m_entryProxyer->data().value("menu"); -} - -void DockAppItem::setWindowIconGeometries() -{ - for (int xid : m_itemData.xidTitleMap.keys()) { -// qDebug() << "set _NET_WM_WINDOW_ICON_GEOMETRY for window " << xid << " to " << globalPos() << size(); - XcbMisc::instance()->set_window_icon_geometry(xid, QRect(globalPos(), size())); - } -} - -void DockAppItem::refreshUI() -{ - m_appBG->setIsActived(m_actived); - reanchorIcon(); -} - -void DockAppItem::onDbusDataChanged(const QString &, const QString &) -{ - updateTitle(); - updateState(); - updateXidTitleMap(); - updateMenuJsonString(); - - setCurrentOpened(m_clientManager->CurrentActiveWindow()); -} - -void DockAppItem::onDockModeChanged(Dock::DockMode, Dock::DockMode) -{ - setActived(actived()); - resizeResources(); -} - -void DockAppItem::onMousePress(QMouseEvent *event) -{ - Q_UNUSED(event) - - hidePreview(true); - emit mousePress(); -} - -void DockAppItem::onMouseRelease(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) { - m_entryProxyer->Activate(event->globalX(), event->globalY(), event->timestamp()); - m_appBG->showActivatingAnimation(); - } - else if (event->button() == Qt::RightButton) { - showMenu(); - } - - emit mouseRelease(); -} - -void DockAppItem::onMouseEnter() -{ - if (hoverable()) { - m_appBG->setIsHovered(true); - showPreview(); - emit mouseEnter(); - } -} - -void DockAppItem::onMouseLeave() -{ - m_appBG->setIsHovered(false); - hidePreview(false); - emit mouseLeave(); -} - -void DockAppItem::resizeBackground() -{ - if (!m_appBG) - return; - - // NOTE: add 1px padding for Top and Bottom - m_appBG->setFixedSize(width(), height() - 2); -} - -void DockAppItem::resizeResources() -{ - if (m_appIcon != NULL) - updateIcon(); - - if (m_appBG != NULL) { - resizeBackground(); - // NOTE: add 1px padding for item top. - m_appBG->move(0, 1); - } - - updateTitle(); -} - -void DockAppItem::reanchorIcon() -{ - switch (m_dockModeData->getDockMode()) { - case Dock::FashionMode: - m_appIcon->move((width() - m_appIcon->width()) / 2, 0); - break; - case Dock::EfficientMode: - m_appIcon->move((width() - m_appIcon->width()) / 2, (height() - m_appIcon->height()) / 2); - break; - case Dock::ClassicMode: - if (itemData().isActived) - m_appIcon->move((height() - m_appIcon->height()) / 2, (height() - m_appIcon->height()) / 2); - else - m_appIcon->move((width() - m_appIcon->width()) / 2, (height() - m_appIcon->height()) / 2); - break; - default: - break; - } -} - -void DockAppItem::setCurrentOpened(uint value) -{ - if (m_itemData.xidTitleMap.keys().indexOf(value) != -1) { - m_itemData.currentOpened = true; - } - else { - m_itemData.currentOpened = false; - } - - m_appBG->setIsCurrentOpened(m_itemData.currentOpened); -} - -void DockAppItem::setActived(bool value) -{ - if (m_actived != value) { - m_actived = value; - - emit activatedChanged(value); - } -} - -void DockAppItem::invokeMenuItem(QString id, bool) -{ - m_entryProxyer->HandleMenuItem(id, QX11Info::getTimestamp()); -} - -QString DockAppItem::getMenuContent() -{ - return m_itemData.menuJsonString; -} - -bool DockAppItem::actived() const -{ - return m_actived; -} - -DockAppItem::~DockAppItem() -{ - -} - diff --git a/dde-dock/src/widgets/app/dockappitem.h b/dde-dock/src/widgets/app/dockappitem.h deleted file mode 100644 index 64b8df589..000000000 --- a/dde-dock/src/widgets/app/dockappitem.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKAPPITEM_H -#define DOCKAPPITEM_H - -#include "dockappicon.h" -#include "dockappbg.h" -#include "../dockitem.h" -#include "interfaces/dockconstants.h" -#include "dbus/dbusdockentry.h" -#include "dbus/dbusclientmanager.h" -#include "controller/dockmodedata.h" -#include "dbus/dbusdockedappmanager.h" -#include "apppreview/apppreviewscontainer.h" - -struct DockAppItemData { - QString id; - QString iconPath; - QString title; - QMap xidTitleMap; - QString menuJsonString; - bool isActived; - bool currentOpened; - bool isDocked; -}; - -class DockAppItem : public DockItem -{ - Q_OBJECT - Q_PROPERTY(QPoint pos READ pos WRITE move) -public: - DockAppItem(QWidget *parent = 0); - ~DockAppItem(); - - DockAppItemData itemData() const; - QWidget *getApplet(); - QString getItemId(); - QString getTitle(); - QPixmap iconPixmap(); - QPixmap grab(const QRect &rectangle = QRect(QPoint(0, 0), QSize(-1, -1))) Q_DECL_OVERRIDE; - void openFiles(const QStringList files); - void setItemId(QString id); - void setEntryProxyer(DBusDockEntry *entryProxyer); - bool actived() const; - void setActived(bool actived); - void setWindowIconGeometries(); - - void refreshUI(); - -signals: - void activatedChanged(bool activated); - -protected: - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - void resizeEvent(QResizeEvent *e); - -private: - void initPreviewContainer(); - void initClientManager(); - void initBackground(); - void initAppIcon(); - void initTitle(); - void initData(); - - void updateIcon(); - void updateTitle(); - void updateState(); - void updateXidTitleMap(); - void updateMenuJsonString(); - - void onDbusDataChanged(const QString &, const QString &); - void onDockModeChanged(Dock::DockMode, Dock::DockMode); - void onMousePress(QMouseEvent *event); - void onMouseRelease(QMouseEvent *event); - void onMouseEnter(); - void onMouseLeave(); - - void resizeBackground(); - void resizeResources(); - void reanchorIcon(); - void setCurrentOpened(uint); - void invokeMenuItem(QString id,bool); - QString getMenuContent(); - -private: - QLabel * m_appTitle; - DockAppBG * m_appBG; - DockAppIcon * m_appIcon; - DockAppItemData m_itemData; - DockModeData *m_dockModeData; - DBusDockEntry *m_entryProxyer; - DBusClientManager *m_clientManager; - DBusDockedAppManager *m_appManager; - AppPreviewsContainer *m_previewContainer; - - bool m_actived = false; -}; - -#endif // DOCKAPPITEM_H diff --git a/dde-dock/src/widgets/app/dockapplayout.cpp b/dde-dock/src/widgets/app/dockapplayout.cpp deleted file mode 100644 index eda1fcdf8..000000000 --- a/dde-dock/src/widgets/app/dockapplayout.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include "dockapplayout.h" -#include "../../controller/dockmodedata.h" - -/* -class DropMask : public QLabel -{ - Q_OBJECT - Q_PROPERTY(int rValue READ getRValue WRITE setRValue) - Q_PROPERTY(double sValue READ getSValue WRITE setSValue) - int m_rValue; - - double m_sValue; - -public: - DropMask(QWidget *parent = 0); - - int getRValue() const {return m_rValue;} - double getSValue() const {return m_sValue;} - -public slots: - void setRValue(int rValue); - void setSValue(double sValue); - -signals: - void droped(); - void invalidDroped(); - -protected: - void dropEvent(QDropEvent *e); - void dragEnterEvent(QDragEnterEvent *e); -}; - -DropMask::DropMask(QWidget *parent) : - QLabel(parent) -{ - setAcceptDrops(true); - setWindowFlags(Qt::ToolTip); - setAttribute(Qt::WA_TranslucentBackground); - setFixedWidth(DockModeData::instance()->getAppIconSize()); - setFixedHeight(DockModeData::instance()->getAppIconSize()); -} - -void DropMask::setRValue(int rValue) -{ - if (!pixmap()) - return; - QTransform rt; - rt.translate(width() / 2, height() / 2); - rt.rotate(rValue); - rt.translate(-width() / 2, -height() / 2); - setPixmap(pixmap()->transformed(rt)); - m_rValue = rValue; -} - -void DropMask::setSValue(double sValue) -{ - if (!pixmap()) - return; - QTransform st(1, 0, 0, 1, width()/2, height()/2); - st.scale(sValue, sValue); - st.rotate(90);//TODO work around here - setPixmap(pixmap()->transformed(st)); - m_sValue = sValue; -} - -void DropMask::dropEvent(QDropEvent *e) -{ - DockAppLayout *layout = dynamic_cast(e->source()); - if (!layout) - return; - DockAppItem *item = qobject_cast(layout->dragingWidget()); - if (item) - { - //restore item to dock if item is actived - if (item->itemData().isActived) { - emit invalidDroped(); - return; - } - - DBusDockedAppManager dda; - if (dda.IsDocked(item->itemData().id).value()) { - dda.RequestUndock(item->itemData().id); - } - - qDebug() << "Item drop to mask:" << e->mimeData()->hasImage(); - QImage image = qvariant_cast(e->mimeData()->imageData()); - if (!image.isNull()) { - setPixmap(QPixmap::fromImage(image).scaled(size())); - - QPropertyAnimation *scaleAnimation = new QPropertyAnimation(this, "sValue"); - scaleAnimation->setDuration(1000); - scaleAnimation->setStartValue(1); - scaleAnimation->setEndValue(0.3); - - QPropertyAnimation *rotationAnimation = new QPropertyAnimation(this, "rValue"); - rotationAnimation->setDuration(1000); - rotationAnimation->setStartValue(0); - rotationAnimation->setEndValue(360); - - QParallelAnimationGroup * group = new QParallelAnimationGroup(); - group->addAnimation(scaleAnimation); -// group->addAnimation(rotationAnimation); - - group->start(); - emit droped(); - - connect(group, &QPropertyAnimation::finished, [=]{ - hide(); - - scaleAnimation->deleteLater(); - rotationAnimation->deleteLater(); - group->deleteLater(); - }); - } - else { - qWarning() << "Item drop to mask, Image is NULL!"; - } - } - - -} - -void DropMask::dragEnterEvent(QDragEnterEvent *e) -{ - e->accept(); -} - -#include "dockapplayout.moc" - -///////////////////////////////////////////////////////////////////////////////////////////////// -*/ - -DockAppLayout::DockAppLayout(QWidget *parent) : - MovableLayout(parent), m_isDraging(false) -{ -// initDropMask(); - initAppManager(); - -// qApp->installEventFilter(this); - m_ddam = new DBusDockedAppManager(this); - connect(this, &DockAppLayout::drop, this, &DockAppLayout::onDrop); - connect(this, &DockAppLayout::dragLeaved, this, &DockAppLayout::onDragLeave); - connect(this, &DockAppLayout::dragEntered, this, &DockAppLayout::onDragEnter); - - m_dem = new DBusEntryManager(this); -} - -QSize DockAppLayout::sizeHint() const -{ - QSize size; - int w = 0; - int h = 0; - switch (direction()) { - case QBoxLayout::LeftToRight: - case QBoxLayout::RightToLeft: - size.setHeight(DockModeData::instance()->getItemHeight()); - for (QWidget * widget : widgets()) { - w += widget->width(); - } - if (dragingWidget() && isDraging()) { - w += dragingWidget()->width(); - } - else if (getDragFromOutside()){ - w += DockModeData::instance()->getNormalItemWidth(); - } - size.setWidth(w + getLayoutSpacing() * widgets().count()); - break; - case QBoxLayout::TopToBottom: - case QBoxLayout::BottomToTop: - size.setWidth(DockModeData::instance()->getNormalItemWidth()); - for (QWidget * widget : widgets()) { - h += widget->height(); - } - if (dragingWidget()) { - h += dragingWidget()->height(); - } - else if (getDragFromOutside()) { - h += DockModeData::instance()->getItemHeight(); - } - size.setHeight(h + getLayoutSpacing() * widgets().count()); - break; - } - - return size; -} - -void DockAppLayout::initEntries() const -{ - m_appManager->initEntries(); -} - -void DockAppLayout::updateWindowIconGeometries() -{ -// qDebug() << "update window icon geometries."; - - for (QWidget *w : widgets()) { - DockAppItem * item = qobject_cast(w); - if (item) { - item->setWindowIconGeometries(); - } - } -} - -void DockAppLayout::enterEvent(QEvent *e) -{ - Q_UNUSED(e) - - setDragable(true); -} - -void DockAppLayout::resizeEvent(QResizeEvent *e) -{ - MovableLayout::resizeEvent(e); - updateItemWidths(); -} - -//bool DockAppLayout::eventFilter(QObject *obj, QEvent *e) -//{ -// if (e->type() == QEvent::Move) { -// QMoveEvent *me = (QMoveEvent *)e; -// QRect r(0, 0, width(), height()); -// if (me && isDraging() && !r.contains(mapFromGlobal(QCursor::pos()))) { -// //show mask to catch draging widget -// //fixme -// m_mask->move(QCursor::pos().x() - 15, QCursor::pos().y() - 15); //15,拖动时的鼠标位移 -// m_mask->show(); -// } -// } - -// return QWidget::eventFilter(obj, e); -//} - -//void DockAppLayout::initDropMask() -//{ -// m_mask = new DropMask; -// connect(m_mask, &DropMask::droped, this, [=] { -// setIsDraging(false); -// emit requestSpacingItemsDestroy(false); -// setFixedSize(sizeHint()); -// }); -// connect(m_mask, &DropMask::invalidDroped, this, &DockAppLayout::restoreDragingWidget); -// connect(this, &DockAppLayout::dragEntered, m_mask, &DropMask::hide); -// connect(this, &DockAppLayout::startDrag, this, [=](QDrag* drag) { -// setIsDraging(true); - -// if (DockModeData::instance()->getDockMode() == Dock::FashionMode) { -// DockAppItem *item = qobject_cast(dragingWidget()); -// if (item) { -// drag->setPixmap(item->iconPixmap()); -// } -// } - -// emit itemHoverableChange(false); -// }); -//} - -void DockAppLayout::onDrop(QDropEvent *event) -{ -// m_mask ->hide(); - setIsDraging(false); - setDragFromOutside(false); - - if (event->source() == this) { //from itself - m_dem->Reorder(appIds()); - event->accept(); - } else if (event->mimeData()->formats().indexOf("RequestDock") != -1){ //from launcher - QJsonObject dataObj = QJsonDocument::fromJson(event->mimeData()->data("RequestDock")).object(); - if (dataObj.isEmpty() || m_ddam->IsDocked(dataObj.value("appKey").toString())) { - emit requestSpacingItemsDestroy(true); - } - else { - m_ddam->RequestDock(dataObj.value("appKey").toString(), "", "", ""); - m_appManager->setDockingItemId(dataObj.value("appKey").toString()); - - qDebug() << "App drop to dock: " << dataObj.value("appKey").toString(); - } - } else { //from desktop file - QList urls = event->mimeData()->urls(); - if (!urls.isEmpty()) { - QStringList normals; - QStringList desktops; - separateFiles(urls, normals, desktops); - if (desktops.length() > 0) { - for (QString path : desktops) { - if (!isDesktopFileDocked(path)) { - QString appKey = getAppKeyByPath(path); - m_ddam->RequestDock(appKey, "", "", ""); - m_appManager->setDockingItemId(appKey); - - qDebug() << "Desktop file drop to dock: " << appKey; - } - } - } else { - //just normal files, try to open files by the target app - int index = getHoverIndextByPos(mapFromGlobal(QCursor::pos())); - if (index != -1) { - DockAppItem *item = qobject_cast(widget(index)); - item->openFiles(normals); - } - } - } - } - - // interval 0 stands for timeout will be triggered on idle. - QTimer::singleShot(0, this, SLOT(updateWindowIconGeometries())); -} - -void DockAppLayout::onDragLeave(QDragLeaveEvent *event) -{ - Q_UNUSED(event) - - setDragFromOutside(false); -} - -void DockAppLayout::onDragEnter(QDragEnterEvent *event) -{ - if (event->source() == this) { - setDragFromOutside(true); - return; - } - else if (event->mimeData()->formats().indexOf("RequestDock") != -1) { - QJsonObject dataObj = QJsonDocument::fromJson(event->mimeData()->data("RequestDock")).object(); - if (dataObj.isEmpty() || m_ddam->IsDocked(dataObj.value("appKey").toString())) { - setDragable(false); - setDragFromOutside(false); - emit requestSpacingItemsDestroy(false); - } - else { - setDragFromOutside(true); - } - } - else { //from desktop file - QList urls = event->mimeData()->urls(); - if (!urls.isEmpty()) { - QStringList normals; - QStringList desktops; - separateFiles(urls, normals, desktops); - if (desktops.length() > 0) { - for (QString path : desktops) { - //多个文件中只要存在一个有效并且未docked的desktop文件,都可以做拖入dock的操作 - if (!isDesktopFileDocked(path)) { - setDragFromOutside(true); - return; - } - } - } - - setDragable(false); - setDragFromOutside(false); - emit requestSpacingItemsDestroy(false); - } - else { - setDragFromOutside(false); - } - } -} - -void DockAppLayout::initAppManager() -{ - m_appManager = new DockAppManager(this); - connect(m_appManager, &DockAppManager::entryAdded, this, &DockAppLayout::onAppItemAdd); - connect(m_appManager, &DockAppManager::entryAppend, this, &DockAppLayout::onAppAppend); - connect(m_appManager, &DockAppManager::entryRemoved, this, &DockAppLayout::onAppItemRemove); - connect(m_appManager, &DockAppManager::requestSort, this, [=] { - m_dem->Reorder(appIds()); - }); -} - -void DockAppLayout::onAppItemRemove(const QString &id) -{ - QList tmpList = this->widgets(); - for (DockItem * item : tmpList) { - DockAppItem *tmpItem = qobject_cast(item); - if (tmpItem && tmpItem->getItemId() == id) { - removeWidget(item); - tmpItem->setVisible(false); - tmpItem->deleteLater(); - return; - } - } - updateItemWidths(); -} - -void DockAppLayout::onAppItemAdd(DockAppItem *item) -{ - const int index = hoverIndex(); - - if (index == -1) - return onAppAppend(item); - - insertWidget(index, item); - createConnections(item); - updateItemWidths(); -} - -void DockAppLayout::onAppAppend(DockAppItem *item) -{ - - - addWidget(item); - createConnections(item); - updateItemWidths(); -} - -QStringList DockAppLayout::appIds() -{ - QStringList ids; - for (QWidget *w : widgets()) { - DockAppItem * item = qobject_cast(w); - if (item) { - ids << item->getItemId(); - } - } - - return ids; -} - -void DockAppLayout::createConnections(DockAppItem *item) -{ - connect(item, &DockAppItem::needPreviewShow, this, [=](QPoint pos) { - DockAppItem * s = qobject_cast(sender()); - if (s) { - emit needPreviewShow(s, pos); - } - }); - connect(item, &DockAppItem::activatedChanged, this, [this](bool) { - updateItemWidths(); - }); - connect(item, &DockAppItem::needPreviewHide, this, &DockAppLayout::needPreviewHide); - connect(item, &DockAppItem::needPreviewUpdate, this, &DockAppLayout::needPreviewUpdate); - connect(this, &DockAppLayout::itemHoverableChange, item, &DockAppItem::setHoverable); -} - -// update the width of all items according to the spaces that left. -void DockAppLayout::updateItemWidths() -{ - DockModeData *dmd = DockModeData::instance(); - - if (dmd->getDockMode() == Dock::ClassicMode) { - QList activeItems; - QList inactiveItems; - - QList tmpList = this->widgets(); - for (DockItem * item : tmpList) { - DockAppItem *tmpItem = qobject_cast(item); - if (tmpItem->actived()) { - activeItems << tmpItem; - } else { - inactiveItems << tmpItem; - } - } - - int itemsCount = activeItems.length() + inactiveItems.length(); - bool cannotHoldAllAsInactives = itemsCount * dmd->getNormalItemWidth() + itemsCount * getLayoutSpacing() > this->width(); - - if (cannotHoldAllAsInactives || activeItems.length() == 0) { - // TODO: should scale the items or something. - for (DockAppItem *item : activeItems) { - item->setFixedSize(dmd->getActivedItemWidth(), dmd->getItemHeight()); - item->refreshUI(); - } - - for (DockAppItem *item: inactiveItems) { - item->setFixedSize(dmd->getNormalItemWidth(), dmd->getItemHeight()); - item->refreshUI(); - } - } else { - uint normalItemWidth = dmd->getNormalItemWidth(); - int widthLeft = this->width() - inactiveItems.length() * normalItemWidth - itemsCount * getLayoutSpacing(); - int averageItemWidthLeft = widthLeft / activeItems.length(); - uint activeItemWidth = qMin(dmd->getActivedItemWidth(), averageItemWidthLeft); - - for (DockAppItem *item : activeItems) { - item->setFixedSize(activeItemWidth, dmd->getItemHeight()); - item->refreshUI(); - } - - for (DockAppItem *item: inactiveItems) { - item->setFixedSize(normalItemWidth, dmd->getItemHeight()); - item->refreshUI(); - } - } - } else if (dmd->getDockMode() == Dock::EfficientMode){ - const int itemCount = widgets().size(); - const bool canHold = !itemCount || itemCount * dmd->getActivedItemWidth() < width(); - const QList tmpList = this->widgets(); - - const int itemWidth = canHold ? dmd->getActivedItemWidth() : (width() - itemCount * dmd->getAppItemSpacing()) / itemCount; - - if (itemWidth <= 0) - return; - - for (DockItem * item : tmpList) { - DockAppItem *tmpItem = qobject_cast(item); - if (tmpItem) { - tmpItem->setFixedSize(itemWidth, dmd->getDockHeight()); - tmpItem->refreshUI(); - } - } - } else { - QList tmpList = this->widgets(); - for (DockItem * item : tmpList) { - DockAppItem *tmpItem = qobject_cast(item); - if (tmpItem) { - if (tmpItem->actived()) { - tmpItem->setFixedSize(dmd->getActivedItemWidth(), dmd->getDockHeight()); - } else { - tmpItem->setFixedSize(dmd->getNormalItemWidth(), dmd->getDockHeight()); - } - - tmpItem->refreshUI(); - } - } - } -} - -bool DockAppLayout::getDragFromOutside() const -{ - return m_dragFromOutside; -} - -void DockAppLayout::setDragFromOutside(bool dragFromOutside) -{ - m_dragFromOutside = dragFromOutside; -} - -bool DockAppLayout::isDraging() const -{ - return m_isDraging; -} - -void DockAppLayout::setIsDraging(bool isDraging) -{ - m_isDraging = isDraging; - - emit itemHoverableChange(!isDraging); -} - -bool DockAppLayout::isDesktopFileDocked(const QString &path) -{ - QSettings ds(path, QSettings::IniFormat); - ds.setIniCodec(QTextCodec::codecForName("UTF-8")); - ds.beginGroup("Desktop Entry"); - QString appKey = ds.value("X-Deepin-AppID").toString(); - ds.endGroup(); - - return m_ddam->IsDocked(appKey).value(); -} - -QString DockAppLayout::getAppKeyByPath(const QString &path) -{ - QSettings ds(path, QSettings::IniFormat); - ds.setIniCodec(QTextCodec::codecForName("UTF-8")); - ds.beginGroup("Desktop Entry"); - QString appKey = ds.value("X-Deepin-AppID").toString(); - ds.endGroup(); - - return appKey; -} - -void DockAppLayout::separateFiles(const QList &urls, QStringList &normals, QStringList &desktopes) -{ - for (QUrl url : urls) { - if (url.fileName().endsWith(".desktop")) { - QSettings ds(url.path(), QSettings::IniFormat); - ds.setIniCodec(QTextCodec::codecForName("UTF-8")); - ds.beginGroup("Desktop Entry"); - QString appKey = ds.value("X-Deepin-AppID").toString(); - if (!appKey.isEmpty()) { - desktopes << url.path(); - } - else { - normals << url.path(); - } - ds.endGroup(); - } - else { - normals << url.path(); - } - } -} - diff --git a/dde-dock/src/widgets/app/dockapplayout.h b/dde-dock/src/widgets/app/dockapplayout.h deleted file mode 100644 index 65afd6766..000000000 --- a/dde-dock/src/widgets/app/dockapplayout.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKAPPLAYOUT_H -#define DOCKAPPLAYOUT_H - -#include "../movablelayout.h" -#include "../../controller/apps/dockappmanager.h" -#include "../../dbus/dbusdockedappmanager.h" - -//class DropMask; - -class DockAppLayout : public MovableLayout -{ - Q_OBJECT -public: - explicit DockAppLayout(QWidget *parent = 0); - - QSize sizeHint() const Q_DECL_OVERRIDE; - void initEntries() const; - -public slots: - void updateWindowIconGeometries(); - void updateItemWidths(); - -signals: - void needPreviewUpdate(); - void needPreviewHide(bool immediately); - void needPreviewShow(DockItem *item, QPoint pos); - void itemHoverableChange(bool v); - -protected: - void enterEvent(QEvent *e) Q_DECL_OVERRIDE; -// bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - -private: - void initDropMask(); - void initAppManager(); - - bool isDraging() const; - bool getDragFromOutside() const; - void setIsDraging(bool isDraging); - void setDragFromOutside(bool dragFromOutside); - bool isDesktopFileDocked(const QString &path); - QString getAppKeyByPath(const QString &path); - void separateFiles(const QList &urls, QStringList &normals, QStringList &desktopes); - - void onDrop(QDropEvent *event); - void onDragLeave(QDragLeaveEvent *event); - void onDragEnter(QDragEnterEvent *event); - void onAppItemRemove(const QString &id); - void onAppItemAdd(DockAppItem *item); - void onAppAppend(DockAppItem *item); - - QStringList appIds(); - -private: - bool m_isDraging; - bool m_dragFromOutside; //mark to determine sizeHint should be plus the spacing -// DropMask *m_mask; - DockAppManager *m_appManager; - DBusDockedAppManager *m_ddam; - DBusEntryManager *m_dem; - - void createConnections(DockAppItem *item); -}; - -#endif // DOCKAPPLAYOUT_H diff --git a/dde-dock/src/widgets/dockitem.cpp b/dde-dock/src/widgets/dockitem.cpp deleted file mode 100644 index af30416e9..000000000 --- a/dde-dock/src/widgets/dockitem.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include - -#include "dockitem.h" -#include "dbus/dbusdisplay.h" - - -const int CONTENT_PREVIEW_INTERVAL = 200; -const int DOCK_PREVIEW_MARGIN = 8; - -class DockItemTitle : public QLabel -{ -public: - explicit DockItemTitle(QWidget * parent = 0); - - void setTitle(QString title); -}; - -DockItemTitle::DockItemTitle(QWidget *parent) : - QLabel(parent) -{ - setObjectName("DockAppTitle"); - setAlignment(Qt::AlignCenter); -} - -void DockItemTitle::setTitle(QString title) -{ - setText(title); - - QFontMetrics fm(font()); - int textWidth = fm.width(title); - - int fitWidth = textWidth + 20; - - resize(fitWidth < 80 ? 80 : fitWidth, 20); -} - -DockItem::DockItem(QWidget * parent) : - QFrame(parent), - m_highlight(nullptr), - m_dbusMenu(nullptr), - m_dbusMenuManager(nullptr) -{ - - setAttribute(Qt::WA_TranslucentBackground); - - m_titleLabel = new DockItemTitle; - m_titlePreview = new PreviewWindow(DArrowRectangle::ArrowBottom); -} - -DockItem::~DockItem() -{ - delete m_highlight; - delete m_titleLabel; -} - - -bool DockItem::hoverable() const -{ - return m_hoverable; -} - -void DockItem::setHoverable(bool hoverable) -{ - m_hoverable = hoverable; -} - -int DockItem::globalX() -{ - return mapToGlobal(QPoint(0,0)).x(); -} - -int DockItem::globalY() -{ - return mapToGlobal(QPoint(0,0)).y(); -} - -QPoint DockItem::globalPos() -{ - return mapToGlobal(QPoint(0,0)); -} - -void DockItem::showPreview(const QPoint &previewPos) -{ - //make sure parentWidget() is valuable befor init hightlight - if (!m_highlight && parentWidget()) { - initHighlight(); - } - - if (!m_titlePreview->isHidden()) { - m_titlePreview->resizeWithContent(); - return; - } - - QPoint pos = previewPos.isNull() - ? QPoint(globalX() + width() / 2, globalY() - DOCK_PREVIEW_MARGIN) - : previewPos; - - if (getApplet() == NULL) { - QString title = getTitle(); - if (!title.isEmpty()) { - m_titleLabel->setTitle(title); - - m_titlePreview->setArrowX(-1); //reset position - m_titlePreview->setContent(m_titleLabel); - m_titlePreview->showPreview(pos.x(), - pos.y() + DOCK_PREVIEW_MARGIN - - 2 - //minute adjustment - m_titlePreview->shadowYOffset() + - m_titlePreview->shadowBlurRadius() + - m_titlePreview->shadowDistance(), - CONTENT_PREVIEW_INTERVAL); - } - } - else { - m_titleLabel->setParent(NULL); - emit needPreviewShow(pos); - } -} - -void DockItem::hidePreview(bool immediately) -{ - m_titlePreview->hidePreview(immediately); - - emit needPreviewHide(immediately); -} - -void DockItem::setFixedSize(int width, int height) -{ - QFrame::setFixedSize(width, height); - - if (m_highlight) { - m_highlight->setFixedSize(size()); - m_highlight->setVisible(false); - } -} - -void DockItem::showMenu(const QPoint &menuPos) -{ - if (getMenuContent().isEmpty()) return; - - hidePreview(true); - - if (m_dbusMenuManager == nullptr) { - m_dbusMenuManager = new DBusMenuManager(this); - } - - QDBusPendingReply pr = m_dbusMenuManager->RegisterMenu(); - pr.waitForFinished(); - - if (pr.isValid()) { - QDBusObjectPath op = pr.value(); - - if (m_dbusMenu != nullptr) { - m_dbusMenu->deleteLater(); - } - - m_dbusMenu = new DBusMenu(op.path(), this); - - connect(m_dbusMenu, &DBusMenu::ItemInvoked, this, &DockItem::invokeMenuItem); - connect(m_dbusMenu, &DBusMenu::MenuUnregistered, [=] { - setHoverable(true); - }); - - QPoint pos = menuPos.isNull() ? QPoint(globalX() + width() / 2, globalY()) : menuPos; - QJsonObject targetObj; - targetObj.insert("x", QJsonValue(pos.x())); - targetObj.insert("y", QJsonValue(pos.y())); - targetObj.insert("isDockMenu", QJsonValue(true)); - targetObj.insert("menuJsonContent", QJsonValue(getMenuContent())); - - m_dbusMenu->ShowMenu(QString(QJsonDocument(targetObj).toJson())); - - setHoverable(false); - } -} - -QString DockItem::getMenuContent() -{ - return ""; -} - -void DockItem::invokeMenuItem(QString, bool) -{ - -} - -QPixmap DockItem::grab(const QRect &rectangle) -{ - return QWidget::grab(rectangle); -} - -void DockItem::initHighlight() -{ - m_highlight = new HighlightEffect(this, parentWidget()); - - connect(this, &DockItem::mousePress, [=](){ - m_highlight->move(pos()); - m_highlight->showDarker(); - }); - connect(this, &DockItem::mouseRelease, [=](){ - m_highlight->move(pos()); - m_highlight->showLighter(); - }); - connect(this, &DockItem::mouseEnter, [=](){ - m_highlight->move(pos()); - m_highlight->showLighter(); - m_highlight->setVisible(true); - }); - connect(this, &DockItem::mouseLeave, [=](){ - if (!m_highlight->isVisible()) - return; - m_highlight->setVisible(false); - m_highlight->move(pos()); - }); -} - -void DockItem::resizeEvent(QResizeEvent * event) -{ - Q_UNUSED(event) - - if (m_highlight) { - m_highlight->setFixedSize(size()); - m_highlight->setVisible(false); - } -} - -void DockItem::moveEvent(QMoveEvent *) -{ - if (m_highlight) - m_highlight->setVisible(false); -} diff --git a/dde-dock/src/widgets/dockitem.h b/dde-dock/src/widgets/dockitem.h deleted file mode 100644 index e1e9a8abc..000000000 --- a/dde-dock/src/widgets/dockitem.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKITEM_H -#define DOCKITEM_H - -#include -#include -#include -#include - -#include "previewwindow.h" -#include "highlighteffect.h" -#include "dbus/dbusmenu.h" -#include "dbus/dbusmenumanager.h" -#include "interfaces/dockconstants.h" - -class DockItemTitle; -class DockItem : public QFrame -{ - Q_OBJECT -public: - explicit DockItem(QWidget *parent = 0); - virtual ~DockItem(); - - virtual QString getTitle() = 0; - virtual QString getItemId() = 0; - virtual QWidget * getApplet() = 0; - virtual QString getMenuContent(); - virtual void invokeMenuItem(QString menuItemId, bool checked); - virtual QPixmap grab(const QRect &rectangle = QRect(QPoint(0, 0), QSize(-1, -1))); - - void showMenu(const QPoint &menuPos = QPoint(0, 0)); - void showPreview(const QPoint &previewPos = QPoint(0, 0)); - void hidePreview(bool immediately = false); - void setFixedSize(int width, int height); - - int globalX(); - int globalY(); - QPoint globalPos(); - - bool hoverable() const; - void setHoverable(bool hoverable); - -signals: - void needPreviewHide(bool immediately); - void needPreviewShow(QPoint pos); - void needPreviewUpdate(); - //signals for hightlight - void mouseEnter(); - void mouseLeave(); - void mousePress(); - void mouseRelease(); - -protected: - bool m_hoverable = true; - HighlightEffect * m_highlight; - PreviewWindow *m_titlePreview; - DockItemTitle *m_titleLabel; - DBusMenu * m_dbusMenu; - DBusMenuManager * m_dbusMenuManager; - - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; - void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE; - -private: - void initHighlight(); - -}; - -#endif // DOCKITEM_H diff --git a/dde-dock/src/widgets/highlighteffect.cpp b/dde-dock/src/widgets/highlighteffect.cpp deleted file mode 100644 index 009d4128b..000000000 --- a/dde-dock/src/widgets/highlighteffect.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "highlighteffect.h" - -HighlightEffect::HighlightEffect(QWidget * source, QWidget *parent) : - QWidget(parent), - m_source(source) -{ - setFixedSize(m_source->size()); - setAttribute(Qt::WA_TransparentForMouseEvents); -} - - -int HighlightEffect::lighter() const -{ - return m_lighter; -} - -void HighlightEffect::setLighter(int lighter) -{ - m_lighter = lighter; -} - -int HighlightEffect::darker() const -{ - return m_darker; -} - -void HighlightEffect::setDarker(int darker) -{ - m_darker = darker; -} - -void HighlightEffect::showDarker() -{ - setVisible(true); - - m_effectState = ESDarker; - - update(); -} - -void HighlightEffect::showLighter() -{ - setVisible(true); - - m_effectState = ESLighter; - - update(); -} - -void HighlightEffect::showNormal() -{ - setVisible(true); - - m_effectState = ESNormal; - - update(); -} - -void HighlightEffect::resizeEvent(QResizeEvent * event) -{ - QWidget::resizeEvent(event); - - update(); -} - -void HighlightEffect::paintEvent(QPaintEvent *) -{ - if (m_source && m_source->isVisible()) - { - QPixmap pixmap = m_source->grab(); - - QPainter painter; - painter.begin(&pixmap); - - painter.setCompositionMode(QPainter::CompositionMode_SourceIn); - - if (m_effectState == ESLighter) { - painter.fillRect(pixmap.rect(), QColor::fromRgbF(1, 1, 1, 0.2)); - } else if (m_effectState == ESDarker) { - painter.fillRect(pixmap.rect(), QColor::fromRgbF(0, 0, 0, 0.2)); - } - - painter.end(); - - painter.begin(this); - painter.drawPixmap(0, 0, pixmap); - painter.end(); - } -} - -void HighlightEffect::pixmapLigher(QPixmap *pixmap) -{ - QImage img = pixmap->toImage(); // slow - - for (int y=0; y < img.height(); y++) - { - for (int x = 0; x < img.width(); x++) - { - QRgb pix = img.pixel(x,y); - QColor col(pix); - col = col.lighter(m_lighter); - img.setPixel(x, y, qRgba(col.red(), col.green(), col.blue(), qAlpha(pix))); - } - } - pixmap->convertFromImage(img); // slow -} - -void HighlightEffect::pixmapDarker(QPixmap *pixmap) -{ - QImage img = pixmap->toImage(); // slow - - for (int y=0; y < img.height(); y++) - { - for (int x = 0; x < img.width(); x++) - { - QRgb pix = img.pixel(x,y); - QColor col(pix); - col = col.darker(m_darker); - img.setPixel(x, y, qRgba(col.red(), col.green(), col.blue(), qAlpha(pix))); - } - } - pixmap->convertFromImage(img); // slow -} diff --git a/dde-dock/src/widgets/highlighteffect.h b/dde-dock/src/widgets/highlighteffect.h deleted file mode 100644 index 937626ba6..000000000 --- a/dde-dock/src/widgets/highlighteffect.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef HIGHLIGHTEFFECT_H -#define HIGHLIGHTEFFECT_H - -#include -#include -#include -#include - -class HighlightEffect : public QWidget -{ - Q_OBJECT -public: - HighlightEffect(QWidget * source, QWidget *parent = 0); - - enum EffectState { - ESNormal, - ESLighter, - ESDarker - }; - - int lighter() const; - void setLighter(int lighter); - int darker() const; - void setDarker(int darker); - - void showDarker(); - void showLighter(); - void showNormal(); - -protected: - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; - -private: - QWidget * m_source; - int m_lighter = 110; - int m_darker = 150; - EffectState m_effectState = ESNormal; - - - void pixmapLigher(QPixmap * pixmap); - void pixmapDarker(QPixmap * pixmap); -}; - -#endif // HIGHLIGHTEFFECT_H diff --git a/dde-dock/src/widgets/launcher/docklauncheritem.cpp b/dde-dock/src/widgets/launcher/docklauncheritem.cpp deleted file mode 100644 index ebd0adbfb..000000000 --- a/dde-dock/src/widgets/launcher/docklauncheritem.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include "docklauncheritem.h" -#include "controller/signalmanager.h" - -DockLauncherItem::DockLauncherItem(QWidget *parent) - : DockItem(parent), - m_launcherInter(new DBusLauncherController(this)) -{ - setFixedSize(m_dockModeData->getNormalItemWidth(), m_dockModeData->getItemHeight()); - connect(m_dockModeData, &DockModeData::dockModeChanged, this, &DockLauncherItem::changeDockMode); - - m_appIcon = new DockAppIcon(this); - m_appIcon->resize(height(), height()); -// connect(m_appIcon, &DockAppIcon::mousePress, this, &DockLauncherItem::slotMousePress); -// connect(m_appIcon, &DockAppIcon::mouseRelease, this, &DockLauncherItem::slotMouseRelease); - connect(m_appIcon, &DockAppIcon::mouseRelease, this, &DockLauncherItem::startupLauncher); - connect(this, &DockLauncherItem::mouseRelease, this, &DockLauncherItem::startupLauncher); - - //TODO icon not show on init - QTimer::singleShot(20, this, SLOT(updateIcon())); - connect(SignalManager::instance(), &SignalManager::requestAppIconUpdate, this, &DockLauncherItem::updateIcon); -} - -void DockLauncherItem::enterEvent(QEvent *) -{ - if (hoverable()) { - showPreview(); - emit mouseEnter(); - } -} - -void DockLauncherItem::leaveEvent(QEvent *) -{ - hidePreview(); - emit mouseLeave(); -} - -void DockLauncherItem::mousePressEvent(QMouseEvent *event) -{ - if (m_dockModeData->getDockMode() != Dock::FashionMode) - slotMousePress(event); - else - DockItem::mousePressEvent(event); - - emit mousePress(); -} - -void DockLauncherItem::mouseReleaseEvent(QMouseEvent *event) -{ - if (m_dockModeData->getDockMode() != Dock::FashionMode) - slotMouseRelease(event); - else - DockItem::mouseReleaseEvent(event); - - emit mouseRelease(); -} - -void DockLauncherItem::slotMousePress(QMouseEvent *event) -{ - if (event->button() != Qt::LeftButton) - return; - - hidePreview(); -} - -void DockLauncherItem::slotMouseRelease(QMouseEvent *event) -{ - if (event->button() != Qt::LeftButton) - return; - -// startupLauncher(); -} - -void DockLauncherItem::changeDockMode(Dock::DockMode, Dock::DockMode) -{ - setFixedSize(m_dockModeData->getNormalItemWidth(), m_dockModeData->getItemHeight()); - updateIcon(); -} - -void DockLauncherItem::updateIcon() -{ - m_appIcon->setIcon("deepin-launcher"); - m_appIcon->resize(m_dockModeData->getAppIconSize(), m_dockModeData->getAppIconSize()); - reanchorIcon(); -} - -void DockLauncherItem::reanchorIcon() -{ - switch (m_dockModeData->getDockMode()) { - case Dock::FashionMode: - m_appIcon->move((width() - m_appIcon->width()) / 2, 0); - break; - case Dock::EfficientMode: - m_appIcon->move((width() - m_appIcon->width()) / 2, (height() - m_appIcon->height()) / 2); - break; - case Dock::ClassicMode: - m_appIcon->move((height() - m_appIcon->height()) / 2, (height() - m_appIcon->height()) / 2); - default: - break; - } -} - -void DockLauncherItem::startupLauncher() -{ - if (m_launcherInter->isValid()) - { - m_launcherInter->Toggle(); - return; - } - - QProcess *proc = new QProcess; - - connect(proc, static_cast(&QProcess::finished), proc, &QProcess::deleteLater); - - QStringList args = QStringList() << "--print-reply" - << "--dest=com.deepin.dde.Launcher" - << "/com/deepin/dde/Launcher" - << "com.deepin.dde.Launcher.Toggle"; - - proc->start("dbus-send", args); -} - -DockLauncherItem::~DockLauncherItem() -{ - -} - diff --git a/dde-dock/src/widgets/launcher/docklauncheritem.h b/dde-dock/src/widgets/launcher/docklauncheritem.h deleted file mode 100644 index 9d8bfccce..000000000 --- a/dde-dock/src/widgets/launcher/docklauncheritem.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKLAUNCHERITEM_H -#define DOCKLAUNCHERITEM_H - -#include - -#include "../dockitem.h" -#include "../app/dockappicon.h" -#include "controller/dockmodedata.h" -#include "interfaces/dockconstants.h" -#include "dbus/dbuslaunchercontroller.h" - -class QProcess; - -class DockLauncherItem : public DockItem -{ - Q_OBJECT -public: - explicit DockLauncherItem(QWidget *parent = 0); - ~DockLauncherItem(); - - QString getItemId() Q_DECL_OVERRIDE {return "dde-launcher";} - QString getTitle() Q_DECL_OVERRIDE { return tr("Launcher"); } - QWidget * getApplet() Q_DECL_OVERRIDE { return NULL; } - -protected: - void enterEvent(QEvent *) Q_DECL_OVERRIDE; - void leaveEvent(QEvent *) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - -private slots: - void slotMousePress(QMouseEvent *event); - void slotMouseRelease(QMouseEvent *event); - void updateIcon(); - -private: - void changeDockMode(Dock::DockMode newMode, Dock::DockMode oldMode); - void reanchorIcon(); - void startupLauncher(); - -private: - DockAppIcon * m_appIcon; - DBusLauncherController *m_launcherInter; - QString m_menuInterfacePath = ""; - DockModeData * m_dockModeData = DockModeData::instance(); -}; - -#endif // DOCKLAUNCHERITEM_H diff --git a/dde-dock/src/widgets/movablelayout.cpp b/dde-dock/src/widgets/movablelayout.cpp deleted file mode 100644 index 1c5281cce..000000000 --- a/dde-dock/src/widgets/movablelayout.cpp +++ /dev/null @@ -1,621 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include -#include -#include -#include "movablelayout.h" - -class MovableSpacingItem : public QWidget -{ - Q_OBJECT - Q_PROPERTY(QSize size READ size WRITE setFixedSize) -public: - explicit MovableSpacingItem(int duration, QEasingCurve::Type easingType, const QSize &targetSize, QWidget *parent = 0); - -signals: - void growFinish(); - void declineFinish(); - -public slots: - void StartGrow(bool immediately = false); - void StartDecline(bool immediately); - -private: - QSize m_targetSize; - QPropertyAnimation *m_growAnimation; - QPropertyAnimation *m_declineAnimation; -}; - -MovableSpacingItem::MovableSpacingItem(int duration, QEasingCurve::Type easingType, const QSize &targetSize, QWidget *parent) - : QWidget(parent), m_targetSize(targetSize) -{ - setFixedSize(0, 0); - m_growAnimation = new QPropertyAnimation(this, "size"); - m_growAnimation->setDuration(duration); - m_growAnimation->setEasingCurve(easingType); - m_declineAnimation = new QPropertyAnimation(this, "size"); - m_declineAnimation->setDuration(duration); - m_declineAnimation->setEasingCurve(easingType); - connect(m_declineAnimation, &QPropertyAnimation::finished, this, &MovableSpacingItem::declineFinish); -} - -void MovableSpacingItem::StartGrow(bool immediately) -{ - if (immediately) { - setFixedSize(m_targetSize); - return; - } - - m_declineAnimation->stop(); - - m_growAnimation->setStartValue(this->size()); - m_growAnimation->setEndValue(m_targetSize); - - m_growAnimation->start(); -} - -void MovableSpacingItem::StartDecline(bool immediately) -{ - if (immediately) { - setFixedSize(0, 0); - emit declineFinish(); - } else { - m_growAnimation->stop(); - - m_declineAnimation->setStartValue(this->size()); - m_declineAnimation->setEndValue(QSize(0, 0)); - - m_declineAnimation->start(); - } -} - -#include "movablelayout.moc" -/////////////////////////////////////////////////////////////////////////// - -const int INVALID_MOVE_RADIUS = 5; -const int MAX_SPACINGITEM_COUNT = 2; -const int ANIMATION_DURATION = 300; -const QSize DEFAULT_SPACING_ITEM_SIZE = QSize(48, 48); -const QEasingCurve::Type ANIMATION_CURVE = QEasingCurve::OutCubic; - -MovableLayout::MovableLayout(QWidget *parent) - : QFrame(parent), - m_lastHoverIndex(-1), - m_animationDuration(ANIMATION_DURATION), - m_draginItem(nullptr), - m_defaultSpacingItemSize(DEFAULT_SPACING_ITEM_SIZE), - m_animationCurve(ANIMATION_CURVE) -{ - setAttribute(Qt::WA_TranslucentBackground); - - initSizeAniamtion(); - - m_layout = new QHBoxLayout(this); - m_layout->setSpacing(0); - m_layout->setContentsMargins(0, 0, 0, 0); - setAcceptDrops(true); -} - -MovableLayout::MovableLayout(QBoxLayout::Direction direction, QWidget *parent) - : QFrame(parent), - m_lastHoverIndex(-1), - m_animationDuration(ANIMATION_DURATION), - m_draginItem(nullptr), - m_defaultSpacingItemSize(DEFAULT_SPACING_ITEM_SIZE), - m_animationCurve(ANIMATION_CURVE) -{ - setAttribute(Qt::WA_TranslucentBackground); - - initSizeAniamtion(); - - m_layout = new QHBoxLayout(this); - m_layout->setDirection(direction); - m_layout->setSpacing(0); - m_layout->setContentsMargins(0, 0, 0, 0); - setAcceptDrops(true); -} - -bool MovableLayout::dragable() const -{ - return m_dragable; -} - -int MovableLayout::indexOf(DockItem * const widget, int from) const -{ - return m_widgetList.indexOf(widget, from); -} - -QWidget *MovableLayout::dragingWidget() const -{ - return m_draginItem; -} - -QWidget *MovableLayout::widget(int index) const -{ - return m_widgetList.at(index); -} - -QList MovableLayout::widgets() const -{ - return m_widgetList; -} - -void MovableLayout::addWidget(DockItem *widget) -{ - m_widgetList.append(widget); - - switch (m_layout->direction()) { - case QBoxLayout::LeftToRight: - case QBoxLayout::TopToBottom: - m_layout->takeAt(m_layout->count() - 1);//remove strect - m_layout->addWidget(widget); - m_layout->addStretch(1); - break; - case QBoxLayout::RightToLeft: - case QBoxLayout::BottomToTop: - m_layout->takeAt(0);//remove strect - m_layout->addWidget(widget); - m_layout->insertStretch(0, 1); - break; - default: - break; - } -} - -void MovableLayout::insertWidget(int index, DockItem *widget) -{ - m_widgetList.insert(index, widget); - m_layout->insertWidget(index, widget); -} - -void MovableLayout::removeWidget(int index) -{ - m_layout->removeWidget(m_widgetList.takeAt(index)); -} - -void MovableLayout::removeWidget(DockItem *widget) -{ - m_layout->removeWidget(widget); - m_widgetList.removeAll(widget); -} - -void MovableLayout::addSpacingItem(QWidget *souce, MovableLayout::MoveDirection md, const QSize &size) -{ - int layoutCount = m_layout->count(); - for (int i = 0; i < layoutCount; i ++) { - if (m_layout->itemAt(i)->widget() == souce) { - MovableSpacingItem *item; - int tmpIndex = i; - switch (md) { - case MoveLeftToRight: - case MoveTopToBottom: - tmpIndex = i == layoutCount - 1 ? layoutCount - 1 : i + 1; - item = qobject_cast(m_layout->itemAt(tmpIndex)->widget()); - if (item) { - //note to other - emit requestSpacingItemsDestroy(false); - item->StartGrow(); - } else { - insertSpacingItemToLayout(tmpIndex, size); - } - break; - case MoveRightToLeft: - case MoveBottomToTop: - tmpIndex = i ; - item = qobject_cast(m_layout->itemAt(tmpIndex)->widget()); - if (item) { - //note to other - emit requestSpacingItemsDestroy(false); - item->StartGrow(); - } else { - insertSpacingItemToLayout(tmpIndex, size); - } - break; - default: - return; - } - - break; - } else { - continue; - } - } -} - -int MovableLayout::count() const -{ - return m_widgetList.count(); -} - -int MovableLayout::hoverIndex() const -{ - bool head = true; - switch (direction()) { - case QBoxLayout::TopToBottom: - case QBoxLayout::BottomToTop: - if (m_vMoveDirection == MoveBottomToTop) { - head = false; - } - case QBoxLayout::LeftToRight: - case QBoxLayout::RightToLeft: - if (m_hMoveDirection == MoveRightToLeft) { - head = false; - } - } - - return head ? m_lastHoverIndex : m_lastHoverIndex + 1; -} - -QBoxLayout::Direction MovableLayout::direction() const -{ - return m_layout->direction(); -} - -void MovableLayout::setDirection(QBoxLayout::Direction direction) -{ - m_layout->setDirection(direction); -} - -int MovableLayout::getLayoutSpacing() const -{ - return m_layout->spacing(); -} - -void MovableLayout::setLayoutSpacing(int spacing) -{ - m_layout->setSpacing(spacing); -} - -void MovableLayout::mouseMoveEvent(QMouseEvent *event) -{ - if (!m_dragable) - return; - - static QPoint basePos(0, 0); - - // only response left button drag - if (event->buttons() != Qt::LeftButton) { - return; - } - - //小范围内拖动无效 - if (basePos.isNull()) { - basePos = event->pos(); - return; - } else { - if (qAbs(event->pos().x() - basePos.x()) > INVALID_MOVE_RADIUS || - qAbs(event->pos().y() - basePos.y()) > INVALID_MOVE_RADIUS) { - basePos = QPoint(0, 0); - } else { - return; - } - } - - int index = getHoverIndextByPos(event->pos()); - if (index == -1) { - return; - } - - m_draginItem = m_widgetList.at(index); - m_lastHoverIndex = index; - storeDragingWidget(); - - // drag and mimeData object will delete automatically - QDrag *drag = new QDrag(this); - QMimeData *mimeData = new QMimeData(); - QPixmap dataImg = m_draginItem->grab(); - mimeData->setImageData(QVariant(dataImg.toImage())); - drag->setMimeData(mimeData); - drag->setHotSpot(QPoint(15, 15)); - drag->setPixmap(dataImg); - - emit startDrag(drag); - - const Qt::DropAction act = drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::MoveAction); - if (act == Qt::IgnoreAction) - restoreDragingWidget(); -} - -void MovableLayout::dragEnterEvent(QDragEnterEvent *event) -{ - setDragable(true); - handleDrag(event->pos()); - event->accept(); - - emit dragEntered(event); -} - -void MovableLayout::dragLeaveEvent(QDragLeaveEvent *event) -{ - Q_UNUSED(event) - - emit dragLeaved(event); - emit requestSpacingItemsDestroy(false); -} - -void MovableLayout::dragMoveEvent(QDragMoveEvent *event) -{ - if (!m_dragable || (m_layout->count() > m_widgetList.count() + MAX_SPACINGITEM_COUNT)) { - return; - } - - handleDrag(event->pos()); -} - -void MovableLayout::dropEvent(QDropEvent *event) -{ - if (m_draginItem && event->source() == this) { - //判断拖动对象是否在layout的空旷区域中drop,如果是,则把拖拽中的widget插入末尾(layout的前部总是会被填满) - QWidget *lw = m_widgetList.last(); - switch (direction()) { - case QBoxLayout::TopToBottom: - if (event->pos().y() > (lw->pos().y() + lw->height())) { - m_lastHoverIndex = m_widgetList.length() - 1; - m_vMoveDirection = MoveBottomToTop; - } - break; - case QBoxLayout::LeftToRight: - if (event->pos().x() > (lw->pos().x() + lw->width())) { - m_lastHoverIndex = m_widgetList.length() - 1; - m_hMoveDirection = MoveRightToLeft; - } - break; - case QBoxLayout::BottomToTop: - if (event->pos().y() < (lw->pos().y() - lw->height())) { - m_lastHoverIndex = m_widgetList.length() - 1; - m_vMoveDirection = MoveTopToBottom; - } - break; - case QBoxLayout::RightToLeft: - if (event->pos().x() < (lw->pos().x() - lw->width())) { - m_lastHoverIndex = m_widgetList.length() - 1; - m_hMoveDirection = MoveLeftToRight; - } - break; - default: - break; - } - - restoreDragingWidget(); - } - - emit requestSpacingItemsDestroy(false); - emit drop(event); -} - -void MovableLayout::resizeEvent(QResizeEvent *event) -{ - emit sizeChanged(event); -} - -void MovableLayout::showEvent(QShowEvent *e) -{ - setFixedSize(sizeHint()); - - QFrame::showEvent(e); -} - -void MovableLayout::initSizeAniamtion() -{ - m_sizeAnimation = new QPropertyAnimation(this, "size"); - m_sizeAnimation->setDuration(ANIMATION_DURATION); - m_sizeAnimation->setEasingCurve(ANIMATION_CURVE); -} - -void MovableLayout::storeDragingWidget() -{ - m_draginItem->setVisible(false); - removeWidget(m_draginItem); - insertSpacingItemToLayout(m_lastHoverIndex, m_draginItem->size(), true); -} - -void MovableLayout::restoreDragingWidget() -{ - m_draginItem->setVisible(true); - insertWidget(hoverIndex(), m_draginItem); - m_draginItem = nullptr; - - //destroy all spacingitem make drop look smooth - emit requestSpacingItemsDestroy(true); -} - -void MovableLayout::insertSpacingItemToLayout(int index, const QSize &size, bool immediately) -{ - //note to other - emit requestSpacingItemsDestroy(false); - - MovableSpacingItem *nItem = new MovableSpacingItem(m_animationDuration, m_animationCurve, size); - connect(this, &MovableLayout::requestSpacingItemsDestroy, nItem, &MovableSpacingItem::StartDecline); - connect(nItem, &MovableSpacingItem::declineFinish, [ = ] { - m_layout->removeWidget(nItem); - nItem->deleteLater(); - }); - m_layout->insertWidget(index, nItem); - nItem->StartGrow(immediately); -} - -MovableLayout::MoveDirection MovableLayout::getVMoveDirection(int index, const QPoint &pos) -{ - QWidget *widget = m_widgetList.at(index); - if (widget) { - QPoint pp = widget->mapToParent(QPoint(0, 0)); - QRect wr = widget->geometry(); - wr.moveTo(pp); - if (wr.contains(pos)) { - QRect topArea(wr.x(), wr.y(), wr.width(), wr.height() / 2); - if (topArea.contains(pos)) { - return MoveTopToBottom; - } else { - return MoveBottomToTop; - } - } else { - return MoveUnknow; - } - } else { - return MoveUnknow; - } -} - -MovableLayout::MoveDirection MovableLayout::getHMoveDirection(int index, const QPoint &pos) -{ - QWidget *widget = m_widgetList.at(index); - if (widget) { - QPoint pp = widget->mapToParent(QPoint(0, 0)); - QRect wr = widget->geometry(); - wr.moveTo(pp); - if (wr.contains(pos)) { - QRect leftArea(wr.x(), wr.y(), wr.width() / 2, wr.height()); - if (leftArea.contains(pos)) { - return MoveLeftToRight; - } else { - return MoveRightToLeft; - } - } else { - return MoveUnknow; - } - } else { - return MoveUnknow; - } -} - -bool MovableLayout::getAutoResize() const -{ - return m_autoResize; -} - -void MovableLayout::setAutoResize(bool autoResize) -{ - m_autoResize = autoResize; -} - -void MovableLayout::setAlignment(Qt::Alignment alignment) -{ - m_layout->setAlignment(alignment); -} - -QEasingCurve::Type MovableLayout::getAnimationCurve() const -{ - return m_animationCurve; -} - -void MovableLayout::setAnimationCurve(const QEasingCurve::Type &animationCurve) -{ - m_animationCurve = animationCurve; -} - -int MovableLayout::getAnimationDuration() const -{ - return m_animationDuration; -} - -void MovableLayout::setAnimationDuration(int animationDuration) -{ - m_animationDuration = animationDuration; -} - -QSize MovableLayout::getDefaultSpacingItemSize() const -{ - return m_defaultSpacingItemSize; -} - -void MovableLayout::setDefaultSpacingItemSize(const QSize &defaultSpacingItemSize) -{ - m_defaultSpacingItemSize = defaultSpacingItemSize; -} - -void MovableLayout::setDuration(int v) -{ - m_animationDuration = v; -} - -void MovableLayout::setDragable(bool v) -{ - m_dragable = v; -} - -void MovableLayout::setEasingCurve(QEasingCurve::Type curve) -{ - m_animationCurve = curve; -} - -bool MovableLayout::event(QEvent *e) -{ - if (e->type() == QEvent::LayoutRequest && getAutoResize() && isVisible()) - { - m_sizeAnimation->setStartValue(size()); - m_sizeAnimation->setEndValue(sizeHint()); - m_sizeAnimation->start(); - } - - return QFrame::event(e); -} - -int MovableLayout::getHoverIndextByPos(const QPoint &pos) -{ - for (int i = 0; i < m_widgetList.count(); i ++) { - QWidget *widget = m_widgetList.at(i); - QPoint pp = widget->mapToParent(QPoint(0, 0)); - QRect wr = widget->geometry(); - wr.moveTo(pp); - if (wr.contains(pos)) { - return i; - } - } - - return -1; -} - -void MovableLayout::handleDrag(const QPoint &pos) -{ - int index = getHoverIndextByPos(pos); - if (index != -1) { - QSize spacingSize = m_draginItem ? m_draginItem->size() : m_defaultSpacingItemSize; - bool shouldAddSpacing = false; - MoveDirection d = MoveUnknow; - - switch (m_layout->direction()) { - case QBoxLayout::LeftToRight: - case QBoxLayout::RightToLeft: - //the same index but direction rever - if (index != m_lastHoverIndex || (m_hMoveDirection != getHMoveDirection(index, pos))) { - shouldAddSpacing = true; - d = m_hMoveDirection; - } - break; - case QBoxLayout::TopToBottom: - case QBoxLayout::BottomToTop: - if (index != m_lastHoverIndex || (m_vMoveDirection != getVMoveDirection(index, pos))) { - shouldAddSpacing = true; - d = m_vMoveDirection; - } - break; - } - - if (shouldAddSpacing) { - updateCurrentHoverInfo(index, pos); - addSpacingItem(m_widgetList.at(index), d, spacingSize); - } - - m_hoverToSpacing = false; - } else { - m_hoverToSpacing = true; - } -} - -void MovableLayout::updateCurrentHoverInfo(int index, const QPoint &pos) -{ - m_lastHoverIndex = index; - m_vMoveDirection = getVMoveDirection(index, pos); - m_hMoveDirection = getHMoveDirection(index, pos); -} - diff --git a/dde-dock/src/widgets/movablelayout.h b/dde-dock/src/widgets/movablelayout.h deleted file mode 100644 index 752cb943a..000000000 --- a/dde-dock/src/widgets/movablelayout.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef MOVABLELAYOUT_H -#define MOVABLELAYOUT_H - -#include -#include -#include -#include -#include - -#include "dockitem.h" - -class QDrag; -class QPropertyAnimation; - -class MovableLayout : public QFrame -{ - Q_OBJECT - Q_PROPERTY(QSize size READ size WRITE setFixedSize) -public: - enum MoveDirection { - MoveLeftToRight, - MoveRightToLeft, - MoveTopToBottom, - MoveBottomToTop, - MoveUnknow - }; - - explicit MovableLayout(QWidget *parent = 0); - explicit MovableLayout(QBoxLayout::Direction direction, QWidget *parent = 0); - - bool dragable() const; - bool getAutoResize() const; - int count() const; - int hoverIndex() const; - int getLayoutSpacing() const; - int getAnimationDuration() const; - int getHoverIndextByPos(const QPoint &pos); - int indexOf(DockItem * const widget, int from = 0) const; - - QWidget *dragingWidget() const; - QWidget *widget(int index) const; - QList widgets() const; - QSize getDefaultSpacingItemSize() const; - QBoxLayout::Direction direction() const; - QEasingCurve::Type getAnimationCurve() const; - - void restoreDragingWidget(); - void removeWidget(int index); - void addWidget(DockItem *widget); - void removeWidget(DockItem *widget); - void insertWidget(int index, DockItem *widget); - - void setDuration(int v); - void setDragable(bool v); - void setLayoutSpacing(int spacing); - void setAutoResize(bool autoResize); - void setAlignment(Qt::Alignment alignment); - void setEasingCurve(QEasingCurve::Type curve); - void setAnimationDuration(int animationDuration); - void setDirection(QBoxLayout::Direction direction); - void setAnimationCurve(const QEasingCurve::Type &animationCurve); - void setDefaultSpacingItemSize(const QSize &defaultSpacingItemSize); - -signals: - void startDrag(QDrag*); - void drop(QDropEvent *event); - void requestSpacingItemsDestroy(bool immediately); - void sizeChanged(QResizeEvent *event); - void dragLeaved(QDragLeaveEvent *event); - void dragEntered(QDragEnterEvent *event); - -protected: - bool event(QEvent *e); - void mouseMoveEvent(QMouseEvent *event); - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void resizeEvent(QResizeEvent *event); - void showEvent(QShowEvent *e); - -private: - void initSizeAniamtion(); - void storeDragingWidget(); - void handleDrag(const QPoint &pos); - void updateCurrentHoverInfo(int index, const QPoint &pos); - void addSpacingItem(QWidget *souce, MoveDirection md, const QSize &size); - void insertSpacingItemToLayout(int index, const QSize &size, bool immediately = false); - MoveDirection getVMoveDirection(int index, const QPoint &pos); - MoveDirection getHMoveDirection(int index, const QPoint &pos); - -private: - int m_lastHoverIndex; - int m_animationDuration; - bool m_hoverToSpacing; - bool m_autoResize; - bool m_dragable; - DockItem *m_draginItem; - QHBoxLayout *m_layout; - QList m_widgetList; - QSize m_defaultSpacingItemSize; - MoveDirection m_vMoveDirection; - MoveDirection m_hMoveDirection; - QPropertyAnimation *m_sizeAnimation; - QEasingCurve::Type m_animationCurve; -}; - -#endif // MOVABLELAYOUT_H diff --git a/dde-dock/src/widgets/plugin/dockpluginitem.cpp b/dde-dock/src/widgets/plugin/dockpluginitem.cpp deleted file mode 100644 index 25bf1253f..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginitem.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include -#include -#include -#include - -#include "dockpluginitem.h" -#include "../../controller/dockmodedata.h" - -static const QString MenuItemRun = "id_run"; -static const QString MenuItemRemove = "id_remove"; - -DockPluginItem::DockPluginItem(DockPluginInterface *plugin, - QString id, QWidget * parent) : - DockItem(parent), - m_plugin(plugin), - m_id(id) -{ - qDebug() << "PluginItemWrapper created " << m_plugin->getPluginName() << m_id; - - if (m_plugin) { - QWidget * item = m_plugin->getItem(id); - m_pluginItemContents = m_plugin->getApplet(id); - - if (item) { - item->setParent(this); - item->move(0, 0); - this->adjustSize(); - -// emit widthChanged(); - - m_display = new DBusDisplay(this); - } - } -} - - -DockPluginItem::~DockPluginItem() -{ - qDebug() << "PluginItemWrapper destroyed " << m_plugin->getPluginName() << m_id; -} - -QString DockPluginItem::getTitle() -{ - return m_plugin->getTitle(m_id); -} - -QWidget * DockPluginItem::getApplet() -{ - return m_plugin->getApplet(m_id); -} - -QString DockPluginItem::id() const -{ - return m_id; -} - -void DockPluginItem::enterEvent(QEvent *) -{ - if (hoverable()) { - DisplayRect rec = m_display->primaryRect(); - showPreview(QPoint(globalX() + width() / 2, rec.height- DockModeData::instance()->getDockHeight() - DOCK_PREVIEW_MARGIN)); - emit mouseEnter(); - } -} - -void DockPluginItem::leaveEvent(QEvent *) -{ - hidePreview(); - emit mouseLeave(); -} - - -void DockPluginItem::mousePressEvent(QMouseEvent * event) -{ - hidePreview(true); - - if (event->button() == Qt::RightButton) { - DisplayRect rec = m_display->primaryRect(); - this->showMenu(QPoint(rec.x + globalX() + width() / 2, - rec.y + rec.height - DockModeData::instance()->getDockHeight())); - } else if (event->button() == Qt::LeftButton) { - QString command = m_plugin->getCommand(m_id); - if (!command.isEmpty()) QProcess::startDetached(command); - } - - emit mousePress(); -} - -void DockPluginItem::mouseReleaseEvent(QMouseEvent *event) -{ - Q_UNUSED(event) - - emit mouseRelease(); -} - -QString DockPluginItem::getMenuContent() -{ - QString menuContent = m_plugin->getMenuContent(m_id); - - bool canRun = !m_plugin->getCommand(m_id).isEmpty(); - bool configurable = m_plugin->configurable(m_id); - - if (canRun || configurable) { - QJsonObject result = QJsonDocument::fromJson(menuContent.toUtf8()).object(); - QJsonArray array = result["items"].toArray(); - - QJsonObject itemRun = createMenuItem(MenuItemRun, tr("_Run"), false, false); - QJsonObject itemRemove = createMenuItem(MenuItemRemove, tr("_Undock"), false, false); - - if (canRun) array.insert(0, itemRun); - if (configurable) array.append(itemRemove); - - result["items"] = array; - - return QString(QJsonDocument(result).toJson()); - } else { - return menuContent; - } -} - -void DockPluginItem::invokeMenuItem(QString itemId, bool checked) -{ - if (itemId == MenuItemRun) { - QString command = m_plugin->getCommand(m_id); - QProcess::startDetached(command); - } else if (itemId == MenuItemRemove){ - m_plugin->setEnabled(m_id, false); - } else { - m_plugin->invokeMenuItem(m_id, itemId, checked); - } -} - -QJsonObject DockPluginItem::createMenuItem(QString itemId, QString itemName, bool checkable, bool checked) -{ - QJsonObject itemObj; - - itemObj.insert("itemId", itemId); - itemObj.insert("itemText", itemName); - itemObj.insert("itemIcon", ""); - itemObj.insert("itemIconHover", ""); - itemObj.insert("itemIconInactive", ""); - itemObj.insert("itemExtra", ""); - itemObj.insert("isActive", true); - itemObj.insert("isCheckable", checkable); - itemObj.insert("checked", checked); - itemObj.insert("itemSubMenu", QJsonObject()); - - return itemObj; -} diff --git a/dde-dock/src/widgets/plugin/dockpluginitem.h b/dde-dock/src/widgets/plugin/dockpluginitem.h deleted file mode 100644 index c4e9db4c6..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginitem.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINITEM_H -#define DOCKPLUGINITEM_H - -#include - -#include "widgets/dockitem.h" -#include "interfaces/dockplugininterface.h" -#include "dbus/dbusdisplay.h" - -class QMouseEvent; -class DockPluginItem : public DockItem -{ - Q_OBJECT -public: - DockPluginItem(DockPluginInterface *plugin, QString id, QWidget * parent = 0); - virtual ~DockPluginItem(); - - QString id() const; - - QString getTitle() Q_DECL_OVERRIDE; - QWidget * getApplet() Q_DECL_OVERRIDE; - - QString getMenuContent() Q_DECL_OVERRIDE; - void invokeMenuItem(QString itemId, bool checked) Q_DECL_OVERRIDE; - -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: - DBusDisplay *m_display = NULL; - QWidget *m_pluginItemContents = NULL; - DockPluginInterface * m_plugin; - QString m_id; - - QJsonObject createMenuItem(QString itemId, QString itemName, bool checkable, bool checked); - const int DOCK_PREVIEW_MARGIN = 7; -}; - -#endif // DOCKPLUGINITEM_H diff --git a/dde-dock/src/widgets/plugin/dockpluginlayout.cpp b/dde-dock/src/widgets/plugin/dockpluginlayout.cpp deleted file mode 100644 index 6f546edec..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginlayout.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dockpluginlayout.h" -#include "../../panel/panelmenu.h" -#include "../../controller/dockmodedata.h" - -DockPluginLayout::DockPluginLayout(QWidget *parent) : MovableLayout(parent) -{ - m_pluginLoadFinishedTimer = new QTimer(this); - m_pluginLoadFinishedTimer->setSingleShot(true); - m_pluginLoadFinishedTimer->setInterval(100); - - setAcceptDrops(false); - setDragable(false); - initPluginManager(); - - connect(m_pluginLoadFinishedTimer, &QTimer::timeout, this, &DockPluginLayout::pluginsInitDone, Qt::QueuedConnection); -} - -QSize DockPluginLayout::sizeHint() const -{ - QSize size; - int w = 0; - int h = 0; - switch (direction()) { - case QBoxLayout::LeftToRight: - case QBoxLayout::RightToLeft: - size.setHeight(DockModeData::instance()->getDockHeight()); - for (QWidget * widget : widgets()) { - w += widget->sizeHint().width(); - } - size.setWidth(w + getLayoutSpacing() * widgets().count()); - break; - case QBoxLayout::TopToBottom: - case QBoxLayout::BottomToTop: - size.setWidth(DockModeData::instance()->getAppletsItemWidth()); - for (QWidget * widget : widgets()) { - h += widget->height(); - } - size.setHeight(h + getLayoutSpacing() * widgets().count()); - break; - } - - return size; -} - -void DockPluginLayout::initAllPlugins() -{ -// QTimer::singleShot(500, m_pluginManager, SLOT(initAll())); - m_pluginManager->initAll(); -} - -void DockPluginLayout::insertWidget(const int index, DockItem *widget) -{ - MovableLayout::insertWidget(index, widget); - - m_pluginLoadFinishedTimer->start(); -} - -void DockPluginLayout::initPluginManager() -{ - m_pluginManager = new DockPluginsManager(this); - - connect(m_pluginManager, &DockPluginsManager::itemAppend, [=](DockItem *targetItem){ - this->insertWidget(0, targetItem); - connect(targetItem, &DockItem::needPreviewShow, [=](QPoint pos) { -// DockItem *s = qobject_cast(sender()); -// if (s) -// emit needPreviewShow(s, pos); - emit needPreviewShow(targetItem, pos); - }); - connect(targetItem, &DockItem::needPreviewHide, this, &DockPluginLayout::needPreviewHide); - connect(targetItem, &DockItem::needPreviewUpdate, this, &DockPluginLayout::needPreviewUpdate); - connect(this, &DockPluginLayout::itemHoverableChange, targetItem, &DockItem::setHoverable); - }); - connect(m_pluginManager, &DockPluginsManager::itemInsert, [=](DockItem *baseItem, DockItem *targetItem){ - int index = indexOf(baseItem); - insertWidget(index != -1 ? index : count(), targetItem); - connect(targetItem, &DockItem::needPreviewShow, this, [=](QPoint pos) { -// DockItem *s = qobject_cast(sender()); -// if (s) -// emit needPreviewShow(s, pos); - emit needPreviewShow(targetItem, pos); - }); - connect(targetItem, &DockItem::needPreviewHide, this, &DockPluginLayout::needPreviewHide); - connect(targetItem, &DockItem::needPreviewUpdate, this, &DockPluginLayout::needPreviewUpdate); - connect(this, &DockPluginLayout::itemHoverableChange, targetItem, &DockItem::setHoverable); - }); - connect(m_pluginManager, &DockPluginsManager::itemRemoved, [=](DockItem* item) { - removeWidget(item); - }); - connect(PanelMenu::instance(), &PanelMenu::settingPlugin, [=]{ - m_pluginManager->onPluginsSetting(getScreenRect().height - parentWidget()->height()); - }); -} - -DisplayRect DockPluginLayout::getScreenRect() -{ - DBusDisplay d; - return d.primaryRect(); -} - diff --git a/dde-dock/src/widgets/plugin/dockpluginlayout.h b/dde-dock/src/widgets/plugin/dockpluginlayout.h deleted file mode 100644 index 31959c8ca..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginlayout.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINLAYOUT_H -#define DOCKPLUGINLAYOUT_H - -#include "../movablelayout.h" -#include "../../dbus/dbusdisplay.h" -#include "../../controller/plugins/dockpluginsmanager.h" - -class DockPluginLayout : public MovableLayout -{ - Q_OBJECT -public: - explicit DockPluginLayout(QWidget *parent = 0); - - QSize sizeHint() const; - void initAllPlugins(); - -signals: - void needPreviewHide(bool immediately); - void needPreviewShow(DockItem *item, QPoint pos); - void needPreviewUpdate(); - void itemHoverableChange(bool v); - void pluginsInitDone(); - -protected: - void insertWidget(const int index, DockItem *widget); - -private: - void initPluginManager(); - DisplayRect getScreenRect(); - -private: - DockPluginsManager *m_pluginManager; - QTimer *m_pluginLoadFinishedTimer; -}; - -#endif // DOCKPLUGINLAYOUT_H diff --git a/dde-dock/src/widgets/plugin/dockpluginssettingwindow.cpp b/dde-dock/src/widgets/plugin/dockpluginssettingwindow.cpp deleted file mode 100644 index a5c2bdac5..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginssettingwindow.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "dockpluginssettingwindow.h" - -class PluginSettingLine : public QLabel -{ - Q_OBJECT -public: - explicit PluginSettingLine(bool checked = false, - const QString &id = "", - const QString &title = "", - const QPixmap &icon = QPixmap(), - QWidget *parent = 0); - - void setIcon(const QPixmap &icon); - void setTitle(const QString &title); - void setPluginId(const QString &pluginId); - void setChecked(const bool checked); - - QString pluginId() const; - bool checked(); - -signals: - void checkedChanged(QString id, bool check); - -private: - QLabel *m_iconLabel = NULL; - QLabel *m_titleLabel = NULL; - DSwitchButton *m_switchButton = NULL; - - QString m_pluginId = ""; - - const int ICON_SIZE = 16; - const int ICON_SPACING = 6; - const int CONTENT_MARGIN = 6; - const int MAX_TEXT_WIDTH = 125; -}; - -PluginSettingLine::PluginSettingLine(bool checked, const QString &id, const QString &title, const QPixmap &icon, QWidget *parent) - :QLabel(parent), m_pluginId(id) -{ - QHBoxLayout *mainLayout = new QHBoxLayout(this); - mainLayout->setContentsMargins(CONTENT_MARGIN, 0, CONTENT_MARGIN, 0); - mainLayout->setSpacing(0); - - m_iconLabel = new QLabel; - m_iconLabel->setFixedSize(ICON_SIZE, ICON_SIZE); - m_iconLabel->setPixmap(icon.scaled(ICON_SIZE, ICON_SIZE)); - - m_titleLabel = new QLabel; - m_titleLabel->setObjectName("PluginSettingLineTitle"); - m_titleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); - setTitle(title); - - m_switchButton = new DSwitchButton; - m_switchButton->setChecked(checked); - - connect(m_switchButton, &DSwitchButton::checkedChanged, [=](bool checked){ - emit checkedChanged(m_pluginId, checked); - }); - - mainLayout->addWidget(m_iconLabel); - mainLayout->addSpacing(ICON_SPACING); - mainLayout->addWidget(m_titleLabel); - mainLayout->addStretch(); - mainLayout->addWidget(m_switchButton); -} - -void PluginSettingLine::setTitle(const QString &title) -{ - m_titleLabel->setText(title); - - QFontMetrics fm(m_titleLabel->font()); - m_titleLabel->setText(fm.elidedText(title,Qt::ElideRight, MAX_TEXT_WIDTH)); -} - -void PluginSettingLine::setIcon(const QPixmap &icon) -{ - m_iconLabel->setPixmap(icon.scaled(ICON_SIZE, ICON_SIZE)); -} - -QString PluginSettingLine::pluginId() const -{ - return m_pluginId; -} - -bool PluginSettingLine::checked() -{ - return m_switchButton->checked(); -} - -void PluginSettingLine::setPluginId(const QString &pluginId) -{ - m_pluginId = pluginId; -} - -void PluginSettingLine::setChecked(const bool checked) -{ - m_switchButton->setChecked(checked); -} - -#include "dockpluginssettingwindow.moc" -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -DockPluginsSettingWindow::DockPluginsSettingWindow(QWidget *parent) : - QFrame(parent) -{ - setObjectName("PluginsSettingFrame"); - setAttribute(Qt::WA_TranslucentBackground); - setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog); - - QWidget *contentFrame = new QWidget; - contentFrame->setObjectName("PluginsSettingFrame"); - QVBoxLayout *contentLayout = new QVBoxLayout(this); - contentLayout->setContentsMargins(0, 0, 0, 0); - contentLayout->setSpacing(0); - contentLayout->addWidget(contentFrame); - - m_mainLayout = new QVBoxLayout(contentFrame); - m_mainLayout->setSpacing(LINE_SPACING); - m_mainLayout->setContentsMargins(0, 0, 0, 0); - - initCloseTitle(); - - setFixedWidth(WIN_WIDTH); - - installEventFilter(this); -} - -void DockPluginsSettingWindow::onPluginAdd(bool checked, const QString &id, const QString &title, const QPixmap &icon) -{ - if (m_lineMap.keys().indexOf(id) != -1) - return; - - PluginSettingLine *line = new PluginSettingLine(checked, id, title, icon); - connect(line, &PluginSettingLine::checkedChanged, this, &DockPluginsSettingWindow::checkedChanged); - - line->setFixedHeight(LINE_HEIGHT); - m_mainLayout->addWidget(line, 1, Qt::AlignTop); - - m_lineMap.insert(id, line); - - resizeWithLineCount(); -} - -void DockPluginsSettingWindow::onPluginRemove(const QString &id) -{ - PluginSettingLine * line = m_lineMap.take(id); - if (line){ - m_mainLayout->removeWidget(line); - line->deleteLater(); - - resizeWithLineCount(); - } -} - -void DockPluginsSettingWindow::onPluginEnabledChanged(const QString &id, bool enabled) -{ - PluginSettingLine * line = m_lineMap.value(id); - if (line) { - line->setChecked(enabled); - } -} - -void DockPluginsSettingWindow::onPluginTitleChanged(const QString &id, const QString &title) -{ - PluginSettingLine * line = m_lineMap.value(id); - if (line) { - line->setTitle(title); - } -} - -void DockPluginsSettingWindow::mouseMoveEvent(QMouseEvent *event) -{ - if (m_mousePressed) - move(event->globalPos() - m_pressPosition); - QFrame::mouseMoveEvent(event); -} - -void DockPluginsSettingWindow::mousePressEvent(QMouseEvent *event) -{ - if(event->button() & Qt::LeftButton) - { - m_pressPosition = event->globalPos() - frameGeometry().topLeft(); - m_mousePressed = true; - } - QFrame::mousePressEvent(event); -} - -void DockPluginsSettingWindow::mouseReleaseEvent(QMouseEvent *event) -{ - m_mousePressed = false; - QFrame::mouseReleaseEvent(event); -} - -bool DockPluginsSettingWindow::eventFilter(QObject *obj, QEvent *event) -{ - if (event->type() == QEvent::WindowDeactivate) { - this->close(); - } - - return QFrame::eventFilter(obj, event); -} - -void DockPluginsSettingWindow::resizeWithLineCount() -{ - setFixedHeight((m_lineMap.count() + 1) * (LINE_HEIGHT + LINE_SPACING)); -} - -void DockPluginsSettingWindow::initCloseTitle() -{ - QLabel *titleLabel = new QLabel(tr("Notification Area Settings")); - titleLabel->setAlignment(Qt::AlignCenter); - titleLabel->setObjectName("PluginSettingTitle"); - QPushButton *closeButton = new QPushButton; - closeButton->setFocusPolicy(Qt::NoFocus); - closeButton->setFixedSize(ICON_SIZE, ICON_SIZE); - closeButton->setObjectName("PluginSettingCloseButton"); - connect(closeButton, &QPushButton::clicked, [=]{ - this->hide(); - }); - - QHBoxLayout *titleLayout = new QHBoxLayout; - titleLayout->setAlignment(Qt::AlignVCenter); - titleLayout->setContentsMargins(0, CONTENT_MARGIN, CONTENT_MARGIN, 0); - titleLayout->setSpacing(0); - - titleLayout->addWidget(titleLabel, 1); - titleLayout->addWidget(closeButton, 1); - - m_mainLayout->addLayout(titleLayout, 1); - DSeparatorHorizontal *sp = new DSeparatorHorizontal; - m_mainLayout->addWidget(sp); -} diff --git a/dde-dock/src/widgets/plugin/dockpluginssettingwindow.h b/dde-dock/src/widgets/plugin/dockpluginssettingwindow.h deleted file mode 100644 index dee8e8b54..000000000 --- a/dde-dock/src/widgets/plugin/dockpluginssettingwindow.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef DOCKPLUGINSSETTINGWINDOW_H -#define DOCKPLUGINSSETTINGWINDOW_H - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -DWIDGET_USE_NAMESPACE - -class PluginSettingLine; - -class DockPluginsSettingWindow : public QFrame -{ - Q_OBJECT -public: - explicit DockPluginsSettingWindow(QWidget *parent = 0); - -public slots: - void onPluginAdd(bool checked = false, - const QString &id = "", - const QString &title = "", - const QPixmap &icon = QPixmap()); - void onPluginRemove(const QString &id); - void onPluginEnabledChanged(const QString &id, bool enabled); - void onPluginTitleChanged(const QString &id, const QString &title); - -signals: - void checkedChanged(const QString &id, bool checked); - -protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - bool eventFilter(QObject *obj, QEvent *event); - -private: - void resizeWithLineCount(); - void initCloseTitle(); - - bool m_mousePressed; - QPoint m_pressPosition; - QVBoxLayout *m_mainLayout; - QMap m_lineMap; - - const int ICON_SIZE = 24; - const int CONTENT_MARGIN = 6; - const int LINE_SPACING = 5; - const int LINE_HEIGHT = 30; - const int WIN_WIDTH = 230; - -}; - -#endif // DOCKPLUGINSSETTINGWINDOW_H diff --git a/dde-dock/src/widgets/previewwindow.cpp b/dde-dock/src/widgets/previewwindow.cpp deleted file mode 100644 index eede0899b..000000000 --- a/dde-dock/src/widgets/previewwindow.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "previewwindow.h" - -PreviewWindow::PreviewWindow(ArrowDirection direction, QWidget *parent) : DArrowRectangle(direction, parent) -{ - setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::Tool); - setArrowWidth(ARROW_WIDTH); - setArrowHeight(ARROW_HEIGHT); - - //QWidget calls this function after it has been fully constructed but before it is shown the very first time. - //so call it to make sure the style sheet won't repolish and cover the value set by seter-function - ensurePolished(); - setRadius(4); - setBorderWidth(1); - setBorderColor(QColor(0, 0, 0, 0.2 * 255)); - - m_showTimer = new QTimer(this); - m_showTimer->setSingleShot(true); - connect(m_showTimer, &QTimer::timeout, this, &PreviewWindow::onShowTimerTriggered); - - m_hideTimer = new QTimer(this); - m_hideTimer->setSingleShot(true); - connect(m_hideTimer, &QTimer::timeout, this, &PreviewWindow::hide); - - m_animation = new QPropertyAnimation(this, "arrowPos"); - m_animation->setDuration(MOVE_ANIMATION_DURATION); - m_animation->setEasingCurve(MOVE_ANIMATION_CURVE); -} - -PreviewWindow::~PreviewWindow() -{ - -} - -void PreviewWindow::showPreview(int x, int y, int interval) -{ - m_hideTimer->stop(); - - m_lastPos = QPoint(m_x, m_y); - m_x = x; - m_y = y; - - if (m_showTimer->isActive()) - return; - - m_showTimer->start(interval); -} - -void PreviewWindow::hidePreview(int interval) -{ - m_showTimer->stop(); - - if (interval <= 0) { - m_animation->stop(); - hide(); - } - else - m_hideTimer->start(interval); -} - -void PreviewWindow::setContent(QWidget *content) -{ - m_currentContent = content; -} - -void PreviewWindow::setArrowPos(const QPoint &pos) -{ - show(pos.x(), pos.y()); -} - -void PreviewWindow::hide() -{ - if (m_lastContent != m_currentContent) - emit hideFinish(m_lastContent); - - emit previewFrameHided(); - - DArrowRectangle::hide(); -} - -void PreviewWindow::enterEvent(QEvent *) -{ - m_hideTimer->stop(); -} - -void PreviewWindow::leaveEvent(QEvent *) -{ - m_hideTimer->start(); -} - -void PreviewWindow::onShowTimerTriggered() -{ - if (!m_lastContent.isNull()) { - m_lastContent.data()->setParent(NULL); - if (m_lastContent != m_currentContent) - emit showFinish(m_lastContent); - } - - DArrowRectangle::setContent(m_currentContent); - m_lastContent = m_currentContent; - - if (isHidden()) { - show(m_x, m_y); - } else { - m_animation->setStartValue(m_lastPos); - m_animation->setEndValue(QPoint(m_x, m_y)); - m_animation->start(); - } -} - diff --git a/dde-dock/src/widgets/previewwindow.h b/dde-dock/src/widgets/previewwindow.h deleted file mode 100644 index c3ec02644..000000000 --- a/dde-dock/src/widgets/previewwindow.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef PREVIEWWINDOW_H -#define PREVIEWWINDOW_H - -#include -#include -#include - -#include - -DWIDGET_USE_NAMESPACE - -class PreviewWindow : public DArrowRectangle -{ - Q_OBJECT - Q_PROPERTY(QPoint arrowPos READ pos WRITE setArrowPos) -public: - explicit PreviewWindow(DArrowRectangle::ArrowDirection direction, QWidget *parent = 0); - ~PreviewWindow(); - - void showPreview(int x, int y, int interval); - void hidePreview(int interval = 0); - void setContent(QWidget *content); - void setArrowPos(const QPoint &pos); - void hide(); - -signals: - void showFinish(QWidget *lastContent); - void hideFinish(QWidget *lastContent); - void previewFrameHided(); - -protected: - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - -private: - void onShowTimerTriggered(); - -private: - QTimer *m_showTimer = NULL; - QTimer *m_hideTimer = NULL; - QPointer m_currentContent; - QPointer m_lastContent; - QPropertyAnimation *m_animation = NULL; - QPoint m_lastPos = QPoint(0, 0); - int m_x = 0; - int m_y = 0; - const int ARROW_WIDTH = 18; - const int ARROW_HEIGHT = 11; - const int MOVE_ANIMATION_DURATION = 300; - const QEasingCurve MOVE_ANIMATION_CURVE = QEasingCurve::OutCirc; -}; - -#endif // PREVIEWWINDOW_H diff --git a/dde-dock/src/widgets/reflectioneffect.cpp b/dde-dock/src/widgets/reflectioneffect.cpp deleted file mode 100644 index 191442e26..000000000 --- a/dde-dock/src/widgets/reflectioneffect.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#include "reflectioneffect.h" - -ReflectionEffect::ReflectionEffect(QWidget * source, QWidget *parent) : - QWidget(parent), - m_source(source), - m_opacity(0.1) -{ - this->setFixedWidth(m_source->width()); - setAttribute(Qt::WA_TransparentForMouseEvents); -} - -qreal ReflectionEffect::opacity() const -{ - return m_opacity; -} - -void ReflectionEffect::setOpacity(const qreal &opacity) -{ - m_opacity = opacity; -} - -void ReflectionEffect::paintEvent(QPaintEvent *) -{ - if (m_source) { - QPixmap pixmap = m_source->grab(); - - // flip the pixmap - pixmap = pixmap.transformed(QTransform().scale(1, -1)); - - if (!pixmap.isNull()) { - QPainter painter; - painter.begin(this); - - painter.setClipRect(rect()); - painter.setOpacity(m_opacity); - painter.drawPixmap(0, 0, pixmap); - - painter.end(); - } - } -} - -void ReflectionEffect::updateReflection() -{ - update(); -} diff --git a/dde-dock/src/widgets/reflectioneffect.h b/dde-dock/src/widgets/reflectioneffect.h deleted file mode 100644 index 1a077b9de..000000000 --- a/dde-dock/src/widgets/reflectioneffect.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2015 Deepin Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - **/ - -#ifndef REFLECTIONEFFECT_H -#define REFLECTIONEFFECT_H - -#include -#include - -class QPaintEvent; -class ReflectionEffect : public QWidget -{ - Q_OBJECT -public: - ReflectionEffect(QWidget * source, QWidget *parent = 0); - - qreal opacity() const; - void setOpacity(const qreal &opacity); - void updateReflection(); - -protected: - void paintEvent(QPaintEvent * event) Q_DECL_OVERRIDE; - -private: - QWidget * m_source; - qreal m_opacity; -}; - -#endif // REFLECTIONEFFECT_H diff --git a/item/dockitem.cpp b/item/dockitem.cpp new file mode 100644 index 000000000..bb036d8ab --- /dev/null +++ b/item/dockitem.cpp @@ -0,0 +1,7 @@ +#include "dockitem.h" + +DockItem::DockItem(QWidget *parent) + : QWidget(parent) +{ + +} diff --git a/item/dockitem.h b/item/dockitem.h new file mode 100644 index 000000000..88a4a6647 --- /dev/null +++ b/item/dockitem.h @@ -0,0 +1,14 @@ +#ifndef DOCKITEM_H +#define DOCKITEM_H + +#include + +class DockItem : public QWidget +{ + Q_OBJECT + +public: + explicit DockItem(QWidget *parent = 0); +}; + +#endif // DOCKITEM_H diff --git a/main.cpp b/main.cpp new file mode 100644 index 000000000..64ffebb8d --- /dev/null +++ b/main.cpp @@ -0,0 +1,14 @@ + +#include "window/mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + MainWindow mw; + mw.show(); + + return app.exec(); +} diff --git a/translate_generation.sh b/translate_generation.sh deleted file mode 100755 index c9080923b..000000000 --- a/translate_generation.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# this file is used to auto-generate .qm file from .ts file. -# author: shibowen at linuxdeepin.com - -ts_list=(`ls translations/*.ts`) - -for ts in "${ts_list[@]}" -do - printf "\nprocess ${ts}\n" - lrelease "${ts}" -done diff --git a/translations/dde-dock.ts b/translations/dde-dock.ts deleted file mode 100644 index a63343395..000000000 --- a/translations/dde-dock.ts +++ /dev/null @@ -1,154 +0,0 @@ - - - - - ClearTrashDialog - - - Are you sure to empty trash? - Are you sure to empty trash? - - - - This action cannot be restored - This action cannot be restored - - - - Cancel - Cancel - - - - Empty - Empty - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - All dependencies will be removed together - - - - Cancel - Cancel - - - - Confirm - Confirm - - - - DockLauncherItem - - - Launcher - Launcher - - - - DockPluginItem - - - _Run - _Run - - - - _Undock - _Undock - - - - DockPluginItemWrapper - - - _Run - _Run - - - - _Undock - _Undock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Notification Area Settings - - - - HomeScreen - - - Shutdown - - - - - MainItem - - - Are you sure to uninstall %1? - Are you sure to uninstall %1? - - - - PanelMenu - - - Fashion mode - Fashion mode - - - - Efficient mode - Efficient mode - - - - Classic mode - Classic mode - - - - Keep showing - Keep showing - - - - Keep hidden - Keep hidden - - - - Smart hide - Smart hide - - - - Notification area settings - Notification area settings - - - - TrashPlugin - - - Trash - Trash - - - - Empty - Empty - - - diff --git a/translations/dde-dock_am.ts b/translations/dde-dock_am.ts deleted file mode 100644 index bba3cea87..000000000 --- a/translations/dde-dock_am.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - በ እርግጥ ቆሻሻውን ባዶ ማድረግ ይፈልጋሉ? - - - - This action cannot be restored - ይህን ተግባር መመለስ አይቻልም - - - - Cancel - መሰረዣ - - - - Empty - ባዶ - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - ሁሉም ጥገኞች በ አንድ ላይ ይወገዳሉ - - - - Cancel - መሰረዣ - - - - Confirm - ማረጋገጫ - - - - DockLauncherItem - - - Launcher - ማስጀመሪያ - - - - DockPluginItem - - - _Run - _ማስኬጃ - - - - _Undock - _መለያያ - - - - DockPluginItemWrapper - - - _Run - _ማስኬጃ - - - - _Undock - _መለያያ - - - - DockPluginsSettingWindow - - - Notification Area Settings - ማስታወቂያ ቦታ ማሰናጃ - - - - HomeScreen - - - Shutdown - ማጥፊያ - - - - MainItem - - - Are you sure to uninstall %1? - በእርግጥ ማጥፋት ይፈልጋሉ %1 ? - - - - PanelMenu - - - Fashion mode - - - - - Efficient mode - - - - - Classic mode - ዘመናዊ ዘዴ - - - - Keep showing - እንደሚታይ ማቆያ - - - - Keep hidden - እንደ ተደበቅ ማቆያ - - - - Smart hide - በራሱ መደበቂያ - - - - Notification area settings - ማስታወቂያ ቦታ ማሰናጃ - - - - TrashPlugin - - - Trash - ቆሻሻ - - - - Empty - ባዶ - - - \ No newline at end of file diff --git a/translations/dde-dock_ar.ts b/translations/dde-dock_ar.ts deleted file mode 100644 index e94339a04..000000000 --- a/translations/dde-dock_ar.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - هل انت متأكد من افراغ سلة المهملات ؟ - - - - This action cannot be restored - لا يمكن استعادة هذا العمل - - - - Cancel - إلغاء - - - - Empty - افراغ - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - كل التبعيات ستحذف معا - - - - Cancel - إلغاء - - - - Confirm - تأكيد - - - - DockLauncherItem - - - Launcher - مُطلق - - - - DockPluginItem - - - _Run - _تشغيل - - - - _Undock - إلغاء الق_فل - - - - DockPluginItemWrapper - - - _Run - _تشغيل - - - - _Undock - إلغاء الق_فل - - - - DockPluginsSettingWindow - - - Notification Area Settings - إعدادات المنطقة /الموقع - - - - HomeScreen - - - Shutdown - إطفاء - - - - MainItem - - - Are you sure to uninstall %1? - هل أنت متأكد من إلغاء تثبيت %1 ? - - - - PanelMenu - - - Fashion mode - نمط الموضة - - - - Efficient mode - وضع مصغر - - - - Classic mode - النمط الكلاسيكي - - - - Keep showing - ابقه ظاهرا - - - - Keep hidden - ابقه مخفيا - - - - Smart hide - الاخفاء الذكي - - - - Notification area settings - إعدادات المنطقة /الموقع - - - - TrashPlugin - - - Trash - المهملات - - - - Empty - فارغ - - - \ No newline at end of file diff --git a/translations/dde-dock_bg.ts b/translations/dde-dock_bg.ts deleted file mode 100644 index 740678889..000000000 --- a/translations/dde-dock_bg.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Наистина ли изпразвате кошчето? - - - - This action cannot be restored - Това действие не може да бъде поравено - - - - Cancel - Отказ - - - - Empty - Изпразни - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Всички зависимости ще бъдат премахнати заедно - - - - Cancel - Отказ - - - - Confirm - Потвърждение - - - - DockLauncherItem - - - Launcher - Стартер - - - - DockPluginItem - - - _Run - Стартиране - - - - _Undock - Разкачване - - - - DockPluginItemWrapper - - - _Run - Стартиране - - - - _Undock - Разкачване - - - - DockPluginsSettingWindow - - - Notification Area Settings - Настройки на зоната за известяване - - - - HomeScreen - - - Shutdown - Изключване - - - - MainItem - - - Are you sure to uninstall %1? - Наистина ли ще деинсталирате %1? - - - - PanelMenu - - - Fashion mode - Модерен режим - - - - Efficient mode - Ефективен режим - - - - Classic mode - Класически режим - - - - Keep showing - Запази видим - - - - Keep hidden - Запази скрит - - - - Smart hide - Интелигентно скриване - - - - Notification area settings - Настройки на зоната за уведомяване - - - - TrashPlugin - - - Trash - Кошче - - - - Empty - Изпразни - - - \ No newline at end of file diff --git a/translations/dde-dock_cs.ts b/translations/dde-dock_cs.ts deleted file mode 100644 index ca8552840..000000000 --- a/translations/dde-dock_cs.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Opravdu chcete vyprázdnit koš? - - - - This action cannot be restored - Tento krok nelze vrátit zpět - - - - Cancel - Zrušit - - - - Empty - Vyprázdnit - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Všechny závislosti budou odstraněny společně - - - - Cancel - Zrušit - - - - Confirm - Potvrdit - - - - DockLauncherItem - - - Launcher - Spouštěč - - - - DockPluginItem - - - _Run - _Spustit - - - - _Undock - _Uvolnit z panelu - - - - DockPluginItemWrapper - - - _Run - _Spustit - - - - _Undock - _Uvolnit z panelu - - - - DockPluginsSettingWindow - - - Notification Area Settings - Nastavení oznamovací oblasti - - - - HomeScreen - - - Shutdown - Vypnout - - - - MainItem - - - Are you sure to uninstall %1? - Opravdu chcete odinstalovat %1? - - - - PanelMenu - - - Fashion mode - Návykový režim - - - - Efficient mode - Účelný režim - - - - Classic mode - Klasický režim - - - - Keep showing - Ukazovat vždy - - - - Keep hidden - Skrývat vždy - - - - Smart hide - Skrývat chytře - - - - Notification area settings - Nastavení oznamovací oblasti - - - - TrashPlugin - - - Trash - Koš - - - - Empty - Vyprázdnit - - - \ No newline at end of file diff --git a/translations/dde-dock_da.ts b/translations/dde-dock_da.ts deleted file mode 100644 index 25d5a09f8..000000000 --- a/translations/dde-dock_da.ts +++ /dev/null @@ -1,153 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Er du sikker på at du vil tømme papirkurven - - - - This action cannot be restored - Denne handling kan ikke gendannes - - - - Cancel - Annuller - - - - Empty - Tøm skraldespand - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Alle afhængigheder vil blive fjernet samtidig - - - - Cancel - Annuller - - - - Confirm - Bekræft - - - - DockLauncherItem - - - Launcher - Launcher - - - - DockPluginItem - - - _Run - _Kør - - - - _Undock - _ Fjern fra dock - - - - DockPluginItemWrapper - - - _Run - _Kør - - - - _Undock - _ Fjern fra dock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Notifikation Område Indstillinger - - - - HomeScreen - - - Shutdown - Luk ned - - - - MainItem - - - Are you sure to uninstall %1? - Er du sikker på at du vil afinstallere %1? - - - - PanelMenu - - - Fashion mode - Moderne tilstand - - - - Efficient mode - Effektiv visning - - - - Classic mode - Klassisk visning - - - - Keep showing - Bliv ved med at vise - - - - Keep hidden - Hold skjult - - - - Smart hide - Smart skjuling - - - - Notification area settings - -Notifikation Område indstillinger - - - - TrashPlugin - - - Trash - Parpirkurv - - - - Empty - Tøm skraldespand - - - \ No newline at end of file diff --git a/translations/dde-dock_de.ts b/translations/dde-dock_de.ts deleted file mode 100644 index 8c395b236..000000000 --- a/translations/dde-dock_de.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Sind Sie sicher, dass Sie den Papierkorb leeren möchten? - - - - This action cannot be restored - Diese Aktion kann nicht wiederhergestellt werden - - - - Cancel - Abbrechen - - - - Empty - Leer - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Alle Abhängigkeiten werden zusammen entfernt - - - - Cancel - Abbrechen - - - - Confirm - Bestätigen - - - - DockLauncherItem - - - Launcher - Starter - - - - DockPluginItem - - - _Run - _Ausführen - - - - _Undock - _Undocken - - - - DockPluginItemWrapper - - - _Run - _Ausführen - - - - _Undock - _Undocken - - - - DockPluginsSettingWindow - - - Notification Area Settings - Einstellungen Benachrichtigungsbereich - - - - HomeScreen - - - Shutdown - Herunterfahren - - - - MainItem - - - Are you sure to uninstall %1? - Sind Sie sicher, dass Sie %1 deinstallieren möchten? - - - - PanelMenu - - - Fashion mode - Mode-Modus - - - - Efficient mode - Effizienter Modus - - - - Classic mode - Klassischer Modus - - - - Keep showing - Immer anzeigen - - - - Keep hidden - _Immer verstecken - - - - Smart hide - _Intelligentes Verbergen - - - - Notification area settings - Einstellungen Benachrichtigungsbereich - - - - TrashPlugin - - - Trash - Papierkorb - - - - Empty - Leer - - - \ No newline at end of file diff --git a/translations/dde-dock_el.ts b/translations/dde-dock_el.ts deleted file mode 100644 index 59d88d264..000000000 --- a/translations/dde-dock_el.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Θέλετε σίγουρα να αδειάσετε τον κάδο απορριμμάτων; - - - - This action cannot be restored - Η ενέργεια αυτή δεν είναι δυνατόν να επαναφερθεί - - - - Cancel - Άκυρο - - - - Empty - Κενό - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Όλες οι εξαρτήσεις θα απομακρυνθούν μαζί - - - - Cancel - Άκυρο - - - - Confirm - Επιβεβαίωση - - - - DockLauncherItem - - - Launcher - Πρόγραμμα εκκίνησης - - - - DockPluginItem - - - _Run - _Τρέξε - - - - _Undock - _Αποσύνδεση - - - - DockPluginItemWrapper - - - _Run - _Τρέξε - - - - _Undock - _Αποσύνδεση - - - - DockPluginsSettingWindow - - - Notification Area Settings - Ρυθμίσεις περιοχής ειδοποιήσεων - - - - HomeScreen - - - Shutdown - Τερματισμός λειτουργίας - - - - MainItem - - - Are you sure to uninstall %1? - Θέλετε σίγουρα να απεγκαταστήσετε το %1; - - - - PanelMenu - - - Fashion mode - Μοντέρνα λειτουργία - - - - Efficient mode - Αποτελεσματική λειτουργία - - - - Classic mode - Κλασική λειτουργία - - - - Keep showing - Συνεχίστε εμφάνιση - - - - Keep hidden - Κρατήστε κρυφό - - - - Smart hide - Έξυπνη απόκρυψη - - - - Notification area settings - Ρυθμίσεις περιοχής ειδοποιήσεων - - - - TrashPlugin - - - Trash - Κάδος απορριμμάτων - - - - Empty - Κενό - - - \ No newline at end of file diff --git a/translations/dde-dock_eo.ts b/translations/dde-dock_eo.ts deleted file mode 100644 index df6e89d4a..000000000 --- a/translations/dde-dock_eo.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Ĉu vi estas certa ke vi volas vakuigi la korbeton? - - - - This action cannot be restored - Tiu ago ne povas esti reestigita - - - - Cancel - Forigi - - - - Empty - Vakua - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Ĉiuj dependaĵoj estos forigitaj kune - - - - Cancel - Forigi - - - - Confirm - Konfirmi - - - - DockLauncherItem - - - Launcher - Lanĉilo - - - - DockPluginItem - - - _Run - ekzekuti _r - - - - _Undock - _Undock - - - - DockPluginItemWrapper - - - _Run - ekzekuti _r - - - - _Undock - _Undock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Sciigspaco agordoj - - - - HomeScreen - - - Shutdown - Elŝalti - - - - MainItem - - - Are you sure to uninstall %1? - Ĉu vi estas certa ke vi volas malinstali %1? - - - - PanelMenu - - - Fashion mode - Laŭstila maniero - - - - Efficient mode - Efika maniero - - - - Classic mode - Klasika maniero - - - - Keep showing - Teni videbla - - - - Keep hidden - Teni malvidebla - - - - Smart hide - Kaŝi inteligente - - - - Notification area settings - Sciigspaco agordoj - - - - TrashPlugin - - - Trash - Korbeto - - - - Empty - Vakua - - - \ No newline at end of file diff --git a/translations/dde-dock_es.ts b/translations/dde-dock_es.ts deleted file mode 100644 index 02b4d53ce..000000000 --- a/translations/dde-dock_es.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - ¿Esta seguro de vaciar la papelería? - - - - This action cannot be restored - Esta acción no puede ser restaurado - - - - Cancel - Cancelar - - - - Empty - Vacio - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Todas las dependencias serán eliminadas juntas - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lanzador - - - - DockPluginItem - - - _Run - _Ejecutar - - - - _Undock - _Quitar del dock - - - - DockPluginItemWrapper - - - _Run - _Ejecutar - - - - _Undock - _Quitar del dock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Ajustes Área de Notificaciones - - - - HomeScreen - - - Shutdown - Apagar - - - - MainItem - - - Are you sure to uninstall %1? - ¿Esta seguro de desinstalar %1? - - - - PanelMenu - - - Fashion mode - Modo Fashion - - - - Efficient mode - Modo eficiente - - - - Classic mode - Modo clásico - - - - Keep showing - Mantener mostrando - - - - Keep hidden - Mantener oculto - - - - Smart hide - Ocultar automáticamente - - - - Notification area settings - Area de configuración de las notificaciones - - - - TrashPlugin - - - Trash - Papelera - - - - Empty - Vacio - - - \ No newline at end of file diff --git a/translations/dde-dock_es_419.ts b/translations/dde-dock_es_419.ts deleted file mode 100644 index a57e5d324..000000000 --- a/translations/dde-dock_es_419.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Esta seguro que quiere vaciar la papelera? - - - - This action cannot be restored - Esta acción no se puede restaurar - - - - Cancel - Cancelar - - - - Empty - Vacía - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Todas las dependencias serán removidas - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lanzador - - - - DockPluginItem - - - _Run - _Ejecutar - - - - _Undock - _Desanclar - - - - DockPluginItemWrapper - - - _Run - _Ejecutar - - - - _Undock - _Desanclar - - - - DockPluginsSettingWindow - - - Notification Area Settings - Configuración del Area de Notificaciones - - - - HomeScreen - - - Shutdown - Apagar - - - - MainItem - - - Are you sure to uninstall %1? - Esta seguro que quiere desinstalar el %1? - - - - PanelMenu - - - Fashion mode - Modo Fashion - - - - Efficient mode - Modo eficiente - - - - Classic mode - Modo clásico - - - - Keep showing - Seguir mostrando - - - - Keep hidden - Mantener oculto - - - - Smart hide - Ocultar automáticamente - - - - Notification area settings - Configuración del área de notificaciones - - - - TrashPlugin - - - Trash - Papelera - - - - Empty - Vacía - - - \ No newline at end of file diff --git a/translations/dde-dock_fa.ts b/translations/dde-dock_fa.ts deleted file mode 100644 index 7c8feac6d..000000000 --- a/translations/dde-dock_fa.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - آیا از تخلیه سطل آشغال اطمینان دارید؟ - - - - This action cannot be restored - این عملیات قابل بازگردانی نیست - - - - Cancel - انصراف - - - - Empty - خالی - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - تمام متعلقات با هم حذف خواهد شد - - - - Cancel - انصراف - - - - Confirm - تایید - - - - DockLauncherItem - - - Launcher - اجرا کننده - - - - DockPluginItem - - - _Run - ـ اجرا - - - - _Undock - ـ رهاسازی - - - - DockPluginItemWrapper - - - _Run - ـ اجرا - - - - _Undock - ـ رهاسازی - - - - DockPluginsSettingWindow - - - Notification Area Settings - تنظیمات بخش اعلان ها - - - - HomeScreen - - - Shutdown - خاموش کردن - - - - MainItem - - - Are you sure to uninstall %1? - برای حذف %1 اطمینان دارید؟ - - - - PanelMenu - - - Fashion mode - حالت فشن - - - - Efficient mode - حالت کارآمد - - - - Classic mode - حالت کلاسیک - - - - Keep showing - تداوم نمایش - - - - Keep hidden - مخفی ماندن - - - - Smart hide - مخفی سازی هوشمند - - - - Notification area settings - تنظیمات بخش اعلان ها - - - - TrashPlugin - - - Trash - زباله - - - - Empty - خالی - - - \ No newline at end of file diff --git a/translations/dde-dock_fi.ts b/translations/dde-dock_fi.ts deleted file mode 100644 index 668fa5796..000000000 --- a/translations/dde-dock_fi.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Haluatko varmasti tyhjentää roskakorin? - - - - This action cannot be restored - Tätä toimintoa ei voida palauttaa - - - - Cancel - Peruutus - - - - Empty - Tyhjä - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Kaikki riippuvaisuudet poistetaan samanaikaisesti - - - - Cancel - Peruutus - - - - Confirm - Vahvista - - - - DockLauncherItem - - - Launcher - Käynnistäjä - - - - DockPluginItem - - - _Run - Suorita - - - - _Undock - Irroita - - - - DockPluginItemWrapper - - - _Run - Suorita - - - - _Undock - Irroita - - - - DockPluginsSettingWindow - - - Notification Area Settings - Ilmoitusalueen asetukset - - - - HomeScreen - - - Shutdown - Sammuta - - - - MainItem - - - Are you sure to uninstall %1? - Haluatko varmasti poistaa kohteen %1 asennuksen? - - - - PanelMenu - - - Fashion mode - Muoti-tila - - - - Efficient mode - Tehokkuustila - - - - Classic mode - Perinteinen tila - - - - Keep showing - Jatka näyttämistä - - - - Keep hidden - Pidä kätkettynä - - - - Smart hide - Älypiilotus - - - - Notification area settings - Ilmoitusalueen asetukset - - - - TrashPlugin - - - Trash - Roskakori - - - - Empty - Tyhjä - - - \ No newline at end of file diff --git a/translations/dde-dock_fr.ts b/translations/dde-dock_fr.ts deleted file mode 100644 index 0a4806e6e..000000000 --- a/translations/dde-dock_fr.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Voulez-vous vraiment vider la poubelle ? - - - - This action cannot be restored - Cette action ne peut être restaurée - - - - Cancel - Annuler - - - - Empty - Vide - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Toutes les dépendances seront supprimées - - - - Cancel - Annuler - - - - Confirm - Confirmer - - - - DockLauncherItem - - - Launcher - Lanceur - - - - DockPluginItem - - - _Run - _Exécuter - - - - _Undock - _Détacher du dock - - - - DockPluginItemWrapper - - - _Run - _Exécuter - - - - _Undock - _Détacher du dock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Paramètres de la zone de notifications - - - - HomeScreen - - - Shutdown - Arrêter - - - - MainItem - - - Are you sure to uninstall %1? - Désinstaller %1? - - - - PanelMenu - - - Fashion mode - Mode dock - - - - Efficient mode - Mode étendu - - - - Classic mode - Mode étendu mini - - - - Keep showing - Maintenir affiché - - - - Keep hidden - Maintenir caché - - - - Smart hide - Masquer intelligemment - - - - Notification area settings - Notifications des paramêtres - - - - TrashPlugin - - - Trash - Corbeille - - - - Empty - Vide - - - \ No newline at end of file diff --git a/translations/dde-dock_gl.ts b/translations/dde-dock_gl.ts deleted file mode 100644 index 87ed96296..000000000 --- a/translations/dde-dock_gl.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Tes a certeza de querer baleirar o lixo? - - - - This action cannot be restored - Esta acción non se pode desfacer - - - - Cancel - Cancelar - - - - Empty - Baleirar - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Eliminaranse todas as dependencias xuntas - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lanzador - - - - DockPluginItem - - - _Run - _Executar - - - - _Undock - _Sacar da Doca - - - - DockPluginItemWrapper - - - _Run - _Executar - - - - _Undock - _Sacar da Doca - - - - DockPluginsSettingWindow - - - Notification Area Settings - Configuración da Área de Notificacións - - - - HomeScreen - - - Shutdown - Apagar - - - - MainItem - - - Are you sure to uninstall %1? - Tes a certeza de querer desinstalar %1? - - - - PanelMenu - - - Fashion mode - Modo moderno - - - - Efficient mode - Modo eficiente - - - - Classic mode - Modo clásico - - - - Keep showing - Manter visible - - - - Keep hidden - Manter oculto - - - - Smart hide - Ocultar automaticamente - - - - Notification area settings - Configuración da área de notificacións - - - - TrashPlugin - - - Trash - Lixo - - - - Empty - Baleirar - - - \ No newline at end of file diff --git a/translations/dde-dock_gl_ES.ts b/translations/dde-dock_gl_ES.ts deleted file mode 100644 index ddffea681..000000000 --- a/translations/dde-dock_gl_ES.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Tes a certeza de querer baleirar o lixo? - - - - This action cannot be restored - Esta acción non se pode desfacer - - - - Cancel - Cancelar - - - - Empty - Baleirar - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Eliminaranse todas as dependencias xuntas - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lanzador - - - - DockPluginItem - - - _Run - _Executar - - - - _Undock - _Sacar da Doca - - - - DockPluginItemWrapper - - - _Run - _Executar - - - - _Undock - _Sacar da Doca - - - - DockPluginsSettingWindow - - - Notification Area Settings - Configuración da Área de Notificacións - - - - HomeScreen - - - Shutdown - Apagar - - - - MainItem - - - Are you sure to uninstall %1? - Tes a certeza de querer desinstalar %1? - - - - PanelMenu - - - Fashion mode - Modo moderno - - - - Efficient mode - Modo eficiente - - - - Classic mode - Modo clásico - - - - Keep showing - Manter visible - - - - Keep hidden - Manter oculto - - - - Smart hide - Ocultar automaticamente - - - - Notification area settings - Configuración da área de notificacións - - - - TrashPlugin - - - Trash - Lixo - - - - Empty - Baleirar - - - \ No newline at end of file diff --git a/translations/dde-dock_hi_IN.ts b/translations/dde-dock_hi_IN.ts deleted file mode 100644 index 1796ae5c1..000000000 --- a/translations/dde-dock_hi_IN.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - क्या आप ट्रैश खाली करना चाहते हैं? - - - - This action cannot be restored - इस कार्यवाही को फिर से बहाल नहीं किया का सकता है - - - - Cancel - रद्द करो - - - - Empty - खाली - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - सभी अनियमितताओं को साथ मिलाकर हटा दिया जाएगा - - - - Cancel - रद्द करो - - - - Confirm - पुष्टि - - - - DockLauncherItem - - - Launcher - लॉन्चर - - - - DockPluginItem - - - _Run - _चलाएँ - - - - _Undock - _असंक्षिप्त - - - - DockPluginItemWrapper - - - _Run - _चलाएँ - - - - _Undock - _असंक्षिप्त - - - - DockPluginsSettingWindow - - - Notification Area Settings - अधिसूचना क्षेत्र रूपरेखाएँ - - - - HomeScreen - - - Shutdown - शटडाउन - - - - MainItem - - - Are you sure to uninstall %1? - क्या आप सचमुच %1 को अनइंस्टॉल करना चाहते हैं? - - - - PanelMenu - - - Fashion mode - फ़ैशन मोड - - - - Efficient mode - दक्ष मोड - - - - Classic mode - क्लासिक मोड - - - - Keep showing - दिखाते रहें - - - - Keep hidden - छुपाएं रखें - - - - Smart hide - स्मार्ट हाइड - - - - Notification area settings - सूचना क्षेत्र की सेटिंग्स - - - - TrashPlugin - - - Trash - रद्दी - - - - Empty - खाली - - - \ No newline at end of file diff --git a/translations/dde-dock_hr.ts b/translations/dde-dock_hr.ts deleted file mode 100644 index 05c57e993..000000000 --- a/translations/dde-dock_hr.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Jeste li sigurni da želite isprazniti smeće? - - - - This action cannot be restored - Ova se radnja ne može obnoviti - - - - Cancel - Poništi - - - - Empty - Isprazni - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Sve će zavisnosti biti uklonjene zajedno - - - - Cancel - Poništi - - - - Confirm - Potvrdi - - - - DockLauncherItem - - - Launcher - Pokretač - - - - DockPluginItem - - - _Run - _Pokreni - - - - _Undock - _Ukloni - - - - DockPluginItemWrapper - - - _Run - _Pokreni - - - - _Undock - _Ukloni - - - - DockPluginsSettingWindow - - - Notification Area Settings - Postavke područja obavijesti - - - - HomeScreen - - - Shutdown - Isključi - - - - MainItem - - - Are you sure to uninstall %1? - Jeste li sigurni da želite deinstalirati %1? - - - - PanelMenu - - - Fashion mode - Moderan način - - - - Efficient mode - Učinkoviti način - - - - Classic mode - Klasičan način - - - - Keep showing - Nastavi prikazivati - - - - Keep hidden - Drži skriveno - - - - Smart hide - Pametno skrivanje - - - - Notification area settings - Postavke područja obavijesti - - - - TrashPlugin - - - Trash - Smeće - - - - Empty - Isprazni - - - \ No newline at end of file diff --git a/translations/dde-dock_hu.ts b/translations/dde-dock_hu.ts deleted file mode 100644 index 1c76eb331..000000000 --- a/translations/dde-dock_hu.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Biztosan kiüríti a lomtárat? - - - - This action cannot be restored - Ez a lépés nem visszaállítható - - - - Cancel - Mégsem - - - - Empty - Üres - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Az összes függőség eltávolításra kerül. - - - - Cancel - Mégsem - - - - Confirm - Megerősítés - - - - DockLauncherItem - - - Launcher - Indító - - - - DockPluginItem - - - _Run - _Futtatás - - - - _Undock - _Rögzítés feloldása - - - - DockPluginItemWrapper - - - _Run - _Futtatás - - - - _Undock - _Rögzítés feloldása - - - - DockPluginsSettingWindow - - - Notification Area Settings - Értesítési terület beállítások - - - - HomeScreen - - - Shutdown - Leállítás - - - - MainItem - - - Are you sure to uninstall %1? - Biztos a %1 eltávolításában? - - - - PanelMenu - - - Fashion mode - Divat mód - - - - Efficient mode - Hatékony mód - - - - Classic mode - Klasszikus mód - - - - Keep showing - Mutassa továbbra is - - - - Keep hidden - Maradjon rejtett - - - - Smart hide - Okos elrejtés - - - - Notification area settings - Értesítési terület beállításai - - - - TrashPlugin - - - Trash - Kuka - - - - Empty - Üres - - - \ No newline at end of file diff --git a/translations/dde-dock_id.ts b/translations/dde-dock_id.ts deleted file mode 100644 index 1604df023..000000000 --- a/translations/dde-dock_id.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Anda yakin ingin mengosongkan tempat sampah? - - - - This action cannot be restored - Aksi ini tak dapat dikembalikan - - - - Cancel - Batal - - - - Empty - Kosong - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Semua dependensi akan dihapus - - - - Cancel - Batal - - - - Confirm - Konfirmasi - - - - DockLauncherItem - - - Launcher - Peluncur - - - - DockPluginItem - - - _Run - _Jalankan - - - - _Undock - _Undock - - - - DockPluginItemWrapper - - - _Run - _Jalankan - - - - _Undock - _Undock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Pengaturan Area Notifikasi - - - - HomeScreen - - - Shutdown - Matikan - - - - MainItem - - - Are you sure to uninstall %1? - Anda yakin ingin mencopot pemasangan %1? - - - - PanelMenu - - - Fashion mode - Mode trendi - - - - Efficient mode - Modus efisien - - - - Classic mode - Mode klasik - - - - Keep showing - Tetap tampilkan - - - - Keep hidden - Biarkan tetap tersembunyi - - - - Smart hide - Penyembunyian cerdas - - - - Notification area settings - Pengaturan area notifikasi - - - - TrashPlugin - - - Trash - Tempat sampah - - - - Empty - Kosong - - - \ No newline at end of file diff --git a/translations/dde-dock_it.ts b/translations/dde-dock_it.ts deleted file mode 100644 index dc31a628f..000000000 --- a/translations/dde-dock_it.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Sicuro di voler svuotare il cestino? - - - - This action cannot be restored - Questa azione non può esser ripristinata - - - - Cancel - Cancella - - - - Empty - Vuoto - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Tutte le dipendenze saranno eliminate contemporaneamente - - - - Cancel - Cancella - - - - Confirm - Conferma - - - - DockLauncherItem - - - Launcher - Launcher - - - - DockPluginItem - - - _Run - _Apri - - - - _Undock - _Sblocca - - - - DockPluginItemWrapper - - - _Run - _Apri - - - - _Undock - _Sblocca - - - - DockPluginsSettingWindow - - - Notification Area Settings - Impostazioni Indicatori - - - - HomeScreen - - - Shutdown - Spegni - - - - MainItem - - - Are you sure to uninstall %1? - Sicuro di voler disinstallare %1? - - - - PanelMenu - - - Fashion mode - Fashion mode - - - - Efficient mode - Efficient mode - - - - Classic mode - Classic mode - - - - Keep showing - Mostra sempre - - - - Keep hidden - Nascondi sempre - - - - Smart hide - Smart hide - - - - Notification area settings - Seleziona indicatori - - - - TrashPlugin - - - Trash - Cestino - - - - Empty - Vuoto - - - \ No newline at end of file diff --git a/translations/dde-dock_ja.ts b/translations/dde-dock_ja.ts deleted file mode 100644 index ab91b851b..000000000 --- a/translations/dde-dock_ja.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - 本当にごみ箱を空にしますか? - - - - This action cannot be restored - このアクションは復元できません - - - - Cancel - キャンセル - - - - Empty - - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - 全ての依存関係が一緒に削除されます - - - - Cancel - キャンセル - - - - Confirm - 確認 - - - - DockLauncherItem - - - Launcher - ランチャー - - - - DockPluginItem - - - _Run - 実行 (_R) - - - - _Undock - Dock 解除 (_U) - - - - DockPluginItemWrapper - - - _Run - 実行 (_R) - - - - _Undock - Dock 解除 (_U) - - - - DockPluginsSettingWindow - - - Notification Area Settings - 通知エリア設定 - - - - HomeScreen - - - Shutdown - シャットダウン - - - - MainItem - - - Are you sure to uninstall %1? - 本当に%1をアンインストールしますか? - - - - PanelMenu - - - Fashion mode - ファッションモード - - - - Efficient mode - 効率モード - - - - Classic mode - クラシックモード - - - - Keep showing - 表示したままにする - - - - Keep hidden - 隠したままにする - - - - Smart hide - スマートハイド - - - - Notification area settings - 通知エリアの設定 - - - - TrashPlugin - - - Trash - ゴミ箱 - - - - Empty - - - - \ No newline at end of file diff --git a/translations/dde-dock_ko.ts b/translations/dde-dock_ko.ts deleted file mode 100644 index 9c2c41d0a..000000000 --- a/translations/dde-dock_ko.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - 정말 휴지통을 비우시겠습니까? - - - - This action cannot be restored - 이 동작은 되돌릴 수 없습니다 - - - - Cancel - 취소 - - - - Empty - 비었음 - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - 모든 의존성이 함께 제거됩니다 - - - - Cancel - 취소 - - - - Confirm - 확인 - - - - DockLauncherItem - - - Launcher - 런쳐 - - - - DockPluginItem - - - _Run - 실행(_R) - - - - _Undock - _언도킹 - - - - DockPluginItemWrapper - - - _Run - 실행(_R) - - - - _Undock - _언도킹 - - - - DockPluginsSettingWindow - - - Notification Area Settings - 알림 지역 설정 - - - - HomeScreen - - - Shutdown - 전원 종료 - - - - MainItem - - - Are you sure to uninstall %1? - 정말로 %1(을)를 삭제하시겠습니까? - - - - PanelMenu - - - Fashion mode - 패션(Fashion) 모드 - - - - Efficient mode - 효율 모드 - - - - Classic mode - 클래식 모드 - - - - Keep showing - 계속 보여주기 - - - - Keep hidden - 숨겨두기 - - - - Smart hide - 스마트하이드 - - - - Notification area settings - 알림 영역 설정 - - - - TrashPlugin - - - Trash - 휴지통 - - - - Empty - 비었음 - - - \ No newline at end of file diff --git a/translations/dde-dock_lt.ts b/translations/dde-dock_lt.ts deleted file mode 100644 index 2ad0a0674..000000000 --- a/translations/dde-dock_lt.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Ar tikrai norite ištuštinti šiukšlinę? - - - - This action cannot be restored - Šis veiksmas negalės būti atkurtas - - - - Cancel - Atsisakyti - - - - Empty - Ištuštinti - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Kartu bus pašalintos visos priklausomybės - - - - Cancel - Atsisakyti - - - - Confirm - Patvirtinti - - - - DockLauncherItem - - - Launcher - Leistukas - - - - DockPluginItem - - - _Run - _Vykdyti - - - - _Undock - _Nelaikyti prisegtą - - - - DockPluginItemWrapper - - - _Run - _Vykdyti - - - - _Undock - _Nelaikyti prisegtą - - - - DockPluginsSettingWindow - - - Notification Area Settings - Pranešimų srities nustatymai - - - - HomeScreen - - - Shutdown - Išjungti - - - - MainItem - - - Are you sure to uninstall %1? - Ar tikrai norite pašalinti %1? - - - - PanelMenu - - - Fashion mode - Madinga veiksena - - - - Efficient mode - Efektyvi veiksena - - - - Classic mode - Klasikinė veiksena - - - - Keep showing - Laikyti rodomą - - - - Keep hidden - Laikyti paslėptą - - - - Smart hide - Išmaniai slėpti - - - - Notification area settings - Pranešimų srities nustatymai - - - - TrashPlugin - - - Trash - Šiukšlinė - - - - Empty - Ištuštinti - - - \ No newline at end of file diff --git a/translations/dde-dock_mn.ts b/translations/dde-dock_mn.ts deleted file mode 100644 index c3f148f54..000000000 --- a/translations/dde-dock_mn.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Хогийн савыг хоослохдоо итгэлтэй байна уу - - - - This action cannot be restored - Энэ үйлдэл сэргээгдэх боломжгүй. - - - - Cancel - Цуцлах - - - - Empty - Хоосон - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Харьяалагдах сангууд бүгд устана - - - - Cancel - Цуцлах - - - - Confirm - Батлах - - - - DockLauncherItem - - - Launcher - Нээгч - - - - DockPluginItem - - - _Run - _Эхлүүлэх - - - - _Undock - _Салгах - - - - DockPluginItemWrapper - - - _Run - _Эхлүүлэх - - - - _Undock - _Салгах - - - - DockPluginsSettingWindow - - - Notification Area Settings - Мэдэгдэл хэсгийн тохируулга - - - - HomeScreen - - - Shutdown - Унтраах - - - - MainItem - - - Are you sure to uninstall %1? - %1 -ыг системээс устгахдаа итгэлтэй байна уу? - - - - PanelMenu - - - Fashion mode - Загварлаг горим - - - - Efficient mode - Үр дүнт горим - - - - Classic mode - Сонгодог горим - - - - Keep showing - Үргэлж харуул - - - - Keep hidden - Үргэлж нуулт - - - - Smart hide - Ухаалаг нуулт - - - - Notification area settings - Мэдэгдэл хэсгийн тохируулга - - - - TrashPlugin - - - Trash - Хог - - - - Empty - Хоосон - - - \ No newline at end of file diff --git a/translations/dde-dock_ms.ts b/translations/dde-dock_ms.ts deleted file mode 100644 index baf292c4c..000000000 --- a/translations/dde-dock_ms.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Anda pasti mahu kosongkan tong sampah? - - - - This action cannot be restored - Tindakan ini tidak dapat dipulihkan - - - - Cancel - Batal - - - - Empty - Kosong - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Semua dependensi akan dibuang bersama-sama - - - - Cancel - Batal - - - - Confirm - Sahkan - - - - DockLauncherItem - - - Launcher - Pelancar - - - - DockPluginItem - - - _Run - _Jalan - - - - _Undock - _Nyahlabuh - - - - DockPluginItemWrapper - - - _Run - _Jalan - - - - _Undock - _Nyahlabuh - - - - DockPluginsSettingWindow - - - Notification Area Settings - Tetapan Kawasan Pemberitahuan - - - - HomeScreen - - - Shutdown - Matikan - - - - MainItem - - - Are you sure to uninstall %1? - Anda pasti mahu menyahpasang %1? - - - - PanelMenu - - - Fashion mode - Mod fesyen - - - - Efficient mode - Mod efisyen - - - - Classic mode - Mod klasik - - - - Keep showing - Kekal ditunjukkan - - - - Keep hidden - Kekal tersembunyi - - - - Smart hide - Sembunyi pintar - - - - Notification area settings - Tetapan kawasan pemberitahuan - - - - TrashPlugin - - - Trash - Tong Sampah - - - - Empty - Kosong - - - \ No newline at end of file diff --git a/translations/dde-dock_nb.ts b/translations/dde-dock_nb.ts deleted file mode 100644 index 8d4d22312..000000000 --- a/translations/dde-dock_nb.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Er du sikker på at du vil tømme papirkurven? - - - - This action cannot be restored - Oppgaven kan ikke gjennopprettes - - - - Cancel - Avbryt - - - - Empty - Tomt - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Alle avhengigheter vil bli fjernet - - - - Cancel - Avbryt - - - - Confirm - Bekreft - - - - DockLauncherItem - - - Launcher - Starteren - - - - DockPluginItem - - - _Run - _Kjør - - - - _Undock - Fjern fra dock - - - - DockPluginItemWrapper - - - _Run - _Kjør - - - - _Undock - Fjern fra dock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Innstillinger for varslingsområdet - - - - HomeScreen - - - Shutdown - Avslutte - - - - MainItem - - - Are you sure to uninstall %1? - Er du sikker på at du ønsker å avinstallere %1? - - - - PanelMenu - - - Fashion mode - Motemodus - - - - Efficient mode - Effektivitetsmodus - - - - Classic mode - Klassisk modus - - - - Keep showing - Fortsett å vise - - - - Keep hidden - Behold skjult - - - - Smart hide - Smartskjul - - - - Notification area settings - Innstillinger for Varslingsområdet - - - - TrashPlugin - - - Trash - Søppelboks - - - - Empty - Tomt - - - \ No newline at end of file diff --git a/translations/dde-dock_nl.ts b/translations/dde-dock_nl.ts deleted file mode 100644 index 1aa4795c5..000000000 --- a/translations/dde-dock_nl.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Weet u zeker dat u de prullenbak wilt legen? - - - - This action cannot be restored - Deze actie kan niet ongedaan worden gemaakt - - - - Cancel - Annuleren - - - - Empty - Leeg - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Alle afhankelijkheden zullen tegelijk worden verwijderd - - - - Cancel - Annuleren - - - - Confirm - Bevestigen - - - - DockLauncherItem - - - Launcher - Starter - - - - DockPluginItem - - - _Run - _Uitvoeren - - - - _Undock - _Loskoppelen - - - - DockPluginItemWrapper - - - _Run - _Uitvoeren - - - - _Undock - _Loskoppelen - - - - DockPluginsSettingWindow - - - Notification Area Settings - Meldingsvak-instellingen - - - - HomeScreen - - - Shutdown - Afsluiten - - - - MainItem - - - Are you sure to uninstall %1? - Weet u zeker dat u %1 wilt deïnstalleren? - - - - PanelMenu - - - Fashion mode - Moderne modus - - - - Efficient mode - Efficiënte modus - - - - Classic mode - Klassieke modus - - - - Keep showing - Altijd weergeven - - - - Keep hidden - Altijd verbergen - - - - Smart hide - Slim verbergen - - - - Notification area settings - Meldingsvak-instellingen - - - - TrashPlugin - - - Trash - Prullenbak - - - - Empty - Legen - - - \ No newline at end of file diff --git a/translations/dde-dock_pl.ts b/translations/dde-dock_pl.ts deleted file mode 100644 index cdf7f425e..000000000 --- a/translations/dde-dock_pl.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Czy na pewno chcesz opróżnić kosz? - - - - This action cannot be restored - To działanie nie może być cofnięte - - - - Cancel - Anuluj - - - - Empty - Pusty - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Wszystkie zależności zostaną łącznie usunięte - - - - Cancel - Anuluj - - - - Confirm - Potwierdź - - - - DockLauncherItem - - - Launcher - Aktywator - - - - DockPluginItem - - - _Run - _Uruchom - - - - _Undock - _Odepnij od doku - - - - DockPluginItemWrapper - - - _Run - _Uruchom - - - - _Undock - _Odepnij od doku - - - - DockPluginsSettingWindow - - - Notification Area Settings - Ustawienia obszaru powiadamiania - - - - HomeScreen - - - Shutdown - Wyłącz - - - - MainItem - - - Are you sure to uninstall %1? - Czy na pewno chcesz odinstalować %1? - - - - PanelMenu - - - Fashion mode - Tryb modny - - - - Efficient mode - Tryb wydajny - - - - Classic mode - Tryb klasyczny - - - - Keep showing - Zawsze pokazuj - - - - Keep hidden - Zawsze ukrywaj - - - - Smart hide - Mądre ukrywanie - - - - Notification area settings - Ustawienia obszaru powiadomień - - - - TrashPlugin - - - Trash - Kosz - - - - Empty - Pusty - - - \ No newline at end of file diff --git a/translations/dde-dock_pt.ts b/translations/dde-dock_pt.ts deleted file mode 100644 index c08528373..000000000 --- a/translations/dde-dock_pt.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Tem a certeza que quer esvaziar o lixo? - - - - This action cannot be restored - Esta ação não pode ser restaurada - - - - Cancel - Cancelar - - - - Empty - Vazio - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Todas as dependências serão removidas em conjunto - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lançador - - - - DockPluginItem - - - _Run - _Executar - - - - _Undock - _Remover do Dock - - - - DockPluginItemWrapper - - - _Run - _Executar - - - - _Undock - _Remover do Dock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Definições de Área de Notificação - - - - HomeScreen - - - Shutdown - Encerrar - - - - MainItem - - - Are you sure to uninstall %1? - Tem a certeza que quer desinstalar %1? - - - - PanelMenu - - - Fashion mode - Modo na Moda - - - - Efficient mode - Modo eficiente - - - - Classic mode - Modo clássico - - - - Keep showing - Continuar a mostrar - - - - Keep hidden - Manter escondido - - - - Smart hide - Esconder de forma esperta - - - - Notification area settings - Definições da área de notificação - - - - TrashPlugin - - - Trash - Lixo - - - - Empty - Vazio - - - \ No newline at end of file diff --git a/translations/dde-dock_pt_BR.ts b/translations/dde-dock_pt_BR.ts deleted file mode 100644 index 051021f7b..000000000 --- a/translations/dde-dock_pt_BR.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Deseja esvaziar a lixeira? - - - - This action cannot be restored - Esta ação não pode ser desfeita - - - - Cancel - Cancelar - - - - Empty - Vazio - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Todas as dependências serão removidas - - - - Cancel - Cancelar - - - - Confirm - Confirmar - - - - DockLauncherItem - - - Launcher - Lançador - - - - DockPluginItem - - - _Run - _Executar - - - - _Undock - _Remover da Barra - - - - DockPluginItemWrapper - - - _Run - _Executar - - - - _Undock - _Remover da Barra - - - - DockPluginsSettingWindow - - - Notification Area Settings - Área de Notificação - - - - HomeScreen - - - Shutdown - Desligar - - - - MainItem - - - Are you sure to uninstall %1? - Deseja realmente desinstalar %1? - - - - PanelMenu - - - Fashion mode - Modo Fashion - - - - Efficient mode - Modo Eficiente - - - - Classic mode - Modo Clássico - - - - Keep showing - Manter exibindo - - - - Keep hidden - Manter escondido - - - - Smart hide - Ocultação inteligente - - - - Notification area settings - Configurações da Área de Notificação - - - - TrashPlugin - - - Trash - Lixeira - - - - Empty - Vazia - - - \ No newline at end of file diff --git a/translations/dde-dock_ro.ts b/translations/dde-dock_ro.ts deleted file mode 100644 index 62ac1601a..000000000 --- a/translations/dde-dock_ro.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Sigur goliţi coşul de gunoi? - - - - This action cannot be restored - Această acţiune nu a putut fi restaurată - - - - Cancel - Anulare - - - - Empty - Gol - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Toate dependenţele vor fi îndepărtate - - - - Cancel - Anulare - - - - Confirm - Confirmă - - - - DockLauncherItem - - - Launcher - Lansator - - - - DockPluginItem - - - _Run - _Rulare - - - - _Undock - _Elimină de pe bară - - - - DockPluginItemWrapper - - - _Run - _Rulare - - - - _Undock - _Elimină de pe bară - - - - DockPluginsSettingWindow - - - Notification Area Settings - Setările zonei de notificare - - - - HomeScreen - - - Shutdown - Închide - - - - MainItem - - - Are you sure to uninstall %1? - Sigur dezinstalaţi %1? - - - - PanelMenu - - - Fashion mode - Mod fashion - - - - Efficient mode - Mod eficient - - - - Classic mode - Mod clasic - - - - Keep showing - Continuă afişarea - - - - Keep hidden - Păstraţi ascuns - - - - Smart hide - Ascundere inteligentă - - - - Notification area settings - Setările zonei de notificare - - - - TrashPlugin - - - Trash - Gunoi - - - - Empty - Gol - - - \ No newline at end of file diff --git a/translations/dde-dock_ru.ts b/translations/dde-dock_ru.ts deleted file mode 100644 index 970fe6e9f..000000000 --- a/translations/dde-dock_ru.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Уверены в очистке корзины? - - - - This action cannot be restored - Это действие необратимо - - - - Cancel - Отмена - - - - Empty - Очистить - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Все зависимости будут удалены одновременно - - - - Cancel - Отмена - - - - Confirm - Подтвердить - - - - DockLauncherItem - - - Launcher - Лаунчер - - - - DockPluginItem - - - _Run - _Выполнить - - - - _Undock - _Открепить - - - - DockPluginItemWrapper - - - _Run - _Выполнить - - - - _Undock - _Открепить - - - - DockPluginsSettingWindow - - - Notification Area Settings - Настройки области уведомлений - - - - HomeScreen - - - Shutdown - Выключить - - - - MainItem - - - Are you sure to uninstall %1? - Вы уверены в удалении %1? - - - - PanelMenu - - - Fashion mode - Современный режим - - - - Efficient mode - Эффектный режим - - - - Classic mode - Классический режим - - - - Keep showing - Держать видимым - - - - Keep hidden - Держать скрытым - - - - Smart hide - Умное скрытие - - - - Notification area settings - Настройки области уведомления - - - - TrashPlugin - - - Trash - Корзина - - - - Empty - Очистить - - - \ No newline at end of file diff --git a/translations/dde-dock_sk.ts b/translations/dde-dock_sk.ts deleted file mode 100644 index 6af54770f..000000000 --- a/translations/dde-dock_sk.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Ste si istý, že chcete vymazať kôš? - - - - This action cannot be restored - Táto akcia nepôjde obnoviť - - - - Cancel - Zrušiť - - - - Empty - Prázdny - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Všetky závislosti budú odstránené - - - - Cancel - Zrušiť - - - - Confirm - Potvrdiť - - - - DockLauncherItem - - - Launcher - Spúšťač - - - - DockPluginItem - - - _Run - _Spustiť - - - - _Undock - _Odstrániť z docku - - - - DockPluginItemWrapper - - - _Run - _Spustiť - - - - _Undock - _Odstrániť z docku - - - - DockPluginsSettingWindow - - - Notification Area Settings - Nastavenia upozornení - - - - HomeScreen - - - Shutdown - Vypnúť - - - - MainItem - - - Are you sure to uninstall %1? - Naozaj chcete odinštalovať %1? - - - - PanelMenu - - - Fashion mode - Módny režim - - - - Efficient mode - Efektívny režim - - - - Classic mode - Klasický režim - - - - Keep showing - Ponechať zobrazené - - - - Keep hidden - Ponechať skryté - - - - Smart hide - Inteligentné skrývanie - - - - Notification area settings - Nastavenia upozornení - - - - TrashPlugin - - - Trash - Kôš - - - - Empty - Prázdny - - - \ No newline at end of file diff --git a/translations/dde-dock_sv.ts b/translations/dde-dock_sv.ts deleted file mode 100644 index f473ebd34..000000000 --- a/translations/dde-dock_sv.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Är du säker på att tömma papperskorgen? - - - - This action cannot be restored - Denna åtgärd kan inte återställas - - - - Cancel - Avbryt - - - - Empty - Töm - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Alla beroenden kommer att tas bort tillsammans - - - - Cancel - Avbryt - - - - Confirm - Bekräfta - - - - DockLauncherItem - - - Launcher - Startare - - - - DockPluginItem - - - _Run - _Kör - - - - _Undock - _Avdocka - - - - DockPluginItemWrapper - - - _Run - _Kör - - - - _Undock - _Avdocka - - - - DockPluginsSettingWindow - - - Notification Area Settings - Meddelandefältsinställningar - - - - HomeScreen - - - Shutdown - Stäng av - - - - MainItem - - - Are you sure to uninstall %1? - Vill du verkligen avinstallera %1? - - - - PanelMenu - - - Fashion mode - Modeläge - - - - Efficient mode - Effektivt läge - - - - Classic mode - Klassiskt läge - - - - Keep showing - Fortsätt visa - - - - Keep hidden - Behåll som dolt - - - - Smart hide - Smart dölj - - - - Notification area settings - Meddelandefältsinställningar - - - - TrashPlugin - - - Trash - Papperskorg - - - - Empty - Tom - - - \ No newline at end of file diff --git a/translations/dde-dock_tr.ts b/translations/dde-dock_tr.ts deleted file mode 100644 index 915ed6f1b..000000000 --- a/translations/dde-dock_tr.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Çöp kutusunu boşaltmak istediğinizden emin misiniz? - - - - This action cannot be restored - Bu hareket kurtarılamaz - - - - Cancel - Vazgeç - - - - Empty - Boş - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Tüm bağlılıklar birlikte kaldırılacak - - - - Cancel - Vazgeç - - - - Confirm - Onayla - - - - DockLauncherItem - - - Launcher - Başlatıcı - - - - DockPluginItem - - - _Run - _Run - - - - _Undock - _Undock - - - - DockPluginItemWrapper - - - _Run - _Run - - - - _Undock - _Undock - - - - DockPluginsSettingWindow - - - Notification Area Settings - Bildirim Alanı Ayarları - - - - HomeScreen - - - Shutdown - Kapat - - - - MainItem - - - Are you sure to uninstall %1? - %1'i kaldırmak istediğinizden emin misiniz? - - - - PanelMenu - - - Fashion mode - Moda modu - - - - Efficient mode - Verimli mod - - - - Classic mode - Klasik mod - - - - Keep showing - Göstermeye devam et - - - - Keep hidden - Gizli tut - - - - Smart hide - Akıll gizle - - - - Notification area settings - Bildirim alanı ayarları - - - - TrashPlugin - - - Trash - Çöp - - - - Empty - Boş - - - \ No newline at end of file diff --git a/translations/dde-dock_uk.ts b/translations/dde-dock_uk.ts deleted file mode 100644 index 60e904dc4..000000000 --- a/translations/dde-dock_uk.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Ви впевнені, що хочете очистити кошик? - - - - This action cannot be restored - Цю дію неможливо відновити - - - - Cancel - Скасувати - - - - Empty - Пусто - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Всі залежності будуть видалені разом - - - - Cancel - Скасувати - - - - Confirm - Підтвердити - - - - DockLauncherItem - - - Launcher - Запускач - - - - DockPluginItem - - - _Run - _Виконати - - - - _Undock - _Забрати з панелі - - - - DockPluginItemWrapper - - - _Run - _Виконати - - - - _Undock - _Забрати з панелі - - - - DockPluginsSettingWindow - - - Notification Area Settings - Налаштування Області Сповіщень - - - - HomeScreen - - - Shutdown - Вимкнення - - - - MainItem - - - Are you sure to uninstall %1? - Ви впевнені, що хочете деінсталювати %1? - - - - PanelMenu - - - Fashion mode - Модний режим - - - - Efficient mode - Режим ефективності - - - - Classic mode - Класичний режим - - - - Keep showing - Показувати далі - - - - Keep hidden - Залишати прихованим - - - - Smart hide - Розумне приховування - - - - Notification area settings - Налаштування області повідомлень - - - - TrashPlugin - - - Trash - Смітник - - - - Empty - Порожньо - - - \ No newline at end of file diff --git a/translations/dde-dock_vi.ts b/translations/dde-dock_vi.ts deleted file mode 100644 index 06f92125c..000000000 --- a/translations/dde-dock_vi.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - Bạn có chắc chắn làm sạch rách không? - - - - This action cannot be restored - Hành động này không thể được phục hồi - - - - Cancel - Hủy - - - - Empty - Làm sạch - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - Tất cả phần phụ thuộc sẽ được bỏ theo cùng - - - - Cancel - Hủy - - - - Confirm - Xác nhận - - - - DockLauncherItem - - - Launcher - Khởi chạy - - - - DockPluginItem - - - _Run - _R Chạy - - - - _Undock - _U Tháo ra - - - - DockPluginItemWrapper - - - _Run - _R Chạy - - - - _Undock - _U Tháo ra - - - - DockPluginsSettingWindow - - - Notification Area Settings - Thiết lập Khu vực Thông báo - - - - HomeScreen - - - Shutdown - - - - - MainItem - - - Are you sure to uninstall %1? - Bạn có chắc chắn là gỡ bỏ %1? - - - - PanelMenu - - - Fashion mode - Dạng thời trang - - - - Efficient mode - Dạng hiệu quả - - - - Classic mode - Dạng cổ điển - - - - Keep showing - Tiếp tục hiện - - - - Keep hidden - Tiếp tục ẩn - - - - Smart hide - Ẩn thông minh - - - - Notification area settings - Những thiết lập khu vực thông báo - - - - TrashPlugin - - - Trash - Thùng rác - - - - Empty - Làm sạch - - - \ No newline at end of file diff --git a/translations/dde-dock_zh_CN.ts b/translations/dde-dock_zh_CN.ts deleted file mode 100644 index e91c8c95b..000000000 --- a/translations/dde-dock_zh_CN.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - 您确定要彻底清空回收站吗? - - - - This action cannot be restored - 此操作不可恢复 - - - - Cancel - 取消 - - - - Empty - 清空 - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - 所有依赖也会被一起移除 - - - - Cancel - 取消 - - - - Confirm - 卸载 - - - - DockLauncherItem - - - Launcher - 启动器 - - - - DockPluginItem - - - _Run - 运行(_R) - - - - _Undock - 移除驻留(_U) - - - - DockPluginItemWrapper - - - _Run - 运行(_R) - - - - _Undock - 移除驻留(_U) - - - - DockPluginsSettingWindow - - - Notification Area Settings - 通知区域设置 - - - - HomeScreen - - - Shutdown - 关机 - - - - MainItem - - - Are you sure to uninstall %1? - 您确定要卸载 %1 吗? - - - - PanelMenu - - - Fashion mode - 时尚模式 - - - - Efficient mode - 高效模式 - - - - Classic mode - 经典模式 - - - - Keep showing - 一直显示 - - - - Keep hidden - 一直隐藏 - - - - Smart hide - 智能隐藏 - - - - Notification area settings - 通知区域设置 - - - - TrashPlugin - - - Trash - 回收站 - - - - Empty - 清空 - - - \ No newline at end of file diff --git a/translations/dde-dock_zh_HK.ts b/translations/dde-dock_zh_HK.ts deleted file mode 100644 index 5f8e1d6bb..000000000 --- a/translations/dde-dock_zh_HK.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - 你確定要清空垃圾筒嗎? - - - - This action cannot be restored - 這個動作不可復原 - - - - Cancel - 取消 - - - - Empty - 清空 - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - 所有相關內容將會一併刪除 - - - - Cancel - 取消 - - - - Confirm - 確認 - - - - DockLauncherItem - - - Launcher - 啟動器 - - - - DockPluginItem - - - _Run - 執行 _R - - - - _Undock - 解除放在快速工具列 _U - - - - DockPluginItemWrapper - - - _Run - 執行 _R - - - - _Undock - 解除放在快速工具列 _U - - - - DockPluginsSettingWindow - - - Notification Area Settings - 通知區設定 - - - - HomeScreen - - - Shutdown - 關機 - - - - MainItem - - - Are you sure to uninstall %1? - 你確定要解除安裝 %1 嗎? - - - - PanelMenu - - - Fashion mode - 時尚模式 - - - - Efficient mode - 高效模式 - - - - Classic mode - 經典模式 - - - - Keep showing - 持續顯示 - - - - Keep hidden - 持續隱藏 - - - - Smart hide - 智慧隱藏 - - - - Notification area settings - 通知區設定 - - - - TrashPlugin - - - Trash - 垃圾桶 - - - - Empty - 清空 - - - \ No newline at end of file diff --git a/translations/dde-dock_zh_TW.ts b/translations/dde-dock_zh_TW.ts deleted file mode 100644 index c24323f41..000000000 --- a/translations/dde-dock_zh_TW.ts +++ /dev/null @@ -1,152 +0,0 @@ - - - ClearTrashDialog - - - Are you sure to empty trash? - 你確定要清空垃圾 ? - - - - This action cannot be restored - 此動作無法復原 - - - - Cancel - 取消 - - - - Empty - 空白 - - - - ConfirmUninstallDialog - - - All dependencies will be removed together - 所有相關內容將會一併刪除 - - - - Cancel - 取消 - - - - Confirm - 確定 - - - - DockLauncherItem - - - Launcher - 啟動器 - - - - DockPluginItem - - - _Run - 執行 (_R) - - - - _Undock - 取消停駐(_U) - - - - DockPluginItemWrapper - - - _Run - 執行 (_R) - - - - _Undock - 取消停駐(_U) - - - - DockPluginsSettingWindow - - - Notification Area Settings - 系統匣設定 - - - - HomeScreen - - - Shutdown - 關機 - - - - MainItem - - - Are you sure to uninstall %1? - 你確定要解除安裝 %1 ? - - - - PanelMenu - - - Fashion mode - 時尚模式 - - - - Efficient mode - 高效率模式 - - - - Classic mode - 經典模式 - - - - Keep showing - 持續顯示 - - - - Keep hidden - 持續隱藏 - - - - Smart hide - 智慧隱藏 - - - - Notification area settings - 系統匣設定 - - - - TrashPlugin - - - Trash - 回收桶 - - - - Empty - 空白 - - - \ No newline at end of file diff --git a/window/mainwindow.cpp b/window/mainwindow.cpp new file mode 100644 index 000000000..abd0e39ed --- /dev/null +++ b/window/mainwindow.cpp @@ -0,0 +1,8 @@ +#include "mainwindow.h" + +#include + +MainWindow::MainWindow(QWidget *parent) + : QWidget(parent) +{ +} diff --git a/window/mainwindow.h b/window/mainwindow.h new file mode 100644 index 000000000..0b92435dc --- /dev/null +++ b/window/mainwindow.h @@ -0,0 +1,14 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +class MainWindow : public QWidget +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); +}; + +#endif // MAINWINDOW_H diff --git a/dde-dock/libs/xcb_misc.cpp b/xcb/xcb_misc.cpp similarity index 100% rename from dde-dock/libs/xcb_misc.cpp rename to xcb/xcb_misc.cpp diff --git a/dde-dock/libs/xcb_misc.h b/xcb/xcb_misc.h similarity index 100% rename from dde-dock/libs/xcb_misc.h rename to xcb/xcb_misc.h